[PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-09-30 Thread dinguyen
From: Dinh Nguyen The variable host_channels of dwc2_hw_params struct is only 4-bits. Adding a 1 to a 0xf results in a 0 for host_channels. Thus, the driver was always thinking it had 0 host channels. Represent the correct number of host channels by using the host_channels variable of dwc2_core_

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-09-30 Thread Dan Carpenter
On Mon, Sep 30, 2013 at 05:05:23PM -0500, dingu...@altera.com wrote: > From: Dinh Nguyen > > The variable host_channels of dwc2_hw_params struct is only 4-bits. Adding > a 1 to a 0xf results in a 0 for host_channels. Thus, the driver was always > thinking it had 0 host channels. > > Represent th

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-09-30 Thread Dinh Nguyen
On Tue, 2013-10-01 at 01:25 +0300, Dan Carpenter wrote: > On Mon, Sep 30, 2013 at 05:05:23PM -0500, dingu...@altera.com wrote: > > From: Dinh Nguyen > > > > The variable host_channels of dwc2_hw_params struct is only 4-bits. Adding > > a 1 to a 0xf results in a 0 for host_channels. Thus, the driv

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-09-30 Thread Dinh Nguyen
Hi Dan, On Tue, 2013-10-01 at 01:25 +0300, Dan Carpenter wrote: > On Mon, Sep 30, 2013 at 05:05:23PM -0500, dingu...@altera.com wrote: > > From: Dinh Nguyen > > > > The variable host_channels of dwc2_hw_params struct is only 4-bits. Adding > > a 1 to a 0xf results in a 0 for host_channels. Thus,

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-09-30 Thread Dan Carpenter
Yeah. I guess it's fine... I was going to suggest adding the + 1 in a different place but actually it doesn't matter. The key to understanding dwc2_set_param_host_channels() is that the "val" parameter is always -1. That means it always returns -EINVAL and the caller jumbles the error code in w

RE: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-09-30 Thread Paul Zimmerman
> From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Monday, September 30, 2013 6:09 PM > > Yeah. I guess it's fine... I was going to suggest adding the + 1 in a > different place but actually it doesn't matter. > > The key to understanding dwc2_set_param_host_channels() is that the

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Dan Carpenter
On Tue, Oct 01, 2013 at 01:21:28AM +, Paul Zimmerman wrote: > > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > > Sent: Monday, September 30, 2013 6:09 PM > > > > Yeah. I guess it's fine... I was going to suggest adding the + 1 in a > > different place but actually it doesn't matter.

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Matthijs Kooijman
On Tue, Oct 01, 2013 at 10:05:17AM +0300, Dan Carpenter wrote: > On Tue, Oct 01, 2013 at 01:21:28AM +, Paul Zimmerman wrote: > > > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > > > Sent: Monday, September 30, 2013 6:09 PM > > > > > > Yeah. I guess it's fine... I was going to sugges

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Dan Carpenter
On Tue, Oct 01, 2013 at 09:51:07AM +0200, Matthijs Kooijman wrote: > On Tue, Oct 01, 2013 at 10:05:17AM +0300, Dan Carpenter wrote: > > On Tue, Oct 01, 2013 at 01:21:28AM +, Paul Zimmerman wrote: > > > > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > > > > Sent: Monday, September 30, 2

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Dinh Nguyen
Hi Dan, On 10/1/13 3:23 AM, Dan Carpenter wrote: On Tue, Oct 01, 2013 at 09:51:07AM +0200, Matthijs Kooijman wrote: On Tue, Oct 01, 2013 at 10:05:17AM +0300, Dan Carpenter wrote: On Tue, Oct 01, 2013 at 01:21:28AM +, Paul Zimmerman wrote: From: Dan Carpenter [mailto:dan.carpen...@oracle.c

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Matthijs Kooijman
Hi Dinh, > >Somehow I assumed that was fixed by the hardware, but I see now that you > >are right. Yes, making the definition larger is better than moving the > >+ 1. > This was my original fix to the problem, but I thought that it would > be confusing when reading the code. I also thought about

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Dinh Nguyen
Hi Matthijs, On 10/1/13 6:08 AM, Matthijs Kooijman wrote: Hi Dinh, Somehow I assumed that was fixed by the hardware, but I see now that you are right. Yes, making the definition larger is better than moving the + 1. This was my original fix to the problem, but I thought that it would be conf

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Dinh Nguyen
Hi Matthijs, On 10/1/13 6:08 AM, Matthijs Kooijman wrote: Hi Dinh, Somehow I assumed that was fixed by the hardware, but I see now that you are right. Yes, making the definition larger is better than moving the + 1. This was my original fix to the problem, but I thought that it would be conf

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Dan Carpenter
On Tue, Oct 01, 2013 at 06:26:29AM -0500, Dinh Nguyen wrote: > [resend]: previous reply didn't include Matthijs > He sets his Mail-Followup-To: so that we don't CC him on replies. I assume it's deliberate because he only wants the copy from the mailing list? regards, dan carpenter

Re: [PATCHv2] staging: dwc2: Fix code that gets the nummber of host channels

2013-10-01 Thread Matthijs Kooijman
Hey Dan, Dinh, > > [resend]: previous reply didn't include Matthijs > > > > He sets his Mail-Followup-To: so that we don't CC him on replies. I > assume it's deliberate because he only wants the copy from the mailing > list? Exactly, I just set that for whatever mailing list I subscribe to. How