Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3532976rdb; Wed, 13 Sep 2023 15:20:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHuQjcJurgibXePR0rpwA6kksH0VDdgEFeezN3Ir1Ri16JluZtuQLJhDZIgrMh3LjhnOQer X-Received: by 2002:aa7:8883:0:b0:68e:3616:604a with SMTP id z3-20020aa78883000000b0068e3616604amr111971pfe.8.1694643641148; Wed, 13 Sep 2023 15:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694643641; cv=none; d=google.com; s=arc-20160816; b=D34Nu0vFcsLbEs7KbW8Oy28SpNtz3XwTuCrotwdUUvg7l1WnPvgCqbKWhBvIr59IUZ o72hazHfNqOaxtFAzKgEKNPTTeiuoWZy8fF2RRYpYUXeKW+CwCMbhm7RR4PmLsE65jdY Y3zDRxmMKwx5lj4i7xoBf8Y7UcCUGP+rlBE3JDOgX2FSi7luwG2Wo7tA6hlt/PS2EUUE qXPxAaEdA2FxRb4xqcXr4krwxCzEAkLHMtBNb2S9rP+ZNHrdS10zhSEty1pa2kXcBe3q 2+wlX/Z84O3DRr/0EJ967xaQCqWESOs32e9hZxOtJt0xBBVKMHQ3iQIbABwLhDcDK9qw QLng== 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=C25aA3yZB9m+Ebm/PtQwmjSppKtvTbA3h7/MLT/rE4s=; fh=1mx2wmFsooekc3dqkRkkEB9CPFsYCCTl9EZiGX+dSUA=; b=0DVkI44CgO4/GOO/WlvYPq3dhQ8kcnE+PMYx/YhGldamy9ERO0SNBZzCN73sf/bl3X uS/4cgBZEl36h2Szmbm9jn2M8/xMftHAzBUtrbzlvWtlxyqsrQZ0eRHl0XRNzUzuLbvC X4KQhl4qLhi+Ou1qebLTJFWnVtdwj5dRwVZDRhr7VKx9+cixiOG0JwtQHD03dppKhdq2 yn+GPuB9uLhzFJxKO3uq2bG0ZYFMS6N8l8eAcTQlmG1qvY8G6eRpX1qLjC1y2D8DcP4v o/wfLk+BI0mGSyBtKpaoA9WFBBkBBAGv9clUiKgaWZkELQAVJe25M9nZ0EE+ioMPmr+c gTBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hIvo8WIu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id k3-20020a6568c3000000b0056f8fdb4430si62325pgt.893.2023.09.13.15.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 15:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hIvo8WIu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 7313C8226F68; Wed, 13 Sep 2023 09:37:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230204AbjIMQhT (ORCPT + 99 others); Wed, 13 Sep 2023 12:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbjIMQhS (ORCPT ); Wed, 13 Sep 2023 12:37:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F271198B; Wed, 13 Sep 2023 09:37:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21303C433C9; Wed, 13 Sep 2023 16:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694623034; bh=jTsdWR7yXTa22nqC9l81Q4ikkwMkf244QTTcwAuulKc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hIvo8WIupXFFwm6NTL1IrX4XxodJAeNYiPXgwOZZF41czBywUs9OXQq4Jg0oO1VpU /NRNns+ZNtjSoP8VbPuK0TkQESRURJhqjUe72fYlBvtvuhwzITLnpuGfCrKHIUN9PH mh4p+aBI+zMrrY+htMyX0MJkRXlqQknpLEdxSVw4= Date: Wed, 13 Sep 2023 18:37:03 +0200 From: Greg KH To: guojinhui Cc: rafael@kernel.org, lenb@kernel.org, lizefan.x@bytedance.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel test robot Subject: Re: [PATCH v2] driver core: platform: set numa_node before platform_add_device() Message-ID: <2023091351-clarify-prototype-710c@gregkh> References: <20230913083825.2670-1-guojinhui.liam@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230913083825.2670-1-guojinhui.liam@bytedance.com> 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 (lipwig.vger.email [0.0.0.0]); Wed, 13 Sep 2023 09:37:21 -0700 (PDT) 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email On Wed, Sep 13, 2023 at 04:38:25PM +0800, guojinhui wrote: > From: "guojinhui" > > platform_add_device creates numa_node attribute of sysfs according to > whether dev_to_node(dev) is equal to NUMA_NO_NODE. So set the numa node > of the device before creating numa_node attribute of sysfs. > > Fixes: 4a60406d3592 ("driver core: platform: expose numa_node to users in sysfs") > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202309122309.mbxAnAIe-lkp@intel.com/ > Signed-off-by: guojinhui > --- > drivers/acpi/acpi_platform.c | 4 +--- > drivers/base/platform.c | 13 +++++++++++++ > 2 files changed, 14 insertions(+), 3 deletions(-) > > diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c > index 48d15dd785f6..adcbfbdc343f 100644 > --- a/drivers/acpi/acpi_platform.c > +++ b/drivers/acpi/acpi_platform.c > @@ -178,11 +178,9 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev, > if (IS_ERR(pdev)) > dev_err(&adev->dev, "platform device creation failed: %ld\n", > PTR_ERR(pdev)); > - else { > - set_dev_node(&pdev->dev, acpi_get_node(adev->handle)); > + else > dev_dbg(&adev->dev, "created platform device %s\n", > dev_name(&pdev->dev)); > - } > > kfree(resources); > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index 76bfcba25003..206dc7b020cd 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -795,6 +795,18 @@ void platform_device_unregister(struct platform_device *pdev) > } > EXPORT_SYMBOL_GPL(platform_device_unregister); > > +#ifdef CONFIG_ACPI #ifdef do not belong in .c files if at all possible. Why can't this be an acpi call instead? Why does this have to be in the driver core? Platform drivers shouldn't know anything about acpi, this feels really odd. > +static inline void platform_set_dev_node(struct platform_device *pdev) Also, it's not "platform_set", it is acpi-specifc, right? Again, the ACPI core should handle this for its ACPI-platform devices, the driver core shouldn't care at all. thanks, greg k-h