From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, YueHaibing <yuehaibing@huawei.com>,
linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] usb: gadget: bdc: use readl_poll_timeout() to simplify code
Date: Mon, 13 Jul 2020 11:06:14 +0800 [thread overview]
Message-ID: <1594609574.23885.35.camel@mhfsdcap03> (raw)
In-Reply-To: <159442422281.1987609.11864731950347548589@swboyd.mtv.corp.google.com>
On Fri, 2020-07-10 at 16:37 -0700, Stephen Boyd wrote:
> Quoting Chunfeng Yun (2020-07-09 20:30:56)
> > diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
> > index 02a3a77..fa173de 100644
> > --- a/drivers/usb/gadget/udc/bdc/bdc_core.c
> > +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
> > @@ -32,21 +33,14 @@
> > static int poll_oip(struct bdc *bdc, int usec)
>
> Can we change usec to unsigned? Not sure why negative time is important.
Yes, it's sensible to use unsigned.
>
> > {
> > u32 status;
> > - /* Poll till STS!= OIP */
> > - while (usec) {
> > - status = bdc_readl(bdc->regs, BDC_BDCSC);
> > - if (BDC_CSTS(status) != BDC_OIP) {
> > - dev_dbg(bdc->dev,
> > - "poll_oip complete status=%d",
> > - BDC_CSTS(status));
>
> This debug message was lost in the conversion. Any reason?
No, will add it back
>
> > - return 0;
> > - }
> > - udelay(10);
> > - usec -= 10;
> > - }
> > - dev_err(bdc->dev, "Err: operation timedout BDCSC: 0x%08x\n", status);
> > + int ret;
> >
> > - return -ETIMEDOUT;
> > + ret = readl_poll_timeout(bdc->regs + BDC_BDCSC, status,
> > + (BDC_CSTS(status) != BDC_OIP), 10, usec);
> > + if (ret)
> > + dev_err(bdc->dev, "Err: operation timedout BDCSC: 0x%08x\n", status);
>
> Please drop "Err:" as we have kernel log levels (i.e. dev_err() used
> here) for that.
Ok
Thanks
>
> > +
> > + return ret;
> > }
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-07-13 3:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 3:30 [PATCH] usb: gadget: bdc: use readl_poll_timeout() to simplify code Chunfeng Yun
2020-07-10 23:37 ` Stephen Boyd
2020-07-13 3:06 ` Chunfeng Yun [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=1594609574.23885.35.camel@mhfsdcap03 \
--to=chunfeng.yun@mediatek.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=swboyd@chromium.org \
--cc=yuehaibing@huawei.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;
as well as URLs for NNTP newsgroup(s).