Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753365AbbG3GiA (ORCPT ); Thu, 30 Jul 2015 02:38:00 -0400 Received: from mga01.intel.com ([192.55.52.88]:63143 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbbG3Gh7 (ORCPT ); Thu, 30 Jul 2015 02:37:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,575,1432623600"; d="scan'208";a="774277662" From: Alexander Shishkin To: Chunyan Zhang Cc: Greg Kroah-Hartman , "linux-kernel\@vger.kernel.org" , Mathieu Poirier , peter.lachner@intel.com, norbert.schulz@intel.com, keven.boell@intel.com, yann.fouassier@intel.com, laurent.fert@intel.com, "linux-api\@vger.kernel.org" , Chunyan Zhang , Mark Brown Subject: Re: [PATCH v3 01/11] stm class: Introduce an abstraction for System Trace Module devices In-Reply-To: References: <1436177344-16751-1-git-send-email-alexander.shishkin@linux.intel.com> <1436177344-16751-2-git-send-email-alexander.shishkin@linux.intel.com> <877fpjkseh.fsf@ashishki-desk.ger.corp.intel.com> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Thu, 30 Jul 2015 09:37:53 +0300 Message-ID: <87vbd29mm6.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1695 Lines: 44 Chunyan Zhang writes: > Sure, I mean, the root reason of this problem is here ( i.e. > "stm_core_up" was zero then): > if (!stm_core_up) > return -EPROBE_DEFER; > > Why it was zero? > Because the function (i.e. stm_core_init() ) in which "stm_core_up" > would be added one hasn't been executed at this moment. It would be > executed on module_init stage for you this version of patch. Again, this is the indented behavior. > The reason of this warning is: > After stm_probe() failed, clk_core_disable() would be called from > amba_put_disable_pclk(), then WARN_ON() happened: > if (WARN_ON(core->enable_count == 0)) > return; > > I'm guessing the reason why "core->enable_count" was 0 at this moment is: > I don't know who created a thread to process the > amba_pm_runtime_suspend(), in which clk_core_disable() was already > called, "core->enable_count" was, of course, cleared to zero then. > And this thread run before amba_put_disable_pclk(pcdev) which is just > the one called from amba_probe() after > "->probe"(i.e. stm_probe in this case) returning a non-zero value. No, this is guesswork. In amba_probe(), clocks are enabled for the drv->probe() and then disabled afterwards and that's where the refcount ends up unbalanced, the probe is the culprit. I can debug your driver for you but you'll at least need to put the code up somewhere so I can see it. Regards, -- Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/