From patchwork Tue Jan 14 10:02:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233907 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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 8732DC33CB3 for ; Tue, 14 Jan 2020 10:16:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 549C4207FF for ; Tue, 14 Jan 2020 10:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578997011; bh=XQLkSruPo+o5PUSErv4u/zaJfbC1EOrkYq7lBk8SaLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=2o/Ga/t+BDlzFLtDuYCKTb3de7i+raR7H87pYJBenTDG81//+4HqsYGMtOMVLDRjW rdle2gOCQ9EA4Deq5Zbs/UmmOOsog6jn54dGK1eFzknYktU2ticgpISHOHGE85yPKH E2nOVcAT1uFCHcCe3QNsxp9kRsTtd6DvGaYhy2+Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729613AbgANKIg (ORCPT ); Tue, 14 Jan 2020 05:08:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:40144 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729094AbgANKIe (ORCPT ); Tue, 14 Jan 2020 05:08:34 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 89247207FF; Tue, 14 Jan 2020 10:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578996514; bh=XQLkSruPo+o5PUSErv4u/zaJfbC1EOrkYq7lBk8SaLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Opt09eAgz/DaGEyCv+VwY/HmC9Wvz91gDVRHBiFX2aBypdO/7beOf9QDmVaRt+Sz4 8Y+VseF1RI2F2W+TYoqKd6/J7haTb0L6RIC2ScyVlwQS45RPlsaOTUZSkJslCWvqkF MhByH/yfkcTsYnuHNRmBzWYHHjUMJyrKEocuLDrw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jacopo Mondi , Marcel Partap , Merlijn Wajer , Michael Scott , NeKit , Pavel Machek , Sebastian Reichel , Tony Lindgren , Kishon Vijay Abraham I Subject: [PATCH 4.19 43/46] phy: cpcap-usb: Fix flakey host idling and enumerating of devices Date: Tue, 14 Jan 2020 11:02:00 +0100 Message-Id: <20200114094348.528047360@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114094339.608068818@linuxfoundation.org> References: <20200114094339.608068818@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tony Lindgren commit 049226b9fd7442149dcbcf55f15408f5973cceda upstream. 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. Cc: Jacopo Mondi Cc: Marcel Partap Cc: Merlijn Wajer Cc: Michael Scott Cc: NeKit Cc: Pavel Machek Cc: Sebastian Reichel Acked-by: Pavel Machek Fixes: 6d6ce40f63af ("phy: cpcap-usb: Add CPCAP PMIC USB support") Signed-off-by: Tony Lindgren Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Greg Kroah-Hartman --- drivers/phy/motorola/phy-cpcap-usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/phy/motorola/phy-cpcap-usb.c +++ b/drivers/phy/motorola/phy-cpcap-usb.c @@ -281,13 +281,13 @@ static void cpcap_usb_detect(struct work return; } + cpcap_usb_try_musb_mailbox(ddata, MUSB_VBUS_OFF); + /* Default to debug UART mode */ error = cpcap_usb_set_uart_mode(ddata); if (error) goto out_err; - cpcap_usb_try_musb_mailbox(ddata, MUSB_VBUS_OFF); - dev_dbg(ddata->dev, "set UART mode\n"); return;