diff mbox

[U-Boot,v5,05/15] dm: usb: Prefix ehci interrupt-queue functions with _ehci_

Message ID 1431259827-8109-6-git-send-email-hdegoede@redhat.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Hans de Goede May 10, 2015, 12:10 p.m. UTC
This is a preparation patch for adding interrupt-queue support to the
ehci dm code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Simon Glass <sjg@chromium.org>
---
 drivers/usb/host/ehci-hcd.c | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

Comments

Simon Glass May 10, 2015, 9:58 p.m. UTC | #1
Hi Hans,

On 10 May 2015 at 06:10, Hans de Goede <hdegoede@redhat.com> wrote:
> This is a preparation patch for adding interrupt-queue support to the
> ehci dm code.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---

I still see some sort of bisect problem here:

Summary of 16 commits for 33 boards (32 threads, 1 job per thread)
01: dm: sf: Update default name of spi flash in structure udevice
02: usb: Fix handover of full-speed devices from ehci to companion
03: usb: usb_control_msg() propagate controller error code
04: usb: legacy_hub_port_reset() check and propagate
usb_set_port_feature() errors
05: usb: Stop reset procedure when a dev is handed over to a companion hcd
06: dm: usb: Prefix ehci interrupt-queue functions with _ehci_
       arm:  +   odroid-xu3 snow arndale odroid
+drivers/usb/host/built-in.o: In function `_ehci_submit_int_msg':
+build/../drivers/usb/host/ehci-hcd.c:1518: undefined reference to
`create_int_queue'
+build/../drivers/usb/host/ehci-hcd.c:1523: undefined reference to
`poll_int_queue'
+build/../drivers/usb/host/ehci-hcd.c:1536: undefined reference to
`destroy_int_queue'
+arm-linux-gnueabihf-ld.bfd: BFD (crosstool-NG
linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 2.23.1
assertion fail /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/binutils-2.23.1/bfd/elf32-arm.c:7677
+arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not
found in the linker script
+arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
+make[1]: *** [u-boot] Error 1
+make: *** [sub-make] Error 2
w+../drivers/usb/host/ehci-hcd.c:1266:26: warning:
‘_ehci_create_int_queue’ defined but not used [-Wunused-function]
w+../drivers/usb/host/ehci-hcd.c:1424:14: warning:
‘_ehci_poll_int_queue’ defined but not used [-Wunused-function]
w+../drivers/usb/host/ehci-hcd.c:1460:12: warning:
‘_ehci_destroy_int_queue’ defined but not used [-Wunused-function]
07: dm: usb: Add support for interrupt queues to the dm usb code
       arm:     odroid-xu3 snow arndale odroid
-drivers/usb/host/built-in.o: In function `_ehci_submit_int_msg':
-build/../drivers/usb/host/ehci-hcd.c:1518: undefined reference to
`create_int_queue'
-build/../drivers/usb/host/ehci-hcd.c:1523: undefined reference to
`poll_int_queue'
-build/../drivers/usb/host/ehci-hcd.c:1536: undefined reference to
`destroy_int_queue'
-arm-linux-gnueabihf-ld.bfd: BFD (crosstool-NG
linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 2.23.1
assertion fail /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/binutils-2.23.1/bfd/elf32-arm.c:7677
-arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not
found in the linker script
-arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
-make[1]: *** [u-boot] Error 1
-make: *** [sub-make] Error 2
w-../drivers/usb/host/ehci-hcd.c:1266:26: warning:
‘_ehci_create_int_queue’ defined but not used [-Wunused-function]
w-../drivers/usb/host/ehci-hcd.c:1424:14: warning:
‘_ehci_poll_int_queue’ defined but not used [-Wunused-function]
w-../drivers/usb/host/ehci-hcd.c:1460:12: warning:
‘_ehci_destroy_int_queue’ defined but not used [-Wunused-function]
08: dm: usb: Move printing of usb scan status to usb_scan_bus()

Regards,
Simon
Hans de Goede May 11, 2015, 6:27 p.m. UTC | #2
Hi,

On 10-05-15 23:58, Simon Glass wrote:
> Hi Hans,
>
> On 10 May 2015 at 06:10, Hans de Goede <hdegoede@redhat.com> wrote:
>> This is a preparation patch for adding interrupt-queue support to the
>> ehci dm code.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> Acked-by: Simon Glass <sjg@chromium.org>
>> ---
>
> I still see some sort of bisect problem here:
>
> Summary of 16 commits for 33 boards (32 threads, 1 job per thread)
> 01: dm: sf: Update default name of spi flash in structure udevice
> 02: usb: Fix handover of full-speed devices from ehci to companion
> 03: usb: usb_control_msg() propagate controller error code
> 04: usb: legacy_hub_port_reset() check and propagate
> usb_set_port_feature() errors
> 05: usb: Stop reset procedure when a dev is handed over to a companion hcd
> 06: dm: usb: Prefix ehci interrupt-queue functions with _ehci_
>         arm:  +   odroid-xu3 snow arndale odroid
> +drivers/usb/host/built-in.o: In function `_ehci_submit_int_msg':
> +build/../drivers/usb/host/ehci-hcd.c:1518: undefined reference to
> `create_int_queue'
> +build/../drivers/usb/host/ehci-hcd.c:1523: undefined reference to
> `poll_int_queue'
> +build/../drivers/usb/host/ehci-hcd.c:1536: undefined reference to
> `destroy_int_queue'
> +arm-linux-gnueabihf-ld.bfd: BFD (crosstool-NG
> linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 2.23.1
> assertion fail /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/binutils-2.23.1/bfd/elf32-arm.c:7677
> +arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not
> found in the linker script
> +arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
> +make[1]: *** [u-boot] Error 1
> +make: *** [sub-make] Error 2
> w+../drivers/usb/host/ehci-hcd.c:1266:26: warning:
> ‘_ehci_create_int_queue’ defined but not used [-Wunused-function]
> w+../drivers/usb/host/ehci-hcd.c:1424:14: warning:
> ‘_ehci_poll_int_queue’ defined but not used [-Wunused-function]
> w+../drivers/usb/host/ehci-hcd.c:1460:12: warning:
> ‘_ehci_destroy_int_queue’ defined but not used [-Wunused-function]
> 07: dm: usb: Add support for interrupt queues to the dm usb code
>         arm:     odroid-xu3 snow arndale odroid
> -drivers/usb/host/built-in.o: In function `_ehci_submit_int_msg':
> -build/../drivers/usb/host/ehci-hcd.c:1518: undefined reference to
> `create_int_queue'
> -build/../drivers/usb/host/ehci-hcd.c:1523: undefined reference to
> `poll_int_queue'
> -build/../drivers/usb/host/ehci-hcd.c:1536: undefined reference to
> `destroy_int_queue'
> -arm-linux-gnueabihf-ld.bfd: BFD (crosstool-NG
> linaro-1.13.1-4.7-2013.04-20130415 - Linaro GCC 2013.04) 2.23.1
> assertion fail /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/binutils-2.23.1/bfd/elf32-arm.c:7677
> -arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not
> found in the linker script
> -arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
> -make[1]: *** [u-boot] Error 1
> -make: *** [sub-make] Error 2
> w-../drivers/usb/host/ehci-hcd.c:1266:26: warning:
> ‘_ehci_create_int_queue’ defined but not used [-Wunused-function]
> w-../drivers/usb/host/ehci-hcd.c:1424:14: warning:
> ‘_ehci_poll_int_queue’ defined but not used [-Wunused-function]
> w-../drivers/usb/host/ehci-hcd.c:1460:12: warning:
> ‘_ehci_destroy_int_queue’ defined but not used [-Wunused-function]
> 08: dm: usb: Move printing of usb scan status to usb_scan_bus()


Ah, looking closer at this I see the problem, _ehci_submit_int_msg()
is implemented by calling create/poll/destroy_int_queue. This is working
for CONFIG_DM_USB=y configs after my patchset by _ehci_submit_int_msg()
calling the usb-uclass.c implementations of these, which then call the
_ehci_ versions of them through the controller ops.

This does not work in the intermediate state with only this patch
applied because then the usb-uclass.c implementations do not yet exist.

I'll send a v6 of this patch making ehci_submit_int_msg() use the _ehci_
prefixed versions which is the right thing to do even without the git
bisect problem this causes.

Sorry about this.

Regards,

Hans
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index e4c462f..b6e965c 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1263,9 +1263,9 @@  disable_periodic(struct ehci_ctrl *ctrl)
 	return 0;
 }
 
-struct int_queue *
-create_int_queue(struct usb_device *dev, unsigned long pipe, int queuesize,
-		 int elementsize, void *buffer, int interval)
+static struct int_queue *_ehci_create_int_queue(struct usb_device *dev,
+			unsigned long pipe, int queuesize, int elementsize,
+			void *buffer, int interval)
 {
 	struct ehci_ctrl *ctrl = ehci_get_ctrl(dev);
 	struct int_queue *result = NULL;
@@ -1421,7 +1421,8 @@  fail1:
 	return NULL;
 }
 
-void *poll_int_queue(struct usb_device *dev, struct int_queue *queue)
+static void *_ehci_poll_int_queue(struct usb_device *dev,
+				  struct int_queue *queue)
 {
 	struct QH *cur = queue->current;
 	struct qTD *cur_td;
@@ -1456,8 +1457,8 @@  void *poll_int_queue(struct usb_device *dev, struct int_queue *queue)
 }
 
 /* Do not free buffers associated with QHs, they're owned by someone else */
-int
-destroy_int_queue(struct usb_device *dev, struct int_queue *queue)
+static int _ehci_destroy_int_queue(struct usb_device *dev,
+				   struct int_queue *queue)
 {
 	struct ehci_ctrl *ctrl = ehci_get_ctrl(dev);
 	int result = -1;
@@ -1558,6 +1559,24 @@  int submit_int_msg(struct usb_device *dev, unsigned long pipe,
 {
 	return _ehci_submit_int_msg(dev, pipe, buffer, length, interval);
 }
+
+struct int_queue *create_int_queue(struct usb_device *dev,
+		unsigned long pipe, int queuesize, int elementsize,
+		void *buffer, int interval)
+{
+	return _ehci_create_int_queue(dev, pipe, queuesize, elementsize,
+				      buffer, interval);
+}
+
+void *poll_int_queue(struct usb_device *dev, struct int_queue *queue)
+{
+	return _ehci_poll_int_queue(dev, queue);
+}
+
+int destroy_int_queue(struct usb_device *dev, struct int_queue *queue)
+{
+	return _ehci_destroy_int_queue(dev, queue);
+}
 #endif
 
 #ifdef CONFIG_DM_USB