Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12822028rwl; Tue, 3 Jan 2023 22:20:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXuZj5jvaSLoOSN4ODm0xYm7qKDNNN6xsVpwkuh9wOmwJBFIIx5ZoQf5lGuXzqKV6fsm0xOu X-Received: by 2002:a17:902:da86:b0:187:3921:2b1c with SMTP id j6-20020a170902da8600b0018739212b1cmr69120433plx.55.1672813241954; Tue, 03 Jan 2023 22:20:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672813241; cv=none; d=google.com; s=arc-20160816; b=JW+dz51S99jZQQvMg+C2/lp31QcxRNWdo9vZwrpTunI2hfOa2wpUIocOC1u7ylK8vn 0oO8e/KQKwk6MJ5XNgFV4breiA4tk1IKJAFUDDrWTEu07+O7Gb+Ldva4oiM5t8zyx5j0 TldcSwGhPnBDsHrx/eYWM+RW/+RxcxHmOUd2lePZFH35ZZVQhfQLIQ2n61pgmjVApmpx qe0S/ZbgB9Z5JLfWbBN70FJJ4ES5j6C7fQ+S+j4tN8dIDV+X8WvN50xiiwcR+j/sE5UN T+Rjghtx77hm9fPJeiRRwEXFLDjNRdSJFHr1gXd1SEobx7K1TqdZ6NfMElxPo0TdbjRd uthA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=aaHO5HW0/jdyJgkDv80hMQrubxOJMAsxdLC43TtMutA=; b=ZJnHjeQ2MD8GJM3pGon7Bo5TaD/278h6aUn0iDARU545k1/Ondt+G3hsnonFZ0gW4T f0O+tekMCJtz7NihyxKgdiix8D0N984iLwEAdMRIGfXqzV76BKDRwClIzIIijMveTKxW ugHMyGrvVBUKzDyigiR1iMzh0Kdn0y396Gy4Lu1bck8qbPSiKqLKiSqPyOZsbtVke5vW pHywrEUEi8b4kVaIL7Gk3mf+DyecYinKVy9EpQqcdG0sdiCoEi+OUJPufZNkteDoOYf4 JKC+76B0lMYc+yqTaV6G4K38y53Jo6aFou8e2Wo4r6kZOo9w4p6EgmcBbZMRqKQDvtPc Jszg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MVsw7RD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j26-20020a63551a000000b004782dc93af4si33413452pgb.307.2023.01.03.22.20.34; Tue, 03 Jan 2023 22:20:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MVsw7RD7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233072AbjADF5e (ORCPT + 59 others); Wed, 4 Jan 2023 00:57:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233194AbjADF5Y (ORCPT ); Wed, 4 Jan 2023 00:57:24 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2AD217E01; Tue, 3 Jan 2023 21:57:17 -0800 (PST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPA id 66F24C0003; Wed, 4 Jan 2023 05:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1672811836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aaHO5HW0/jdyJgkDv80hMQrubxOJMAsxdLC43TtMutA=; b=MVsw7RD7e/dmgFjFFlzS3wJbIzgCtceXUQz8DUjxIfIQvDZVb9e42V/XYROwutZLoEFvJ6 Kmf1mcQAxBnKnDHFiJ8RGiF698Kb5NaptrYVwhsXNK8NhdpCbBNWVmTQA1D1jclhFRUp6v WeBcmYyTfM3NQq08Y2CRqulBy/Cto9xcOaW5sAt8es82F+YbEG4PqKBwHEcFqLH2oyoVwv sPr9EPVrxxi4UvW4TQdByi64QAb0866m+byNLFegin+880F6Dv8/ZvzKfVhYZUJrE/kyP7 tJgy1n/1lYvQ0fxx7NOIhrXIGOH7v4RcsfXfvtctUuvpaLCGlbujpnskHxm0Ew== MIME-Version: 1.0 Date: Wed, 04 Jan 2023 06:57:14 +0100 From: clement.leger@bootlin.com To: Lizhi Hou Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, robh@kernel.org, frowand.list@gmail.com, helgaas@kernel.org, max.zhen@amd.com, sonal.santan@amd.com, larry.liu@amd.com, brian.xu@amd.com, stefano.stabellini@xilinx.com, trix@redhat.com, Thomas Petazzoni , Allan.Nielsen@microchip.com, Horatiu.Vultur@microchip.com, Steen.Hegelund@microchip.com Subject: Re: [PATCH V5 2/3] PCI: Create device tree node for selected devices In-Reply-To: References: <1671125446-57584-1-git-send-email-lizhi.hou@amd.com> <1671125446-57584-3-git-send-email-lizhi.hou@amd.com> <20230103154811.63e71494@fixe.home> Message-ID: <7eb33924fc380669893571747b999660@bootlin.com> X-Sender: clement.leger@bootlin.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 2023-01-04 01:31, Lizhi Hou a écrit : > On 1/3/23 06:48, Clément Léger wrote: >> Le Thu, 15 Dec 2022 09:30:45 -0800, >> Lizhi Hou a écrit : >> >>> + >>> +static int of_pci_prop_address_cells(struct pci_dev *pdev, >>> + struct of_changeset *ocs, >>> + struct device_node *np) >>> +{ >>> + return of_changeset_add_prop_u32(ocs, np, "#address_cells", >>> + OF_PCI_ADDRESS_CELLS); >>> +} >> Hi Lizhi, >> >> This should be #address-cells and not #address_cells. >> >>> + >>> +static int of_pci_prop_size_cells(struct pci_dev *pdev, >>> + struct of_changeset *ocs, >>> + struct device_node *np) >>> +{ >>> + return of_changeset_add_prop_u32(ocs, np, "#size_cells", >>> + OF_PCI_SIZE_CELLS); >>> +} >> Ditto here, this should be #size-cells and not #size_cells. Was this >> really tested ? > > I will fix this.  I verified the properties are generated and did not > notice the '_' error. Hi Lizhi, The most important thing to test is if a driver can correctly retrieve resource of the device using a node added below the created PCI device node. This is resolved using the whole hierarchy ranges, address-cells and size-cells properties. If not correctly set, this will fail (and it fails). Clément > > > Thanks, > > Lizhi > >> >> Thanks, >>