From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932738AbbCDQLh (ORCPT ); Wed, 4 Mar 2015 11:11:37 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:59656 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932325AbbCDQLg (ORCPT ); Wed, 4 Mar 2015 11:11:36 -0500 From: Laurent Pinchart To: Sudeep Holla Cc: Felipe Balbi , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , Greg Kroah-Hartman Subject: Re: [PATCH v2] usb: isp1760: add peripheral/device controller chip id Date: Wed, 04 Mar 2015 18:11:37 +0200 Message-ID: <38531734.64FvIzp7Ky@avalon> User-Agent: KMail/4.14.3 (Linux/3.18.7-gentoo; KDE/4.14.3; x86_64; ; ) In-Reply-To: <54F72B1C.2080700@arm.com> References: <1424800422-25332-1-git-send-email-sudeep.holla@arm.com> <9376982.frUB33IUZX@avalon> <54F72B1C.2080700@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sudeep, On Wednesday 04 March 2015 15:56:12 Sudeep Holla wrote: > On 26/02/15 18:53, Laurent Pinchart wrote: > > Hi Sudeep, > > > > Thank you for the patch. > > > > On Thursday 26 February 2015 11:47:57 Sudeep Holla wrote: > >> As per the SAF1761 data sheet[0], the DcChipID register represents > >> the hardware version number (0001h) and the chip ID (1582h) for the > >> Peripheral Controller. > >> > >> However as per the ISP1761 data sheet[1], the DcChipID register > >> represents the hardware version number (0015h) and the chip ID (8210h) > >> for the Peripheral Controller. > >> > >> This patch adds support for both the chip ID values. > >> > >> [0] http://www.nxp.com/documents/data_sheet/SAF1761.pdf > >> [1] http://pdf.datasheetcatalog.com/datasheets2/74/742102_1.pdf > >> > >> Cc: Felipe Balbi > >> Cc: Laurent Pinchart > >> Signed-off-by: Sudeep Holla > > > > Acked-by: Laurent Pinchart > > Thanks. I assume Felipe will pick this up. > > Now about the testing in Gadget mode on Vexpress platform. > I have set > CONFIG_USB_OTG=y > CONFIG_USB_MON=y > CONFIG_USB_STORAGE=y > CONFIG_USB_ISP1760=y > CONFIG_USB_ISP1760_DUAL_ROLE=y > CONFIG_USB_GADGET=y > CONFIG_USB_MASS_STORAGE=m > > When I execute: > $ modprobe g_mass_storage file=/home/linaro/backing_file > > I get the following inconsistent lock state dump > > --->8 > Number of LUNs=8 > Mass Storage Function, version: 2009/09/11 > LUN: removable file: (no medium) > Number of LUNs=1 > LUN: file: /home/linaro/backing_file > Number of LUNs=1 > g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11 > g_mass_storage gadget: userspace failed to provide iSerialNumber > g_mass_storage gadget: g_mass_storage ready > > ================================= > [ INFO: inconsistent lock state ] > 4.0.0-rc2-00004-gf7bb2ef60173 #51 Not tainted > --------------------------------- > inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. > in:imklog/2118 [HC1[1]:SC0[0]:HE0:SE1] takes: > (&(&udc->lock)->rlock){?.+...}, at: [] > isp1760_udc_irq+0x367/0x9dc > {HARDIRQ-ON-W} state was registered at: > [] _raw_spin_lock+0x23/0x30 > [] isp1760_udc_start+0x23/0xf8 > [] udc_bind_to_driver+0x71/0xb0 > [] usb_gadget_probe_driver+0x53/0x9c > [] usb_composite_probe+0x8a/0xa4 [libcomposite] > [] 0xbf8311a7 > [] do_one_initcall+0x8d/0x17c > [] do_init_module+0x49/0x148 > [] load_module+0xb7f/0xbc4 > [] SyS_finit_module+0x51/0x74 > [] ret_fast_syscall+0x1/0x68 > irq event stamp: 4966 > hardirqs last enabled at (4965): [] > _raw_spin_unlock_irq+0x1f/0x24 > hardirqs last disabled at (4966): [] __irq_svc+0x33/0x64 > softirqs last enabled at (4458): [] __do_softirq+0x23d/0x2d0 > softirqs last disabled at (4389): [] irq_exit+0xef/0x15c > > other info that might help us debug this: > Possible unsafe locking scenario: > > CPU0 > ---- > lock(&(&udc->lock)->rlock); > > lock(&(&udc->lock)->rlock); > > *** DEADLOCK *** > > 1 lock held by in:imklog/2118: > #0: (&f->f_pos_lock){+.+.+.}, at: [] __fdget_pos+0x31/0x34 > > stack backtrace: > CPU: 0 PID: 2118 Comm: in:imklog Not tainted > 4.0.0-rc2-00004-gf7bb2ef60173 #51 > Hardware name: ARM-Versatile Express > [] (unwind_backtrace) from [] (show_stack+0x11/0x14) > [] (show_stack) from [] (dump_stack+0x6d/0x78) > [] (dump_stack) from [] (print_usage_bug+0x1d9/0x260) > [] (print_usage_bug) from [] (mark_lock+0x173/0x5d0) > [] (mark_lock) from [] (__lock_acquire+0xab7/0x19a4) > [] (__lock_acquire) from [] (lock_acquire+0x79/0xe8) > [] (lock_acquire) from [] (_raw_spin_lock+0x23/0x30) > [] (_raw_spin_lock) from [] > (isp1760_udc_irq+0x367/0x9dc) > [] (isp1760_udc_irq) from [] > (handle_irq_event_percpu+0x45/0x154) > [] (handle_irq_event_percpu) from [] > (handle_irq_event+0x2f/0x44) > [] (handle_irq_event) from [] > (handle_fasteoi_irq+0x6f/0xf0) > [] (handle_fasteoi_irq) from [] > (generic_handle_irq+0x23/0x2c) > [] (generic_handle_irq) from [] > (__handle_domain_irq+0x45/0x84) > [] (__handle_domain_irq) from [] > (gic_handle_irq+0x27/0x50) > [] (gic_handle_irq) from [] (__irq_svc+0x3f/0x64) > Exception stack(0xecc27e08 to 0xecc27e50) > 7e00: 00000001 ecd6cdd8 00000000 ecd6c7c0 ee78ff00 > c003b44a > 7e20: c103a78c ecc27e68 c080d8b8 00000001 00000000 ecd6c7c0 c0992738 > ecc27e50 > 7e40: c0055161 c05137e0 400c0033 ffffffff > [] (__irq_svc) from [] (_raw_spin_unlock_irq+0x20/0x24) > [] (_raw_spin_unlock_irq) from [] > (finish_task_switch+0x99/0x16c) > [] (finish_task_switch) from [] (__schedule+0x2fd/0x6f0) > [] (__schedule) from [] (schedule+0x2f/0x64) > [] (schedule) from [] (do_syslog+0x40d/0x470) > [] (do_syslog) from [] (proc_reg_read+0x49/0x6c) > [] (proc_reg_read) from [] (vfs_read+0x55/0xb8) > [] (vfs_read) from [] (SyS_read+0x35/0x74) > [] (SyS_read) from [] (ret_fast_syscall+0x1/0x68) > > --- > > Also I don't see any message on the host side. Let me know if there's > something wrong in my config or test commands. Looks like a driver bug to me, .udc_start() and .udc_stop() should use spin_(un)lock_irq(). Would you like to submit a patch ? I can also do it. -- Regards, Laurent Pinchart