Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1606806 > unrolled thread
| Started by | Joerg Roedel <joro@8bytes.org> |
|---|---|
| First post | 2017-03-22 18:40 +0100 |
| Last post | 2017-03-23 00:50 +0100 |
| Articles | 10 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] ACPI Fixes for Hotplug Joerg Roedel <joro@8bytes.org> - 2017-03-22 18:40 +0100
[PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC Joerg Roedel <joro@8bytes.org> - 2017-03-22 18:40 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-22 18:50 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC Joerg Roedel <jroedel@suse.de> - 2017-03-23 00:00 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-23 00:50 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC Joerg Roedel <joro@8bytes.org> - 2017-03-23 01:00 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-23 02:10 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC Joerg Roedel <jroedel@suse.de> - 2017-03-23 12:00 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-23 12:30 +0100
Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-23 00:50 +0100
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-03-22 18:40 +0100 |
| Subject | [PATCH 0/3] ACPI Fixes for Hotplug |
| Message-ID | <tnSoN-63J-15@gated-at.bofh.it> |
Hi, here are fixes for three issues I found in ACPI code during hotplug testing. Patches 2 and 3 fix the same issue, but I think both make sense on their own. Please review. Thanks, Joerg Joerg Roedel (3): ACPI, ioapic: Clear on-stack resource before using it ACPI: Remove platform devices from a bus on removal ACPI: Don't create a platform_device for IOAPIC/IOxAPIC drivers/acpi/acpi_platform.c | 8 +++++--- drivers/acpi/ioapic.c | 6 ++++++ drivers/acpi/scan.c | 26 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) -- 1.9.1
[toc] | [next] | [standalone]
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-03-22 18:40 +0100 |
| Subject | [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnSoN-63J-19@gated-at.bofh.it> |
| In reply to | #1606806 |
From: Joerg Roedel <jroedel@suse.de>
No platform-device is required for IO(x)APICs, so don't even
create them.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
drivers/acpi/acpi_platform.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index b4c1a6a..03250e1 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -25,9 +25,11 @@
ACPI_MODULE_NAME("platform");
static const struct acpi_device_id forbidden_id_list[] = {
- {"PNP0000", 0}, /* PIC */
- {"PNP0100", 0}, /* Timer */
- {"PNP0200", 0}, /* AT DMA Controller */
+ {"PNP0000", 0}, /* PIC */
+ {"PNP0100", 0}, /* Timer */
+ {"PNP0200", 0}, /* AT DMA Controller */
+ {"ACPI0009", 0}, /* IOxAPIC */
+ {"ACPI000A", 0}, /* IOAPIC */
{"", 0},
};
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rjw@rjwysocki.net> |
|---|---|
| Date | 2017-03-22 18:50 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnSyv-6bg-63@gated-at.bofh.it> |
| In reply to | #1606808 |
On Wednesday, March 22, 2017 06:33:25 PM Joerg Roedel wrote:
> From: Joerg Roedel <jroedel@suse.de>
>
> No platform-device is required for IO(x)APICs, so don't even
> create them.
>
> Signed-off-by: Joerg Roedel <jroedel@suse.de>
If we do this, I'd prefer not to do [2/3], because we'll introduce code that
will be essentially dead then.
> ---
> drivers/acpi/acpi_platform.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
> index b4c1a6a..03250e1 100644
> --- a/drivers/acpi/acpi_platform.c
> +++ b/drivers/acpi/acpi_platform.c
> @@ -25,9 +25,11 @@
> ACPI_MODULE_NAME("platform");
>
> static const struct acpi_device_id forbidden_id_list[] = {
> - {"PNP0000", 0}, /* PIC */
> - {"PNP0100", 0}, /* Timer */
> - {"PNP0200", 0}, /* AT DMA Controller */
Why do you change the existing entries?
> + {"PNP0000", 0}, /* PIC */
> + {"PNP0100", 0}, /* Timer */
> + {"PNP0200", 0}, /* AT DMA Controller */
> + {"ACPI0009", 0}, /* IOxAPIC */
> + {"ACPI000A", 0}, /* IOAPIC */
> {"", 0},
> };
>
>
Thanks,
Rafael
[toc] | [prev] | [next] | [standalone]
| From | Joerg Roedel <jroedel@suse.de> |
|---|---|
| Date | 2017-03-23 00:00 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnXot-1mG-3@gated-at.bofh.it> |
| In reply to | #1606834 |
Hi Rafael,
On Wed, Mar 22, 2017 at 06:42:39PM +0100, Rafael J. Wysocki wrote:
> On Wednesday, March 22, 2017 06:33:25 PM Joerg Roedel wrote:
> > From: Joerg Roedel <jroedel@suse.de>
> >
> > No platform-device is required for IO(x)APICs, so don't even
> > create them.
> >
> > Signed-off-by: Joerg Roedel <jroedel@suse.de>
>
> If we do this, I'd prefer not to do [2/3], because we'll introduce code that
> will be essentially dead then.
In this case the code in acpi_bus_attach() adding platform_devices is also
dead. Could it be removed then?
>
> > ---
> > drivers/acpi/acpi_platform.c | 8 +++++---
> > 1 file changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
> > index b4c1a6a..03250e1 100644
> > --- a/drivers/acpi/acpi_platform.c
> > +++ b/drivers/acpi/acpi_platform.c
> > @@ -25,9 +25,11 @@
> > ACPI_MODULE_NAME("platform");
> >
> > static const struct acpi_device_id forbidden_id_list[] = {
> > - {"PNP0000", 0}, /* PIC */
> > - {"PNP0100", 0}, /* Timer */
> > - {"PNP0200", 0}, /* AT DMA Controller */
>
> Why do you change the existing entries?
Just to align the '0's in one column :)
Joerg
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rafael@kernel.org> |
|---|---|
| Date | 2017-03-23 00:50 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnYaS-1YM-13@gated-at.bofh.it> |
| In reply to | #1607061 |
On Thu, Mar 23, 2017 at 12:41 AM, Rafael J. Wysocki <rafael@kernel.org> wrote: > On Wed, Mar 22, 2017 at 11:58 PM, Joerg Roedel <jroedel@suse.de> wrote: >> Hi Rafael, >> >> On Wed, Mar 22, 2017 at 06:42:39PM +0100, Rafael J. Wysocki wrote: >>> On Wednesday, March 22, 2017 06:33:25 PM Joerg Roedel wrote: >>> > From: Joerg Roedel <jroedel@suse.de> >>> > >>> > No platform-device is required for IO(x)APICs, so don't even >>> > create them. >>> > >>> > Signed-off-by: Joerg Roedel <jroedel@suse.de> >>> >>> If we do this, I'd prefer not to do [2/3], because we'll introduce code that >>> will be essentially dead then. >> >> In this case the code in acpi_bus_attach() adding platform_devices is also >> dead. Could it be removed then? > > It is not dead. > > Platform devices are actually created by it, but they never go away. IOW, they should never be created for anything hot-removable. If they are, this is a bug (as you noticed). Thanks, Rafael
[toc] | [prev] | [next] | [standalone]
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-03-23 01:00 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnYky-22N-21@gated-at.bofh.it> |
| In reply to | #1607070 |
On Thu, Mar 23, 2017 at 12:44:18AM +0100, Rafael J. Wysocki wrote: > On Thu, Mar 23, 2017 at 12:41 AM, Rafael J. Wysocki <rafael@kernel.org> wrote: > > > > It is not dead. > > > > Platform devices are actually created by it, but they never go away. > > IOW, they should never be created for anything hot-removable. > > If they are, this is a bug (as you noticed). Okay, in this case patch 2 can be omitted. But for my understanding, platform_devices created in acpi_bus_attach() that are not hot-removable don't take a reference to the host_bridge, right (at least when the host-bridge is hot-removable)? Otherwise this would be a leak again in case the host-bridge gets removed. Joerg
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rafael@kernel.org> |
|---|---|
| Date | 2017-03-23 02:10 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnZqh-36m-11@gated-at.bofh.it> |
| In reply to | #1607082 |
On Thu, Mar 23, 2017 at 12:58 AM, Joerg Roedel <joro@8bytes.org> wrote: > On Thu, Mar 23, 2017 at 12:44:18AM +0100, Rafael J. Wysocki wrote: >> On Thu, Mar 23, 2017 at 12:41 AM, Rafael J. Wysocki <rafael@kernel.org> wrote: >> > >> > It is not dead. >> > >> > Platform devices are actually created by it, but they never go away. >> >> IOW, they should never be created for anything hot-removable. >> >> If they are, this is a bug (as you noticed). > > Okay, in this case patch 2 can be omitted. > > But for my understanding, platform_devices created in acpi_bus_attach() > that are not hot-removable don't take a reference to the host_bridge, > right (at least when the host-bridge is hot-removable)? They shouldn't. > Otherwise this would be a leak again in case the host-bridge gets > removed. Right. The main problem is that representing anything hot-removable as a platform device is inherently fragile, as the platform bus type has no idea whatever about things that may physically go away and platform drivers don't expect that devices may vanish from under them in general and so on. Unregistration alone doesn't help much with that, so IMO at least for now it's better to avoid using platform_device for hot-removable stuff. Thanks, Rafael
[toc] | [prev] | [next] | [standalone]
| From | Joerg Roedel <jroedel@suse.de> |
|---|---|
| Date | 2017-03-23 12:00 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <to8Df-14F-15@gated-at.bofh.it> |
| In reply to | #1607106 |
On Thu, Mar 23, 2017 at 02:06:44AM +0100, Rafael J. Wysocki wrote: > The main problem is that representing anything hot-removable as a > platform device is inherently fragile, as the platform bus type has no > idea whatever about things that may physically go away and platform > drivers don't expect that devices may vanish from under them in > general and so on. Unregistration alone doesn't help much with that, > so IMO at least for now it's better to avoid using platform_device for > hot-removable stuff. Okay, thanks for the explanation. So patch 2 could be dropped, should I resend without that patch or do you want to pick them up from this post? Joerg
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rafael@kernel.org> |
|---|---|
| Date | 2017-03-23 12:30 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <to96h-1uL-3@gated-at.bofh.it> |
| In reply to | #1607360 |
On Thu, Mar 23, 2017 at 11:50 AM, Joerg Roedel <jroedel@suse.de> wrote: > On Thu, Mar 23, 2017 at 02:06:44AM +0100, Rafael J. Wysocki wrote: >> The main problem is that representing anything hot-removable as a >> platform device is inherently fragile, as the platform bus type has no >> idea whatever about things that may physically go away and platform >> drivers don't expect that devices may vanish from under them in >> general and so on. Unregistration alone doesn't help much with that, >> so IMO at least for now it's better to avoid using platform_device for >> hot-removable stuff. > > Okay, thanks for the explanation. So patch 2 could be dropped, should I > resend without that patch or do you want to pick them up from this post? I can pick them up easily enough, thanks! Take care, Rafael
[toc] | [prev] | [next] | [standalone]
| From | "Rafael J. Wysocki" <rafael@kernel.org> |
|---|---|
| Date | 2017-03-23 00:50 +0100 |
| Subject | Re: [PATCH 3/3] ACPI: Don't create a platform_device for IOAPIC/IOxAPIC |
| Message-ID | <tnYaS-1YM-15@gated-at.bofh.it> |
| In reply to | #1607061 |
On Wed, Mar 22, 2017 at 11:58 PM, Joerg Roedel <jroedel@suse.de> wrote: > Hi Rafael, > > On Wed, Mar 22, 2017 at 06:42:39PM +0100, Rafael J. Wysocki wrote: >> On Wednesday, March 22, 2017 06:33:25 PM Joerg Roedel wrote: >> > From: Joerg Roedel <jroedel@suse.de> >> > >> > No platform-device is required for IO(x)APICs, so don't even >> > create them. >> > >> > Signed-off-by: Joerg Roedel <jroedel@suse.de> >> >> If we do this, I'd prefer not to do [2/3], because we'll introduce code that >> will be essentially dead then. > > In this case the code in acpi_bus_attach() adding platform_devices is also > dead. Could it be removed then? It is not dead. Platform devices are actually created by it, but they never go away. Thanks, Rafael
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web