Vmd pch rootbus v3#5
Open
sdurawa wants to merge 8 commits into
Open
Conversation
mtkaczyk
reviewed
Nov 8, 2024
mtkaczyk
left a comment
There was a problem hiding this comment.
Patch1 :
PCI: vmd: Create bus enumeration helper
Please change to:
PCI: vmd: Add vmd_bus_enumeration()
mtkaczyk
suggested changes
Nov 8, 2024
|
|
||
| if (vmd->bus1_rootbus) | ||
| max_buses += | ||
| resource_size(&vmd->resources[VMD_RES_BUS1_CFGBAR]) + 2; |
| return -ENODEV; | ||
| } | ||
|
|
||
| /* BUS0 (IOC) start number */ |
There was a problem hiding this comment.
Bjorn doesn't like our IOC, PCH nomenclature, please challenge that :)
|
|
||
| /* BUS0 (IOC) start number */ | ||
| vmd->busn_start[VMD_BUS_0] = VMD_RESTRICT_2_BUS_START; | ||
| /* BUS1 (PCH) start number */ |
| vmd->bus[VMD_BUS_0] = pci_create_root_bus(&vmd->dev->dev, | ||
| vmd->busn_start[VMD_BUS_0], | ||
| vmd->bus[bus_number] = pci_create_root_bus(&vmd->dev->dev, | ||
| vmd->busn_start[bus_number], |
| "Can't create symlink to domain\n"); | ||
| WARN(sysfs_create_link( | ||
| &vmd->dev->dev.kobj, &vmd->bus[bus_number]->dev.kobj, | ||
| kasprintf(GFP_KERNEL, "domain bus%d", bus_number)), |
| "Can't create symlink to domain\n"); | ||
| WARN(sysfs_create_link( | ||
| &vmd->dev->dev.kobj, &vmd->bus[bus_number]->dev.kobj, | ||
| kasprintf(GFP_KERNEL, "domain bus%d", bus_number)), |
There was a problem hiding this comment.
You can't just change link. "domain" link is there and it must stay as is. For example, you are breaking this code:
https://github.com/md-raid-utilities/mdadm/blob/main/platform-intel.c#L126
mtkaczyk
suggested changes
Nov 8, 2024
mtkaczyk
left a comment
There was a problem hiding this comment.
Bjorn asked what is happening if this workaround is not applied, please elaborate :)
| u32 offset; | ||
|
|
||
| /* | ||
| * VMD WA: for PCH rootbus, bus number is set to VMD_PRIMARY_BUS1 |
3e93b76 to
55e2095
Compare
added 8 commits
November 15, 2024 09:39
Move the vmd bus enumeration code to a new helper. No functional changes. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Move the VMD CFGBAR initialization code to a new helper. No functional changes. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Move the MEMBAR1 and MEMBAR2 registry initialization code to a new helper functions. No functional changes. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Move the VMD bus initialization code to a new helper. No functional changes. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Add enum vmd_resource type to replace hardcoded values. Add defines for vmd bus start number based on VMD restriction value. No functional changes. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Bus and busn_start are converted from scalar to an array to support multiple VMD buses in the future. No functional changes. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
Starting from Intel Arrow Lake VMD enhacement introduces second rootbus support with fixed root bus number (0x80). It means that all 3 MMIO BARs exposed by VMD are shared now between both buses (current BUS0 and new BUS1). This patch add new BUS1 enumeration and divide MMIO space to be shared between both rootbuses. Due to enumeration issues with rootbus hardwired to a fixed non-zero value, this patch will work with a workaround proposed in next patch. Without workaraund user won't see attached devices behind BUS1 rootbus. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
…ro value VMD BUS1 rootbus primary number is 0x80 and pci_scan_bridge_extend() cannot assign it as "hard-wired to 0" and marks setup as broken. To avoid falling into bridge configuration invalid condition, BUS1 number has to be the same as BUS1 primary number. Suggested-by: Nirmal Patel <nirmal.patel@linux.intel.com> Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> Signed-off-by: Szymon Durawa <szymon.durawa@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New version with applied Bjorn remarks