All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
@ 2017-08-04  7:39 Michal Simek
  2017-08-04  7:39 ` [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed Michal Simek
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Michal Simek @ 2017-08-04  7:39 UTC (permalink / raw)
  To: linux-kernel, monstr; +Cc: Guenter Roeck, linux-watchdog, Wim Van Sebroeck

Give read access to module parameters to all and write access to root.
This change also improves driver error path testing.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Please let me know what you think - I can use macros from stat.h if
required

---
 drivers/watchdog/cadence_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index 05c000081e9d..dadd3b0c2d49 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -52,12 +52,12 @@
 static int wdt_timeout;
 static int nowayout = WATCHDOG_NOWAYOUT;
 
-module_param(wdt_timeout, int, 0);
+module_param(wdt_timeout, int, 0644);
 MODULE_PARM_DESC(wdt_timeout,
 		 "Watchdog time in seconds. (default="
 		 __MODULE_STRING(CDNS_WDT_DEFAULT_TIMEOUT) ")");
 
-module_param(nowayout, int, 0);
+module_param(nowayout, int, 0644);
 MODULE_PARM_DESC(nowayout,
 		 "Watchdog cannot be stopped once started (default="
 		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
-- 
1.9.1

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

* [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed
  2017-08-04  7:39 [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Michal Simek
@ 2017-08-04  7:39 ` Michal Simek
  2017-08-04 13:47   ` Guenter Roeck
  2017-08-14 14:47   ` Guenter Roeck
  2017-08-04 13:45 ` [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Guenter Roeck
  2017-08-14 14:47 ` Guenter Roeck
  2 siblings, 2 replies; 9+ messages in thread
From: Michal Simek @ 2017-08-04  7:39 UTC (permalink / raw)
  To: linux-kernel, monstr; +Cc: Guenter Roeck, linux-watchdog, Wim Van Sebroeck

Showing message that driver is loaded is common across drivers.
This change also fixes checkpatch (--strict) warning
"Alignment should match open parenthesis".

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/watchdog/cadence_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index dadd3b0c2d49..064cf7b6c1c5 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -368,7 +368,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
 	}
 	platform_set_drvdata(pdev, wdt);
 
-	dev_dbg(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
+	dev_info(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
 		 wdt->regs, cdns_wdt_device->timeout,
 		 nowayout ? ", nowayout" : "");
 
-- 
1.9.1

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

* Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
  2017-08-04  7:39 [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Michal Simek
  2017-08-04  7:39 ` [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed Michal Simek
@ 2017-08-04 13:45 ` Guenter Roeck
  2017-08-04 13:52   ` Michal Simek
  2017-08-14 14:47 ` Guenter Roeck
  2 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2017-08-04 13:45 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr; +Cc: linux-watchdog, Wim Van Sebroeck

On 08/04/2017 12:39 AM, Michal Simek wrote:
> Give read access to module parameters to all and write access to root.
> This change also improves driver error path testing.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
> Please let me know what you think - I can use macros from stat.h if
> required
> 

Seems to be quite pointless and misleading, since the values are only read
at probe time. Am I missing something ?

Guenter

> ---
>   drivers/watchdog/cadence_wdt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 05c000081e9d..dadd3b0c2d49 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -52,12 +52,12 @@
>   static int wdt_timeout;
>   static int nowayout = WATCHDOG_NOWAYOUT;
>   
> -module_param(wdt_timeout, int, 0);
> +module_param(wdt_timeout, int, 0644);
>   MODULE_PARM_DESC(wdt_timeout,
>   		 "Watchdog time in seconds. (default="
>   		 __MODULE_STRING(CDNS_WDT_DEFAULT_TIMEOUT) ")");
>   
> -module_param(nowayout, int, 0);
> +module_param(nowayout, int, 0644);
>   MODULE_PARM_DESC(nowayout,
>   		 "Watchdog cannot be stopped once started (default="
>   		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> 

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

* Re: [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed
  2017-08-04  7:39 ` [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed Michal Simek
@ 2017-08-04 13:47   ` Guenter Roeck
  2017-08-04 13:56     ` Michal Simek
  2017-08-14 14:47   ` Guenter Roeck
  1 sibling, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2017-08-04 13:47 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr; +Cc: linux-watchdog, Wim Van Sebroeck

On 08/04/2017 12:39 AM, Michal Simek wrote:
> Showing message that driver is loaded is common across drivers.

Across watchdog drivers, which I am always half-annoyed about.
Is this really valuable ?

Guenter

> This change also fixes checkpatch (--strict) warning
> "Alignment should match open parenthesis".
> > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>   drivers/watchdog/cadence_wdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index dadd3b0c2d49..064cf7b6c1c5 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -368,7 +368,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
>   	}
>   	platform_set_drvdata(pdev, wdt);
>   
> -	dev_dbg(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
> +	dev_info(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
>   		 wdt->regs, cdns_wdt_device->timeout,
>   		 nowayout ? ", nowayout" : "");
>   
> 

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

* Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
  2017-08-04 13:45 ` [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Guenter Roeck
@ 2017-08-04 13:52   ` Michal Simek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2017-08-04 13:52 UTC (permalink / raw)
  To: Guenter Roeck, Michal Simek, linux-kernel
  Cc: linux-watchdog, Wim Van Sebroeck


[-- Attachment #1.1: Type: text/plain, Size: 1385 bytes --]

On 4.8.2017 15:45, Guenter Roeck wrote:
> On 08/04/2017 12:39 AM, Michal Simek wrote:
>> Give read access to module parameters to all and write access to root.
>> This change also improves driver error path testing.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Please let me know what you think - I can use macros from stat.h if
>> required
>>
> 
> Seems to be quite pointless and misleading, since the values are only read
> at probe time. Am I missing something ?

You can unbind device and bind that device again. If you want to use it
or test with different parameters you need to have an access to these
module parameters.
For testing purpose if you setup for example timeout to 1000s which is
more than CDNS_WDT_MAX_TIMEOUT probe will fail and you have better
driver coverage.

I see that a lot of watchdog drivers are using 0 there - means no sysfs
access to these modules parameters. Some of them are using 0644 or 0444
that's why I want to know if there is any for example security reason to
disable access to these parameters.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed
  2017-08-04 13:47   ` Guenter Roeck
@ 2017-08-04 13:56     ` Michal Simek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2017-08-04 13:56 UTC (permalink / raw)
  To: Guenter Roeck, Michal Simek, linux-kernel
  Cc: linux-watchdog, Wim Van Sebroeck


[-- Attachment #1.1: Type: text/plain, Size: 795 bytes --]

On 4.8.2017 15:47, Guenter Roeck wrote:
> On 08/04/2017 12:39 AM, Michal Simek wrote:
>> Showing message that driver is loaded is common across drivers.
> 
> Across watchdog drivers, which I am always half-annoyed about.
> Is this really valuable ?

I don't think that this is debug message. We don't have hundreds of
drivers that log explodes and for systems, which I don't know, I do
normally check dmesg logs and I would expect this message to be there to
know that watchdog is enabled.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
  2017-08-04  7:39 [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Michal Simek
  2017-08-04  7:39 ` [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed Michal Simek
  2017-08-04 13:45 ` [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Guenter Roeck
@ 2017-08-14 14:47 ` Guenter Roeck
  2017-08-14 14:51   ` Michal Simek
  2 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2017-08-14 14:47 UTC (permalink / raw)
  To: Michal Simek; +Cc: linux-kernel, monstr, linux-watchdog, Wim Van Sebroeck

On Fri, Aug 04, 2017 at 09:39:16AM +0200, Michal Simek wrote:
> Give read access to module parameters to all and write access to root.
> This change also improves driver error path testing.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Please let me know what you think - I can use macros from stat.h if
> required
> 
You mean instead of 0644 ? That is discouraged nowadays.

Guenter

> ---
>  drivers/watchdog/cadence_wdt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index 05c000081e9d..dadd3b0c2d49 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -52,12 +52,12 @@
>  static int wdt_timeout;
>  static int nowayout = WATCHDOG_NOWAYOUT;
>  
> -module_param(wdt_timeout, int, 0);
> +module_param(wdt_timeout, int, 0644);
>  MODULE_PARM_DESC(wdt_timeout,
>  		 "Watchdog time in seconds. (default="
>  		 __MODULE_STRING(CDNS_WDT_DEFAULT_TIMEOUT) ")");
>  
> -module_param(nowayout, int, 0);
> +module_param(nowayout, int, 0644);
>  MODULE_PARM_DESC(nowayout,
>  		 "Watchdog cannot be stopped once started (default="
>  		 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> -- 
> 1.9.1
> 

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

* Re: [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed
  2017-08-04  7:39 ` [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed Michal Simek
  2017-08-04 13:47   ` Guenter Roeck
@ 2017-08-14 14:47   ` Guenter Roeck
  1 sibling, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2017-08-14 14:47 UTC (permalink / raw)
  To: Michal Simek; +Cc: linux-kernel, monstr, linux-watchdog, Wim Van Sebroeck

On Fri, Aug 04, 2017 at 09:39:17AM +0200, Michal Simek wrote:
> Showing message that driver is loaded is common across drivers.
> This change also fixes checkpatch (--strict) warning
> "Alignment should match open parenthesis".
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
>  drivers/watchdog/cadence_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
> index dadd3b0c2d49..064cf7b6c1c5 100644
> --- a/drivers/watchdog/cadence_wdt.c
> +++ b/drivers/watchdog/cadence_wdt.c
> @@ -368,7 +368,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
>  	}
>  	platform_set_drvdata(pdev, wdt);
>  
> -	dev_dbg(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
> +	dev_info(&pdev->dev, "Xilinx Watchdog Timer at %p with timeout %ds%s\n",
>  		 wdt->regs, cdns_wdt_device->timeout,
>  		 nowayout ? ", nowayout" : "");
>  
> -- 
> 1.9.1
> 

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

* Re: [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters
  2017-08-14 14:47 ` Guenter Roeck
@ 2017-08-14 14:51   ` Michal Simek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2017-08-14 14:51 UTC (permalink / raw)
  To: Guenter Roeck, Michal Simek
  Cc: linux-kernel, monstr, linux-watchdog, Wim Van Sebroeck

On 14.8.2017 16:47, Guenter Roeck wrote:
> On Fri, Aug 04, 2017 at 09:39:16AM +0200, Michal Simek wrote:
>> Give read access to module parameters to all and write access to root.
>> This change also improves driver error path testing.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> 
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> 
>> ---
>>
>> Please let me know what you think - I can use macros from stat.h if
>> required
>>
> You mean instead of 0644 ? That is discouraged nowadays.

yep and good.

Thanks,
Michal

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

end of thread, other threads:[~2017-08-14 14:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04  7:39 [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Michal Simek
2017-08-04  7:39 ` [PATCH 2/2] watchdog: cadence_wdt: Show information when driver is probed Michal Simek
2017-08-04 13:47   ` Guenter Roeck
2017-08-04 13:56     ` Michal Simek
2017-08-14 14:47   ` Guenter Roeck
2017-08-04 13:45 ` [PATCH 1/2] watchdog: cadence_wdt: Enable access to module parameters Guenter Roeck
2017-08-04 13:52   ` Michal Simek
2017-08-14 14:47 ` Guenter Roeck
2017-08-14 14:51   ` Michal Simek

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.