Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4320709ybl; Tue, 21 Jan 2020 17:45:31 -0800 (PST) X-Google-Smtp-Source: APXvYqyX9I9Fu5IHqgll4T/IXsGltKcnKZmVOJWNyLOV5wAmaezEymFEri6+jNG071LAZoQXmVtn X-Received: by 2002:a9d:3a65:: with SMTP id j92mr5809224otc.37.1579657531271; Tue, 21 Jan 2020 17:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579657531; cv=none; d=google.com; s=arc-20160816; b=M9Vcf43AAKi2mL+Xf4kEFSJgF4Yoms+jTxZNGU20MhIzaKLlD5sQO7IbSQGHmmiqsq mjJUKCxlF7zhUDLNOtLBUvyMhI7EzAcSU+z+aF8hsmG/KmUKRJmXqhX8Oem3j7SfSqkk 0tYE1Am+JSHJkPlJmSFrnKKzRj9lLIAyK23YRVBGdgdXp8v0NbsKlcRFl7p+T9KNY9dH ITLVFGlQdF9WfWBQTcl/iYDApWj84Rj80VH9P64Pme/wiD5H3FrPB+a0/ODipRDuWz1i /7s7sNS9sAuHFD9HrRnzyqhC/BMLMv0k7LPv5BeUrQ4lCb/mqskbruhA3DY6RJXwDprA Wdyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :authenticated-by; bh=zDCvotnfFTl5I5ejnoDUb3EMTVt7zWu1P/h2/5/PoSk=; b=iX399xl2Im+TxJlYz6+9tilR3occdralRRC23h7OHTo/ASDTs2wohukd05LaEOdvWb V+gFKeBrZ5JMaiiXskYeQl3lyF+cN8PFWv91UbUI6jkysCGfQCuXwV1s5+Tk5TUJDQUH PTRMj8nNbx/4mCjwo4GU3mRWUgh5RnYubPMSAAWjappiVFDbYRhw/ZbzmNlmXEkcJdYn m+39GZS+10rfPd1vl2ChdQrD4zyKFYwzcZxpBaa0MS9//vUkzOsytVO6shVsJswloSAE vzsMGugZmVbe9gM3QMDdzrvt7x7SD0f8SdX6STb3RTh4SWI1IK3OpGyVRbsPOy2Sh56F IRKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si20844839oig.255.2020.01.21.17.45.19; Tue, 21 Jan 2020 17:45:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729259AbgAVBoM (ORCPT + 99 others); Tue, 21 Jan 2020 20:44:12 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:56909 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728904AbgAVBoM (ORCPT ); Tue, 21 Jan 2020 20:44:12 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID 00M1hnIg020167, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCASV02.realtek.com.tw[172.21.6.19]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id 00M1hnIg020167 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 22 Jan 2020 09:44:08 +0800 Received: from fc30.localdomain (172.21.177.138) by RTITCASV02.realtek.com.tw (172.21.6.19) with Microsoft SMTP Server id 14.3.468.0; Wed, 22 Jan 2020 09:43:45 +0800 From: Hayes Wang To: CC: , , , , , Hayes Wang Subject: [PATCH net v2 7/9] r8152: don't enable U1U2 with USB_SPEED_HIGH for RTL8153B Date: Wed, 22 Jan 2020 09:41:19 +0800 Message-ID: <1394712342-15778-355-Taiwan-albertk@realtek.com> X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <1394712342-15778-348-Taiwan-albertk@realtek.com> References: <1394712342-15778-338-Taiwan-albertk@realtek.com> <1394712342-15778-348-Taiwan-albertk@realtek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.177.138] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For certain platforms, it causes USB reset periodically. Signed-off-by: Hayes Wang --- drivers/net/usb/r8152.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 7efeddad1fc8..b1a00f29455b 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c @@ -3391,7 +3391,8 @@ static void rtl8153b_runtime_enable(struct r8152 *tp, bool enable) r8153b_ups_en(tp, false); r8153_queue_wake(tp, false); rtl_runtime_suspend_enable(tp, false); - r8153b_u1u2en(tp, true); + if (tp->udev->speed != USB_SPEED_HIGH) + r8153b_u1u2en(tp, true); } } @@ -5024,7 +5025,9 @@ static void rtl8153b_up(struct r8152 *tp) ocp_write_word(tp, MCU_TYPE_PLA, PLA_MAC_PWR_CTRL3, ocp_data); r8153_aldps_en(tp, true); - r8153b_u1u2en(tp, true); + + if (tp->udev->speed != USB_SPEED_HIGH) + r8153b_u1u2en(tp, true); } static void rtl8153b_down(struct r8152 *tp) @@ -5527,7 +5530,9 @@ static void r8153b_init(struct r8152 *tp) ocp_data &= ~CUR_LINK_OK; ocp_data |= POLL_LINK_CHG; ocp_write_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS, ocp_data); - r8153b_u1u2en(tp, true); + + if (tp->udev->speed != USB_SPEED_HIGH) + r8153b_u1u2en(tp, true); usb_enable_lpm(tp->udev); /* MAC clock speed down */ -- 2.21.0