Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp703468pxb; Thu, 2 Sep 2021 13:03:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8Qd/KEKESAwPRvLgaF2Y9uV5N2NoX51LFN0ngs95SLjf7qjsjajPcwvjjx7SYs8rbjwW/ X-Received: by 2002:a1c:f206:: with SMTP id s6mr4711062wmc.102.1630613030542; Thu, 02 Sep 2021 13:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630613030; cv=none; d=google.com; s=arc-20160816; b=r+YARfdZ2H5Ji541/dnbkW2/a3AS8idVHLmMB78Ig9bMpCx+Z0wbNuncktGcaaUe30 BJ7TJlFN8nf1TiyPyfbOUMyQf/PxdEPhvWeuebiul7MaW1IQS9/Y4td4QEfbVU+9vSUR UydrWvmoiWPsD2aSOGRkdCqHFqw/aETiFCg2Q4YwHzCs6RJLs3a/4KQTGe5l6kC8wgMB 2Ho63wDsXEplRle8RSwX5INGN+Jgl7vwFB2KY17FCTt8wMXknZIx8V6YUlhcudzD+EZo V6Rst6IHaOjKNfXkn3C8lP2c+MGfmftW/ZdZKWCyPqpp5x9qWnZTo6qSAys8ljtL6UdR Tnlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hw/fBL3opA2bLcUR0yVQdYJHI5iiXQ/mTOUvyfi2qwc=; b=AavE3JOMeNzvoYDlN7InPqDoIzjZ5IBOfB4oEtcuOuvuZKDsG91mywU0x1CoO+D9vz H7KUTpIVVVjRDGb8imjnOTppkKP85uDdF09DtkXTKGgUF/gTbOqDKg+IcZ3jkF6DsvbK ev2kMalcJJV55Mtf7oSnW9RKrpzVOP6Yj8tSX1Pd6jWT2se9JXJ6IGKclFmirFWmi4rm S+rM0Mv2FcIfwU2ciVpmhZ9rLWv6FUESlsb3ZFOxERMB9D2HY6USMWkCD5T96wEp7zH1 3a4cPMU30BQSnoJU+5VHjlvsk2bGp8rnKFqJ6s7XMR365/L7lFIn4czjn/04GJA34tmE pyeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MfSV52wF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si2789923edc.485.2021.09.02.13.03.27; Thu, 02 Sep 2021 13:03:50 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MfSV52wF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345517AbhIBOZv (ORCPT + 99 others); Thu, 2 Sep 2021 10:25:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:41338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345318AbhIBOZl (ORCPT ); Thu, 2 Sep 2021 10:25:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35B16610A4; Thu, 2 Sep 2021 14:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630592682; bh=8Q26juGy7jduIrtBN/cCky6QYZFj3PapNW4w/N2c58A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MfSV52wFAuVERyUEr7ffSXU2OWRVhIHVwUF/DBjm6//ZPMP2omLe9EgMjfeybJoY9 JxMBMKfrVfCJLRcXeO7r1Xq2jL/xRrCiEJZQQrBxLyIos/09gukp93iPF6GTtfpohX ymSe81lXKn/90vujjv2rzeszJP5oWVuGgAlSHPn3oHRRVtKsvJgkm3LFjbyGQ8so19 ZtK6Mf9r4RPhM9GEV/QASooW1f5H+9z0Tzt4e7xptfrQuhRJL+GSqLkF6K5bvTjMwL m9ZEgP84FfrMGNTA/pqJSPne8/oWRkNK4x7+BVGOjy/GBXUi8JxYQn95XlgOqA7iJ+ HwAGKsh2NwqQg== Received: by mail-ej1-f49.google.com with SMTP id bt14so4819282ejb.3; Thu, 02 Sep 2021 07:24:42 -0700 (PDT) X-Gm-Message-State: AOAM530FRted8ehtHP8Yjx7V6L+OCpD29ZC2K7E/9CYmx/VHmW8chsqo z6oVoDhs6YBADyvW2lE1h/Bflt6A6HXPeXIpkg== X-Received: by 2002:a17:906:8cd:: with SMTP id o13mr4136037eje.341.1630592680828; Thu, 02 Sep 2021 07:24:40 -0700 (PDT) MIME-Version: 1.0 References: <20210902025528.1017391-1-saravanak@google.com> <20210902025528.1017391-3-saravanak@google.com> In-Reply-To: <20210902025528.1017391-3-saravanak@google.com> From: Rob Herring Date: Thu, 2 Sep 2021 09:24:29 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1 2/2] of: platform: Mark bus devices nodes with FWNODE_FLAG_NEVER_PROBES To: Saravana Kannan Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Frank Rowand , Len Brown , Ulf Hansson , Android Kernel Team , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, "open list:ACPI FOR ARM64 (ACPI/arm64)" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 1, 2021 at 9:55 PM Saravana Kannan wrote: > > We don't want fw_devlink creating device links for bus devices as > they'll never probe. So mark those device node with this flag. > > Signed-off-by: Saravana Kannan > --- > drivers/of/platform.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/of/platform.c b/drivers/of/platform.c > index 74afbb7a4f5e..42b3936d204a 100644 > --- a/drivers/of/platform.c > +++ b/drivers/of/platform.c > @@ -392,6 +392,22 @@ static int of_platform_bus_create(struct device_node *bus, > if (!dev || !of_match_node(matches, bus)) > return 0; > > + /* > + * If the bus node has only one compatible string value and it has > + * matched as a bus node, it's never going to get probed by a device > + * driver. So flag it as such so that fw_devlink knows not to create > + * device links with this device. > + * > + * This doesn't catch all devices that'll never probe, but this is good > + * enough for now. > + * > + * This doesn't really work for PPC because of how it uses > + * of_platform_bus_probe() to add normal devices. So ignore PPC cases. > + */ > + if (!IS_ENABLED(CONFIG_PPC) && > + of_property_count_strings(bus, "compatible") == 1) > + bus->fwnode.flags |= FWNODE_FLAG_NOT_DEVICE; This looks fragile relying on 1 compatible string, and the DT flags in this code have been fragile too. I'm pretty sure we have cases of simple-bus or simple-mfd that also have another compatible. Couldn't we solve this with a simple driver? Make 'simple-pm-bus' driver work for other cases? BTW, this patch doesn't even work for simple-pm-bus. A driver for simple-bus may cause issues if there's a more specific driver to bind to as we don't handle that. It's simply whichever matches first. Rob