+++ /dev/null
-From 860dd4424f344400b491b212ee4acb3a358ba9d9 Mon Sep 17 00:00:00 2001
-From: Christoph Hellwig <hch@lst.de>
-Date: Tue, 21 Nov 2017 14:23:37 +0100
-Subject: scsi: dma-mapping: always provide dma_get_cache_alignment
-
-From: Christoph Hellwig <hch@lst.de>
-
-commit 860dd4424f344400b491b212ee4acb3a358ba9d9 upstream.
-
-Provide the dummy version of dma_get_cache_alignment that always returns
-1 even if CONFIG_HAS_DMA is not set, so that drivers and subsystems can
-use it without ifdefs.
-
-Signed-off-by: Christoph Hellwig <hch@lst.de>
-Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- include/linux/dma-mapping.h | 2 --
- 1 file changed, 2 deletions(-)
-
---- a/include/linux/dma-mapping.h
-+++ b/include/linux/dma-mapping.h
-@@ -181,7 +181,6 @@ static inline void *dma_zalloc_coherent(
- return ret;
- }
-
--#ifdef CONFIG_HAS_DMA
- static inline int dma_get_cache_alignment(void)
- {
- #ifdef ARCH_DMA_MINALIGN
-@@ -189,7 +188,6 @@ static inline int dma_get_cache_alignmen
- #endif
- return 1;
- }
--#endif
-
- /* flags for the coherent memory api */
- #define DMA_MEMORY_MAP 0x01
+++ /dev/null
-From 90addc6b3c9cda0146fbd62a08e234c2b224a80c Mon Sep 17 00:00:00 2001
-From: Huacai Chen <chenhc@lemote.com>
-Date: Tue, 21 Nov 2017 14:23:38 +0100
-Subject: scsi: use dma_get_cache_alignment() as minimum DMA alignment
-
-From: Huacai Chen <chenhc@lemote.com>
-
-commit 90addc6b3c9cda0146fbd62a08e234c2b224a80c upstream.
-
-In non-coherent DMA mode, kernel uses cache flushing operations to
-maintain I/O coherency, so scsi's block queue should be aligned to the
-value returned by dma_get_cache_alignment(). Otherwise, If a DMA buffer
-and a kernel structure share a same cache line, and if the kernel
-structure has dirty data, cache_invalidate (no writeback) will cause
-data corruption.
-
-Signed-off-by: Huacai Chen <chenhc@lemote.com>
-[hch: rebased and updated the comment and changelog]
-Signed-off-by: Christoph Hellwig <hch@lst.de>
-Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- drivers/scsi/scsi_lib.c | 10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
-
---- a/drivers/scsi/scsi_lib.c
-+++ b/drivers/scsi/scsi_lib.c
-@@ -2028,11 +2028,13 @@ static void __scsi_init_queue(struct Scs
- q->limits.cluster = 0;
-
- /*
-- * set a reasonable default alignment on word boundaries: the
-- * host and device may alter it using
-- * blk_queue_update_dma_alignment() later.
-+ * Set a reasonable default alignment: The larger of 32-byte (dword),
-+ * which is a common minimum for HBAs, and the minimum DMA alignment,
-+ * which is set by the platform.
-+ *
-+ * Devices that require a bigger alignment can increase it later.
- */
-- blk_queue_dma_alignment(q, 0x03);
-+ blk_queue_dma_alignment(q, max(4, dma_get_cache_alignment()) - 1);
- }
-
- struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
virtio-release-virtio-index-when-fail-to-device_register.patch
hv-kvp-avoid-reading-past-allocated-blocks-from-kvp-file.patch
isa-prevent-null-dereference-in-isa_bus-driver-callbacks.patch
-scsi-dma-mapping-always-provide-dma_get_cache_alignment.patch
-scsi-use-dma_get_cache_alignment-as-minimum-dma-alignment.patch
efi-move-some-sysfs-files-to-be-read-only-by-root.patch
asn.1-check-for-error-from-asn1_op_end__act-actions.patch
keys-add-missing-permission-check-for-request_key-destination.patch