Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4615357ybi; Tue, 30 Jul 2019 05:14:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqycPWeywcXkIJtcReQ+ykXXPs64X2j7KH7epgniFy1CX8usPcSdZGIaEyN89+ZIhmX4SXKz X-Received: by 2002:a17:902:aa83:: with SMTP id d3mr111539211plr.74.1564488843260; Tue, 30 Jul 2019 05:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564488843; cv=none; d=google.com; s=arc-20160816; b=eOrE+mfPiQMqPE1pThcQtpIA5JVXeTyxwBZKMZcGPGStXXv2jVWuJXJG3WbS5skxxL L3itvOwvKXDF4i4mg7myTfW1/PmhL1NoSA15ptcAM/C2rI3EKFplWuNmB+AomHQr+Nce +vW0qUg9E8OVGr2ZUlo9BOsaI0IxRlwftj21zFVVxPcs9vYB/crASC/4Zu9y+zi0c9yE HTp1iK6zQ99SsGrBwz5KFivCmHqRQNmCM/xqpJefaHqT6zW6MWGixWvXM9cQMtQExNZl cJPris1AaFQS3Qww+prEyBojPsy41XphmdxJmN5QQ96pvo8PCTVf7uhT2Vae7gRCCVyS iewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YGBrNyNmOGBItVaAlikeDRkZmnd2saiH3yWVQwuc7AY=; b=FhJq7XARsGZChNeofHym6+4IkEAr6g+SE9cEKzN1JlWSZHER0Xk4ooA7CIq6SnkXTK rmIh4JIJfJ6rG0L4TGXBKN6aPeCKKsO+he/T/xwweTkhvNGYxN68rP0GAzTT49hDfM5y tVRFu0xvfsFWUK+wtbSMNL3R8t3FE6MTEj4IcFYoR+B9hH7D768jx/RPaIutPTOjtWYf 2O78U/aQHQER272+WdzBkguvXk5qGV/CjKclzvwFdyo0dpf8ea59fNxOzCoFrMs8Cvmd DcXZHI7thGtR0C142cz/XqSFcT4tQCDlJBMNBeDVAWuHluY+IrcinGJME7Sqzy67+qRP 4a9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=teW0gCrH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a13si29373549pgw.81.2019.07.30.05.13.48; Tue, 30 Jul 2019 05:14:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=teW0gCrH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729940AbfG3L2E (ORCPT + 99 others); Tue, 30 Jul 2019 07:28:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:59456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbfG3L2D (ORCPT ); Tue, 30 Jul 2019 07:28:03 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63B232087F; Tue, 30 Jul 2019 11:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564486083; bh=rnaBRVn1mjxWpZxAFonlDUu7I1y6N0i1HPAr0bh96tg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=teW0gCrHZ5mnilA3e7+O1wr3JUumNVGxwuVSa3ZNEy+++k9Nkt7wb5hZ9Ljx/Qrb4 JsC1qkwxWVa9ipeeO9wrjq2ZX7qhmjApEEnu8xd1uB1HoDttlJpPt0bcbwE+3HOfBd /6YK3G6jDBXxqaJ3ZCHOsd9Nuqd8vEEl8m+Bylck= Date: Tue, 30 Jul 2019 12:27:59 +0100 From: Will Deacon To: Mark Rutland Cc: Lorenzo Pieralisi , Anders Roxell , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm_pmu: Mark expected switch fall-through Message-ID: <20190730112758.ctgg6l5gldsefdgs@willie-the-truck> References: <20190726112737.19309-1-anders.roxell@linaro.org> <20190726122956.GC26088@lakrids.cambridge.arm.com> <20190726151825.GA12552@e121166-lin.cambridge.arm.com> <20190730112415.GB51922@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190730112415.GB51922@lakrids.cambridge.arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote: > On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote: > > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote: > > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote: > > > > When fall-through warnings was enabled by default the following warning > > > > was starting to show up: > > > > > > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’: > > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall > > > > through [-Wimplicit-fallthrough=] > > > > cpu_pm_pmu_setup(armpmu, cmd); > > > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > ../drivers/perf/arm_pmu.c:727:2: note: here > > > > case CPU_PM_ENTER_FAILED: > > > > ^~~~ > > > > > > > > Rework so that the compiler doesn't warn about fall-through. > > > > > > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning") > > > > Signed-off-by: Anders Roxell > > > > --- > > > > > > > > I'm not convinced that this is the correct patch to fix this issue. > > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case > > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup() > > > > there also, since in cpu_pm_pmu_setup() has a case prepared for > > > > CPU_PM_ENTER_FAILED. > > > > > > I agree, think that should be: > > > > > > case CPU_PM_EXIT: > > > case CPU_PM_ENTER_FAILED: > > > cpu_pm_pmu_setup(armpmu, cmd); > > > armpmu->start(armpmu); > > > break; > > > > > > ... so that we re-start the events before we start the PMU. > > > > > > That would be a fix for commit: > > > > > > da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier") > > > > Yes that's correct, apologies. Probably we did not hit it because CPU PM > > notifier entry failures are a pretty rare event; regardless: > > > > Acked-by: Lorenzo Pieralisi > > > > I can send the updated fix, just let me know. > > I'm not sure what Will wants, but assuming you do so: > > Acked-by: Mark Rutland I gave up waiting, so it's already queued here: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/fixes&id=0d7fd70f26039bd4b33444ca47f0e69ce3ae0354 Will