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=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 9FC08C433E0 for ; Fri, 8 Jan 2021 12:26:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 56107239FC for ; Fri, 8 Jan 2021 12:26:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727448AbhAHM0p (ORCPT ); Fri, 8 Jan 2021 07:26:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:54930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbhAHM0p (ORCPT ); Fri, 8 Jan 2021 07:26:45 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B6883238E8; Fri, 8 Jan 2021 12:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610108764; bh=3Sa0Em/ZGPisFrTI0JuPpmbH+3oTgWsFlEcpdO59oS8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Qyx1l48in8phi8u4p3epf4fMVj9EEB5cY1iQCjRDu5dQ8LxYlbALOHVMMX8KCBeIU qo+nog0IEIN7Vm6a4PABDK9qHTxV+ows8rK6AzqiMYqgsxap4K6dmdtT9N2NGi5ZqH wRmUBVHzvoT4abdlq4hwsjTDLMqNtio8WgA77sq0FQ9QH8vraKvUOeHWTuw+zrNbJI rDb7NBgqPlhCGWTFPRZRVM3FQZkv4DXr8nFrQYi0RcEZ8CwnF2vxaJ/McFD6hgadnp +lHNY00eypdJqXRAI/XiV/U9TN7R8l15Qwtpl2oRdM3/KsW+a2PrXatyde2hgvyNvy CwoCeWRB3Dj1Q== From: Felipe Balbi To: John Stultz , lkml Cc: Yu Chen , Tejas Joglekar , Yang Fei , YongQin Liu , Andrzej Pietrasiewicz , Thinh Nguyen , Jun Li , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-usb@vger.kernel.org, John Stultz , Heikki Krogerus , Roger Quadros Subject: Re: [PATCH v3 1/2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD In-Reply-To: <20210108015115.27920-1-john.stultz@linaro.org> References: <20210108015115.27920-1-john.stultz@linaro.org> Date: Fri, 08 Jan 2021 14:25:58 +0200 Message-ID: <87bldzwr6x.fsf@kernel.org> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, John Stultz writes: > From: Yu Chen > > Just resending this, as discussion died out a bit and I'm not > sure how to make further progress. See here for debug data that > was requested last time around: > https://lore.kernel.org/lkml/CALAqxLXdnaUfJKx0aN9xWwtfWVjMWigPpy2aqsNj56yvnbU80g@mail.gmail.com/ > > With the current dwc3 code on the HiKey960 we often see the > COREIDLE flag get stuck off in __dwc3_gadget_start(), which > seems to prevent the reset irq and causes the USB gadget to > fail to initialize. > > We had seen occasional initialization failures with older > kernels but with recent 5.x era kernels it seemed to be becoming > much more common, so I dug back through some older trees and > realized I dropped this quirk from Yu Chen during upstreaming > as I couldn't provide a proper rational for it and it didn't > seem to be necessary. I now realize I was wrong. > > After resubmitting the quirk, Thinh Nguyen pointed out that it > shouldn't be a quirk at all and it is actually mentioned in the > programming guide that it should be done when switching modes > in DRD. > > So, to avoid these !COREIDLE lockups seen on HiKey960, this > patch issues GCTL soft reset when switching modes if the > controller is in DRD mode. > > Cc: Felipe Balbi > Cc: Tejas Joglekar > Cc: Yang Fei > Cc: YongQin Liu > Cc: Andrzej Pietrasiewicz > Cc: Thinh Nguyen > Cc: Jun Li > Cc: Mauro Carvalho Chehab > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > Signed-off-by: Yu Chen > Signed-off-by: John Stultz > --- > v2: > * Rework to always call the GCTL soft reset in DRD mode, > rather then using a quirk as suggested by Thinh Nguyen > > v3: > * Move GCTL soft reset under the spinlock as suggested by > Thinh Nguyen Because this is such an invasive change, I would prefer that we get Tested-By tags from a good fraction of the users before applying these two changes. -- balbi