From patchwork Wed Oct 9 21:21:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 11182221 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 D44F217EE for ; Wed, 9 Oct 2019 21:22:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFAC021D80 for ; Wed, 9 Oct 2019 21:22:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731851AbfJIVWA (ORCPT ); Wed, 9 Oct 2019 17:22:00 -0400 Received: from muru.com ([72.249.23.125]:36570 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731072AbfJIVWA (ORCPT ); Wed, 9 Oct 2019 17:22:00 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 6174181CA; Wed, 9 Oct 2019 21:22:33 +0000 (UTC) From: Tony Lindgren To: Bin Liu Cc: Greg Kroah-Hartman , 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 2/7] usb: musb: omap2430: Wait on enable to avoid babble Date: Wed, 9 Oct 2019 14:21:39 -0700 Message-Id: <20191009212145.28495-3-tony@atomide.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191009212145.28495-1-tony@atomide.com> References: <20191009212145.28495-1-tony@atomide.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org We can babble interrupt if we attempt to switch to USB host mode too soon after enabling musb. Let's fix the issue by waiting a bit in runtime_resume. Cc: Jacopo Mondi Cc: Marcel Partap Cc: Merlijn Wajer Cc: Michael Scott Cc: NeKit Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Tony Lindgren --- drivers/usb/musb/omap2430.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -550,6 +550,9 @@ static int omap2430_runtime_resume(struct device *dev) musb_writel(musb->mregs, OTG_INTERFSEL, musb->context.otg_interfsel); + /* Wait for musb to get oriented. Otherwise we can get babble */ + usleep_range(200000, 250000); + return 0; }