Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1191986rdh; Fri, 24 Nov 2023 07:07:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAkFYHaW6mq2DiJEl44JghN3zlO8o5ut3L3ZCYdy46cR9OtdO4hNtUNm5vuEah0XjmM8Lg X-Received: by 2002:a05:6820:228c:b0:581:e303:807c with SMTP id ck12-20020a056820228c00b00581e303807cmr3564191oob.5.1700838452364; Fri, 24 Nov 2023 07:07:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700838452; cv=none; d=google.com; s=arc-20160816; b=bAOnF9hkX9yacRp61zSbYwqVOL8msm8vyHU/NS+++TnNZAphR8VN7E9McxJ0BPowKx aY8JOtuml70gko/gKhtWuLp7yLEstzh2ySpp1y5zABubkGG3FEm1IIoaDPNDtulUcm6h dcXYiUtLraEsca1LWcDBQe7wPKlTf/KEPzEh7IHSMZ93OZENDCbeIk/4ojPHm24iFLw+ vtc6s5vLbIc6YyrTPdeH1gXMzCy3zIRsVDCvGnrfT+7pgV2MzeQnXAIeDx0oENsAC322 q9UNYzFkRcL+t3S/VmrjDSzfuk9Q2UeX//xNQaqvZn+I+ZVDeZYhWm1BhRkEiHTkN4JT Y5pg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=w2ILYuO4tClrG1VSkN0MLjyHgvt37TYPKTyvEuwMG2g=; fh=hSu+8KU0168zzUws9zgTri7hFazRzXhQ+G08DwqfupU=; b=PNlSnEsdoWD4B3+T2U+0f8ilWnPd4sK+IEOEPhfk4xihQtldCyZPsbJIj+kS2SDup2 xDUiYxd3CoaMlXHL0kPlHd5iS/DIF9Es2xJ2DOSZvFh63yrUIS5UHGV6CqcH5sIdepe0 9Abxg6KRJo7ycDlQB+dViuh8/LDe09/quEHfGOzf9cYd7KEcvDhM1Q/2bcvUJuDGsikm f9vKPfhhvVlGo+xKdrvNGIpkPzJckmj9ayHCDJOBFMCYUa16wjoI7Y2Yg3xDmqk7NNaU HBpqLH3/u1k86dWarhZl3hCtEMf+UbkAOz9p/4wzPP9rMh6j47rfgr6Ax2IkJLcrALsT yMnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PXP9b/W1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i15-20020a4a928f000000b0058d489e4a24si255319ooh.55.2023.11.24.07.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 07:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="PXP9b/W1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 859A080BA41F; Fri, 24 Nov 2023 07:07:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345609AbjKXPHK (ORCPT + 99 others); Fri, 24 Nov 2023 10:07:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345641AbjKXPHI (ORCPT ); Fri, 24 Nov 2023 10:07:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48F5D19B0 for ; Fri, 24 Nov 2023 07:07:14 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74C7BC433C7; Fri, 24 Nov 2023 15:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1700838433; bh=AEn7eLNiCWXSCKU/V6dq487QCSOB2Gi18tMF4Q+T8s0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PXP9b/W1Cyy4ODd36Mg/WHH8md71tO7eh/829jn6datfyuRX9ObT54PQy6QRxih4U A7CTFtzIEHRhaFg3z9xr9LOThevoGgvbebSyO/sG1L3fB+/bRNMaF+Rb9tlL2cMY/w RlWR4eBfj4kAvgpR0VPTX5sidzngqyn71CUCF0P4= Date: Fri, 24 Nov 2023 15:07:11 +0000 From: Greg Kroah-Hartman To: Oleksij Rempel Cc: "Rafael J. Wysocki" , Ulf Hansson , Mark Brown , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-pm@vger.kernel.org, =?iso-8859-1?Q?S=F8ren?= Andersen Subject: Re: [PATCH v1 1/3] driver core: move core part of device_shutdown() to a separate function Message-ID: <2023112450-unsterile-crushing-c665@gregkh> References: <20231124145338.3112416-1-o.rempel@pengutronix.de> <20231124145338.3112416-2-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231124145338.3112416-2-o.rempel@pengutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 24 Nov 2023 07:07:29 -0800 (PST) On Fri, Nov 24, 2023 at 03:53:36PM +0100, Oleksij Rempel wrote: > Split the device_shutdown() as a preparation for the prioritization > support. Nit, this is going to need a lot more description, as at this point in time, we do not know what "prioritization support" is. > > Signed-off-by: Oleksij Rempel > --- > drivers/base/core.c | 110 +++++++++++++++++++++++++------------------- > 1 file changed, 63 insertions(+), 47 deletions(-) > > diff --git a/drivers/base/core.c b/drivers/base/core.c > index 67ba592afc77..0f5646a097d3 100644 > --- a/drivers/base/core.c > +++ b/drivers/base/core.c > @@ -4719,12 +4719,73 @@ int device_change_owner(struct device *dev, kuid_t kuid, kgid_t kgid) > } > EXPORT_SYMBOL_GPL(device_change_owner); > > +/** This doesn't need kernel-doc for a static function, right? > + * device_shutdown_one - shut down a device > + * @dev: device to shut down > + * > + * It is called with the device lock held. > + * > + * The device must be on the devices_kset list. > + */ > +static void device_shutdown_one_locked(struct device *dev) > +{ > + struct device *parent; > + > + lockdep_assert_held(&devices_kset->list_lock); > + /* > + * hold reference count of device's parent to > + * prevent it from being freed because parent's > + * lock is to be held > + */ > + parent = get_device(dev->parent); > + get_device(dev); > + /* As you are moving the code, might as well make it a bit prettier and add proper line breaks before the comments please. thanks, greg k-h