Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1627928imj; Fri, 8 Feb 2019 04:50:34 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia68bq6xH+69Utz5S4GdYiwwRWuqOLkZS9Y9XEQbWPA5E3kkiZw25SE6AWkSwaVhfAmFYj2 X-Received: by 2002:a17:902:34a:: with SMTP id 68mr22971750pld.268.1549630233927; Fri, 08 Feb 2019 04:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549630233; cv=none; d=google.com; s=arc-20160816; b=QHIZX2yGf6V06hWOnfCmBOyuh8TM7g81zz/7U7H+sOwiwLMOhX7fvuMZnPaYHBMXsi ryRxKUGS26q6G/pB9spssrJp0LZpStmuYk4GBu1v96Apz4Q/pVXA4xPGVSxvdm2sbhXs iUZceby2Zdbyyi37w+8kl0+VMviNzn/s6GHhaCKnce023bUhxpaVYdiRWMlVOL7kUTak 15EG/plxf0l+dDPbFtDK6hVT/G9HoxtxD4niNvjUixgj+Qo7TQYtpTjRv2Xw5gpZJl9s vGqGiCIPv2NTBJM0pmge5Pv83+iEhACI0DJPmte1Uf/d2PTOlFJScBpbvfw5Lvm6aX+z kk3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xPcDhdgRfeCUFb0NzA1yOiOvgeXq4mBndVeTfOEslgQ=; b=jspYEQzhwXOQ9D8jSPn56YrU6NRZ2QxuisxiznBvad7uyFSQnNNqjiaYP2bkLXCzBZ 2J4cyXo0DUgA5IAxY0hOYy5VhtbgaIsucaqQ7jTbJgYsVt5MWUElYlldPoVi9AtHmJ0D wuxl+S9lCQ8WX/dfnzRruPby3x7TMzVw1ArTKvSEsndfyJUxXHCjrfBf3eTuvW2mivCv KZF+y4J2NEheMvuT9gxI4Gmrn/VNV66avrXzByaIG3FpuJ2kZHCDrCQHQ33MxPJ68kuC JU2mTk6btS7h2YLlnJV18PgTinZkoPbjr92zQE77zUJdUgm4c3GFsNwjUB40wjSOq16A Nvtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mobiveil.co.in header.s=google header.b="eh/Bg0jU"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o33si2274682pld.121.2019.02.08.04.50.18; Fri, 08 Feb 2019 04:50:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mobiveil.co.in header.s=google header.b="eh/Bg0jU"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726952AbfBHMts (ORCPT + 99 others); Fri, 8 Feb 2019 07:49:48 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55442 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbfBHMts (ORCPT ); Fri, 8 Feb 2019 07:49:48 -0500 Received: by mail-wm1-f65.google.com with SMTP id r17so3264472wmh.5 for ; Fri, 08 Feb 2019 04:49:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mobiveil.co.in; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xPcDhdgRfeCUFb0NzA1yOiOvgeXq4mBndVeTfOEslgQ=; b=eh/Bg0jU9RaDR1LBeR3Gh1Q56m8LdqeMCjFymtwr+4RLIQKymhUKmPy7h8cE2dnt6I MY2BcxyhOc37PCKHC09QEvo6SDg9KssZE/fXVFmu9gRRmyMIwtzLjj6dvRIoXbuJj/lf F8RLPay1V2SCqepLMtout4X3rx5JR/99Q+y4A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xPcDhdgRfeCUFb0NzA1yOiOvgeXq4mBndVeTfOEslgQ=; b=mh/fzl+Eez+yva1k23FlPAHd4ebwsdT4SPUcpO1z08vLEX6Yh5Pwxrae1Y9IDqzbNG hdEVQFVSnGP/0tykhL4f5cEpkVbjCCgc7QkeJisEeeWotk5+r+e6+2CvcasSTeEj5O0V BrzTEMXM1NjN+hjlS8S0XV7knNhk1y08UV+avWg+vGr8adgS2N8x41I5oQpD+vL0AKz8 eL8ALacaQy7mBZ7PYrfZ2M3F//HhsTZC40qFbazVZiGE0qU7jl1+rkFgxh00+d80ib2s +COOGmufkIueG2k+mcJx5MOhq5S3n8oUnxcKCx4iH2/Mvl4E6rkgPaC0BdnQ+gEosapU NqcQ== X-Gm-Message-State: AHQUAubfzANGiNQcqV+f2JR8wPvkJ7rZFe8GVR3jZHzUdBObq7pZWMOB t5dqXmcElFzRCGyz1NU7fKY2y+AnWE3cAquKTL580A== X-Received: by 2002:a1c:9e4a:: with SMTP id h71mr11858445wme.82.1549630185604; Fri, 08 Feb 2019 04:49:45 -0800 (PST) MIME-Version: 1.0 References: <20190129080926.36773-1-Zhiqiang.Hou@nxp.com> <20190129080926.36773-25-Zhiqiang.Hou@nxp.com> In-Reply-To: <20190129080926.36773-25-Zhiqiang.Hou@nxp.com> From: Subrahmanya Lingappa Date: Fri, 8 Feb 2019 18:22:24 +0530 Message-ID: Subject: Re: [PATCHv3 24/27] PCI: mobiveil: ls_pcie_g4: add Workaround for A-011577 To: "Z.q. Hou" Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Mingkai Hu , "M.h. Lian" , Xiaowei Bao Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ZQ, On Tue, Jan 29, 2019 at 1:41 PM Z.q. Hou wrote: > > From: Hou Zhiqiang > > PCIe configuration access to non-existent function triggered > SERROR interrupt exception. > > Workaround: > Disable error reporting on AXI bus during the Vendor ID read > transactions in enumeration. > > This ERRATA is only for LX2160A Rev1.0, and it will be fixed > in Rev2.0. > > Signed-off-by: Hou Zhiqiang > --- > V3: > - Integrated without change from http://patchwork.ozlabs.org/patch/1006790/ > > .../controller/mobiveil/pci-layerscape-gen4.c | 37 +++++++++++++++++++ > .../controller/mobiveil/pcie-mobiveil-host.c | 17 ++++++++- > .../pci/controller/mobiveil/pcie-mobiveil.h | 3 ++ > 3 files changed, 56 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c > index 174cbcac4059..d2c5dbbd5e3c 100644 > --- a/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c > +++ b/drivers/pci/controller/mobiveil/pci-layerscape-gen4.c > @@ -22,8 +22,13 @@ > > #include "pcie-mobiveil.h" > > +#define REV_1_0 (0x10) > + > /* LUT and PF control registers */ > #define PCIE_LUT_OFF (0x80000) > +#define PCIE_LUT_GCR (0x28) > +#define PCIE_LUT_GCR_RRE (0) > + > #define PCIE_PF_OFF (0xc0000) > #define PCIE_PF_INT_STAT (0x18) > #define PF_INT_STAT_PABRST (31) > @@ -41,6 +46,7 @@ struct ls_pcie_g4 { > struct mobiveil_pcie *pci; > struct delayed_work dwork; > int irq; > + u8 rev; > }; > > static inline u32 ls_pcie_g4_lut_readl(struct ls_pcie_g4 *pcie, u32 off) > @@ -76,6 +82,15 @@ static bool ls_pcie_g4_is_bridge(struct ls_pcie_g4 *pcie) > return header_type == PCI_HEADER_TYPE_BRIDGE; > } > > +static int ls_pcie_g4_host_init(struct mobiveil_pcie *pci) > +{ > + struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); > + > + pcie->rev = csr_readb(pci, PCI_REVISION_ID); > + > + return 0; > +} > + > static int ls_pcie_g4_link_up(struct mobiveil_pcie *pci) > { > struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); > @@ -188,12 +203,34 @@ static void ls_pcie_g4_reset(struct work_struct *work) > ls_pcie_g4_reinit_hw(pcie); > } > > +static int ls_pcie_g4_read_other_conf(struct pci_bus *bus, unsigned int devfn, > + int where, int size, u32 *val) > +{ > + struct mobiveil_pcie *pci = bus->sysdata; > + struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci); > + int ret; > + > + if (pcie->rev == REV_1_0 && where == PCI_VENDOR_ID) > + ls_pcie_g4_lut_writel(pcie, PCIE_LUT_GCR, > + 0 << PCIE_LUT_GCR_RRE); > + > + ret = pci_generic_config_read(bus, devfn, where, size, val); > + > + if (pcie->rev == REV_1_0 && where == PCI_VENDOR_ID) > + ls_pcie_g4_lut_writel(pcie, PCIE_LUT_GCR, > + 1 << PCIE_LUT_GCR_RRE); > + > + return ret; > +} > + > static struct mobiveil_rp_ops ls_pcie_g4_rp_ops = { > .interrupt_init = ls_pcie_g4_interrupt_init, > + .read_other_conf = ls_pcie_g4_read_other_conf, > }; > > static const struct mobiveil_pab_ops ls_pcie_g4_pab_ops = { > .link_up = ls_pcie_g4_link_up, > + .host_init = ls_pcie_g4_host_init, > }; > > static int __init ls_pcie_g4_probe(struct platform_device *pdev) > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > index e8d0c4989013..5f51bc2dd6d7 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c > @@ -79,9 +79,20 @@ static void __iomem *mobiveil_pcie_map_bus(struct pci_bus *bus, > return pcie->rp.config_axi_slave_base + where; > } > > +static int mobiveil_pcie_config_read(struct pci_bus *bus, unsigned int devfn, > + int where, int size, u32 *val) > +{ > + struct mobiveil_pcie *pcie = bus->sysdata; > + struct root_port *rp = &pcie->rp; > + > + if (bus->number > rp->root_bus_nr && rp->ops->read_other_conf) > + return rp->ops->read_other_conf(bus, devfn, where, size, val); > + > + return pci_generic_config_read(bus, devfn, where, size, val); > +} > static struct pci_ops mobiveil_pcie_ops = { > .map_bus = mobiveil_pcie_map_bus, > - .read = pci_generic_config_read, > + .read = mobiveil_pcie_config_read, > .write = pci_generic_config_write, > }; > > @@ -309,6 +320,10 @@ int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit) > value |= (PCI_CLASS_BRIDGE_PCI << 16); > csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); > > + /* Platform specific host init */ > + if (pcie->ops->host_init) > + return pcie->ops->host_init(pcie); > + > return 0; > } > > diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > index 0ccd6cee5f8f..ab43de5e4b2b 100644 > --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h > +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h > @@ -145,6 +145,8 @@ struct mobiveil_msi { /* MSI information */ > > struct mobiveil_rp_ops { > int (*interrupt_init)(struct mobiveil_pcie *pcie); > + int (*read_other_conf)(struct pci_bus *bus, unsigned int devfn, > + int where, int size, u32 *val); > }; > > struct root_port { > @@ -160,6 +162,7 @@ struct root_port { > > struct mobiveil_pab_ops { > int (*link_up)(struct mobiveil_pcie *pcie); > + int (*host_init)(struct mobiveil_pcie *pcie); > }; > > struct mobiveil_pcie { > -- > 2.17.1 > can we have an english brief than having a internal cryptic number:A-011577, on the patch title?