[PW_SID:1101052] driver core: platform: Setup device MSI domain just before driver probe#2019
[PW_SID:1101052] driver core: platform: Setup device MSI domain just before driver probe#2019linux-riscv-bot wants to merge 1 commit into
Conversation
On RISC-V, the MSI controller (aka RISC-V IMSIC) is probed as a regular
platform device and MSI client drivers are always probed after the MSI
controller driver using fw_devlink. Unfortunately, this is not sufficient
to ensure device MSI domain is set for MSI client devices before driver
probe because OF framework sets device MSI domain at the time of platform
device creation whereas ACPI framework expects arch specific code to set
the device MSI domain at the time of platform device creation.
Currently, to work-around the problem of missing device MSI domain,
various RISC-V MSI client drivers explicitly set device MSI domain
in the driver probe function using below code pattern:
/*
* The device MSI domain for platform devices on RISC-V architecture
* is only available after the MSI controller driver is probed so,
* explicitly configure here.
*/
if (!dev_get_msi_domain(dev)) {
/*
* The device MSI domain for OF devices is only set at the
* time of populating/creating OF device. If the device MSI
* domain is discovered later after the OF device is created
* then we need to set it explicitly before using any platform
* MSI functions.
*/
if (is_of_node(fwnode)) {
of_msi_configure(dev, dev_of_node(dev));
} else if (is_acpi_device_node(fwnode)) {
struct irq_domain *msi_domain;
msi_domain = irq_find_matching_fwnode(imsic_acpi_get_fwnode(dev),
DOMAIN_BUS_PLATFORM_MSI);
dev_set_msi_domain(dev, msi_domain);
}
if (!dev_get_msi_domain(dev))
return -EPROBE_DEFER;
}
Instead of the above approach, extend the platform_dma_configure() to set
device MSI domain for both OF and ACPI based platform devices before driver
probe and remove the duplicate code pattern from RISC-V MSI client drivers.
Co-developed-by: Sunil V L <sunilvl@oss.qualcomm.com>
Signed-off-by: Sunil V L <sunilvl@oss.qualcomm.com>
Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
|
Patch 1: "driver core: platform: Setup device MSI domain just before driver probe" |
PR for series 1101052 applied to workflow__riscv__fixes
Name: driver core: platform: Setup device MSI domain just before driver probe
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1101052
Version: 1