From patchwork Fri Aug 30 21:44:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 11124567 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0007416B1 for ; Fri, 30 Aug 2019 21:44:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DDF902343D for ; Fri, 30 Aug 2019 21:44:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728293AbfH3VoN (ORCPT ); Fri, 30 Aug 2019 17:44:13 -0400 Received: from muru.com ([72.249.23.125]:59184 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728079AbfH3VoN (ORCPT ); Fri, 30 Aug 2019 17:44:13 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 174E480D4; Fri, 30 Aug 2019 21:44:41 +0000 (UTC) From: Tony Lindgren To: Kishon Vijay Abraham I Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Jacopo Mondi , Marcel Partap , Merlijn Wajer , Michael Scott , NeKit , Pavel Machek , Sebastian Reichel Subject: [PATCH] phy: cpcap-usb: Fix flakey host idling and enumerating of devices Date: Fri, 30 Aug 2019 14:44:09 -0700 Message-Id: <20190830214409.49232-1-tony@atomide.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org We must let the USB host idle things properly before we switch to debug UART mode. Otherwise the USB host may never idle after disconnecting devices, and that causes the next enumeration to be flakey. This happens as the USB PHY mode gets disabled too early. Cc: Jacopo Mondi Cc: Marcel Partap Cc: Merlijn Wajer Cc: Michael Scott Cc: NeKit Cc: Pavel Machek Cc: Sebastian Reichel Fixes: 6d6ce40f63af ("phy: cpcap-usb: Add CPCAP PMIC USB support") Signed-off-by: Tony Lindgren --- drivers/phy/motorola/phy-cpcap-usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c --- a/drivers/phy/motorola/phy-cpcap-usb.c +++ b/drivers/phy/motorola/phy-cpcap-usb.c @@ -274,12 +274,12 @@ static void cpcap_usb_detect(struct work_struct *work) return; } - /* Default to debug UART mode */ - error = cpcap_usb_set_uart_mode(ddata); + error = musb_mailbox(MUSB_VBUS_OFF); if (error) goto out_err; - error = musb_mailbox(MUSB_VBUS_OFF); + /* Default to debug UART mode */ + error = cpcap_usb_set_uart_mode(ddata); if (error) goto out_err;