linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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
Subject: Re: [PATCH v2 1/2] phy: qcom: Add driver for QCOM APQ8064 SATA PHY
Date: Fri, 11 Jul 2014 14:39:05 +0100	[thread overview]
Message-ID: <53BFE8F9.7050700@linaro.org> (raw)
In-Reply-To: <1828880.cILxhDlkNH@amdc1032>

Thankyou for the comments,

On 11/07/14 13:38, Bartlomiej Zolnierkiewicz wrote:
>
> Hi,
>
> On Wednesday, July 09, 2014 12:04:06 PM Srinivas Kandagatla wrote:
>> Add a PHY driver for uses with AHCI based SATA controller driver on the
>> APQ8064 family of SoCs.
>>
>> This patch is a forward port from Qualcomm's v3.4 andriod kernel.
>
> Android?
yep.
>
> unused define, please remove it
>
Will fix these instances in next version.
>> +
>> +#define UNIPHY_PLL_LOCK		BIT(0)
>> +#define SATA_PHY_TX_CAL		BIT(0)
>> +#define SATA_PHY_RX_CAL		BIT(0)
>> +
>> +/* default timeout set to 1 sec */
>> +#define TIMEOUT_MS		10000
>> +
>> +struct qcom_apq8064_sata_phy {
>> +	void __iomem *mmio;
>> +	struct clk *cfg_clk;
>> +	struct device *dev;
>> +};
>> +
>> +/* 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);
>> +	u32 val;
>> +
>> +	do {
>> +		cpu_relax();
>> +		val = readl_relaxed(addr);
>> +		if (val & mask)
>> +			break;
>> +	} while (!time_after(jiffies, timeout));
>
> It would be better to use usleep_[range]() (or even msleep() if needed)
> instead of just using cpu_relax().

We really want to poll the register here, usleep/msleep would be useful 
if we know already know how much delay is required, but in this case the 
its not true.

>> +
>> +static int qcom_apq8064_sata_phy_remove(struct platform_device *pdev)
>> +{
>> +	struct qcom_apq8064_sata_phy *phy = platform_get_drvdata(pdev);
>
> Doesn't this require to use platform_set_drvdata() first in the ->probe
> method?
Good spot, I will fix this in next version.

Thanks,
srini

  reply	other threads:[~2014-07-11 13:39 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 [this message]
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
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=53BFE8F9.7050700@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 \
    /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).