From patchwork Thu Mar 14 06:42:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10852235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 318DE17EF for ; Thu, 14 Mar 2019 06:43:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C9E92A1BF for ; Thu, 14 Mar 2019 06:43:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1117F2A1C4; Thu, 14 Mar 2019 06:43:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 985742A1BF for ; Thu, 14 Mar 2019 06:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Y+YB5PhoTqnpEvNRGSguT3sgeUjqgVvefiuPrO9ECKI=; b=YRkicqhgiIUQse D8/NpoI+wPt5gwqUtonq9xwlrrrkwVh0Ob+tJoEOdoh5gqG70tdS127mUrpgIIYgVIDFEQ1xCee/G viO2KQOoBR5Aw7hnrAb7VENb+V5QLIgxTe5qTcPsShsN9mmWOLqoHZRr6UG+OSfr/9cNeZSViyWUk y3NbhwxBed2kTsx39lxJNtPhbSxrAIyaCbXokyq5nUuZi6EIcL5rEUAHWbxEJYM/8iiRW7rPhHtWR 3f0tFqDHeKjgnhmtKpPmqI7bbfmtnZpy+O24kdTtPXE05LkxiTQZB63oEYuOKmo5RmzbIyILbeAvJ pEInaqwfB3Hme/OpCK7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4K5f-00043b-Da; Thu, 14 Mar 2019 06:43:43 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h4K5O-0003hA-H5 for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2019 06:43:31 +0000 Received: by mail-pg1-x543.google.com with SMTP id h8so3323031pgp.6 for ; Wed, 13 Mar 2019 23:43:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qELTA4aujWEU9keNr9yQA2v0lmekRZinbYpRGs9xFkI=; b=u7Cwfo3HTNXiwKrg1Xm7VMazORbN94o2bgbSQzTbrMMH/hv2AKW3bvhAABqWicB/v4 b9asgi0FzheRGcnrFHLPLb4TWJFo6FCTgETwkXrrarLL5+LNgizsrqJnUFDCoutWuuqR 0ys3qt/rgIrjMeEOQMF1tUJbUIKoqzngo0Pw5nfz0P5pZbzD2MgMLpzU7u8vYP1AX2SE UTIQp1N9YYQv44EaDziD2yLPLUdGeRIlzbsiovemP4HQwk9YKbxdCVVb5Oquqs7roSz/ tAL1P3fwgMxIMURRzGJ2geREkGPTznTxUDRymTjz/gYQ1dthykaya/JICIL1lYNV/VBF NhsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qELTA4aujWEU9keNr9yQA2v0lmekRZinbYpRGs9xFkI=; b=MFSvoJGcrCntXWz6P9jyg/kf6sAq1mYdl2+R/EANKj20GXObyRLTD4YRtQxeaPuZWs BlOSwEU6i6AZfHd21B4jCNmlhty/bImrmoLMN5vVPVtb4prRaOhDuiQoHsP/JWM7sc2C YiZGZPuoJnqXojurRNW2MnmdGpclMnOlyfM32IdM7VdUS2EuFCSzriHi/qFBRBcAY2fa bOU8zAP7aZNmJQrmohOw2qXqVy1owINjHWbFCVE9CWsbLjalmV2DrX99XutvpAcB2OiZ qx4T8nro0Q68hyA+cv7DRCDs32JUJucpCjp/6lhxT4fiTD5M9v0A3ovgs8wgiIUvjIcO mDBQ== X-Gm-Message-State: APjAAAVmi+0LSZE22YBMfg1XxNQg//+CdcV9Jcm9+7it7tnPpxQrOlO4 h1M2mIngwg/IiPTdknIAo2MtsQ== X-Google-Smtp-Source: APXvYqzEbwwxjCug9kdh/7bejtUsTgAC7OJlUejiEL+ajhn8s2NdVFN0pvHFBtOZYPx8uOLJs3Y6tQ== X-Received: by 2002:a65:5c0b:: with SMTP id u11mr34473391pgr.352.1552545805889; Wed, 13 Mar 2019 23:43:25 -0700 (PDT) Received: from localhost ([122.166.134.37]) by smtp.gmail.com with ESMTPSA id l7sm49201244pfj.162.2019.03.13.23.43.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 23:43:25 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Russell King Subject: [PATCH 3/7] ARM: twd: Update cpufreq transition notifier to handle multiple CPUs Date: Thu, 14 Mar 2019 12:12:49 +0530 Message-Id: <3c977305886032ba871bd266d555ede47b4576fc.1552545525.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190313_234327_065239_2496D60F X-CRM114-Status: GOOD ( 12.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Viresh Kumar , Vincent Guittot , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The cpufreq core currently calls the cpufreq transition notifier callback once for each affected CPU. This is going to change soon and the cpufreq core will call the callback only once for each cpufreq policy. The callback must look at the newly added field in struct cpufreq_freqs, "cpus", which contains policy->related_cpus (both online/offline CPUs) and perform per-cpu actions for them if any. This patch updates twd_cpufreq_transition() to use the new "cpus" field and run twd_update_frequency() for each online CPU present in the freqs->cpus. Signed-off-by: Viresh Kumar --- arch/arm/kernel/smp_twd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index b30eafeef096..df7db45d931b 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c @@ -162,15 +162,18 @@ static int twd_cpufreq_transition(struct notifier_block *nb, unsigned long state, void *data) { struct cpufreq_freqs *freqs = data; + int cpu; /* * The twd clock events must be reprogrammed to account for the new * frequency. The timer is local to a cpu, so cross-call to the * changing cpu. */ - if (state == CPUFREQ_POSTCHANGE) - smp_call_function_single(freqs->cpu, twd_update_frequency, - NULL, 1); + if (state != CPUFREQ_POSTCHANGE) + return NOTIFY_OK; + + for_each_cpu_and(cpu, freqs->cpus, cpu_online_mask) + smp_call_function_single(cpu, twd_update_frequency, NULL, 1); return NOTIFY_OK; }