From patchwork Thu Jan 24 04:10:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inderpal Singh X-Patchwork-Id: 2029041 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 7E711DF264 for ; Thu, 24 Jan 2013 04:10:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753224Ab3AXEK6 (ORCPT ); Wed, 23 Jan 2013 23:10:58 -0500 Received: from mail-pb0-f45.google.com ([209.85.160.45]:34220 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752918Ab3AXEK5 (ORCPT ); Wed, 23 Jan 2013 23:10:57 -0500 Received: by mail-pb0-f45.google.com with SMTP id rq13so231076pbb.18 for ; Wed, 23 Jan 2013 20:10:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=GXLF+DK9GnByCgWHQECSrhh7rSHTVUaYDtjkvAjMiy4=; b=Ky2yjUV0atnSx416MZW9V+mq+nJ9D8wRgaX8znJUal8VBioqABLm21lTjpvRRHrT/1 4BSv2vJ10s04HjCsqYBYoThPR60wYqON73bVSemp30PK1xUoAYG8J/s6NtVvavHJzxyb 020i0Jy5Uhs81IfgZTQ2gjClSLRNYgisBBc9akuKrjmYXGaCd4Bh2pcjkcENwrc2pl1p VchnGAf4s/D1zc97DAXNy0n0IHnK2Pv2CxbCxKNmzQRUJaYXXyWzWgn8BeOEtcqZt/JH vHSdrywAk5Atb6XjxMKQgpXqKU0vBQT1winTt5JNT785JG4wWlJjQ7OZcbhZsIGKHaxU iFmA== X-Received: by 10.68.219.67 with SMTP id pm3mr1319529pbc.150.1359000657341; Wed, 23 Jan 2013 20:10:57 -0800 (PST) Received: from inder-ubuntu.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id w5sm14829621pax.28.2013.01.23.20.10.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Jan 2013 20:10:56 -0800 (PST) From: Inderpal Singh To: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org Cc: rjw@sisk.pl, kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, patches@linaro.org Subject: [PATCH] drivers: cpufreq: exynos: update related_cpus mask to fix hotplug dump Date: Thu, 24 Jan 2013 09:40:47 +0530 Message-Id: <1359000647-8366-1-git-send-email-inderpal.singh@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkOYT2Mxm8XGz79UCp2aL9orwx/AEB3FZWRHWIXpzshMuUfvmCfhP4SSKgnUQmFGCb6dRbL Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org commit "7e6087e595d3...cpufreq: Simplify cpufreq_add_dev()" started using related_cpus mask to check if the current cpu is already managed. With above commit hotplug in exynos gives following dump. / $ echo 1 > /sys/devices/system/cpu/cpu1/online CPU1: Booted secondary processor ------------[ cut here ]------------ WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x88/0xbc() sysfs: cannot create duplicate filename '/devices/system/cpu/cpu0/cpufreq' Modules linked in: [] (unwind_backtrace+0x0/0xf8) from [] (warn_slowpath_common+0x4c/0x64) [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt+0x30/0x40) from [] (sysfs_add_one+0x88/0xbc) [] (sysfs_add_one+0x88/0xbc) from [] (sysfs_do_create_link+0x110/0x208) [] (sysfs_do_create_link+0x110/0x208) from [] (cpufreq_add_dev_interface+0x218/0x2b0) [] (cpufreq_add_dev_interface+0x218/0x2b0) from [] (cpufreq_add_dev+0x30c/0x448) [] (cpufreq_add_dev+0x30c/0x448) from [] (cpufreq_cpu_callback+0x94/0x9c) [] (cpufreq_cpu_callback+0x94/0x9c) from [] (notifier_call_chain+0x44/0x84) [] (notifier_call_chain+0x44/0x84) from [] (__cpu_notify+0x28/0x44) [] (__cpu_notify+0x28/0x44) from [] (_cpu_up+0x104/0x154) [] (_cpu_up+0x104/0x154) from [] (cpu_up+0x64/0x84) [] (cpu_up+0x64/0x84) from [] (store_online+0x50/0x78) [] (store_online+0x50/0x78) from [] (dev_attr_store+0x18/0x24) [] (dev_attr_store+0x18/0x24) from [] (sysfs_write_file+0x168/0x198) [] (sysfs_write_file+0x168/0x198) from [] (vfs_write+0x9c/0x140) [] (vfs_write+0x9c/0x140) from [] (sys_write+0x3c/0x70) [] (sys_write+0x3c/0x70) from [] (ret_fast_syscall+0x0/0x30) ---[ end trace 3d002b0ded69f43b ]--- This patch fixes it by updating the related_cpus mask. Tested on Rafael's linux-next. Signed-off-by: Inderpal Singh Acked-by: Viresh Kumar --- drivers/cpufreq/exynos-cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 7012ea8..8ba4cdb 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -238,6 +238,7 @@ static int exynos_cpufreq_cpu_init(struct cpufreq_policy *policy) cpumask_copy(policy->cpus, cpu_online_mask); } else { policy->shared_type = CPUFREQ_SHARED_TYPE_ANY; + cpumask_setall(policy->related_cpus); cpumask_setall(policy->cpus); }