2024-04-17 19:22:59

by Alexandre Belloni

[permalink] [raw]
Subject: [PATCH 1/2] rtc: rx8111: demote warnings to debug level

From: Alexandre Belloni <[email protected]>

The proper way for userspace to react on a read time error is to have a
look at the voltage low information. There is no point in cluttering dmesg
as it is often not even visible to the end user.

Signed-off-by: Alexandre Belloni <[email protected]>
---
drivers/rtc/rtc-rx8111.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/rtc/rtc-rx8111.c b/drivers/rtc/rtc-rx8111.c
index 62d2352de102..4a35bd921b33 100644
--- a/drivers/rtc/rtc-rx8111.c
+++ b/drivers/rtc/rtc-rx8111.c
@@ -170,14 +170,14 @@ static int rx8111_read_time(struct device *dev, struct rtc_time *tm)
}

if (FIELD_GET(RX8111_FLAG_XST_BIT, regval)) {
- dev_warn(data->dev,
- "Crystal oscillation stopped, time is not reliable\n");
+ dev_dbg(data->dev,
+ "Crystal oscillation stopped, time is not reliable\n");
return -EINVAL;
}

if (FIELD_GET(RX8111_FLAG_VLF_BIT, regval)) {
- dev_warn(data->dev,
- "Low voltage detected, time is not reliable\n");
+ dev_dbg(data->dev,
+ "Low voltage detected, time is not reliable\n");
return -EINVAL;
}

@@ -188,7 +188,7 @@ static int rx8111_read_time(struct device *dev, struct rtc_time *tm)
}

if (regval) {
- dev_warn(data->dev, "Clock stopped, time is not reliable\n");
+ dev_dbg(data->dev, "Clock stopped, time is not reliable\n");
return -EINVAL;
}

--
2.44.0



2024-04-19 11:03:32

by Waqar Hameed

[permalink] [raw]
Subject: Re: [PATCH 1/2] rtc: rx8111: demote warnings to debug level

On Wed, Apr 17, 2024 at 21:19 +0200 [email protected] wrote:

> From: Alexandre Belloni <[email protected]>
>
> The proper way for userspace to react on a read time error is to have a
> look at the voltage low information. There is no point in cluttering dmesg
> as it is often not even visible to the end user.
>
> Signed-off-by: Alexandre Belloni <[email protected]>
> ---
> drivers/rtc/rtc-rx8111.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/rtc/rtc-rx8111.c b/drivers/rtc/rtc-rx8111.c
> index 62d2352de102..4a35bd921b33 100644
> --- a/drivers/rtc/rtc-rx8111.c
> +++ b/drivers/rtc/rtc-rx8111.c
> @@ -170,14 +170,14 @@ static int rx8111_read_time(struct device *dev, struct rtc_time *tm)
> }
>
> if (FIELD_GET(RX8111_FLAG_XST_BIT, regval)) {
> - dev_warn(data->dev,
> - "Crystal oscillation stopped, time is not reliable\n");
> + dev_dbg(data->dev,
> + "Crystal oscillation stopped, time is not reliable\n");
> return -EINVAL;
> }
>
> if (FIELD_GET(RX8111_FLAG_VLF_BIT, regval)) {
> - dev_warn(data->dev,
> - "Low voltage detected, time is not reliable\n");
> + dev_dbg(data->dev,
> + "Low voltage detected, time is not reliable\n");
> return -EINVAL;
> }
>
> @@ -188,7 +188,7 @@ static int rx8111_read_time(struct device *dev, struct rtc_time *tm)
> }
>
> if (regval) {
> - dev_warn(data->dev, "Clock stopped, time is not reliable\n");
> + dev_dbg(data->dev, "Clock stopped, time is not reliable\n");
> return -EINVAL;
> }

There are several other drivers that uses `dev_warn()` in these cases,
and it was just followed here as well. I agree with you here though!

Reviewed-by: Waqar Hameed <[email protected]>