From: <sw617.shin@samsung.com>
To: "'Sam Protsenko'" <semen.protsenko@linaro.org>
Cc: <krzk@kernel.org>, <alim.akhtar@samsung.com>,
<wim@linux-watchdog.org>, <linux@roeck-us.net>,
<khwan.seo@samsung.com>, <dongil01.park@samsung.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-samsung-soc@vger.kernel.org>,
<linux-watchdog@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v4 3/4] watchdog: s3c2410_wdt: Increase max timeout value of watchdog
Date: Tue, 5 Aug 2025 13:23:07 +0900 [thread overview]
Message-ID: <000b01dc05c0$a50f5f20$ef2e1d60$@samsung.com> (raw)
In-Reply-To: <CAPLW+4mo-Fw5+KmwHdZGAM4uNpOWL6QakTgP-wMSxR=+dMGqsQ@mail.gmail.com>
On Saturday, August 2, 2025 at 1:37 PM Sam Protsenko <semen.protsenko@linaro.org> wrote:
> Not a strong point, but I'd break this patch into two:
> 1. Add 32-bit counter feature (without enabling it in exynosautov920
> implementation)
> 2. Enable 32-bit counter feature in exynosautov920
>
I'll break this patch into two in the next patch set.
> > #define S3C2410_WTCNT_MAXCNT 0xffff
>
> Suggest renaming this to S3C2410_WTCNT_MAXCNT_16, to emphasize the fact
> this value is for 16-bit counters. And for consistency with the below one.
>
> > +#define S3C2410_WTCNT_MAXCNT_32 0xffffffff
> >
I'll rename this to S3C2410_WTCNT_MAXCNT_16 in the next patch set.
> > + * %QUIRK_HAS_32BIT_MAXCNT: WTDAT and WTCNT are 32-bit registers.
> > + With these
>
> Why not name it like QUIRK_HAS_32BIT_CNT or QUIRK_HAS_32BIT_COUNTER?
> As I understand, the quirk means that the chip has 32-bit counter, so MAX
> bit is not really needed?
>
> > + * 32-bit registers, larger values to be set, which means that larger
> > + timeouts
>
> Spelling: "to be set" -> "will be set" (or "have to be set").
I'll modify this in the next patch set.
> > + unsigned int max_cnt;
>
> Maybe make it u32? It definitely refers to a 32-bit register value, so
> will be more explicit that way. Not a strong opinion though.
>
I'll change this to u32 in the next patch set.
> > };
> >
> > static const struct s3c2410_wdt_variant drv_data_s3c2410 = {
> > @@ -349,7 +356,7 @@ static const struct s3c2410_wdt_variant
> drv_data_exynosautov920_cl0 = {
> > .cnt_en_bit = 8,
> > .quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET |
> > QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN |
> > - QUIRK_HAS_DBGACK_BIT,
> > + QUIRK_HAS_DBGACK_BIT | QUIRK_HAS_32BIT_MAXCNT,
> > };
> >
> > static const struct s3c2410_wdt_variant drv_data_exynosautov920_cl1 = {
> > @@ -362,7 +369,7 @@ static const struct s3c2410_wdt_variant
> drv_data_exynosautov920_cl1 = {
> > .cnt_en_bit = 8,
> > .quirks = QUIRK_HAS_WTCLRINT_REG | QUIRK_HAS_PMU_MASK_RESET |
> > QUIRK_HAS_PMU_RST_STAT | QUIRK_HAS_PMU_CNT_EN |
> > - QUIRK_HAS_DBGACK_BIT,
> > + QUIRK_HAS_DBGACK_BIT | QUIRK_HAS_32BIT_MAXCNT,
>
> Yeah, I think it would be easier to review and handle further if this
> exynosautov920 enablement is extracted into a separate patch.
>
I'll break this patch into two in the next patch set.
> >
> > - if (count >= 0x10000) {
> > - divisor = DIV_ROUND_UP(count, 0xffff);
> > + if (count > wdt->max_cnt) {
>
> wdt->max_cnt + 1?
>
Yes, 0x10000 represented 'wdt->max_cnt + 1.'
Would you like to suggest any revisions?
> > + wdt->max_cnt = S3C2410_WTCNT_MAXCNT;
> > + if ((wdt->drv_data->quirks & QUIRK_HAS_32BIT_MAXCNT))
>
> Double braces don't seem to be needed.
>
> > + wdt->max_cnt = S3C2410_WTCNT_MAXCNT_32;
> > +
>
> Style (minor nitpick): this block can be more explicit, i.e.:
>
> if ((wdt->drv_data->quirks & QUIRK_HAS_32BIT_MAXCNT))
> wdt->max_cnt = S3C2410_WTCNT_MAXCNT_32;
> else
> wdt->max_cnt = S3C2410_WTCNT_MAXCNT;
>
I'll fix these in the next patch set.
next prev parent reply other threads:[~2025-08-05 4:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250724081336epcas2p30ba9afd1e78d9bbb60f44d24d1cf0acb@epcas2p3.samsung.com>
2025-07-24 8:08 ` [PATCH v4 0/4] Increase max timeout value of s3c2410 watchdog Sangwook Shin
2025-07-24 8:08 ` [PATCH v4 1/4] watchdog: s3c2410_wdt: Replace hardcoded values with macro definitions Sangwook Shin
2025-07-24 8:08 ` [PATCH v4 2/4] watchdog: s3c2410_wdt: Fix max_timeout being calculated larger Sangwook Shin
2025-08-02 4:11 ` Sam Protsenko
2025-08-05 4:22 ` sw617.shin
2025-08-05 4:47 ` Guenter Roeck
2025-08-05 5:03 ` Sam Protsenko
2025-08-05 7:26 ` sw617.shin
2025-08-05 13:30 ` Guenter Roeck
2025-08-05 22:53 ` Sam Protsenko
2025-08-06 4:51 ` sw617.shin
2025-07-24 8:08 ` [PATCH v4 3/4] watchdog: s3c2410_wdt: Increase max timeout value of watchdog Sangwook Shin
2025-08-02 4:36 ` Sam Protsenko
2025-08-05 4:23 ` sw617.shin [this message]
2025-08-05 4:51 ` Sam Protsenko
2025-07-24 8:08 ` [PATCH v4 4/4] watchdog: s3c2410_wdt: exynosautov9: Enable supported features Sangwook Shin
2025-08-02 4:39 ` Sam Protsenko
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='000b01dc05c0$a50f5f20$ef2e1d60$@samsung.com' \
--to=sw617.shin@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=dongil01.park@samsung.com \
--cc=khwan.seo@samsung.com \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=semen.protsenko@linaro.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 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.