From: Sasha Levin Date: Mon, 5 Jul 2021 01:54:00 +0000 (-0400) Subject: Fixes for 5.12 X-Git-Tag: v5.13.1~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b69f03fd939b704d524506765213c75cbc7ae49;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.12 Signed-off-by: Sasha Levin --- diff --git a/queue-5.12/drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch b/queue-5.12/drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch new file mode 100644 index 00000000000..3026919e20e --- /dev/null +++ b/queue-5.12/drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch @@ -0,0 +1,47 @@ +From 0c64b634ee4fb8f4ba28e190277a26cdb7630c0d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 11 Jun 2021 14:34:50 +0200 +Subject: drm/nouveau: fix dma_address check for CPU/GPU sync +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +[ Upstream commit d330099115597bbc238d6758a4930e72b49ea9ba ] + +AGP for example doesn't have a dma_address array. + +Signed-off-by: Christian König +Acked-by: Alex Deucher +Link: https://patchwork.freedesktop.org/patch/msgid/20210614110517.1624-1-christian.koenig@amd.com +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/nouveau/nouveau_bo.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c +index f2720a006199..0a47a2a5553d 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_bo.c ++++ b/drivers/gpu/drm/nouveau/nouveau_bo.c +@@ -549,7 +549,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) + struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm; + int i, j; + +- if (!ttm_dma) ++ if (!ttm_dma || !ttm_dma->dma_address) + return; + if (!ttm_dma->pages) { + NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma); +@@ -585,7 +585,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) + struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm; + int i, j; + +- if (!ttm_dma) ++ if (!ttm_dma || !ttm_dma->dma_address) + return; + if (!ttm_dma->pages) { + NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma); +-- +2.30.2 + diff --git a/queue-5.12/gpio-amd8111-and-tqmx86-require-has_ioport_map.patch b/queue-5.12/gpio-amd8111-and-tqmx86-require-has_ioport_map.patch new file mode 100644 index 00000000000..256007457ab --- /dev/null +++ b/queue-5.12/gpio-amd8111-and-tqmx86-require-has_ioport_map.patch @@ -0,0 +1,45 @@ +From 81c332ac63b02a784d4cdd36c8186128c66f6cf3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 25 Jun 2021 10:37:34 +0200 +Subject: gpio: AMD8111 and TQMX86 require HAS_IOPORT_MAP + +From: Johannes Berg + +[ Upstream commit c6414e1a2bd26b0071e2b9d6034621f705dfd4c0 ] + +Both of these drivers use ioport_map(), so they need to +depend on HAS_IOPORT_MAP. Otherwise, they cannot be built +even with COMPILE_TEST on architectures without an ioport +implementation, such as ARCH=um. + +Reported-by: kernel test robot +Signed-off-by: Johannes Berg +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/Kconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig +index e3607ec4c2e8..fb365aef336b 100644 +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -1361,6 +1361,7 @@ config GPIO_TPS68470 + config GPIO_TQMX86 + tristate "TQ-Systems QTMX86 GPIO" + depends on MFD_TQMX86 || COMPILE_TEST ++ depends on HAS_IOPORT_MAP + select GPIOLIB_IRQCHIP + help + This driver supports GPIO on the TQMX86 IO controller. +@@ -1428,6 +1429,7 @@ menu "PCI GPIO expanders" + config GPIO_AMD8111 + tristate "AMD 8111 GPIO driver" + depends on X86 || COMPILE_TEST ++ depends on HAS_IOPORT_MAP + help + The AMD 8111 south bridge contains 32 GPIO pins which can be used. + +-- +2.30.2 + diff --git a/queue-5.12/gpio-mxc-fix-disabled-interrupt-wake-up-support.patch b/queue-5.12/gpio-mxc-fix-disabled-interrupt-wake-up-support.patch new file mode 100644 index 00000000000..bc513dbc50e --- /dev/null +++ b/queue-5.12/gpio-mxc-fix-disabled-interrupt-wake-up-support.patch @@ -0,0 +1,41 @@ +From d903eef1371300bd1f979729ecaab93bc28e8922 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 17 Jun 2021 15:54:13 +0200 +Subject: gpio: mxc: Fix disabled interrupt wake-up support + +From: Loic Poulain + +[ Upstream commit 3093e6cca3ba7d47848068cb256c489675125181 ] + +A disabled/masked interrupt marked as wakeup source must be re-enable +and unmasked in order to be able to wake-up the host. That can be done +by flaging the irqchip with IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND. + +Note: It 'sometimes' works without that change, but only thanks to the +lazy generic interrupt disabling (keeping interrupt unmasked). + +Reported-by: Michal Koziel +Signed-off-by: Loic Poulain +Reviewed-by: Linus Walleij +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/gpio/gpio-mxc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c +index 157106e1e438..b9fdf05d7669 100644 +--- a/drivers/gpio/gpio-mxc.c ++++ b/drivers/gpio/gpio-mxc.c +@@ -334,7 +334,7 @@ static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base) + ct->chip.irq_unmask = irq_gc_mask_set_bit; + ct->chip.irq_set_type = gpio_set_irq_type; + ct->chip.irq_set_wake = gpio_set_wake_irq; +- ct->chip.flags = IRQCHIP_MASK_ON_SUSPEND; ++ ct->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND; + ct->regs.ack = GPIO_ISR; + ct->regs.mask = GPIO_IMR; + +-- +2.30.2 + diff --git a/queue-5.12/s390-vfio-ap-clean-up-mdev-resources-when-remove-cal.patch b/queue-5.12/s390-vfio-ap-clean-up-mdev-resources-when-remove-cal.patch new file mode 100644 index 00000000000..899e09d104e --- /dev/null +++ b/queue-5.12/s390-vfio-ap-clean-up-mdev-resources-when-remove-cal.patch @@ -0,0 +1,59 @@ +From de1b69d06767303eebe89f4b035bdc6c37146856 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Jun 2021 18:46:32 -0400 +Subject: s390/vfio-ap: clean up mdev resources when remove callback invoked + +From: Tony Krowiak + +[ Upstream commit 8c0795d2a0f50e2b131f5b2a8c2795939a94058e ] + +The mdev remove callback for the vfio_ap device driver bails out with +-EBUSY if the mdev is in use by a KVM guest (i.e., the KVM pointer in the +struct ap_matrix_mdev is not NULL). The intended purpose was +to prevent the mdev from being removed while in use. There are two +problems with this scenario: + +1. Returning a non-zero return code from the remove callback does not + prevent the removal of the mdev. + +2. The KVM pointer in the struct ap_matrix_mdev will always be NULL because + the remove callback will not get invoked until the mdev fd is closed. + When the mdev fd is closed, the mdev release callback is invoked and + clears the KVM pointer from the struct ap_matrix_mdev. + +Let's go ahead and remove the check for KVM in the remove callback and +allow the cleanup of mdev resources to proceed. + +Signed-off-by: Tony Krowiak +Reviewed-by: Jason Gunthorpe +Link: https://lore.kernel.org/r/20210609224634.575156-2-akrowiak@linux.ibm.com +Signed-off-by: Vasily Gorbik +Signed-off-by: Sasha Levin +--- + drivers/s390/crypto/vfio_ap_ops.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/drivers/s390/crypto/vfio_ap_ops.c b/drivers/s390/crypto/vfio_ap_ops.c +index 6946a7e26eff..ef5e792c665f 100644 +--- a/drivers/s390/crypto/vfio_ap_ops.c ++++ b/drivers/s390/crypto/vfio_ap_ops.c +@@ -366,16 +366,6 @@ static int vfio_ap_mdev_remove(struct mdev_device *mdev) + struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev); + + mutex_lock(&matrix_dev->lock); +- +- /* +- * If the KVM pointer is in flux or the guest is running, disallow +- * un-assignment of control domain. +- */ +- if (matrix_mdev->kvm_busy || matrix_mdev->kvm) { +- mutex_unlock(&matrix_dev->lock); +- return -EBUSY; +- } +- + vfio_ap_mdev_reset_queues(mdev); + list_del(&matrix_mdev->node); + kfree(matrix_mdev); +-- +2.30.2 + diff --git a/queue-5.12/scsi-sr-return-appropriate-error-code-when-disk-is-e.patch b/queue-5.12/scsi-sr-return-appropriate-error-code-when-disk-is-e.patch new file mode 100644 index 00000000000..c6ed3f05c32 --- /dev/null +++ b/queue-5.12/scsi-sr-return-appropriate-error-code-when-disk-is-e.patch @@ -0,0 +1,37 @@ +From 4c669d4b8332b1748be127a15807c92128f422bc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 11 Jun 2021 17:44:02 +0800 +Subject: scsi: sr: Return appropriate error code when disk is ejected + +From: ManYi Li + +[ Upstream commit 7dd753ca59d6c8cc09aa1ed24f7657524803c7f3 ] + +Handle a reported media event code of 3. This indicates that the media has +been removed from the drive and user intervention is required to proceed. +Return DISK_EVENT_EJECT_REQUEST in that case. + +Link: https://lore.kernel.org/r/20210611094402.23884-1-limanyi@uniontech.com +Signed-off-by: ManYi Li +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/sr.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c +index e4633b84c556..7815ed642d43 100644 +--- a/drivers/scsi/sr.c ++++ b/drivers/scsi/sr.c +@@ -220,6 +220,8 @@ static unsigned int sr_get_events(struct scsi_device *sdev) + return DISK_EVENT_EJECT_REQUEST; + else if (med->media_event_code == 2) + return DISK_EVENT_MEDIA_CHANGE; ++ else if (med->media_event_code == 3) ++ return DISK_EVENT_EJECT_REQUEST; + return 0; + } + +-- +2.30.2 + diff --git a/queue-5.12/series b/queue-5.12/series new file mode 100644 index 00000000000..7058b8f1c8b --- /dev/null +++ b/queue-5.12/series @@ -0,0 +1,5 @@ +scsi-sr-return-appropriate-error-code-when-disk-is-e.patch +s390-vfio-ap-clean-up-mdev-resources-when-remove-cal.patch +gpio-mxc-fix-disabled-interrupt-wake-up-support.patch +drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch +gpio-amd8111-and-tqmx86-require-has_ioport_map.patch