From 015d72b51f34c12be37551d613eb3a17eabbdfe4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 24 Jul 2023 08:51:38 +0200 Subject: [PATCH] 6.4-stable patches added patches: scsi-sg-don-t-grab-scsi-host-module-reference.patch spi-dw-remove-misleading-comment-for-mount-evans-soc.patch --- ...on-t-grab-scsi-host-module-reference.patch | 69 +++++++++++++++++++ queue-6.4/series | 2 + ...sleading-comment-for-mount-evans-soc.patch | 41 +++++++++++ 3 files changed, 112 insertions(+) create mode 100644 queue-6.4/scsi-sg-don-t-grab-scsi-host-module-reference.patch create mode 100644 queue-6.4/spi-dw-remove-misleading-comment-for-mount-evans-soc.patch diff --git a/queue-6.4/scsi-sg-don-t-grab-scsi-host-module-reference.patch b/queue-6.4/scsi-sg-don-t-grab-scsi-host-module-reference.patch new file mode 100644 index 00000000000..c0f5e846269 --- /dev/null +++ b/queue-6.4/scsi-sg-don-t-grab-scsi-host-module-reference.patch @@ -0,0 +1,69 @@ +From fcaa174a9c995cf0af3967e55644a1543ea07e36 Mon Sep 17 00:00:00 2001 +From: Yu Kuai +Date: Thu, 22 Jun 2023 00:01:11 +0800 +Subject: scsi/sg: don't grab scsi host module reference + +From: Yu Kuai + +commit fcaa174a9c995cf0af3967e55644a1543ea07e36 upstream. + +In order to prevent request_queue to be freed before cleaning up +blktrace debugfs entries, commit db59133e9279 ("scsi: sg: fix blktrace +debugfs entries leakage") use scsi_device_get(), however, +scsi_device_get() will also grab scsi module reference and scsi module +can't be removed. + +It's reported that blktests can't unload scsi_debug after block/001: + +blktests (master) # ./check block +block/001 (stress device hotplugging) [failed] + +++ /root/blktests/results/nodev/block/001.out.bad 2023-06-19 + Running block/001 + Stressing sd + +modprobe: FATAL: Module scsi_debug is in use. + +Fix this problem by grabbing request_queue reference directly, so that +scsi host module can still be unloaded while request_queue will be +pinged by sg device. + +Reported-by: Chaitanya Kulkarni +Link: https://lore.kernel.org/all/1760da91-876d-fc9c-ab51-999a6f66ad50@nvidia.com/ +Fixes: db59133e9279 ("scsi: sg: fix blktrace debugfs entries leakage") +Signed-off-by: Yu Kuai +Reviewed-by: Christoph Hellwig +Link: https://lore.kernel.org/r/20230621160111.1433521-1-yukuai1@huaweicloud.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/sg.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/scsi/sg.c ++++ b/drivers/scsi/sg.c +@@ -1496,7 +1496,7 @@ sg_add_device(struct device *cl_dev) + int error; + unsigned long iflags; + +- error = scsi_device_get(scsidp); ++ error = blk_get_queue(scsidp->request_queue); + if (error) + return error; + +@@ -1557,7 +1557,7 @@ cdev_add_err: + out: + if (cdev) + cdev_del(cdev); +- scsi_device_put(scsidp); ++ blk_put_queue(scsidp->request_queue); + return error; + } + +@@ -1574,7 +1574,7 @@ sg_device_destroy(struct kref *kref) + */ + + blk_trace_remove(q); +- scsi_device_put(sdp->device); ++ blk_put_queue(q); + + write_lock_irqsave(&sg_index_lock, flags); + idr_remove(&sg_index_idr, sdp->index); diff --git a/queue-6.4/series b/queue-6.4/series index 62f2826a89b..206b76bad0a 100644 --- a/queue-6.4/series +++ b/queue-6.4/series @@ -221,3 +221,5 @@ jbd2-recheck-chechpointing-non-dirty-buffer.patch kbuild-rust-avoid-creating-temporary-files.patch tracing-histograms-return-an-error-if-we-fail-to-add-histogram-to-hist_vars-list.patch drm-ttm-fix-bulk_move-corruption-when-adding-a-entry.patch +spi-dw-remove-misleading-comment-for-mount-evans-soc.patch +scsi-sg-don-t-grab-scsi-host-module-reference.patch diff --git a/queue-6.4/spi-dw-remove-misleading-comment-for-mount-evans-soc.patch b/queue-6.4/spi-dw-remove-misleading-comment-for-mount-evans-soc.patch new file mode 100644 index 00000000000..95194c927c4 --- /dev/null +++ b/queue-6.4/spi-dw-remove-misleading-comment-for-mount-evans-soc.patch @@ -0,0 +1,41 @@ +From 5b6d0b91f84cff3f28724076f93f6f9e2ef8d775 Mon Sep 17 00:00:00 2001 +From: Abe Kohandel +Date: Tue, 6 Jun 2023 16:18:44 -0700 +Subject: spi: dw: Remove misleading comment for Mount Evans SoC + +From: Abe Kohandel + +commit 5b6d0b91f84cff3f28724076f93f6f9e2ef8d775 upstream. + +Remove a misleading comment about the DMA operations of the Intel Mount +Evans SoC's SPI Controller as requested by Serge. + +Signed-off-by: Abe Kohandel +Link: https://lore.kernel.org/linux-spi/20230606191333.247ucbf7h3tlooxf@mobilestation/ +Fixes: 0760d5d0e9f0 ("spi: dw: Add compatible for Intel Mount Evans SoC") +Reviewed-by: Serge Semin +Link: https://lore.kernel.org/r/20230606231844.726272-1-abe.kohandel@intel.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/spi/spi-dw-mmio.c | 9 +-------- + 1 file changed, 1 insertion(+), 8 deletions(-) + +--- a/drivers/spi/spi-dw-mmio.c ++++ b/drivers/spi/spi-dw-mmio.c +@@ -237,14 +237,7 @@ static int dw_spi_intel_init(struct plat + } + + /* +- * The Intel Mount Evans SoC's Integrated Management Complex uses the +- * SPI controller for access to a NOR SPI FLASH. However, the SoC doesn't +- * provide a mechanism to override the native chip select signal. +- * +- * This driver doesn't use DMA for memory operations when a chip select +- * override is not provided due to the native chip select timing behavior. +- * As a result no DMA configuration is done for the controller and this +- * configuration is not tested. ++ * DMA-based mem ops are not configured for this device and are not tested. + */ + static int dw_spi_mountevans_imc_init(struct platform_device *pdev, + struct dw_spi_mmio *dwsmmio) -- 2.47.3