Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4282108imm; Fri, 18 May 2018 02:25:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXcYlYWkye+clcA/b0VeP36IYmJtXQ6JDi1yi2hcujZGnWT9nHiM416HZDXPzBDANh1tts X-Received: by 2002:a63:9205:: with SMTP id o5-v6mr6884508pgd.233.1526635552382; Fri, 18 May 2018 02:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526635552; cv=none; d=google.com; s=arc-20160816; b=pv6wKZWIoFaWBtWSyoyqtrN4hvxKSz0MFKP8DDPgG+C/7aJYqA+85BqDdAZ/+HqRRu y22+8fdXVrCy24vYpAYJcZzVyYo5Cs5/YIqQVUoFSnuSbKohhDjlO+gE9UiY7BpS/OIg 90Gg0NtkssdGZ2Fq9NRQ3D0om+I3DTO72eIIhE5LbCEy7hOc3fOKn+XwFttD4w7m6EEA dRvZHpjgJ0XRXSD2f0diHtBXVi170d2iuHKdm4dVR0yxRJL3xPNWb9fx3F9siuDEe7f/ eNfVH7l30sROjhjICLj4sWQha6eKBWa4Olcr15TQmCFVUF43rUOcMzCV52XtF3R4SvVC HbyA== 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=puKbFEAJ5SSbVU9ruJyIvINv5PVUJ5rwfmVP/G47jCw=; b=bWkREVGZtOuUI6q2WRCxxM0d9QXlKX8AqkkhMGPK1TRbaGO0zUADl6rFdjhWunJUdc zQglzDxwRXNDAErZ8X/TzZZ8MfgfxCdpZkTz6fodD+Xift70vfy0fn7teCXRkXSTGB3X jkr6WI3P040BwQthSmiPBRfe/0qcsgWFWD+Ru9yfnGxAASnpjUrJ10Yx+kOM+s27Bkwx md43DedeFEcBQMV8MgWgDWooK8PqlGhNji0qBJ1s08BLkV5FVLI+iC1ZMv/ogifPfqlY So2I5GXbA+DwqtW6Dr9/WtdjpWRq8teDP0j8rD3ayGoK5T20HFqGoBh6P59rkgeEtgkK N3EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=d94+ASrY; dkim=pass header.i=@codeaurora.org header.s=default header.b=bGaqb7oy; 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 g8-v6si5884526pgr.474.2018.05.18.02.25.38; Fri, 18 May 2018 02:25:52 -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=d94+ASrY; dkim=pass header.i=@codeaurora.org header.s=default header.b=bGaqb7oy; 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 S1753335AbeERJXp (ORCPT + 99 others); Fri, 18 May 2018 05:23:45 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:60192 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752783AbeERJXm (ORCPT ); Fri, 18 May 2018 05:23:42 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 32B22609D1; Fri, 18 May 2018 09:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526635422; bh=tBWOrEoSpMV4s8gQH6N8Bn1DrJwHAfFu5b6vzRqqPNk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=d94+ASrYN0/aYjktzOm6qUHuUeQKr1VkoSj2rm1IbiQEK0xjbG2LVGCRIUqgl7s/4 9i5Vhsvwd+6km1r08O1aIJpAT00hXIhUx9aFdU6rdUaK0g9CELvhW2OLiuTisGecgY 2gpVZhHpulIlVxVlSHxpGUCz2bk1eF8X5uBiw51k= 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 CB5A260131; Fri, 18 May 2018 09:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526635421; bh=tBWOrEoSpMV4s8gQH6N8Bn1DrJwHAfFu5b6vzRqqPNk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bGaqb7oyPO28lkSYzaMcc0vOzuSs/s7itAY6epD/C6G774qYMIKIBFnl9hUO121RP WkvFK3pwLEP3ff8TcJFhrwRLMdPQt72nN9PEuIzw3jIN5hW8CEMEcK98jsayabMUHf Uewv8GL6tcgTrk+wReWxCMSJPRsl7giIqdHMN9pw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 18 May 2018 14:53:41 +0530 From: poza@codeaurora.org To: Ray Jui Cc: Bjorn Helgaas , Lorenzo Pieralisi , 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 INTERNAL 3/3] PCI: iproc: Disable MSI parsing in certain PAXC blocks In-Reply-To: <1526577692-21104-4-git-send-email-ray.jui@broadcom.com> References: <1526577692-21104-1-git-send-email-ray.jui@broadcom.com> <1526577692-21104-4-git-send-email-ray.jui@broadcom.com> Message-ID: 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-05-17 22: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 3c76c5f..b906d80 100644 > --- a/drivers/pci/host/pcie-iproc.c > +++ b/drivers/pci/host/pcie-iproc.c > @@ -1144,10 +1144,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; > + } > + > /* > * 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 > @@ -1201,7 +1213,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); Are you calling iproc_pcie_paxc_v2_msi_steer() anywhere else with 'false' ? I see its getting called only from one place in current code iproc_pcie_msi_steer(). > break; > default: > return -EINVAL; > @@ -1427,6 +1439,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");