From patchwork Mon Oct 16 09:51:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 153287 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3346001vqb; Mon, 16 Oct 2023 02:51:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9ubjCJyLWdfiAPm+fISgTj7hfNcz6EgCoJUGehiSo07SunyUAOTNKLwXSjjc6Y2jSjPUz X-Received: by 2002:a05:6a00:3985:b0:68f:c8b3:3077 with SMTP id fi5-20020a056a00398500b0068fc8b33077mr36094377pfb.1.1697449918170; Mon, 16 Oct 2023 02:51:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697449918; cv=none; d=google.com; s=arc-20160816; b=j3q7AppZiJDeGFJvvxum9ddhN9fqfVdpwfgh6FxEFqd9xOQZVqAXekosQWYoLWzh37 gG/L2MDtOHDAbwo8bXs8edb2MtsDYwP7vAJhxnl7IgbgFnHF8gG/f7sx5sdrex4IRYCW c21P20s6eCmF/IbeuYO01mWKCCBvO0iCwpRmpI5Y2rpDw0pywYwgl6P7TIerv/duZ6He USV+Ha1eOmT8x0NcZ5IGL9ulWsb3TPHUssgBQeZ/i08B3Sy3uE4wsqqYg8yN8lhnzIgz qMdoQwmzjhbREM1MQk+PUEwV7IrTV+5iWGHdD1cEiOpDexcci2qigtFZm0I7ruZR6aI0 4LfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=ZR8Xw0VKdm5ZQEx6TOBC00k7PmZ+VxoOGHDSFsEhUTg=; fh=2Lq/IMKJboLh3wBXbtdsp/BuyUlYbdqGriV0VGUcl/M=; b=yM4d/K+8GlvB4AmA8TSuA2bDyBFYBdQ5IMH+/6mbwili4a4n1orb1FsCwBUHjo/rGP DMHZPrxFHcIfFUuXr1owowgjSgmzj9+mVMc/f+ZOZkkmyEbN1gBqCOGeKIUFZ1lWWAFB b5J6c7b1z9XLopiZhD09x3eF7gVQjom2vNrluRJkWv7L4XI93DIiUiVpF21Rw1YgvZtk XsYpFsl5ODJXSuoU3qSXOmfeQmtTcZvIRwHBBma87J5zN+6+jsnBDdAOXKa6v/fqZa+s b2p1kxoR3ZdRB0TfEPKTAUWhCnWE83prSW5wUJKnZeq52z/rnrc20Lm0I/aKBKM0GDlZ M9ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UQQ1UDKq; dkim=neutral (no key) header.i=@linutronix.de header.b=nfeHsiOH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f18-20020a056a0022d200b006b4ac79384csi6927582pfj.347.2023.10.16.02.51.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 02:51:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UQQ1UDKq; dkim=neutral (no key) header.i=@linutronix.de header.b=nfeHsiOH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 811188065CA8; Mon, 16 Oct 2023 02:51:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231126AbjJPJvs (ORCPT + 18 others); Mon, 16 Oct 2023 05:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjJPJvq (ORCPT ); Mon, 16 Oct 2023 05:51:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87A569C; Mon, 16 Oct 2023 02:51:44 -0700 (PDT) Date: Mon, 16 Oct 2023 09:51:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697449903; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZR8Xw0VKdm5ZQEx6TOBC00k7PmZ+VxoOGHDSFsEhUTg=; b=UQQ1UDKq1BLou1Kv4sRfDPM7j1vFBNWor8254w+F4C1YkYwITSxVPsBsCQL1oP60KQvBR4 vtcTnea49tG63rd4aF9E5iKtppQJtNwU+HEjcNdgv6hlMhAQQrp8gv9Nkdfu+qf/nSPnkm ZFuhAfOvWgRPVHjZaSEkUSZEkvfHvZW7jnqUZu3hUvWYnfrwnHFD9cQfoctsemXk9Thb9E C4qAUGwe1LON50q0jdQZSF9ZxervWRZIVF604CThQDjDjWyTHdzz0VqixQCOR3yI6H9Ze1 7lSuZcqiekIw9OAJ8tZyg1dsMvhIYbdwlGUdFhX8LgXvhuVhIM3Rf8i8DRTddw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697449903; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZR8Xw0VKdm5ZQEx6TOBC00k7PmZ+VxoOGHDSFsEhUTg=; b=nfeHsiOHPviRCjMr4jdvphs9o1idBB3MqukMmqRWLSauSjZ8TNsTqP5lJW2qxRCNNP2sP0 PYu2lt2G/+ceFeBg== From: "tip-bot2 for Sandipan Das" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV Cc: Dan Carpenter , Sandipan Das , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231016060743.332051-1-sandipan.das@amd.com> References: <20231016060743.332051-1-sandipan.das@amd.com> MIME-Version: 1.0 Message-ID: <169744990239.3135.3791356843221893982.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 16 Oct 2023 02:51:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779905245625712197 X-GMAIL-MSGID: 1779905245625712197 The following commit has been merged into the perf/core branch of tip: Commit-ID: 744940f1921c8feb90e3c4bcc1e153fdd6e10fe2 Gitweb: https://git.kernel.org/tip/744940f1921c8feb90e3c4bcc1e153fdd6e10fe2 Author: Sandipan Das AuthorDate: Mon, 16 Oct 2023 11:37:43 +05:30 Committer: Ingo Molnar CommitterDate: Mon, 16 Oct 2023 11:42:01 +02:00 perf/x86/amd/uncore: Pass through error code for initialization failures, instead of -ENODEV Pass through the appropriate error code when the registration of hotplug callbacks fail during initialization, instead of returning a blanket -ENODEV. [ mingo: Updated the changelog. ] Reported-by: Dan Carpenter Signed-off-by: Sandipan Das Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20231016060743.332051-1-sandipan.das@amd.com --- arch/x86/events/amd/uncore.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/arch/x86/events/amd/uncore.c b/arch/x86/events/amd/uncore.c index a389828..4429eac 100644 --- a/arch/x86/events/amd/uncore.c +++ b/arch/x86/events/amd/uncore.c @@ -1040,20 +1040,25 @@ static int __init amd_uncore_init(void) /* * Install callbacks. Core will call them for each online cpu. */ - if (cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP, - "perf/x86/amd/uncore:prepare", - NULL, amd_uncore_cpu_dead)) + ret = cpuhp_setup_state(CPUHP_PERF_X86_AMD_UNCORE_PREP, + "perf/x86/amd/uncore:prepare", + NULL, amd_uncore_cpu_dead); + if (ret) goto fail; - if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING, - "perf/x86/amd/uncore:starting", - amd_uncore_cpu_starting, NULL)) + ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING, + "perf/x86/amd/uncore:starting", + amd_uncore_cpu_starting, NULL); + if (ret) goto fail_prep; - if (cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE, - "perf/x86/amd/uncore:online", - amd_uncore_cpu_online, - amd_uncore_cpu_down_prepare)) + + ret = cpuhp_setup_state(CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE, + "perf/x86/amd/uncore:online", + amd_uncore_cpu_online, + amd_uncore_cpu_down_prepare); + if (ret) goto fail_start; + return 0; fail_start: