* [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used
@ 2008-07-01 17:52 John Linn
2008-07-07 6:47 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 5+ messages in thread
From: John Linn @ 2008-07-01 17:52 UTC (permalink / raw)
To: linuxppc-dev; +Cc: dwg, paulus, John Linn
The legacy serial driver does not work with an 8250
type UART that uses reg-offset and reg-shift. This
change updates the driver so it doesn't find the UART
when those properties are present on the UART in the
device tree for soc devices.
Signed-off-by: John Linn <john.linn@xilinx.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
V2
Corrected logic to use "||" rather than "&&".
arch/powerpc/kernel/legacy_serial.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
index 61dd174..cf37f5c 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -136,6 +136,11 @@ static int __init add_legacy_soc_port(struct device_node *np,
if (of_get_property(np, "clock-frequency", NULL) == NULL)
return -1;
+ /* if reg-shift or offset, don't try to use it */
+ if ((of_get_property(np, "reg-shift", NULL) != NULL) ||
+ (of_get_property(np, "reg-offset", NULL) != NULL))
+ return -1;
+
/* if rtas uses this device, don't try to use it as well */
if (of_get_property(np, "used-by-rtas", NULL) != NULL)
return -1;
--
1.5.2.1
This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used
2008-07-01 17:52 [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used John Linn
@ 2008-07-07 6:47 ` Benjamin Herrenschmidt
2008-07-07 11:01 ` Josh Boyer
2008-07-07 14:24 ` Grant Likely
0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-07 6:47 UTC (permalink / raw)
To: John Linn; +Cc: dwg, linuxppc-dev, paulus
On Tue, 2008-07-01 at 10:52 -0700, John Linn wrote:
> The legacy serial driver does not work with an 8250
> type UART that uses reg-offset and reg-shift. This
> change updates the driver so it doesn't find the UART
> when those properties are present on the UART in the
> device tree for soc devices.
>
> Signed-off-by: John Linn <john.linn@xilinx.com>
> Acked-by: Grant Likely <grant.likely@secretlab.ca>
> ---
> V2
>
> Corrected logic to use "||" rather than "&&".
I have some problems with this patch:
- First if the properties are present but their value match the
register layout of a standard UART, we will bail out... not nice.
- Why don't we just implement support for the reg-shift and
offset instead ?
Cheers,
Ben.
> arch/powerpc/kernel/legacy_serial.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c
> index 61dd174..cf37f5c 100644
> --- a/arch/powerpc/kernel/legacy_serial.c
> +++ b/arch/powerpc/kernel/legacy_serial.c
> @@ -136,6 +136,11 @@ static int __init add_legacy_soc_port(struct device_node *np,
> if (of_get_property(np, "clock-frequency", NULL) == NULL)
> return -1;
>
> + /* if reg-shift or offset, don't try to use it */
> + if ((of_get_property(np, "reg-shift", NULL) != NULL) ||
> + (of_get_property(np, "reg-offset", NULL) != NULL))
> + return -1;
> +
> /* if rtas uses this device, don't try to use it as well */
> if (of_get_property(np, "used-by-rtas", NULL) != NULL)
> return -1;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used
2008-07-07 6:47 ` Benjamin Herrenschmidt
@ 2008-07-07 11:01 ` Josh Boyer
2008-07-07 22:00 ` Benjamin Herrenschmidt
2008-07-07 14:24 ` Grant Likely
1 sibling, 1 reply; 5+ messages in thread
From: Josh Boyer @ 2008-07-07 11:01 UTC (permalink / raw)
To: benh; +Cc: dwg, linuxppc-dev, paulus, John Linn
On Mon, 07 Jul 2008 16:47:08 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Tue, 2008-07-01 at 10:52 -0700, John Linn wrote:
> > The legacy serial driver does not work with an 8250
> > type UART that uses reg-offset and reg-shift. This
> > change updates the driver so it doesn't find the UART
> > when those properties are present on the UART in the
> > device tree for soc devices.
> >
> > Signed-off-by: John Linn <john.linn@xilinx.com>
> > Acked-by: Grant Likely <grant.likely@secretlab.ca>
> > ---
> > V2
> >
> > Corrected logic to use "||" rather than "&&".
>
> I have some problems with this patch:
>
> - First if the properties are present but their value match the
> register layout of a standard UART, we will bail out... not nice.
Why would they be present in that case?
> - Why don't we just implement support for the reg-shift and
> offset instead ?
Probably because the last time someone suggested that it spawned a
lengthy debate about what reg-offset/shift were supposed to do.
josh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used
2008-07-07 6:47 ` Benjamin Herrenschmidt
2008-07-07 11:01 ` Josh Boyer
@ 2008-07-07 14:24 ` Grant Likely
1 sibling, 0 replies; 5+ messages in thread
From: Grant Likely @ 2008-07-07 14:24 UTC (permalink / raw)
To: benh; +Cc: dwg, linuxppc-dev, paulus, John Linn
On Mon, Jul 7, 2008 at 12:47 AM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Tue, 2008-07-01 at 10:52 -0700, John Linn wrote:
>> The legacy serial driver does not work with an 8250
>> type UART that uses reg-offset and reg-shift. This
>> change updates the driver so it doesn't find the UART
>> when those properties are present on the UART in the
>> device tree for soc devices.
>
> I have some problems with this patch:
>
> - First if the properties are present but their value match the
> register layout of a standard UART, we will bail out... not nice.
Okay, that can be fixed.
> - Why don't we just implement support for the reg-shift and
> offset instead ?
We can do this, but this patch was simpler for solving the immediate
problem in .26
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used
2008-07-07 11:01 ` Josh Boyer
@ 2008-07-07 22:00 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-07-07 22:00 UTC (permalink / raw)
To: Josh Boyer; +Cc: dwg, linuxppc-dev, paulus, John Linn
> > - First if the properties are present but their value match the
> > register layout of a standard UART, we will bail out... not nice.
>
> Why would they be present in that case?
Why not ?
> > - Why don't we just implement support for the reg-shift and
> > offset instead ?
>
> Probably because the last time someone suggested that it spawned a
> lengthy debate about what reg-offset/shift were supposed to do.
That's lame, their definition is already quite there.
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-07-07 22:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01 17:52 [PATCH] [V2] powerpc: legacy_serial: reg-offset & shift aren't used John Linn
2008-07-07 6:47 ` Benjamin Herrenschmidt
2008-07-07 11:01 ` Josh Boyer
2008-07-07 22:00 ` Benjamin Herrenschmidt
2008-07-07 14:24 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).