mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
HV: unify the sharing mode and partition mode coding style for similar functions
Both sharing mode and partition mode should follow the same coding logic/style for similar functions: vdev cfgread/cfgwrite: should all return -ENODEV if the pci reg access is not handled by it, but previously the partition mode code is not following this logic vpci cfgread/cfgwrite: if the vdev cfgread/cfgwrite does not handle this reg, pass on to next vdev cfgread/cfgwrite, if no vdev handles that req, passthru to physical pci device Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -149,7 +149,8 @@ void partition_mode_cfgread(struct acrn_vpci *vpci, union pci_bdf vbdf,
|
||||
}
|
||||
} else {
|
||||
if (vdev_pt_cfgread(vdev, offset, bytes, val) != 0) {
|
||||
pr_err("vdev_pt_cfgread failed!");
|
||||
/* Not handled by any handlers, passthru to physical device */
|
||||
*val = pci_pdev_read_cfg(vdev->pdev->bdf, offset, bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,7 +168,8 @@ void partition_mode_cfgwrite(struct acrn_vpci *vpci, union pci_bdf vbdf,
|
||||
}
|
||||
} else {
|
||||
if (vdev_pt_cfgwrite(vdev, offset, bytes, val) != 0){
|
||||
pr_err("vdev_pt_cfgwrite failed!");
|
||||
/* Not handled by any handlers, passthru to physical device */
|
||||
pci_pdev_write_cfg(vdev->pdev->bdf, offset, bytes, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user