Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5084488pxu; Wed, 21 Oct 2020 12:56:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxL3oMAO7v+FsPYLbzJUZPdQy5Gv+20T4DutbHwH5XkJI+xFAtS2WLpqlC8R2vbqKYGXla X-Received: by 2002:a17:906:3c05:: with SMTP id h5mr5088274ejg.70.1603310189866; Wed, 21 Oct 2020 12:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603310189; cv=none; d=google.com; s=arc-20160816; b=yzLcBZ3l1AZpz5ru9b/8cyGthCVGwwsOjYCwOiFqBVY9El+9qUPVd/TMlymrXYsWLb zRXexgCIVuzDIsKtNWSqtN/A33fD0ytTkUcsxk/fRHUhByYkx5A+S95hiPurS+4HDUcI OL52XsmAXrBYbUclS/P57zuOggTWgWPyG3cDot7ywzP9QjQH4g+ZNmriKa6Owr2rEJ6S 6G23fiy90Hd/gConZYBRo2YcWwGcuLEvv+bgXn+b5drP1Vgj+dza7y3naUuJKbQtJPSB KAKFn+NDU5U+Vvb8hzDMoFiQkjm/Pu9dox/2qnSuD3nnfl6ETyGV0rUCL7/FgqqaD30r VcuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=IxNQgiLBn6KJBFIc0BUay+EJMCW3V/Q/QjCV0hH0wSM=; b=kjo86Ohk8EM9B9mLkgsaxvAF9/1Ewu3Fsm57PxitySRcZA2YuNGmSucseymyfNIjIN PQwTxWjY5vLbqaMVMKpX9JYSTkETZ7CdqzRj1iglAFheMrjUGNmuPRk0V3JslGngOC5W c4DgeuZrfhYvgh36VufN5GzvtsJZ11pc5SZc8Yw8UgLJVROoaXKGz+qu99c/GxyoHDjz MD3P225HDVRUXk/OAPpHITq+JKzAv3RKHE0vnVsaiRSACUlmXPp7itJ/ayq4SDngqfmO im/bAhq7YWvTxey+SHRhtw6+EjfX90HtzstRFqBOx0/2Qt04gY0dKfR4lV3K6vKNix2l Opig== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx26si1824482edb.360.2020.10.21.12.56.07; Wed, 21 Oct 2020 12:56:29 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410408AbgJTWtU (ORCPT + 99 others); Tue, 20 Oct 2020 18:49:20 -0400 Received: from mga09.intel.com ([134.134.136.24]:16074 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2410401AbgJTWtT (ORCPT ); Tue, 20 Oct 2020 18:49:19 -0400 IronPort-SDR: Sc7Ie1KyWDWWUzO9HwrLpjwuQM5oKyVlHLodTKY3qx7WFr8IHCQwpWgLjl85cv7v3FazxIqZlM 7XfH/vtID5jQ== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="167407217" X-IronPort-AV: E=Sophos;i="5.77,399,1596524400"; d="scan'208";a="167407217" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 15:49:18 -0700 IronPort-SDR: 4KiBMEZzhtiQLObbYps0EonH2PxWkSsibGHJRBHbKboL9QF9BoQlRwfIm+RlrRrbTt2zTKbaAF 8ls4rvJ5hBwg== X-IronPort-AV: E=Sophos;i="5.77,399,1596524400"; d="scan'208";a="358690253" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 15:49:12 -0700 Received: by paasikivi.fi.intel.com (Postfix, from userid 1000) id 06753206F4; Wed, 21 Oct 2020 01:49:11 +0300 (EEST) Date: Wed, 21 Oct 2020 01:49:10 +0300 From: Sakari Ailus To: Dan Scally Cc: Andy Shevchenko , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux.walleij@linaro.org, prabhakar.mahadev-lad.rj@bp.renesas.com, heikki.krogerus@linux.intel.com, dmitry.torokhov@gmail.com, laurent.pinchart+renesas@ideasonboard.com, kieran.bingham+renesas@ideasonboard.com, jacopo+renesas@jmondi.org, robh@kernel.org, davem@davemloft.net, linux@rasmusvillemoes.dk, sergey.senozhatsky@gmail.com, rostedt@goodmis.org, pmladek@suse.com, mchehab@kernel.org, tian.shu.qiu@intel.com, bingbu.cao@intel.com, yong.zhi@intel.com, rafael@kernel.org, gregkh@linuxfoundation.org, kitakar@gmail.com, dan.carpenter@oracle.org Subject: Re: [RFC PATCH v3 7/9] ipu3-cio2: Check if pci_dev->dev's fwnode is a software_node in cio2_parse_firmware() and set FWNODE_GRAPH_DEVICE_DISABLED if so Message-ID: <20201020224910.GB2703@paasikivi.fi.intel.com> References: <20201019225903.14276-1-djrscally@gmail.com> <20201019225903.14276-8-djrscally@gmail.com> <20201020091958.GC4077@smile.fi.intel.com> <20201020120615.GV13341@paasikivi.fi.intel.com> <32bbb4db-17d7-b9d1-950f-8f29d67539c3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32bbb4db-17d7-b9d1-950f-8f29d67539c3@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, On Tue, Oct 20, 2020 at 08:56:07PM +0100, Dan Scally wrote: > Hi Sakari > > On 20/10/2020 13:06, Sakari Ailus wrote: > > Hi Andy, > > > > On Tue, Oct 20, 2020 at 12:19:58PM +0300, Andy Shevchenko wrote: > >> On Mon, Oct 19, 2020 at 11:59:01PM +0100, Daniel Scally wrote: > >>> fwnode_graph_get_endpoint_by_id() will optionally parse enabled devices > >>> only; that status being determined through the .device_is_available() op > >>> of the device's fwnode. As software_nodes don't have that operation and > >>> adding it is meaningless, we instead need to check if the device's fwnode > >>> is a software_node and if so pass the appropriate flag to disable that > >>> check > >> Period. > >> > >> I'm wondering if actually this can be hidden in fwnode_graph_get_endpoint_by_id(). > > The device availability test is actually there for a reason. Some firmware > > implementations put all the potential devices in the tables and only one > > (of some) of them are available. > > > > Could this be implemented so that if the node is a software node, then get > > its parent and then see if that is available? > > > > I guess that could be implemented in software node ops. Any opinions? > Actually when considering the cio2 device, it seems that > set_secondary_fwnode() actually overwrites the _primary_, given > fwnode_is_primary(dev->fwnode) returns false. So in at least some cases, > this wouldn't work. Ouch. I wonder when this happens --- have you checked what's the primary there? I guess it might be if it's a PCI device without the corresponding ACPI device node? I remember you had an is_available implementation that just returned true for software nodes in an early version of the set? I think it would still be a lesser bad in this case. -- Regards, Sakari Ailus