From: Greg Kroah-Hartman Date: Fri, 10 Mar 2023 13:05:50 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v6.1.17~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba84085518b678b0cfacda450a79f7b5ee081b96;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-stable patches added patches: malidp-fix-null-vs-is_err-checking.patch revert-scsi-mpt3sas-fix-return-value-check-of-dma_get_required_mask.patch scsi-mpt3sas-don-t-change-dma-mask-while-reallocating-pools.patch scsi-mpt3sas-re-do-lost-mpt3sas-dma-mask-fix.patch scsi-mpt3sas-remove-usage-of-dma_get_required_mask-api.patch --- diff --git a/queue-5.15/malidp-fix-null-vs-is_err-checking.patch b/queue-5.15/malidp-fix-null-vs-is_err-checking.patch new file mode 100644 index 00000000000..1c9137203fa --- /dev/null +++ b/queue-5.15/malidp-fix-null-vs-is_err-checking.patch @@ -0,0 +1,32 @@ +From 15342f930ebebcfe36f2415049736a77d7d2e045 Mon Sep 17 00:00:00 2001 +From: Miaoqian Lin +Date: Mon, 13 Dec 2021 07:21:15 +0000 +Subject: malidp: Fix NULL vs IS_ERR() checking + +From: Miaoqian Lin + +commit 15342f930ebebcfe36f2415049736a77d7d2e045 upstream. + +The get_sg_table() function does not return NULL. +It returns error pointers. + +Signed-off-by: Miaoqian Lin +Signed-off-by: Liviu Dudau +Link: https://lore.kernel.org/dri-devel/20211213072115.18098-1-linmq006@gmail.com/ +Signed-off-by: Stefan Ghinea +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/arm/malidp_planes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/arm/malidp_planes.c ++++ b/drivers/gpu/drm/arm/malidp_planes.c +@@ -348,7 +348,7 @@ static bool malidp_check_pages_threshold + else + sgt = obj->funcs->get_sg_table(obj); + +- if (!sgt) ++ if (IS_ERR(sgt)) + return false; + + sgl = sgt->sgl; diff --git a/queue-5.15/revert-scsi-mpt3sas-fix-return-value-check-of-dma_get_required_mask.patch b/queue-5.15/revert-scsi-mpt3sas-fix-return-value-check-of-dma_get_required_mask.patch new file mode 100644 index 00000000000..5a2378dd9eb --- /dev/null +++ b/queue-5.15/revert-scsi-mpt3sas-fix-return-value-check-of-dma_get_required_mask.patch @@ -0,0 +1,38 @@ +From 6ac451d8d12b4309b523b600449bb2f4494ac5bb Mon Sep 17 00:00:00 2001 +From: Salvatore Bonaccorso +Date: Wed, 8 Mar 2023 17:14:56 +0100 +Subject: Revert "scsi: mpt3sas: Fix return value check of dma_get_required_mask()" + +From: Salvatore Bonaccorso + +This reverts commit e0e0747de0ea3dd87cdbb0393311e17471a9baf1. + +As noted in 1a2dcbdde82e ("scsi: mpt3sas: re-do lost mpt3sas DMA mask +fix") in mainline there was a mis-merge in commit 62e6e5940c0c ("Merge +tag 'scsi-misc' of +git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi"). causing that +the fix needed to be redone later on again. To make series of patches +apply cleanly to the stable series where e0e0747de0ea ("scsi: mpt3sas: +Fix return value check of dma_get_required_mask()") was backported, +revert the aforementioned commit. + +No upstream commit exists for this commit. + +Link: https://lore.kernel.org/regressions/yq1sfehmjnb.fsf@ca-mkp.ca.oracle.com/ +Signed-off-by: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -2993,7 +2993,7 @@ _base_config_dma_addressing(struct MPT3S + + if (ioc->is_mcpu_endpoint || + sizeof(dma_addr_t) == 4 || ioc->use_32bit_dma || +- dma_get_required_mask(&pdev->dev) <= DMA_BIT_MASK(32)) ++ dma_get_required_mask(&pdev->dev) <= 32) + ioc->dma_mask = 32; + /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */ + else if (ioc->hba_mpi_version_belonged > MPI2_VERSION) diff --git a/queue-5.15/scsi-mpt3sas-don-t-change-dma-mask-while-reallocating-pools.patch b/queue-5.15/scsi-mpt3sas-don-t-change-dma-mask-while-reallocating-pools.patch new file mode 100644 index 00000000000..76116705fb6 --- /dev/null +++ b/queue-5.15/scsi-mpt3sas-don-t-change-dma-mask-while-reallocating-pools.patch @@ -0,0 +1,58 @@ +From 7e4f02c0747d8713735098ddb9744bd30f0903af Mon Sep 17 00:00:00 2001 +From: Sreekanth Reddy +Date: Thu, 25 Aug 2022 13:24:54 +0530 +Subject: scsi: mpt3sas: Don't change DMA mask while reallocating pools + +From: Sreekanth Reddy + +commit 9df650963bf6d6c2c3fcd325d8c44ca2b99554fe upstream. + +When a pool crosses the 4GB boundary region then before reallocating pools +change the coherent DMA mask to 32 bits and keep the normal DMA mask set to +63/64 bits. + +Link: https://lore.kernel.org/r/20220825075457.16422-2-sreekanth.reddy@broadcom.com +Signed-off-by: Sreekanth Reddy +Signed-off-by: Martin K. Petersen +Signed-off-by: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -2990,19 +2990,26 @@ static int + _base_config_dma_addressing(struct MPT3SAS_ADAPTER *ioc, struct pci_dev *pdev) + { + struct sysinfo s; ++ u64 coherent_dma_mask, dma_mask; + +- if (ioc->is_mcpu_endpoint || +- sizeof(dma_addr_t) == 4 || ioc->use_32bit_dma || +- dma_get_required_mask(&pdev->dev) <= 32) ++ if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4 || ++ dma_get_required_mask(&pdev->dev) <= 32) { + ioc->dma_mask = 32; ++ coherent_dma_mask = dma_mask = DMA_BIT_MASK(32); + /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */ +- else if (ioc->hba_mpi_version_belonged > MPI2_VERSION) ++ } else if (ioc->hba_mpi_version_belonged > MPI2_VERSION) { + ioc->dma_mask = 63; +- else ++ coherent_dma_mask = dma_mask = DMA_BIT_MASK(63); ++ } else { + ioc->dma_mask = 64; ++ coherent_dma_mask = dma_mask = DMA_BIT_MASK(64); ++ } + +- if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(ioc->dma_mask)) || +- dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(ioc->dma_mask))) ++ if (ioc->use_32bit_dma) ++ coherent_dma_mask = DMA_BIT_MASK(32); ++ ++ if (dma_set_mask(&pdev->dev, dma_mask) || ++ dma_set_coherent_mask(&pdev->dev, coherent_dma_mask)) + return -ENODEV; + + if (ioc->dma_mask > 32) { diff --git a/queue-5.15/scsi-mpt3sas-re-do-lost-mpt3sas-dma-mask-fix.patch b/queue-5.15/scsi-mpt3sas-re-do-lost-mpt3sas-dma-mask-fix.patch new file mode 100644 index 00000000000..ed5979b43b4 --- /dev/null +++ b/queue-5.15/scsi-mpt3sas-re-do-lost-mpt3sas-dma-mask-fix.patch @@ -0,0 +1,51 @@ +From 2de98253a5e5f612b4dd3991eaf12da2f87fd835 Mon Sep 17 00:00:00 2001 +From: Sreekanth Reddy +Date: Tue, 13 Sep 2022 17:35:38 +0530 +Subject: scsi: mpt3sas: re-do lost mpt3sas DMA mask fix + +From: Sreekanth Reddy + +commit 1a2dcbdde82e3a5f1db9b2f4c48aa1aeba534fb2 upstream. + +This is a re-do of commit e0e0747de0ea ("scsi: mpt3sas: Fix return value +check of dma_get_required_mask()"), which I ended up undoing in a +mis-merge in commit 62e6e5940c0c ("Merge tag 'scsi-misc' of +git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi"). + +The original commit message was + + scsi: mpt3sas: Fix return value check of dma_get_required_mask() + + Fix the incorrect return value check of dma_get_required_mask(). Due to + this incorrect check, the driver was always setting the DMA mask to 63 bit. + + Link: https://lore.kernel.org/r/20220913120538.18759-2-sreekanth.reddy@broadcom.com + Fixes: ba27c5cf286d ("scsi: mpt3sas: Don't change the DMA coherent mask after allocations") + Signed-off-by: Sreekanth Reddy + Signed-off-by: Martin K. Petersen + +and this fix was lost when I mis-merged the conflict with commit +9df650963bf6 ("scsi: mpt3sas: Don't change DMA mask while reallocating +pools"). + +Reported-by: Juergen Gross +Fixes: 62e6e5940c0c ("Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi") +Link: https://lore.kernel.org/all/CAHk-=wjaK-TxrNaGtFDpL9qNHL1MVkWXO1TT6vObD5tXMSC4Zg@mail.gmail.com +Signed-off-by: Linus Torvalds +Signed-off-by: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -2993,7 +2993,7 @@ _base_config_dma_addressing(struct MPT3S + u64 coherent_dma_mask, dma_mask; + + if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4 || +- dma_get_required_mask(&pdev->dev) <= 32) { ++ dma_get_required_mask(&pdev->dev) <= DMA_BIT_MASK(32)) { + ioc->dma_mask = 32; + coherent_dma_mask = dma_mask = DMA_BIT_MASK(32); + /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */ diff --git a/queue-5.15/scsi-mpt3sas-remove-usage-of-dma_get_required_mask-api.patch b/queue-5.15/scsi-mpt3sas-remove-usage-of-dma_get_required_mask-api.patch new file mode 100644 index 00000000000..7066b3da63a --- /dev/null +++ b/queue-5.15/scsi-mpt3sas-remove-usage-of-dma_get_required_mask-api.patch @@ -0,0 +1,34 @@ +From 7f67a3498048f7e5be3dc5e8b32eebda115d409f Mon Sep 17 00:00:00 2001 +From: Sreekanth Reddy +Date: Fri, 28 Oct 2022 14:46:55 +0530 +Subject: scsi: mpt3sas: Remove usage of dma_get_required_mask() API + +From: Sreekanth Reddy + +commit 06e472acf964649a58b7de35fc9cdc3151acb970 upstream. + +Remove the usage of dma_get_required_mask() API. Directly set the DMA mask +to 63/64 if the system is a 64bit machine. + +Signed-off-by: Sreekanth Reddy +Link: https://lore.kernel.org/r/20221028091655.17741-2-sreekanth.reddy@broadcom.com +Reviewed-by: Christoph Hellwig +Signed-off-by: Martin K. Petersen +Signed-off-by: Salvatore Bonaccorso +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/mpt3sas/mpt3sas_base.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/scsi/mpt3sas/mpt3sas_base.c ++++ b/drivers/scsi/mpt3sas/mpt3sas_base.c +@@ -2992,8 +2992,7 @@ _base_config_dma_addressing(struct MPT3S + struct sysinfo s; + u64 coherent_dma_mask, dma_mask; + +- if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4 || +- dma_get_required_mask(&pdev->dev) <= DMA_BIT_MASK(32)) { ++ if (ioc->is_mcpu_endpoint || sizeof(dma_addr_t) == 4) { + ioc->dma_mask = 32; + coherent_dma_mask = dma_mask = DMA_BIT_MASK(32); + /* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */ diff --git a/queue-5.15/series b/queue-5.15/series index 4ad186dd634..e478910b7d6 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -128,3 +128,8 @@ drm-display-dp_mst-fix-down-message-handling-after-a-packet-reception-error.patc bluetooth-hci_sock-purge-socket-queues-in-the-destruct-callback.patch media-uvcvideo-fix-race-condition-with-usb_kill_urb.patch drm-virtio-fix-error-code-in-virtio_gpu_object_shmem_init.patch +revert-scsi-mpt3sas-fix-return-value-check-of-dma_get_required_mask.patch +scsi-mpt3sas-don-t-change-dma-mask-while-reallocating-pools.patch +scsi-mpt3sas-re-do-lost-mpt3sas-dma-mask-fix.patch +scsi-mpt3sas-remove-usage-of-dma_get_required_mask-api.patch +malidp-fix-null-vs-is_err-checking.patch