linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Dilip Kota <eswara.kota@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, kishon@ti.com,
	devicetree@vger.kernel.org, lee.jones@linaro.org, arnd@arndb.de,
	robh@kernel.org, andriy.shevchenko@intel.com,
	cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com,
	qi-ming.wu@intel.com, yixin.zhu@intel.com
Subject: Re: [PATCH v7 3/3] phy: intel: Add driver support for ComboPhy
Date: Tue, 5 May 2020 10:51:22 +0530	[thread overview]
Message-ID: <20200505052122.GW1375924@vkoul-mobl> (raw)
In-Reply-To: <0de7ba47-bc98-9267-46b4-230a86151c2d@linux.intel.com>

On 04-05-20, 17:32, Dilip Kota wrote:
> 
> On 5/4/2020 5:20 PM, Vinod Koul wrote:
> > On 04-05-20, 16:26, Dilip Kota wrote:
> > > On 5/4/2020 3:29 PM, Vinod Koul wrote:
> > > > On 30-04-20, 15:15, Dilip Kota wrote:
> > > > 
> > > > > +					  u32 mask, u32 val)
> > > > > +{
> > > > > +	u32 reg_val;
> > > > > +
> > > > > +	reg_val = readl(base + reg);
> > > > > +	reg_val &= ~mask;
> > > > > +	reg_val |= FIELD_PREP(mask, val);
> > > > > +	writel(reg_val, base + reg);
> > > > bypassing regmap here... why?
> > > It is not regmap address, one of the below two addresses are passed to this
> > > function.
> > okay, perhaps add a comment somewhere that regmap is not used for this
> > base?
> I dont see a need of adding a comment, describing don't do regmap here.

Driver uses regmap except here, which seems odd hence explanation
required for this.

> > 
> > > struct intel_combo_phy {
> > > ...
> > >          void __iomem            *app_base;
> > >          void __iomem            *cr_base;
> > > ...
> > > }
> > 
> > > > > +static int intel_cbphy_calibrate(struct phy *phy)
> > > > > +{
> > > > > +	struct intel_cbphy_iphy *iphy = phy_get_drvdata(phy);
> > > > > +	struct intel_combo_phy *cbphy = iphy->parent;
> > > > > +	void __iomem *cr_base = cbphy->cr_base;
> > > > > +	int val, ret, id;
> > > > > +
> > > > > +	if (cbphy->phy_mode != PHY_XPCS_MODE)
> > > > > +		return 0;
> > > > > +
> > > > > +	id = PHY_ID(iphy);
> > > > > +
> > > > > +	/* trigger auto RX adaptation */
> > > > > +	combo_phy_w32_off_mask(cr_base, CR_ADDR(PCS_XF_ATE_OVRD_IN_2, id),
> > > > > +			       ADAPT_REQ_MSK, 3);
> > > > > +	/* Wait RX adaptation to finish */
> > > > > +	ret = readl_poll_timeout(cr_base + CR_ADDR(PCS_XF_RX_ADAPT_ACK, id),
> > > > > +				 val, val & RX_ADAPT_ACK_BIT, 10, 5000);
> > > > > +	if (ret)
> > > > > +		dev_err(cbphy->dev, "RX Adaptation failed!\n");
> > > > you want to continue her and not return error?
> > > Next step is stopping the Adaptation, it should be done in both error and
> > > success case.
> > Again documenting this helps, pls add some comments on this behaviour
> Comments are already in place, mentioning Start and Stop of Rx Adaptation.
> And Stop is being is done as Start is triggered, so not needed to mention
> error and success.

Ok

-- 
~Vinod

  reply	other threads:[~2020-05-05  5:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30  7:15 [PATCH v7 0/3] Add Intel ComboPhy driver Dilip Kota
2020-04-30  7:15 ` [PATCH v7 1/3] dt-bindings: phy: Add PHY_TYPE_XPCS definition Dilip Kota
2020-04-30  7:15 ` [PATCH v7 2/3] dt-bindings: phy: Add YAML schemas for Intel ComboPhy Dilip Kota
2020-04-30  7:15 ` [PATCH v7 3/3] phy: intel: Add driver support for ComboPhy Dilip Kota
2020-05-04  7:29   ` Vinod Koul
2020-05-04  8:26     ` Dilip Kota
2020-05-04  9:20       ` Vinod Koul
2020-05-04  9:32         ` Dilip Kota
2020-05-05  5:21           ` Vinod Koul [this message]
2020-05-05  7:54             ` Dilip Kota
2020-05-11 10:06               ` Dilip Kota
2020-04-30  8:25 ` [PATCH v7 0/3] Add Intel ComboPhy driver Lee Jones
2020-04-30  9:43   ` Dilip Kota
2020-04-30 10:09     ` Lee Jones

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=20200505052122.GW1375924@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=arnd@arndb.de \
    --cc=cheol.yong.kim@intel.com \
    --cc=chuanhua.lei@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eswara.kota@linux.intel.com \
    --cc=kishon@ti.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qi-ming.wu@intel.com \
    --cc=robh@kernel.org \
    --cc=yixin.zhu@intel.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).