Received: by 10.223.185.116 with SMTP id b49csp8805594wrg; Fri, 2 Mar 2018 08:14:27 -0800 (PST) X-Google-Smtp-Source: AG47ELtrzFG+swfWi8z1zsqtsHZRqZkFiNGX7DGxwrK7AUxjq8R224z9EeBXO2stTA7CbaimuFuj X-Received: by 10.99.120.5 with SMTP id t5mr4894512pgc.156.1520007267422; Fri, 02 Mar 2018 08:14:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520007267; cv=none; d=google.com; s=arc-20160816; b=L627ReeT+jas3gfL7scc6ixnMlUt4XMyLKW6DjmKo2LyFnOuSUw61QBqU7awUPt0iw lF7PBAU3QeWclELJBU7I2VSCoa6FfEnlrE+BurRyIYfFLnDFi4FkX67Crpk2KrIY92iH TtUcTV5KjejVrPi97XbBG/095IToGxsn4ZDI9WHz+Lbc9xVCtM0L1RTuUtN/s5MQroVs g6jOJBH6n3/f0an6l1RyL65ls5mtHhgMCTFx4gEd5qHZ8Abv75DzDnE5Ak/MIuHu2KIk wnppAhYXVJ4Y0FQJmBaMHnzcy1XdQG2R+BR5LtA0rEdwkHr2/zl/Fj1b3idwQyYg9S5F tR8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=sk0bt7ZUTcBzu6Vi3CkULc8ap11D3qRvKIIEt3VZ00Q=; b=ghStulDwSAjteizzzQjvmCuEaT5XccJzWxXS9Z16ObdWI4zT+pvdmIcN563Uukp6IG 5HvpDHPkC3dCDQWQl8SdC2YzIAWFskDMSi0pRaQeskK5SSMRWI6bW/LHC8qjbD/nvvqD YK8Dpyuo+Y6vGdWybWYFhvacxsESfZWSdXh7DRlfROInSfpZeC6EoSxNX7cbUonWBdhK 0FgmdqmcRX0Sw5f4s3z0ApLeXfMI495J9g/LCfCDKZjk6QV8JeKde4qYBg9dVOAdjEny qVJ5HTWgsDZgOwaz4S5MHUguer2Y+PQiR7w4D5tOdD2BTuCM1Y2Qs8ULaNGvXbyRFMCw 9Wfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=i1eGBB4W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg3-v6si4900537plb.28.2018.03.02.08.14.13; Fri, 02 Mar 2018 08:14:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=i1eGBB4W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427739AbeCBP1W (ORCPT + 99 others); Fri, 2 Mar 2018 10:27:22 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:10087 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1427701AbeCBP1P (ORCPT ); Fri, 2 Mar 2018 10:27:15 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w22FRCh7005170; Fri, 2 Mar 2018 09:27:12 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520004433; bh=ZlRmvVMpfdo1zjgZvtFgcuCxPLqTwSdP0j8z9Aufy+M=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=i1eGBB4WBswms3avjxfzNaroi+8CeMPIJhPyZo6AdTgRs96rDoIdoX7aAAoLJKOeT vXu4S+km352g8TQ79SG+MuQyUBwgk1hj8E/m1jHS9X6PFN3b8uV/fmXjCltF5VwWlH Q2wbGqpH1Gn/YmsEgs5FUDk/9sodQxn/FSrQeYNI= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w22FRClX027582; Fri, 2 Mar 2018 09:27:12 -0600 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Fri, 2 Mar 2018 09:27:12 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Fri, 2 Mar 2018 09:27:12 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w22FRCxN012590; Fri, 2 Mar 2018 09:27:12 -0600 Date: Fri, 2 Mar 2018 09:27:12 -0600 From: Bin Liu To: Merlijn Wajer CC: Greg Kroah-Hartman , , , Pali =?iso-8859-1?Q?Roh=E1r?= , Ivaylo Dimitrov , Subject: Re: usb: musb: "(null)" in sysfs mode file after disabling a gadget (and at other times, system hangs) Message-ID: <20180302152712.GA22262@uda0271908> Mail-Followup-To: Bin Liu , Merlijn Wajer , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Pali =?iso-8859-1?Q?Roh=E1r?= , Ivaylo Dimitrov , linux-omap@vger.kernel.org References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Mar 02, 2018 at 12:47:07AM +0100, Merlijn Wajer wrote: > Hi, > > I found that the "mode" file in musb sys node will return "(null)" when > one would expect it show b_idle. > > Wrong /mode file: > > [Fresh boot, cable not connected yet] > root@n900devuan:~# modprobe g_nokia > [Insert cable connected to PC] > root@n900devuan:~# cat > /sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode > b_peripheral > [Remove cable connected to PC] > root@n900devuan:~# cat > /sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode > b_idle > root@n900devuan:~# rmmod g_nokia > root@n900devuan:~# cat > /sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode > (null) I can reproduce this on AM335x EVM, > [Insert cable connected to PC] > root@n900devuan:~# cat > /sys/devices/platform/68000000.ocp/480ab000.usb_otg_hs/musb-hdrc.0.auto/mode > b_idle but not this, I still get (null). g_nokia is not loaded here, right? > > I would expect it to state "b_idle" instead of "(null)". Actually, I'd like to see (null) whenever a gadget driver is not loaded, which indicates a gadget is not bound to the udc. Regards, -Bin.