From: <sw617.shin@samsung.com>
To: "'Sam Protsenko'" <semen.protsenko@linaro.org>,
"'Guenter Roeck'" <linux@roeck-us.net>
Cc: <krzk@kernel.org>, <alim.akhtar@samsung.com>,
<wim@linux-watchdog.org>, <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 2/4] watchdog: s3c2410_wdt: Fix max_timeout being calculated larger
Date: Tue, 5 Aug 2025 16:26:08 +0900 [thread overview]
Message-ID: <008501dc05da$36362600$a2a27200$@samsung.com> (raw)
In-Reply-To: <CAPLW+4kVMo68DAO0y_=m3k81Xeh4wYV9+KX3fg=5S7xwOh0O7Q@mail.gmail.com>
On Tuesday, August 5, 2025 at 2:03 PM Sam Protsenko <semen.protsenko@linaro.org> wrote:
>
> > > + u64 t_max = n_max / freq;
> > >
> >
> > Make sure this compiles on 32-bit builds.
> >
>
> Can you please elaborate what might be the possible problem -- just
> curious? I admit I never though about 32-bit case when writing that code,
> but don't see any immediate issues with that too.
>
In my opinion, it seems that Gunter Reck's explanation is correct.
I've found out that the error of "undefined reference to '__aeabi_uldivmod'" may occur when compiling new code on a 32-bit architecture.
If you don't mind, I would like to proceed with maintaining the previous revision below.
From my perspective, this approach appears to be the most reasonable solution for supporting both 32-bit and 64-bit architectures.
@@ -411,8 +411,8 @@ static inline unsigned int s3c2410wdt_max_timeout(struct s3c2410_wdt *wdt)
{
const unsigned long freq = s3c2410wdt_get_freq(wdt);
- return S3C2410_WTCNT_MAXCNT / (freq / (S3C2410_WTCON_PRESCALE_MAX + 1)
- / S3C2410_WTCON_MAXDIV);
+ return S3C2410_WTCNT_MAXCNT / DIV_ROUND_UP(freq,
+ (S3C2410_WTCON_PRESCALE_MAX + 1) * S3C2410_WTCON_MAXDIV);
}
next prev parent reply other threads:[~2025-08-05 7:26 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
[not found] ` <CGME20250724081336epcas2p31c2e3cbed1d3a7bf30a9fb664e6cb92b@epcas2p3.samsung.com>
2025-07-24 8:08 ` [PATCH v4 1/4] watchdog: s3c2410_wdt: Replace hardcoded values with macro definitions Sangwook Shin
[not found] ` <CGME20250724081336epcas2p38e95932ddc5c702e05a6436f05582993@epcas2p3.samsung.com>
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 [this message]
2025-08-05 13:30 ` Guenter Roeck
2025-08-05 22:53 ` Sam Protsenko
2025-08-06 4:51 ` sw617.shin
[not found] ` <CGME20250724081337epcas2p31f594b6e9ab87e24c94f11dea4070956@epcas2p3.samsung.com>
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
2025-08-05 4:51 ` Sam Protsenko
[not found] ` <CGME20250724081337epcas2p430db7d7514b8cc05e41001f17b8b0d45@epcas2p4.samsung.com>
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='008501dc05da$36362600$a2a27200$@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®