-
Notifications
You must be signed in to change notification settings - Fork 0
Vmd pch rootbus #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
e6e2d3d to
893f31f
Compare
mtkaczyk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
patch 1 review
for title I suggest to remove reference to Intel CPU code number (not needed here):
PCI: vmd: Clean up vmd_enable_domain function
This function is too long and needs to be shortened to make it more readable.
This clean up is a prework for enablement additional VMD bus range. It doesn't change
Functional behavior of vmd_enable_domain().
Suggested-by: Nirmal Patel <[email protected]>
Signed-off-by: Szymon Durawa <[email protected]>
typo beahvior
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen something like that before, probably visual formatting.
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not acceptable:
| max_buses = resource_size(&vmd->resources[VMD_RESOURCE_CFGBAR]); | |
| u16 bus; | |
| u16 max_buses = resource_size(&vmd->resources[VMD_RESOURCE_CFGBAR]); |
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, it is badly formatted.
| &vmd->resources[VMD_RESOURCE_MEMBAR_1]; | |
| struct x *vmd_membar1_res=&vmd->dev->resource[VMD_MEMBAR1]; | |
| struct x *vmd_membar2_res =&vmd->dev->resource[VMD_MEMBAR2]; | |
| vmd_membar1_res->child =&vmd->dev->resource[VMD_MEMBAR1]; | |
| vmd_membar2_res->child =&vmd->dev->resource[VMD_MEMBAR2]; |
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| struct resource *res; | |
| struct resource *res = &vmd->dev->resource[VMD_CFGBAR]; |
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Highlight that it can be NULL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean @parent lol :)
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you say type but the name has number
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally overwriting income parameter is bad practice, maybe better. use inline if?
.parent = parent ? parent : res;
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like bad formatting to me, please look into kernel, how they solve this :)
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad formatting.
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad formating
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can move it up to previous line, lgtm anyway
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is correct in kernel coding style :(
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider shorter naming for variables.
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formating
893f31f to
c4ede08
Compare
This function is too long and needs to be shortened to make it more readable. Certain VMD devices like Intel Arrow Lake has two bus ranges, current implementation supports only one range. This clean up is a prework for enablement additional VMD bus range. It doesn't change functional behavior of vmd_enable_domain(). Suggested-by: Nirmal Patel <[email protected]> Reviewed-by: Mariusz Tkaczyk <[email protected]> Signed-off-by: Szymon Durawa <[email protected]>
Starting from Intel Arrow Lake VMD enhacement introduces separate rotbus for PCH. It means that all 3 MMIO BARs exposed by VMD are shared now between CPU IOC and PCH. This patch adds PCH bus enumeration and MMIO management for devices with VMD enhancement support. Suggested-by: Nirmal Patel <[email protected]> Reviewed-by: Mariusz Tkaczyk <[email protected]> Signed-off-by: Szymon Durawa <[email protected]>
VMD PCH 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 this, PCH bus number has to be the same as PCH primary number. Suggested-by: Nirmal Patel <[email protected]> Reviewed-by: Mariusz Tkaczyk <[email protected]> Signed-off-by: Szymon Durawa <[email protected]>
drivers/pci/controller/vmd.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean @parent lol :)
| pci_add_resource_offset(&resources_pch, | ||
| &vmd->resources[VMD_RES_PCH_MEMBAR_2], offset[1]); | ||
|
|
||
| vmd->bus[VMD_ROOTBUS_1] = pci_create_root_bus( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this formatting is bad.
VMD PCH rootbus implementation