Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2475733pxj; Mon, 10 May 2021 04:02:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxORWOAo88tLTbFzsW18pdTbh7ukQTJf0CsSJUydunan6hkX9u2nWOrIVWQRcyUqhiVK00R X-Received: by 2002:a05:6e02:dec:: with SMTP id m12mr20820802ilj.288.1620644531492; Mon, 10 May 2021 04:02:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644531; cv=none; d=google.com; s=arc-20160816; b=SRsdBEjCrLLehE00tHHNEktDF10HQ+zGP6PtRBQm7qokbSncsY/jNIPilHT4L4KRYO TXJaFGA/sBRyhR0slALWTG34vbskzlARB0YWoisS4I2PY+fL9vUphTDFHs9XDMiiLm0s 0wE362yxRvO9LmLDUT6rId07Yw3S+MC/9ffPNHS4VhmxMNfna9NUmRpytaUz+ow0RSDy 1NFoMyXIiNSJrO2E11rRt2JefhR3SDyFNo4l9OUdWui9AxUXxl+q+7Bn25WDbtCRPzGO cy4lYWOhRBlgFpO2TDiQJKfgx0n9g0pe6eNKL03M+IivAwwGujRR83xdHLQitQQ9qZ1k hXBQ== 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=yIGWRsI2tI64oLbs3Fa1onlP/tT2WWJBoMBTVNLouyE=; b=YC9UucBDoZ5NrJMi38oh1IiC6wlvQXx7aNMLJY/Nl9CEN2DuNi5HCU/aoD8Yof+ktz CBBag+Nw0Op3c5wX1d/M+7RbDqAZToqMVBQY13yVADED1BJnz1oJnLtIMaQfG7KtjIT5 /RYHhj2LRdcYCMO/QLYlEGc4Te6koneU+K+Nq2TiCmyxkwewC3BSz8N7Z2XZV04c1vj+ kf2TH3nlrCpYw0v5cAmDsDs4jZyDQR2nykAhTP3csiwWqt/5ca3jjEhD8JXdgVnSZwEs NbGEWsLLaZxpdCtSXNDCqVHTuMNzOPSJulxd5OFHq8grOlD65ce8xKsq9fws25MVCFTu CByA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nJdiGzxM; 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 s4si17628817ilv.33.2021.05.10.04.01.57; Mon, 10 May 2021 04:02:11 -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=nJdiGzxM; 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 S232966AbhEJK63 (ORCPT + 99 others); Mon, 10 May 2021 06:58:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:58292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233243AbhEJKpZ (ORCPT ); Mon, 10 May 2021 06:45:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F00166199F; Mon, 10 May 2021 10:35:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642932; bh=0rCUqkBZZMR4uJ2N+2owI05AkuDJrs3wfxx4M192WkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nJdiGzxMgdmNWtbzGPcXdmmOizCh5TQjFaiIuYlYLo5nmVncsK+Pe4xs6zPUxrcwr eq7OeBHlVO49nF8oK5XJ5LGSzaAf5tDRRIktD3HYQZTY0FwFHcHOhVYZHNHYtZK5dF j813LX3dmna/rmTIgJ5WSorLgJ9HjpFO9/yI9lv0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunfeng Yun , Sasha Levin Subject: [PATCH 5.10 083/299] usb: xhci-mtk: support quirk to disable usb2 lpm Date: Mon, 10 May 2021 12:18:00 +0200 Message-Id: <20210510102007.670979126@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunfeng Yun [ Upstream commit bee1f89aad2a51cd3339571bc8eadbb0dc88a683 ] The xHCI driver support usb2 HW LPM by default, here add support XHCI_HW_LPM_DISABLE quirk, then we can disable usb2 lpm when need it. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/1617181553-3503-4-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/xhci-mtk.c | 3 +++ drivers/usb/host/xhci-mtk.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index 2f27dc0d9c6b..1c331577fca9 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -397,6 +397,8 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci) xhci->quirks |= XHCI_SPURIOUS_SUCCESS; if (mtk->lpm_support) xhci->quirks |= XHCI_LPM_SUPPORT; + if (mtk->u2_lpm_disable) + xhci->quirks |= XHCI_HW_LPM_DISABLE; /* * MTK xHCI 0.96: PSA is 1 by default even if doesn't support stream, @@ -469,6 +471,7 @@ static int xhci_mtk_probe(struct platform_device *pdev) return ret; mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable"); + mtk->u2_lpm_disable = of_property_read_bool(node, "usb2-lpm-disable"); /* optional property, ignore the error if it does not exist */ of_property_read_u32(node, "mediatek,u3p-dis-msk", &mtk->u3p_dis_msk); diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h index cbb09dfea62e..080109012b9a 100644 --- a/drivers/usb/host/xhci-mtk.h +++ b/drivers/usb/host/xhci-mtk.h @@ -150,6 +150,7 @@ struct xhci_hcd_mtk { struct phy **phys; int num_phys; bool lpm_support; + bool u2_lpm_disable; /* usb remote wakeup */ bool uwk_en; struct regmap *uwk; -- 2.30.2