Skip to content

Commit a9e3d5a

Browse files
Vivek PernamittaManivannan Sadhasivam
authored andcommitted
bus: mhi: host: Add support for separate controller configurations for VF and PF
Implement support for separate controller configurations for both Virtual Functions (VF) and Physical Functions (PF). This enhancement allows for more flexible and efficient management of resources. The PF takes on a supervisory role and will have bootup information such as SAHARA, DIAG, and NDB (for file system sync data, etc.). VFs can handle resources associated with the main data movement of the Function are available to the SI (system image) as per PCIe SRIOV spec (rev 0.9 1.Architectural overview) Signed-off-by: Vivek Pernamitta <[email protected]> Reviewed-by: Krishna Chaitanya Chundru <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent f5225a3 commit a9e3d5a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/bus/mhi/host/pci_generic.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
/**
3535
* struct mhi_pci_dev_info - MHI PCI device specific information
3636
* @config: MHI controller configuration
37+
* @vf_config: MHI controller configuration for Virtual function (optional)
3738
* @name: name of the PCI module
3839
* @fw: firmware path (if any)
3940
* @edl: emergency download mode firmware path (if any)
@@ -47,6 +48,7 @@
4748
*/
4849
struct mhi_pci_dev_info {
4950
const struct mhi_controller_config *config;
51+
const struct mhi_controller_config *vf_config;
5052
const char *name;
5153
const char *fw;
5254
const char *edl;
@@ -1299,9 +1301,14 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
12991301
return -ENOMEM;
13001302

13011303
INIT_WORK(&mhi_pdev->recovery_work, mhi_pci_recovery_work);
1304+
1305+
if (pdev->is_virtfn && info->vf_config)
1306+
mhi_cntrl_config = info->vf_config;
1307+
else
1308+
mhi_cntrl_config = info->config;
1309+
13021310
timer_setup(&mhi_pdev->health_check_timer, health_check, 0);
13031311

1304-
mhi_cntrl_config = info->config;
13051312
mhi_cntrl = &mhi_pdev->mhi_cntrl;
13061313

13071314
mhi_cntrl->cntrl_dev = &pdev->dev;

0 commit comments

Comments
 (0)