From: kbuild test robot <lkp@intel.com>
To: Eugen.Hristev@microchip.com
Cc: kbuild-all@01.org, wim@linux-watchdog.org, linux@roeck-us.net,
robh+dt@kernel.org, linux-watchdog@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.or, Nicolas.Ferre@microchip.com,
alexandre.belloni@bootlin.com, Eugen.Hristev@microchip.com
Subject: Re: [PATCH 2/3] watchdog: sam9x60_wdt: introduce sam9x60 watchdog timer driver
Date: Wed, 2 Oct 2019 21:38:37 +0800 [thread overview]
Message-ID: <201910022136.pzeBchGD%lkp@intel.com> (raw)
In-Reply-To: <1570001371-8174-2-git-send-email-eugen.hristev@microchip.com>
[-- Attachment #1: Type: text/plain, Size: 5670 bytes --]
Hi,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[cannot apply to v5.4-rc1 next-20191002]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Eugen-Hristev-microchip-com/dt-bindings-watchdog-sam9x60_wdt-add-bindings/20191002-200155
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers//watchdog/sam9x60_wdt.c: In function 'sam9x60_wdt_ping':
>> drivers//watchdog/sam9x60_wdt.c:23:24: warning: large integer implicitly truncated to unsigned type [-Woverflow]
#define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */
^
>> drivers//watchdog/sam9x60_wdt.c:126:30: note: in expansion of macro 'AT91_WDT_KEY'
wdt_write(wdt, AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
^~~~~~~~~~~~
vim +/AT91_WDT_KEY +126 drivers//watchdog/sam9x60_wdt.c
20
21 #define AT91_WDT_CR 0x00 /* Watchdog Control Register */
22 #define AT91_WDT_WDRSTT BIT(0) /* Restart */
> 23 #define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */
24
25 #define AT91_WDT_MR 0x04 /* Watchdog Mode Register */
26 #define AT91_WDT_PERIODRST BIT(4) /* Period Reset */
27 #define AT91_WDT_RPTHRST BIT(5) /* Minimum Restart Period */
28 #define AT91_WDT_WDDIS BIT(12) /* Disable */
29 #define AT91_WDT_WDDBGHLT BIT(28) /* Debug Halt */
30 #define AT91_WDT_WDIDLEHLT BIT(29) /* Idle Halt */
31
32 #define AT91_WDT_VR 0x08 /* Watchdog Timer Value Register */
33
34 #define AT91_WDT_WLR 0x0c
35 #define AT91_WDT_COUNTER (0xfff << 0) /* Watchdog Period Value */
36 #define AT91_WDT_SET_COUNTER(x) ((x) & AT91_WDT_COUNTER)
37
38 #define AT91_WDT_IER 0x14 /* Interrupt Enable Register */
39 #define AT91_WDT_PERINT BIT(0) /* Period Interrupt Enable */
40 #define AT91_WDT_IDR 0x18 /* Interrupt Disable Register */
41 #define AT91_WDT_ISR 0x1c /* Interrupt Status Register */
42
43 /* minimum and maximum watchdog timeout, in seconds */
44 #define MIN_WDT_TIMEOUT 1
45 #define MAX_WDT_TIMEOUT 16
46 #define WDT_DEFAULT_TIMEOUT MAX_WDT_TIMEOUT
47
48 #define WDT_SEC2TICKS(s) ((s) ? (((s) << 8) - 1) : 0)
49
50 struct sam9x60_wdt {
51 struct watchdog_device wdd;
52 void __iomem *reg_base;
53 u32 mr;
54 u32 ir;
55 unsigned long last_ping;
56 };
57
58 static int wdt_timeout;
59 static bool nowayout = WATCHDOG_NOWAYOUT;
60
61 module_param(wdt_timeout, int, 0);
62 MODULE_PARM_DESC(wdt_timeout,
63 "Watchdog timeout in seconds. (default = "
64 __MODULE_STRING(WDT_DEFAULT_TIMEOUT) ")");
65
66 module_param(nowayout, bool, 0);
67 MODULE_PARM_DESC(nowayout,
68 "Watchdog cannot be stopped once started (default="
69 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
70
71 #define wdt_enabled (!(wdt->mr & AT91_WDT_WDDIS))
72
73 #define wdt_read(wdt, field) \
74 readl_relaxed((wdt)->reg_base + (field))
75
76 /* 4 slow clock periods is 4/32768 = 122.07us*/
77 #define WDT_DELAY usecs_to_jiffies(123)
78
79 static void wdt_write(struct sam9x60_wdt *wdt, u32 field, u32 val)
80 {
81 /*
82 * WDT_CR and WDT_MR must not be modified within three slow clock
83 * periods following a restart of the watchdog performed by a write
84 * access in WDT_CR.
85 */
86 while (time_before(jiffies, wdt->last_ping + WDT_DELAY))
87 usleep_range(30, 125);
88 writel_relaxed(val, wdt->reg_base + field);
89 wdt->last_ping = jiffies;
90 }
91
92 static void wdt_write_nosleep(struct sam9x60_wdt *wdt, u32 field, u32 val)
93 {
94 if (time_before(jiffies, wdt->last_ping + WDT_DELAY))
95 usleep_range(123, 250);
96 writel_relaxed(val, wdt->reg_base + field);
97 wdt->last_ping = jiffies;
98 }
99
100 static int sam9x60_wdt_start(struct watchdog_device *wdd)
101 {
102 struct sam9x60_wdt *wdt = watchdog_get_drvdata(wdd);
103
104 wdt->mr &= ~AT91_WDT_WDDIS;
105 wdt_write(wdt, AT91_WDT_MR, wdt->mr);
106 wdt_write_nosleep(wdt, AT91_WDT_IER, wdt->ir);
107
108 return 0;
109 }
110
111 static int sam9x60_wdt_stop(struct watchdog_device *wdd)
112 {
113 struct sam9x60_wdt *wdt = watchdog_get_drvdata(wdd);
114
115 wdt->mr |= AT91_WDT_WDDIS;
116 wdt_write(wdt, AT91_WDT_MR, wdt->mr);
117 wdt_write_nosleep(wdt, AT91_WDT_IDR, wdt->ir);
118
119 return 0;
120 }
121
122 static int sam9x60_wdt_ping(struct watchdog_device *wdd)
123 {
124 struct sam9x60_wdt *wdt = watchdog_get_drvdata(wdd);
125
> 126 wdt_write(wdt, AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT);
127
128 return 0;
129 }
130
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54932 bytes --]
next prev parent reply other threads:[~2019-10-02 13:39 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 7:35 [PATCH 1/3] dt-bindings: watchdog: sam9x60_wdt: add bindings Eugen.Hristev
2019-10-02 7:35 ` [PATCH 2/3] watchdog: sam9x60_wdt: introduce sam9x60 watchdog timer driver Eugen.Hristev
2019-10-02 10:23 ` Alexandre Belloni
2019-10-02 11:07 ` Eugen.Hristev
2019-10-02 13:16 ` Guenter Roeck
2019-10-07 7:58 ` Eugen.Hristev
2019-10-07 12:36 ` Guenter Roeck
2019-10-07 13:14 ` Alexandre Belloni
2019-10-07 14:17 ` Eugen.Hristev
2019-10-02 13:38 ` kbuild test robot [this message]
2019-10-02 7:35 ` [PATCH 3/3] MAINTAINERS: add sam9x60_wdt Eugen.Hristev
2019-10-02 9:56 ` [PATCH 1/3] dt-bindings: watchdog: sam9x60_wdt: add bindings Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201910022136.pzeBchGD%lkp@intel.com \
--to=lkp@intel.com \
--cc=Eugen.Hristev@microchip.com \
--cc=Nicolas.Ferre@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=devicetree@vger.kernel.org \
--cc=kbuild-all@01.org \
--cc=linux-arm-kernel@lists.infradead.or \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).