Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4351648pxf; Tue, 23 Mar 2021 08:36:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq9avCdt4z0LoEjUz0ScT1qYBxjx54+DIB9sV82jgEDBfHDxkOl5UqRYfq3ICqs7E2Du38 X-Received: by 2002:a05:6402:3596:: with SMTP id y22mr5198116edc.207.1616513794368; Tue, 23 Mar 2021 08:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616513794; cv=none; d=google.com; s=arc-20160816; b=uY82xGuD0t7Io/B3RQDwIJyJQhMxV3X9AMCOgKGCFsHxQf+1JeZUKmNBNX2EkTM85U DwgOG949I7/GY5Cqhr7fu1zXwsop00+3ezqK0Rscf9/m388hdd1CMkwGj6pfLBP5hwC+ ylHlswvbKBGqG/VYH2XmCMO32nOVedWezyxCDDoVJqIngvOCu/I0I2sFm457CGSOIzNY WVw800PIU86Zy787vDoFaZ35Oowf0OnCgY+VTiKG1j3yIYs37y6DstdDfwcnJhf63Kft 1swU8nfe/zkxgi2HiV2gQpXPH7W3iNemGaNg7PeOXwWcYXv+AXIaPm8x+vY3XJAYgvMy oYtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=T9Ju7ks48Q/c9cyKwiJM915/1oNDVigADUqpAI8UmbY=; b=oCml7K4RmdRjoUsZ647j28xWYWrDax/+JN9WZnpuJErq8oFNAUELwyw8KbqBVR8TAP UUV50v5dehiheUJ7AQeb0c/RVr3Oj8QWEd0M810N+mjRisHvZ4N9S2gdZ4PoQXCzVP9c 0fyup0zmznJE6JSSr/17ywvnUG5JOBHIRGV33OZ5DKa6NQiotEJwYv3r6FTRP9yckV2R tQ8Dw7zI+/vwakaqvXYSre5XcjHRBrJHYtn96XtxIyDkp1EuN2MLQTiMm7reU3UKV7BI ESApMtODO8VTZdXl3mT4q2zAPQSfFjmC+isXM0d3vmHOcdY++bfBnLo6+VFsCuO3rkTY Spkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AlLjj+UT; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z18si13590537ejx.409.2021.03.23.08.36.05; Tue, 23 Mar 2021 08:36:34 -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=@linuxfoundation.org header.s=korg header.b=AlLjj+UT; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232846AbhCWPbj (ORCPT + 99 others); Tue, 23 Mar 2021 11:31:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:48580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232806AbhCWPbc (ORCPT ); Tue, 23 Mar 2021 11:31:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB060619B2; Tue, 23 Mar 2021 15:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616513492; bh=bJy+1pPqZ9b2Coh/IbNlRkCGydYdoUBWt094ZsN9XxQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AlLjj+UTm8ohjArHF3/kLE6NH9IKV1+f0uhOgM+uE+6EEfjFhMkoRpuylFIncP92V vst7a9mUItBFvLggdjPLnwVDp061sfGmigo8KOUqA3SI/Oouxw73pAA/214cCUIXU7 cACTgBTQ9nNiPQpRNJiKZQD/v6KcjQ4ggri/K8n4= Date: Tue, 23 Mar 2021 16:31:29 +0100 From: Greg KH To: =?utf-8?B?5ZGo55Cw5p2wIChaaG91IFlhbmppZSk=?= Cc: hminas@synopsys.com, paul@crapouillou.net, linux-mips@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, dongsheng.qiu@ingenic.com, aric.pzqi@ingenic.com, sernia.zhou@foxmail.com, Dragan =?utf-8?B?xIxlxI1hdmFj?= Subject: Re: [PATCH] USB: DWC2: Add VBUS overcurrent detection control. Message-ID: References: <1616513066-62025-1-git-send-email-zhouyanjie@wanyeetech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1616513066-62025-1-git-send-email-zhouyanjie@wanyeetech.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 11:24:26PM +0800, 周琰杰 (Zhou Yanjie) wrote: > Introduce configurable option for enabling GOTGCTL register > bits VbvalidOvEn and VbvalidOvVal. Once selected it disables > VBUS overcurrent detection. > > This patch is derived from Dragan Čečavac (in the kernel 3.18 > tree of CI20). It is very useful for the MIPS Creator CI20(r1). > Without this patch, CI20's OTG port has a great probability to > face overcurrent warning, which breaks the OTG functionality. > > Signed-off-by: 周琰杰 (Zhou Yanjie) > Signed-off-by: Dragan Čečavac > --- > drivers/usb/dwc2/Kconfig | 6 ++++++ > drivers/usb/dwc2/core.c | 9 +++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/drivers/usb/dwc2/Kconfig b/drivers/usb/dwc2/Kconfig > index c131719..e40d187 100644 > --- a/drivers/usb/dwc2/Kconfig > +++ b/drivers/usb/dwc2/Kconfig > @@ -94,4 +94,10 @@ config USB_DWC2_DEBUG_PERIODIC > non-periodic transfers, but of course the debug logs will be > incomplete. Note that this also disables some debug messages > for which the transfer type cannot be deduced. > + > +config USB_DWC2_DISABLE_VOD > + bool "Disable VBUS overcurrent detection" > + help > + Say Y here to switch off VBUS overcurrent detection. It enables USB > + functionality blocked by overcurrent detection. Why would this be a configuration option? Shouldn't this be dynamic and just work properly automatically? You should not have to do this on a build-time basis, it should be able to be detected and handled properly at run-time for all devices. If you know this is needed for a specific type of device, detect it and make the change then, otherwise this could break working systems, right? thanks, greg k-h