Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3023323rwb; Mon, 15 Aug 2022 16:20:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR4EUQQ1m3Iat9wzSpkZAxZcozcfyrI0P/Jc3PBEH/aGqq3a4y3aAS87zdGvh2O9c9PlPcho X-Received: by 2002:a17:906:5d0f:b0:732:fb97:780d with SMTP id g15-20020a1709065d0f00b00732fb97780dmr12001981ejt.269.1660605654497; Mon, 15 Aug 2022 16:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605654; cv=none; d=google.com; s=arc-20160816; b=VT32qtUk9OkquFi4bbtyoqz8soWSI9sbOjA6FBQyYTBJ63bCIA8koG1r93Es9yF5jZ ZBUeS5ZePu3Cel9JO2MNAkxSsWnW75ALkkSvE9SL9WSranRSwJIQmp1+xDfBclwktul7 hNIGnjv699Wx6QX7o2PSVNC8fs/bmgg8y9gRdk4J+eBgcRcKP8jfHpKuun5wbYX6X4Pm gNR6jCbBWCzIhUORN8oQYfaMbtT/p0bASofTEzvu0ThYxHciSmgJ9RfeCjBwrfKvKSxJ Y3TcNdLH8jBnppmwawT1VwCdHWz7u8d7tMUwqUTijfNmedgJgHtL64JawziyhtPoVJjF wJZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7QivAkWN1xLSNL0+QO5gIbUVHrXkaKGbgn85G6h/McQ=; b=idmwvckdlKsi4T2td7Z3jSftviVxQc2njpGOVbPCl7mlCLLpQ68yIum6rVKyGfyAVi lJp+escvXoTiqSR353Gp3Z9TPggs//q/tSXyHoEs5Du87kuImw9mRoBVeGAig+oCMWaO s2/HXPcXe7o5Cwry4mqnFr80fGlBNaZssDDBmUSIViOogN1jpj3JMZYC7Da0Yiyv6WW2 UIV/2kzfq/Eer/Q9vgSzbEg+9FpSrRKLe0RoVrkK3HM2yc7j4AA7qIvWQdUSFvylzUh2 2FZ70XVFR7imSN1y3r2HwdHisEMkU6a2I4+nCMCfaIx87H6UlpPTDuYTUcWHEc91fGTY MmvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jeof42bT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk19-20020a170906b0d300b00730951e6030si7872425ejb.188.2022.08.15.16.20.28; Mon, 15 Aug 2022 16:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jeof42bT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1343655AbiHOWIx (ORCPT + 99 others); Mon, 15 Aug 2022 18:08:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348309AbiHOWFs (ORCPT ); Mon, 15 Aug 2022 18:05:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 886AC11609A; Mon, 15 Aug 2022 12:37:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6905A611E7; Mon, 15 Aug 2022 19:37:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 562F1C433C1; Mon, 15 Aug 2022 19:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592249; bh=Xq3v93P9JTZdi2AV2EUYbUde+wbxdFFKx2QgvcEJt9c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jeof42bTN5mZDVAuPuNVLXsSmELPXMmuU3Kq7svhgkp0zf3Iy/yzpK8qsPFmxmGLn AtbiNEfrqIsHfJkWpb6u5dDYrZM60D1E9Eg9fyDAIiz6lHVqvgwkrlHR7oz1idrJdM mExfYsBPYq5HCT3grqGExJrcOyfKiD4Y2mUFeBDk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thinh Nguyen , Sasha Levin Subject: [PATCH 5.18 0756/1095] usb: dwc3: core: Deprecate GCTL.CORESOFTRESET Date: Mon, 15 Aug 2022 20:02:35 +0200 Message-Id: <20220815180500.580769281@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thinh Nguyen [ Upstream commit afbd04e66e5d16ca3c7ea2e3c56eca25558eacf3 ] Synopsys IP DWC_usb32 and DWC_usb31 version 1.90a and above deprecated GCTL.CORESOFTRESET. The DRD mode switching flow is updated to remove the GCTL soft reset. Add version checks to prevent using deprecated setting in mode switching flow. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/9df529fde6e55f5508321b6bc26e92848044ef2b.1655338967.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index d28cd1a6709b..46a3b8941e40 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -158,7 +158,8 @@ static void __dwc3_set_mode(struct work_struct *work) } /* For DRD host or device mode only */ - if (dwc->desired_dr_role != DWC3_GCTL_PRTCAP_OTG) { + if ((DWC3_IP_IS(DWC3) || DWC3_VER_IS_PRIOR(DWC31, 190A)) && + dwc->desired_dr_role != DWC3_GCTL_PRTCAP_OTG) { reg = dwc3_readl(dwc->regs, DWC3_GCTL); reg |= DWC3_GCTL_CORESOFTRESET; dwc3_writel(dwc->regs, DWC3_GCTL, reg); -- 2.35.1