LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: legacy_serial: reg-offset & shift aren't used
@ 2008-07-01 16:31 John Linn
  0 siblings, 0 replies; 5+ messages in thread
From: John Linn @ 2008-07-01 16:31 UTC (permalink / raw)
  To: linuxppc-dev, grant.likely, paulus, benh, dwg, jwboyer,
	stephen.neuendorffer
  Cc: 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>
---

 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..b43235f 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 and 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] powerpc: legacy_serial: reg-offset & shift aren't used
       [not found] <12149299143952-git-send-email-john.linn@xilinx.com>
@ 2008-07-01 16:48 ` Stephen Neuendorffer
       [not found] ` <977C41F842E66D4CB2E41332313B6150062A2DB4@XSJ-EXCHVS1.xlnx.xilinx.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Neuendorffer @ 2008-07-01 16:48 UTC (permalink / raw)
  To: John Linn, linuxppc-dev, grant.likely, paulus, benh, dwg, jwboyer



> -----Original Message-----
> From: John Linn [mailto:john.linn@xilinx.com]
> Sent: Tuesday, July 01, 2008 9:32 AM
> To: linuxppc-dev@ozlabs.org; grant.likely@secretlab.ca;
paulus@samba.org; benh@kernel.crashing.org;
> dwg@au1.ibm.com; jwboyer@linux.vnet.ibm.com; Stephen Neuendorffer
> Cc: John Linn
> Subject: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't
used
> =

> 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>
> ---
> =

>  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..b43235f 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) =3D=3D NULL)
>  		return -1;
> =

> +	/* if reg-shift and offset, don't try to use it */
> +	if ((of_get_property(np, "reg-shift", NULL) !=3D NULL) &&
> +		(of_get_property(np, "reg-offset", NULL) !=3D NULL))
> +		return -1;

Um, shouldn't this be || ?

> +
>  	/* if rtas uses this device, don't try to use it as well */
>  	if (of_get_property(np, "used-by-rtas", NULL) !=3D NULL)
>  		return -1;
> --
> 1.5.2.1
> =



This email and any attachments are intended for the sole use of the named r=
ecipient(s) and contain(s) confidential information that may be proprietary=
, privileged or copyrighted under applicable law. If you are not the intend=
ed recipient, do not read, copy, or forward this email message or any attac=
hments. Delete this email message and any attachments immediately.

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

* RE: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't used
       [not found] ` <977C41F842E66D4CB2E41332313B6150062A2DB4@XSJ-EXCHVS1.xlnx.xilinx.com>
@ 2008-07-01 16:52   ` John Linn
  2008-07-01 17:06     ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: John Linn @ 2008-07-01 16:52 UTC (permalink / raw)
  To: Stephen Neuendorffer, linuxppc-dev, grant.likely, paulus, benh,
	dwg, jwboyer

It could be "||" but I didn't know if there were cases where that
wouldn't be true. I don't know that code that well so I was being
conservative and maybe shouldn't be. =


Our specific case works fine with "&&" since we have both in the device
tree.  =


-- John

-----Original Message-----
From: Stephen Neuendorffer =

Sent: Tuesday, July 01, 2008 10:48 AM
To: John Linn; linuxppc-dev@ozlabs.org; grant.likely@secretlab.ca;
paulus@samba.org; benh@kernel.crashing.org; dwg@au1.ibm.com;
jwboyer@linux.vnet.ibm.com
Subject: RE: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't
used



> -----Original Message-----
> From: John Linn [mailto:john.linn@xilinx.com]
> Sent: Tuesday, July 01, 2008 9:32 AM
> To: linuxppc-dev@ozlabs.org; grant.likely@secretlab.ca;
paulus@samba.org; benh@kernel.crashing.org;
> dwg@au1.ibm.com; jwboyer@linux.vnet.ibm.com; Stephen Neuendorffer
> Cc: John Linn
> Subject: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't
used
> =

> 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>
> ---
> =

>  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..b43235f 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) =3D=3D NULL)
>  		return -1;
> =

> +	/* if reg-shift and offset, don't try to use it */
> +	if ((of_get_property(np, "reg-shift", NULL) !=3D NULL) &&
> +		(of_get_property(np, "reg-offset", NULL) !=3D NULL))
> +		return -1;

Um, shouldn't this be || ?

> +
>  	/* if rtas uses this device, don't try to use it as well */
>  	if (of_get_property(np, "used-by-rtas", NULL) !=3D NULL)
>  		return -1;
> --
> 1.5.2.1
> =



This email and any attachments are intended for the sole use of the named r=
ecipient(s) and contain(s) confidential information that may be proprietary=
, privileged or copyrighted under applicable law. If you are not the intend=
ed recipient, do not read, copy, or forward this email message or any attac=
hments. Delete this email message and any attachments immediately.

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

* Re: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't used
  2008-07-01 16:52   ` John Linn
@ 2008-07-01 17:06     ` Grant Likely
  2008-07-01 17:07       ` John Linn
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2008-07-01 17:06 UTC (permalink / raw)
  To: John Linn; +Cc: Stephen Neuendorffer, dwg, linuxppc-dev, paulus

On Tue, Jul 01, 2008 at 10:52:20AM -0600, John Linn wrote:
> It could be "||" but I didn't know if there were cases where that
> wouldn't be true. I don't know that code that well so I was being
> conservative and maybe shouldn't be. 

No, Stephen is right.  It should be ||

g.

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

* RE: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't used
  2008-07-01 17:06     ` Grant Likely
@ 2008-07-01 17:07       ` John Linn
  0 siblings, 0 replies; 5+ messages in thread
From: John Linn @ 2008-07-01 17:07 UTC (permalink / raw)
  To: Grant Likely; +Cc: Stephen Neuendorffer, dwg, linuxppc-dev, paulus

I'll respin the patch and send again.

-- John

-----Original Message-----
From: Grant Likely [mailto:glikely@secretlab.ca] On Behalf Of Grant
Likely
Sent: Tuesday, July 01, 2008 11:06 AM
To: John Linn
Cc: Stephen Neuendorffer; linuxppc-dev@ozlabs.org; paulus@samba.org;
benh@kernel.crashing.org; dwg@au1.ibm.com; jwboyer@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc: legacy_serial: reg-offset & shift aren't
used

On Tue, Jul 01, 2008 at 10:52:20AM -0600, John Linn wrote:
> It could be "||" but I didn't know if there were cases where that
> wouldn't be true. I don't know that code that well so I was being
> conservative and maybe shouldn't be. =


No, Stephen is right.  It should be ||

g.



This email and any attachments are intended for the sole use of the named r=
ecipient(s) and contain(s) confidential information that may be proprietary=
, privileged or copyrighted under applicable law. If you are not the intend=
ed recipient, do not read, copy, or forward this email message or any attac=
hments. Delete this email message and any attachments immediately.

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

end of thread, other threads:[~2008-07-01 17:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <12149299143952-git-send-email-john.linn@xilinx.com>
2008-07-01 16:48 ` [PATCH] powerpc: legacy_serial: reg-offset & shift aren't used Stephen Neuendorffer
     [not found] ` <977C41F842E66D4CB2E41332313B6150062A2DB4@XSJ-EXCHVS1.xlnx.xilinx.com>
2008-07-01 16:52   ` John Linn
2008-07-01 17:06     ` Grant Likely
2008-07-01 17:07       ` John Linn
2008-07-01 16:31 John Linn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox