From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>
Subject: Re: [PATCH] PCI/PME: Restore pcie_pme_driver.remove
Date: Wed, 15 Feb 2017 10:19:45 -0500 [thread overview]
Message-ID: <20170215151944.GH6993@windriver.com> (raw)
In-Reply-To: <20170215051748.3346-1-yinghai@kernel.org>
[[PATCH] PCI/PME: Restore pcie_pme_driver.remove] On 14/02/2017 (Tue 21:17) Yinghai Lu wrote:
> Found 4.9 and later, removing pci device for pcie port via /sys failed:
> ------------[ cut here ]------------
> kernel BUG at drivers/pci/msi.c:370!
>
[...]
> Bisect to commit d7def2040077 ("PCI/PME: Make explicitly non-modular").
> That commit did extra thing like remove the .remove for pcie_pme_driver.
Ah crap. Seems I mis-interpreted the use case of the .remove. :-/
Sorry about that.
Thanks,
Paul.
--
>
> Put back pcie_pme_remove and restore to pcie_pme_driver fix the problem.
>
> Fixes: d7def2040077 ("PCI/PME: Make explicitly non-modular")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> index 7175293..2dd1c68 100644
> --- a/drivers/pci/pcie/pme.c
> +++ b/drivers/pci/pcie/pme.c
> @@ -433,6 +433,17 @@ static int pcie_pme_resume(struct pcie_device *srv)
> return 0;
> }
>
> +/**
> + * pcie_pme_remove - Prepare PCIe PME service device for removal.
> + * @srv - PCIe service device to remove.
> + */
> +static void pcie_pme_remove(struct pcie_device *srv)
> +{
> + pcie_pme_suspend(srv);
> + free_irq(srv->irq, srv);
> + kfree(get_service_data(srv));
> +}
> +
> static struct pcie_port_service_driver pcie_pme_driver = {
> .name = "pcie_pme",
> .port_type = PCI_EXP_TYPE_ROOT_PORT,
> @@ -441,6 +452,7 @@ static struct pcie_port_service_driver pcie_pme_driver = {
> .probe = pcie_pme_probe,
> .suspend = pcie_pme_suspend,
> .resume = pcie_pme_resume,
> + .remove = pcie_pme_remove,
> };
>
> /**
next prev parent reply other threads:[~2017-02-15 15:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 5:17 [PATCH] PCI/PME: Restore pcie_pme_driver.remove Yinghai Lu
2017-02-15 11:25 ` Rafael J. Wysocki
2017-02-15 15:19 ` Paul Gortmaker [this message]
2017-02-15 16:06 ` Bjorn Helgaas
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=20170215151944.GH6993@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=stable@vger.kernel.org \
--cc=yinghai@kernel.org \
/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