From: Kalle Valo <kvalo@codeaurora.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: zajec5@gmail.com, hauke@hauke-m.de,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bcma: Replace mdelay with usleep_range in bcma_pmu_resources_init
Date: Fri, 26 Jan 2018 18:13:01 +0200 [thread overview]
Message-ID: <87y3kkr436.fsf@purkki.adurom.net> (raw)
In-Reply-To: <1516958011-303-1-git-send-email-baijiaju1990@gmail.com> (Jia-Ju Bai's message of "Fri, 26 Jan 2018 17:13:31 +0800")
Jia-Ju Bai <baijiaju1990@gmail.com> writes:
> After checking all possible call chains to bcma_pmu_resources_init() here,
> my tool finds that this function is never called in atomic context,
> namely never in an interrupt handler or holding a spinlock.
> Thus mdelay can be replaced with usleep_range to avoid busy wait.
>
> This is found by a static analysis tool named DCNS written by myself.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
> drivers/bcma/driver_chipcommon_pmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bcma/driver_chipcommon_pmu.c b/drivers/bcma/driver_chipcommon_pmu.c
> index f1eb4d3..478948c 100644
> --- a/drivers/bcma/driver_chipcommon_pmu.c
> +++ b/drivers/bcma/driver_chipcommon_pmu.c
> @@ -203,7 +203,7 @@ static void bcma_pmu_resources_init(struct bcma_drv_cc *cc)
> * Add some delay; allow resources to come up and settle.
> * Delay is required for SoC (early init).
> */
> - mdelay(2);
> + usleep_range(1500, 2000);
I would like to have an ack from someone familiar with bcma before I
apply this.
--
Kalle Valo
next prev parent reply other threads:[~2018-01-26 16:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-26 9:13 Jia-Ju Bai
2018-01-26 16:13 ` Kalle Valo [this message]
2018-01-26 16:27 ` Larry Finger
2018-01-26 16:26 ` Larry Finger
2018-01-26 16:33 ` Jia-Ju Bai
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=87y3kkr436.fsf@purkki.adurom.net \
--to=kvalo@codeaurora.org \
--cc=baijiaju1990@gmail.com \
--cc=hauke@hauke-m.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=zajec5@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 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®