Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1552328ybb; Fri, 29 Mar 2019 06:49:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9cogTP7PqAxFVX63PTSeAr8FXCluV3Sw419BYV2dK24EHjqX6eWTw7NiqFkTDD0hUQl1O X-Received: by 2002:a17:902:8c97:: with SMTP id t23mr1464941plo.110.1553867343764; Fri, 29 Mar 2019 06:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553867343; cv=none; d=google.com; s=arc-20160816; b=kLpY1g8gOHVyUaNyYNu3dnrhkp+lgwBBBsAQZn8U2QMGrjYGEy22UULiitDO1qpSfT BxtDK9d3FhxR257MKW3kWICANRgwYOPRpXKfo2N//WwXZfN4HspgO2+hXYDXlqTtHRxz DY/9QD7Lcip/P44WdXUVPWxv2DJpWwDzUzwCA+UKck2HTD9N0qN/lUXTYaMcyICCaUD4 PXydq1uFmM+ImnHu22tneFoVU2dJ8kQyDl24kRUG1wS4PzMeuNqbvfIkWHZz00vQrkz3 dD4ajJO3JKQEx+sDEwaEcGCr0H+yfzUL2o46hju76pca08VwDMbckWz6ckN1XcKjFZS/ 9O6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=w1UKS5ip8o+RTMHZhspRGiDbjDaZ07Rk0oIWJh1bKog=; b=V1Jww6M7YkMfb3Qr5AiNh7E6gWQRYGx43uJS8wTl7B5pqTKUkKRUbZt6A+KP/B+hsB wVnwKDpORZ69FkAO6L22hcMoWCsiIjkD9L2NT8acbjdkPmBDMnVvvUrOicNp+Cul0VYB Lnf1m/JPnodnViLHXVzNol7Pxz824P7C0rnEGsR1XIwD4cYj/k2X0Lxq7t5ARx01yi3E IRnvY67ZzWPwTO/K+3sR+YySQthI+y834rXoBlHSroSFV2tsnfvCZ4qnc27J8Z+W+3jL lD2kG1B047gdvH51Ogvk7PUPhHLmwl/q/KpuwgAS6r2tgnOX/iN6W0uAHzaV5PF8Y1VA dVVw== ARC-Authentication-Results: i=1; mx.google.com; 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 i9si1898164pgs.296.2019.03.29.06.48.48; Fri, 29 Mar 2019 06:49:03 -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; 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 S1729735AbfC2NsL (ORCPT + 99 others); Fri, 29 Mar 2019 09:48:11 -0400 Received: from ns.iliad.fr ([212.27.33.1]:33312 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729626AbfC2NsI (ORCPT ); Fri, 29 Mar 2019 09:48:08 -0400 Received: from ns.iliad.fr (localhost [127.0.0.1]) by ns.iliad.fr (Postfix) with ESMTP id 4EE9420BAC; Fri, 29 Mar 2019 14:48:06 +0100 (CET) Received: from [192.168.108.8] (freebox.vlq16.iliad.fr [213.36.7.13]) by ns.iliad.fr (Postfix) with ESMTP id 3023E20B19; Fri, 29 Mar 2019 14:48:06 +0100 (CET) Subject: Re: [PATCH v5] PCI: qcom: Use default config space read function From: Marc Gonzalez To: Bjorn Andersson Cc: Stanimir Varbanov , Bjorn Helgaas , Srinivas Kandagatla , Andy Gross , David Brown , PCI , MSM , LKML , Jeffrey Hugo References: <94bb3f22-c5a7-1891-9d89-42a520e9a592@free.fr> <65321fe3-ca29-c454-63ae-98a46c2e5158@mm-sol.com> <1205cbfb-ac06-63a5-9401-75d4e68b15b5@free.fr> <38ad143b-3b07-4d19-8ccd-ca39fb51e53d@free.fr> <7d3d788a-d6a3-a70b-adab-6c65771cacc4@free.fr> <3c76613e-e60d-94b8-dd6f-b8f4e1928263@linaro.org> <2f901228-52db-7661-8257-ca8fd2ff2a46@free.fr> <29664b43-535c-c4b1-a93d-18f49687f929@linaro.org> <9c5a7620-e9ed-82d6-0708-34fe33e39030@linaro.org> <29d33e81-fe8d-7fd9-843d-cc53ea6c9586@free.fr> <8cd24928-54d0-c320-b53f-08332d434477@free.fr> <66ae38dc-1c0c-5a76-be23-fb87db90b327@free.fr> Message-ID: Date: Fri, 29 Mar 2019 14:48:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <66ae38dc-1c0c-5a76-be23-fb87db90b327@free.fr> Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP ; ns.iliad.fr ; Fri Mar 29 14:48:06 2019 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bjorn, I think this patch is good enough to land now. Regards. On 25/03/2019 16:42, Marc Gonzalez wrote: > Move the device class fudge to a proper fixup function, and remove > qcom_pcie_rd_own_conf() which has become useless. > > NB: dw_pcie_setup_rc() already did the right thing, but it's broken > on older qcom chips, such as 8064. > > Signed-off-by: Marc Gonzalez > --- > Changes from v4 to v5: Apply fixup to all qcom chips, the same way it was before > (thus the code remains functionally equivalent) > Drop Srinivas' Tested-by tag because of the change > --- > drivers/pci/controller/dwc/pcie-qcom.c | 23 ++++++----------------- > 1 file changed, 6 insertions(+), 17 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c > index a7f703556790..0ed235d560e3 100644 > --- a/drivers/pci/controller/dwc/pcie-qcom.c > +++ b/drivers/pci/controller/dwc/pcie-qcom.c > @@ -1129,25 +1129,8 @@ static int qcom_pcie_host_init(struct pcie_port *pp) > return ret; > } > > -static int qcom_pcie_rd_own_conf(struct pcie_port *pp, int where, int size, > - u32 *val) > -{ > - struct dw_pcie *pci = to_dw_pcie_from_pp(pp); > - > - /* the device class is not reported correctly from the register */ > - if (where == PCI_CLASS_REVISION && size == 4) { > - *val = readl(pci->dbi_base + PCI_CLASS_REVISION); > - *val &= 0xff; /* keep revision id */ > - *val |= PCI_CLASS_BRIDGE_PCI << 16; > - return PCIBIOS_SUCCESSFUL; > - } > - > - return dw_pcie_read(pci->dbi_base + where, size, val); > -} > - > static const struct dw_pcie_host_ops qcom_pcie_dw_ops = { > .host_init = qcom_pcie_host_init, > - .rd_own_conf = qcom_pcie_rd_own_conf, > }; > > /* Qcom IP rev.: 2.1.0 Synopsys IP rev.: 4.01a */ > @@ -1309,6 +1292,12 @@ static const struct of_device_id qcom_pcie_match[] = { > { } > }; > > +static void qcom_fixup_class(struct pci_dev *dev) > +{ > + dev->class = PCI_CLASS_BRIDGE_PCI << 8; > +} > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_QCOM, PCI_ANY_ID, qcom_fixup_class); > + > static struct platform_driver qcom_pcie_driver = { > .probe = qcom_pcie_probe, > .driver = {