linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: xxm <xxm@rock-chips.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org,
	devicetree@vger.kernel.org, robh+dt@kernel.org,
	Johan Jonker <jbx6244@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Shawn Lin <shawn.lin@rock-chips.com>
Subject: Re: [PATCH v4 2/2] PCI: rockchip: add DesignWare based PCIe controller【请注意,邮件由kswilczynski@gmail.com代发】
Date: Mon, 22 Feb 2021 12:52:14 +0800	[thread overview]
Message-ID: <29259d39-7b46-6ce3-0b13-98840f1ad0bb@rock-chips.com> (raw)
In-Reply-To: <YDMW6OmnnrIgt1RR@rocinante>

Hi Krzysztof,

All your comments will be fixed in next patch, thanks for your review.

在 2021/2/22 10:28, Krzysztof Wilczyński 写道:
> Hi Simon,
>
> The subject should start with a capital letter.
>
> [...]
>> pcie-dw-rockchip is based on DWC IP. But pcie-rockchip-host
>> is Rockchip designed IP which is only used for RK3399. So all the following
>> non-RK3399 SoCs should use this driver.
> You might need to wrap the long line in the above.
>
> The commit message above could use some polish in terms of wording and
> adding more context - what are you adding, what is this driver going to
> support.  For example, what are the "all the following" SoCs?  Should
> there be a list?  Or did you mean "all the other (...)", etc.
>
> [...]
>> +config PCIE_ROCKCHIP_DW_HOST
>> +	bool "Rockchip DesignWare PCIe controller"
>> +	select PCIE_DW
>> +	select PCIE_DW_HOST
>> +	depends on ARCH_ROCKCHIP || COMPILE_TEST
>> +	depends on OF
>> +	help
>> +	  Enables support for the DW PCIe controller in the Rockchip SoC.
> Perhaps replacing "DW" with "DesignWare" would be better.  Also, do you
> want to mention here - for the sake of the future user - that this not
> intended to support RK3399 as per the commit message.
>
> [...]
>> +/*
>> + * PCIe host controller driver for Rockchip SoCs
> A nitpick.  Missing period at the end of the sentence.
>
> [...]
>> +static int rockchip_pcie_link_up(struct dw_pcie *pci)
>> +{
>> +	struct rockchip_pcie *rockchip = to_rockchip_pcie(pci);
>> +	u32 val = rockchip_pcie_readl_apb(rockchip, PCIE_CLIENT_LTSSM_STATUS);
>> +
>> +	if ((val & (PCIE_RDLH_LINKUP | PCIE_SMLH_LINKUP)) == 0x30000 &&
> [...]
>
> A suggestion.  Would it make sense to add a definition for this
> open-coded value of 0x30000 above?
>
>> +static void rockchip_pcie_fast_link_setup(struct rockchip_pcie *rockchip)
>> +{
>> +	u32 val;
>> +
>> +	/* LTSSM EN ctrl mode */
> [...]
>
> Does this comment above stands for "LTSSM enable control mode"?
>
>> +static int rockchip_pcie_phy_init(struct rockchip_pcie *rockchip)
>> +{
>> +	int ret;
>> +	struct device *dev = rockchip->pci.dev;
> These two variables should swap place to keep order of use, and to match
> how it has been done everywhere else in this drivers.
>
>> +
>> +	rockchip->phy = devm_phy_get(dev, "pcie-phy");
>> +	if (IS_ERR(rockchip->phy))
>> +		return dev_err_probe(dev, PTR_ERR(rockchip->phy),
>> +				     "missing phy\n");
> I would be "PHY" here.
>
>> +	ret = phy_init(rockchip->phy);
>> +	if (ret < 0)
>> +		return ret;
>> +
>> +	phy_power_on(rockchip->phy);
> [...]
>
> We should probably check phy_power_on() for a possible failure.  Some
> platforms also clean up on a failure from phy_init() and phy_power_on(),
> but I am not sure if this particular platform would require anything.
>
> [...]
>> +	/* DON'T MOVE ME: must be enable before phy init */
> It would be "PHY" here.
>
>> +	rockchip->vpcie3v3 = devm_regulator_get_optional(dev, "vpcie3v3");
>> +	if (IS_ERR(rockchip->vpcie3v3))
>> +		return dev_err_probe(dev, PTR_ERR(rockchip->rst),
>> +				     "failed to get vpcie3v3 regulator\n");
>> +
>> +	if (rockchip->vpcie3v3) {
>> +		ret = regulator_enable(rockchip->vpcie3v3);
>> +		if (ret) {
>> +			dev_err(dev, "fail to enable vpcie3v3 regulator\n");
> It would be "failed" here.
>
> [...]
>> +static const struct of_device_id rockchip_pcie_of_match[] = {
>> +	{ .compatible = "rockchip,rk3568-pcie", },
>> +	{ /* sentinel */ },
>> +};
> We could probably drop the comment about the "sentinel" from the above.
>
> Krzysztof
>
>



  reply	other threads:[~2021-02-22  4:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-27  2:24 [PATCH v4 1/2] dt-bindings: rockchip: Add DesignWare based PCIe controller Simon Xue
2021-01-27  2:25 ` [PATCH v4 2/2] PCI: rockchip: add " Simon Xue
2021-02-22  0:59   ` xxm
2021-02-22  2:28   ` Krzysztof Wilczyński
2021-02-22  4:52     ` xxm [this message]
2021-02-22  0:59 ` [PATCH v4 1/2] dt-bindings: rockchip: Add " xxm
2021-02-22  2:37 ` Krzysztof Wilczyński
2021-02-22  4:19   ` [PATCH v4 1/2] dt-bindings: rockchip: Add DesignWare based PCIe controller【请注意,邮件由kswilczynski@gmail.com代发】 xxm

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=29259d39-7b46-6ce3-0b13-98840f1ad0bb@rock-chips.com \
    --to=xxm@rock-chips.com \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=helgaas@kernel.org \
    --cc=jbx6244@gmail.com \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@rock-chips.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).