Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp54191lqo; Tue, 7 May 2024 11:56:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWexIpog97JHfecXWkbg/Z/FdTp5sseytlGFfJsRojDFTqU0t7K3a7PuepWCYjBdF+YU2fnCNoHeFLcmx20jCzEVnkt8DWTLBdXPbWmnQ== X-Google-Smtp-Source: AGHT+IGZOL0EOXdHLha48xcODXU5nX0zUIBlKCfVUCvcVbK3SwxvPKo7TS67ZEf/qjDjhXcDTWgb X-Received: by 2002:a05:6358:9216:b0:18d:daac:f411 with SMTP id e5c5f4694b2df-192d397318dmr62486855d.31.1715108163187; Tue, 07 May 2024 11:56:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715108163; cv=pass; d=google.com; s=arc-20160816; b=1I3S0p2JJH4PgbO70Os39cLuzW+nryPw1aDa1XVbjUZaK7TaAs2V9jJBVs+1sY10Q+ 5/OBkGJlhBMGZU+bWyH19M27yHRdmgkJW+qHgONEq7uo58mvuQfia+/myvIkTZuteXrf Sk/FNkRrOqwwZzSu5udLBX+qLTbaKeQStZmj8iVR76gz+hd74k0isZjZdi1rUVrYTV6y dfyNz4B6mvPMVAGrLcbJm1iJphxcAxNNXTSll98tgPBc359lH4UXWThXPqqhvRdVZEsG fzLvGzy0CIZpI3ZEKJA1vd32X4dF03Vk+CGNvhHut38NC0BeHv2Fz6KuWaLRjcPyc6Vp ka9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=qXIIiXK3uzYI4Evl+BuJ7FIhP5qiRwcE6TGAg0CY3ck=; fh=MyE2fmUvXEhtfhqscBY93bNUeKDKyJRwOTi1fUtagpY=; b=rfRJFUwL/HaOCkQHrJzCgtfdHCrTVqWwyA2UhyOn4my3e7IxDf0cTljAbtc1F+DZVa PmSWUF/Er2+p65F3+m/5wpnTYOa2JBC0gmHDpNxTmrcZhnK3itCE3F/XoyTQ+xzwyOwC Ot+c+LnZv0cDRBdrR1QYM3mdnUR2SWkwQtH87w3M3W6J7giZIvk63gR/VXGT7092CxVn 9lrSK6V+xwC29T4Pp1cWQgxm8X5Kz7MYgwvE7zVypZltZNUJzt12GNljogded43f0q9P rZNNT9gr3NOCAJyS0QYE3oDIjxsbQrOfJPQ3JTp3BL2Qvsjyq5qVLxnj+bEx3OEhSTfW yPIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MYxYpuTJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v2-20020a631502000000b005dc90546100si10825048pgl.295.2024.05.07.11.56.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 11:56:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MYxYpuTJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172018-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172018-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 970C9284224 for ; Tue, 7 May 2024 18:56:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 922E416D9C7; Tue, 7 May 2024 18:55:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MYxYpuTJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE62C16D4E2; Tue, 7 May 2024 18:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715108151; cv=none; b=KDAMGhJaHfKQ83d2lJyM+kijfTaZ4TgyPsVp0ixRi/tAOCk8d+K06O6sWWlunqSxA9aU4uVJ5dZZUILsQwz0is77JwT+HxXL5lN/8i1u4ZAH01tdAv0NyRzuqHBnOJXXyBouKye5udew7c54KcBRK5V/lqdaw5+tHKdVrtlJuOI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715108151; c=relaxed/simple; bh=s9TJ7BUa1nTYfV0K5h3xYN7O2jbjVFFreTldzhRORjA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=u2PlQIMnZHtCfR3PdQItNPCeuNPTwaIRZuHLyXgqU0m8n1Ht8+ObYn3nvTvr1nBsXRWJZUjRjUmC1Z7DUfVaPah8h2dtBEwbKC7uMzzgDM4OOFdxHp1kCjvRt/hpjtoigtApGDx+LZjT0mRrdzZdRz3Wm5/xmYUuYlQFV62u6Vs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MYxYpuTJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FF0FC4DDE3; Tue, 7 May 2024 18:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715108151; bh=s9TJ7BUa1nTYfV0K5h3xYN7O2jbjVFFreTldzhRORjA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MYxYpuTJ6uS5ozOsUarhVXYgwV4QygLxiV1yGuFjhWlskfh1AY2MgxmNgLc2+qCPA 7oPm45NCbyVbL56RRE2CoL8xaSg4N0uf6NHmzHawqdBeOJbZHhGWYjUs06JNKqerXb V4kBGr93FecfBYSiQpEyoDKueit4UuWMlPhqDq9Tz6JWnEiQb0J1Zaz70f7gA3DAuV uO92Tl5SDo4maQTzrQnHEVupT5k7P9Hfu1cbWgrXtl15LG0yN4R1BkEjZ9hrgIx+qu j/V65VHKYY4o/J7IhsVZcrEQdDG3c2Pc24u3qBd2tmLplh42qTXNU8VM6SWPGy2HL4 M+GASdaIt1nUQ== Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-6ea0a6856d7so189634a34.1; Tue, 07 May 2024 11:55:51 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVYUi+I2gGgTXQkzNCfhrb7l5gaJCjuFHzBSDkLZ1Lhno984o96cQye+n4S8gx0y6J/5072toVOIbug9+HwF8zW6UqzqdnvwaBzok6b2ncYEJ0VG1p0+gbqmQLuBvECfS1avUg7gRAB9l83B+0WmO0g7LURpBIRvpr8RC1CsBhFfCvEOPvQktffByXFj8jSJr2YMUyCnehPYhoLHnYjUg== X-Gm-Message-State: AOJu0Yy5WB6DatbqfPMj/rlK6jXjyiZxG2tdK0SqS2eg5sgXc9lJ8o6y 88GhxT3yNA1e7iW6gX8gi799xVCZ9SA4gviAFuqnICoslMOVz3C+ymF+fsgM64k6kFnb7iBycXq kTTmOSrHCA2CE2EZjY6+vIpzNi/Y= X-Received: by 2002:a4a:3158:0:b0:5b1:ff38:5ee0 with SMTP id 006d021491bc7-5b24d470f6fmr320087eaf.1.1715108150335; Tue, 07 May 2024 11:55:50 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240430142434.10471-1-Jonathan.Cameron@huawei.com> <20240430142434.10471-5-Jonathan.Cameron@huawei.com> In-Reply-To: <20240430142434.10471-5-Jonathan.Cameron@huawei.com> From: "Rafael J. Wysocki" Date: Tue, 7 May 2024 20:55:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v9 04/19] ACPI: processor: Return an error if acpi_processor_get_info() fails in processor_add() To: Jonathan Cameron Cc: Thomas Gleixner , Peter Zijlstra , linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, Russell King , "Rafael J . Wysocki" , Miguel Luis , James Morse , Salil Mehta , Jean-Philippe Brucker , Catalin Marinas , Will Deacon , Marc Zyngier , Hanjun Guo , Gavin Shan , Ingo Molnar , Borislav Petkov , Dave Hansen , linuxarm@huawei.com, justin.he@arm.com, jianyong.wu@arm.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 30, 2024 at 4:26=E2=80=AFPM Jonathan Cameron wrote: > > Rafael observed [1] that returning 0 from processor_add() will result in > acpi_default_enumeration() being called which will attempt to create a > platform device, but that makes little sense when the processor is known > to be not available. So just return the error code from acpi_processor_g= et_info() > instead. > > Link: https://lore.kernel.org/all/CAJZ5v0iKU8ra9jR+EmgxbuNm=3DUwx2m1-8vn_= RAZ+aCiUVLe3Pw@mail.gmail.com/ [1] > Suggested-by: Rafael J. Wysocki > Signed-off-by: Jonathan Cameron Acked-by: Rafael J. Wysocki Thank you! > --- > v9: New patch following through from Gavin pointing out a memory leak lat= er > in the series. > --- > drivers/acpi/acpi_processor.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.= c > index 161c95c9d60a..5f062806ca40 100644 > --- a/drivers/acpi/acpi_processor.c > +++ b/drivers/acpi/acpi_processor.c > @@ -393,7 +393,7 @@ static int acpi_processor_add(struct acpi_device *dev= ice, > > result =3D acpi_processor_get_info(device); > if (result) /* Processor is not physically present or unavailable= */ > - return 0; > + return result; > > BUG_ON(pr->id >=3D nr_cpu_ids); > > -- > 2.39.2 >