From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Antoine Tenart <antoine.tenart@bootlin.com>,
davem@davemloft.net, hkallweit1@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
alexandre.belloni@bootlin.com, thomas.petazzoni@bootlin.com,
allan.nielsen@microchip.com
Subject: Re: [PATCH net-next 4/4] net: phy: mscc-miim: read poll when high resolution timers are disabled
Date: Tue, 26 May 2020 15:05:34 -0700 [thread overview]
Message-ID: <7c969bd9-e9d9-3768-a258-527257cf1a5f@gmail.com> (raw)
In-Reply-To: <20200526220127.GS768009@lunn.ch>
On 5/26/2020 3:01 PM, Andrew Lunn wrote:
>>> +/* When high resolution timers aren't built-in: we can't use usleep_range() as
>>> + * we would sleep way too long. Use udelay() instead.
>>> + */
>>> +#define mscc_readl_poll_timeout(addr, val, cond, delay_us, timeout_us) \
>>> +({ \
>>> + if (!IS_ENABLED(CONFIG_HIGH_RES_TIMERS)) \
>>> + readl_poll_timeout_atomic(addr, val, cond, delay_us, \
>>> + timeout_us); \
>>> + readl_poll_timeout(addr, val, cond, delay_us, timeout_us); \
>>> +})
>>> +
>>
>> I would make this a regular function which would not harm the compiler's
>> ability to optimize it, but would give you type checking. With that fixed:
>
> Hi Florian
>
> cond makes that difficult, since it is not a parameter in the usual
> sense, but an expression to evaluate if the polling should terminate.
>
> readl_poll_timeout() and readl_poll_timeout_atomic() themselves are
> #define's, and there are more levels of macros under them.
Oh that's right, thanks for reminding me of this.
--
Florian
next prev parent reply other threads:[~2020-05-26 22:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-26 16:22 [PATCH net-next 0/4] net: phy: mscc-miim: reduce waiting time between MDIO transactions Antoine Tenart
2020-05-26 16:22 ` [PATCH net-next 1/4] net: phy: mscc-miim: use more reasonable delays Antoine Tenart
2020-05-26 21:04 ` Alexandre Belloni
2020-05-26 21:19 ` Florian Fainelli
2020-05-26 16:22 ` [PATCH net-next 2/4] net: phy: mscc-miim: remove redundant timeout check Antoine Tenart
2020-05-26 21:04 ` Alexandre Belloni
2020-05-26 21:19 ` Florian Fainelli
2020-05-26 16:22 ` [PATCH net-next 3/4] net: phy: mscc-miim: improve waiting logic Antoine Tenart
2020-05-26 21:07 ` Alexandre Belloni
2020-05-26 21:21 ` Florian Fainelli
2020-05-26 16:22 ` [PATCH net-next 4/4] net: phy: mscc-miim: read poll when high resolution timers are disabled Antoine Tenart
2020-05-26 21:22 ` Florian Fainelli
2020-05-26 22:01 ` Andrew Lunn
2020-05-26 22:05 ` Florian Fainelli [this message]
2020-05-26 17:01 ` [PATCH net-next 0/4] net: phy: mscc-miim: reduce waiting time between MDIO transactions Andrew Lunn
2020-05-27 7:00 ` Antoine Tenart
2020-05-26 22:34 ` David Miller
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=7c969bd9-e9d9-3768-a258-527257cf1a5f@gmail.com \
--to=f.fainelli@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=allan.nielsen@microchip.com \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.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).