Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3366825pxb; Fri, 5 Nov 2021 14:32:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHklKWNBqEGsYTqbE3AgfwYtRW0SpSxHiwQeLWjoZHYYzgeSrtZfbcA+clS6m7tjKyxE8m X-Received: by 2002:a02:2b08:: with SMTP id h8mr11453688jaa.137.1636147950543; Fri, 05 Nov 2021 14:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636147950; cv=none; d=google.com; s=arc-20160816; b=GvSp/kqiCPgfHFGWtnzq/KefmvpZMTyugyxFfl+S1BbUZlhZXcVH36JLG4Y4MJXUUC KQr2Pez5urc99E1TkhzK4sd9v1O7/32GU6wY5gMV4v/QoXuNVSbmIq4fVzGmGyYoQFQO z+qieZd5uKkgQwjfe65qyKbIQIFSQ1hW+z4Gf+SiF2oPh8VhLws7pkEgOqZR0naDK6Rh hfWVgAT9JGX1rN0U82Qpnm5zyqVjQsAMa8DeIcTXxwb7tscudHtcdg34YOF+0GRITCfa JDVQVIkOGpeeF5Y/XuFTNKpmlrm37HTmkEYU3i3+cecmhp61Ststh4ZMaKlBKEkpA+3o zmUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=G3qfrI/sS+kNFHo6v7HTnTcHlMqBxMKZpKZwQGGOccM=; b=ScYbJeYt8jWZ2573VS5cPfOn6DEOCqomQ49347rxkioTQeXuMuTZrJ5vmWeCITNwos HnMVoIUu01kC9zkrgZs2lxS7TZRKQ/KAX6C6seudeUBX3zFqn7k7wNQNlsWep/l4fOvo f7jjcNCkPi7wToQiAlWZ7VH9kQzeYLq8564Uuul18yA/HIbnggpTwZfR8UeUvtG+R74j 8U3knGkga4J9OHqi95XkiwoOyAJIHmQHnuQ0coL+/grCh4p+EcZBRAayGdTiCZVinrln KGyUoa9VOeEjbmR9KZ0rkNoKLIJXIwbyFEDvk4TmMIXDNHeQZiRDj+Qe+CSkH6fdRWYM Sj3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="mV/rhr0e"; 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=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay28si4368297iob.22.2021.11.05.14.32.18; Fri, 05 Nov 2021 14:32:30 -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=@quicinc.com header.s=qcdkim header.b="mV/rhr0e"; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232948AbhKESu1 (ORCPT + 99 others); Fri, 5 Nov 2021 14:50:27 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:47975 "EHLO alexa-out-sd-01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbhKESu1 (ORCPT ); Fri, 5 Nov 2021 14:50:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1636138067; x=1667674067; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=G3qfrI/sS+kNFHo6v7HTnTcHlMqBxMKZpKZwQGGOccM=; b=mV/rhr0e9CAhZFT84k3qsazA73itdbKDeVpTbAGXUf8Wwt1nuFAcodxm SLXNiBIefRrCTBElOrhVmS8hGY4Aa3LfUrIVXv908kTfmDAvYo4zNzNCe 9m8l+sTDcTAdyD0QpJj7NwbZUjb1TILnMiVDYL+2e9BE4yWuzcbOFWREk I=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 05 Nov 2021 11:47:47 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Nov 2021 11:47:46 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Fri, 5 Nov 2021 11:47:46 -0700 Received: from [10.110.96.158] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Fri, 5 Nov 2021 11:47:45 -0700 Subject: Re: [RFC PATCH] software node: Skip duplicated software_node sysfs To: Andy Shevchenko CC: "Rafael J. Wysocki" , Andy Shevchenko , Heikki Krogerus , Greg Kroah-Hartman , Laurentiu Tudor , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20211101200346.16466-1-quic_qiancai@quicinc.com> From: Qian Cai Message-ID: <52df4a97-1132-d594-0180-132d0ca714d5@quicinc.com> Date: Fri, 5 Nov 2021 14:47:43 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/1/21 7:51 PM, Andy Shevchenko wrote: > 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. Andy, thanks for the pointers so far. I was able to trace set_primary_fwnode() and set_secondary_fwnode(). Anyway, what's the "upper layer"? Is that "struct device" or "struct swnode"? I suppose you meant: - Remove "secondary" field from "struct fwnode_handle". - Replace "fwnode" from "upper layer" with "struct list_head fwnode_head;". - Modify all functions in "software_node_ops" to use "fwnode_head". Is that correct?