Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2890242imc; Wed, 13 Mar 2019 04:00:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCyUsjtV+F3oSBqI3CKVTDFAYRjmow7wwhtdDwdcEmFLsti/vgBWUJz+7h7SFZYAeWcof+ X-Received: by 2002:a63:c118:: with SMTP id w24mr857196pgf.67.1552474813461; Wed, 13 Mar 2019 04:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552474813; cv=none; d=google.com; s=arc-20160816; b=ep1nJGuacaQBHrrz5O3eO3en3iW1a7r86J4YIiHfgYNnpH53k9rDswz8Gn1z/KrmAD +FQuS6OogaUjAv0qG1dCFdLU5PPmA7T2Aq0rYc+kL2seCeKFw5ZPGyd03yoJhA4OXkCa oEx61PF8oiJhS+32oC1Xo3goGGa6SYmHKvtnwWir6wq20JsidaPbasGn/NDM5aYbYRmy 1/u0w8fz3Jy33ytxjBmCC4nvCVlDS3/hnMSAI93SG/ySiSy/5s7ctH8sHmp9fvZwoVOB nl1pWCOSi2cl0t4UKZZtcJqypketY+zCtpSiqGloEV8n7oAMm7WHNDgVvdRkVnCDdl/e cXjQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=h4LFviQDP20Bf7IkpPDIpnlx1Y4FYEMNZGgLZoxCprA=; b=uBfX7+0Z7o1n2o4CCShE6aA/szSc24C5ev/iTSWR+HCmYP+wRyiRdPYu0L0zM7Fg2V S9wj6AjfokSEnMIc744N+I1FOnZONRHfCsxqpbjnn0lQAURfQ2UR3tjH7qVhZ4rUZhg1 3iTASntVhAWdm8IC9F0NtihV74NHrTEiMegce7+wfPyDFQiKxBBgqHhBUZ04zhT5VodC Sx5B+HLPi+nB9BDv+6f1uQHU7ZF7XkyG0bEZ/hHYoShzUN/knApGb1odManNXD3Zz7oc rcJSEPuZo+fhK8pRjXAcFehX0UXdyRKFN11qN1M/3fGdfGlQzkkXwz2+sVpaMmygB1Yu uklA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mobiveil.co.in header.s=google header.b=jHbxRFGF; 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 a9si9300594pgt.415.2019.03.13.03.59.57; Wed, 13 Mar 2019 04:00:13 -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=@mobiveil.co.in header.s=google header.b=jHbxRFGF; 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 S1726263AbfCMK7d (ORCPT + 99 others); Wed, 13 Mar 2019 06:59:33 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43815 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725847AbfCMK7d (ORCPT ); Wed, 13 Mar 2019 06:59:33 -0400 Received: by mail-wr1-f65.google.com with SMTP id d17so1447977wre.10 for ; Wed, 13 Mar 2019 03:59:31 -0700 (PDT) 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:content-transfer-encoding; bh=h4LFviQDP20Bf7IkpPDIpnlx1Y4FYEMNZGgLZoxCprA=; b=jHbxRFGFdyci9bWQbeBNbGi9uoJUlqlqtvRH6d22tI80JqWTI4jJ7lWcjfCe4//WD9 A+y3CubwpsHLmF6UhyfVIt45Y4f27tzeEa3HMJDylpqIl3HZKfQavd4Iv6IPU8dFEoZo 789eGZMRAhKQBiuP9lJPabM+8OQfBdIriKAX4= 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:content-transfer-encoding; bh=h4LFviQDP20Bf7IkpPDIpnlx1Y4FYEMNZGgLZoxCprA=; b=PAtS+99bIsllsHFwi/OGtsPmMW71K2S6fWtpwLx+J/RXHpK72LtuxjqC7AEv+KaeiF JeqMQnYbx1wLshSNIbSPgAUKT+3ncnBOWm/uFKcXBb9DNGb1/STNm1Ec+JJsm+LGRS/D qvSq4rP7NgUqjCIafqbqUuu6JsY762dReBJgWbJraRch8IGGMZHXSGteMZ8JybhxyiVc 6r1aoIvjaJfwZeOF1WZxpk5185Xha4MKz9CWbRu/SKqTRpmRFwaUxyS/UoevBOZZ7ZI/ CMxpVLks5lZuASdsXTzM2Nifg1vhM/Jr2RVBfM8LFwXHQkHDLxltjGqEglv7o/gktAUr JC9g== X-Gm-Message-State: APjAAAXEquRln2Qo6lWQ9Y0SpCHdKwj0urKj32kn19nkoc7jQJx7hVWb 4Zu0uERYb6DlMeeBD2mFdIgdC6tmtKtsDZBo3Aw01Q== X-Received: by 2002:a5d:6b07:: with SMTP id v7mr26531406wrw.314.1552474770378; Wed, 13 Mar 2019 03:59:30 -0700 (PDT) MIME-Version: 1.0 References: <20190311093130.7209-1-Zhiqiang.Hou@nxp.com> <20190311093130.7209-12-Zhiqiang.Hou@nxp.com> <20190311141401.GG214730@google.com> In-Reply-To: From: Subrahmanya Lingappa Date: Wed, 13 Mar 2019 16:29:18 +0530 Message-ID: Subject: Re: [PATCHv4 11/28] PCI: mobiveil: only fix up the Class Code field To: "Z.q. Hou" Cc: Bjorn Helgaas , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "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" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bjorn/ZQ, On Tue, Mar 12, 2019 at 2:48 PM Z.q. Hou wrote: > > Hi Bjorn, > > Thanks a lot for your comments! > > > -----Original Message----- > > From: Bjorn Helgaas [mailto:helgaas@kernel.org] > > Sent: 2019=E5=B9=B43=E6=9C=8811=E6=97=A5 22:14 > > 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; > > robh+dt@kernel.org; mark.rutland@arm.com; l.subrahmanya@mobiveil.co.in; > > shawnguo@kernel.org; Leo Li ; > > lorenzo.pieralisi@arm.com; catalin.marinas@arm.com; > > will.deacon@arm.com; Mingkai Hu ; M.h. Lian > > ; Xiaowei Bao > > Subject: Re: [PATCHv4 11/28] PCI: mobiveil: only fix up the Class Code = field > > > > On Mon, Mar 11, 2019 at 09:31:23AM +0000, Z.q. Hou wrote: > > > From: Hou Zhiqiang > > > > > > Fix up the Class Code to PCI bridge, do not change the Revision ID. > > > And move the fixup to mobiveil_host_init function. > > > > Add parens after function name. > > > > Please explain why this change is needed. Does it fix a bug? > > > > Does this fix the problem that the PCI core didn't correctly identify t= he device > > as a bridge because it identified bridges by class code instead of head= er type? > > > > That problem *should* be fixed by b2fb5cc57469 ("PCI: Rely on config sp= ace > > header type, not class code"), which is now upstream. > > > > You might still want this class code change so that lspci shows the cor= rect > > thing. That's fine, but the changelog should say why we're doing it. > > > > Subrahmanya's original patch is to fixup 'Class Code' field, but it also = fixed the 'Revision ID' field. This patch is patch is to remove the fixup o= f 'Revision ID' field. it was introduced during the test with 4.9 and 4.15 linux version, without this fix driver was not getting loaded. I belive it should be sufficient to mention in code comment: "Fixing the class code as hardware is not reflecting the correct class code", And the changelog for this patch mentioning "avoid changing the revision ID during the class code fix". Is that OK? Thanks, > > > > Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP > > > driver") > > > > Make this "Fixes:" line a single line again. > > > > > Signed-off-by: Hou Zhiqiang > > > Reviewed-by: Minghuan Lian > > > Reviewed-by: Subrahmanya Lingappa > > > --- > > > V4: > > > - no change > > > > > > drivers/pci/controller/pcie-mobiveil.c | 9 ++++++--- > > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/pci/controller/pcie-mobiveil.c > > > b/drivers/pci/controller/pcie-mobiveil.c > > > index 78e575e71f4d..8eee1ab7ee24 100644 > > > --- a/drivers/pci/controller/pcie-mobiveil.c > > > +++ b/drivers/pci/controller/pcie-mobiveil.c > > > @@ -653,6 +653,12 @@ static int mobiveil_host_init(struct mobiveil_pc= ie > > *pcie) > > > type, resource_size(win->res)); > > > } > > > > > > + /* fixup for PCIe class register */ > > > + value =3D csr_readl(pcie, PAB_INTP_AXI_PIO_CLASS); > > > + value &=3D 0xff; > > > + value |=3D (PCI_CLASS_BRIDGE_PCI << 16); > > > + csr_writel(pcie, value, PAB_INTP_AXI_PIO_CLASS); > > > + > > > /* setup MSI hardware registers */ > > > mobiveil_pcie_enable_msi(pcie); > > > > > > @@ -896,9 +902,6 @@ static int mobiveil_pcie_probe(struct > > platform_device *pdev) > > > goto error; > > > } > > > > > > - /* fixup for PCIe class register */ > > > - csr_writel(pcie, 0x060402ab, PAB_INTP_AXI_PIO_CLASS); > > > - > > > /* initialize the IRQ domains */ > > > ret =3D mobiveil_pcie_init_irq_domain(pcie); > > > if (ret) { > > > -- > > > 2.17.1 > > > > > Thanks, > Zhiqiang