From: Dan Carpenter <error27@gmail.com>
To: sarbansah151@gmail.com
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH] staging: rtl8723bs: replace yield() with usleep_range() and cond_resched()
Date: Tue, 20 Oct 2026 10:08:52 +0300 [thread overview]
Message-ID: <atcThOcDxCXURMw4@stanley.mountain> (raw)
In-Reply-To: <CADyAg8dZO9PfT+wkj-qDAEAgBOs8AK0fjs5ma4q3qAT+BKxOBw@mail.gmail.com>
On Tue, Oct 20, 2026 at 12:59:47AM -0400, sarbansah151@gmail.com wrote:
> yield() merely reschedules the calling task and does not sleep, so
> using it in hardware poll loops spins the CPU while waiting on the
> device. checkpatch.pl flags this class of bug ("Using yield() is
> generally wrong", see yield() kernel-doc in sched/core.c).
>
> In the firmware download poll loops the git history shows a
> commented-out mdelay(10) at these sites, which indicates a ~10ms
> delay was intended; restore it with usleep_range(10000, 20000), the
> correct idiom for sub-20ms sleeps. In the firmware checksum/ready
> poll loops use usleep_range(1000, 2000) to rate-limit register
> polling.
>
> In the TX path there is an explicit comment that sleeping even 1ms
> causes throughput loss, so use cond_resched() there instead: it
> yields the CPU only when the scheduler actually wants to run
> something else.
>
> Signed-off-by: Sarban Sah <sarbansah151@gmail.com>
> ---
We generally wouldn't merge this without testing even without the
staging anti-AI rules, but mainly this driver has been deleted in
linux-next.
regards,
dan carpenter
prev parent reply other threads:[~2026-10-20 7:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 4:59 [PATCH] staging: rtl8723bs: replace yield() with usleep_range() and cond_resched() sarbansah151
2026-10-20 7:08 ` Dan Carpenter [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=atcThOcDxCXURMw4@stanley.mountain \
--to=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
--cc=sarbansah151@gmail.com \
/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.