diff mbox

[U-Boot,2/3] usb: Allow up to 7 storage devices

Message ID 1451854231-20916-2-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass Jan. 3, 2016, 8:50 p.m. UTC
The current limit of 5 is not enough for the driver model USB tests. Really
we should not have a limit but the driver model code still uses the
usb_dev_desc[] array, which has a limit.

Increasing the limit by 2 should not bother anyone. Adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 common/usb_storage.c | 2 +-
 include/usb.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Marek Vasut Jan. 3, 2016, 9:23 p.m. UTC | #1
On Sunday, January 03, 2016 at 09:50:30 PM, Simon Glass wrote:
> The current limit of 5 is not enough for the driver model USB tests. Really
> we should not have a limit but the driver model code still uses the
> usb_dev_desc[] array, which has a limit.
> 
> Increasing the limit by 2 should not bother anyone. Adjust it.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Marek Vasut <marex@denx.de>

btw moving this constant to one place would be nice ;)

> ---
> 
>  common/usb_storage.c | 2 +-
>  include/usb.h        | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index 4fa6538..e61a8c8 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -65,7 +65,7 @@ static const unsigned char us_direction[256/8] = {
>  static ccb usb_ccb __attribute__((aligned(ARCH_DMA_MINALIGN)));
>  static __u32 CBWTag;
> 
> -#define USB_MAX_STOR_DEV 5
> +#define USB_MAX_STOR_DEV 7
>  static int usb_max_devs; /* number of highest available usb device */
> 
>  static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
> diff --git a/include/usb.h b/include/usb.h
> index 55b9268..7d6ad70 100644
> --- a/include/usb.h
> +++ b/include/usb.h
> @@ -227,7 +227,7 @@ int board_usb_cleanup(int index, enum usb_init_type
> init);
> 
>  #ifdef CONFIG_USB_STORAGE
> 
> -#define USB_MAX_STOR_DEV 5
> +#define USB_MAX_STOR_DEV 7
>  block_dev_desc_t *usb_stor_get_dev(int index);
>  int usb_stor_scan(int mode);
>  int usb_stor_info(void);

Best regards,
Marek Vasut
Simon Glass Jan. 7, 2016, 7:23 p.m. UTC | #2
On 3 January 2016 at 14:23, Marek Vasut <marex@denx.de> wrote:
> On Sunday, January 03, 2016 at 09:50:30 PM, Simon Glass wrote:
>> The current limit of 5 is not enough for the driver model USB tests. Really
>> we should not have a limit but the driver model code still uses the
>> usb_dev_desc[] array, which has a limit.
>>
>> Increasing the limit by 2 should not bother anyone. Adjust it.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Reviewed-by: Marek Vasut <marex@denx.de>
>
> btw moving this constant to one place would be nice ;)
>
>> ---
>>
>>  common/usb_storage.c | 2 +-
>>  include/usb.h        | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/usb_storage.c b/common/usb_storage.c
>> index 4fa6538..e61a8c8 100644
>> --- a/common/usb_storage.c
>> +++ b/common/usb_storage.c
>> @@ -65,7 +65,7 @@ static const unsigned char us_direction[256/8] = {
>>  static ccb usb_ccb __attribute__((aligned(ARCH_DMA_MINALIGN)));
>>  static __u32 CBWTag;
>>
>> -#define USB_MAX_STOR_DEV 5
>> +#define USB_MAX_STOR_DEV 7
>>  static int usb_max_devs; /* number of highest available usb device */
>>
>>  static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
>> diff --git a/include/usb.h b/include/usb.h
>> index 55b9268..7d6ad70 100644
>> --- a/include/usb.h
>> +++ b/include/usb.h
>> @@ -227,7 +227,7 @@ int board_usb_cleanup(int index, enum usb_init_type
>> init);
>>
>>  #ifdef CONFIG_USB_STORAGE
>>
>> -#define USB_MAX_STOR_DEV 5
>> +#define USB_MAX_STOR_DEV 7
>>  block_dev_desc_t *usb_stor_get_dev(int index);
>>  int usb_stor_scan(int mode);
>>  int usb_stor_info(void);
>
> Best regards,
> Marek Vasut

Applied to u-boot-dm/master.
Simon Glass Jan. 8, 2016, 3:34 a.m. UTC | #3
On 3 January 2016 at 14:23, Marek Vasut <marex@denx.de> wrote:
> On Sunday, January 03, 2016 at 09:50:30 PM, Simon Glass wrote:
>> The current limit of 5 is not enough for the driver model USB tests. Really
>> we should not have a limit but the driver model code still uses the
>> usb_dev_desc[] array, which has a limit.
>>
>> Increasing the limit by 2 should not bother anyone. Adjust it.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Reviewed-by: Marek Vasut <marex@denx.de>
>
> btw moving this constant to one place would be nice ;)

OK, how about this:

http://patchwork.ozlabs.org/patch/564474/

>
>> ---
>>
>>  common/usb_storage.c | 2 +-
>>  include/usb.h        | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/common/usb_storage.c b/common/usb_storage.c
>> index 4fa6538..e61a8c8 100644
>> --- a/common/usb_storage.c
>> +++ b/common/usb_storage.c
>> @@ -65,7 +65,7 @@ static const unsigned char us_direction[256/8] = {
>>  static ccb usb_ccb __attribute__((aligned(ARCH_DMA_MINALIGN)));
>>  static __u32 CBWTag;
>>
>> -#define USB_MAX_STOR_DEV 5
>> +#define USB_MAX_STOR_DEV 7
>>  static int usb_max_devs; /* number of highest available usb device */
>>
>>  static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
>> diff --git a/include/usb.h b/include/usb.h
>> index 55b9268..7d6ad70 100644
>> --- a/include/usb.h
>> +++ b/include/usb.h
>> @@ -227,7 +227,7 @@ int board_usb_cleanup(int index, enum usb_init_type
>> init);
>>
>>  #ifdef CONFIG_USB_STORAGE
>>
>> -#define USB_MAX_STOR_DEV 5
>> +#define USB_MAX_STOR_DEV 7
>>  block_dev_desc_t *usb_stor_get_dev(int index);
>>  int usb_stor_scan(int mode);
>>  int usb_stor_info(void);
>
> Best regards,
> Marek Vasut
Marek Vasut Jan. 8, 2016, 12:10 p.m. UTC | #4
On Friday, January 08, 2016 at 04:34:27 AM, Simon Glass wrote:
> On 3 January 2016 at 14:23, Marek Vasut <marex@denx.de> wrote:
> > On Sunday, January 03, 2016 at 09:50:30 PM, Simon Glass wrote:
> >> The current limit of 5 is not enough for the driver model USB tests.
> >> Really we should not have a limit but the driver model code still uses
> >> the usb_dev_desc[] array, which has a limit.
> >> 
> >> Increasing the limit by 2 should not bother anyone. Adjust it.
> >> 
> >> Signed-off-by: Simon Glass <sjg@chromium.org>
> > 
> > Reviewed-by: Marek Vasut <marex@denx.de>
> > 
> > btw moving this constant to one place would be nice ;)
> 
> OK, how about this:
> 
> http://patchwork.ozlabs.org/patch/564474/

That's fine, thanks!

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/common/usb_storage.c b/common/usb_storage.c
index 4fa6538..e61a8c8 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -65,7 +65,7 @@  static const unsigned char us_direction[256/8] = {
 static ccb usb_ccb __attribute__((aligned(ARCH_DMA_MINALIGN)));
 static __u32 CBWTag;
 
-#define USB_MAX_STOR_DEV 5
+#define USB_MAX_STOR_DEV 7
 static int usb_max_devs; /* number of highest available usb device */
 
 static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
diff --git a/include/usb.h b/include/usb.h
index 55b9268..7d6ad70 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -227,7 +227,7 @@  int board_usb_cleanup(int index, enum usb_init_type init);
 
 #ifdef CONFIG_USB_STORAGE
 
-#define USB_MAX_STOR_DEV 5
+#define USB_MAX_STOR_DEV 7
 block_dev_desc_t *usb_stor_get_dev(int index);
 int usb_stor_scan(int mode);
 int usb_stor_info(void);