From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D3BBC4332F for ; Tue, 8 Nov 2022 09:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l4tdfIM+cMUqbV+qPEwGfASidc4bMDQYF0MufyPm5SI=; b=JUEy8+7DNrr0n6 sL5o9YlDNawnRqsGhY6HaMIffj4L2h/79XyYpDMz7YLpT6sspJ67/HQwaPwkwXZ1+iJn9q+zR/Y5w RvZhDBT08PhcWWgS8ZLyUARyJASeE+zE9sCxVgDOX94BtIPnMDU1eDfogfN8ApE7q8f7809AUQHPL gCye2Bsc23nxLgn2lRamJSwbT863sqVCrxPtHE9P0BTKYuDZ6VN11lSfB0GFJjy3Abc4fuo20ufP/ QqGbJ/q7R5OiCbikN5PMj1TLqGuF9MPRZG9KN1tinyDY4X3k/e7cK7WNcboTXn+l0HV0JNHOcl4ri RP1PLFX23yzCiMtWPdNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osL8o-004BNz-IZ; Tue, 08 Nov 2022 09:43:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1osL7u-004AxV-Dc for linux-arm-kernel@lists.infradead.org; Tue, 08 Nov 2022 09:42:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5DA791FB; Tue, 8 Nov 2022 01:42:41 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.38.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 647493F534; Tue, 8 Nov 2022 01:42:34 -0800 (PST) Date: Tue, 8 Nov 2022 09:42:28 +0000 From: Mark Rutland To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, pierre.gondois@arm.com, valentin.schneider@arm.com, vschneid@redhat.com Subject: Re: [PATCH 3/3] arm_pmu: rework ACPI probing Message-ID: References: <20220930111844.1522365-1-mark.rutland@arm.com> <20220930111844.1522365-4-mark.rutland@arm.com> <20221107191017.GA21991@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221107191017.GA21991@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221108_014238_528988_53300EC0 X-CRM114-Status: GOOD ( 18.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Nov 07, 2022 at 07:10:18PM +0000, Will Deacon wrote: > On Fri, Sep 30, 2022 at 12:18:44PM +0100, Mark Rutland wrote: > > @@ -320,13 +320,26 @@ int arm_pmu_acpi_probe(armpmu_init_fn init_fn) > > * For the moment, as with the platform/DT case, we need at least one > > * of a PMU's CPUs to be online at probe time. > > */ > > - for_each_possible_cpu(cpu) { > > + for_each_online_cpu(cpu) { > > struct arm_pmu *pmu = per_cpu(probed_pmus, cpu); > > + unsigned long cpuid; > > char *base_name; > > > > - if (!pmu || pmu->name) > > + /* If we've already probed this CPU, we have nothing to do */ > > + if (pmu) > > continue; > > > > + pmu = armpmu_alloc(); > > + if (!pmu) { > > + pr_warn("Unable to allocate PMU for CPU%d\n", > > + cpu); > > + } > > + > > + cpuid = per_cpu(cpu_data, cpu).reg_midr; > > + pmu->acpi_cpuid = cpuid; > > I've queued this, but if armpmu_alloc() fails we now deference NULL here > whereas we should probably propagate the error. Whoops; that was meant to return -ENOMEM, as with the other allocation failure. > Please can you send a fix on top of for-next/acpi? Done: https://lore.kernel.org/r/20221108093725.1239563-1-mark.rutland@arm.com Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel