linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Samsung watchdog driver updates
@ 2010-05-20 10:58 Ben Dooks
  2010-05-20 10:58 ` [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs Ben Dooks
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ben Dooks @ 2010-05-20 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

two updates for samsung watchdog driver, one bugfix and one kconfig.

please apply for this merge window.

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

* [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs
  2010-05-20 10:58 Samsung watchdog driver updates Ben Dooks
@ 2010-05-20 10:58 ` Ben Dooks
  2010-05-21  9:21   ` Sergei Shtylyov
  2010-05-20 10:58 ` [PATCH 2/2] s3c2410_wdt - Fix on handling of the request_mem_region fail Ben Dooks
  2010-05-21  8:19 ` Samsung watchdog driver updates Wim Van Sebroeck
  2 siblings, 1 reply; 6+ messages in thread
From: Ben Dooks @ 2010-05-20 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

From: Banajit Goswami <banajit.g@samsung.com>

This patch adds HAVE_S3C2410_WATCHDOG to control inclusion of watchdog driver
for Samsung SoCs. This option will help to include the driver only for the
necessary machines and not for all for any given arch.

Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 drivers/watchdog/Kconfig |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 0bf5020..c232146 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -145,13 +145,19 @@ config KS8695_WATCHDOG
 	  Watchdog timer embedded into KS8695 processor. This will reboot your
 	  system when the timeout is reached.
 
+config HAVE_S3C2410_WATCHDOG
+	bool
+	help
+	  This will include watchdog timer support for Samsung SoCs. If
+	  you want to include watchdog support for any machine, kindly
+	  select this in the respective mach-XXXX/Kconfig file.
+
 config S3C2410_WATCHDOG
 	tristate "S3C2410 Watchdog"
-	depends on ARCH_S3C2410
+	depends on ARCH_S3C2410 || HAVE_S3C2410_WATCHDOG
 	help
-	  Watchdog timer block in the Samsung S3C2410 chips. This will
-	  reboot the system when the timer expires with the watchdog
-	  enabled.
+	  Watchdog timer block in the Samsung SoCs. This will reboot
+	  the system when the timer expires with the watchdog enabled.
 
 	  The driver is limited by the speed of the system's PCLK
 	  signal, so with reasonably fast systems (PCLK around 50-66MHz)
-- 
1.6.3.3

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

* [PATCH 2/2] s3c2410_wdt - Fix on handling of the request_mem_region fail
  2010-05-20 10:58 Samsung watchdog driver updates Ben Dooks
  2010-05-20 10:58 ` [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs Ben Dooks
@ 2010-05-20 10:58 ` Ben Dooks
  2010-05-21  8:19 ` Samsung watchdog driver updates Wim Van Sebroeck
  2 siblings, 0 replies; 6+ messages in thread
From: Ben Dooks @ 2010-05-20 10:58 UTC (permalink / raw)
  To: linux-arm-kernel

From: Banajit Goswami <banajit.g@samsung.com>

If the request for wdt_mem region fails, this patch modifies the driver
such that, it does not try to release the wdt_mem region on exit.

Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Acked-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
---
 drivers/watchdog/s3c2410_wdt.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index e4cebef..ee0566b 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -426,8 +426,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
 	wdt_mem = request_mem_region(res->start, size, pdev->name);
 	if (wdt_mem == NULL) {
 		dev_err(dev, "failed to get memory region\n");
-		ret = -ENOENT;
-		goto err_req;
+		return -EBUSY;
 	}
 
 	wdt_base = ioremap(res->start, size);
-- 
1.6.3.3

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

* Samsung watchdog driver updates
  2010-05-20 10:58 Samsung watchdog driver updates Ben Dooks
  2010-05-20 10:58 ` [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs Ben Dooks
  2010-05-20 10:58 ` [PATCH 2/2] s3c2410_wdt - Fix on handling of the request_mem_region fail Ben Dooks
@ 2010-05-21  8:19 ` Wim Van Sebroeck
  2 siblings, 0 replies; 6+ messages in thread
From: Wim Van Sebroeck @ 2010-05-21  8:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Ben,

> two updates for samsung watchdog driver, one bugfix and one kconfig.
> 
> please apply for this merge window.

I added them to the linux-2.6-watchdog tree so that they can be included
in this merge window.

I also created a fix for the removal of the driver (the misc_deregister
needs to happen first so that userspace access is removed before removing
the rest of the driver).
Can you test and give feedback?

Thanks,
Wim.

commit c41e5d25f3d82d1b048f8dc156f057d0deba093a
Author: Wim Van Sebroeck <wim@iguana.be>
Date:   Fri May 21 08:11:42 2010 +0000

    watchdog: s3c2410_wdt - Fix removing of platform device
    
    When removing the watchdog platform device, we need to
    disable the access to userspace first. It makes no sense
    to remove the drivers clock, irq's, ... and then disable
    usersapce access.
    the order of removal has also been changed so that it
    is the reverse of probing (this way the clock is also
    disabled sooner).
    
    Cc: Ben Dooks <ben-linux@fluff.org>
    Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c
index 3009325..ae53662 100644
--- a/drivers/watchdog/s3c2410_wdt.c
+++ b/drivers/watchdog/s3c2410_wdt.c
@@ -532,21 +532,22 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev)
 
 static int __devexit s3c2410wdt_remove(struct platform_device *dev)
 {
-	s3c2410wdt_cpufreq_deregister();
-
-	release_resource(wdt_mem);
-	kfree(wdt_mem);
-	wdt_mem = NULL;
+	misc_deregister(&s3c2410wdt_miscdev);
 
-	free_irq(wdt_irq->start, dev);
-	wdt_irq = NULL;
+	s3c2410wdt_cpufreq_deregister();
 
 	clk_disable(wdt_clock);
 	clk_put(wdt_clock);
 	wdt_clock = NULL;
 
+	free_irq(wdt_irq->start, dev);
+	wdt_irq = NULL;
+
 	iounmap(wdt_base);
-	misc_deregister(&s3c2410wdt_miscdev);
+
+	release_resource(wdt_mem);
+	kfree(wdt_mem);
+	wdt_mem = NULL;
 	return 0;
 }
 

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

* [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs
  2010-05-20 10:58 ` [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs Ben Dooks
@ 2010-05-21  9:21   ` Sergei Shtylyov
  2010-05-21  9:50     ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: Sergei Shtylyov @ 2010-05-21  9:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

Ben Dooks wrote:

> From: Banajit Goswami <banajit.g@samsung.com>

> This patch adds HAVE_S3C2410_WATCHDOG to control inclusion of watchdog driver
> for Samsung SoCs. This option will help to include the driver only for the
> necessary machines and not for all for any given arch.

> Signed-off-by: Banajit Goswami <banajit.g@samsung.com>
> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
> Acked-by: Ben Dooks <ben-linux@fluff.org>
> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
[...]
> diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> index 0bf5020..c232146 100644
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -145,13 +145,19 @@ config KS8695_WATCHDOG
>  	  Watchdog timer embedded into KS8695 processor. This will reboot your
>  	  system when the timeout is reached.
>  
> +config HAVE_S3C2410_WATCHDOG
> +	bool
> +	help
> +	  This will include watchdog timer support for Samsung SoCs. If
> +	  you want to include watchdog support for any machine, kindly
> +	  select this in the respective mach-XXXX/Kconfig file.

    What use is the help text for a hidden option?

WBR, Sergei

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

* [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs
  2010-05-21  9:21   ` Sergei Shtylyov
@ 2010-05-21  9:50     ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2010-05-21  9:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 21, 2010 at 01:21:20PM +0400, Sergei Shtylyov wrote:
>>  +config HAVE_S3C2410_WATCHDOG
>> +	bool
>> +	help
>> +	  This will include watchdog timer support for Samsung SoCs. If
>> +	  you want to include watchdog support for any machine, kindly
>> +	  select this in the respective mach-XXXX/Kconfig file.
>
>    What use is the help text for a hidden option?

Documentation to describe what the hidden option does - it tells those
who modify Kconfig files what the intention of the option is.

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

end of thread, other threads:[~2010-05-21  9:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 10:58 Samsung watchdog driver updates Ben Dooks
2010-05-20 10:58 ` [PATCH 1/2] s3c2410_wdt - Add extra option to include watchdog for Samsung SoCs Ben Dooks
2010-05-21  9:21   ` Sergei Shtylyov
2010-05-21  9:50     ` Russell King - ARM Linux
2010-05-20 10:58 ` [PATCH 2/2] s3c2410_wdt - Fix on handling of the request_mem_region fail Ben Dooks
2010-05-21  8:19 ` Samsung watchdog driver updates Wim Van Sebroeck

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