Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp710223pxu; Fri, 23 Oct 2020 11:17:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCm4AR4iyVZtikuzC5a5ZdlnIaHH1ISlX/5n06IgWK0HtXFvRyEhZuvgohVGCqaeN7pl2G X-Received: by 2002:a17:906:a002:: with SMTP id p2mr3027568ejy.399.1603477069802; Fri, 23 Oct 2020 11:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603477069; cv=none; d=google.com; s=arc-20160816; b=wvrzadoN/PcVSVqUEoceHt1oVvrBCuLdEbc4LCc9FXufpEv2WwUxHP9mkTkJ0F1gRq 3I1pLAdCN62ES8rkNfiP1SIl/T7oO1n1T3Kky7VvbZeTbN+hPPFOhX1/+slPNfL0mGlk aa3Rs+x3Z91QcvXV1vIuDdPNdiyZm8rMHRw38rXICheRXcCmU5ywNrssm25/Kc+NaWfR 5/mumR4JINhkDvx4JCxqyZxsZFPX+sKzdWLotAHCs4JQ49qkKtQ6H6Ht4BZQdWeSEt+w gl7RHjvZfvcYkVFoMqFVI1p3gdi02ofcdhDTF1ljjXTCH99Ki0tqr+ea6IqPSmPqLzJZ +grw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=C/bjsmvysft6EGJv8VsDVza1KPfdvyiXKW7Pa6w9gvk=; b=hd4Dz5bFvGBcyVzidphxwFfdM9Wb+md/6eMX8cpsfPSf2YcKwsZaZe+L8g45pScK6F glMdtaGYoT01tsgo4oBOhDOHkvUhcuxLNAipii768c6kaztXu6pfStdttv+ZDnnZ2VJM 1Yj1mak4obTVR7YoGnTndQGM14Exk+pU9y4EPl0RFQI6X5kPdaYsa+kntBmyZRbFHW5T LDm1s1NhRR/5SPMgGS7qsRyl0Y7DV1kV2M/NeX9q0e2j4OqtP+MJVw0gFwD68Vk0xJX0 3htzLzdRunX59arrf6PNxAZgGt8mVVEFl1SnuCDOpm12Cd8CsLunRz4c3lJDy/P5iG+o 0Qxw== 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 s18si1619322eji.706.2020.10.23.11.17.28; Fri, 23 Oct 2020 11:17:49 -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 S1750450AbgJWOSj (ORCPT + 99 others); Fri, 23 Oct 2020 10:18:39 -0400 Received: from mga14.intel.com ([192.55.52.115]:19985 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750426AbgJWOSi (ORCPT ); Fri, 23 Oct 2020 10:18:38 -0400 IronPort-SDR: LdIdsxg/i4l+hV2SP0a2+XyDZtebRf5JDFQ6GNM4zWOpFGaf/xxnfueA09x4+v7Q4RfPG069sb KGlwrTuGmRBQ== X-IronPort-AV: E=McAfee;i="6000,8403,9782"; a="166896945" X-IronPort-AV: E=Sophos;i="5.77,408,1596524400"; d="scan'208";a="166896945" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 07:18:34 -0700 IronPort-SDR: cwYGM98kQmo5KJhfcwDaNOrMZBL+vf98U/ZCNeQQ3f4kytt4mFOOdoehpAusvhwF4KkDJpOjtu O9YhvcDtzADg== X-IronPort-AV: E=Sophos;i="5.77,408,1596524400"; d="scan'208";a="317104862" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2020 07:18:31 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kVxum-00E8KY-TH; Fri, 23 Oct 2020 17:19:32 +0300 Date: Fri, 23 Oct 2020 17:19:32 +0300 From: Andy Shevchenko To: Ferry Toth Cc: Heikki Krogerus , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Saravana Kannan , linux-acpi@vger.kernel.org, "Rafael J. Wysocki" Subject: Re: [PATCH v1 1/2] device property: Keep secondary firmware node secondary by type Message-ID: <20201023141932.GW4077@smile.fi.intel.com> References: <20201022184100.71659-1-andriy.shevchenko@linux.intel.com> <20201023123412.GA614478@kuha.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 23, 2020 at 04:03:20PM +0200, Ferry Toth wrote: > Hi > > Op 23-10-2020 om 14:34 schreef Heikki Krogerus: > > On Thu, Oct 22, 2020 at 09:40:59PM +0300, Andy Shevchenko wrote: > > > Behind primary and secondary we understand the type of the nodes > > > which might define their ordering. However, if primary node gone, > > > we can't maintain the ordering by definition of the linked list. > > > Thus, by ordering secondary node becomes first in the list. > > > But in this case the meaning of it is still secondary (or auxiliary). > > > The type of the node is maintained by the secondary pointer in it: > > > > > > secondary pointer Meaning > > > NULL or valid primary node > > > ERR_PTR(-ENODEV) secondary node > > > > > > So, if by some reason we do the following sequence of calls > > > > > > set_primary_fwnode(dev, NULL); > > > set_primary_fwnode(dev, primary); > > > > > > we should preserve secondary node. > > > > > > This concept is supported by the description of set_primary_fwnode() > > > along with implementation of set_secondary_fwnode(). Hence, fix > > > the commit c15e1bdda436 to follow this as well. > > > > > > Fixes: c15e1bdda436 ("device property: Fix the secondary firmware node handling in set_primary_fwnode()") > > > Cc: Ferry Toth > > > Signed-off-by: Andy Shevchenko > > FWIW: > > > > Reviewed-by: Heikki Krogerus > > Tested-by: Ferry Toth The quoting above is broken, I dare to put it below without any quoting. Tested-by: Ferry Toth > > > --- > > > drivers/base/core.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > > index c852f16c111b..41feab679fa1 100644 > > > --- a/drivers/base/core.c > > > +++ b/drivers/base/core.c > > > @@ -4278,7 +4278,7 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) > > > } else { > > > if (fwnode_is_primary(fn)) { > > > dev->fwnode = fn->secondary; > > > - fn->secondary = NULL; > > > + fn->secondary = ERR_PTR(-ENODEV); > > > } else { > > > dev->fwnode = NULL; > > > } > > > -- > > > 2.28.0 -- With Best Regards, Andy Shevchenko