Skip to contentSkip to conversation

dm: Disable all SPI and SPI flash tests

PATCH New Simon Glass 3 participants 12 messages Jan 3, 2016 – Jan 8, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 dm: Disable all SPI and SPI flash tests

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.

---

 test/dm/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
test/dm/Makefile +2 -2
index 681c6ae..3ff1b75 100644
@@ -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
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#1 lore raw

PATCH 1/3 dm: Disable all SPI and SPI flash tests

Quoted 4 lines · Simon Glass

This subsystem has been broken since commit:

4efad20a sf: Update status reg check in spi_flash_cmd_wait_ready

Quoted 8 lines

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

---

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

Applied to u-boot-dm/master.

#2 lore raw

PATCH 2/3 usb: Allow up to 7 storage devices

In reply to Simon Glass

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.

---

 common/usb_storage.c | 2 +-
 include/usb.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/usb_storage.c +1 -1
index 4fa6538..e61a8c8 100644
@@ -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];
include/usb.h +1 -1
index 55b9268..7d6ad70 100644
@@ -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);
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#3 lore raw

PATCH 2/3 usb: Allow up to 7 storage devices

Quoted 7 lines · Simon Glass

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.

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

Quoted 32 lines

---

 common/usb_storage.c | 2 +-
 include/usb.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/usb_storage.c +1 -1
index 4fa6538..e61a8c8 100644
@@ -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];
include/usb.h +1 -1
index 55b9268..7d6ad70 100644
@@ -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);
Quoted 1 line

int usb_stor_info(void);

Best regards,
Marek Vasut

#4 lore raw

PATCH 2/3 usb: Allow up to 7 storage devices

Quoted 41 lines · Marek Vasut
Quoted 7 lines · Simon Glass

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.

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

Quoted 28 lines

---

 common/usb_storage.c | 2 +-
 include/usb.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/usb_storage.c +1 -1
index 4fa6538..e61a8c8 100644
@@ -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];
include/usb.h +0 -0
index 55b9268..7d6ad70 100644
@@ -227,7 +227,7 @@ int board_usb_cleanup(int index, enum usb_init_type
 init);
 
 #ifdef CONFIG_USB_STORAGE
 
Quoted 8 lines
Quoted 5 lines
include/usb.h +1 -1
-#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.

#5 lore raw

PATCH 2/3 usb: Allow up to 7 storage devices

In reply to Marek Vasut
Quoted 5 lines · Marek Vasut
Quoted 4 lines · Simon Glass

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.

Quoted 7 lines
Quoted 3 lines

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

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

OK, how about this:

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

Quoted 37 lines
Quoted 33 lines

---

 common/usb_storage.c | 2 +-
 include/usb.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
common/usb_storage.c +1 -1
index 4fa6538..e61a8c8 100644
@@ -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];
include/usb.h +1 -1
index 55b9268..7d6ad70 100644
@@ -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);
Quoted 1 line

int usb_stor_info(void);

Best regards,
Marek Vasut

#6 lore raw

PATCH 2/3 usb: Allow up to 7 storage devices

Quoted 10 lines · Simon Glass
Quoted 9 lines · Marek Vasut
Quoted 7 lines · Simon Glass

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.

Quoted 7 lines
Quoted 3 lines

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

#7 lore raw

PATCH 3/3 dm: usb: Add a remove() method for USB keyboards

In reply to Simon Glass

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

---

 common/usb_kbd.c | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
common/usb_kbd.c +36 -0
index 9617a48..7bcab1c 100644
@@ -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[] = {
Signature · 1 line
2.6.0.rc2.230.g3dd15c0
#9 lore raw

PATCH 3/3 dm: usb: Add a remove() method for USB keyboards

In reply to Simon Glass

Hi Simon,

Quoted 4 lines · Simon Glass

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

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

-Joe

#10 lore raw

PATCH 3/3 dm: usb: Add a remove() method for USB keyboards

Hi Joe,

Quoted 5 lines · Joe Hershberger

Hi Simon,

Quoted 1 line · Simon Glass

At present USB keyboards are not properly removed with driver model.

Add the

Quoted 6 lines
Quoted 3 lines

code to handle this.

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

Yes, with the other patches.

Quoted 2 lines

-Joe

Regards,
Simon

#11 lore raw

PATCH 3/3 dm: usb: Add a remove() method for USB keyboards

Quoted 11 lines · Simon Glass

Hi Joe,

Quoted 8 lines · Joe Hershberger

Hi Simon,

Quoted 4 lines · Simon Glass

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

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

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

Yes, with the other patches.

Quoted 2 lines

-Joe

Fixed up a typo and:

Applied to u-boot-dm/master.