From patchwork Mon Feb 17 09:22:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 24747 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 86279202B2 for ; Mon, 17 Feb 2014 09:22:39 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id at1sf23082406iec.9 for ; Mon, 17 Feb 2014 01:22:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=UstLcbd+b1Baumx1oK/acqxuTTfezuP4HyGjIcMAi/Q=; b=Sdg4A1q5ayI3QCj+ahd0aRG93hq54+mqdBO9CrJAKW5+sdz0PV8pCT03LJuyGaYwWS 4mACYnoId5m6AKf4EhC/e35R4sp2SoTedAwVKoeUfKPTJ7oZlN80iCpjtMSJ4dczeUTI Po7TyqvY+/0DSCnMgFY+00CfwuDNh4PlNThDwsw4XTE1ke8fwU2YdIw1rSICgGmwvMFx IqUBufRXKzenLEKY79xd9NCu6aVEXzjDyEeXquLkoAwpr55+oJlNxiDFlnilc/mD0Mvh XJfYWh9yG6bdBQ3fpRC/6WDh7nehOUCFHeBsyUfUfuMNYE4ky7Y/g/SyZA5+x3BlIsER XQXg== X-Gm-Message-State: ALoCoQkhkNT/A4/J08Rakz+bNwUzoye70H2wbml0X+p/MWRhdWt02mL1/kHrrTw8jvWD3HhQR2LU X-Received: by 10.182.108.136 with SMTP id hk8mr9990162obb.11.1392628958655; Mon, 17 Feb 2014 01:22:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.65 with SMTP id a59ls918747qge.72.gmail; Mon, 17 Feb 2014 01:22:38 -0800 (PST) X-Received: by 10.220.247.68 with SMTP id mb4mr565449vcb.37.1392628958559; Mon, 17 Feb 2014 01:22:38 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id f5si4340160vej.111.2014.02.17.01.22.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Feb 2014 01:22:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id id10so11684216vcb.27 for ; Mon, 17 Feb 2014 01:22:38 -0800 (PST) X-Received: by 10.52.246.133 with SMTP id xw5mr10131685vdc.32.1392628958449; Mon, 17 Feb 2014 01:22:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp123473vcz; Mon, 17 Feb 2014 01:22:38 -0800 (PST) X-Received: by 10.66.124.230 with SMTP id ml6mr25668094pab.29.1392628957662; Mon, 17 Feb 2014 01:22:37 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id eb3si14147648pbc.56.2014.02.17.01.22.37; Mon, 17 Feb 2014 01:22:37 -0800 (PST) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbaBQJWZ (ORCPT + 27 others); Mon, 17 Feb 2014 04:22:25 -0500 Received: from mail-we0-f179.google.com ([74.125.82.179]:44767 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbaBQJWT (ORCPT ); Mon, 17 Feb 2014 04:22:19 -0500 Received: by mail-we0-f179.google.com with SMTP id q58so10530430wes.10 for ; Mon, 17 Feb 2014 01:22:18 -0800 (PST) X-Received: by 10.180.25.46 with SMTP id z14mr11956657wif.49.1392628938152; Mon, 17 Feb 2014 01:22:18 -0800 (PST) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id xt1sm35204230wjb.17.2014.02.17.01.22.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 17 Feb 2014 01:22:17 -0800 (PST) From: Viresh Kumar To: rjw@rjwysocki.net, swarren@nvidia.com Cc: linaro-kernel@lists.linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: [PATCH] cpufreq: remove sysfs link when a cpu != policy->cpu, is removed Date: Mon, 17 Feb 2014 14:52:11 +0530 Message-Id: <324f43fc664f51eec355b08b6c2d4cedd2140b4c.1392628861.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Earlier patch tried to do this but missed this piece of code to fix. 42f921a cpufreq: remove sysfs files for CPUs which failed to come back after resume Currently we are getting this on suspend/resume: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 877 at fs/sysfs/dir.c:52 sysfs_warn_dup+0x68/0x84() sysfs: cannot create duplicate filename '/devices/system/cpu/cpu1/cpufreq' Modules linked in: brcmfmac brcmutil CPU: 0 PID: 877 Comm: test-rtc-resume Not tainted 3.14.0-rc2-00259-g9398a10cd964 #12 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x80/0xcc) [] (dump_stack) from [] (warn_slowpath_common+0x64/0x88) [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x68/0x84) [] (sysfs_warn_dup) from [] (sysfs_do_create_link_sd+0xb0/0xb8) [] (sysfs_do_create_link_sd) from [] (__cpufreq_add_dev.isra.27+0x2a8/0x814) [] (__cpufreq_add_dev.isra.27) from [] (cpufreq_cpu_callback+0x70/0x8c) [] (cpufreq_cpu_callback) from [] (notifier_call_chain+0x44/0x84) [] (notifier_call_chain) from [] (__cpu_notify+0x28/0x44) [] (__cpu_notify) from [] (_cpu_up+0xf0/0x140) [] (_cpu_up) from [] (enable_nonboot_cpus+0x68/0xb0) [] (enable_nonboot_cpus) from [] (suspend_devices_and_enter+0x198/0x2dc) [] (suspend_devices_and_enter) from [] (pm_suspend+0x174/0x1e8) [] (pm_suspend) from [] (state_store+0x6c/0xbc) [] (state_store) from [] (kobj_attr_store+0x14/0x20) [] (kobj_attr_store) from [] (sysfs_kf_write+0x44/0x48) [] (sysfs_kf_write) from [] (kernfs_fop_write+0xb4/0x14c) [] (kernfs_fop_write) from [] (vfs_write+0xa8/0x180) [] (vfs_write) from [] (SyS_write+0x3c/0x70) [] (SyS_write) from [] (ret_fast_syscall+0x0/0x30) ---[ end trace 76969904b614c18f ]--- Fix this by removing sysfs link for cpufreq directory when cpu removed isn't policy->cpu. Reported-by: Stephen Warren Signed-off-by: Viresh Kumar --- Fix for 3.14 only. drivers/cpufreq/cpufreq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 08ca8c9..cb003a6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1323,8 +1323,7 @@ static int __cpufreq_remove_dev_prepare(struct device *dev, up_read(&policy->rwsem); if (cpu != policy->cpu) { - if (!frozen) - sysfs_remove_link(&dev->kobj, "cpufreq"); + sysfs_remove_link(&dev->kobj, "cpufreq"); } else if (cpus > 1) { new_cpu = cpufreq_nominate_new_policy_cpu(policy, cpu); if (new_cpu >= 0) {