From patchwork Thu Jul 23 09:02:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 51387 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 3FDCB22A9E for ; Thu, 23 Jul 2015 09:02:55 +0000 (UTC) Received: by wixh2 with SMTP id h2sf34759413wix.0 for ; Thu, 23 Jul 2015 02:02:54 -0700 (PDT) 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=Ff+6YBBrMPDIuFjTxI+CWusQc6PK05zGUByUXiR677k=; b=bmR3Lk7oyUxMqsvHLsOp6cqL/UO+z41zgtUBQ8hpggMDb12W/dQz56m8uPYdFva0bB YC0iiGm92Vz1Xo6FdOMPF7gE9iwJBl4hoT5z/RoCaeWieVwb7janGs4rhHDmuFsmdBtj xXtbUwYqtm5cwRbSc8nBJTZjMLz6R17C6GuB9m8MUsJ/bRXDYyd5XemxHOGJgb6jVCjP ydRfODkDjq7rrlEgVdSWhNXjpry6jxflwMGZXnS73ZUecbYRkROJcUl464CgE1/gVPu/ 2lS7+5DRTBCXXMEsVLWZlJIIuqJaDNmnTjCm5KUMbAPXIGwjYmox9f0bBMw8ItZfzZ3E nJcQ== X-Gm-Message-State: ALoCoQnegj3UpqQ+4YPzPo5/ZINpwj+/s+qs/TMFzMovKG78L4nAPSqoEnRNzlu+xTWK7JIE0v6+ X-Received: by 10.194.60.73 with SMTP id f9mr3255971wjr.6.1437642174499; Thu, 23 Jul 2015 02:02:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.225 with SMTP id v1ls213792lav.71.gmail; Thu, 23 Jul 2015 02:02:54 -0700 (PDT) X-Received: by 10.152.9.5 with SMTP id v5mr6476956laa.111.1437642174277; Thu, 23 Jul 2015 02:02:54 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id s12si3570585lbp.106.2015.07.23.02.02.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 02:02:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by lagw2 with SMTP id w2so153303488lag.3 for ; Thu, 23 Jul 2015 02:02:53 -0700 (PDT) X-Received: by 10.152.9.66 with SMTP id x2mr5940398laa.76.1437642173761; Thu, 23 Jul 2015 02:02:53 -0700 (PDT) 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.112.7.198 with SMTP id l6csp422131lba; Thu, 23 Jul 2015 02:02:52 -0700 (PDT) X-Received: by 10.107.12.30 with SMTP id w30mr11293985ioi.82.1437642172242; Thu, 23 Jul 2015 02:02:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si15396727igl.24.2015.07.23.02.02.51; Thu, 23 Jul 2015 02:02:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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 S1752254AbbGWJCu (ORCPT + 12 others); Thu, 23 Jul 2015 05:02:50 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34515 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbbGWJCs (ORCPT ); Thu, 23 Jul 2015 05:02:48 -0400 Received: by pacan13 with SMTP id an13so155972376pac.1 for ; Thu, 23 Jul 2015 02:02:47 -0700 (PDT) X-Received: by 10.70.129.232 with SMTP id nz8mr16380977pdb.159.1437642167218; Thu, 23 Jul 2015 02:02:47 -0700 (PDT) Received: from localhost ([122.171.186.190]) by smtp.gmail.com with ESMTPSA id w10sm7614318pds.49.2015.07.23.02.02.46 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 23 Jul 2015 02:02:46 -0700 (PDT) From: Viresh Kumar To: edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, javi.merino@arm.com, Viresh Kumar , linux-kernel@vger.kernel.org (open list), linux-pm@vger.kernel.org (open list:THERMAL), Zhang Rui Subject: [PATCH] thermal: remove dangling 'weight_attr' device file Date: Thu, 23 Jul 2015 14:32:32 +0530 Message-Id: <874682c7b1ab8b0fcc2abc905c71bc2bc041aaeb.1437642037.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.4.0 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@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=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) 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: , This file isn't getting removed while we unbind a device from thermal zone. And this causes following messages when the device is registered again: WARNING: CPU: 0 PID: 2228 at /home/viresh/linux/fs/sysfs/dir.c:31 sysfs_warn_dup+0x60/0x70() sysfs: cannot create duplicate filename '/devices/virtual/thermal/thermal_zone0/cdev0_weight' Modules linked in: cpufreq_dt(+) [last unloaded: cpufreq_dt] CPU: 0 PID: 2228 Comm: insmod Not tainted 4.2.0-rc3-00059-g44fffd9473eb #272 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x84/0xc4) [] (dump_stack) from [] (warn_slowpath_common+0x80/0xb0) [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt) from [] (sysfs_warn_dup+0x60/0x70) [] (sysfs_warn_dup) from [] (sysfs_add_file_mode_ns+0x13c/0x190) [] (sysfs_add_file_mode_ns) from [] (sysfs_create_file_ns+0x3c/0x48) [] (sysfs_create_file_ns) from [] (thermal_zone_bind_cooling_device+0x260/0x358) [] (thermal_zone_bind_cooling_device) from [] (of_thermal_bind+0x88/0xb4) [] (of_thermal_bind) from [] (__thermal_cooling_device_register+0x17c/0x2e0) [] (__thermal_cooling_device_register) from [] (__cpufreq_cooling_register+0x3a0/0x51c) [] (__cpufreq_cooling_register) from [] (cpufreq_ready+0x44/0x88 [cpufreq_dt]) [] (cpufreq_ready [cpufreq_dt]) from [] (cpufreq_add_dev+0x4a0/0x7dc) [] (cpufreq_add_dev) from [] (subsys_interface_register+0x94/0xd8) [] (subsys_interface_register) from [] (cpufreq_register_driver+0x10c/0x1f0) [] (cpufreq_register_driver) from [] (dt_cpufreq_probe+0x60/0x8c [cpufreq_dt]) [] (dt_cpufreq_probe [cpufreq_dt]) from [] (platform_drv_probe+0x44/0xa4) [] (platform_drv_probe) from [] (driver_probe_device+0x174/0x2b4) [] (driver_probe_device) from [] (__driver_attach+0x8c/0x90) [] (__driver_attach) from [] (bus_for_each_dev+0x68/0x9c) [] (bus_for_each_dev) from [] (bus_add_driver+0x19c/0x214) [] (bus_add_driver) from [] (driver_register+0x78/0xf8) [] (driver_register) from [] (do_one_initcall+0x8c/0x1d4) [] (do_one_initcall) from [] (do_init_module+0x5c/0x1b8) [] (do_init_module) from [] (load_module+0xd34/0xed8) [] (load_module) from [] (SyS_init_module+0xd0/0x120) [] (SyS_init_module) from [] (ret_fast_syscall+0x0/0x3c) ---[ end trace 3be0e7b7dc6e3c4f ]--- Fixes: db91651311c8 ("thermal: export weight to sysfs") Signed-off-by: Viresh Kumar --- drivers/thermal/thermal_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 04659bfb888b..4ca211be4c0f 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1333,6 +1333,7 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, return -ENODEV; unbind: + device_remove_file(&tz->device, &pos->weight_attr); device_remove_file(&tz->device, &pos->attr); sysfs_remove_link(&tz->device.kobj, pos->name); release_idr(&tz->idr, &tz->lock, pos->id);