Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp544013pxb; Fri, 8 Jan 2021 11:21:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuXv/ciM+kOW7S7XukwNnYFFgTUapklm8NjuyYu8td7yK7r33rE/DRKaZHSMw213DdJa47 X-Received: by 2002:a17:906:8617:: with SMTP id o23mr3657240ejx.274.1610133684293; Fri, 08 Jan 2021 11:21:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610133684; cv=none; d=google.com; s=arc-20160816; b=kdEplcwJgKyzzZYrtwAK0CQI43JaqnbFugKeaCQDTyj/QoVgDW6rDRV4b9bYa7puY+ cqkmAZ9HIzioAvkOCnKOgW3wxN7IPlYtO/Jfb5Ptf0BoZOsVVuWZSjBTiRCUXH1tL2tj 5dMeARAK4vUTxGRUCKdZXJsaIXFpCpbwCKvG6ix9yurbaCQ9NrshaVQ0E1VhpNrzDGro 9t8Dlaq72F1h2XlVzx8tfbatYPLf78GOPAkEfpwpnoADjtOl7Y/RXzhWmpuLwW8QsFHz 0iJqge/B1OoQ26mNS8JSVosGx7EbOwRuykpWEwsq/mb8JMB1pKk79Fj1TRDYggJlkL/6 xjsQ== 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=ozbpLtkK1xvRTK+jwsC/Xn8VvSovcm0+oA0TWoxuKes=; b=dgotc6dAuRHmMQcacN3r6oifeWo0sT6mdSFDmzhywRZyBnO3gdI+Gt9OjUKNDd9OwE jfdi3iUtKwkdvTiH8bs1TIUaGHkpxQSnoXiyqys7jGNUcaU/b0DGDuuCTQROw4GYeR08 nGTdf1J6id/cp5B/YQTCxyxap07ro2rb1wEpmXqvqNsGBqfsP+Bpw4BLDO8Kk7ZJ9Esv AoOSDkKzRSe1wsjeaxPAD5gi13Ai3kisJFdRzZ+tGeZpleo18rt8V0QLcVwCAQGj9zug DqEuM2YfOfjMIUJY4vSamZewflNgaNsY3A4aUe+chridYrJluILuIyajd+r+8fSlBPMy hSXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=REri6ss5; 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 o11si3893377ejg.118.2021.01.08.11.20.59; Fri, 08 Jan 2021 11:21:24 -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=@linaro.org header.s=google header.b=REri6ss5; 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 S1728877AbhAHTTZ (ORCPT + 99 others); Fri, 8 Jan 2021 14:19:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbhAHTTZ (ORCPT ); Fri, 8 Jan 2021 14:19:25 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 979F6C061380 for ; Fri, 8 Jan 2021 11:18:44 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id 23so25419958lfg.10 for ; Fri, 08 Jan 2021 11:18:44 -0800 (PST) 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=ozbpLtkK1xvRTK+jwsC/Xn8VvSovcm0+oA0TWoxuKes=; b=REri6ss5W8tvw++tDJHa6Tj2j4DNNmbizybl3TpCOkP38qlwzLJL3iRDH7m/iGR88P KKogFPJnAi3XbSxBoOCLhMhQtWw2FK8m1e/Opk5TYu1FtVmOAlVcihIgg0EBhL0EdZGc CbwCuj8pEebcxR8ZblMQORCBY38zzkSYAB7gk4WXEIoVwoMBjKLijfznN2jiU5upNMZb mphSVuEwfY0CQI1aG0II4jxKl3pd+VdlF705kzvT3hj50Zgu0uc2PyqDJLpEHdfGTu3J gDXLVc1budnOYeU9tZLX9zd3zIpC1ToycjGkxxgsCeJ9jVf5DhhwfSaZKi1DqgLzbWFq Q8QA== 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=ozbpLtkK1xvRTK+jwsC/Xn8VvSovcm0+oA0TWoxuKes=; b=fuvOXhFYHGpuP0LcUVBE6p0kMbjOp2Xb3iPc8oWkkbiik0OSg+Xg37V3jITaCMHTVG b4IPqbJSu7aluaHyG7cYTycaM2RwVChzkTM/wJ5Lzw4g+CeHw2ZSx66dZ1oJ2X2EV1nr v58ELmeOUT7FgPk7I4vsXYR+z4o++Zfh9SUWagC8ufxByIU9s6rwBymR2/yuv8swYPTs V2XulAp1NA/mnSi1qTB1RA7Pv24gpNCrC6rlToomtum0bkcO59aSfLg6FLWFCOIsMANE EY+1lGazUShVF78BioCUpAOYkdWZ8OOQgOTFhs8lr0kXyYnVZAbqbcwyG4BSgauqd7ir eGrA== X-Gm-Message-State: AOAM533Mr0y82JoszTScCzqrM7HpmWv0T14Iz3intNs65Xb5+Uhc4TyI qgSLVnzocRzynh5rvGLDWMULSbLWX2IWwd5GKnIy4Q== X-Received: by 2002:a2e:b001:: with SMTP id y1mr2310498ljk.257.1610133523015; Fri, 08 Jan 2021 11:18:43 -0800 (PST) MIME-Version: 1.0 References: <20210108015115.27920-1-john.stultz@linaro.org> <87bldzwr6x.fsf@kernel.org> In-Reply-To: <87bldzwr6x.fsf@kernel.org> From: John Stultz Date: Fri, 8 Jan 2021 11:18:32 -0800 Message-ID: Subject: Re: [PATCH v3 1/2] 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 , Heikki Krogerus , Roger Quadros Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 8, 2021 at 4:26 AM Felipe Balbi wrote: > > > 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. I'm happy to reach out to folks to try to get that. Though I'm wondering if it would be better to put it behind a dts quirk flag, as originally proposed? https://lore.kernel.org/lkml/20201021181803.79650-1-john.stultz@linaro.org/ That way folks can enable it for devices as they need? Again, I'm not trying to force this in as-is, just mostly sending it out again for discussion to understand what other approach might work. thanks -john