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=-19.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 74EAFC433B4 for ; Fri, 7 May 2021 13:04:59 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 C5EA06145D for ; Fri, 7 May 2021 13:04:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5EA06145D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=UGqo/3B1e9ohxze6BuYhuoFhuCz235ObmEqYsiFoYhw=; b=HBSJj//JPMgS55TimiA9uixK7 tf5CUHagZXDn20lYVo1/IQ7wBEosxOH5DNB4vDRlnHf/5se5S5comZsQ+36YbuftLkzldniEFnyM+ 1fdjLCJpUYBAkWlFWq5fWjIfkKb8u53UiYte0Lcqc2cWfqKUOR4QJzZHpHSrsJYHZu8JUbmtWyIQX utXYSU9Dk+Lmnh8UTPKplQpHVwYMs9VkH852LcDGNysDg1ipjIaDtN4KOicGKxN+4xLxPw7Wjmb3x C9+GEqfRd4XflIrHMPs3xPi2ahB0PB9khC81Vu8UxNGzt3UxtAvenEL7/BJKmLB/ei+sx9QZ+bn4Z ogHwPOyWA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lf08R-0076hv-Mn; Fri, 07 May 2021 13:03:15 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lf08O-0076hW-Iy for linux-arm-kernel@desiato.infradead.org; Fri, 07 May 2021 13:03:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To :Content-ID:Content-Description:References; bh=ZNQtxWezjG7jFV088E50hUagXyzBPUX1Jkxl53JVBWI=; b=lgjfwmaYodqyPEHFH4d0a3t1co LvasfWXqhtpbVLUs22QaRbw5Ug+hauKdjypsTLAzpOk7Dm+k+fCC6XqVyoQd85K+aoYOJQaddywT9 yhEACbj/h4lOoVe15OqcNRWVNMvoV4FZEgHfXGSkSs77rj2eJbWuUMDM3O218RNGxEzcwV8960w/f EkoLMrEe/cUlZF0QD/oZdAUc3xmLeC6prQjmvDhR4p+alp71UpsuUqkuBf0lVP1R1EOsGBKP4M8ON fvC0PeWR45iVW0KuQyGYFC7YTpqE8tePF19/7maFytsRRk/P/SXP01cHrrJ1tPgVs/PkHW1obXJwD 60P9ogug==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lf08L-006s37-MX for linux-arm-kernel@lists.infradead.org; Fri, 07 May 2021 13:03:11 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF6C46143F; Fri, 7 May 2021 13:03:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620392589; bh=D6tlwEAZ7eCBlX2hF7kas98mcfOt8qkO9WqLf5nvISw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Qh5hEKGA1AtUF3SJIVptuc3lTAGNuwd8uyuDNNQLtDHsxiJdQi06lDyRRR+bunggf whyACVAcqrk2cFycZwtAO5JqX1OROu1a69+GBd7ifMooXxM59fpBo6pODO+w/9TRGn VbDkqD1dWbpzQCQUcKvT1RkMdajBpDh4O31BKdeiTKhS2hW09O18mQOFsbh2aTxJcK GYCbOc7D9noT6HQ0HwyW2Bc/Un66Y7LHP3LfqUKK35YIONJ+2icr11xYOtaHI+yjR2 Bqa1uHeftLLv1I9sjrTd+A/kDXNMAK3mUHueaUNJLr2Ohe1FwA1AvmFmnyZK8mztN+ K4co8ETz9d0vw== Date: Fri, 7 May 2021 08:03:07 -0500 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Lorenzo Pieralisi , Thomas Petazzoni , Rob Herring , Bjorn Helgaas , Russell King , Marek =?iso-8859-1?Q?Beh=FAn?= , Remi Pommarel , Xogium , Tomasz Maciej Nowak , Marc Zyngier , linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/42] PCI: aardvark: Fix reporting CRS Software Visibility on emulated bridge Message-ID: <20210507130307.GA1448097@bjorn-Precision-5520> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210506153153.30454-7-pali@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_060309_827367_8A6D0FAE X-CRM114-Status: GOOD ( 25.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 06, 2021 at 05:31:17PM +0200, Pali Roh=E1r wrote: > CRS Software Visibility is supported and always enabled by PIO. > Correctly report this information via emulated root bridge. Maybe spell out "Configuration Request Retry Status (CRS) Software Visibility" once. I'm guessing the aardvark hardware spec is proprietary, but can you at least include a reference to the section that says CRSVIS is supported and CRSSVE is enabled? What is PIO? I assume this is something other than "programmed I/O"? I'd like the commit log to say something about the effect of this change, i.e., why are we doing it? For one thing, I expect lspci will now show "RootCtl: ... CRSVisible+" and "RootCap: CRSVisible+". With PCI_EXP_RTCAP_CRSVIS set, pci_enable_crs() should now try to set PCI_EXP_RTCTL_CRSSVE (which I think is a no-op since advk_pci_bridge_emul_pcie_conf_write() doesn't do anything with PCI_EXP_RTCTL_CRSSVE). So AFAICT this has zero effect on the kernel. Possibly we *should* base some kernel behavior on whether PCI_EXP_RTCTL_CRSSVE is set, but I don't think we do today. > Signed-off-by: Pali Roh=E1r > Reviewed-by: Marek Beh=FAn > Fixes: 8a3ebd8de328 ("PCI: aardvark: Implement emulated root PCI bridge c= onfig space") > Cc: stable@vger.kernel.org Again, I think this just adds functionality and doesn't fix something that used to be broken. Per [1], patches for the stable kernel should be for serious issues like an oops, hang, data corruption, etc. I know stable kernel maintainers pick up all sorts of other stuff, but that's up to them. I try to limit stable tags to reduce the risk of regressing. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree= /Documentation/process/stable-kernel-rules.rst?id=3Dv5.11 > --- > drivers/pci/controller/pci-aardvark.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > = > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controll= er/pci-aardvark.c > index 3f3c72927afb..e297ec9ec390 100644 > --- a/drivers/pci/controller/pci-aardvark.c > +++ b/drivers/pci/controller/pci-aardvark.c > @@ -578,6 +578,8 @@ advk_pci_bridge_emul_pcie_conf_read(struct pci_bridge= _emul *bridge, > case PCI_EXP_RTCTL: { > u32 val =3D advk_readl(pcie, PCIE_ISR0_MASK_REG); > *value =3D (val & PCIE_MSG_PM_PME_MASK) ? 0 : PCI_EXP_RTCTL_PMEIE; > + *value |=3D PCI_EXP_RTCTL_CRSSVE; > + *value |=3D PCI_EXP_RTCAP_CRSVIS << 16; > return PCI_BRIDGE_EMUL_HANDLED; > } > = > @@ -659,6 +661,7 @@ static struct pci_bridge_emul_ops advk_pci_bridge_emu= l_ops =3D { > static int advk_sw_pci_bridge_init(struct advk_pcie *pcie) > { > struct pci_bridge_emul *bridge =3D &pcie->bridge; > + int ret; > = > bridge->conf.vendor =3D > cpu_to_le16(advk_readl(pcie, PCIE_CORE_DEV_ID_REG) & 0xffff); > @@ -682,7 +685,16 @@ static int advk_sw_pci_bridge_init(struct advk_pcie = *pcie) > bridge->data =3D pcie; > bridge->ops =3D &advk_pci_bridge_emul_ops; > = > - return pci_bridge_emul_init(bridge, 0); > + /* PCIe config space can be initialized after pci_bridge_emul_init() */ > + ret =3D pci_bridge_emul_init(bridge, 0); > + if (ret < 0) > + return ret; > + > + /* Completion Retry Status is supported and always enabled by PIO */ "CRS Software Visibility", not "Completion Retry Status". The CRSSVE bit is *supposed* to be RW, per spec. Is it RO on this hardware? > + bridge->pcie_conf.rootctl =3D cpu_to_le16(PCI_EXP_RTCTL_CRSSVE); > + bridge->pcie_conf.rootcap =3D cpu_to_le16(PCI_EXP_RTCAP_CRSVIS); > + > + return 0; > } > = > static bool advk_pcie_valid_device(struct advk_pcie *pcie, struct pci_bu= s *bus, > -- = > 2.20.1 > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel