Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Minghuan Lian <Minghuan.Lian@freescale.com>
Cc: <linuxppc-dev@lists.ozlabs.org>,
	Zang Roy-R61911 <r61911@freescale.com>,
	Kumar Gala <galak@kernel.crashing.org>,
	Bjorn Helgaas <bhelgaas@google.com>, <linux-pci@vger.kernel.org>
Subject: Re: [PATCH 2/2] pci: fsl: rework PCI driver compatible with Layerscape
Date: Fri, 27 Sep 2013 11:54:07 -0500	[thread overview]
Message-ID: <1380300847.24959.394.camel@snotra.buserror.net> (raw)
In-Reply-To: <1379502122-20792-2-git-send-email-Minghuan.Lian@freescale.com>

On Wed, 2013-09-18 at 19:02 +0800, Minghuan Lian wrote:
> @@ -592,6 +719,7 @@ int fsl_pci_mcheck_exception(struct pt_regs *regs)
>  #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx)
>  
>  struct device_node *fsl_pci_primary;
> +extern const struct of_device_id fsl_pci_ids[];

Externs go in headers.

> -static int fsl_pci_probe(struct platform_device *pdev)
> +static int __init fsl_pci_probe(struct platform_device *pdev)
>  {
>  	int ret;
> -	struct device_node *node;
> +	struct fsl_pci *pci;
> +
> +	if (!of_device_is_available(pdev->dev.of_node)) {
> +		dev_warn(&pdev->dev, "disabled\n");
> +		return -ENODEV;
> +	}

This should be dev_dbg().

> -#ifdef CONFIG_PM
> -static int fsl_pci_resume(struct device *dev)
> +static int __exit fsl_pci_remove(struct platform_device *pdev)

Why __exit?  What happens if someone unbinds the PCI controller via
sysfs?
 
> +/*
> + * Structure of a PCI controller (host bridge)
> + */
> +struct fsl_pci {
> +	struct list_head node;
> +	int is_pcie;

bool is_pcie;

> +/* Return link status 0-> link, 1-> no link */
> +int fsl_pci_check_link(struct fsl_pci *pci);

bool

> +
> +/*
> + * The fsl_arch_* functions are arch hooks. Those functions are
> + * implemented as weak symbols so that they can be overridden by
> + * architecture specific code if needed.
> + */
> +
> +/* Return PCI64 DMA offset */
> +u64 fsl_arch_pci64_dma_offset(void);

Is this always guaranteed to exist?

> +/* Register PCI/PCIe controller to architecture system */
> +int __weak fsl_arch_pci_sys_register(struct fsl_pci *pci);
> +
> +/* Remove PCI/PCIe controller from architecture system */
> +void __weak fsl_arch_pci_sys_remove(struct fsl_pci *pci);

Why do these need to be weak?  Won't there be exactly one implementation
per supported arch?

-Scott




  parent reply	other threads:[~2013-09-27 16:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 11:02 [PATCH 1/2] pci: fsl: derive the common PCI driver to drivers/pci/host Minghuan Lian
2013-09-18 11:02 ` [PATCH 2/2] pci: fsl: rework PCI driver compatible with Layerscape Minghuan Lian
2013-09-27 11:29   ` Lian Minghuan-b31939
2013-09-27 16:47     ` Scott Wood
2013-09-27 16:54   ` Scott Wood [this message]
2013-09-29 11:51     ` Lian Minghuan-b31939
2013-09-30 22:50       ` Scott Wood
2013-09-29 23:56   ` Timur Tabi
2013-09-30  1:52     ` Lian Minghuan-b31939
2013-09-30 22:41       ` Scott Wood
2013-10-01  1:19       ` Timur Tabi

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=1380300847.24959.394.camel@snotra.buserror.net \
    --to=scottwood@freescale.com \
    --cc=Minghuan.Lian@freescale.com \
    --cc=bhelgaas@google.com \
    --cc=galak@kernel.crashing.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=r61911@freescale.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