devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jingoo Han <jg1.han@samsung.com>
To: 'Tanmay Inamdar' <tinamdar@apm.com>
Cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@apm.com, jcm@redhat.com,
	'Bjorn Helgaas' <bhelgaas@google.com>,
	'Arnd Bergmann' <arnd@arndb.de>,
	'Jason Gunthorpe' <jgunthorpe@obsidianresearch.com>,
	'Grant Likely' <grant.likely@linaro.org>,
	'Rob Herring' <robh+dt@kernel.org>,
	'Catalin Marinas' <catalin.marinas@arm.com>,
	'Rob Landley' <rob@landley.net>,
	'Liviu Dudau' <liviu.dudau@arm.com>,
	'Jingoo Han' <jg1.han@samsung.com>
Subject: Re: [PATCH v4 1/4] pci: APM X-Gene PCIe controller driver
Date: Fri, 07 Mar 2014 17:37:42 +0900	[thread overview]
Message-ID: <005901cf39e0$81ceb960$856c2c20$%han@samsung.com> (raw)
In-Reply-To: <1394085963-27553-2-git-send-email-tinamdar@apm.com>

On Thursday, March 06, 2014 3:06 PM, Tanmay Inamdar wrote:
> 

Hi Tanmay Inamdar,

I added some minor comments. :-)

> This patch adds the AppliedMicro X-Gene SOC PCIe controller driver.
> X-Gene PCIe controller supports maxmum upto 8 lanes and GEN3 speed.

Would you fix the followings?

s/maxmum/maximum
s/upto/up to

> X-Gene SOC supports maximum 5 PCIe ports.
> 
> Signed-off-by: Tanmay Inamdar <tinamdar@apm.com>
> ---
>  drivers/pci/host/Kconfig     |   10 +
>  drivers/pci/host/Makefile    |    1 +
>  drivers/pci/host/pci-xgene.c |  739 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 750 insertions(+)
>  create mode 100644 drivers/pci/host/pci-xgene.c

[.....]

> --- /dev/null
> +++ b/drivers/pci/host/pci-xgene.c

[.....]

> +
> +static int xgene_pcie_parse_map_dma_ranges(struct xgene_pcie_port *port)
> +{
> +	struct device_node *np = port->node;
> +	struct of_pci_range range;
> +	struct of_pci_range_parser parser;
> +	struct device *dev = port->dev;
> +	u8 ib_reg_mask = 0;
> +
> +	if (pci_dma_range_parser_init(&parser, np)) {
> +		dev_err(dev, "missing dma-ranges property\n");
> +		return -EINVAL;
> +	}
> +
> +	/* Get the dma-ranges from DT */
> +	for_each_of_pci_range(&parser, &range) {
> +		u64 end = range.cpu_addr + range.size - 1;
> +		dev_dbg(port->dev, "0x%08x 0x%016llx..0x%016llx -> 0x%016llx\n",
> +			range.flags, range.cpu_addr, end, range.pci_addr);
> +		xgene_pcie_setup_ib_reg(port, &range, &ib_reg_mask);
> +	}
> +	return 0;
> +}
> +
> +static int __init xgene_pcie_probe_bridge(struct platform_device *pdev)

Please, remove '__init' marker in order to fix section mismatch
warning.

> +{
> +	struct device_node *np = of_node_get(pdev->dev.of_node);
> +	struct xgene_pcie_port *port;
> +	struct pci_host_bridge *bridge;
> +	resource_size_t lastbus;
> +	u32 lanes = 0, speed = 0;
> +	u64 cfg_addr = 0;
> +	int ret;
> +
> +	port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL);
> +	if (!port)
> +		return -ENOMEM;
> +	port->node = np;
> +	port->dev = &pdev->dev;
> +
> +	ret = xgene_pcie_map_reg(port, pdev, &cfg_addr);
> +	if (ret)
> +		return ret;
> +
> +	ret = xgene_pcie_init_port(port);
> +	if (ret)
> +		return ret;
> +	xgene_pcie_program_core(port->csr_base);
> +	xgene_pcie_setup_root_complex(port);
> +
> +	bridge = of_create_pci_host_bridge(&pdev->dev, &xgene_pcie_ops, port);
> +	if (IS_ERR_OR_NULL(bridge))
> +		return PTR_ERR(bridge);
> +
> +	ret = xgene_pcie_map_ranges(port, bridge, cfg_addr);
> +	if (ret)
> +		return ret;
> +
> +	ret = xgene_pcie_parse_map_dma_ranges(port);
> +	if (ret)
> +		return ret;
> +
> +	xgene_pcie_poll_linkup(port, &lanes, &speed);
> +	if (!port->link_up)
> +		dev_info(port->dev, "(rc) link down\n");
> +	else
> +		dev_info(port->dev, "(rc) x%d gen-%d link up\n",
> +				lanes, speed + 1);
> +	platform_set_drvdata(pdev, port);
> +	lastbus = pci_rescan_bus(bridge->bus);
> +	pci_bus_update_busn_res_end(bridge->bus, lastbus);
> +	return 0;
> +}
> +
> +static const struct of_device_id xgene_pcie_match_table[] __initconst = {

Please, remove '__initconst' marker in order to fix section mismatch
warning.

> +	{.compatible = "apm,xgene-pcie",},
> +	{},
> +};
> +
> +static struct platform_driver xgene_pcie_driver = {
> +	.driver = {
> +		   .name = "xgene-pcie",
> +		   .owner = THIS_MODULE,
> +		   .of_match_table = of_match_ptr(xgene_pcie_match_table),
> +		  },

Please fix this indent style, as below:

+	},

See you later. :-)

Best regards,
Jingoo Han

> +	.probe = xgene_pcie_probe_bridge,
> +};
> +module_platform_driver(xgene_pcie_driver);
> +
> +MODULE_AUTHOR("Tanmay Inamdar <tinamdar@apm.com>");
> +MODULE_DESCRIPTION("APM X-Gene PCIe driver");
> +MODULE_LICENSE("GPL v2");
> --
> 1.7.9.5

  reply	other threads:[~2014-03-07  8:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  6:05 [PATCH v4 0/4] APM X-Gene PCIe controller Tanmay Inamdar
2014-03-06  6:06 ` [PATCH v4 1/4] pci: APM X-Gene PCIe controller driver Tanmay Inamdar
2014-03-07  8:37   ` Jingoo Han [this message]
2014-03-07 18:32     ` Tanmay Inamdar
2014-03-14 12:18   ` Arnd Bergmann
2014-03-15  3:29     ` Tanmay Inamdar
2014-03-06  6:06 ` [PATCH v4 2/4] arm64: dts: APM X-Gene PCIe device tree nodes Tanmay Inamdar
2014-03-12  8:31   ` Jingoo Han
2014-03-12 16:44     ` Tanmay Inamdar
2014-03-14 12:07   ` Arnd Bergmann
2014-03-15  3:27     ` Tanmay Inamdar
2014-03-15  8:58       ` Arnd Bergmann
2014-03-06  6:06 ` [PATCH v4 3/4] dt-bindings: pci: xgene pcie device tree bindings Tanmay Inamdar
2014-03-06  6:06 ` [PATCH v4 4/4] MAINTAINERS: entry for APM X-Gene PCIe host driver Tanmay Inamdar

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='005901cf39e0$81ceb960$856c2c20$%han@samsung.com' \
    --to=jg1.han@samsung.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=jcm@redhat.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=patches@apm.com \
    --cc=rob@landley.net \
    --cc=robh+dt@kernel.org \
    --cc=tinamdar@apm.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).