Skip to contentSkip to conversation

Patch "platform-msi: Prepare for real per device domains" has been added to the 6.6-stable tree

PATCH In review Thomas Gleixner 2 participants 3 messages Dec 11, 2024 – Dec 12, 2024 1 message not in the archive Stable branch

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 23 lines · Sasha Levin

platform-msi: Prepare for real per device domains

[ Upstream commit c88f9110bfbca5975a8dee4c9792ba12684c7bca ]

Provide functions to create and remove per device MSI domains which replace the platform-MSI domains. The new model is that each of the devices which utilize platform-MSI gets now its private MSI domain which is "customized" in size and with a device specific function to write the MSI message into the device.

This is the same functionality as platform-MSI but it avoids all the down sides of platform MSI, i.e. the extra ID book keeping, the special data structure in the msi descriptor. Further the domains are only created when the devices are really in use, so the burden is on the usage and not on the infrastructure.

Fill in the domain template and provide two functions to init/allocate and remove a per device MSI domain.

Until all users and parent domain providers are converted, the init/alloc function invokes the original platform-MSI code when the irqdomain which is associated to the device does not provide MSI parent functionality yet.

Quoted 5 lines

Stable-dep-of: 64506b3d23a3 ("scsi: ufs: qcom: Only free platform MSIs when ESI is enabled")

See my other reply. Please don't backport the world if it's not really required. I'll send a backport of 64506b3d23a3 in a minute.

Thanks,

tglx

#2 lore raw

PATCH 1/1 scsi: ufs: qcom: Only free platform MSIs when ESI is enabled

In reply to a message not in the archive

From: Manivannan Sadhasivam <[email protected]>

commit 64506b3d23a337e98a74b18dcb10c8619365f2bd upstream.

Otherwise, it will result in a NULL pointer dereference as below:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
Call trace:
 mutex_lock+0xc/0x54
 platform_device_msi_free_irqs_all+0x14/0x20
 ufs_qcom_remove+0x34/0x48 [ufs_qcom]
 platform_remove+0x28/0x44
 device_remove+0x4c/0x80
 device_release_driver_internal+0xd8/0x178
 driver_detach+0x50/0x9c
 bus_remove_driver+0x6c/0xbc
 driver_unregister+0x30/0x60
 platform_driver_unregister+0x14/0x20
 ufs_qcom_pltform_exit+0x18/0xb94 [ufs_qcom]
 __arm64_sys_delete_module+0x180/0x260
 invoke_syscall+0x44/0x100
 el0_svc_common.constprop.0+0xc0/0xe0
 do_el0_svc+0x1c/0x28
 el0_svc+0x34/0xdc
 el0t_64_sync_handler+0xc0/0xc4
 el0t_64_sync+0x190/0x194
---
 drivers/ufs/host/ufs-qcom.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ufs/host/ufs-qcom.c +2 -1
@@ -1926,7 +1926,8 @@ static int ufs_qcom_remove(struct platfo
 
 	pm_runtime_get_sync(&(pdev)->dev);
 	ufshcd_remove(hba);
-	platform_msi_domain_free_irqs(hba->dev);
+	if (host->esi_enabled)
+		platform_msi_domain_free_irqs(hba->dev);
 	return 0;
 }
 
#3 lore raw

Re: [PATCH 6.6.y] scsi: ufs: qcom: Only free platform MSIs when ESI is enabled

Quoted 36 lines · Thomas Gleixner

From: Manivannan Sadhasivam <[email protected]>

commit 64506b3d23a337e98a74b18dcb10c8619365f2bd upstream.

Otherwise, it will result in a NULL pointer dereference as below:

Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
Call trace:
 mutex_lock+0xc/0x54
 platform_device_msi_free_irqs_all+0x14/0x20
 ufs_qcom_remove+0x34/0x48 [ufs_qcom]
 platform_remove+0x28/0x44
 device_remove+0x4c/0x80
 device_release_driver_internal+0xd8/0x178
 driver_detach+0x50/0x9c
 bus_remove_driver+0x6c/0xbc
 driver_unregister+0x30/0x60
 platform_driver_unregister+0x14/0x20
 ufs_qcom_pltform_exit+0x18/0xb94 [ufs_qcom]
 __arm64_sys_delete_module+0x180/0x260
 invoke_syscall+0x44/0x100
 el0_svc_common.constprop.0+0xc0/0xe0
 do_el0_svc+0x1c/0x28
 el0_svc+0x34/0xdc
 el0t_64_sync_handler+0xc0/0xc4
 el0t_64_sync+0x190/0x194
Quoted 3 lines
---
 drivers/ufs/host/ufs-qcom.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Thanks for this, I've dropped the other backports and just taken this one instead.

greg k-h