All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled
@ 2010-09-06 20:53 Marek Vasut
  2010-09-07  2:26 ` Eric Miao
  0 siblings, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2010-09-06 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

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.

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

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

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index afef7b0..f3c60b9 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -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

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

* [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled
  2010-09-06 20:53 [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled Marek Vasut
@ 2010-09-07  2:26 ` Eric Miao
  2010-09-07  5:56   ` Igor Grinberg
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Miao @ 2010-09-07  2:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 7, 2010 at 4:53 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> 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.
>

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.

> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
>
> 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(-)
>
> diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
> index afef7b0..f3c60b9 100644
> --- a/drivers/usb/host/ohci-pxa27x.c
> +++ b/drivers/usb/host/ohci-pxa27x.c
> @@ -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
>
>

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

* [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled
  2010-09-07  2:26 ` Eric Miao
@ 2010-09-07  5:56   ` Igor Grinberg
  2010-09-07  6:11     ` Eric Miao
  0 siblings, 1 reply; 6+ messages in thread
From: Igor Grinberg @ 2010-09-07  5:56 UTC (permalink / raw)
  To: linux-arm-kernel

 On 09/07/10 05:26, Eric Miao wrote:
> On Tue, Sep 7, 2010 at 4:53 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
>> 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.
>>
> 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.

That was my intention, but I haven't checked if it really does the job.

>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>> ---
>>
>> 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).

>>  drivers/usb/host/ohci-pxa27x.c |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
>> index afef7b0..f3c60b9 100644
>> --- a/drivers/usb/host/ohci-pxa27x.c
>> +++ b/drivers/usb/host/ohci-pxa27x.c
>> @@ -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
>>
>>

-- 
Regards,
Igor.

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

* [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled
  2010-09-07  5:56   ` Igor Grinberg
@ 2010-09-07  6:11     ` Eric Miao
  2010-09-07  6:26       ` Igor Grinberg
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Miao @ 2010-09-07  6:11 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 7, 2010 at 1:56 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
> ?On 09/07/10 05:26, Eric Miao wrote:
>> On Tue, Sep 7, 2010 at 4:53 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
>>> 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.
>>>
>> 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.
>
> 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.

>
>>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>>> ---
>>>
>>> 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).
>
>>> ?drivers/usb/host/ohci-pxa27x.c | ? ?4 ++++
>>> ?1 files changed, 4 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
>>> index afef7b0..f3c60b9 100644
>>> --- a/drivers/usb/host/ohci-pxa27x.c
>>> +++ b/drivers/usb/host/ohci-pxa27x.c
>>> @@ -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
>>>
>>>
>
> --
> Regards,
> Igor.
>
>

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

* [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled
  2010-09-07  6:11     ` Eric Miao
@ 2010-09-07  6:26       ` Igor Grinberg
  2010-09-07  6:45         ` Eric Miao
  0 siblings, 1 reply; 6+ messages in thread
From: Igor Grinberg @ 2010-09-07  6:26 UTC (permalink / raw)
  To: linux-arm-kernel

 On 09/07/10 09:11, Eric Miao wrote:
> On Tue, Sep 7, 2010 at 1:56 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>>  On 09/07/10 05:26, Eric Miao wrote:
>>> On Tue, Sep 7, 2010 at 4:53 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
>>>> 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.
>>>>
>>> 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.
>> 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?

>>>> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>>>> ---
>>>>
>>>> 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).
>>
>>>>  drivers/usb/host/ohci-pxa27x.c |    4 ++++
>>>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
>>>> index afef7b0..f3c60b9 100644
>>>> --- a/drivers/usb/host/ohci-pxa27x.c
>>>> +++ b/drivers/usb/host/ohci-pxa27x.c
>>>> @@ -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
>>>>
>>>>
>> --
>> Regards,
>> Igor.
>>
>>

-- 
Regards,
Igor.

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

* [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled
  2010-09-07  6:26       ` Igor Grinberg
@ 2010-09-07  6:45         ` Eric Miao
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Miao @ 2010-09-07  6:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Sep 7, 2010 at 2:26 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
> ?On 09/07/10 09:11, Eric Miao wrote:
>> On Tue, Sep 7, 2010 at 1:56 PM, Igor Grinberg <grinberg@compulab.co.il> wrote:
>>> ?On 09/07/10 05:26, Eric Miao wrote:
>>>> On Tue, Sep 7, 2010 at 4:53 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
>>>>> 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.
>>>>>
>>>> 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.
>>> 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?

Exactly right.

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

end of thread, other threads:[~2010-09-07  6:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-06 20:53 [PATCH] ARM: pxa: Enable U2D only in case PXA3xx is enabled Marek Vasut
2010-09-07  2:26 ` Eric Miao
2010-09-07  5:56   ` Igor Grinberg
2010-09-07  6:11     ` Eric Miao
2010-09-07  6:26       ` Igor Grinberg
2010-09-07  6:45         ` Eric Miao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.