Re:[PATCH] scsi: lpfc: Switch memcpy_fromio() to __read32_copy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No one has the same problem? Or this patch need improve?

Huacai
 
------------------ Original ------------------
From:  "陈华才"<chenhc@xxxxxxxxxx>;
Date:  Thu, Mar 1, 2018 01:59 PM
To:  "James Smart"<james.smart@xxxxxxxxxxxx>; "Dick Kennedy"<dick.kennedy@xxxxxxxxxxxx>;
Cc:  "James E . J . Bottomley"<jejb@xxxxxxxxxxxxxxxxxx>; "Martin K . Petersen"<martin.petersen@xxxxxxxxxx>; "Fuxin Zhang"<zhangfx@xxxxxxxxxx>; "linux-scsi"<linux-scsi@xxxxxxxxxxxxxxx>; "stable"<stable@xxxxxxxxxxxxxxx>;
Subject:  Re:[PATCH] scsi: lpfc: Switch memcpy_fromio() to __read32_copy()
 
Ping?
 
------------------ Original ------------------
From:  "Huacai Chen"<chenhc@xxxxxxxxxx>;
Date:  Fri, Jan 26, 2018 08:53 PM
To:  "James Smart"<james.smart@xxxxxxxxxxxx>; "Dick Kennedy"<dick.kennedy@xxxxxxxxxxxx>;
Cc:  "James E . J . Bottomley"<jejb@xxxxxxxxxxxxxxxxxx>; "Martin K . Petersen"<martin.petersen@xxxxxxxxxx>; "Fuxin Zhang"<zhangfx@xxxxxxxxxx>; "linux-scsi"<linux-scsi@xxxxxxxxxxxxxxx>; "Huacai Chen"<chenhc@xxxxxxxxxx>; "stable"<stable@xxxxxxxxxxxxxxx>;
Subject:  [PATCH] scsi: lpfc: Switch memcpy_fromio() to __read32_copy()
 
In commit bc73905abf770192 ("[SCSI] lpfc 8.3.16: SLI Additions, updates,
and code cleanup"), lpfc_memcpy_to_slim() have switched memcpy_toio() to
__write32_copy() in order to prevent unaligned 64 bit copy. Recently, we
found that lpfc_memcpy_from_slim() have similar issues, so let it switch
memcpy_fromio() to __read32_copy().

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Huacai Chen <chenhc@xxxxxxxxxx>
---
 drivers/scsi/lpfc/lpfc_compat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_compat.h b/drivers/scsi/lpfc/lpfc_compat.h
index 6b32b0a..47d4fad 100644
--- a/drivers/scsi/lpfc/lpfc_compat.h
+++ b/drivers/scsi/lpfc/lpfc_compat.h
@@ -91,8 +91,8 @@ lpfc_memcpy_to_slim( void __iomem *dest, void *src, unsigned int bytes)
 static inline void
 lpfc_memcpy_from_slim( void *dest, void __iomem *src, unsigned int bytes)
 {
-	/* actually returns 1 byte past dest */
-	memcpy_fromio( dest, src, bytes);
+	/* convert bytes in argument list to word count for copy function */
+	__ioread32_copy(dest, src, bytes / sizeof(uint32_t));
 }
 
 #endif	/* __BIG_ENDIAN */
-- 
2.7.0




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]