Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp62786ybi; Fri, 26 Jul 2019 06:11:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2R63rs3GCyIXxg7f9H6wXfBBwlFpEmIy5hBvxBl19rscSvXxCQhEfAb0eO8/1MW2TgfH3 X-Received: by 2002:aa7:92cb:: with SMTP id k11mr22456777pfa.126.1564146674871; Fri, 26 Jul 2019 06:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564146674; cv=none; d=google.com; s=arc-20160816; b=XkhJQxYm7aXHmF4cvfhD5jn6sk/pbqw9awbk84MSw4Zmzn6z5Xy9Fgr3nQ3B2pxMtX As4bku/vqat9O2RExFAF+RAxUT1CUVDT8IfViuEzwCI3s9fZnBREU5N8Wetv52WIdtHR PO9gwIPVy13INT4PMvJk34ylugV1BsyjdexzhcrzOiMhnI7e6AVcWTd48TuEJM/nmucT Js5tYIASxIRWrfVbWWJ79pfDGuZoqcgRDHrKv5EgAbZvcef5rzJ2MTrBdBLN1ebc1TVE 9G4vEleBJYq3X8W4SQEQc2HVn/nXNGsKMDXrHde6kT5hFE+bVjGb7PmRm2BRtAcOGob0 bi5g== 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=KVb4D3VjYBW+3+f+OsnFKIv6vApNr2wl9Dh00WPWnQk=; b=lChUs20jBptHRtESakpUqgmDZs2NQapbNKK0rgCj8ZWCnuufMDCj3lri8saFLzxHCk a6TYA+tDweuYDu4GKRNSKKoZrRmcma0p9Hh8oPyZEJ5dViVvO3sUbKzhBLOyghAsxK50 d6bGPBj/pcF5uz95BmOwiFCw0vTdpxL3poTvmuTrnEOy3400NZ8Re9dgnFNsoPBAjQPv 2PmSnq9/kykR3lSfV0rOluMHJwe84rGFD3/F13A5EU8iXOJ80RqxPLr0+tAjX1/A0gD8 8odZddscOkLOMYMIZ+5qZIfxQ36ntoayLuw4737JVMBLBoGxlF6pEY1VDD1o2UsYud3n YbKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T0cPsAPN; 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 p22si21398799pli.255.2019.07.26.06.10.59; Fri, 26 Jul 2019 06:11:14 -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=T0cPsAPN; 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 S1726956AbfGZNGr (ORCPT + 99 others); Fri, 26 Jul 2019 09:06:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbfGZNGq (ORCPT ); Fri, 26 Jul 2019 09:06:46 -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 B1245218D4; Fri, 26 Jul 2019 13:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564146405; bh=wy90VSu21JsNlVD4p9aROU7aEivMN9wBYYTtojIdGuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T0cPsAPNe8K0N153hhhClYfBNU/9g1TYS9J14wsei7fNcElNIaZqDT3mTzxNdvb/h 64NRjFkUXZBRz4k5ATbS46cxZdTCjIuBUDamPdioHsSi8B22Wsw3NMr5H6/kuj9FsM l5gjkIaNuY5HiXfkLfLTVBkhrhDeElef1P9wY0U0= Date: Fri, 26 Jul 2019 14:06:41 +0100 From: Will Deacon To: Mark Rutland Cc: Anders Roxell , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com Subject: Re: [PATCH] arm_pmu: Mark expected switch fall-through Message-ID: <20190726130641.dp3qrvyhsote5iu3@willie-the-truck> References: <20190726112737.19309-1-anders.roxell@linaro.org> <20190726122956.GC26088@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: <20190726122956.GC26088@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 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") Does seem about right, but I'd like Lorenzo's ack on this. Will