Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1313141
| From | Tomasz Nowicki <tn@semihalf.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. |
| Date | 2016-01-20 12:30 +0100 |
| Message-ID | <qSZ7z-5Eb-5@gated-at.bofh.it> (permalink) |
| References | <qQtES-hT-3@gated-at.bofh.it> <qQtET-hT-41@gated-at.bofh.it> <qSH11-1Nb-37@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 19.01.2016 17:02, Lorenzo Pieralisi wrote: > On Wed, Jan 13, 2016 at 02:20:57PM +0100, Tomasz Nowicki wrote: [...] >> device via pci_create_root_bus parameter (as the ACPI device type) > > I do not understand what you mean by "as the ACPI device type". See below. > >> and using ACPI_COMPANION_SET in core code for ACPI boot method. >> ACPI_COMPANION_SET is safe to run for all cases DT, ACPI and DT&ACPI. >> >> Suggested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> >> Signed-off-by: Tomasz Nowicki <tn@semihalf.com> >> --- >> drivers/acpi/pci_root.c | 5 ++++- >> drivers/pci/probe.c | 2 ++ >> 2 files changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c >> index ae3fe4e..a65c8c2 100644 >> --- a/drivers/acpi/pci_root.c >> +++ b/drivers/acpi/pci_root.c >> @@ -846,7 +846,10 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, >> >> pci_acpi_root_add_resources(info); >> pci_add_resource(&info->resources, &root->secondary); >> - bus = pci_create_root_bus(NULL, busnum, ops->pci_ops, >> + >> + /* Root bridge device needs to be sure of parent ACPI type */ >> + ACPI_COMPANION_SET(&device->dev, device); > > I do not understand why the code above is needed, can you elaborate > please ? > This makes sure that device->dev can be identified as ACPI device, so we can use to_acpi_device_node() and assign companion safely below. > >> + bus = pci_create_root_bus(&device->dev, busnum, ops->pci_ops, >> sysdata, &info->resources); >> if (!bus) >> goto out_release_info; >> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c >> index 553a029..cad836f 100644 >> --- a/drivers/pci/probe.c >> +++ b/drivers/pci/probe.c >> @@ -2107,6 +2107,8 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus, >> bridge->dev.parent = parent; >> bridge->dev.release = pci_release_host_bridge_dev; >> dev_set_name(&bridge->dev, "pci%04x:%02x", pci_domain_nr(b), bus); >> + ACPI_COMPANION_SET(&bridge->dev, >> + parent ? to_acpi_device_node(parent->fwnode) : NULL); pci_create_root_bus() can be called with DT device, then ACPI_COMPANION_SET assign no companion to bridge device. Thanks, Tomasz
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-01-19 17:10 +0100
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Tomasz Nowicki <tn@semihalf.com> - 2016-01-20 12:30 +0100
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-01-20 13:40 +0100
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Tomasz Nowicki <tn@semihalf.com> - 2016-01-20 14:50 +0100
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-01-20 15:30 +0100
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Tomasz Nowicki <tn@semihalf.com> - 2016-01-20 15:50 +0100
Re: [PATCH V3 11/21] pci, acpi: Move ACPI host bridge device companion assignment to core code. Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-01-27 18:50 +0100
csiph-web