All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] OMAP: serial: Release the claimed memory region in remove
@ 2012-02-11  7:33 ` Shubhrajyoti D
  0 siblings, 0 replies; 4+ messages in thread
From: Shubhrajyoti D @ 2012-02-11  7:33 UTC (permalink / raw)
  To: linux-serial; +Cc: linux-omap, linux-arm-kernel, Shubhrajyoti D, Govindraj.R

Currently the memory region is not released the folowing error is
observed.

/testsuites # insmod omap-serial.ko
[  130.746917] omap_uart omap_uart.0: memory region already claimed
[  130.753143] omap_uart: probe of omap_uart.0 failed with error -16
[  130.759338] omap_uart omap_uart.1: memory region already claimed
[  130.765380] omap_uart: probe of omap_uart.1 failed with error -16
[  130.771606] omap_uart omap_uart.2: memory region already claimed
[  130.777679] omap_uart: probe of omap_uart.2 failed with error -16
[  130.783905] omap_uart omap_uart.3: memory region already claimed
[  130.789947] omap_uart: probe of omap_uart.3 failed with error -16

Fix it by releasing the memory region.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
changes from the rfc version - 
move the release after the unmap.

 drivers/tty/serial/omap-serial.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 8c6f137..16aa4f0 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1480,9 +1480,12 @@ do_release_region:
 static int serial_omap_remove(struct platform_device *dev)
 {
 	struct uart_omap_port *up = platform_get_drvdata(dev);
+	struct resource		*r;
 
 	if (up) {
 		iounmap(up->port.membase);
+		r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+		release_mem_region(r->start, resource_size(r));
 		pm_runtime_disable(&up->pdev->dev);
 		uart_remove_one_port(&serial_omap_reg, &up->port);
 		pm_qos_remove_request(&up->pm_qos_request);
-- 
1.7.1


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

* [PATCH] OMAP: serial: Release the claimed memory region in remove
@ 2012-02-11  7:33 ` Shubhrajyoti D
  0 siblings, 0 replies; 4+ messages in thread
From: Shubhrajyoti D @ 2012-02-11  7:33 UTC (permalink / raw)
  To: linux-arm-kernel

Currently the memory region is not released the folowing error is
observed.

/testsuites # insmod omap-serial.ko
[  130.746917] omap_uart omap_uart.0: memory region already claimed
[  130.753143] omap_uart: probe of omap_uart.0 failed with error -16
[  130.759338] omap_uart omap_uart.1: memory region already claimed
[  130.765380] omap_uart: probe of omap_uart.1 failed with error -16
[  130.771606] omap_uart omap_uart.2: memory region already claimed
[  130.777679] omap_uart: probe of omap_uart.2 failed with error -16
[  130.783905] omap_uart omap_uart.3: memory region already claimed
[  130.789947] omap_uart: probe of omap_uart.3 failed with error -16

Fix it by releasing the memory region.

Cc: Govindraj.R <govindraj.raja@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
changes from the rfc version - 
move the release after the unmap.

 drivers/tty/serial/omap-serial.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 8c6f137..16aa4f0 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1480,9 +1480,12 @@ do_release_region:
 static int serial_omap_remove(struct platform_device *dev)
 {
 	struct uart_omap_port *up = platform_get_drvdata(dev);
+	struct resource		*r;
 
 	if (up) {
 		iounmap(up->port.membase);
+		r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+		release_mem_region(r->start, resource_size(r));
 		pm_runtime_disable(&up->pdev->dev);
 		uart_remove_one_port(&serial_omap_reg, &up->port);
 		pm_qos_remove_request(&up->pm_qos_request);
-- 
1.7.1

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

* Re: [PATCH] OMAP: serial: Release the claimed memory region in remove
  2012-02-11  7:33 ` Shubhrajyoti D
@ 2012-02-11 11:27   ` Mark Brown
  -1 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-02-11 11:27 UTC (permalink / raw)
  To: Shubhrajyoti D; +Cc: linux-serial, Govindraj.R, linux-omap, linux-arm-kernel

On Sat, Feb 11, 2012 at 01:03:27PM +0530, Shubhrajyoti D wrote:
> Currently the memory region is not released the folowing error is
> observed.

> /testsuites # insmod omap-serial.ko
> [  130.746917] omap_uart omap_uart.0: memory region already claimed
> [  130.753143] omap_uart: probe of omap_uart.0 failed with error -16

It'd be better yet to use the devm_ functions to prevent such issues
recurring in future.

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

* [PATCH] OMAP: serial: Release the claimed memory region in remove
@ 2012-02-11 11:27   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-02-11 11:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Feb 11, 2012 at 01:03:27PM +0530, Shubhrajyoti D wrote:
> Currently the memory region is not released the folowing error is
> observed.

> /testsuites # insmod omap-serial.ko
> [  130.746917] omap_uart omap_uart.0: memory region already claimed
> [  130.753143] omap_uart: probe of omap_uart.0 failed with error -16

It'd be better yet to use the devm_ functions to prevent such issues
recurring in future.

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

end of thread, other threads:[~2012-02-11 11:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-11  7:33 [PATCH] OMAP: serial: Release the claimed memory region in remove Shubhrajyoti D
2012-02-11  7:33 ` Shubhrajyoti D
2012-02-11 11:27 ` Mark Brown
2012-02-11 11:27   ` Mark Brown

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.