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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 8D9A9C33CAE for ; Mon, 13 Jan 2020 11:22:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5C92220661 for ; Mon, 13 Jan 2020 11:22:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KnDj5OQM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5C92220661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/66KDYG2ipxmmFyaGBl0n1eBrS0R5BletLnT/Ded8a0=; b=KnDj5OQM30akl3 63FEm3B0IF6MqTqCg0FYHXw8FwGeJs+Pppnnbss8OsBXxJGCj1gJWbB/fXao8uhtx+eyHxH0Yntsb Dx+F7mzP/ylZtygLoHSKf9eD7yaQ4z0B3kAfcvSrLLfZqE0ei5VD9yoVFoJ7DDfdPHfxCrR67Gkf5 XPI9ltxfOGuvt6tGedqQrdERSdHBivaE3NISYvczKApgvPpyotM1/FjW3SqMbIfL8w0OYhsm8SuXQ 0+cmGeNZbBSjf7xKKcn2bgfXC0Xpb2lWZC37B+0PCRzN4IR5JnKRHbx+x17PvtvC0sHs26XavSYrW eCZmfzM5kBzBCpDZ50Vg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqxnM-0007lA-Oz; Mon, 13 Jan 2020 11:22:08 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iqxnJ-0007kf-Dv for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2020 11:22:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C31E013D5; Mon, 13 Jan 2020 03:22:04 -0800 (PST) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0499C3F6C4; Mon, 13 Jan 2020 03:22:04 -0800 (PST) Date: Mon, 13 Jan 2020 11:22:02 +0000 From: Andrew Murray To: "Z.q. Hou" Subject: Re: [PATCHv9 06/12] PCI: mobiveil: Add callback function for link up check Message-ID: <20200113112201.GL42593@e119886-lin.cambridge.arm.com> References: <20191120034451.30102-1-Zhiqiang.Hou@nxp.com> <20191120034451.30102-7-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191120034451.30102-7-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200113_032205_560993_D92EAD58 X-CRM114-Status: GOOD ( 18.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "lorenzo.pieralisi@arm.com" , "m.karthikeyan@mobiveil.co.in" , "arnd@arndb.de" , "linux-pci@vger.kernel.org" , "l.subrahmanya@mobiveil.co.in" , "will.deacon@arm.com" , "linux-kernel@vger.kernel.org" , Leo Li , "M.h. Lian" , "robh+dt@kernel.org" , Mingkai Hu , Xiaowei Bao , "catalin.marinas@arm.com" , "bhelgaas@google.com" , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 20, 2019 at 03:45:57AM +0000, Z.q. Hou wrote: > From: Hou Zhiqiang > > The platforms, in which the Mobiveil GPEX is integrated, > may have their specific mechanism to check link up status. > This patch is to enable these platforms to implement theirs. > > Signed-off-by: Hou Zhiqiang > --- > V9: > - New patch splited from the #1 of V8 patches to make it easy to review. > > drivers/pci/controller/mobiveil/pcie-mobiveil.c | 3 +++ > drivers/pci/controller/mobiveil/pcie-mobiveil.h | 5 +++++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.c b/drivers/pci/controller/mobiveil/pcie-mobiveil.c > index 2773f823c9ea..b9ed2d95641c 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.c > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.c > @@ -125,6 +125,9 @@ void mobiveil_csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off, > > bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie) > { > + if (pcie->ops->link_up) > + return pcie->ops->link_up(pcie); > + > return (mobiveil_csr_readl(pcie, LTSSM_STATUS) & > LTSSM_STATUS_L0_MASK) == LTSSM_STATUS_L0; On the previous patch I suggested that we don't mix up the link_up logic with the logic that decides which function to call. In this case the link_up logic is trivial. So this is probably OK. Reviewed-by: Andrew Murray > } > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > index 18d85806a7fc..95d2e7c809b8 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > @@ -148,6 +148,10 @@ struct root_port { > struct pci_host_bridge *bridge; > }; > > +struct mobiveil_pab_ops { > + int (*link_up)(struct mobiveil_pcie *pcie); > +}; > + > struct mobiveil_pcie { > struct platform_device *pdev; > void __iomem *csr_axi_slave_base; /* root port config base */ > @@ -157,6 +161,7 @@ struct mobiveil_pcie { > int ppio_wins; > int ob_wins_configured; /* configured outbound windows */ > int ib_wins_configured; /* configured inbound windows */ > + const struct mobiveil_pab_ops *ops; > struct root_port rp; > }; > > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel