Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1763589pxb; Mon, 8 Mar 2021 05:59:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsm/YhjSEtcLKhMJErl8KrUgQHXHCoy3/TghHgI7k5upESiLGOUUJrdiU/YUeSEgV4ubvw X-Received: by 2002:a05:6402:8c2:: with SMTP id d2mr22833511edz.4.1615211946832; Mon, 08 Mar 2021 05:59:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615211946; cv=none; d=google.com; s=arc-20160816; b=xBfZxkV8VMfuvcU59urODd3GAOxWqMK5SXnPt/4Zn7bvU5qPGy2htoi6ZwffcHukL0 UEMOHNOn4Abf+lafFDVvXmV/dItrHIIFjNz3joDP7rPYfZlKdDg+/4Wi0H0ID6Y8ugBe aW6WioTiP32GO+NBffyrDA8DLnBDbXFFFzjG/DqKEx2eBkqjeYSuQDBGeIqc9u+OSjEK GEZ6kggbcKnTvdF6uWSZTz94ADnQTHyEieUkaVBb5tFa/MBaqKhwocSakHj1CkkynLy4 OtO+vgOw/agkru8pa4FRoDcx8+aQH2p8C+omks7x2s3BO3AwbIZWRu5iQiydmi+FevAs HmAw== 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=Xyji7BfFtyXrZ4SgWALTkkRPMB7kEqWt4vRS6fB9xYk=; b=sr54W9FGjH5yRpNb6Fo7kjP3td2vzNYa/3L+nVcIIyYoeoOvuWZgn5EeMHf+whCv3W j5uDpinMtubOAUqv8cGJaYaJEgTki4BJJYbYxU/njNHvU/+5NwYuaE6ft+xVLnzEzZBt K1TzSvKPZhooCVTGAlJWLHThjFMa26CWU4uF3X30UtgAS4YWq8RRqiw4zB4tY2a802KB DV2eeuD3TgX629cYbRlSIxLhX+Bhgnzw8xeTIM4Lpfl4yrWN+Xn1hrniM1miDS7Hvl7y MEC/+6M7oMszkTP3snk3jJ0Ag5zQGFke9rf3S38QGBIubxS0qr3R0I7rhhCOSr6+XZlI Be1w== 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=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 f22si6994588edw.372.2021.03.08.05.58.43; Mon, 08 Mar 2021 05:59:06 -0800 (PST) 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbhCHN5r (ORCPT + 99 others); Mon, 8 Mar 2021 08:57:47 -0500 Received: from mga02.intel.com ([134.134.136.20]:1940 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231355AbhCHN5O (ORCPT ); Mon, 8 Mar 2021 08:57:14 -0500 IronPort-SDR: Pwa/bL1bAo5fWRjaH9h1H2mveQFO8NwGxsf/CiKZXJxxHz8gfjOqDLKqZJOybkecKvf6YhRqVP ILcSlFOqQCjg== X-IronPort-AV: E=McAfee;i="6000,8403,9916"; a="175140516" X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="175140516" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 05:57:13 -0800 IronPort-SDR: y7vlO1ZA2ifHMhH+r9TWzkrV9NvFjAt1sBk3WHBE5e1lqHdlk6qXWckWfrSUFCrRF3XTbMxTIE N5f/lPC1De+Q== X-IronPort-AV: E=Sophos;i="5.81,232,1610438400"; d="scan'208";a="437486815" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2021 05:57:07 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lJGNc-00ApWj-AU; Mon, 08 Mar 2021 15:57:04 +0200 Date: Mon, 8 Mar 2021 15:57:04 +0200 From: Andy Shevchenko To: "Rafael J. Wysocki" Cc: Daniel Scally , Tomasz Figa , Sakari Ailus , Rajmohan Mani , "Rafael J. Wysocki" , Len Brown , Mika Westerberg , Linus Walleij , Bartosz Golaszewski , Wolfram Sang , Lee Jones , Kieran Bingham , Laurent Pinchart , Hans de Goede , Mark Gross , Maximilian Luz , Robert Moore , Erik Kaneda , me@fabwu.ch, Linux Kernel Mailing List , ACPI Devel Maling List , "open list:GPIO SUBSYSTEM" , linux-i2c , Platform Driver , "open list:ACPI COMPONENT ARCHITECTURE (ACPICA)" Subject: Re: [PATCH v3 1/6] ACPI: scan: Extend acpi_walk_dep_device_list() Message-ID: References: <20210222130735.1313443-1-djrscally@gmail.com> <20210222130735.1313443-2-djrscally@gmail.com> <615bad5e-6e68-43c9-dd0b-f26d2832d52f@gmail.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 Mon, Mar 08, 2021 at 02:36:27PM +0100, Rafael J. Wysocki wrote: > On Sun, Mar 7, 2021 at 9:39 PM Andy Shevchenko > wrote: > > On Sun, Mar 7, 2021 at 3:36 PM Daniel Scally wrote: > > > On 22/02/2021 13:34, Andy Shevchenko wrote: > > > > On Mon, Feb 22, 2021 at 3:12 PM Daniel Scally wrote: > > > >> The acpi_walk_dep_device_list() is not as generalisable as its name > > > >> implies, serving only to decrement the dependency count for each > > > >> dependent device of the input. Extend the function to instead accept > > > >> a callback which can be applied to all the dependencies in acpi_dep_list. > > > >> Replace all existing calls to the function with calls to a wrapper, passing > > > >> a callback that applies the same dependency reduction. > > > > The code looks okay to me, if it was the initial idea, feel free to add > > > > Reviewed-by: Andy Shevchenko ... > > > >> +void acpi_dev_flag_dependency_met(acpi_handle handle) > > > > Since it's acpi_dev_* namespace, perhaps it should take struct acpi_device here? > > > > > > I can do this, but I avoided it because in most of the uses in the > > > kernel currently there's no struct acpi_device, they're just passing > > > ACPI_HANDLE(dev) instead, so I'd need to get the adev with > > > ACPI_COMPANION() in each place. It didn't seem worth it... > > It may not even be possible sometimes, because that function may be > called before creating all of the struct acpi_device objects (like in > the case of deferred enumeration). > > > > but happy to > > > do it if you'd prefer it that way? > > > > I see, let Rafael decide then. I'm not pushing here. > > Well, it's a matter of correctness. Looking at your above comment it is indeed. Thanks for clarification! But should we have acpi_dev_*() namespace for this function if it takes handle? For time being nothing better than following comes to my mind: __acpi_dev_flag_dependency_met() => __acpi_flag_device_dependency_met() acpi_dev_flag_dependency_met() => acpi_flag_device_dependency_met() -- With Best Regards, Andy Shevchenko