* [PATCH] watchdog: qcom: Report reboot reason
@ 2016-04-05 0:37 Guenter Roeck
2016-04-05 19:07 ` Grant Grundler
2016-05-14 16:35 ` Wim Van Sebroeck
0 siblings, 2 replies; 7+ messages in thread
From: Guenter Roeck @ 2016-04-05 0:37 UTC (permalink / raw)
To: Wim Van Sebroeck
Cc: Guenter Roeck, linux-watchdog, linux-kernel, Guenter Roeck,
Grant Grundler
The Qualcom watchdog timer block reports if the system was reset by the
watchdog. Pass the information to user space.
Cc: Grant Grundler <grundler@chromium.org>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
---
drivers/watchdog/qcom-wdt.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
index 20563cc..a043fa4 100644
--- a/drivers/watchdog/qcom-wdt.c
+++ b/drivers/watchdog/qcom-wdt.c
@@ -21,6 +21,7 @@
#define WDT_RST 0x38
#define WDT_EN 0x40
+#define WDT_STS 0x44
#define WDT_BITE_TIME 0x5C
struct qcom_wdt {
@@ -108,7 +109,8 @@ static const struct watchdog_ops qcom_wdt_ops = {
static const struct watchdog_info qcom_wdt_info = {
.options = WDIOF_KEEPALIVEPING
| WDIOF_MAGICCLOSE
- | WDIOF_SETTIMEOUT,
+ | WDIOF_SETTIMEOUT
+ | WDIOF_CARDRESET,
.identity = KBUILD_MODNAME,
};
@@ -171,6 +173,9 @@ static int qcom_wdt_probe(struct platform_device *pdev)
wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
wdt->wdd.parent = &pdev->dev;
+ if (readl(wdt->base + WDT_STS) & 1)
+ wdt->wdd.bootstatus = WDIOF_CARDRESET;
+
/*
* If 'timeout-sec' unspecified in devicetree, assume a 30 second
* default, unless the max timeout is less than 30 seconds, then use
--
2.8.0.rc3.226.g39d4020
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] watchdog: qcom: Report reboot reason
2016-04-05 0:37 [PATCH] watchdog: qcom: Report reboot reason Guenter Roeck
@ 2016-04-05 19:07 ` Grant Grundler
2016-05-04 1:36 ` Grant Grundler
2016-05-14 16:35 ` Wim Van Sebroeck
1 sibling, 1 reply; 7+ messages in thread
From: Grant Grundler @ 2016-04-05 19:07 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Wim Van Sebroeck, Guenter Roeck, linux-watchdog, LKML
On Mon, Apr 4, 2016 at 5:37 PM, Guenter Roeck <groeck@chromium.org> wrote:
> The Qualcom watchdog timer block reports if the system was reset by the
> watchdog. Pass the information to user space.
>
> Cc: Grant Grundler <grundler@chromium.org>
> Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Grant Grundler <grundler@chromium.org>
Tested-by: Grant Grundler <grundler@chromium.org>
Thanks Guenter! :)
FTR, this landed in the chromeos-3.14 (and chromeos-3.18 shortly)
branches and will be included in a future update for TP-Link Onhub
devices.
cheers,
grant
> ---
> drivers/watchdog/qcom-wdt.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
> index 20563cc..a043fa4 100644
> --- a/drivers/watchdog/qcom-wdt.c
> +++ b/drivers/watchdog/qcom-wdt.c
> @@ -21,6 +21,7 @@
>
> #define WDT_RST 0x38
> #define WDT_EN 0x40
> +#define WDT_STS 0x44
> #define WDT_BITE_TIME 0x5C
>
> struct qcom_wdt {
> @@ -108,7 +109,8 @@ static const struct watchdog_ops qcom_wdt_ops = {
> static const struct watchdog_info qcom_wdt_info = {
> .options = WDIOF_KEEPALIVEPING
> | WDIOF_MAGICCLOSE
> - | WDIOF_SETTIMEOUT,
> + | WDIOF_SETTIMEOUT
> + | WDIOF_CARDRESET,
> .identity = KBUILD_MODNAME,
> };
>
> @@ -171,6 +173,9 @@ static int qcom_wdt_probe(struct platform_device *pdev)
> wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
> wdt->wdd.parent = &pdev->dev;
>
> + if (readl(wdt->base + WDT_STS) & 1)
> + wdt->wdd.bootstatus = WDIOF_CARDRESET;
> +
> /*
> * If 'timeout-sec' unspecified in devicetree, assume a 30 second
> * default, unless the max timeout is less than 30 seconds, then use
> --
> 2.8.0.rc3.226.g39d4020
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] watchdog: qcom: Report reboot reason
2016-04-05 19:07 ` Grant Grundler
@ 2016-05-04 1:36 ` Grant Grundler
2016-05-04 2:01 ` Guenter Roeck
0 siblings, 1 reply; 7+ messages in thread
From: Grant Grundler @ 2016-05-04 1:36 UTC (permalink / raw)
To: Grant Grundler
Cc: Guenter Roeck, Wim Van Sebroeck, Guenter Roeck, linux-watchdog, LKML
Ping? Did this change get accepted?
cheers,
grant
On Tue, Apr 5, 2016 at 12:07 PM, Grant Grundler <grundler@chromium.org> wrote:
> On Mon, Apr 4, 2016 at 5:37 PM, Guenter Roeck <groeck@chromium.org> wrote:
>> The Qualcom watchdog timer block reports if the system was reset by the
>> watchdog. Pass the information to user space.
>>
>> Cc: Grant Grundler <grundler@chromium.org>
>> Signed-off-by: Guenter Roeck <groeck@chromium.org>
>
> Reviewed-by: Grant Grundler <grundler@chromium.org>
> Tested-by: Grant Grundler <grundler@chromium.org>
>
> Thanks Guenter! :)
>
> FTR, this landed in the chromeos-3.14 (and chromeos-3.18 shortly)
> branches and will be included in a future update for TP-Link Onhub
> devices.
>
> cheers,
> grant
>
>> ---
>> drivers/watchdog/qcom-wdt.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
>> index 20563cc..a043fa4 100644
>> --- a/drivers/watchdog/qcom-wdt.c
>> +++ b/drivers/watchdog/qcom-wdt.c
>> @@ -21,6 +21,7 @@
>>
>> #define WDT_RST 0x38
>> #define WDT_EN 0x40
>> +#define WDT_STS 0x44
>> #define WDT_BITE_TIME 0x5C
>>
>> struct qcom_wdt {
>> @@ -108,7 +109,8 @@ static const struct watchdog_ops qcom_wdt_ops = {
>> static const struct watchdog_info qcom_wdt_info = {
>> .options = WDIOF_KEEPALIVEPING
>> | WDIOF_MAGICCLOSE
>> - | WDIOF_SETTIMEOUT,
>> + | WDIOF_SETTIMEOUT
>> + | WDIOF_CARDRESET,
>> .identity = KBUILD_MODNAME,
>> };
>>
>> @@ -171,6 +173,9 @@ static int qcom_wdt_probe(struct platform_device *pdev)
>> wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
>> wdt->wdd.parent = &pdev->dev;
>>
>> + if (readl(wdt->base + WDT_STS) & 1)
>> + wdt->wdd.bootstatus = WDIOF_CARDRESET;
>> +
>> /*
>> * If 'timeout-sec' unspecified in devicetree, assume a 30 second
>> * default, unless the max timeout is less than 30 seconds, then use
>> --
>> 2.8.0.rc3.226.g39d4020
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] watchdog: qcom: Report reboot reason
2016-05-04 1:36 ` Grant Grundler
@ 2016-05-04 2:01 ` Guenter Roeck
2016-05-04 2:07 ` Grant Grundler
0 siblings, 1 reply; 7+ messages in thread
From: Guenter Roeck @ 2016-05-04 2:01 UTC (permalink / raw)
To: Grant Grundler; +Cc: Guenter Roeck, Wim Van Sebroeck, linux-watchdog, LKML
On 05/03/2016 06:36 PM, Grant Grundler wrote:
> Ping? Did this change get accepted?
>
Hi Grant,
Should be. It is in my watchdog-next branch. I plan to send
a pull request to Wim early next week.
Guenter
> cheers,
> grant
>
> On Tue, Apr 5, 2016 at 12:07 PM, Grant Grundler <grundler@chromium.org> wrote:
>> On Mon, Apr 4, 2016 at 5:37 PM, Guenter Roeck <groeck@chromium.org> wrote:
>>> The Qualcom watchdog timer block reports if the system was reset by the
>>> watchdog. Pass the information to user space.
>>>
>>> Cc: Grant Grundler <grundler@chromium.org>
>>> Signed-off-by: Guenter Roeck <groeck@chromium.org>
>>
>> Reviewed-by: Grant Grundler <grundler@chromium.org>
>> Tested-by: Grant Grundler <grundler@chromium.org>
>>
>> Thanks Guenter! :)
>>
>> FTR, this landed in the chromeos-3.14 (and chromeos-3.18 shortly)
>> branches and will be included in a future update for TP-Link Onhub
>> devices.
>>
>> cheers,
>> grant
>>
>>> ---
>>> drivers/watchdog/qcom-wdt.c | 7 ++++++-
>>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
>>> index 20563cc..a043fa4 100644
>>> --- a/drivers/watchdog/qcom-wdt.c
>>> +++ b/drivers/watchdog/qcom-wdt.c
>>> @@ -21,6 +21,7 @@
>>>
>>> #define WDT_RST 0x38
>>> #define WDT_EN 0x40
>>> +#define WDT_STS 0x44
>>> #define WDT_BITE_TIME 0x5C
>>>
>>> struct qcom_wdt {
>>> @@ -108,7 +109,8 @@ static const struct watchdog_ops qcom_wdt_ops = {
>>> static const struct watchdog_info qcom_wdt_info = {
>>> .options = WDIOF_KEEPALIVEPING
>>> | WDIOF_MAGICCLOSE
>>> - | WDIOF_SETTIMEOUT,
>>> + | WDIOF_SETTIMEOUT
>>> + | WDIOF_CARDRESET,
>>> .identity = KBUILD_MODNAME,
>>> };
>>>
>>> @@ -171,6 +173,9 @@ static int qcom_wdt_probe(struct platform_device *pdev)
>>> wdt->wdd.max_timeout = 0x10000000U / wdt->rate;
>>> wdt->wdd.parent = &pdev->dev;
>>>
>>> + if (readl(wdt->base + WDT_STS) & 1)
>>> + wdt->wdd.bootstatus = WDIOF_CARDRESET;
>>> +
>>> /*
>>> * If 'timeout-sec' unspecified in devicetree, assume a 30 second
>>> * default, unless the max timeout is less than 30 seconds, then use
>>> --
>>> 2.8.0.rc3.226.g39d4020
>>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] watchdog: qcom: Report reboot reason
2016-05-04 2:01 ` Guenter Roeck
@ 2016-05-04 2:07 ` Grant Grundler
0 siblings, 0 replies; 7+ messages in thread
From: Grant Grundler @ 2016-05-04 2:07 UTC (permalink / raw)
To: Guenter Roeck
Cc: Grant Grundler, Guenter Roeck, Wim Van Sebroeck, linux-watchdog, LKML
On Tue, May 3, 2016 at 7:01 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> On 05/03/2016 06:36 PM, Grant Grundler wrote:
>>
>> Ping? Did this change get accepted?
>>
>
> Hi Grant,
>
> Should be. It is in my watchdog-next branch. I plan to send
> a pull request to Wim early next week.
Hi Guenter!
Excellent - I just hadn't see any ACK. Thanks! :)
grant
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] watchdog: qcom: Report reboot reason
2016-04-05 0:37 [PATCH] watchdog: qcom: Report reboot reason Guenter Roeck
2016-04-05 19:07 ` Grant Grundler
@ 2016-05-14 16:35 ` Wim Van Sebroeck
2016-05-16 16:17 ` Grant Grundler
1 sibling, 1 reply; 7+ messages in thread
From: Wim Van Sebroeck @ 2016-05-14 16:35 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Guenter Roeck, linux-watchdog, linux-kernel, Grant Grundler
Hi Guenter,
> The Qualcom watchdog timer block reports if the system was reset by the
> watchdog. Pass the information to user space.
>
> Cc: Grant Grundler <grundler@chromium.org>
> Signed-off-by: Guenter Roeck <groeck@chromium.org>
> ---
> drivers/watchdog/qcom-wdt.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
This patch has been added into linux-watchdog-next.
Kind regards,
Wim.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] watchdog: qcom: Report reboot reason
2016-05-14 16:35 ` Wim Van Sebroeck
@ 2016-05-16 16:17 ` Grant Grundler
0 siblings, 0 replies; 7+ messages in thread
From: Grant Grundler @ 2016-05-16 16:17 UTC (permalink / raw)
To: Wim Van Sebroeck
Cc: Guenter Roeck, Guenter Roeck, linux-watchdog, LKML, Grant Grundler
[plain text this time...]
On Sat, May 14, 2016 at 9:35 AM, Wim Van Sebroeck <wim@iguana.be> wrote:
>
> Hi Guenter,
>
> > The Qualcom watchdog timer block reports if the system was reset by the
> > watchdog. Pass the information to user space.
> >
> > Cc: Grant Grundler <grundler@chromium.org>
> > Signed-off-by: Guenter Roeck <groeck@chromium.org>
> > ---
> > drivers/watchdog/qcom-wdt.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
>
> This patch has been added into linux-watchdog-next.
Awesome - thanks Wim!
cheers,
grant
>
> Kind regards,
> Wim.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-05-16 16:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05 0:37 [PATCH] watchdog: qcom: Report reboot reason Guenter Roeck
2016-04-05 19:07 ` Grant Grundler
2016-05-04 1:36 ` Grant Grundler
2016-05-04 2:01 ` Guenter Roeck
2016-05-04 2:07 ` Grant Grundler
2016-05-14 16:35 ` Wim Van Sebroeck
2016-05-16 16:17 ` Grant Grundler
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).