All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	<linux-usb@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Ikjoon Jang <ikjn@chromium.org>
Subject: [PATCH 2/3] usb: xhci-mtk: fix UAS issue by XHCI_BROKEN_STREAMS quirk
Date: Wed, 16 Dec 2020 19:51:24 +0800	[thread overview]
Message-ID: <20201216115125.5886-2-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <20201216115125.5886-1-chunfeng.yun@mediatek.com>

The 0.96 xHCI controller on some platforms does not support
bulk stream even HCCPARAMS says supporting, due to MaxPSASize
is set a non-zero default value by mistake, here use
XHCI_BROKEN_STREAMS quirk to fix it.

Fixes: 94a631d91ad3 ("usb: xhci-mtk: check hcc_params after adding primary hcd")
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/host/xhci-mtk.c | 7 ++++++-
 drivers/usb/host/xhci-mtk.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 8f321f39ab96..08dab974d847 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -395,6 +395,9 @@ 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->broken_streams)
+		xhci->quirks |= XHCI_BROKEN_STREAMS;
 }
 
 /* called during probe() after chip reset completes */
@@ -460,6 +463,8 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 		return ret;
 
 	mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable");
+	mtk->broken_streams =
+		of_property_read_bool(node, "mediatek,broken_streams_quirk");
 	/* optional property, ignore the error if it does not exist */
 	of_property_read_u32(node, "mediatek,u3p-dis-msk",
 			     &mtk->u3p_dis_msk);
@@ -546,7 +551,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 	if (ret)
 		goto put_usb3_hcd;
 
-	if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
+	if (!mtk->broken_streams && HCC_MAX_PSA(xhci->hcc_params) >= 4)
 		xhci->shared_hcd->can_do_streams = 1;
 
 	ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
index a93cfe817904..86aa4978915e 100644
--- a/drivers/usb/host/xhci-mtk.h
+++ b/drivers/usb/host/xhci-mtk.h
@@ -147,6 +147,7 @@ struct xhci_hcd_mtk {
 	struct phy **phys;
 	int num_phys;
 	bool lpm_support;
+	bool broken_streams;
 	/* usb remote wakeup */
 	bool uwk_en;
 	struct regmap *uwk;
-- 
2.18.0

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: devicetree@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-mediatek@lists.infradead.org,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Ikjoon Jang <ikjn@chromium.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] usb: xhci-mtk: fix UAS issue by XHCI_BROKEN_STREAMS quirk
Date: Wed, 16 Dec 2020 19:51:24 +0800	[thread overview]
Message-ID: <20201216115125.5886-2-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <20201216115125.5886-1-chunfeng.yun@mediatek.com>

The 0.96 xHCI controller on some platforms does not support
bulk stream even HCCPARAMS says supporting, due to MaxPSASize
is set a non-zero default value by mistake, here use
XHCI_BROKEN_STREAMS quirk to fix it.

Fixes: 94a631d91ad3 ("usb: xhci-mtk: check hcc_params after adding primary hcd")
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/host/xhci-mtk.c | 7 ++++++-
 drivers/usb/host/xhci-mtk.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 8f321f39ab96..08dab974d847 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -395,6 +395,9 @@ 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->broken_streams)
+		xhci->quirks |= XHCI_BROKEN_STREAMS;
 }
 
 /* called during probe() after chip reset completes */
@@ -460,6 +463,8 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 		return ret;
 
 	mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable");
+	mtk->broken_streams =
+		of_property_read_bool(node, "mediatek,broken_streams_quirk");
 	/* optional property, ignore the error if it does not exist */
 	of_property_read_u32(node, "mediatek,u3p-dis-msk",
 			     &mtk->u3p_dis_msk);
@@ -546,7 +551,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 	if (ret)
 		goto put_usb3_hcd;
 
-	if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
+	if (!mtk->broken_streams && HCC_MAX_PSA(xhci->hcc_params) >= 4)
 		xhci->shared_hcd->can_do_streams = 1;
 
 	ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
index a93cfe817904..86aa4978915e 100644
--- a/drivers/usb/host/xhci-mtk.h
+++ b/drivers/usb/host/xhci-mtk.h
@@ -147,6 +147,7 @@ struct xhci_hcd_mtk {
 	struct phy **phys;
 	int num_phys;
 	bool lpm_support;
+	bool broken_streams;
 	/* usb remote wakeup */
 	bool uwk_en;
 	struct regmap *uwk;
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Rob Herring <robh+dt@kernel.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: devicetree@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-mediatek@lists.infradead.org,
	Hsin-Yi Wang <hsinyi@chromium.org>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>,
	Ikjoon Jang <ikjn@chromium.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] usb: xhci-mtk: fix UAS issue by XHCI_BROKEN_STREAMS quirk
Date: Wed, 16 Dec 2020 19:51:24 +0800	[thread overview]
Message-ID: <20201216115125.5886-2-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <20201216115125.5886-1-chunfeng.yun@mediatek.com>

The 0.96 xHCI controller on some platforms does not support
bulk stream even HCCPARAMS says supporting, due to MaxPSASize
is set a non-zero default value by mistake, here use
XHCI_BROKEN_STREAMS quirk to fix it.

Fixes: 94a631d91ad3 ("usb: xhci-mtk: check hcc_params after adding primary hcd")
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
 drivers/usb/host/xhci-mtk.c | 7 ++++++-
 drivers/usb/host/xhci-mtk.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 8f321f39ab96..08dab974d847 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -395,6 +395,9 @@ 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->broken_streams)
+		xhci->quirks |= XHCI_BROKEN_STREAMS;
 }
 
 /* called during probe() after chip reset completes */
@@ -460,6 +463,8 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 		return ret;
 
 	mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable");
+	mtk->broken_streams =
+		of_property_read_bool(node, "mediatek,broken_streams_quirk");
 	/* optional property, ignore the error if it does not exist */
 	of_property_read_u32(node, "mediatek,u3p-dis-msk",
 			     &mtk->u3p_dis_msk);
@@ -546,7 +551,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
 	if (ret)
 		goto put_usb3_hcd;
 
-	if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
+	if (!mtk->broken_streams && HCC_MAX_PSA(xhci->hcc_params) >= 4)
 		xhci->shared_hcd->can_do_streams = 1;
 
 	ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h
index a93cfe817904..86aa4978915e 100644
--- a/drivers/usb/host/xhci-mtk.h
+++ b/drivers/usb/host/xhci-mtk.h
@@ -147,6 +147,7 @@ struct xhci_hcd_mtk {
 	struct phy **phys;
 	int num_phys;
 	bool lpm_support;
+	bool broken_streams;
 	/* usb remote wakeup */
 	bool uwk_en;
 	struct regmap *uwk;
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-12-16 11:52 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 11:51 [PATCH 1/3] dt-bindings: usb: mtk-xhci: add a new property for broken streams Chunfeng Yun
2020-12-16 11:51 ` Chunfeng Yun
2020-12-16 11:51 ` Chunfeng Yun
2020-12-16 11:51 ` Chunfeng Yun [this message]
2020-12-16 11:51   ` [PATCH 2/3] usb: xhci-mtk: fix UAS issue by XHCI_BROKEN_STREAMS quirk Chunfeng Yun
2020-12-16 11:51   ` Chunfeng Yun
2020-12-16 12:28   ` Nicolas Boichat
2020-12-16 12:28     ` Nicolas Boichat
2020-12-16 12:28     ` Nicolas Boichat
2020-12-17  2:19     ` Chunfeng Yun
2020-12-17  2:19       ` Chunfeng Yun
2020-12-17  2:19       ` Chunfeng Yun
2020-12-17  3:32       ` Nicolas Boichat
2020-12-17  3:32         ` Nicolas Boichat
2020-12-17  3:32         ` Nicolas Boichat
2020-12-17  6:23         ` Chunfeng Yun
2020-12-17  6:23           ` Chunfeng Yun
2020-12-17  6:23           ` Chunfeng Yun
2020-12-21 19:35           ` Rob Herring
2020-12-21 19:35             ` Rob Herring
2020-12-21 19:35             ` Rob Herring
2020-12-25  6:12             ` Chunfeng Yun
2020-12-25  6:12               ` Chunfeng Yun
2020-12-25  6:12               ` Chunfeng Yun
2020-12-17  3:43       ` Rosen Penev
2020-12-17  3:43         ` Rosen Penev
2020-12-17  3:43         ` Rosen Penev
2020-12-24  7:18         ` Chunfeng Yun
2020-12-24  7:18           ` Chunfeng Yun
2020-12-24  7:18           ` Chunfeng Yun
     [not found]           ` <7ad022d3-ff83-9126-ee74-6d1e4d381366@gmail.com>
2021-02-01  1:47             ` Chunfeng Yun
2021-02-01  1:47               ` Chunfeng Yun
2021-02-01  1:47               ` Chunfeng Yun
2020-12-16 11:51 ` [PATCH 3/3] arm64: dts: mt8173: add a broken streams quirk property for xHCI node Chunfeng Yun
2020-12-16 11:51   ` Chunfeng Yun
2020-12-16 11:51   ` Chunfeng Yun
2020-12-21 19:29 ` [PATCH 1/3] dt-bindings: usb: mtk-xhci: add a new property for broken streams Rob Herring
2020-12-21 19:29   ` Rob Herring
2020-12-21 19:29   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216115125.5886-2-chunfeng.yun@mediatek.com \
    --to=chunfeng.yun@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsinyi@chromium.org \
    --cc=ikjn@chromium.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.