From patchwork Fri Jun 29 14:58:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaitra P B X-Patchwork-Id: 10496821 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 E0F2460230 for ; Fri, 29 Jun 2018 14:58:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D33B829693 for ; Fri, 29 Jun 2018 14:58:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7867299BF; Fri, 29 Jun 2018 14:58:40 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, 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 61E9D29693 for ; Fri, 29 Jun 2018 14:58:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754933AbeF2O6j (ORCPT ); Fri, 29 Jun 2018 10:58:39 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:35442 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753488AbeF2O6j (ORCPT ); Fri, 29 Jun 2018 10:58:39 -0400 Received: by mail-qk0-f194.google.com with SMTP id u21-v6so5065615qku.2 for ; Fri, 29 Jun 2018 07:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=xtjFuShY/jKjdrHe0BdIvIyv/ih9Y12lXtBzxGn6K1A=; b=Q4l+D5wdGwq6Ip6NwSmIL4TARzhfYBQcDUajohu74zRvdgYzuUqQ2zm3viPWZevkg9 JXBUWJTlbP+zhlC04G28zDKYd/zUlv5bi6zJP7HMSyxYMYMdhD6gw6sDIOmV4KZTGyVG 9GASYdHm8ux3j10OYKeBjOWYhM5UHDiMJioug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xtjFuShY/jKjdrHe0BdIvIyv/ih9Y12lXtBzxGn6K1A=; b=F1mJEzazsIkwO5szIfP++RXqkysiY3/YfaBPovWco2ApkwKiYm29ID4sCPOJTeUiKa O1XZqTcfCce8DX9U4GBj6T+lRK4xt6i8TsoJPIQt8Sg14Usda/DvGBwcI5xlT2sExd/v nPaY+hWD9rN7v0R3HQK24UAMPto6nnTRa9tUfXJXQsliftDeejr3eojikyyLvepzfnO1 3J+94Uy1ZxfiDev75uMrg8i0SfjSEtljCd+a9G4QYARQpXJEQsL+9lfe3r+RK5Vsislg XvBFnweWqO3apxOPEDKUR907Ln0g3jhxZiwIXo+smxoprcOa2ozjX61P4F8ygvDfhXTw IEyw== X-Gm-Message-State: APt69E0ObyGQtj4jhZcNyCOcyW568BTEs52LIExK8DmYa5LJLui4vAoy eAkh5TQw51DiDnZywMyKGPeLV4u9 X-Google-Smtp-Source: AAOMgpe5SfwFISQ+MyTJqEEh9xlYVUsaUKEXlesBGa4GFH+W1xS0UM1xXDamZxPdhgwQougZPY4IKw== X-Received: by 2002:a37:c0c:: with SMTP id 12-v6mr12817751qkm.59.1530284318261; Fri, 29 Jun 2018 07:58:38 -0700 (PDT) Received: from localhost.localdomain.localdomain ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id r62-v6sm8415692qkl.85.2018.06.29.07.58.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Jun 2018 07:58:37 -0700 (PDT) From: Chaitra P B To: linux-scsi@vger.kernel.org Cc: davem@davemloft.net, Sreekanth.Reddy@broadcom.com, Chaitra P B Subject: [PATCH] mpt3sas: Fix for regression caused due to cf6bf9710c patch Date: Fri, 29 Jun 2018 10:58:10 -0400 Message-Id: <1530284290-8555-1-git-send-email-chaitra.basappa@broadcom.com> X-Mailer: git-send-email 1.8.3.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 "scsi: mpt3sas: Bug fix for big endian systems" Above patch with commit id "cf6bf9710cabba1fe94a4349f4eb8db623c77ebc" was posted to fix sparse warnings. While posting this patch it was assumed that readl() & writel() APIs internally calls le32_to_cpu() & cpu_to_le32() APIs respectively. Looks like it is not true for all architecture and hence this patch is reverting back only those hunks which removed le32_to_cpu() API call while using readl() API & cpu_to_le32() API call while using writel() API. Signed-off-by: Chaitra P B --- drivers/scsi/mpt3sas/mpt3sas_base.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index dc41bd3..17b6b0a 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -3321,7 +3321,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, spinlock_t *writeq_lock) { unsigned long flags; - __u64 data_out = b; + __u64 data_out = cpu_to_le64(b); spin_lock_irqsave(writeq_lock, flags); writel((u32)(data_out), addr); @@ -3344,7 +3344,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, static inline void _base_writeq(__u64 b, volatile void __iomem *addr, spinlock_t *writeq_lock) { - writeq(b, addr); + writeq(cpu_to_le64(b), addr); } #else static inline void @@ -5215,7 +5215,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, /* send message 32-bits at a time */ for (i = 0, failed = 0; i < request_bytes/4 && !failed; i++) { - writel((u32)(request[i]), &ioc->chip->Doorbell); + writel(cpu_to_le32(request[i]), &ioc->chip->Doorbell); if ((_base_wait_for_doorbell_ack(ioc, 5))) failed = 1; } @@ -5236,7 +5236,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, } /* read the first two 16-bits, it gives the total length of the reply */ - reply[0] = (u16)(readl(&ioc->chip->Doorbell) + reply[0] = le16_to_cpu(readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK); writel(0, &ioc->chip->HostInterruptStatus); if ((_base_wait_for_doorbell_int(ioc, 5))) { @@ -5245,7 +5245,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, ioc->name, __LINE__); return -EFAULT; } - reply[1] = (u16)(readl(&ioc->chip->Doorbell) + reply[1] = le16_to_cpu(readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK); writel(0, &ioc->chip->HostInterruptStatus); @@ -5259,7 +5259,7 @@ void mpt3sas_base_clear_st(struct MPT3SAS_ADAPTER *ioc, if (i >= reply_bytes/2) /* overflow case */ readl(&ioc->chip->Doorbell); else - reply[i] = (u16)(readl(&ioc->chip->Doorbell) + reply[i] = le16_to_cpu(readl(&ioc->chip->Doorbell) & MPI2_DOORBELL_DATA_MASK); writel(0, &ioc->chip->HostInterruptStatus); }