From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 00C4FC433F5 for ; Wed, 22 Sep 2021 21:24:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE15D6112F for ; Wed, 22 Sep 2021 21:24:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238063AbhIVVZv (ORCPT ); Wed, 22 Sep 2021 17:25:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:42838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237802AbhIVVZv (ORCPT ); Wed, 22 Sep 2021 17:25:51 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E65B60F44; Wed, 22 Sep 2021 21:24:20 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mT9iz-00CPab-Qw; Wed, 22 Sep 2021 22:24:18 +0100 Date: Wed, 22 Sep 2021 22:24:17 +0100 Message-ID: <87czp0b8xq.wl-maz@kernel.org> From: Marc Zyngier To: "Sven Peter" Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, "Bjorn Helgaas" , "Rob Herring" , "Lorenzo Pieralisi" , Krzysztof =?UTF-8?B?V2lsY3p5xYRza2k=?= , "Alyssa Rosenzweig" , "Stan Skowronek" , "Mark Kettenis" , "Hector Martin" , "Robin Murphy" , kernel-team@android.com Subject: Re: [PATCH v4 04/10] PCI: apple: Add initial hardware bring-up In-Reply-To: <86507f22-d824-4f7c-ba94-d3105c5206c2@www.fastmail.com> References: <20210922205458.358517-1-maz@kernel.org> <20210922205458.358517-5-maz@kernel.org> <86507f22-d824-4f7c-ba94-d3105c5206c2@www.fastmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sven@svenpeter.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, kw@linux.com, alyssa@rosenzweig.io, stan@corellium.com, kettenis@openbsd.org, marcan@marcan.st, Robin.Murphy@arm.com, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, 22 Sep 2021 22:08:33 +0100, "Sven Peter" wrote: > > Hi, > > > On Wed, Sep 22, 2021, at 22:54, Marc Zyngier wrote: > > From: Alyssa Rosenzweig > > > [...] > > + > > + /* Use the first reg entry to work out the port index */ > > + port->idx = idx >> 11; > > + port->pcie = pcie; > > + port->np = np; > > + > > + port->base = devm_platform_ioremap_resource(platform, port->idx + 2); > > + if (IS_ERR(port->base)) > > + return -ENODEV; > > + > > + rmw_set(PORT_APPCLK_EN, port + PORT_APPCLK); > > I think this should be > > rmw_set(PORT_APPCLK_EN, port->base + PORT_APPCLK); Ouch. Well caught. I wonder how many of these I introduced...:-/ > > > + > > + rmw_set(PORT_PERST_OFF, port->base + PORT_PERST); > > + gpiod_set_value(reset, 1); > > + > > + ret = readl_relaxed_poll_timeout(port->base + PORT_STATUS, stat, > > + stat & PORT_STATUS_READY, 100, 250000); > > + if (ret < 0) { > > + dev_err(pcie->dev, "port %pOF ready wait timeout\n", np); > > + return ret; > > + } > > + > > + /* Flush writes and enable the link */ > > + dma_wmb(); > > I don't think this barrier is required. It really isn't, and I though I had removed it. I now wonder whether I have pushed out the right branch, or messed up by moving from one machine to another... > > + > > + writel_relaxed(PORT_LTSSMCTL_START, port->base + PORT_LTSSMCTL); > > + > > + return 0; > > +} > > + > [...] > > > Looks good to me otherwise, > > Reviewed-by: Sven Peter Thanks. Hopefully I'll manage to post a non broken series next time... M. -- Without deviation from the norm, progress is not possible.