diff mbox

[U-Boot,v7,2/4] EHCI: add callback ehci_fixup

Message ID 1317162078-8041-1-git-send-email-fermata7@gmail.com
State Superseded
Headers show

Commit Message

Jana Rapava Sept. 27, 2011, 10:21 p.m. UTC
Add callback to ehci_fixup to prepare
for solving the problem with VBUS reset on Efika.

Signed-off-by: Jana Rapava <fermata7@gmail.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Remy Bohmer <linux@bohmer.net>
Cc: Stefano Babic <sbabic@denx.de>
---
Changes for v1:
    - split into patchset
    - add callback ehci_fixup
Changes for v2:
      - make this the second patch in series
      - add comment to alias ehci_fixup
Changes for v3:
       - make the comment a sentence
       - rebase patch on top of u-boot-imx/next
Changes for v4:
	- change the versioning of changelog
	from per patchset to per patch
	- fix the appearance of comment

 drivers/usb/host/ehci-hcd.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

Comments

Marek Vasut Sept. 28, 2011, 12:46 a.m. UTC | #1
> Add callback to ehci_fixup

Dear Jana Rapava,

you mean ehci-hcd.c ?

 to prepare
> for solving the problem with VBUS reset on Efika.
> 
> Signed-off-by: Jana Rapava <fermata7@gmail.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Remy Bohmer <linux@bohmer.net>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> Changes for v1:
>         - split into patchset
>         - add callback ehci_fixup
> Changes for v2:
>             - make this the second patch in series
>             - add comment to alias ehci_fixup
> Changes for v3:
>               - make the comment a sentence
>               - rebase patch on top of u-boot-imx/next
> Changes for v4:
>     - change the versioning of changelog
>     from per patchset to per patch
>     - fix the appearance of comment

so this is a resend?

> 
>   drivers/usb/host/ehci-hcd.c |     13 ++++++++++++-
>   1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index bdadd46..ef0c578 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -536,6 +536,17 @@ static inline int min3(int a, int b, int c)
>       return a;
>   }

> +inline void __ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
> +{
> +    wait_ms(50);
> +}
> +/*
> + * this function will alias to __ehci_fixup,
> + * unless function ehci_fixup is defined somewhere

mske this a sentence please ... 'this is a default behaviour unless the user redefines this ...', Something along those lines, be creative.

> + */
> +void ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
> +     __attribute__((weak, alias("__ehci_fixup")));
> +
>   int
>   ehci_submit_root(struct usb_device *dev, unsigned long pipe, void
> *buffer,          int length, struct devrequest *req)
> @@ -709,7 +720,7 @@ ehci_submit_root(struct usb_device *dev, unsigned
> long pipe, void *buffer,                  * usb 2.0 specification say 50 ms resets on
>                    * root
>                    */
> -                wait_ms(50);
> +                ehci_fixup(status_reg, &reg);
>                   /* terminate the reset */
>                   ehci_writel(status_reg, reg & ~EHCI_PS_PR);
>                   /*
> -- 
> 1.7.6.3
>
Marek Vasut Sept. 28, 2011, 10:54 a.m. UTC | #2
On Wednesday, September 28, 2011 12:21:16 AM Jana Rapava wrote:
> Add callback to ehci_fixup to prepare
> for solving the problem with VBUS reset on Efika.
> 
> Signed-off-by: Jana Rapava <fermata7@gmail.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Remy Bohmer <linux@bohmer.net>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
> Changes for v1:
>     - split into patchset
>     - add callback ehci_fixup
> Changes for v2:
>       - make this the second patch in series
>       - add comment to alias ehci_fixup
> Changes for v3:
>        - make the comment a sentence
>        - rebase patch on top of u-boot-imx/next
> Changes for v4:
> 	- change the versioning of changelog
> 	from per patchset to per patch
> 	- fix the appearance of comment
> 

Sentence -- starts with a capital letter and ends with a dot ... please fix 
already. Otherwise:

Acked-by: Marek Vasut <marek.vasut@gmail.com>

(please add this line to the final revision of this patch.)
Jana Rapava Sept. 28, 2011, 11:52 a.m. UTC | #3
> Otherwise:
> Acked-by: Marek Vasut <marek.vasut@gmail.com>
>
> (please add this line to the final revision of this patch.)
>

Thanks, should I add this line also to the first two patches of this
patchset? There weren't any change requests for the last version of them.

Regards,
Jana Rapava
Marek Vasut Sept. 28, 2011, 12:13 p.m. UTC | #4
On Wednesday, September 28, 2011 01:52:39 PM Jana Rapava wrote:
> > Otherwise:
> > Acked-by: Marek Vasut <marek.vasut@gmail.com>
> > 
> > (please add this line to the final revision of this patch.)
> 
> Thanks, should I add this line also to the first two patches of this
> patchset? There weren't any change requests for the last version of them.

This is 2/4 patch ... how can there be "first two patches" ? Am I missing 
something ? Ok, this is starting to be a mess, can you resubmit the whole series 
? And no, add Acked-by only to Acked-by patches.

Cheers
> 
> Regards,
> Jana Rapava
diff mbox

Patch

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index bdadd46..ef0c578 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -536,6 +536,17 @@  static inline int min3(int a, int b, int c)
 	return a;
 }
 
+inline void __ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
+{
+	wait_ms(50);
+}
+/*
+ * this function will alias to __ehci_fixup,
+ * unless function ehci_fixup is defined somewhere
+ */
+void ehci_fixup(uint32_t *status_reg, uint32_t *reg_ref)
+	 __attribute__((weak, alias("__ehci_fixup")));
+
 int
 ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 		 int length, struct devrequest *req)
@@ -709,7 +720,7 @@  ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 				 * usb 2.0 specification say 50 ms resets on
 				 * root
 				 */
-				wait_ms(50);
+				ehci_fixup(status_reg, &reg);
 				/* terminate the reset */
 				ehci_writel(status_reg, reg & ~EHCI_PS_PR);
 				/*