From: Lian Minghuan-b31939 <B31939@freescale.com>
To: Scott Wood <scottwood@freescale.com>,
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: Sun, 29 Sep 2013 19:51:38 +0800 [thread overview]
Message-ID: <5248144A.6070307@freescale.com> (raw)
In-Reply-To: <1380300847.24959.394.camel@snotra.buserror.net>
Hi Scott,
please see my comments inline.
On 09/28/2013 12:54 AM, Scott Wood wrote:
> 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.
[Minghuan] ok.
>
>> -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().
[Minghuan] ok.
>> -#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?
>
[Minghuan] Sorry. should remove __exit
>> +/*
>> + * Structure of a PCI controller (host bridge)
>> + */
>> +struct fsl_pci {
>> + struct list_head node;
>> + int is_pcie;
> bool is_pcie;
[Minghuan] ok.
>> +/* Return link status 0-> link, 1-> no link */
>> +int fsl_pci_check_link(struct fsl_pci *pci);
> bool
[Minghuan] ok.
>> +
>> +/*
>> + * 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?
[Minghuan] Yes. I define a __weak implementation in pci-fsl.c
>> +/* 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?
[Minghuan] I added __weak for compiling kernel when selecting pci-fsl
module but
there is no related arch pci implementation.
I can remove the __weak, and use
"depends on FSL_SOC_BOOKE || PPC_86xx" in Kconfig to make sure there is
one implementation
of supported arch.
> -Scott
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Lian Minghuan-b31939 <B31939@freescale.com>
To: Scott Wood <scottwood@freescale.com>,
Minghuan Lian <Minghuan.Lian@freescale.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Zang Roy-R61911 <r61911@freescale.com>
Subject: Re: [PATCH 2/2] pci: fsl: rework PCI driver compatible with Layerscape
Date: Sun, 29 Sep 2013 19:51:38 +0800 [thread overview]
Message-ID: <5248144A.6070307@freescale.com> (raw)
In-Reply-To: <1380300847.24959.394.camel@snotra.buserror.net>
Hi Scott,
please see my comments inline.
On 09/28/2013 12:54 AM, Scott Wood wrote:
> 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.
[Minghuan] ok.
>
>> -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().
[Minghuan] ok.
>> -#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?
>
[Minghuan] Sorry. should remove __exit
>> +/*
>> + * Structure of a PCI controller (host bridge)
>> + */
>> +struct fsl_pci {
>> + struct list_head node;
>> + int is_pcie;
> bool is_pcie;
[Minghuan] ok.
>> +/* Return link status 0-> link, 1-> no link */
>> +int fsl_pci_check_link(struct fsl_pci *pci);
> bool
[Minghuan] ok.
>> +
>> +/*
>> + * 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?
[Minghuan] Yes. I define a __weak implementation in pci-fsl.c
>> +/* 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?
[Minghuan] I added __weak for compiling kernel when selecting pci-fsl
module but
there is no related arch pci implementation.
I can remove the __weak, and use
"depends on FSL_SOC_BOOKE || PPC_86xx" in Kconfig to make sure there is
one implementation
of supported arch.
> -Scott
>
>
next prev parent reply other threads:[~2013-09-29 11:50 UTC|newest]
Thread overview: 22+ 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 ` Minghuan Lian
2013-09-18 11:02 ` [PATCH 2/2] pci: fsl: rework PCI driver compatible with Layerscape Minghuan Lian
2013-09-18 11:02 ` Minghuan Lian
2013-09-27 11:29 ` Lian Minghuan-b31939
2013-09-27 11:29 ` Lian Minghuan-b31939
2013-09-27 16:47 ` Scott Wood
2013-09-27 16:47 ` Scott Wood
2013-09-27 16:54 ` Scott Wood
2013-09-27 16:54 ` Scott Wood
2013-09-29 11:51 ` Lian Minghuan-b31939 [this message]
2013-09-29 11:51 ` Lian Minghuan-b31939
2013-09-30 22:50 ` Scott Wood
2013-09-30 22:50 ` Scott Wood
2013-09-29 23:56 ` Timur Tabi
2013-09-29 23:56 ` Timur Tabi
2013-09-30 1:52 ` Lian Minghuan-b31939
2013-09-30 1:52 ` Lian Minghuan-b31939
2013-09-30 22:41 ` Scott Wood
2013-09-30 22:41 ` Scott Wood
2013-10-01 1:19 ` Timur Tabi
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=5248144A.6070307@freescale.com \
--to=b31939@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 \
--cc=scottwood@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.