From patchwork Wed Nov 20 21:06:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 3215631 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D4D9C045B for ; Wed, 20 Nov 2013 21:06:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8F7FA2077A for ; Wed, 20 Nov 2013 21:06:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AA6742076C for ; Wed, 20 Nov 2013 21:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755252Ab3KTVGa (ORCPT ); Wed, 20 Nov 2013 16:06:30 -0500 Received: from avon.wwwdotorg.org ([70.85.31.133]:52939 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755131Ab3KTVG3 (ORCPT ); Wed, 20 Nov 2013 16:06:29 -0500 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 2F2DD622C; Wed, 20 Nov 2013 14:06:29 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id CD76CE45FB; Wed, 20 Nov 2013 14:06:24 -0700 (MST) From: Stephen Warren To: "Rafael J. Wysocki" , Viresh Kumar Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, Stephen Warren Subject: [PATCH] cpufreq: tegra: don't error target() when suspended Date: Wed, 20 Nov 2013 14:06:22 -0700 Message-Id: <1384981582-30697-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.8.1.5 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.8 at avon.wwwdotorg.org X-Virus-Status: Clean Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Stephen Warren d4019f0a92ab "cpufreq: move freq change notifications to cpufreq core" added code to the cpufreq core to print an error if a cpufreq driver's .target() function returned an error. This exposed the fact that Tegra's cpufreq driver returns an error when it is ignoring requests due to the system being suspended. Modify Tegra's .target() function not to return an error in this case; this prevents the error prints. The argument is that since the suspend hook can't and doesn't inform the cpufreq core when its requests will be ignored, there's no way for the cpufreq core to squelch them, so it's not an error for the requests to keep coming. This change make the Tegra driver consistent with how the Exynos handles the same situation. Note that s5pv210-cpufreq.c probably suffers from this same issue though. Signed-off-by: Stephen Warren --- This is a fix for 3.13. Commit d4019f0a92ab also failed to update the Tegra pm_notifier hook to emit cpufreq notifications. That hook calls the target() implementation directly, which used to emit the notifications. However, now that the notifications are made outside of target(), they no longer occur when target() is called directly. I'm not sure if this is an issue or not? --- drivers/cpufreq/tegra-cpufreq.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/cpufreq/tegra-cpufreq.c b/drivers/cpufreq/tegra-cpufreq.c index f42df7ec03c5..b7309c37033d 100644 --- a/drivers/cpufreq/tegra-cpufreq.c +++ b/drivers/cpufreq/tegra-cpufreq.c @@ -142,10 +142,8 @@ static int tegra_target(struct cpufreq_policy *policy, unsigned int index) mutex_lock(&tegra_cpu_lock); - if (is_suspended) { - ret = -EBUSY; + if (is_suspended) goto out; - } freq = freq_table[index].frequency;