From patchwork Thu Mar 1 05:59:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 10250447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 202B1602B5 for ; Thu, 1 Mar 2018 05:59:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D4A128F19 for ; Thu, 1 Mar 2018 05:59:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01EA128F1C; Thu, 1 Mar 2018 05:59:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, MIME_BASE64_BLANKS, MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04C3728F19 for ; Thu, 1 Mar 2018 05:59:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966276AbeCAF7d (ORCPT ); Thu, 1 Mar 2018 00:59:33 -0500 Received: from smtpbg65.qq.com ([103.7.28.233]:17958 "EHLO smtpbg65.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966253AbeCAF7a (ORCPT ); Thu, 1 Mar 2018 00:59:30 -0500 X-QQ-GoodBg: 0 X-QQ-SSF: 00100000000000F0 X-QQ-FEAT: +RVLFyEtuxxc2xK46rBjrmX1TxNiC8mVF+/uLI3xYQt68DzOao81th0JxUVOX v0WeL2qrHfKkrsi/T6RASKv+D8eKggFl0mL75XJwZXDiffECse4mXPGDngPg79LA2uOwUUG roucL505bQWV6M2IayxQ/jTnhiu8xk7r78FWZ5BtuMf5Bqi3uenB8052icWidWLIEwzzJdX fDtwp/spqn40X2Kl9N9YVf2iM61SRhwLmRi012BeJYwkqb+XYDZwgzlv6T36E4iKJy5X3xr ByR+HrDZgPAVEOWqKfmFI2eIY= X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 222.92.124.153 X-QQ-STYLE: X-QQ-mid: bizmailfree34t1519883956t2544 From: "=?utf-8?B?6ZmI5Y2O5omN?=" To: "=?utf-8?B?SmFtZXMgU21hcnQ=?=" , "=?utf-8?B?RGljayBLZW5uZWR5?=" Cc: "=?utf-8?B?SmFtZXMgRSAuIEogLiBCb3R0b21sZXk=?=" , "=?utf-8?B?TWFydGluIEsgLiBQZXRlcnNlbg==?=" , "=?utf-8?B?RnV4aW4gWmhhbmc=?=" , "=?utf-8?B?bGludXgtc2NzaQ==?=" , "=?utf-8?B?c3RhYmxl?=" Subject: Re:[PATCH] scsi: lpfc: Switch memcpy_fromio() to __read32_copy() Mime-Version: 1.0 Date: Thu, 1 Mar 2018 13:59:16 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x References: <1516971186-20372-1-git-send-email-chenhc@lemote.com> In-Reply-To: <1516971186-20372-1-git-send-email-chenhc@lemote.com> X-QQ-ReplyHash: 983634971 X-QQ-SENDSIZE: 520 Received: from qq.com (unknown [127.0.0.1]) by smtp.qq.com (ESMTP) with SMTP id ; Thu, 01 Mar 2018 13:59:17 +0800 (CST) Feedback-ID: bizmailfree:lemote.com:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ping? ------------------ Original ------------------ From: "Huacai Chen"; Date: Fri, Jan 26, 2018 08:53 PM To: "James Smart"; "Dick Kennedy"; Cc: "James E . J . Bottomley"; "Martin K . Petersen"; "Fuxin Zhang"; "linux-scsi"; "Huacai Chen"; "stable"; 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@vger.kernel.org Signed-off-by: Huacai Chen --- drivers/scsi/lpfc/lpfc_compat.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0 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 */