* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 6:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 6:12 UTC (permalink / raw)
To: Mathias Nyman, Martin Blumenstingl
Cc: Matthias Brugger, Chunfeng Yun, Roger Quadros, linux-kernel,
linux-arm-kernel, linux-usb, linux-mediatek, Greg Kroah-Hartman
The phys has already been initialized when add primary hcd,
including usb2 phys and usb3 phys also if exist, so needn't
re-parse "phys" property again.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/host/xhci-mtk.c | 1 +
drivers/usb/host/xhci-plat.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 7334da9..6bb23fb 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6700e5e..65a4294 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
--
1.9.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [usb-next] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 6:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 6:12 UTC (permalink / raw)
To: Mathias Nyman, Martin Blumenstingl
Cc: Matthias Brugger, Chunfeng Yun, Roger Quadros, linux-kernel,
linux-arm-kernel, linux-usb, linux-mediatek, Greg Kroah-Hartman
The phys has already been initialized when add primary hcd,
including usb2 phys and usb3 phys also if exist, so needn't
re-parse "phys" property again.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/host/xhci-mtk.c | 1 +
drivers/usb/host/xhci-plat.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 7334da9..6bb23fb 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6700e5e..65a4294 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 6:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 6:12 UTC (permalink / raw)
To: Mathias Nyman, Martin Blumenstingl
Cc: Greg Kroah-Hartman, linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Chunfeng Yun,
linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
Matthias Brugger,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Roger Quadros
The phys has already been initialized when add primary hcd,
including usb2 phys and usb3 phys also if exist, so needn't
re-parse "phys" property again.
Signed-off-by: Chunfeng Yun <chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
drivers/usb/host/xhci-mtk.c | 1 +
drivers/usb/host/xhci-plat.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 7334da9..6bb23fb 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6700e5e..65a4294 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
--
1.9.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 6:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 6:12 UTC (permalink / raw)
To: linux-arm-kernel
The phys has already been initialized when add primary hcd,
including usb2 phys and usb3 phys also if exist, so needn't
re-parse "phys" property again.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/host/xhci-mtk.c | 1 +
drivers/usb/host/xhci-plat.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
index 7334da9..6bb23fb 100644
--- a/drivers/usb/host/xhci-mtk.c
+++ b/drivers/usb/host/xhci-mtk.c
@@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6700e5e..65a4294 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
xhci->shared_hcd->can_do_streams = 1;
+ xhci->shared_hcd->skip_phy_initialization = 1;
ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
if (ret)
goto dealloc_usb2_hcd;
--
1.9.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 9:05 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 9:05 UTC (permalink / raw)
To: Chunfeng Yun, Mathias Nyman, Martin Blumenstingl
Cc: Matthias Brugger, linux-kernel, linux-arm-kernel, linux-usb,
linux-mediatek, Greg Kroah-Hartman
Hi Chunfeng,
On 21/03/18 08:12, Chunfeng Yun wrote:
> The phys has already been initialized when add primary hcd,
> including usb2 phys and usb3 phys also if exist, so needn't
> re-parse "phys" property again.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> drivers/usb/host/xhci-mtk.c | 1 +
> drivers/usb/host/xhci-plat.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 7334da9..6bb23fb 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 6700e5e..65a4294 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
I think this is unnecessary.
There aren't separate PHYs for the primary and shared HCDs right?
Also how can you be sure that phy_init() has been done for all platform HCD users?
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
>
--
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 20+ messages in thread
* [usb-next] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 9:05 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 9:05 UTC (permalink / raw)
To: Chunfeng Yun, Mathias Nyman, Martin Blumenstingl
Cc: Matthias Brugger, linux-kernel, linux-arm-kernel, linux-usb,
linux-mediatek, Greg Kroah-Hartman
Hi Chunfeng,
On 21/03/18 08:12, Chunfeng Yun wrote:
> The phys has already been initialized when add primary hcd,
> including usb2 phys and usb3 phys also if exist, so needn't
> re-parse "phys" property again.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> drivers/usb/host/xhci-mtk.c | 1 +
> drivers/usb/host/xhci-plat.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 7334da9..6bb23fb 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 6700e5e..65a4294 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
I think this is unnecessary.
There aren't separate PHYs for the primary and shared HCDs right?
Also how can you be sure that phy_init() has been done for all platform HCD users?
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 9:05 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 9:05 UTC (permalink / raw)
To: Chunfeng Yun, Mathias Nyman, Martin Blumenstingl
Cc: Greg Kroah-Hartman, linux-usb, linux-kernel, linux-mediatek,
Matthias Brugger, linux-arm-kernel
Hi Chunfeng,
On 21/03/18 08:12, Chunfeng Yun wrote:
> The phys has already been initialized when add primary hcd,
> including usb2 phys and usb3 phys also if exist, so needn't
> re-parse "phys" property again.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> drivers/usb/host/xhci-mtk.c | 1 +
> drivers/usb/host/xhci-plat.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 7334da9..6bb23fb 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 6700e5e..65a4294 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
I think this is unnecessary.
There aren't separate PHYs for the primary and shared HCDs right?
Also how can you be sure that phy_init() has been done for all platform HCD users?
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
>
--
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 20+ messages in thread
* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 9:05 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 9:05 UTC (permalink / raw)
To: linux-arm-kernel
Hi Chunfeng,
On 21/03/18 08:12, Chunfeng Yun wrote:
> The phys has already been initialized when add primary hcd,
> including usb2 phys and usb3 phys also if exist, so needn't
> re-parse "phys" property again.
>
> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> ---
> drivers/usb/host/xhci-mtk.c | 1 +
> drivers/usb/host/xhci-plat.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> index 7334da9..6bb23fb 100644
> --- a/drivers/usb/host/xhci-mtk.c
> +++ b/drivers/usb/host/xhci-mtk.c
> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 6700e5e..65a4294 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> xhci->shared_hcd->can_do_streams = 1;
>
> + xhci->shared_hcd->skip_phy_initialization = 1;
I think this is unnecessary.
There aren't separate PHYs for the primary and shared HCDs right?
Also how can you be sure that phy_init() has been done for all platform HCD users?
> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> if (ret)
> goto dealloc_usb2_hcd;
>
--
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 11:50 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 11:50 UTC (permalink / raw)
To: Roger Quadros
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
Hi Roger,
On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> Hi Chunfeng,
>
> On 21/03/18 08:12, Chunfeng Yun wrote:
> > The phys has already been initialized when add primary hcd,
> > including usb2 phys and usb3 phys also if exist, so needn't
> > re-parse "phys" property again.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > drivers/usb/host/xhci-mtk.c | 1 +
> > drivers/usb/host/xhci-plat.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> > index 7334da9..6bb23fb 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > index 6700e5e..65a4294 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
>
> I think this is unnecessary.
> There aren't separate PHYs for the primary and shared HCDs right?
Yes, the primary and shared HCDs will get the same PHYs provided by
"phys" property.
>
> Also how can you be sure that phy_init() has been done for all platform HCD users?
Here I assume that "phys" and "usb-phy" properties are not used at the
same time. There are two cases:
1. Using "usb-phy": no "phys" to be got by shared HCD.
2. Using "phys": the primary HCD will get those phys, so shared HCD can
skip them.
>
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> >
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [usb-next] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 11:50 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 11:50 UTC (permalink / raw)
To: Roger Quadros
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
Hi Roger,
On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> Hi Chunfeng,
>
> On 21/03/18 08:12, Chunfeng Yun wrote:
> > The phys has already been initialized when add primary hcd,
> > including usb2 phys and usb3 phys also if exist, so needn't
> > re-parse "phys" property again.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > drivers/usb/host/xhci-mtk.c | 1 +
> > drivers/usb/host/xhci-plat.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> > index 7334da9..6bb23fb 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > index 6700e5e..65a4294 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
>
> I think this is unnecessary.
> There aren't separate PHYs for the primary and shared HCDs right?
Yes, the primary and shared HCDs will get the same PHYs provided by
"phys" property.
>
> Also how can you be sure that phy_init() has been done for all platform HCD users?
Here I assume that "phys" and "usb-phy" properties are not used at the
same time. There are two cases:
1. Using "usb-phy": no "phys" to be got by shared HCD.
2. Using "phys": the primary HCD will get those phys, so shared HCD can
skip them.
>
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> >
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 11:50 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 11:50 UTC (permalink / raw)
To: Roger Quadros
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
Hi Roger,
On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> Hi Chunfeng,
>
> On 21/03/18 08:12, Chunfeng Yun wrote:
> > The phys has already been initialized when add primary hcd,
> > including usb2 phys and usb3 phys also if exist, so needn't
> > re-parse "phys" property again.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > drivers/usb/host/xhci-mtk.c | 1 +
> > drivers/usb/host/xhci-plat.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> > index 7334da9..6bb23fb 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > index 6700e5e..65a4294 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
>
> I think this is unnecessary.
> There aren't separate PHYs for the primary and shared HCDs right?
Yes, the primary and shared HCDs will get the same PHYs provided by
"phys" property.
>
> Also how can you be sure that phy_init() has been done for all platform HCD users?
Here I assume that "phys" and "usb-phy" properties are not used at the
same time. There are two cases:
1. Using "usb-phy": no "phys" to be got by shared HCD.
2. Using "phys": the primary HCD will get those phys, so shared HCD can
skip them.
>
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> >
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 11:50 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-21 11:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi Roger,
On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> Hi Chunfeng,
>
> On 21/03/18 08:12, Chunfeng Yun wrote:
> > The phys has already been initialized when add primary hcd,
> > including usb2 phys and usb3 phys also if exist, so needn't
> > re-parse "phys" property again.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> > ---
> > drivers/usb/host/xhci-mtk.c | 1 +
> > drivers/usb/host/xhci-plat.c | 1 +
> > 2 files changed, 2 insertions(+)
> >
> > diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> > index 7334da9..6bb23fb 100644
> > --- a/drivers/usb/host/xhci-mtk.c
> > +++ b/drivers/usb/host/xhci-mtk.c
> > @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> > diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> > index 6700e5e..65a4294 100644
> > --- a/drivers/usb/host/xhci-plat.c
> > +++ b/drivers/usb/host/xhci-plat.c
> > @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> > if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> > xhci->shared_hcd->can_do_streams = 1;
> >
> > + xhci->shared_hcd->skip_phy_initialization = 1;
>
> I think this is unnecessary.
> There aren't separate PHYs for the primary and shared HCDs right?
Yes, the primary and shared HCDs will get the same PHYs provided by
"phys" property.
>
> Also how can you be sure that phy_init() has been done for all platform HCD users?
Here I assume that "phys" and "usb-phy" properties are not used at the
same time. There are two cases:
1. Using "usb-phy": no "phys" to be got by shared HCD.
2. Using "phys": the primary HCD will get those phys, so shared HCD can
skip them.
>
> > ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> > if (ret)
> > goto dealloc_usb2_hcd;
> >
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 12:27 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 12:27 UTC (permalink / raw)
To: Chunfeng Yun
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
On 21/03/18 13:50, Chunfeng Yun wrote:
> Hi Roger,
>
> On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
>> Hi Chunfeng,
>>
>> On 21/03/18 08:12, Chunfeng Yun wrote:
>>> The phys has already been initialized when add primary hcd,
>>> including usb2 phys and usb3 phys also if exist, so needn't
>>> re-parse "phys" property again.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>> ---
>>> drivers/usb/host/xhci-mtk.c | 1 +
>>> drivers/usb/host/xhci-plat.c | 1 +
>>> 2 files changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
>>> index 7334da9..6bb23fb 100644
>>> --- a/drivers/usb/host/xhci-mtk.c
>>> +++ b/drivers/usb/host/xhci-mtk.c
>>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
>>> index 6700e5e..65a4294 100644
>>> --- a/drivers/usb/host/xhci-plat.c
>>> +++ b/drivers/usb/host/xhci-plat.c
>>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>
>> I think this is unnecessary.
>> There aren't separate PHYs for the primary and shared HCDs right?
> Yes, the primary and shared HCDs will get the same PHYs provided by
> "phys" property.
>
>>
>> Also how can you be sure that phy_init() has been done for all platform HCD users?
> Here I assume that "phys" and "usb-phy" properties are not used at the
> same time. There are two cases:
> 1. Using "usb-phy": no "phys" to be got by shared HCD.
> 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> skip them.
Now I see the problem.
But the right fix should be in core/hcd.c
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 2884607..1d1da12 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
}
}
- if (!hcd->skip_phy_initialization) {
+ if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
if (IS_ERR(hcd->phy_roothub)) {
retval = PTR_ERR(hcd->phy_roothub);
>
>>
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>>
>>
>
>
--
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [usb-next] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 12:27 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 12:27 UTC (permalink / raw)
To: Chunfeng Yun
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
On 21/03/18 13:50, Chunfeng Yun wrote:
> Hi Roger,
>
> On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
>> Hi Chunfeng,
>>
>> On 21/03/18 08:12, Chunfeng Yun wrote:
>>> The phys has already been initialized when add primary hcd,
>>> including usb2 phys and usb3 phys also if exist, so needn't
>>> re-parse "phys" property again.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>> ---
>>> drivers/usb/host/xhci-mtk.c | 1 +
>>> drivers/usb/host/xhci-plat.c | 1 +
>>> 2 files changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
>>> index 7334da9..6bb23fb 100644
>>> --- a/drivers/usb/host/xhci-mtk.c
>>> +++ b/drivers/usb/host/xhci-mtk.c
>>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
>>> index 6700e5e..65a4294 100644
>>> --- a/drivers/usb/host/xhci-plat.c
>>> +++ b/drivers/usb/host/xhci-plat.c
>>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>
>> I think this is unnecessary.
>> There aren't separate PHYs for the primary and shared HCDs right?
> Yes, the primary and shared HCDs will get the same PHYs provided by
> "phys" property.
>
>>
>> Also how can you be sure that phy_init() has been done for all platform HCD users?
> Here I assume that "phys" and "usb-phy" properties are not used at the
> same time. There are two cases:
> 1. Using "usb-phy": no "phys" to be got by shared HCD.
> 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> skip them.
Now I see the problem.
But the right fix should be in core/hcd.c
>
>>
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>>
>>
>
>
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 2884607..1d1da12 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
}
}
- if (!hcd->skip_phy_initialization) {
+ if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
if (IS_ERR(hcd->phy_roothub)) {
retval = PTR_ERR(hcd->phy_roothub);
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 12:27 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 12:27 UTC (permalink / raw)
To: Chunfeng Yun
Cc: Mathias Nyman, Martin Blumenstingl, Greg Kroah-Hartman,
linux-usb, linux-kernel, linux-mediatek, Matthias Brugger,
linux-arm-kernel
On 21/03/18 13:50, Chunfeng Yun wrote:
> Hi Roger,
>
> On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
>> Hi Chunfeng,
>>
>> On 21/03/18 08:12, Chunfeng Yun wrote:
>>> The phys has already been initialized when add primary hcd,
>>> including usb2 phys and usb3 phys also if exist, so needn't
>>> re-parse "phys" property again.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>> ---
>>> drivers/usb/host/xhci-mtk.c | 1 +
>>> drivers/usb/host/xhci-plat.c | 1 +
>>> 2 files changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
>>> index 7334da9..6bb23fb 100644
>>> --- a/drivers/usb/host/xhci-mtk.c
>>> +++ b/drivers/usb/host/xhci-mtk.c
>>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
>>> index 6700e5e..65a4294 100644
>>> --- a/drivers/usb/host/xhci-plat.c
>>> +++ b/drivers/usb/host/xhci-plat.c
>>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>
>> I think this is unnecessary.
>> There aren't separate PHYs for the primary and shared HCDs right?
> Yes, the primary and shared HCDs will get the same PHYs provided by
> "phys" property.
>
>>
>> Also how can you be sure that phy_init() has been done for all platform HCD users?
> Here I assume that "phys" and "usb-phy" properties are not used at the
> same time. There are two cases:
> 1. Using "usb-phy": no "phys" to be got by shared HCD.
> 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> skip them.
Now I see the problem.
But the right fix should be in core/hcd.c
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 2884607..1d1da12 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
}
}
- if (!hcd->skip_phy_initialization) {
+ if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
if (IS_ERR(hcd->phy_roothub)) {
retval = PTR_ERR(hcd->phy_roothub);
>
>>
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>>
>>
>
>
--
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-21 12:27 ` Roger Quadros
0 siblings, 0 replies; 20+ messages in thread
From: Roger Quadros @ 2018-03-21 12:27 UTC (permalink / raw)
To: linux-arm-kernel
On 21/03/18 13:50, Chunfeng Yun wrote:
> Hi Roger,
>
> On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
>> Hi Chunfeng,
>>
>> On 21/03/18 08:12, Chunfeng Yun wrote:
>>> The phys has already been initialized when add primary hcd,
>>> including usb2 phys and usb3 phys also if exist, so needn't
>>> re-parse "phys" property again.
>>>
>>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
>>> ---
>>> drivers/usb/host/xhci-mtk.c | 1 +
>>> drivers/usb/host/xhci-plat.c | 1 +
>>> 2 files changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
>>> index 7334da9..6bb23fb 100644
>>> --- a/drivers/usb/host/xhci-mtk.c
>>> +++ b/drivers/usb/host/xhci-mtk.c
>>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
>>> index 6700e5e..65a4294 100644
>>> --- a/drivers/usb/host/xhci-plat.c
>>> +++ b/drivers/usb/host/xhci-plat.c
>>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
>>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
>>> xhci->shared_hcd->can_do_streams = 1;
>>>
>>> + xhci->shared_hcd->skip_phy_initialization = 1;
>>
>> I think this is unnecessary.
>> There aren't separate PHYs for the primary and shared HCDs right?
> Yes, the primary and shared HCDs will get the same PHYs provided by
> "phys" property.
>
>>
>> Also how can you be sure that phy_init() has been done for all platform HCD users?
> Here I assume that "phys" and "usb-phy" properties are not used at the
> same time. There are two cases:
> 1. Using "usb-phy": no "phys" to be got by shared HCD.
> 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> skip them.
Now I see the problem.
But the right fix should be in core/hcd.c
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index 2884607..1d1da12 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
}
}
- if (!hcd->skip_phy_initialization) {
+ if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
if (IS_ERR(hcd->phy_roothub)) {
retval = PTR_ERR(hcd->phy_roothub);
>
>>
>>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
>>> if (ret)
>>> goto dealloc_usb2_hcd;
>>>
>>
>
>
--
cheers,
-roger
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-22 8:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-22 8:12 UTC (permalink / raw)
To: Roger Quadros
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
hi,
On Wed, 2018-03-21 at 14:27 +0200, Roger Quadros wrote:
> On 21/03/18 13:50, Chunfeng Yun wrote:
> > Hi Roger,
> >
> > On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> >> Hi Chunfeng,
> >>
> >> On 21/03/18 08:12, Chunfeng Yun wrote:
> >>> The phys has already been initialized when add primary hcd,
> >>> including usb2 phys and usb3 phys also if exist, so needn't
> >>> re-parse "phys" property again.
> >>>
> >>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> >>> ---
> >>> drivers/usb/host/xhci-mtk.c | 1 +
> >>> drivers/usb/host/xhci-plat.c | 1 +
> >>> 2 files changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> >>> index 7334da9..6bb23fb 100644
> >>> --- a/drivers/usb/host/xhci-mtk.c
> >>> +++ b/drivers/usb/host/xhci-mtk.c
> >>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> >>> index 6700e5e..65a4294 100644
> >>> --- a/drivers/usb/host/xhci-plat.c
> >>> +++ b/drivers/usb/host/xhci-plat.c
> >>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>
> >> I think this is unnecessary.
> >> There aren't separate PHYs for the primary and shared HCDs right?
> > Yes, the primary and shared HCDs will get the same PHYs provided by
> > "phys" property.
> >
> >>
> >> Also how can you be sure that phy_init() has been done for all platform HCD users?
> > Here I assume that "phys" and "usb-phy" properties are not used at the
> > same time. There are two cases:
> > 1. Using "usb-phy": no "phys" to be got by shared HCD.
> > 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> > skip them.
>
> Now I see the problem.
> But the right fix should be in core/hcd.c
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 2884607..1d1da12 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> }
> }
>
> - if (!hcd->skip_phy_initialization) {
> + if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
It's a better way.
Thanks
> hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
> if (IS_ERR(hcd->phy_roothub)) {
> retval = PTR_ERR(hcd->phy_roothub);
>
> >
> >>
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [usb-next] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-22 8:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-22 8:12 UTC (permalink / raw)
To: Roger Quadros
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
hi,
On Wed, 2018-03-21 at 14:27 +0200, Roger Quadros wrote:
> On 21/03/18 13:50, Chunfeng Yun wrote:
> > Hi Roger,
> >
> > On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> >> Hi Chunfeng,
> >>
> >> On 21/03/18 08:12, Chunfeng Yun wrote:
> >>> The phys has already been initialized when add primary hcd,
> >>> including usb2 phys and usb3 phys also if exist, so needn't
> >>> re-parse "phys" property again.
> >>>
> >>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> >>> ---
> >>> drivers/usb/host/xhci-mtk.c | 1 +
> >>> drivers/usb/host/xhci-plat.c | 1 +
> >>> 2 files changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> >>> index 7334da9..6bb23fb 100644
> >>> --- a/drivers/usb/host/xhci-mtk.c
> >>> +++ b/drivers/usb/host/xhci-mtk.c
> >>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> >>> index 6700e5e..65a4294 100644
> >>> --- a/drivers/usb/host/xhci-plat.c
> >>> +++ b/drivers/usb/host/xhci-plat.c
> >>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>
> >> I think this is unnecessary.
> >> There aren't separate PHYs for the primary and shared HCDs right?
> > Yes, the primary and shared HCDs will get the same PHYs provided by
> > "phys" property.
> >
> >>
> >> Also how can you be sure that phy_init() has been done for all platform HCD users?
> > Here I assume that "phys" and "usb-phy" properties are not used at the
> > same time. There are two cases:
> > 1. Using "usb-phy": no "phys" to be got by shared HCD.
> > 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> > skip them.
>
> Now I see the problem.
> But the right fix should be in core/hcd.c
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 2884607..1d1da12 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> }
> }
>
> - if (!hcd->skip_phy_initialization) {
> + if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
It's a better way.
Thanks
> hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
> if (IS_ERR(hcd->phy_roothub)) {
> retval = PTR_ERR(hcd->phy_roothub);
>
> >
> >>
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>>
> >>
> >
> >
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-22 8:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-22 8:12 UTC (permalink / raw)
To: Roger Quadros
Cc: Mathias Nyman, Martin Blumenstingl, Matthias Brugger,
linux-kernel, linux-arm-kernel, linux-usb, linux-mediatek,
Greg Kroah-Hartman
hi,
On Wed, 2018-03-21 at 14:27 +0200, Roger Quadros wrote:
> On 21/03/18 13:50, Chunfeng Yun wrote:
> > Hi Roger,
> >
> > On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> >> Hi Chunfeng,
> >>
> >> On 21/03/18 08:12, Chunfeng Yun wrote:
> >>> The phys has already been initialized when add primary hcd,
> >>> including usb2 phys and usb3 phys also if exist, so needn't
> >>> re-parse "phys" property again.
> >>>
> >>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> >>> ---
> >>> drivers/usb/host/xhci-mtk.c | 1 +
> >>> drivers/usb/host/xhci-plat.c | 1 +
> >>> 2 files changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> >>> index 7334da9..6bb23fb 100644
> >>> --- a/drivers/usb/host/xhci-mtk.c
> >>> +++ b/drivers/usb/host/xhci-mtk.c
> >>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> >>> index 6700e5e..65a4294 100644
> >>> --- a/drivers/usb/host/xhci-plat.c
> >>> +++ b/drivers/usb/host/xhci-plat.c
> >>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>
> >> I think this is unnecessary.
> >> There aren't separate PHYs for the primary and shared HCDs right?
> > Yes, the primary and shared HCDs will get the same PHYs provided by
> > "phys" property.
> >
> >>
> >> Also how can you be sure that phy_init() has been done for all platform HCD users?
> > Here I assume that "phys" and "usb-phy" properties are not used at the
> > same time. There are two cases:
> > 1. Using "usb-phy": no "phys" to be got by shared HCD.
> > 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> > skip them.
>
> Now I see the problem.
> But the right fix should be in core/hcd.c
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 2884607..1d1da12 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> }
> }
>
> - if (!hcd->skip_phy_initialization) {
> + if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
It's a better way.
Thanks
> hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
> if (IS_ERR(hcd->phy_roothub)) {
> retval = PTR_ERR(hcd->phy_roothub);
>
> >
> >>
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd
@ 2018-03-22 8:12 ` Chunfeng Yun
0 siblings, 0 replies; 20+ messages in thread
From: Chunfeng Yun @ 2018-03-22 8:12 UTC (permalink / raw)
To: linux-arm-kernel
hi,
On Wed, 2018-03-21 at 14:27 +0200, Roger Quadros wrote:
> On 21/03/18 13:50, Chunfeng Yun wrote:
> > Hi Roger,
> >
> > On Wed, 2018-03-21 at 11:05 +0200, Roger Quadros wrote:
> >> Hi Chunfeng,
> >>
> >> On 21/03/18 08:12, Chunfeng Yun wrote:
> >>> The phys has already been initialized when add primary hcd,
> >>> including usb2 phys and usb3 phys also if exist, so needn't
> >>> re-parse "phys" property again.
> >>>
> >>> Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
> >>> ---
> >>> drivers/usb/host/xhci-mtk.c | 1 +
> >>> drivers/usb/host/xhci-plat.c | 1 +
> >>> 2 files changed, 2 insertions(+)
> >>>
> >>> diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c
> >>> index 7334da9..6bb23fb 100644
> >>> --- a/drivers/usb/host/xhci-mtk.c
> >>> +++ b/drivers/usb/host/xhci-mtk.c
> >>> @@ -554,6 +554,7 @@ static int xhci_mtk_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> >>> index 6700e5e..65a4294 100644
> >>> --- a/drivers/usb/host/xhci-plat.c
> >>> +++ b/drivers/usb/host/xhci-plat.c
> >>> @@ -294,6 +294,7 @@ static int xhci_plat_probe(struct platform_device *pdev)
> >>> if (HCC_MAX_PSA(xhci->hcc_params) >= 4)
> >>> xhci->shared_hcd->can_do_streams = 1;
> >>>
> >>> + xhci->shared_hcd->skip_phy_initialization = 1;
> >>
> >> I think this is unnecessary.
> >> There aren't separate PHYs for the primary and shared HCDs right?
> > Yes, the primary and shared HCDs will get the same PHYs provided by
> > "phys" property.
> >
> >>
> >> Also how can you be sure that phy_init() has been done for all platform HCD users?
> > Here I assume that "phys" and "usb-phy" properties are not used at the
> > same time. There are two cases:
> > 1. Using "usb-phy": no "phys" to be got by shared HCD.
> > 2. Using "phys": the primary HCD will get those phys, so shared HCD can
> > skip them.
>
> Now I see the problem.
> But the right fix should be in core/hcd.c
>
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 2884607..1d1da12 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2757,7 +2757,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
> }
> }
>
> - if (!hcd->skip_phy_initialization) {
> + if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
It's a better way.
Thanks
> hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
> if (IS_ERR(hcd->phy_roothub)) {
> retval = PTR_ERR(hcd->phy_roothub);
>
> >
> >>
> >>> ret = usb_add_hcd(xhci->shared_hcd, irq, IRQF_SHARED);
> >>> if (ret)
> >>> goto dealloc_usb2_hcd;
> >>>
> >>
> >
> >
>
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2018-03-22 8:12 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-21 6:12 [usb-next PATCH] usb: xhci: skip phys initialization of shared hcd Chunfeng Yun
2018-03-21 6:12 ` Chunfeng Yun
2018-03-21 6:12 ` Chunfeng Yun
2018-03-21 6:12 ` [usb-next] " Chunfeng Yun
2018-03-21 9:05 ` [usb-next PATCH] " Roger Quadros
2018-03-21 9:05 ` Roger Quadros
2018-03-21 9:05 ` Roger Quadros
2018-03-21 9:05 ` [usb-next] " Roger Quadros
2018-03-21 11:50 ` [usb-next PATCH] " Chunfeng Yun
2018-03-21 11:50 ` Chunfeng Yun
2018-03-21 11:50 ` Chunfeng Yun
2018-03-21 11:50 ` [usb-next] " Chunfeng Yun
2018-03-21 12:27 ` [usb-next PATCH] " Roger Quadros
2018-03-21 12:27 ` Roger Quadros
2018-03-21 12:27 ` Roger Quadros
2018-03-21 12:27 ` [usb-next] " Roger Quadros
2018-03-22 8:12 ` [usb-next PATCH] " Chunfeng Yun
2018-03-22 8:12 ` Chunfeng Yun
2018-03-22 8:12 ` Chunfeng Yun
2018-03-22 8:12 ` [usb-next] " Chunfeng Yun
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.