Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4260705rdb; Thu, 14 Sep 2023 17:45:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFny2NpVa/f57xGQFlOzaU0tPNmStA4nTQBfBgIo0eheOx05MHylXNwEpW/0EfwZJE+weSq X-Received: by 2002:a05:6a20:8f0c:b0:14e:2c56:7b02 with SMTP id b12-20020a056a208f0c00b0014e2c567b02mr533050pzk.0.1694738705290; Thu, 14 Sep 2023 17:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694738705; cv=none; d=google.com; s=arc-20160816; b=04BcaG+DlzuzzrZhmZYNyIGEQaapYYMgg1uBtUzesUmrZ/i5J7Oco1tHnC9gz8mS/9 dd8jwurhUxEcOqXjmVRp4ONg/RFfqm5/uy/iJ3LuBoGf4KEz3l5VFYYhK26sGFlEmIDD ERsbLJwBvHL/AvoNY3p9GqS0MwfnLwOCRMPBavy8Wp18zpcXWkvpN2yMzcKq7G7qbYyU FarFdtDvKpOOz42XXGeC0ZL2s81dbdz/hTjunod5QWkbOkCpcmtipdC0DTbL7MMhURe8 WgHAyawnhT9PJA1JMJ/Z2ThUr2I60d5ezYFw6+snYga16UyQaJglrC4ujvOtznpMP7Ld 4moQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ebM0c0pS7Yj9AcYD8iD0tO6tSr15uXr4K+UiJ03c4A8=; fh=4yIpUYI+DeBTmnaQSJCjJnBN3EqXTWOyOPR7K9CVKGo=; b=kjOl5NVOjpkVIbjGEgZgoxy/rNT6CiiHh9L9zqdaV2UO8nBOAqGODQEzXjdGnX6yL0 Yi5r7ZPFEt0cpzO5kVxtbD5aia/25KnO39MsJ35q5NB+a/xpZPONxCLKO/pmD2D+4gm9 NZhcFPbUN3Wzx/Nb5A8C0HDEwW5TKBRW7/jbfZVwKcBqQmiYQcbDmlOyrK+HmP+IinvL eTFSX6QtvWXqpH2ntCMbEL9pNATWucNnUU8YSqIOloFKyzmFg3JZyKEKp2hPIdh3Wgif 94hifP2q2M50Zx4GCwTnP5HlbAW3Akr21OaME3RwU9OH0AqNYIOuoXO8xy+9Z+VBLkdJ EulA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=i5eoJQuL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id ls12-20020a17090b350c00b00263f3c1bb86si2624186pjb.158.2023.09.14.17.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 17:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=i5eoJQuL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0931C807C7C9; Wed, 13 Sep 2023 21:01:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234175AbjINEAn (ORCPT + 99 others); Thu, 14 Sep 2023 00:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233285AbjINEAm (ORCPT ); Thu, 14 Sep 2023 00:00:42 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5907E4B for ; Wed, 13 Sep 2023 21:00:16 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1c1e780aa95so3628885ad.3 for ; Wed, 13 Sep 2023 21:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1694664016; x=1695268816; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ebM0c0pS7Yj9AcYD8iD0tO6tSr15uXr4K+UiJ03c4A8=; b=i5eoJQuLTt28JafLqM7yeHwq1skXkkJlm9ZUouVxHMjH5EDKKNaiE1fAGnA7VnlS6D 0v8bjvnFR/LCWAhsAkWOmRlXyl7VpjTTqO7dmSpbC7Rbhk+eyoIa9SRj6EHKqPmJz0kQ QMe5/zyGQIqum2IQtpCJD1xUVZ+KpIii3Ta82n3Y/HgXhH1Qkn2q8nBO+GE+6y6YeblF gfoKqd6xW+1Nt71jF13QNQohlP4GMxX3l/VjFmsvyGyhPnfqa4I8Dn49UQ9wBMihN+xu zQzA5NXHCQNVxU/w7rFMpGWtGT4DX5WTIffLzgpvfaqQ+NkcQTOrJjqAJu6MJz6sqHG0 3h9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694664016; x=1695268816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ebM0c0pS7Yj9AcYD8iD0tO6tSr15uXr4K+UiJ03c4A8=; b=EcFYyoqLHnjq1BGsrrXsVe5d3pSFUFv3r04gPkot73OM1QUld6TmK3DVwvDsGQm5CH mxI2PgiRhXGbGOmOxp4Hznccfkq0juCwDjtxNGzSx54FtUjfrpEKNVSPUQOaTptdPoof 7r+Y47WSo3vlG8ie05GYsp740m3R8GT3CncyhIROIUv4Gg96iv2W6za8RRnXZCwEphPP nqa6AHQLaz3JIpM6iPh+9OXj23wdae9e2GnenCBTnh/tUpEofeVbIcStLd1sQxpjOPCS 7wzM3E2xsFLL0m/N8fyZQLilAshNDb0SZbM4v06a3l5fwQKOKWh8jgmN1tyw+/RkA2eg sYEg== X-Gm-Message-State: AOJu0Yy8JA83A2bY7vjDbk/lw118A5G6N8ve9GZcDQHGp/gxIpKYzQ2r WUsbQEqVogpLY+a+PFW2a841qw== X-Received: by 2002:a17:902:be12:b0:1c4:abc:b84c with SMTP id r18-20020a170902be1200b001c40abcb84cmr917910pls.6.1694664016125; Wed, 13 Sep 2023 21:00:16 -0700 (PDT) Received: from PF2LML5M-SMJ.bytedance.net ([220.243.131.6]) by smtp.gmail.com with ESMTPSA id c3-20020a170902d90300b001bc45408d26sm403681plz.36.2023.09.13.21.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 21:00:14 -0700 (PDT) From: Jinhui Guo To: gregkh@linuxfoundation.org Cc: guojinhui.liam@bytedance.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, lizefan.x@bytedance.com, lkp@intel.com, rafael@kernel.org Subject: Re: [PATCH v2] driver core: platform: set numa_node before platform_add_device() Date: Thu, 14 Sep 2023 12:00:07 +0800 Message-Id: <20230914040007.3196-1-guojinhui.liam@bytedance.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <2023091351-clarify-prototype-710c@gregkh> References: <2023091351-clarify-prototype-710c@gregkh> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 21:01:04 -0700 (PDT) On Wed, 13 Sep 2023 06:37:03PM +0200, Greg KH wrote: > 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 > I agree with that. I will try to fix it in the ACPI code which call the platform function soon. thanks, Jinhui Guo