Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D852C2B9F4 for ; Sat, 19 Jun 2021 14:10:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 705BB61154 for ; Sat, 19 Jun 2021 14:10:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 705BB61154 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=diac24.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9BD2B80F47; Sat, 19 Jun 2021 16:10:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=diac24.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 26049814A4; Sat, 19 Jun 2021 16:10:19 +0200 (CEST) Received: from eidolon.nox.tf (eidolon.nox.tf [IPv6:2a07:2ec0:2185::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 67CB480F3A for ; Sat, 19 Jun 2021 16:10:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=diac24.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=equinox@diac24.net Received: from equinox by eidolon.nox.tf with local (Exim 4.94.2) (envelope-from ) id 1lubfq-0060Zg-M9; Sat, 19 Jun 2021 16:10:15 +0200 Date: Sat, 19 Jun 2021 16:10:14 +0200 From: David Lamparter To: u-boot@lists.denx.de Subject: Re: [PATCH] nvme: fix for big endian systems Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Tue, May 18, 2021 at 01:09:17PM +0200, David Lamparter wrote: > On Thu, May 06, 2021 at 08:24:30PM +0200, David Lamparter wrote: > > writel() and co. already include the endian swap; doing the swap twice > > is, er, unhelpful. > > > > Tested on a P4080DS, which boots perfectly fine off NVMe with this. > > is there anything to be done on my end to get this merged? The > MAINTAINERS file has no entry for drivers/nvme/ so I'm not quite sure > who to ping on this... Ping - could someone review and/or merge this? Cheers, David > > diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c > > index c61dab20c5f0..d554ec54cbe0 100644 > > --- a/drivers/nvme/nvme.c > > +++ b/drivers/nvme/nvme.c > > @@ -157,7 +157,7 @@ static u16 nvme_read_completion_status(struct nvme_queue *nvmeq, u16 index) > > > > invalidate_dcache_range(start, stop); > > > > - return le16_to_cpu(readw(&(nvmeq->cqes[index].status))); > > + return readw(&(nvmeq->cqes[index].status)); > > } > > > > /** > > @@ -221,7 +221,7 @@ static int nvme_submit_sync_cmd(struct nvme_queue *nvmeq, > > } > > > > if (result) > > - *result = le32_to_cpu(readl(&(nvmeq->cqes[head].result))); > > + *result = readl(&(nvmeq->cqes[head].result)); > > > > if (++head == nvmeq->q_depth) { > > head = 0; > > @@ -304,7 +304,7 @@ static int nvme_enable_ctrl(struct nvme_dev *dev) > > { > > dev->ctrl_config &= ~NVME_CC_SHN_MASK; > > dev->ctrl_config |= NVME_CC_ENABLE; > > - writel(cpu_to_le32(dev->ctrl_config), &dev->bar->cc); > > + writel(dev->ctrl_config, &dev->bar->cc); > > > > return nvme_wait_ready(dev, true); > > } > > @@ -313,7 +313,7 @@ static int nvme_disable_ctrl(struct nvme_dev *dev) > > { > > dev->ctrl_config &= ~NVME_CC_SHN_MASK; > > dev->ctrl_config &= ~NVME_CC_ENABLE; > > - writel(cpu_to_le32(dev->ctrl_config), &dev->bar->cc); > > + writel(dev->ctrl_config, &dev->bar->cc); > > > > return nvme_wait_ready(dev, false); > > }