From patchwork Mon Mar 5 06:56:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 10258213 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 D2AB260211 for ; Mon, 5 Mar 2018 06:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEFF128831 for ; Mon, 5 Mar 2018 06:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B35DB288ED; Mon, 5 Mar 2018 06:57:01 +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 BB89728831 for ; Mon, 5 Mar 2018 06:56:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932395AbeCEG46 (ORCPT ); Mon, 5 Mar 2018 01:56:58 -0500 Received: from smtpproxy19.qq.com ([184.105.206.84]:47807 "EHLO smtpproxy19.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbeCEG45 (ORCPT ); Mon, 5 Mar 2018 01:56:57 -0500 X-QQ-GoodBg: 0 X-QQ-SSF: 00100000000000F0 X-QQ-FEAT: yXZMKu5H1aq21kOF4yCX017onBMdUyGt6DUXmjkP066tQY/hmYWnXFEcTi8eP 8PYFujj+4okhPzA3TYRvH/+d8n+REdndqLOPbdZquSQW8XVr9+I39K7eufTaLvoXFVoqhik wogL0/DcQKshhkAIIU5qTjAg3LRTgxMBXMLQMBnSIUAAObhUA1dCV2+dVc4n+lrB0a8haPG Fj5cqxQXh5c9pIGGmMAsT89o9G9Ta3h4td6lcm5hyhHOtluH862gAKxOlRdbfkWMy+DOGnF eVerIGR9v/JkQTQ4cA8xiQ9s0= X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 222.92.124.153 X-QQ-STYLE: X-QQ-mid: bizmailfree34t1520233011t1487 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: Mon, 5 Mar 2018 14:56:51 +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: X-QQ-ReplyHash: 3354981905 X-QQ-SENDSIZE: 520 Received: from qq.com (unknown [127.0.0.1]) by smtp.qq.com (ESMTP) with SMTP id ; Mon, 05 Mar 2018 14:56:52 +0800 (CST) Feedback-ID: bizmailfree:lemote.com:qybgforeign:qybgforeign4 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 No one has the same problem? Or this patch need improve? Huacai ------------------ Original ------------------ From: "陈华才"; Date: Thu, Mar 1, 2018 01:59 PM To: "James Smart"; "Dick Kennedy"; Cc: "James E . J . Bottomley"; "Martin K . Petersen"; "Fuxin Zhang"; "linux-scsi"; "stable"; Subject: Re:[PATCH] scsi: lpfc: Switch memcpy_fromio() to __read32_copy() 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 Signed-off-by: James Smart  Signed-off-by: James Smart Signed-off-by: James Smart 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 */