From: Scott Wood <scottwood@freescale.com>
To: Dongsheng Wang <dongsheng.wang@freescale.com>
Cc: roy.zang@freescale.com, galak@codeaurora.org, rjw@rjwysocki.net,
linux-pci@vger.kernel.org, bhelgaas@google.com,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [2/2] fsl/pci: The new pci suspend/resume implementation
Date: Wed, 19 Mar 2014 16:00:41 -0500 [thread overview]
Message-ID: <20140319210041.GA14019@home.buserror.net> (raw)
In-Reply-To: <1389081848-26506-2-git-send-email-dongsheng.wang@freescale.com>
On Tue, Jan 07, 2014 at 04:04:08PM +0800, Dongsheng Wang wrote:
> From: Wang Dongsheng <dongsheng.wang@freescale.com>
>
> The new suspend/resume implementation, send pme turnoff message
> in suspend, and send pme exit message in resume.
>
> Add a PME handler, to response PME & message interrupt.
>
> Change platform_driver->suspend/resume to syscore->suspend/resume.
> pci-driver will call back EP device, to save EP state in
> pci_pm_suspend_noirq, so we need to keep the link, until
> pci_pm_suspend_noirq finish.
>
> Signed-off-by: Wang Dongsheng <dongsheng.wang@freescale.com>
Is this patch OK to go in without patch 1/2? It's not clear whether that
was deemed incorrect (as in new patch coming) or unnecessary.
It would also be good if you submit with the explanation from
http://www.spinics.net/lists/linux-pci/msg27844.html in the commit
message.
> -static int fsl_pci_probe(struct platform_device *pdev)
> +#ifdef CONFIG_PM
> +static irqreturn_t fsl_pci_pme_handle(int irq, void *dev_id)
> {
> - int ret;
> - struct device_node *node;
> + struct pci_controller *hose = dev_id;
> + struct ccsr_pci __iomem *pci = hose->private_data;
> + u32 dr;
>
> - node = pdev->dev.of_node;
> - ret = fsl_add_bridge(pdev, fsl_pci_primary == node);
> + dr = in_be32(&pci->pex_pme_mes_dr);
> + if (dr)
> + out_be32(&pci->pex_pme_mes_dr, dr);
> + else
> + return IRQ_NONE;
>
> - mpc85xx_pci_err_probe(pdev);
> + return IRQ_HANDLED;
> +}
Why do you put some of the HANDLED path in the if statement, and some
outside?
Just do:
if (!dr)
return IRQ_NONE;
out_be32(...);
return IRQ_HANDLED;
> +static int fsl_pci_pme_probe(struct pci_controller *hose)
> +{
> + struct ccsr_pci __iomem *pci;
> + struct pci_dev *dev = hose->bus->self;
> + u16 pms;
> + int pme_irq;
> + int res;
> +
> + /* PME Disable */
> + pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pms);
> + pms &= ~PCI_PM_CTRL_PME_ENABLE;
> + pci_write_config_word(dev, dev->pm_cap + PCI_PM_CTRL, pms);
> +
> + pme_irq = irq_of_parse_and_map(hose->dn, 0);
> + if (!pme_irq) {
> + pr_warn("Failed to map PME interrupt.\n");
dev_err()
> +
> + return -ENXIO;
> + }
> +
> + res = devm_request_irq(hose->parent, pme_irq,
> + fsl_pci_pme_handle,
> + IRQF_DISABLED | IRQF_SHARED,
> + "[PCI] PME", hose);
IRQF_DISABLED is a deprecated no-op.
> + if (res < 0) {
> + pr_warn("Unable to requiest irq %d for PME\n", pme_irq);
dev_err() etc.
-Scott
next prev parent reply other threads:[~2014-03-19 21:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-07 8:04 [PATCH 1/2] pci: Fix root port bus->self is NULL Dongsheng Wang
2014-01-07 8:04 ` [PATCH 2/2] fsl/pci: The new pci suspend/resume implementation Dongsheng Wang
2014-01-07 20:41 ` Rafael J. Wysocki
2014-01-08 7:12 ` Dongsheng.Wang
2014-01-21 5:40 ` Dongsheng.Wang
2014-03-19 21:00 ` Scott Wood [this message]
2014-03-20 2:25 ` [2/2] " Dongsheng.Wang
2014-01-07 8:27 ` [PATCH 1/2] pci: Fix root port bus->self is NULL Yijing Wang
2014-01-07 8:54 ` Jiang Liu
2014-01-07 9:51 ` Dongsheng.Wang
2014-01-08 2:33 ` Jiang Liu
2014-01-08 3:51 ` Dongsheng.Wang
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=20140319210041.GA14019@home.buserror.net \
--to=scottwood@freescale.com \
--cc=bhelgaas@google.com \
--cc=dongsheng.wang@freescale.com \
--cc=galak@codeaurora.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rjw@rjwysocki.net \
--cc=roy.zang@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;
as well as URLs for NNTP newsgroup(s).