Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3507641ybz; Mon, 4 May 2020 04:28:40 -0700 (PDT) X-Google-Smtp-Source: APiQypIk5cHmvca6UQg3euZJg0SfqDt+QDPzBEGaB8dPTre+BTycwwdFPOxqk9Uzdmiv1kDSkpj+ X-Received: by 2002:a17:906:f91:: with SMTP id q17mr14298620ejj.7.1588591720014; Mon, 04 May 2020 04:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588591720; cv=none; d=google.com; s=arc-20160816; b=BxR2u5iu84q1A/FcjKoy6bY4juJ5J0PQ6Y9zYD8G/Blrp/TFhBuATrMVXdt5M/nqW8 76OS1K16NoNseDXHh/FzVxSuBcV3wuoyi2H7eWOrGzrc9T8jOIwGuu6ygCyFcaYwFY7c 0vhjk5jC16UfD6swygI6FTIHw39xIqC8Qj5ta7Yn3HjAVUsEXXVIMGVsHT5jhwm4GtqJ Y+Kvjzia1u9P7efxMKwJQragNvfpWZ9+v8refEXDI9blIfsFftFHC3MkGhaEEUNSXrrL S1G4m8/0afmN8fJkbw44yJMxc4xMEVk1YEByVFIiAWTptjnPvPnzFTfgPTzuCcMTVnpp FKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ixtz1XolvKrPM7xxnIK6VIbkJnXU5BBKN3oVWxJz+SI=; b=MfIRYboYTXfrQfssvkAjBSr7lTR5glmUa8cX1Nf/pLBsjKL0KwWU+4hnBuyHWn3xit rqm5HX3Rf2PcFtnk/81UkhZjXX509qYtCwmVA9Pzm1oYy3R7uejjKQK+slWBy8nCs22n HJIalKh/rBG1DQheOSbrDU26DbAqSa7EQz8rMOKobzzn8WcK0aBmhRCnydF49f1wbbye Rm3pUvdkXxFh44c8tPUQSkOF/Myxp0OLf5Ck6JRX4OGlOOvBsSgcWORJDwhnlJKyy0Pd T3ZFvbBvUYWgbykyovq9Ben6ZI80tJhvmdTmC7G6gsXOGXxG/CqYPeoXqz6LKOrNNbGR 5pdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si6781517ejn.341.2020.05.04.04.28.16; Mon, 04 May 2020 04:28:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728296AbgEDLZq (ORCPT + 99 others); Mon, 4 May 2020 07:25:46 -0400 Received: from foss.arm.com ([217.140.110.172]:42270 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbgEDLZq (ORCPT ); Mon, 4 May 2020 07:25:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 623631FB; Mon, 4 May 2020 04:25:45 -0700 (PDT) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 433BC3F71F; Mon, 4 May 2020 04:25:44 -0700 (PDT) Date: Mon, 4 May 2020 12:25:35 +0100 From: Lorenzo Pieralisi To: Kishon Vijay Abraham I Cc: Tom Joseph , Bjorn Helgaas , Rob Herring , Andrew Murray , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] PCI: cadence: Fix to read 32-bit Vendor ID/Device ID property from DT Message-ID: <20200504112535.GA27662@e121166-lin.cambridge.arm.com> References: <20200417114322.31111-1-kishon@ti.com> <20200417114322.31111-5-kishon@ti.com> <20200501151131.GC7398@e121166-lin.cambridge.arm.com> <47cc8236-4bec-244d-4ab3-cda8eb37d4bf@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47cc8236-4bec-244d-4ab3-cda8eb37d4bf@ti.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 04, 2020 at 02:22:30PM +0530, Kishon Vijay Abraham I wrote: > Hi Lorenzo, > > On 5/1/2020 8:41 PM, Lorenzo Pieralisi wrote: > > On Fri, Apr 17, 2020 at 05:13:22PM +0530, Kishon Vijay Abraham I wrote: > >> The PCI Bus Binding specification (IEEE Std 1275-1994 Revision 2.1 [1]) > >> defines both Vendor ID and Device ID to be 32-bits. Fix > >> pcie-cadence-host.c driver to read 32-bit Vendor ID and Device ID > >> properties from device tree. > >> > >> [1] -> https://www.devicetree.org/open-firmware/bindings/pci/pci2_1.pdf > >> > >> Signed-off-by: Kishon Vijay Abraham I > >> --- > >> drivers/pci/controller/cadence/pcie-cadence-host.c | 4 ++-- > >> drivers/pci/controller/cadence/pcie-cadence.h | 4 ++-- > >> 2 files changed, 4 insertions(+), 4 deletions(-) > > > > I don't see how you would use a 32-bit value for a 16-bit register so > > certainly the struct cdns_pcie_rc fields size is questionable anyway. > > > > I *assume* you are referring to 4.1.2.1 and the property list > > encoded as "encode-int". > > > > I would like to get RobH's opinion on this - I don't know myself > > whether the PCI OF bindings you added are still relevant and how > > they should be interpreted. > > This change was made due to RobH's comment below [1] > > [1] -> > https://lore.kernel.org/r/CAL_JsqLYScxGySy8xaN-UB6URfw8K_jSiuSXwVoTU9-RdJecww@mail.gmail.com/ Thanks for the pointer - that's what I needed to proceed with this patch. Lorenzo > Thanks > Kishon > > > > > Thanks > > Lorenzo > > > >> diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c > >> index 8f72967f298f..31e67c9c88cf 100644 > >> --- a/drivers/pci/controller/cadence/pcie-cadence-host.c > >> +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c > >> @@ -229,10 +229,10 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) > >> } > >> > >> rc->vendor_id = 0xffff; > >> - of_property_read_u16(np, "vendor-id", &rc->vendor_id); > >> + of_property_read_u32(np, "vendor-id", &rc->vendor_id); > >> > >> rc->device_id = 0xffff; > >> - of_property_read_u16(np, "device-id", &rc->device_id); > >> + of_property_read_u32(np, "device-id", &rc->device_id); > >> > >> res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg"); > >> pcie->reg_base = devm_ioremap_resource(dev, res); > >> diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h > >> index 6bd89a21bb1c..df14ad002fe9 100644 > >> --- a/drivers/pci/controller/cadence/pcie-cadence.h > >> +++ b/drivers/pci/controller/cadence/pcie-cadence.h > >> @@ -262,8 +262,8 @@ struct cdns_pcie_rc { > >> struct resource *bus_range; > >> void __iomem *cfg_base; > >> u32 no_bar_nbits; > >> - u16 vendor_id; > >> - u16 device_id; > >> + u32 vendor_id; > >> + u32 device_id; > >> }; > >> > >> /** > >> -- > >> 2.17.1 > >>