From: Jiang Liu <jiang.liu@linux.intel.com> To: Hanjun Guo <hanjun.guo@linaro.org>, "Rafael J . Wysocki" <rjw@rjwysocki.net>, Bjorn Helgaas <bhelgaas@google.com>, Marc Zyngier <marc.zyngier@arm.com>, Yijing Wang <wangyijing@huawei.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>, x86@kernel.org Cc: Lv Zheng <lv.zheng@intel.com>, "lenb @ kernel . org" <lenb@kernel.org>, LKML <linux-kernel@vger.kernel.org>, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC v2 6/7] x86/PCI/ACPI: Use common interface to support PCI host bridge Date: Wed, 13 May 2015 13:38:37 +0800 [thread overview] Message-ID: <5552E35D.8030501@linux.intel.com> (raw) In-Reply-To: <5551EFC1.2010704@linaro.org> On 2015/5/12 20:19, Hanjun Guo wrote: > [...] >> struct pci_root_info { >> - struct acpi_device *bridge; >> - char name[16]; >> - struct pci_controller sd; >> + struct acpi_pci_root_info_common common; >> #ifdef CONFIG_PCI_MMCONFIG >> bool mcfg_added; >> u16 segment; >> @@ -165,14 +164,17 @@ static int check_segment(u16 seg, struct device >> *dev, char *estr) >> return 0; >> } >> >> -static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start, >> - u8 end, phys_addr_t addr) >> +static int setup_mcfg_map(struct acpi_pci_root_info_common *ci) >> { >> int result; >> - struct device *dev = &info->bridge->dev; >> + struct pci_root_info *info; >> + struct acpi_pci_root *root = ci->root; >> + struct device *dev = &ci->bridge->dev; >> + int seg = ci->controller.segment; > > ... > >> >> - info->start_bus = start; >> - info->end_bus = end; >> + info = container_of(ci, struct pci_root_info, common); >> + info->start_bus = (u8)root->secondary.start; >> + info->end_bus = (u8)root->secondary.end; >> info->mcfg_added = false; > > info->segment is not initialized here > >> >> /* return success if MMCFG is not in use */ >> @@ -182,7 +184,8 @@ static int setup_mcfg_map(struct pci_root_info >> *info, u16 seg, u8 start, >> if (!(pci_probe & PCI_PROBE_MMCONF)) >> return check_segment(seg, dev, "MMCONFIG is disabled,"); >> >> - result = pci_mmconfig_insert(dev, seg, start, end, addr); >> + result = pci_mmconfig_insert(dev, seg, info->start_bus, >> info->end_bus, >> + root->mcfg_addr); >> if (result == 0) { >> /* enable MMCFG if it hasn't been enabled yet */ >> if (raw_pci_ext_ops == NULL) >> @@ -195,8 +198,11 @@ static int setup_mcfg_map(struct pci_root_info >> *info, u16 seg, u8 start, >> return 0; >> } >> >> -static void teardown_mcfg_map(struct pci_root_info *info) >> +static void teardown_mcfg_map(struct acpi_pci_root_info_common *ci) >> { >> + struct pci_root_info *info; >> + >> + info = container_of(ci, struct pci_root_info, common); >> if (info->mcfg_added) { >> pci_mmconfig_delete(info->segment, info->start_bus, > > But the segment is used here to delete mmconfig entry, it seems that > the domain is 0 so there will be no problem, did I miss something? Good catch, we should use ci->controller.segment and kill info->segment. > > Thanks > Hanjun
WARNING: multiple messages have this Message-ID (diff)
From: jiang.liu@linux.intel.com (Jiang Liu) To: linux-arm-kernel@lists.infradead.org Subject: [RFC v2 6/7] x86/PCI/ACPI: Use common interface to support PCI host bridge Date: Wed, 13 May 2015 13:38:37 +0800 [thread overview] Message-ID: <5552E35D.8030501@linux.intel.com> (raw) In-Reply-To: <5551EFC1.2010704@linaro.org> On 2015/5/12 20:19, Hanjun Guo wrote: > [...] >> struct pci_root_info { >> - struct acpi_device *bridge; >> - char name[16]; >> - struct pci_controller sd; >> + struct acpi_pci_root_info_common common; >> #ifdef CONFIG_PCI_MMCONFIG >> bool mcfg_added; >> u16 segment; >> @@ -165,14 +164,17 @@ static int check_segment(u16 seg, struct device >> *dev, char *estr) >> return 0; >> } >> >> -static int setup_mcfg_map(struct pci_root_info *info, u16 seg, u8 start, >> - u8 end, phys_addr_t addr) >> +static int setup_mcfg_map(struct acpi_pci_root_info_common *ci) >> { >> int result; >> - struct device *dev = &info->bridge->dev; >> + struct pci_root_info *info; >> + struct acpi_pci_root *root = ci->root; >> + struct device *dev = &ci->bridge->dev; >> + int seg = ci->controller.segment; > > ... > >> >> - info->start_bus = start; >> - info->end_bus = end; >> + info = container_of(ci, struct pci_root_info, common); >> + info->start_bus = (u8)root->secondary.start; >> + info->end_bus = (u8)root->secondary.end; >> info->mcfg_added = false; > > info->segment is not initialized here > >> >> /* return success if MMCFG is not in use */ >> @@ -182,7 +184,8 @@ static int setup_mcfg_map(struct pci_root_info >> *info, u16 seg, u8 start, >> if (!(pci_probe & PCI_PROBE_MMCONF)) >> return check_segment(seg, dev, "MMCONFIG is disabled,"); >> >> - result = pci_mmconfig_insert(dev, seg, start, end, addr); >> + result = pci_mmconfig_insert(dev, seg, info->start_bus, >> info->end_bus, >> + root->mcfg_addr); >> if (result == 0) { >> /* enable MMCFG if it hasn't been enabled yet */ >> if (raw_pci_ext_ops == NULL) >> @@ -195,8 +198,11 @@ static int setup_mcfg_map(struct pci_root_info >> *info, u16 seg, u8 start, >> return 0; >> } >> >> -static void teardown_mcfg_map(struct pci_root_info *info) >> +static void teardown_mcfg_map(struct acpi_pci_root_info_common *ci) >> { >> + struct pci_root_info *info; >> + >> + info = container_of(ci, struct pci_root_info, common); >> if (info->mcfg_added) { >> pci_mmconfig_delete(info->segment, info->start_bus, > > But the segment is used here to delete mmconfig entry, it seems that > the domain is 0 so there will be no problem, did I miss something? Good catch, we should use ci->controller.segment and kill info->segment. > > Thanks > Hanjun
next prev parent reply other threads:[~2015-05-13 5:38 UTC|newest] Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-05-05 2:46 [RFC v2 0/7] Consolidate ACPI PCI root common code into ACPI core Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` [RFC v2 1/7] ACPI/PCI: Enhance ACPI core to support sparse IO space Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-11 13:01 ` Hanjun Guo 2015-05-11 13:01 ` Hanjun Guo 2015-05-11 13:01 ` Hanjun Guo 2015-05-05 2:46 ` [RFC v2 2/7] ia64/PCI/ACPI: Use common ACPI resource parsing interface for host bridge Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-11 13:04 ` Hanjun Guo 2015-05-11 13:04 ` Hanjun Guo 2015-05-11 13:04 ` Hanjun Guo 2015-05-05 2:46 ` [RFC v2 3/7] ia64/PCI: Use common struct resource_entry to replace struct iospace_resource Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` [RFC v2 4/7] x86/PCI: Rename struct pci_sysdata as struct pci_controller Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` [RFC v2 5/7] PCI/ACPI: Consolidate common PCI host bridge code into ACPI core Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-11 13:36 ` Hanjun Guo 2015-05-11 13:36 ` Hanjun Guo 2015-05-11 13:36 ` Hanjun Guo 2015-05-13 5:36 ` Jiang Liu 2015-05-13 5:36 ` Jiang Liu 2015-05-13 5:36 ` Jiang Liu 2015-05-13 9:29 ` Hanjun Guo 2015-05-13 9:29 ` Hanjun Guo 2015-05-13 12:24 ` Jiang Liu 2015-05-13 12:24 ` Jiang Liu 2015-05-13 13:25 ` Hanjun Guo 2015-05-13 13:25 ` Hanjun Guo 2015-05-14 1:09 ` Jiang Liu 2015-05-14 1:09 ` Jiang Liu 2015-05-14 4:05 ` Hanjun Guo 2015-05-14 4:05 ` Hanjun Guo 2015-05-14 4:42 ` Jiang Liu 2015-05-14 4:42 ` Jiang Liu 2015-05-14 4:42 ` Jiang Liu 2015-05-05 2:46 ` [RFC v2 6/7] x86/PCI/ACPI: Use common interface to support PCI host bridge Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-12 12:19 ` Hanjun Guo 2015-05-12 12:19 ` Hanjun Guo 2015-05-13 5:38 ` Jiang Liu [this message] 2015-05-13 5:38 ` Jiang Liu 2015-05-05 2:46 ` [RFC v2 7/7] ia64/PCI/ACPI: " Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 2:46 ` Jiang Liu 2015-05-05 3:10 ` [RFC v2 0/7] Consolidate ACPI PCI root common code into ACPI core Hanjun Guo 2015-05-05 3:10 ` Hanjun Guo
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=5552E35D.8030501@linux.intel.com \ --to=jiang.liu@linux.intel.com \ --cc=bhelgaas@google.com \ --cc=hanjun.guo@linaro.org \ --cc=hpa@zytor.com \ --cc=lenb@kernel.org \ --cc=linux-acpi@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-pci@vger.kernel.org \ --cc=lv.zheng@intel.com \ --cc=marc.zyngier@arm.com \ --cc=mingo@redhat.com \ --cc=rjw@rjwysocki.net \ --cc=tglx@linutronix.de \ --cc=wangyijing@huawei.com \ --cc=x86@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: linkBe 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.