Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3970623pxb; Tue, 2 Nov 2021 01:36:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfEB4o16Bgc5p2VfvnW8GtKF51Q+X4bupOR0LoIfNAPS9Dwh+yBG5IzRTXSZMnZG66MlCx X-Received: by 2002:a17:906:c156:: with SMTP id dp22mr4634398ejc.168.1635842200858; Tue, 02 Nov 2021 01:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635842200; cv=none; d=google.com; s=arc-20160816; b=Ocmjg2ZFCzMVcwz+sJr9Xlmlha6E2aSsdXePUiHw7urRH0ZWN574FvrFwXlxQzmfIi FlMV0+JU9kS3OO4m/4ch2/p+fHD8zb+ABomWBDMYqnosQWh54iZkSfeoPpoj6nk1MLCd uuqkOUcNrlc6Szg1Ync6XBCsvqTuwUeeGtE/V2238ge9wI+5gDWoCTVajHfOtHAlslbo TPRvXXYSTRGdxiD/MFUJAz40FQalyotR4MzMtwDC328GY7zpcM7QVl/JBB98bhoWs6aP mYus6rMMlkX1fJGZappHA3QdZWix9XjRJ9hKeN6O+jOFlChppOo/d5fQcxpMh7Yfq4mG RiQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=H34c6xjC8tVcTfy6bn7aIzuUC31fL1xDRr9kBG9wtRc=; b=kzBdSxM7HJZkmeWo55f9hZjT/VjlmSMZljVWIXjvcukFeao+vKcAn9Mct27C/g2W5/ Zt+h4nqxcAdaXF/6IobihLuvg/+eYU+YEio7Eyu9U45oq+qICWo2mLw8Ts0DKUXUyFlo zLdD+0cpDyLHYzIZbagRQfCDEsh/SvXyjBF4htDiA/JeJZwB41ICl4/PJw8AOwbdZcd5 XXg1wZBif8HpQD3Q941emLFFdwjq1uyeifYPmnLhd17+82YzJy0fC+YNyfNzxATCeVSS +K5oP7ZdZsTDQg9Olv3tQjsQiLlVpRRpmU0Q9R2djEUd6rPvWbLia6LBw6xDoNZ7l3uI 9vbw== 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 x88si22926079ede.207.2021.11.02.01.36.15; Tue, 02 Nov 2021 01:36: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbhKBIe6 (ORCPT + 99 others); Tue, 2 Nov 2021 04:34:58 -0400 Received: from mga06.intel.com ([134.134.136.31]:65314 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231356AbhKBIez (ORCPT ); Tue, 2 Nov 2021 04:34:55 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="292048517" X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="292048517" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 01:32:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="638114603" Received: from kuha.fi.intel.com ([10.237.72.166]) by fmsmga001.fm.intel.com with SMTP; 02 Nov 2021 01:32:11 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 02 Nov 2021 10:32:10 +0200 Date: Tue, 2 Nov 2021 10:32:10 +0200 From: Heikki Krogerus To: Andy Shevchenko Cc: Qian Cai , "Rafael J. Wysocki" , Andy Shevchenko , Greg Kroah-Hartman , Laurentiu Tudor , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [RFC PATCH] software node: Skip duplicated software_node sysfs Message-ID: References: <20211101200346.16466-1-quic_qiancai@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 02, 2021 at 10:28:45AM +0200, Heikki Krogerus wrote: > On Tue, Nov 02, 2021 at 01:51:34AM +0200, Andy Shevchenko wrote: > > On Monday, November 1, 2021, Qian Cai wrote: > > > > > A recent commit allowed device_create_managed_software_node() to call > > > software_node_notify() which could generate duplicated "software_node" > > > sysfs files. For example, > > > > > > "/devices/platform/808622B7:01/xhci-hcd.3.auto/software_node" > > > > > > Since it was created earlier from another path, > > > > > > sysfs_create_link > > > software_node_notify > > > device_add > > > platform_device_add > > > dwc3_host_init > > > dwc3_probe > > > platform_probe > > > really_probe.part.0 > > > really_probe > > > __driver_probe_device > > > driver_probe_device > > > __driver_attach > > > bus_for_each_dev > > > driver_attach > > > bus_add_driver > > > driver_register > > > __platform_driver_register > > > dwc3_driver_init at drivers/usb/dwc3/core.c:2072 > > > do_one_initcall > > > > > > Fixed it by using sysfs_create_link_nowarn() in software_node_notify() to > > > avoid those bad messages during booting, > > > > > > No, it’s not so easy. What you are doing is a papering over the real issue > > which is the limitation of the firmware nodes to two. What we need is to > > drop the link from struct fwnode_handle, move it to upper layer and modify > > all fwnode ops to be used over the list of fwnode:s. > > > > XHCI driver and DWC3 are sharing the primary fwnode, but at the same time > > they wanted to have _different_ secondary ones when role is switched. This > > can’t be done in the current design. And here is the symptom what you got. > > I'm actually not sure what is going on in this case, because this is > the ACPI enumerated BSW board, at least based on the ACPI ID? > > That board should not have the initial secondary fwnode assigned by > the time the dwc3 host driver is called. But what Andy said is still true. You are only hiding the core problem with this. So this patch is not the way to go. thanks, -- heikki