Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp263545pxb; Fri, 8 Jan 2021 04:30:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhhNmIeRBdmrf0tRKOn5O2VCZh/9DUMagqwU6snIun6t58OMr2V0kPDmU9hCj/bXzGkV4t X-Received: by 2002:a17:906:3781:: with SMTP id n1mr2487304ejc.296.1610109017268; Fri, 08 Jan 2021 04:30:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610109017; cv=none; d=google.com; s=arc-20160816; b=anIQ0Rzi6Nd7W/hkRvBtbS63xnJy4KhCOoiObHeodyL2Lo6xq/IeLmjoGqrK3FzUxQ FRlnYX1kJkWWK7XF8u0GQg1Buy/mSXha3UOpTmmVRMx2TqYzSPlXSiUK0QiXOEH3SJU4 JcNR0Xzbt1y4erGL18dzVH8SEaMzXOkVvW9SyPgB6JziNOI8XMqC8eIEKax16R9CbUdG M6HHOW/24GRpKuUkyadYufalwXXh58OCxDblHeEhPC76kSfVDfhLsrImd1mghpNyaR8f Jvtr74TuQNGvPTOgj5rSo29aay8c8RLhRWHntvPLqiqZ04Akn8nKm8rTeOw1mQdhjyWk Gh9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=U8qevrKUjwED2aj24SjBUPxPtE2RyWkl/Zdsw8bhUtQ=; b=KQMZU365Wkh2yN4KMUdXFdrBQRCmCfxd54RvRBadGdPUTFR2U+N3CTfob1xzz3sEMq 0lTxNwwn+onCPZhpf2VsRkrbRVrAh2PhrKukrWEqU6rZ9IWDqxAvsaNsz6v+FAZ5Xn05 fjEjEwBXPCOSLdWtyV94leKyAE7YIYMUJiRWCVDCwKqjFVC9ldG5xyZY7wxvAoU+DCmd ICZ2dNo+DXqMYfVTQ4kSWC7fwe1hNePK0cv2fCnyuUmyDq/ciGLAsJD0XEUE0fQWK8fU HVshJsC6iMgLmFX7ktNWacr5ndD+jGAAFHWS2EIHSJkpLUm3gof3mlm5TPXbp9jTgQjg v7WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qyx1l48i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si3569593edk.240.2021.01.08.04.29.53; Fri, 08 Jan 2021 04:30:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qyx1l48i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727016AbhAHM0p (ORCPT + 99 others); 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