public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests
@ 2016-01-03 20:50 Simon Glass
  2016-01-03 20:50 ` [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Simon Glass @ 2016-01-03 20:50 UTC (permalink / raw)
  To: u-boot

This subsystem has been broken since commit:

  4efad20a  sf: Update status reg check in spi_flash_cmd_wait_ready

There has so far been no response from the maintainer, and a release is
imminent. For now, let's just disable the tests.

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

 test/dm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/dm/Makefile b/test/dm/Makefile
index 681c6ae..3ff1b75 100644
--- a/test/dm/Makefile
+++ b/test/dm/Makefile
@@ -27,8 +27,8 @@ obj-y += regmap.o
 obj-$(CONFIG_REMOTEPROC) += remoteproc.o
 obj-$(CONFIG_RESET) += reset.o
 obj-$(CONFIG_DM_RTC) += rtc.o
-obj-$(CONFIG_DM_SPI_FLASH) += sf.o
-obj-$(CONFIG_DM_SPI) += spi.o
+#obj-$(CONFIG_DM_SPI_FLASH) += sf.o
+#obj-$(CONFIG_DM_SPI) += spi.o
 obj-y += syscon.o
 obj-$(CONFIG_DM_USB) += usb.o
 obj-$(CONFIG_DM_PMIC) += pmic.o
-- 
2.6.0.rc2.230.g3dd15c0

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

* [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices
  2016-01-03 20:50 [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass
@ 2016-01-03 20:50 ` Simon Glass
  2016-01-03 21:23   ` Marek Vasut
  2016-01-03 20:50 ` [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards Simon Glass
  2016-01-07 19:23 ` [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass
  2 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2016-01-03 20:50 UTC (permalink / raw)
  To: u-boot

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(-)

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);
-- 
2.6.0.rc2.230.g3dd15c0

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

* [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards
  2016-01-03 20:50 [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass
  2016-01-03 20:50 ` [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices Simon Glass
@ 2016-01-03 20:50 ` Simon Glass
  2016-01-03 21:22   ` Marek Vasut
  2016-01-04  4:04   ` Joe Hershberger
  2016-01-07 19:23 ` [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass
  2 siblings, 2 replies; 12+ messages in thread
From: Simon Glass @ 2016-01-03 20:50 UTC (permalink / raw)
  To: u-boot

At present USB keyboards are not properly removed with driver model. Add the
code to handle this.

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

 common/usb_kbd.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 9617a48..7bcab1c 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -611,6 +611,41 @@ static int usb_kbd_probe(struct udevice *dev)
 	return ret;
 }
 
+static int usb_kbd_remove(struct udevice *dev)
+{
+	struct usb_device *udev = dev_get_parent_priv(dev);
+	struct usb_kbd_pdata *data;
+	struct stdio_dev *sdev;
+	int ret;
+
+	sdev = stdio_get_by_name(DEVNAME);
+	if (!sdev) {
+		ret = -ENXIO;
+		goto err;
+	}
+	data = udev->privptr;
+	if (stdio_deregister_dev(sdev, true)) {
+		ret = -EPERM;
+		goto err;
+	}
+#ifdef CONFIG_CONSOLE_MUX
+	if (iomux_doenv(stdin, getenv("stdin"))) {
+		ret = -ENOLINK;
+		goto err;
+	}
+#endif
+#ifdef CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE
+	destroy_int_queue(usb_kbd_dev, data->intq);
+#endif
+	free(data->new);
+	free(data);
+
+	return 0;
+err:
+	printf("%s: warning, ret=%d", __func__, ret);
+	return ret;
+}
+
 static const struct udevice_id usb_kbd_ids[] = {
 	{ .compatible = "usb-keyboard" },
 	{ }
@@ -621,6 +656,7 @@ U_BOOT_DRIVER(usb_kbd) = {
 	.id	= UCLASS_KEYBOARD,
 	.of_match = usb_kbd_ids,
 	.probe = usb_kbd_probe,
+	.remove = usb_kbd_remove,
 };
 
 static const struct usb_device_id kbd_id_table[] = {
-- 
2.6.0.rc2.230.g3dd15c0

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

* [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards
  2016-01-03 20:50 ` [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards Simon Glass
@ 2016-01-03 21:22   ` Marek Vasut
  2016-01-04  4:04   ` Joe Hershberger
  1 sibling, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2016-01-03 21:22 UTC (permalink / raw)
  To: u-boot

On Sunday, January 03, 2016 at 09:50:31 PM, Simon Glass wrote:
> At present USB keyboards are not properly removed with driver model. Add
> the code to handle this.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

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

Best regards,
Marek Vasut

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

* [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices
  2016-01-03 20:50 ` [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices Simon Glass
@ 2016-01-03 21:23   ` Marek Vasut
  2016-01-07 19:23     ` Simon Glass
  2016-01-08  3:34     ` Simon Glass
  0 siblings, 2 replies; 12+ messages in thread
From: Marek Vasut @ 2016-01-03 21:23 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards
  2016-01-03 20:50 ` [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards Simon Glass
  2016-01-03 21:22   ` Marek Vasut
@ 2016-01-04  4:04   ` Joe Hershberger
  2016-01-04  4:08     ` Simon Glass
  1 sibling, 1 reply; 12+ messages in thread
From: Joe Hershberger @ 2016-01-04  4:04 UTC (permalink / raw)
  To: u-boot

Hi Simon,

On Sun, Jan 3, 2016 at 2:50 PM, Simon Glass <sjg@chromium.org> wrote:
> At present USB keyboards are not properly removed with driver model. Add the
> code to handle this.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Is this supposed to fix the crash that I was reporting details about
in the USB keyboard sandbox tests?

-Joe

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

* [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards
  2016-01-04  4:04   ` Joe Hershberger
@ 2016-01-04  4:08     ` Simon Glass
  2016-01-07 19:23       ` Simon Glass
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Glass @ 2016-01-04  4:08 UTC (permalink / raw)
  To: u-boot

Hi Joe,

On Jan 3, 2016 9:04 PM, "Joe Hershberger" <joe.hershberger@gmail.com> wrote:
>
> Hi Simon,
>
> On Sun, Jan 3, 2016 at 2:50 PM, Simon Glass <sjg@chromium.org> wrote:
> > At present USB keyboards are not properly removed with driver model.
Add the
> > code to handle this.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
>
> Is this supposed to fix the crash that I was reporting details about
> in the USB keyboard sandbox tests?

Yes, with the other patches.

>
> -Joe

Regards,
Simon

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

* [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests
  2016-01-03 20:50 [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass
  2016-01-03 20:50 ` [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices Simon Glass
  2016-01-03 20:50 ` [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards Simon Glass
@ 2016-01-07 19:23 ` Simon Glass
  2 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2016-01-07 19:23 UTC (permalink / raw)
  To: u-boot

On 3 January 2016 at 13:50, Simon Glass <sjg@chromium.org> wrote:
> This subsystem has been broken since commit:
>
>   4efad20a  sf: Update status reg check in spi_flash_cmd_wait_ready
>
> There has so far been no response from the maintainer, and a release is
> imminent. For now, let's just disable the tests.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  test/dm/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to u-boot-dm/master.

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

* [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices
  2016-01-03 21:23   ` Marek Vasut
@ 2016-01-07 19:23     ` Simon Glass
  2016-01-08  3:34     ` Simon Glass
  1 sibling, 0 replies; 12+ messages in thread
From: Simon Glass @ 2016-01-07 19:23 UTC (permalink / raw)
  To: u-boot

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.

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

* [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards
  2016-01-04  4:08     ` Simon Glass
@ 2016-01-07 19:23       ` Simon Glass
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Glass @ 2016-01-07 19:23 UTC (permalink / raw)
  To: u-boot

On 3 January 2016 at 21:08, Simon Glass <sjg@chromium.org> wrote:
> Hi Joe,
>
> On Jan 3, 2016 9:04 PM, "Joe Hershberger" <joe.hershberger@gmail.com> wrote:
>>
>> Hi Simon,
>>
>> On Sun, Jan 3, 2016 at 2:50 PM, Simon Glass <sjg@chromium.org> wrote:
>> > At present USB keyboards are not properly removed with driver model. Add
>> > the
>> > code to handle this.
>> >
>> > Signed-off-by: Simon Glass <sjg@chromium.org>
>>
>> Is this supposed to fix the crash that I was reporting details about
>> in the USB keyboard sandbox tests?
>
> Yes, with the other patches.
>
>>
>> -Joe

Fixed up a typo and:

Applied to u-boot-dm/master.

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

* [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices
  2016-01-03 21:23   ` Marek Vasut
  2016-01-07 19:23     ` Simon Glass
@ 2016-01-08  3:34     ` Simon Glass
  2016-01-08 12:10       ` Marek Vasut
  1 sibling, 1 reply; 12+ messages in thread
From: Simon Glass @ 2016-01-08  3:34 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices
  2016-01-08  3:34     ` Simon Glass
@ 2016-01-08 12:10       ` Marek Vasut
  0 siblings, 0 replies; 12+ messages in thread
From: Marek Vasut @ 2016-01-08 12:10 UTC (permalink / raw)
  To: u-boot

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

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

end of thread, other threads:[~2016-01-08 12:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-03 20:50 [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass
2016-01-03 20:50 ` [U-Boot] [PATCH 2/3] usb: Allow up to 7 storage devices Simon Glass
2016-01-03 21:23   ` Marek Vasut
2016-01-07 19:23     ` Simon Glass
2016-01-08  3:34     ` Simon Glass
2016-01-08 12:10       ` Marek Vasut
2016-01-03 20:50 ` [U-Boot] [PATCH 3/3] dm: usb: Add a remove() method for USB keyboards Simon Glass
2016-01-03 21:22   ` Marek Vasut
2016-01-04  4:04   ` Joe Hershberger
2016-01-04  4:08     ` Simon Glass
2016-01-07 19:23       ` Simon Glass
2016-01-07 19:23 ` [U-Boot] [PATCH 1/3] dm: Disable all SPI and SPI flash tests Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox