From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754009Ab1ASPbO (ORCPT ); Wed, 19 Jan 2011 10:31:14 -0500 Received: from na3sys009aog103.obsmtp.com ([74.125.149.71]:36184 "EHLO na3sys009aog103.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049Ab1ASPbM (ORCPT ); Wed, 19 Jan 2011 10:31:12 -0500 Date: Wed, 19 Jan 2011 17:30:57 +0200 From: Felipe Balbi To: Ming Lei Cc: Yang Ruirui , Greg Kroah-Hartman , Mian Yousaf Kaukab , Linus Walleij , Felipe Balbi , Heikki Krogerus , Tejun Heo , Samuel Ortiz , Hema HK , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb otg: use atomic notifier instead of blocking notifier Message-ID: <20110119153057.GB3552@legolas.emea.dhcp.ti.com> Reply-To: balbi@ti.com References: <20110119092011.GA23624@darkstar> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Jan 19, 2011 at 11:18:49PM +0800, Ming Lei wrote: > 2011/1/19 Yang Ruirui : > > [   28.990997] [] (unwind_backtrace+0x0/0xec) from [] (print_usage_bug+0x170/0x1b4) > > [   29.007293] [] (print_usage_bug+0x170/0x1b4) from [] (mark_lock+0x358/0x628) > > [   29.019836] [] (mark_lock+0x358/0x628) from [] (__lock_acquire+0x554/0x1730) > > [   29.032409] [] (__lock_acquire+0x554/0x1730) from [] (lock_acquire+0x60/0x74) > > [   29.045166] [] (lock_acquire+0x60/0x74) from [] (down_read+0x48/0x5c) > > [   29.057250] [] (down_read+0x48/0x5c) from [] (__blocking_notifier_call_chain+0x2c/0x5c) > > [   29.074920] [] (__blocking_notifier_call_chain+0x2c/0x5c) from [] (blocking_notifier_call_chain+0x14/0x18) > > [   29.094573] [] (blocking_notifier_call_chain+0x14/0x18) from [] (musb_gadget_vbus_draw+0x38/0x60) > > I am a little confused, why is blocking_notifier_call_chain called from > musb_gadget_vbus_draw? See source code of musb_gadget_vbus_draw: > > 1587 static int musb_gadget_vbus_draw(struct usb_gadget *gadget, unsigned mA) > 1588 { > 1589 struct musb *musb = gadget_to_musb(gadget); > 1590 > 1591 if (!musb->xceiv->set_power) > 1592 return -EOPNOTSUPP; > 1593 return otg_set_power(musb->xceiv, mA); > 1594 } that's easy to guess since commit log says it's a problem on Meego kernel. > Are you sure the issue can be reproduced in 2.6.37 or -next tree? > > In mainline code(2.6.37), blocking_notifier_call_chain is only called in > threaded irq handler of otg driver wrt. musb driver, so seems enough. true, but seems like Nokia is using to notify gadget states, which makes a lot of sense when you start thinking about things such as battery charging. -- balbi