linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: suppress confusing warnings on BCM2835
@ 2019-02-19 18:22 Stefan Wahren
  2019-02-21  7:34 ` Minas Harutyunyan
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wahren @ 2019-02-19 18:22 UTC (permalink / raw)
  To: Minas Harutyunyan, Greg Kroah-Hartman
  Cc: Stefan Wahren, Felipe Balbi, linux-usb, linux-arm-kernel

According to the BCM2835 datasheet the used Synopsys IP isn't a LPM-capable
core. So disable these features and suppress these confusing warnings:

dwc2 3f980000.usb: dwc2_check_params: Invalid parameter lpm=1
dwc2 3f980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
dwc2 3f980000.usb: dwc2_check_params: Invalid parameter besl=1
dwc2 3f980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/usb/dwc2/params.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index 24ff5f2..a158abb 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -47,6 +47,10 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg)
 	p->max_transfer_size = 65535;
 	p->max_packet_count = 511;
 	p->ahbcfg = 0x10;
+	p->lpm = false;
+	p->lpm_clock_gating = false;
+	p->besl = false;
+	p->hird_threshold_en = false;
 }
 
 static void dwc2_set_his_params(struct dwc2_hsotg *hsotg)
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc2: suppress confusing warnings on BCM2835
  2019-02-19 18:22 [PATCH] usb: dwc2: suppress confusing warnings on BCM2835 Stefan Wahren
@ 2019-02-21  7:34 ` Minas Harutyunyan
  2019-03-01 19:39   ` Stefan Wahren
  0 siblings, 1 reply; 3+ messages in thread
From: Minas Harutyunyan @ 2019-02-21  7:34 UTC (permalink / raw)
  To: Stefan Wahren, Minas Harutyunyan, Greg Kroah-Hartman
  Cc: Felipe Balbi, linux-usb, linux-arm-kernel

Hi Stefan,

On 2/19/2019 10:23 PM, Stefan Wahren wrote:
> According to the BCM2835 datasheet the used Synopsys IP isn't a LPM-capable
> core. So disable these features and suppress these confusing warnings:
> 
> dwc2 3f980000.usb: dwc2_check_params: Invalid parameter lpm=1
> dwc2 3f980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
> dwc2 3f980000.usb: dwc2_check_params: Invalid parameter besl=1
> dwc2 3f980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
>   drivers/usb/dwc2/params.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
> index 24ff5f2..a158abb 100644
> --- a/drivers/usb/dwc2/params.c
> +++ b/drivers/usb/dwc2/params.c
> @@ -47,6 +47,10 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg)
>   	p->max_transfer_size = 65535;
>   	p->max_packet_count = 511;
>   	p->ahbcfg = 0x10;
> +	p->lpm = false;
> +	p->lpm_clock_gating = false;
> +	p->besl = false;
> +	p->hird_threshold_en = false;
>   }
>   
>   static void dwc2_set_his_params(struct dwc2_hsotg *hsotg)
> 

What about to apply below patch:


diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
index c1912627a032..6b86aa42f003 100644
--- a/drivers/usb/dwc2/params.c
+++ b/drivers/usb/dwc2/params.c
@@ -303,11 +303,17 @@ static void dwc2_set_default_params(struct 
dwc2_hsotg *hsotg)
         p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a);
         p->uframe_sched = true;
         p->external_id_pin_ctl = false;
-       p->lpm = true;
-       p->lpm_clock_gating = true;
-       p->besl = true;
-       p->hird_threshold_en = true;
-       p->hird_threshold = 4;
+       p->lpm = hw->lpm_mode;
+       if (p->lpm) {
+               p->lpm_clock_gating = true;
+               p->besl = true;
+               p->hird_threshold_en = true;
+               p->hird_threshold = 4;
+       } else {
+               p->lpm_clock_gating = false;
+               p->besl = false;
+               p->hird_threshold_en = false;
+       }
         p->ipg_isoc_en = false;
         p->service_interval = false;
         p->max_packet_count = hw->max_packet_count;



Thanks,
Minas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc2: suppress confusing warnings on BCM2835
  2019-02-21  7:34 ` Minas Harutyunyan
@ 2019-03-01 19:39   ` Stefan Wahren
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Wahren @ 2019-03-01 19:39 UTC (permalink / raw)
  To: Minas Harutyunyan, Greg Kroah-Hartman
  Cc: Felipe Balbi, linux-usb, linux-arm-kernel

Hi Minas,

sorry for the delay, i was too busy with other issues.

> Minas Harutyunyan <minas.harutyunyan@synopsys.com> hat am 21. Februar 2019 um 08:34 geschrieben:
> 
> 
> Hi Stefan,
> 
> On 2/19/2019 10:23 PM, Stefan Wahren wrote:
> > According to the BCM2835 datasheet the used Synopsys IP isn't a LPM-capable
> > core. So disable these features and suppress these confusing warnings:
> > 
> > dwc2 3f980000.usb: dwc2_check_params: Invalid parameter lpm=1
> > dwc2 3f980000.usb: dwc2_check_params: Invalid parameter lpm_clock_gating=1
> > dwc2 3f980000.usb: dwc2_check_params: Invalid parameter besl=1
> > dwc2 3f980000.usb: dwc2_check_params: Invalid parameter hird_threshold_en=1
> > 
> > Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> > ---
> >   drivers/usb/dwc2/params.c | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
> > index 24ff5f2..a158abb 100644
> > --- a/drivers/usb/dwc2/params.c
> > +++ b/drivers/usb/dwc2/params.c
> > @@ -47,6 +47,10 @@ static void dwc2_set_bcm_params(struct dwc2_hsotg *hsotg)
> >   	p->max_transfer_size = 65535;
> >   	p->max_packet_count = 511;
> >   	p->ahbcfg = 0x10;
> > +	p->lpm = false;
> > +	p->lpm_clock_gating = false;
> > +	p->besl = false;
> > +	p->hird_threshold_en = false;
> >   }
> >   
> >   static void dwc2_set_his_params(struct dwc2_hsotg *hsotg)
> > 
> 
> What about to apply below patch:

yes, this is a more general solution.

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>

> 
> 
> diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c
> index c1912627a032..6b86aa42f003 100644
> --- a/drivers/usb/dwc2/params.c
> +++ b/drivers/usb/dwc2/params.c
> @@ -303,11 +303,17 @@ static void dwc2_set_default_params(struct 
> dwc2_hsotg *hsotg)
>          p->reload_ctl = (hw->snpsid >= DWC2_CORE_REV_2_92a);
>          p->uframe_sched = true;
>          p->external_id_pin_ctl = false;
> -       p->lpm = true;
> -       p->lpm_clock_gating = true;
> -       p->besl = true;
> -       p->hird_threshold_en = true;
> -       p->hird_threshold = 4;
> +       p->lpm = hw->lpm_mode;
> +       if (p->lpm) {
> +               p->lpm_clock_gating = true;
> +               p->besl = true;
> +               p->hird_threshold_en = true;
> +               p->hird_threshold = 4;
> +       } else {
> +               p->lpm_clock_gating = false;
> +               p->besl = false;
> +               p->hird_threshold_en = false;
> +       }
>          p->ipg_isoc_en = false;
>          p->service_interval = false;
>          p->max_packet_count = hw->max_packet_count;
> 
> 
> 
> Thanks,
> Minas
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-01 19:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 18:22 [PATCH] usb: dwc2: suppress confusing warnings on BCM2835 Stefan Wahren
2019-02-21  7:34 ` Minas Harutyunyan
2019-03-01 19:39   ` Stefan Wahren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).