From patchwork Wed Feb 25 04:35:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 45008 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1819520502 for ; Wed, 25 Feb 2015 04:35:31 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id h11sf1444037wiw.1 for ; Tue, 24 Feb 2015 20:35:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=t+IIX2pmHoTcrBNJOZCXbtKIjAcIFb2Par5y/tbWw9s=; b=YbMXGBWfWF40BZfpEnY9JA3/XKKcVJE/JUuPAgdfIoQiJHWBkqGqsIplvpQlGfAIm3 URz7iAVlVoaFCu0seCSrTltQ+NOKDKZ8X8S8xiZDidtpqzBvzGlQ/leCN/MrnrY60cpc OQFapSPJst3VNr7lPmCRY1SJ9VwB9Z12fR25UfUEmeFtCbqFt118200i1oivBkswEniA tgBw1ZmU8W1UXhTa5AFvLCD5I/BvwX64CWmoEK+fkYWmo/aquSfn2t5Zh73GNioj71Gw vNZQHjBLygzDzB6PpzfAHOht4D+iAVreZGJP4CB2GNZpFc1P7YxwrFsYnVgINNpeShlU MQpg== X-Gm-Message-State: ALoCoQlZDT1eHyNU/7QDx3ZORy1tSU7uUsqcNo7dJhnAcHlwDP+TZ+gO+UEqJ3OvasxGYxQB5mL5 X-Received: by 10.180.182.44 with SMTP id eb12mr2563321wic.4.1424838930352; Tue, 24 Feb 2015 20:35:30 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.9 with SMTP id js9ls787167lab.69.gmail; Tue, 24 Feb 2015 20:35:30 -0800 (PST) X-Received: by 10.112.219.135 with SMTP id po7mr942091lbc.111.1424838930122; Tue, 24 Feb 2015 20:35:30 -0800 (PST) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id og8si27663060lbb.6.2015.02.24.20.35.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 20:35:29 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by labgq15 with SMTP id gq15so1369566lab.6 for ; Tue, 24 Feb 2015 20:35:29 -0800 (PST) X-Received: by 10.112.114.230 with SMTP id jj6mr1023410lbb.112.1424838929679; Tue, 24 Feb 2015 20:35:29 -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.112.35.133 with SMTP id h5csp2367146lbj; Tue, 24 Feb 2015 20:35:28 -0800 (PST) X-Received: by 10.68.202.98 with SMTP id kh2mr2407817pbc.6.1424838927569; Tue, 24 Feb 2015 20:35:27 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ni7si2818603pdb.166.2015.02.24.20.35.25; Tue, 24 Feb 2015 20:35:27 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752120AbbBYEfP (ORCPT + 11 others); Tue, 24 Feb 2015 23:35:15 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:40133 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbbBYEfO (ORCPT ); Tue, 24 Feb 2015 23:35:14 -0500 Received: by pdev10 with SMTP id v10so2004747pde.7 for ; Tue, 24 Feb 2015 20:35:13 -0800 (PST) X-Received: by 10.70.39.33 with SMTP id m1mr2349400pdk.2.1424838913383; Tue, 24 Feb 2015 20:35:13 -0800 (PST) Received: from [192.168.0.7] ([122.172.196.7]) by mx.google.com with ESMTPSA id qj3sm40888211pac.31.2015.02.24.20.35.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Feb 2015 20:35:12 -0800 (PST) Message-ID: <54ED50F5.5080603@linaro.org> Date: Wed, 25 Feb 2015 10:05:01 +0530 From: viresh kumar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ethan Zhao , ethan zhao CC: Rafael Wysocki , santosh shilimkar , Linaro Kernel Mailman List , "linux-pm@vger.kernel.org" , linux-kernel , guangyu.sun@oracle.com, "sriharsha.devdas@oracle.com" Subject: Re: [PATCH Resend] cpufreq: Set cpufreq_cpu_data to NULL before putting kobject References: <54CEECF7.7020504@oracle.com> <54CEF123.5050106@oracle.com> <54CEF574.6040404@oracle.com> <54CEF7AA.80401@oracle.com> <54CEFA23.7040705@oracle.com> <54CF0106.5050601@oracle.com> <54CF9209.1050403@oracle.com> In-Reply-To: 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.41 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: , On Wednesday 25 February 2015 08:54 AM, Ethan Zhao wrote: > Viresh, > With this patch applied, still got the following warning and panic, > seems it needs more care. > > 54.474618] ------------[ cut here ]------------ > [ 54.545816] WARNING: CPU: 0 PID: 213 at include/linux/kref.h:47 > kobject_get+0x41/0x50() > [ 54.642595] Modules linked in: i2c_i801(+) mfd_core shpchp(+) > acpi_cpufreq(+) edac_core ioatdma(+) xfs libcrc32c ast syscopyarea ixgbe > sysfillrect sysimgblt sr_mod sd_mod drm_kms_helper igb mdio cdrom e1000e ahci > dca ttm libahci uas drm i2c_algo_bit ptp megaraid_sas libata usb_storage > i2c_core pps_core dm_mirror dm_region_hash dm_log dm_mod > [ 55.007264] CPU: 0 PID: 213 Comm: kworker/0:2 Not tainted > 3.18.5 > [ 55.099970] Hardware name: Oracle Corporation SUN FIRE X4170 M2 SERVER > /ASSY,MOTHERBOARD,X4170, BIOS 08120104 05/08/2012 > [ 55.239736] Workqueue: kacpi_notify acpi_os_execute_deferred > [ 55.308598] 0000000000000000 00000000bd730b61 ffff88046742baf8 > ffffffff816b7edb > [ 55.398305] 0000000000000000 0000000000000000 ffff88046742bb38 > ffffffff81078ae1 > [ 55.488040] ffff88046742bbd8 ffff8806706b3000 0000000000000292 > 0000000000000000 > [ 55.577776] Call Trace: > [ 55.608228] [] dump_stack+0x46/0x58 > [ 55.670895] [] warn_slowpath_common+0x81/0xa0 > [ 55.743952] [] warn_slowpath_null+0x1a/0x20 > [ 55.814929] [] kobject_get+0x41/0x50 > [ 55.878654] [] cpufreq_cpu_get+0x75/0xc0 > [ 55.946528] [] cpufreq_update_policy+0x2e/0x1f0 > [ 56.021682] [] ? up+0x32/0x50 > [ 56.078126] [] ? acpi_ns_get_node+0xcb/0xf2 > [ 56.148974] [] ? acpi_evaluate_object+0x22c/0x252 > [ 56.226066] [] ? acpi_get_handle+0x95/0xc0 > [ 56.295871] [] ? acpi_has_method+0x25/0x40 > [ 56.365661] [] acpi_processor_ppc_has_changed+0x77/0x82 > [ 56.448956] [] ? move_linked_works+0x66/0x90 > [ 56.520842] [] acpi_processor_notify+0x58/0xe7 > [ 56.594807] [] acpi_ev_notify_dispatch+0x44/0x5c > [ 56.670859] [] acpi_os_execute_deferred+0x15/0x22 > [ 56.747936] [] process_one_work+0x14e/0x3f0 > [ 56.818766] [] worker_thread+0x11b/0x4d0 > [ 56.886486] [] ? rescuer_thread+0x350/0x350 > [ 56.957316] [] kthread+0xe1/0x100 > [ 57.017742] [] ? kthread_create_on_node+0x1b0/0x1b0 > [ 57.096903] [] ret_from_fork+0x7c/0xb0 > [ 57.162534] [] ? kthread_create_on_node+0x1b0/0x1b0 > [ 57.241680] ---[ end trace dce06bb76f547de5 ]--- > > > Any idea ? No. Santosh reported this to me few days back, I asked him to perform some testing but don't know what happened after that.. Can you give me full kernel logs along with the crash after this patch. You will be required to do some testing this time as I don't have any clue about the problem.. --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index b4375021238f..230a59d2e0d7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -214,8 +214,10 @@ struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) if (cpufreq_driver) { /* get the CPU */ policy = per_cpu(cpufreq_cpu_data, cpu); - if (policy) + if (policy) { kobject_get(&policy->kobj); + pr_info("%s: %d", __func__, atomic_read(&policy->kobj.kref.refcount)); + } } read_unlock_irqrestore(&cpufreq_driver_lock, flags); @@ -233,6 +235,7 @@ void cpufreq_cpu_put(struct cpufreq_policy *policy) return; kobject_put(&policy->kobj); + pr_info("%s: %d", __func__, atomic_read(&policy->kobj.kref.refcount)); up_read(&cpufreq_rwsem); } EXPORT_SYMBOL_GPL(cpufreq_cpu_put);