linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] serial: PL011: Repair NULL pointer dereference
@ 2012-04-02 14:31 Lee Jones
  2012-04-02 14:31 ` [PATCH 2/2] ARM: ux500: Fix unmet direct dependency Lee Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Lee Jones @ 2012-04-02 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

The pl011 driver attempts to mask and clear UART interrupts
at probe time, which subsequently fail with a NULL pointer
dereference error. This is due to 'uap->port.membase' being
used uninitialised. This patch moves the offending lines
to a point of post-initialisation.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/tty/serial/amba-pl011.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 0c65c9e..b5c1f0f 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1946,10 +1946,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 		goto unmap;
 	}
 
-	/* Ensure interrupts from this UART are masked and cleared */
-	writew(0, uap->port.membase + UART011_IMSC);
-	writew(0xffff, uap->port.membase + UART011_ICR);
-
 	uap->vendor = vendor;
 	uap->lcrh_rx = vendor->lcrh_rx;
 	uap->lcrh_tx = vendor->lcrh_tx;
@@ -1965,6 +1961,11 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
 	uap->port.ops = &amba_pl011_pops;
 	uap->port.flags = UPF_BOOT_AUTOCONF;
 	uap->port.line = i;
+
+	/* Ensure interrupts from this UART are masked and cleared */
+	writew(0, uap->port.membase + UART011_IMSC);
+	writew(0xffff, uap->port.membase + UART011_ICR);
+
 	pl011_dma_probe(uap);
 
 	snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));
-- 
1.7.5.4

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

* [PATCH 2/2] ARM: ux500: Fix unmet direct dependency
  2012-04-02 14:31 [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Lee Jones
@ 2012-04-02 14:31 ` Lee Jones
  2012-04-05 10:33 ` [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Jon Medhurst (Tixy)
  2012-04-09 17:54 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2012-04-02 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

A recent change to a Kconfig configuration saw MACH_U8500
remove TPS6105X selection. In doing so Kconfig stopped
selecting REGULATORS, which is still required. This patch
sees UX500_SOC_DB8500 implicitly select it instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 arch/arm/mach-ux500/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 880d02e..ef7099e 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -17,6 +17,7 @@ config UX500_SOC_DB5500
 config UX500_SOC_DB8500
 	bool
 	select MFD_DB8500_PRCMU
+	select REGULATOR
 	select REGULATOR_DB8500_PRCMU
 	select CPU_FREQ_TABLE if CPU_FREQ
 
-- 
1.7.5.4

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

* [PATCH 1/2] serial: PL011: Repair NULL pointer dereference
  2012-04-02 14:31 [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Lee Jones
  2012-04-02 14:31 ` [PATCH 2/2] ARM: ux500: Fix unmet direct dependency Lee Jones
@ 2012-04-05 10:33 ` Jon Medhurst (Tixy)
  2012-04-09 17:54 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Jon Medhurst (Tixy) @ 2012-04-05 10:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 2012-04-02 at 15:31 +0100, Lee Jones wrote:
> The pl011 driver attempts to mask and clear UART interrupts
> at probe time, which subsequently fail with a NULL pointer
> dereference error. This is due to 'uap->port.membase' being
> used uninitialised. This patch moves the offending lines
> to a point of post-initialisation.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Tested-by: Jon Medhurst <tixy@linaro.org>

This fixes vexpress boot on v3.4-rc1.

> ---
>  drivers/tty/serial/amba-pl011.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 0c65c9e..b5c1f0f 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -1946,10 +1946,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
>  		goto unmap;
>  	}
>  
> -	/* Ensure interrupts from this UART are masked and cleared */
> -	writew(0, uap->port.membase + UART011_IMSC);
> -	writew(0xffff, uap->port.membase + UART011_ICR);
> -
>  	uap->vendor = vendor;
>  	uap->lcrh_rx = vendor->lcrh_rx;
>  	uap->lcrh_tx = vendor->lcrh_tx;
> @@ -1965,6 +1961,11 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
>  	uap->port.ops = &amba_pl011_pops;
>  	uap->port.flags = UPF_BOOT_AUTOCONF;
>  	uap->port.line = i;
> +
> +	/* Ensure interrupts from this UART are masked and cleared */
> +	writew(0, uap->port.membase + UART011_IMSC);
> +	writew(0xffff, uap->port.membase + UART011_ICR);
> +
>  	pl011_dma_probe(uap);
>  
>  	snprintf(uap->type, sizeof(uap->type), "PL011 rev%u", amba_rev(dev));

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

* [PATCH 1/2] serial: PL011: Repair NULL pointer dereference
  2012-04-02 14:31 [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Lee Jones
  2012-04-02 14:31 ` [PATCH 2/2] ARM: ux500: Fix unmet direct dependency Lee Jones
  2012-04-05 10:33 ` [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Jon Medhurst (Tixy)
@ 2012-04-09 17:54 ` Linus Walleij
  2 siblings, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2012-04-09 17:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 2, 2012 at 4:31 PM, Lee Jones <lee.jones@linaro.org> wrote:

> The pl011 driver attempts to mask and clear UART interrupts
> at probe time, which subsequently fail with a NULL pointer
> dereference error. This is due to 'uap->port.membase' being
> used uninitialised. This patch moves the offending lines
> to a point of post-initialisation.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

A fix for this was sent out on march 21st:
http://marc.info/?l=linux-serial&m=133235774423240&w=2

This is something like the third or fourth patch solving the
problem :-)

We are just waiting for Greg to pick it up and push upstream
for the -rc:s.

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-04-09 17:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-02 14:31 [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Lee Jones
2012-04-02 14:31 ` [PATCH 2/2] ARM: ux500: Fix unmet direct dependency Lee Jones
2012-04-05 10:33 ` [PATCH 1/2] serial: PL011: Repair NULL pointer dereference Jon Medhurst (Tixy)
2012-04-09 17:54 ` Linus Walleij

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