Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5051184imm; Tue, 12 Jun 2018 01:30:45 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL70n1891ljo3DbFK8m6mM6wDbhD2A+jAUvAdDG/bfxDcnQDAreIdItRA+bPAFgYtVunqyP X-Received: by 2002:a17:902:9a4b:: with SMTP id x11-v6mr2975463plv.176.1528792245399; Tue, 12 Jun 2018 01:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528792245; cv=none; d=google.com; s=arc-20160816; b=vCwcMj7l8WGAj2QlpqWGzyHVsRk3IGZGpZH8tUPvZSzO84EkcXd/0Ktu0GEWQsAY8w 91p5B/SJPbczP2ohG3U3kkgudauB8GqmdJSSwYZG2ou/CS2SrB8cMMmADdhNf7HtTSJV rcwy2tX8SMRmK6TbxeiLxMNLWGh2td+sGN1sMwF2Mlu0tadtZUUfbqKubnr8oZ6J3Ct2 ht0o6cEuVBrnn9Hpv8iIW8AumH6Bv7UfX9WAALUq6vYXukiNLC+P6Xubu8iwUKwqF8Hu +z+3++LIDRDfNtDufRSpb/jx6j4VHsZFZ1e2sdSU6sJJNGUoFy5cZ+A6iMJNNX5PuNmF 8dZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=s/F9pl2a3lxf1vmMtFFf2ct5Zcm76MEAdvPZsuzY8yQ=; b=jwnfNw2DSsOhHU1MKxdAuhY29zs5LmsJ779ohkU8qmVV/QFlKpck3J6yK0FqhMdI0J k5KTuYDg4AXxAPLSmB6ixM5Anb3D9va2eCNBVM9kZsNxMJqp/SbsNMnyI1QBcwTclOb3 LF8T2NigXRHCbiHsbQHc+MH76FT5nFpr1ofrRUIafcVrOhd0NTXjY/QxlJzUEn/844HO YW7weiA0W+PRDqIqXIWM/yu9ETTpPSGLGlWVejwHhJzLj7W5YlP9anWeD/XGAFjOhMSJ xX0MTMH5yWDy9vSYM9E5zjCrB3PFOFAqxBRDAHnpnrr7VcHCYffX1qpbvJlwKNwefmja VEAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=MAGlRHFO; dkim=pass header.i=@codeaurora.org header.s=default header.b=MAGlRHFO; 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 r21-v6si320648pfh.333.2018.06.12.01.30.30; Tue, 12 Jun 2018 01:30:45 -0700 (PDT) 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=@codeaurora.org header.s=default header.b=MAGlRHFO; dkim=pass header.i=@codeaurora.org header.s=default header.b=MAGlRHFO; 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 S933848AbeFLI31 (ORCPT + 99 others); Tue, 12 Jun 2018 04:29:27 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:47352 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933790AbeFLI3Z (ORCPT ); Tue, 12 Jun 2018 04:29:25 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9531560116; Tue, 12 Jun 2018 08:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528792164; bh=E3ux/QqRgo6n1lJofttxerzRRsuNuvf4yw6O2Bhrr+Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MAGlRHFOVJfvQdqxkqU4TK4jXFXj3NRQhNnt9C4K3TzX1irNUbdWDsC0EVWaLKhAu 5EEc2gDMu+bcJYfbQ+uWebbKJcYLl4b/zjiftlCVz7fpVGSD5jxGGYDnpxRzqIf4cj FELeQcg8oEPkJfo/3KaY0XXxb5IaYBCd5OKqmTMc= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 2DCC9602BD; Tue, 12 Jun 2018 08:29:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528792164; bh=E3ux/QqRgo6n1lJofttxerzRRsuNuvf4yw6O2Bhrr+Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MAGlRHFOVJfvQdqxkqU4TK4jXFXj3NRQhNnt9C4K3TzX1irNUbdWDsC0EVWaLKhAu 5EEc2gDMu+bcJYfbQ+uWebbKJcYLl4b/zjiftlCVz7fpVGSD5jxGGYDnpxRzqIf4cj FELeQcg8oEPkJfo/3KaY0XXxb5IaYBCd5OKqmTMc= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 12 Jun 2018 13:59:24 +0530 From: poza@codeaurora.org To: Ray Jui Cc: Lorenzo Pieralisi , Bjorn Helgaas , Bjorn Helgaas , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, linux-pci-owner@vger.kernel.org Subject: Re: [PATCH v2 3/5] PCI: iproc: Disable MSI parsing in certain PAXC blocks In-Reply-To: <1528762867-16823-4-git-send-email-ray.jui@broadcom.com> References: <1528762867-16823-1-git-send-email-ray.jui@broadcom.com> <1528762867-16823-4-git-send-email-ray.jui@broadcom.com> Message-ID: <8f6d7771baec3f56e0ccf5efd0efe2a2@codeaurora.org> X-Sender: poza@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-06-12 05:51, Ray Jui wrote: > The internal MSI parsing logic in certain revisions of PAXC root > complexes does not work properly and can casue corruptions on the > writes. They need to be disabled > > Signed-off-by: Ray Jui > Reviewed-by: Scott Branden > --- > drivers/pci/host/pcie-iproc.c | 34 ++++++++++++++++++++++++++++++++-- > 1 file changed, 32 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/host/pcie-iproc.c > b/drivers/pci/host/pcie-iproc.c > index 680f6b1..0804aa2 100644 > --- a/drivers/pci/host/pcie-iproc.c > +++ b/drivers/pci/host/pcie-iproc.c > @@ -1197,10 +1197,22 @@ static int iproc_pcie_paxb_v2_msi_steer(struct > iproc_pcie *pcie, u64 msi_addr) > return ret; > } > > -static void iproc_pcie_paxc_v2_msi_steer(struct iproc_pcie *pcie, u64 > msi_addr) > +static void iproc_pcie_paxc_v2_msi_steer(struct iproc_pcie *pcie, u64 > msi_addr, > + bool enable) > { > u32 val; > > + if (!enable) { > + /* > + * Disable PAXC MSI steering. All write transfers will be > + * treated as non-MSI transfers > + */ > + val = iproc_pcie_read_reg(pcie, IPROC_PCIE_MSI_EN_CFG); > + val &= ~MSI_ENABLE_CFG; > + iproc_pcie_write_reg(pcie, IPROC_PCIE_MSI_EN_CFG, val); > + return; can be dropped. > + } > + > /* > * Program bits [43:13] of address of GITS_TRANSLATER register into > * bits [30:0] of the MSI base address register. In fact, in all > iProc > @@ -1254,7 +1266,7 @@ static int iproc_pcie_msi_steer(struct iproc_pcie > *pcie, > return ret; > break; > case IPROC_PCIE_PAXC_V2: > - iproc_pcie_paxc_v2_msi_steer(pcie, msi_addr); > + iproc_pcie_paxc_v2_msi_steer(pcie, msi_addr, true); > break; > default: > return -EINVAL; > @@ -1480,6 +1492,24 @@ int iproc_pcie_remove(struct iproc_pcie *pcie) > } > EXPORT_SYMBOL(iproc_pcie_remove); > > +/* > + * The MSI parsing logic in certain revisions of Broadcom PAXC based > root > + * complex does not work and needs to be disabled > + */ > +static void quirk_paxc_disable_msi_parsing(struct pci_dev *pdev) > +{ > + struct iproc_pcie *pcie = iproc_data(pdev->bus); > + > + if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE) > + iproc_pcie_paxc_v2_msi_steer(pcie, 0, false); > +} > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, > + quirk_paxc_disable_msi_parsing); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802, > + quirk_paxc_disable_msi_parsing); > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd804, > + quirk_paxc_disable_msi_parsing); > + > MODULE_AUTHOR("Ray Jui "); > MODULE_DESCRIPTION("Broadcom iPROC PCIe common driver"); > MODULE_LICENSE("GPL v2");