From: John.Youn@synopsys.com (John Youn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 RFC 1/6] usb: dwc2: core: Avoid nonsense error in gadget mode
Date: Mon, 15 Aug 2016 18:30:46 -0700 [thread overview]
Message-ID: <92280b0f-4dd3-bcf5-57ed-277a9f91653d@synopsys.com> (raw)
In-Reply-To: <1469559213-16160-2-git-send-email-stefan.wahren@i2se.com>
On 7/26/2016 11:54 AM, Stefan Wahren wrote:
> In gadget mode On bcm2835 platform the host tx fifo size could be zero.
> So add zero to range and avoid such nonsense errors:
>
> dwc2 20980000.usb: 0 invalid for host_nperio_tx_fifo_size.
> dwc2 20980000.usb: Setting host_nperio_tx_fifo_size to 0
> dwc2 20980000.usb: 0 invalid for host_perio_tx_fifo_size.
> dwc2 20980000.usb: Setting host_perio_tx_fifo_size to 0
Hi Stefan,
Are those the power on reset values of GNPTXFSIZ and HPTXFSIZ?
If these values can be 0, I think the patch is ok. But I'm not sure
about that. I can check with some hardware engineers to see under what
conditions this is possible.
Regards,
John
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> ---
> drivers/usb/dwc2/core.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
> index 4135a5f..5645528 100644
> --- a/drivers/usb/dwc2/core.c
> +++ b/drivers/usb/dwc2/core.c
> @@ -819,7 +819,10 @@ void dwc2_set_param_host_nperio_tx_fifo_size(struct dwc2_hsotg *hsotg, int val)
> {
> int valid = 1;
>
> - if (val < 16 || val > hsotg->hw_params.host_nperio_tx_fifo_size)
> + if (val && (val < 16))
> + valid = 0;
> +
> + if (val > hsotg->hw_params.host_nperio_tx_fifo_size)
> valid = 0;
>
> if (!valid) {
> @@ -839,7 +842,10 @@ void dwc2_set_param_host_perio_tx_fifo_size(struct dwc2_hsotg *hsotg, int val)
> {
> int valid = 1;
>
> - if (val < 16 || val > hsotg->hw_params.host_perio_tx_fifo_size)
> + if (val && (val < 16))
> + valid = 0;
> +
> + if (val > hsotg->hw_params.host_perio_tx_fifo_size)
> valid = 0;
>
> if (!valid) {
>
next prev parent reply other threads:[~2016-08-16 1:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-26 18:53 [PATCH V2 RFC 0/6] ARM: dts: bcm2835: Add Raspberry Pi Zero Stefan Wahren
2016-07-26 18:53 ` [PATCH V2 RFC 1/6] usb: dwc2: core: Avoid nonsense error in gadget mode Stefan Wahren
2016-08-16 1:30 ` John Youn [this message]
2016-08-16 16:22 ` Eric Anholt
2016-08-16 16:44 ` Stefan Wahren
2016-08-16 19:20 ` John Youn
2016-08-16 20:09 ` Stefan Wahren
2016-07-26 18:53 ` [PATCH V2 RFC 2/6] usb: dwc2: Add DT properties to specify fifo size in host/otg mode Stefan Wahren
2016-07-29 21:12 ` Rob Herring
2016-08-18 18:12 ` John Youn
2016-07-26 18:53 ` [PATCH V2 RFC 3/6] ARM: dts: bcm283x: Add missing usb clock Stefan Wahren
2016-07-26 18:53 ` [PATCH V2 RFC 4/6] ARM: dts: bcm283x: Add generic USB PHY Stefan Wahren
2016-07-26 18:53 ` [PATCH V2 RFC 5/6] DT: bindings: bcm: Add Raspberry Pi Zero Stefan Wahren
2016-07-29 21:13 ` Rob Herring
2016-07-26 18:53 ` [PATCH V2 RFC 6/6] ARM: dts: bcm2835: " Stefan Wahren
2016-08-02 17:19 ` Stephen Warren
2016-08-02 19:29 ` Stefan Wahren
2016-08-02 20:56 ` Stephen Warren
2016-08-16 19:30 ` John Youn
2016-08-16 19:58 ` Stefan Wahren
2016-08-16 22:07 ` John Youn
2016-08-17 19:11 ` Stefan Wahren
2016-08-17 21:21 ` John Youn
2016-08-17 22:17 ` Stefan Wahren
2016-08-18 18:03 ` John Youn
2016-08-18 19:04 ` Stefan Wahren
2016-08-18 19:34 ` John Youn
2016-08-18 18:14 ` [PATCH V2 RFC 0/6] " Eric Anholt
2016-08-18 18:57 ` Stefan Wahren
2016-08-19 0:37 ` Eric Anholt
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=92280b0f-4dd3-bcf5-57ed-277a9f91653d@synopsys.com \
--to=john.youn@synopsys.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox