The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] greybus: gb-beagleplay: Pass jiffies to serdev_device_wait_until_sent()
       [not found] <20261203-gb-beagleplay-wait-until-sent-jiffies-v1-1-e821aba69c25.ref@yahoo.pl>
@ 2026-12-02 23:45 ` Tomasz Unger
  2026-12-03 13:16   ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Unger @ 2026-12-02 23:45 UTC (permalink / raw)
  To: Ayush Singh, Johan Hovold, Alex Elder, Greg Kroah-Hartman
  Cc: Ayush Singh, greybus-dev, linux-kernel, Tomasz Unger

cc1352_prepare() passes CC1352_BOOTLOADER_TIMEOUT (2000, meant as
milliseconds) directly to serdev_device_wait_until_sent(), which takes
the timeout in jiffies. With HZ=250, as on the BeaglePlay, it waits up
to 8 seconds instead of 2.

Convert it with msecs_to_jiffies(), as the other users of this constant
in the driver already do.

Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API")
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
Verified on a BeaglePlay (HZ=250) with a kprobe on tty_wait_until_sent()
while re-uploading the image already in the CC1352 (the driver skips
reflashing): the timeout passed from cc1352_prepare() is 2000 without
this patch and 500 with it. The arm64 object code differs only in that
constant (#0x7d0 -> #0x1f4).

An AI coding assistant (Claude) helped find the bug and draft the fix;
the change was tested as described above.
---
 drivers/greybus/gb-beagleplay.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/greybus/gb-beagleplay.c b/drivers/greybus/gb-beagleplay.c
index 13cbd8c5e9d4..22bdfc8e5f4b 100644
--- a/drivers/greybus/gb-beagleplay.c
+++ b/drivers/greybus/gb-beagleplay.c
@@ -978,7 +978,8 @@ static enum fw_upload_err cc1352_prepare(struct fw_upload *fw_upload,
 	msleep(200);
 	flush_work(&bg->tx_work);
 
-	serdev_device_wait_until_sent(bg->sd, CC1352_BOOTLOADER_TIMEOUT);
+	serdev_device_wait_until_sent(bg->sd,
+				      msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
 
 	WRITE_ONCE(bg->flashing_mode, true);
 

---
base-commit: 4f6f0ad4a3322d445ac6cc8bba32cc35b4372a4a
change-id: 20261203-gb-beagleplay-wait-until-sent-jiffies-c4fc8dc89a7d

Best regards,
--  
Tomasz Unger <tomasz.unger@yahoo.pl>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] greybus: gb-beagleplay: Pass jiffies to serdev_device_wait_until_sent()
  2026-12-02 23:45 ` [PATCH] greybus: gb-beagleplay: Pass jiffies to serdev_device_wait_until_sent() Tomasz Unger
@ 2026-12-03 13:16   ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2026-12-03 13:16 UTC (permalink / raw)
  To: Tomasz Unger
  Cc: Ayush Singh, Alex Elder, Greg Kroah-Hartman, Ayush Singh,
	greybus-dev, linux-kernel

On Thu, Dec 03, 2026 at 12:45:42AM +0100, Tomasz Unger wrote:
> cc1352_prepare() passes CC1352_BOOTLOADER_TIMEOUT (2000, meant as
> milliseconds) directly to serdev_device_wait_until_sent(), which takes
> the timeout in jiffies. With HZ=250, as on the BeaglePlay, it waits up
> to 8 seconds instead of 2.
> 
> Convert it with msecs_to_jiffies(), as the other users of this constant
> in the driver already do.
> 
> Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API")
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---

Looks correct:

Reviewed-by: Johan Hovold <johan@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-03 13:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261203-gb-beagleplay-wait-until-sent-jiffies-v1-1-e821aba69c25.ref@yahoo.pl>
2026-12-02 23:45 ` [PATCH] greybus: gb-beagleplay: Pass jiffies to serdev_device_wait_until_sent() Tomasz Unger
2026-12-03 13:16   ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox