ARM: pxa: Enable U2D only in case PXA3xx is enabled
Subsystems (2)
PATCH 1/1 ARM: pxa: Enable U2D only in case PXA3xx is enabled
In case PXA3xx support isn't enabled in kernel, the pxa3xx_u2d_start_hc() and pxa3xx_u2d_stop_hc() functions are undefined. Encapsulate their callings with #ifdef CONFIG_PXA3xx macro.
---
NOTE: I'm adding "Make a proper fix for this thing" into my ToDo. This is just a quick patch since I have that exam soon. I'll go for approach 2) from what we discussed in the other thread once the exam's past me.
drivers/usb/host/ohci-pxa27x.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/usb/host/ohci-pxa27x.c +4 -0
@@ -236,8 +236,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev)if (retval <0 )return retval; +#ifdef CONFIG_PXA3xxif (cpu_is_pxa3xx ())pxa3xx_u2d_start_hc (&ohci_to_hcd (&ohci->ohci)->self); +#endif uhchr =__raw_readl (ohci->mmio_base +UHCHR ) & ~UHCHR_SSE ;__raw_writel (uhchr, ohci->mmio_base +UHCHR );
@@ -255,8 +257,10 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev) inf = dev->platform_data; +#ifdef CONFIG_PXA3xxif (cpu_is_pxa3xx ())pxa3xx_u2d_stop_hc (&ohci_to_hcd (&ohci->ohci)->self); +#endif if (inf->exit) inf->exit (dev);
Signature · 1 line
1.7.1
PATCH 1/1 ARM: pxa: Enable U2D only in case PXA3xx is enabled
Quoted 4 lines · Marek Vasut
In case PXA3xx support isn't enabled in kernel, the
pxa3xx_u2d_start_hc()andpxa3xx_u2d_stop_hc()functions are undefined. Encapsulate their callings with #ifdefCONFIG_PXA3xxmacro.
This isn't necessary. cpu_is_pxa3xx() will expand to zero if CONFIG_PXA3xx isn't defined, and the whole if () statement will be optimized away by the compiler.
Quoted 40 lines
Signed-off-by Marek Vasut <[email protected]>---
NOTE: I'm adding "Make a proper fix for this thing" into my ToDo. This is just a quick patch since I have that exam soon. I'll go for approach 2) from what we discussed in the other thread once the exam's past me.
?drivers/usb/host/ohci-pxa27x.c | ? ?4 ++++
?1 files changed, 4 insertions(+), 0 deletions(-)drivers/usb/host/ohci-pxa27x.c +4
-1@@ -236,8 +236,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev) ? ? ? ?if (retval < 0) ? ? ? ? ? ? ? ?return retval; +#ifdef CONFIG_PXA3xx ? ? ? ?if (cpu_is_pxa3xx()) ? ? ? ? ? ? ? ?pxa3xx_u2d_start_hc(&ohci_to_hcd(&ohci->ohci)->self); +#endif ? ? ? ?uhchr = __raw_readl(ohci->mmio_base + UHCHR) & ~UHCHR_SSE; ? ? ? ?__raw_writel(uhchr, ohci->mmio_base + UHCHR);@@ -255,8 +257,10 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev) ? ? ? ?inf = dev->platform_data; +#ifdef CONFIG_PXA3xx ? ? ? ?if (cpu_is_pxa3xx()) ? ? ? ? ? ? ? ?pxa3xx_u2d_stop_hc(&ohci_to_hcd(&ohci->ohci)->self); +#endif ? ? ? ?if (inf->exit) ? ? ? ? ? ? ? ?inf->exit(dev); --1.7.1
PATCH 1/1 ARM: pxa: Enable U2D only in case PXA3xx is enabled
Quoted 8 lines · Eric Miao
Quoted 4 lines · Marek Vasut
In case PXA3xx support isn't enabled in kernel, the
pxa3xx_u2d_start_hc()andpxa3xx_u2d_stop_hc()functions are undefined. Encapsulate their callings with #ifdefCONFIG_PXA3xxmacro.This isn't necessary.
cpu_is_pxa3xx()will expand to zero ifCONFIG_PXA3xxisn't defined, and the whole if () statement will be optimized away by the compiler.
That was my intention, but I haven't checked if it really does the job.
Quoted 6 lines
Quoted 6 lines
Signed-off-by Marek Vasut <[email protected]>---
NOTE: I'm adding "Make a proper fix for this thing" into my ToDo. This is just a quick patch since I have that exam soon. I'll go for approach 2) from what we discussed in the other thread once the exam's past me.
I've already started working on this yesterday and I'll be glad to have the patch reviewed more carefully then the U2D series were (so we need to fix it right away).
Quoted 33 lines
Quoted 33 lines
drivers/usb/host/ohci-pxa27x.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/usb/host/ohci-pxa27x.c +4
-1@@ -236,8 +236,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev)if (retval <0 )return retval; +#ifdef CONFIG_PXA3xxif (cpu_is_pxa3xx ())pxa3xx_u2d_start_hc (&ohci_to_hcd (&ohci->ohci)->self); +#endif uhchr =__raw_readl (ohci->mmio_base +UHCHR ) & ~UHCHR_SSE ;__raw_writel (uhchr, ohci->mmio_base +UHCHR );@@ -255,8 +257,10 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev) inf = dev->platform_data; +#ifdef CONFIG_PXA3xxif (cpu_is_pxa3xx ())pxa3xx_u2d_stop_hc (&ohci_to_hcd (&ohci->ohci)->self); +#endif if (inf->exit) inf->exit (dev); --1.7.1
Signature · 2 lines
Regards, Igor.
PATCH 1/1 ARM: pxa: Enable U2D only in case PXA3xx is enabled
Quoted 11 lines · Igor Grinberg
Quoted 8 lines · Eric Miao
Quoted 4 lines · Marek Vasut
In case PXA3xx support isn't enabled in kernel, the
pxa3xx_u2d_start_hc()andpxa3xx_u2d_stop_hc()functions are undefined. Encapsulate their callings with #ifdefCONFIG_PXA3xxmacro.This isn't necessary.
cpu_is_pxa3xx()will expand to zero ifCONFIG_PXA3xxisn't defined, and the whole if () statement will be optimized away by the compiler.That was my intention, but I haven't checked if it really does the job.
It didn't. But I proposed a fix hours ago and it seemed to work. Tested by Marek.
Quoted 50 lines
Quoted 7 lines
Quoted 7 lines
Signed-off-by Marek Vasut <[email protected]>---
NOTE: I'm adding "Make a proper fix for this thing" into my ToDo. This is just a quick patch since I have that exam soon. I'll go for approach 2) from what we discussed in the other thread once the exam's past me.
I've already started working on this yesterday and I'll be glad to have the patch reviewed more carefully then the U2D series were (so we need to fix it right away).
Quoted 27 lines
Quoted 27 lines
?drivers/usb/host/ohci-pxa27x.c | ? ?4 ++++
?1 files changed, 4 insertions(+), 0 deletions(-)drivers/usb/host/ohci-pxa27x.c +4
-0@@ -236,8 +236,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev) ? ? ? ?if (retval < 0) ? ? ? ? ? ? ? ?return retval; +#ifdef CONFIG_PXA3xx ? ? ? ?if (cpu_is_pxa3xx()) ? ? ? ? ? ? ? ?pxa3xx_u2d_start_hc(&ohci_to_hcd(&ohci->ohci)->self); +#endif ? ? ? ?uhchr = __raw_readl(ohci->mmio_base + UHCHR) & ~UHCHR_SSE; ? ? ? ?__raw_writel(uhchr, ohci->mmio_base + UHCHR);@@ -255,8 +257,10 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev) ? ? ? ?inf = dev->platform_data; +#ifdef CONFIG_PXA3xx ? ? ? ?if (cpu_is_pxa3xx()) ? ? ? ? ? ? ? ?pxa3xx_u2d_stop_hc(&ohci_to_hcd(&ohci->ohci)->self); +#endif Quoted 6 lines
Quoted 6 lines
drivers/usb/host/ohci-pxa27x.c +0
-1? ? ? ?if (inf->exit) ? ? ? ? ? ? ? ?inf->exit(dev); --1.7.1
--
Regards,
Igor.
PATCH 1/1 ARM: pxa: Enable U2D only in case PXA3xx is enabled
Quoted 7 lines · Eric Miao
Quoted 6 lines · Igor Grinberg
Quoted 5 lines · Eric Miao
Quoted 4 lines · Marek Vasut
In case PXA3xx support isn't enabled in kernel, the
pxa3xx_u2d_start_hc()andpxa3xx_u2d_stop_hc()functions are undefined. Encapsulate their callings with #ifdefCONFIG_PXA3xxmacro.
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
This isn't necessary.
cpu_is_pxa3xx()will expand to zero ifCONFIG_PXA3xxisn't defined, and the whole if () statement will be optimized away by the compiler.That was my intention, but I haven't checked if it really does the job.
It didn't. But I proposed a fix hours ago and it seemed to work. Tested by Marek.
Oh.. now I see this:
[PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configured
This only fixes the problem for cpu's other then pxa3xx, we still need one of the proposed fixes for pxa3xx based boards, that don't use U2DC, right?
Quoted 47 lines
Quoted 47 lines
Quoted 6 lines
Quoted 6 lines
Signed-off-by Marek Vasut <[email protected]>---
NOTE: I'm adding "Make a proper fix for this thing" into my ToDo. This is just a quick patch since I have that exam soon. I'll go for approach 2) from what we discussed in the other thread once the exam's past me.
I've already started working on this yesterday and I'll be glad to have the patch reviewed more carefully then the U2D series were (so we need to fix it right away).
Quoted 27 lines
Quoted 27 lines
drivers/usb/host/ohci-pxa27x.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/usb/host/ohci-pxa27x.c +4
-0@@ -236,8 +236,10 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev)if (retval <0 )return retval; +#ifdef CONFIG_PXA3xxif (cpu_is_pxa3xx ())pxa3xx_u2d_start_hc (&ohci_to_hcd (&ohci->ohci)->self); +#endif uhchr =__raw_readl (ohci->mmio_base +UHCHR ) & ~UHCHR_SSE ;__raw_writel (uhchr, ohci->mmio_base +UHCHR );@@ -255,8 +257,10 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev) inf = dev->platform_data; +#ifdef CONFIG_PXA3xxif (cpu_is_pxa3xx ())pxa3xx_u2d_stop_hc (&ohci_to_hcd (&ohci->ohci)->self); +#endif Quoted 6 lines
Quoted 6 lines
drivers/usb/host/ohci-pxa27x.c +0
-1if (inf->exit) inf->exit (dev); --1.7.1
--
Regards,
Igor.
Signature · 2 lines
Regards, Igor.
PATCH 1/1 ARM: pxa: Enable U2D only in case PXA3xx is enabled
Quoted 15 lines · Igor Grinberg
Quoted 7 lines · Eric Miao
Quoted 6 lines · Igor Grinberg
Quoted 5 lines · Eric Miao
Quoted 4 lines · Marek Vasut
In case PXA3xx support isn't enabled in kernel, the
pxa3xx_u2d_start_hc()andpxa3xx_u2d_stop_hc()functions are undefined. Encapsulate their callings with #ifdefCONFIG_PXA3xxmacro.Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
This isn't necessary.
cpu_is_pxa3xx()will expand to zero ifCONFIG_PXA3xxisn't defined, and the whole if () statement will be optimized away by the compiler.That was my intention, but I haven't checked if it really does the job.
It didn't. But I proposed a fix hours ago and it seemed to work. Tested by Marek.
Quoted 6 lines
Oh.. now I see this:
[PATCH] pxa: fix cpu_is_pxa*() not expanded to zero when not configuredThis only fixes the problem for cpu's other then pxa3xx, we still need one of the proposed fixes for pxa3xx based boards, that don't use U2DC, right?
Exactly right.