From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 802ACC43603 for ; Thu, 12 Dec 2019 16:09:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 498892073B for ; Thu, 12 Dec 2019 16:09:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729848AbfLLQJu (ORCPT ); Thu, 12 Dec 2019 11:09:50 -0500 Received: from muru.com ([72.249.23.125]:46364 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729731AbfLLQJu (ORCPT ); Thu, 12 Dec 2019 11:09:50 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 9780D80C0; Thu, 12 Dec 2019 16:10:28 +0000 (UTC) Date: Thu, 12 Dec 2019 08:09:46 -0800 From: Tony Lindgren To: Bin Liu , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Merlijn Wajer , Pavel Machek , Sebastian Reichel Subject: Re: [PATCH] usb: musb: fix idling for suspend after disconnect interrupt Message-ID: <20191212160946.GR35479@atomide.com> References: <20191126034151.38154-1-tony@atomide.com> <20191212160059.GI16429@iaqt7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191212160059.GI16429@iaqt7> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi, * Bin Liu [191212 16:02]: > Hi Tony, > > Sorry for my late response. No worries. > On Mon, Nov 25, 2019 at 07:41:51PM -0800, Tony Lindgren wrote: > > When disconnected as USB B-device, we sometimes get a suspend interrupt > > after disconnect interrupt. In that case we have devctl set to 99 with > > VBUS still valid and musb_pm_runtime_check_session() wrongly things we > > have an active session. We have no other interrupts after disconnect > > coming in this case at least with the omap2430 glue. > > I don't have an omap2430 platform to test, but its musb doesn't generate > DISCONNECT interrupt at all when disconnected from USB host in any case? > It is a surprise, the musb core driver expects the DISCONNECT interrupt > after VBUS is lost and relies on it to tear down the gadget driver and > the state machine. I am wondering how its USB is functional without the > DISCONNECT event... We do get DISCONNECT, but we can then get a SUSPEND after DISCONNECT has already happened.. That will wake up musb waiting for further interrupts thinking it's connected. But after that there are no more interrupts as the cable is disconnected so we need to poll the status again. If we see SUSPEND before DISCONNECT, then things idle fine. Regards, Tony