Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp223767pxu; Thu, 22 Oct 2020 21:36:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyWgS9zFeqzoI2ZCGQF28VcZ19P5XTbG+NVevDIhLuTK4Mjo7c29AboBVFlbAtpIEIiRjZ X-Received: by 2002:a17:906:39d1:: with SMTP id i17mr233506eje.284.1603427763421; Thu, 22 Oct 2020 21:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603427763; cv=none; d=google.com; s=arc-20160816; b=GtiYnHQ/Tsw8ppDn37lxAmCfzctTTTyGZwx7inbV7t0VqWQIxqLPBgM2A3278UYkH2 OarFQzXa0vRmr8uhGpdhRASby6G4EanYX+y4RD25WtaKBS9eccMRegsM0/kSwW7zolVS GjPlCe7lZm4q8eo6vywcrMVwZYGXcA62CAmdFgX+J5dtver/i6f9Tvmn8LDgkqF4pDSa BSeInesfow8WIhsiL11dw+gsgr8dehRzKpxB3AKnJLCqg/XDeIv0sxSmOXlmuqDygmZH W+6keUrZmDRS2LX0ckZuKzNVy0FHxeasgJ6CqI8PYiHjc3hHPBw3IYB7m8XDdoFdcLq2 qdtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vgurfa7uICYHznbYitBbS6zGK9tKnDPl24+Alzk+UmQ=; b=Iw6recUYcpRy5QhV1lGIydO0egt+uFBd/6meKIcfAtWg5yOJlS37qhoroSAlhXaiq1 PM5Nyta4fWgYMCNdporc+ZlzKTw8S+UCGc2JOI+kQmI1beD5NJirRhoGfVbfykgnmPUA uAQWCvSOBy2vFP4T88ZsLEq2RtvmKCkjN4xGunGDrf3WU2SEdw89f3tgPU4eoeUTgq1w Ie1wZYhWM8UkHi6zaNP6jKExunZdKxFy9xR56X/QKp+nkALRyFOV22G+WJiAF9ZpnsWl OgrUI4rk1RySL1Jw+sVeC7MD3JLWFjgHf7keTRVAh7zgfczaO6Ek5lkpZmiuK6hPoc1G ME2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FM94cPUK; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n12si139632eje.169.2020.10.22.21.35.41; Thu, 22 Oct 2020 21:36:03 -0700 (PDT) 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=@linaro.org header.s=google header.b=FM94cPUK; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S370418AbgJVTqb (ORCPT + 99 others); Thu, 22 Oct 2020 15:46:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2509801AbgJVTqa (ORCPT ); Thu, 22 Oct 2020 15:46:30 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EF9EC0613CE for ; Thu, 22 Oct 2020 12:46:30 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id m128so3028335oig.7 for ; Thu, 22 Oct 2020 12:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vgurfa7uICYHznbYitBbS6zGK9tKnDPl24+Alzk+UmQ=; b=FM94cPUKChGVwwWOMYxWmIJ/1Ul4AgBCkn/JIlx6hX/J7MUeinFbyfcH29zLOsc843 r6Vx+tpf1c2ttbzWGH9WujJtf4Z1OjWSGBby21tKao0FCms/SdOxuDjpweBK74j3USZy gOvefG+9LGgDDYcJwuy4ln8ZW2r3z3W8ge5+95uv1LgYG0RrPuQuDujKnmPN4NuLOsZ5 u067ybT7gerl6qTwJCoyRdAv4RtpbGlMCC6bYp1/gS5OtFcuZdF0orkaLLE2T/9jYAjC cbX1Vt1C7DWCswvCQGA7/6fCwhfbRiG6hvLwJObjTZ1H2C6GmNuIj40p3NP0Nxa9t+34 AIFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vgurfa7uICYHznbYitBbS6zGK9tKnDPl24+Alzk+UmQ=; b=dLXZZVNPow/ZaIghFxWD0o28uMMu95sxZ/VX7/g4Abycv7i7Dd5+JF0PfiybU8KK7u U1IYPnSSamHR2RQu10+AEvAdNyUx1Ws7KN/TzwsFQKjw+8onrVadKw7S6VayCSRJL6kG s6fVf7E4OUrX/RSmghFXE/OwQGxWxizZcW5N+KE9YfTdCcSfxmvbIG4rLn+4mQDn8xmc fd7AInWd2vQJnyR/jcnej8Xhqo2uRUmtoQnmOh8cqbg+SMGyFimgjuu4hW9gcddsCbOf pt8/f8P0XMi1Dyv5ydoe8ZabZus1IYGlbsU8UkcmP8jh8OPqpUEUC27mb7+YRfXjsRoE zWTA== X-Gm-Message-State: AOAM530yZ8nhDoqkeZMACsxhtV1JYBN5u99aU1l4rv6YUOH+t0zp0m/Z wC4uhlc2O0+MAL1zwDkcazE9AL7CPQqW37kKNXPssw== X-Received: by 2002:aca:1a07:: with SMTP id a7mr2439299oia.169.1603395989572; Thu, 22 Oct 2020 12:46:29 -0700 (PDT) MIME-Version: 1.0 References: <20201021224619.20796-1-john.stultz@linaro.org> <87y2jyelv6.fsf@kernel.org> In-Reply-To: <87y2jyelv6.fsf@kernel.org> From: John Stultz Date: Thu, 22 Oct 2020 12:46:18 -0700 Message-ID: Subject: Re: [PATCH v2] usb: dwc3: Trigger a GCTL soft reset when switching modes in DRD To: Felipe Balbi Cc: lkml , Yu Chen , Tejas Joglekar , Yang Fei , YongQin Liu , Andrzej Pietrasiewicz , Thinh Nguyen , Jun Li , Mauro Carvalho Chehab , Greg Kroah-Hartman , Linux USB List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 12:55 AM Felipe Balbi wrote: > John Stultz writes: > > From: Yu Chen > > > > 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. > > This keeps coming back every few years. It has never been necessary so > far. Why is it necessary now? Sorry, I'm not totally sure I've got all the context here. If you mean with regards to the HiKey960, it's because the HiKey960 had a somewhat complicated vendor patch stack that others and I had been carrying along and trying to upstream slowly over the last few years. Since that process of upstreaming required lots of rework, the patch set changed over time fixing a number of issues and in this case (by dropping the quirk) introducing others. The usb functionality on the board was never perfect. As I said in the patch, we saw initialization issues *very* rarely with older kernels - which I suspected was due to the oddball mux/hub driver that had to be deeply reworked - so the issue was easy to overlook, except the frequency of it had grown to be quite noticeable. So now that all but the dts bits are upstream, I've been trying to spend occasional free cycles figuring out what's wrong. That's when I figured out it was the quirk fix I dropped. But the good news is so far with it I've not hit any initialization issues (over a few hundred reboots). > The only thing we need to do is verify > which registers are shadowed between host and peripheral roles and cache > only those registers. Sorry, could you explain this a bit more? Again, I don't have access to the hardware docs, so I'm just working with the source and any vendor patches I can find. > A full soft reset will take a while and is likely to create other > issues. I'm also fine with going back to the quirk approach if you think that would be lower risk to other devices? thanks -john