From: Sasha Levin Date: Mon, 5 Jul 2021 01:54:02 +0000 (-0400) Subject: Fixes for 4.14 X-Git-Tag: v5.13.1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87f9d62fdb9cbd159ccdc7beb987eeefe245e985;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 4.14 Signed-off-by: Sasha Levin --- diff --git a/queue-4.14/drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch b/queue-4.14/drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch new file mode 100644 index 00000000000..409d4ca91e2 --- /dev/null +++ b/queue-4.14/drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch @@ -0,0 +1,47 @@ +From b84c6d8065838079c7b63dc459079b9d725cd0eb 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 e427f80344c4..a2d770acd10a 100644 +--- a/drivers/gpu/drm/nouveau/nouveau_bo.c ++++ b/drivers/gpu/drm/nouveau/nouveau_bo.c +@@ -450,7 +450,7 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) + struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; + int i; + +- if (!ttm_dma) ++ if (!ttm_dma || !ttm_dma->dma_address) + return; + + /* Don't waste time looping if the object is coherent */ +@@ -470,7 +470,7 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) + struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; + int i; + +- if (!ttm_dma) ++ if (!ttm_dma || !ttm_dma->dma_address) + return; + + /* Don't waste time looping if the object is coherent */ +-- +2.30.2 + diff --git a/queue-4.14/scsi-sr-return-appropriate-error-code-when-disk-is-e.patch b/queue-4.14/scsi-sr-return-appropriate-error-code-when-disk-is-e.patch new file mode 100644 index 00000000000..b7753a82116 --- /dev/null +++ b/queue-4.14/scsi-sr-return-appropriate-error-code-when-disk-is-e.patch @@ -0,0 +1,37 @@ +From aefa0a07ba420642ea872f9d10765e90552f9ee8 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 5be3d6b7991b..a46fbe2d2ee6 100644 +--- a/drivers/scsi/sr.c ++++ b/drivers/scsi/sr.c +@@ -216,6 +216,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-4.14/series b/queue-4.14/series index 2bac7bda778..7a57bd49bd2 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -17,3 +17,5 @@ mm-page_vma_mapped_walk-get-vma_address_end-earlier.patch mm-thp-fix-page_vma_mapped_walk-if-thp-mapped-by-pte.patch mm-thp-another-pvmw_sync-fix-in-page_vma_mapped_walk.patch mm-futex-fix-shared-futex-pgoff-on-shmem-huge-page.patch +scsi-sr-return-appropriate-error-code-when-disk-is-e.patch +drm-nouveau-fix-dma_address-check-for-cpu-gpu-sync.patch