All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ayush Singh <ayush@beagleboard.org>
To: Tomasz Unger <tomasz.unger@yahoo.pl>
Cc: Ayush Singh <ayushdevel1325@gmail.com>,
	 Johan Hovold <johan@kernel.org>,  Alex Elder <elder@kernel.org>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Ayush Singh <ayush@beagleboard.org>,
	greybus-dev@lists.linaro.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] greybus: gb-beagleplay: Pass jiffies to serdev_device_wait_until_sent()
Date: Sat, 05 Dec 2026 19:15:32 +0530	[thread overview]
Message-ID: <87v7576dtv.fsf@gmail.com> (raw)
In-Reply-To: <20261203-gb-beagleplay-wait-until-sent-jiffies-v1-1-e821aba69c25@yahoo.pl>

Tomasz Unger <tomasz.unger@yahoo.pl> writes:

> 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>
>

Reviewed-by: Ayush Singh <ayush@beagleboard.org>

LGTM

Best Regards,
Ayush Singh

      parent reply	other threads:[~2026-12-05 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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
2026-12-05 13:45   ` Ayush Singh [this message]

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=87v7576dtv.fsf@gmail.com \
    --to=ayush@beagleboard.org \
    --cc=ayushdevel1325@gmail.com \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomasz.unger@yahoo.pl \
    /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.