Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4653853pxb; Tue, 2 Nov 2021 13:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtcQE5yXzNsL1emEO/BU6b+/VGdkEXsD+cv215cX8S14VtLO7jl9qKpKD/FnpEmVEtTPYA X-Received: by 2002:a05:6638:1383:: with SMTP id w3mr29594938jad.102.1635884961529; Tue, 02 Nov 2021 13:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635884961; cv=none; d=google.com; s=arc-20160816; b=mYu7eSVwAeOy5AvnFjWonREjirOVhDgTNQqEpu7HM5FBXgSgQTd7ZV4pUnf93MPKGC 6MBEEinuK5YbUUHJ/ksiPC/gVoq1/Z6f7h4s/YuGXrlBR/wsKxph+ulU6bGPkTpaEiXp 5WmBPkaiSIFd0NYS03MVRTC3gF6dBv2zvTHcf5+doVIZbGBLW354j4XOCYZU1D8RADLU s4ZsoCqXPnxEAye63cn58pjzq8sfTUwBSSg0ulhQeO8pIoI2ZpQ4dltuh0teqpCUwXcX 33hkpMYlzmY3OfF/YPtq8own74NJr4LCVzrJtNW/+o5y4VgCjl6LZ0JYk6WBd05Nwuj1 qp5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QAaXhUzziYq9zGj4Dn+TSRAKewTMaW26NBtOKk5rNW0=; b=J4y4MIiUpnmQ1AP8cFcsudxgYWdZkq+fk3zbenHeKPqs3yK2p2UroqOZ+hop9kheAY 7XmrnBW3UgT+BJcm3KFDA4cyvnikSlLOLyxpiGs66RQg9NWoniTqf9wO3o2ncdIL/jM/ fePRhf/m3wEpnM6RcbEMb85CkxgUGXjRPdc/sPtEWDbkZqENoBEME6D00qMOwAQGqZNK Dm0hQ+7c9JxtfERK82XeM85HfI3NlmktXd2C14Ldu96HaTut/VZiFdD3ON6uWYSwbNyL PEjyJbyYVMIQDpTliexane/1PRQSTZflqPNsFcf8BoEkZDfYbG0wCCBLl1MZMmk/s6f1 fZfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bgMThWbX; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si6362713ill.177.2021.11.02.13.29.08; Tue, 02 Nov 2021 13:29:21 -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=@gmail.com header.s=20210112 header.b=bgMThWbX; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231533AbhKBUaG (ORCPT + 99 others); Tue, 2 Nov 2021 16:30:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231254AbhKBUaF (ORCPT ); Tue, 2 Nov 2021 16:30:05 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11894C061714; Tue, 2 Nov 2021 13:27:30 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id j21so1624283edt.11; Tue, 02 Nov 2021 13:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=QAaXhUzziYq9zGj4Dn+TSRAKewTMaW26NBtOKk5rNW0=; b=bgMThWbXBX8BJYCrH5bovFBKEVLKqcpIEs4af/BStQOpvBfKG1/neFup8YmukpBfJG ymGA3GTTcuH96/OqfzVR2//BXRBdm0Jj8xxO8+4L+ktsjKk+IcFiEDBm+Ur/7j5D/qPE rxnt493wXJ5+QdktZURiZhtO2aXNpKz2w2YgorA6CbrmDruVbGkEpv4Y2KO8oZ8ALEi1 1MW5RM1u/EtE880HX92DzbHSEi6VenQ0r7qadMTm/+Z8cX3XZ8Cp2taWFTpQylW2U4bS m4UjDxNbRrj3kLGd+2LTPP288+/7CcmEMF0d3nF7mdReC7rs2OfHO1O4WnfiFEJwWu54 07Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QAaXhUzziYq9zGj4Dn+TSRAKewTMaW26NBtOKk5rNW0=; b=LfT5HbcOcJ7x8dDtg9fuqyib/pXN9sSP1nxvqhRwXX6+B5aDuOEKWijvb6xvp4cT/c vm5JGNnyZyCLAB0wSKkDwFhLL8hRgvAStbMDTK4IvrDYO4Hw9tcTTAZ0hjqLYnx53ALo mbbU8BSzaNqRga2dPl0xPI0NtblxQVp4kfuUH8JkEaf1vOPqHYFkf7eViN6PXCTGQt3x XPelVkQITH+fUsdIR95HiXbg14LjS150F0ytisELIPGV5jA30E9JGNrMGebvZb0tW5hZ pSW6eyQhF+oT/WB4rJaHYZsJ0d3DW4GvGHGQHrsXTqYHST2KZQLKabKPu0hCZsieQjm0 tpMg== X-Gm-Message-State: AOAM530HkCdxSQvCAyDZw5i9gDfY2lXazqF5ZqCv4P3qdGtcXYwusdOp PLwGWplVC8O7UeE7Z+V4tMlcC6l9QdsEXcjec0o= X-Received: by 2002:a17:907:7601:: with SMTP id jx1mr48274365ejc.69.1635884848667; Tue, 02 Nov 2021 13:27:28 -0700 (PDT) MIME-Version: 1.0 References: <20211101200346.16466-1-quic_qiancai@quicinc.com> In-Reply-To: From: Andy Shevchenko Date: Tue, 2 Nov 2021 22:26:39 +0200 Message-ID: Subject: Re: [RFC PATCH] software node: Skip duplicated software_node sysfs To: Qian Cai Cc: "Rafael J. Wysocki" , Andy Shevchenko , Heikki Krogerus , Greg Kroah-Hartman , Laurentiu Tudor , "linux-acpi@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 2, 2021 at 10:20 PM Andy Shevchenko wrote: > On Tue, Nov 2, 2021 at 9:44 PM Qian Cai wrote: > > On 11/1/21 7:51 PM, Andy Shevchenko wrote: > > > No, it=E2=80=99s not so easy. What you are doing is a papering over t= he 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 m= odify > > > all fwnode ops to be used over the list of fwnode:s. > > > > Andy, this is my first time touching fwnode/swnode. After reading the > > source code for a few hours, I still don't understand the hint here. > > Specifically, what does the "the link" refer to? > > https://elixir.bootlin.com/linux/latest/source/include/linux/fwnode.h#L36 > > (Property related) fwnode (as of today) is the single linked list with > only two possible entries. Comments against set_primary_fwnode() > followed by set_secondary_fwnode() may shed a bit of light here > https://elixir.bootlin.com/linux/latest/source/drivers/base/core.c#L4724 What you can start with, btw, is adding the trace events / points to these two functions. (Currently only devres is enabled: https://elixir.bootlin.com/linux/latest/source/drivers/base/trace.h) When you do this, you may actually see what's going on and how the swnode tries to recreate the same file. --=20 With Best Regards, Andy Shevchenko