From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756065AbcIRDhg (ORCPT ); Sat, 17 Sep 2016 23:37:36 -0400 Received: from mail-db5eur01on0043.outbound.protection.outlook.com ([104.47.2.43]:28739 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755486AbcIRDhc (ORCPT ); Sat, 17 Sep 2016 23:37:32 -0400 From: Po Liu To: Shawn Guo CC: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , Roy Zang , Arnd Bergmann , Marc Zyngier , Stuart Yoder , Leo Li , "M.H. Lian" , Murali Karicheri , "Bjorn Helgaas" , Mingkai Hu Subject: RE: [PATCH v5 3/3] pci:aer: add support aer interrupt with none MSI/MSI-X/INTx mode Thread-Topic: [PATCH v5 3/3] pci:aer: add support aer interrupt with none MSI/MSI-X/INTx mode Thread-Index: AQHSDXq+mQIj497Zs02r28vBatnen6B+ctIAgAAm/QA= Date: Sun, 18 Sep 2016 03:37:27 +0000 Message-ID: References: <1472625442-23309-2-git-send-email-po.liu@nxp.com> <1473741659-17618-1-git-send-email-po.liu@nxp.com> <1473741659-17618-3-git-send-email-po.liu@nxp.com> <20160918005212.GF15478@tiger> In-Reply-To: <20160918005212.GF15478@tiger> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=po.liu@nxp.com; x-originating-ip: [192.158.241.86] x-ms-office365-filtering-correlation-id: 166be028-28f4-4d4d-8130-08d3df751c9c x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2638;6:cOOYY8KBjuqDjH+f0LFmbo1SFkpqAgBChONajFAhs6UmBYOmFJhBNC0IvDKR6KXJym5rgNY576u18jHqNNEL+WuTNDKV5WlTOQESDDsM6UQsC/NqcVgSMVge83+Zuk1jlp4yNYSlMqk7tfEVooHpL0ei3Km8c46DbX7/JfxlcDv3SmnyDbmIBDZAKpHNAFuyo8R+3qmDrNcoj4pbNAsbckkRiRSAOXTVSnP5QwtxAlaUwNmf+awXvKYcuXVYYMdehgl6d9FV5yxtHPi5b1nScuniakgjxd44jI9UK7YkZzEA0hxmvg1ZACOgQuoy2Rj38as4cjWPWBfZGPq2cZ1jBw==;5:+2gTMA6OjYwhpLWo7u4sXAJNW1Yf0b+msyNT+HKoe412PBeNixix28VK1EeePnY5Gq84F9Jfe7vvfE2Gv2YIQzDrribkywz5LmSbU4myGCQ6UxUXaCKAe8PV3senxARnvhxa2TSbCrgPlgM4QFlZiQ==;24:jJyWqaGUiN38LnoLib8GAR81gfHmy05JfZvBRodbgXyZkEgJjIIx3H7lbkA9U9PfqLyWXFUO5muLHPRvYbd81a28NOqJjWkdrJknoYysMSM=;7:3lhtjcx6RZw8QVbJkwSaHq1aHh1Vzh/Hn3L2LtJq51HGu/mtGqzUvWaYjoLUxq7sC00SwwgreDFyven/bIeqwB2Sgx2KobYUa+m6kKhxpPyOCk0yfCItfC1gcQqQlNqfQ/02lYLPAYN7iwyEKHHyeECBpXIN0LPzqj3u6yMVnSbLefLMhp/VSLyzn2ZladGZZ89zAanA2ClILRkUpnVudoakd2/XOgSLCjVLkKYvzqKAzWOjmDcbrj1e94vN6q+iifHTCXkbh4Ytyt0JOh6o3JZQvot622uInJrHXIHpELTpnGu0f2+VoCeZodBeHNLG x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2638; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(185117386973197)(258649278758335); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026);SRVR:VI1PR0401MB2638;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0401MB2638; x-forefront-prvs: 0069246B74 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(377454003)(13464003)(199003)(189002)(24454002)(5660300001)(10400500002)(586003)(5002640100001)(3846002)(87936001)(2950100001)(93886004)(15975445007)(2900100001)(6116002)(102836003)(9686002)(7696004)(11100500001)(4326007)(110136003)(68736007)(8676002)(81156014)(81166006)(92566002)(7736002)(7846002)(305945005)(74316002)(2906002)(8936002)(66066001)(101416001)(50986999)(54356999)(76176999)(122556002)(33656002)(97736004)(19580395003)(19580405001)(189998001)(77096005)(1720100001)(86362001)(575784001)(3660700001)(76576001)(3280700002)(105586002)(106356001)(106116001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2638;H:VI1PR0401MB1709.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2016 03:37:27.0986 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2638 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u8I3bmLc018878 Hi Shawn, > -----Original Message----- > From: Shawn Guo [mailto:shawnguo@kernel.org] > Sent: Sunday, September 18, 2016 8:52 AM > To: Po Liu > Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > linux-kernel@vger.kernel.org; devicetree@vger.kernel.org; Roy Zang; Arnd > Bergmann; Marc Zyngier; Stuart Yoder; Leo Li; M.H. Lian; Murali > Karicheri; Bjorn Helgaas; Mingkai Hu > Subject: Re: [PATCH v5 3/3] pci:aer: add support aer interrupt with none > MSI/MSI-X/INTx mode > > On Tue, Sep 13, 2016 at 12:40:59PM +0800, Po Liu wrote: > > On some platforms, root port doesn't support MSI/MSI-X/INTx in RC mode. > > When chip support the aer interrupt with none MSI/MSI-X/INTx mode, > > maybe there is interrupt line for aer pme etc. Search the interrupt > > number in the fdt file. Then fixup the dev->irq with it. > > > > Signed-off-by: Po Liu > > Will the new kernel work with existing/old DTB? I'm trying to > understand the dependency between driver and DTS changes. Yes, We've never use name 'intr' before. So we remove it is ok. 'aer' is a dts name for researching it's true interrupt number by kernel. This patch is first time to use name 'aer'. So it must be compatible with existing/old DTB. > > Shawn > > > --- > > changes for v5: > > - Add clear 'aer' interrup-names description > > > > .../devicetree/bindings/pci/layerscape-pci.txt | 11 +++++--- > > drivers/pci/pcie/portdrv_core.c | 31 > +++++++++++++++++++--- > > 2 files changed, 35 insertions(+), 7 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/pci/layerscape-pci.txt > > b/Documentation/devicetree/bindings/pci/layerscape-pci.txt > > index 41e9f55..101d0a7 100644 > > --- a/Documentation/devicetree/bindings/pci/layerscape-pci.txt > > +++ b/Documentation/devicetree/bindings/pci/layerscape-pci.txt > > @@ -18,8 +18,10 @@ Required properties: > > - reg: base addresses and lengths of the PCIe controller > > - interrupts: A list of interrupt outputs of the controller. Must > contain an > > entry for each entry in the interrupt-names property. > > -- interrupt-names: Must include the following entries: > > - "intr": The interrupt that is asserted for controller interrupts > > +- interrupt-names: It may be include the following entries: > > + "aer": The interrupt that is asserted for aer interrupt > > + "pme": The interrupt that is asserted for pme interrupt > > + ...... > > - fsl,pcie-scfg: Must include two entries. > > The first entry must be a link to the SCFG device node > > The second entry must be '0' or '1' based on physical PCIe > controller index. > > @@ -35,8 +37,9 @@ Example: > > reg = <0x00 0x03400000 0x0 0x00010000 /* controller > registers */ > > 0x40 0x00000000 0x0 0x00002000>; /* configuration > space */ > > reg-names = "regs", "config"; > > - interrupts = ; /* > controller interrupt */ > > - interrupt-names = "intr"; > > + interrupts = , /* aer > interrupt */ > > + ; /* pme interrupt */ > > + interrupt-names = "aer", "pme"; > > fsl,pcie-scfg = <&scfg 0>; > > #address-cells = <3>; > > #size-cells = <2>; > > diff --git a/drivers/pci/pcie/portdrv_core.c > > b/drivers/pci/pcie/portdrv_core.c index e9270b4..7c4943d 100644 > > --- a/drivers/pci/pcie/portdrv_core.c > > +++ b/drivers/pci/pcie/portdrv_core.c > > @@ -16,6 +16,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "../pci.h" > > #include "portdrv.h" > > @@ -200,6 +201,28 @@ static int pcie_port_enable_msix(struct pci_dev > > *dev, int *vectors, int mask) static int init_service_irqs(struct > > pci_dev *dev, int *irqs, int mask) { > > int i, irq = -1; > > + int ret; > > + struct device_node *np = NULL; > > + > > + for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) > > + irqs[i] = 0; > > + > > + if (dev->bus->dev.of_node) > > + np = dev->bus->dev.of_node; > > + > > + /* If root port doesn't support MSI/MSI-X/INTx in RC mode, > > + * request irq for aer > > + */ > > + if (IS_ENABLED(CONFIG_OF_IRQ) && np && > > + (mask & PCIE_PORT_SERVICE_PME)) { > > + ret = of_irq_get_byname(np, "aer"); > > + if (ret > 0) { > > + irqs[PCIE_PORT_SERVICE_AER_SHIFT] = ret; > > + if (dev->irq) > > + irq = dev->irq; > > + goto no_msi; > > + } > > + } > > > > /* > > * If MSI cannot be used for PCIe PME or hotplug, we have to use > @@ > > -225,11 +248,13 @@ static int init_service_irqs(struct pci_dev *dev, > int *irqs, int mask) > > irq = dev->irq; > > > > no_msi: > > - for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) > > - irqs[i] = irq; > > + for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++) { > > + if (!irqs[i]) > > + irqs[i] = irq; > > + } > > irqs[PCIE_PORT_SERVICE_VC_SHIFT] = -1; > > > > - if (irq < 0) > > + if (irq < 0 && irqs[PCIE_PORT_SERVICE_AER_SHIFT] < 0) > > return -ENODEV; > > return 0; > > } > > -- > > 2.1.0.27.g96db324 > > > > > > _______________________________________________ > > linux-arm-kernel mailing list > > linux-arm-kernel@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel