From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Kishon Vijay Abraham I <kishon@ti.com>,
Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-ide@vger.kernel.org,
Sujit Reddy Thumma <sthumma@codeaurora.org>
Subject: Re: [PATCH v4 1/2] phy: qcom: Add driver for QCOM APQ8064 SATA PHY
Date: Wed, 16 Jul 2014 07:28:16 +0100 [thread overview]
Message-ID: <53C61B80.5070600@linaro.org> (raw)
In-Reply-To: <12555066.QsMd3v2SOo@amdc1032>
On 15/07/14 17:56, Bartlomiej Zolnierkiewicz wrote:
>> +
>> >+/* Helper function to do poll and timeout */
>> >+static int read_poll_timeout(void __iomem *addr, u32 mask)
>> >+{
>> >+ unsigned long timeout = jiffies + msecs_to_jiffies(TIMEOUT_MS);
>> >+
>> >+ do {
>> >+ if (readl_relaxed(addr) & mask)
>> >+ return 0;
>> >+
>> >+ usleep_range(DELAY_INTERVAL_US, DELAY_INTERVAL_US + 50);
>> >+ } while (!time_after(jiffies, timeout));
>> >+
>> >+ return -ETIMEDOUT;
>> >+}
> Thanks for reworking this code, unfortunately it still has a one
> (unlikely but still theoretically possible) problem. If there is
> i.e. a big IRQ load between first usleep_range() call and first
Very unlikely but as you said it possible in theory :-)
> time_after() check the function will timeout without checking
> the register. To fix it you needs to add an additonal register
> checking before returning -ETIMEDOUT value or replace time_after()
> condition with a fixed number of retries (100000 to cover 1sec
> timeout).
I will send out a fix on top of my previous patches to fix this.
thanks,
srini
next prev parent reply other threads:[~2014-07-16 6:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 18:00 [PATCH] phy: qcom: Add driver for QCOM APQ8064 SATA PHY Srinivas Kandagatla
2014-06-23 18:12 ` Kumar Gala
2014-06-23 18:38 ` Srinivas Kandagatla
2014-07-09 9:36 ` Srinivas Kandagatla
2014-07-09 10:08 ` Kishon Vijay Abraham I
2014-07-09 11:03 ` [PATCH v2 0/2] Add Qcom AP8064 SATA PHY support Srinivas Kandagatla
2014-07-09 11:04 ` [PATCH v2 1/2] phy: qcom: Add driver for QCOM APQ8064 SATA PHY Srinivas Kandagatla
2014-07-11 12:38 ` Bartlomiej Zolnierkiewicz
2014-07-11 13:39 ` Srinivas Kandagatla
2014-07-11 14:33 ` Bartlomiej Zolnierkiewicz
2014-07-11 19:42 ` Srinivas Kandagatla
2014-07-09 11:04 ` [PATCH v2 2/2] phy: qcom: Update APQ8064 PHY device tree bindings Srinivas Kandagatla
2014-07-14 8:47 ` [PATCH v3 0/2] phy: qcom: Add driver for QCOM APQ8064 SATA PHY Srinivas Kandagatla
2014-07-14 8:48 ` [PATCH v3 1/2] " Srinivas Kandagatla
2014-07-14 8:48 ` [PATCH v3 2/2] phy: qcom: Update APQ8064 PHY device tree bindings Srinivas Kandagatla
2014-07-14 10:30 ` [PATCH v3 0/2] phy: qcom: Add driver for QCOM APQ8064 SATA PHY Kishon Vijay Abraham I
2014-07-14 10:32 ` Srinivas Kandagatla
2014-07-14 11:17 ` [PATCH v4 " Srinivas Kandagatla
2014-07-14 11:17 ` [PATCH v4 1/2] " Srinivas Kandagatla
2014-07-15 16:56 ` Bartlomiej Zolnierkiewicz
2014-07-16 6:28 ` Srinivas Kandagatla [this message]
2014-07-14 11:18 ` [PATCH v4 2/2] phy: qcom: Add APQ8064 SATA PHY device tree bindings Srinivas Kandagatla
2014-07-14 10:53 ` [PATCH] phy: qcom: Add driver for QCOM APQ8064 SATA PHY kiran padwal
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=53C61B80.5070600@linaro.org \
--to=srinivas.kandagatla@linaro.org \
--cc=b.zolnierkie@samsung.com \
--cc=grant.likely@linaro.org \
--cc=kishon@ti.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sthumma@codeaurora.org \
/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).