Skip to content

[PW_SID:1101052] driver core: platform: Setup device MSI domain just before driver probe#2019

Open
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1101052
Open

[PW_SID:1101052] driver core: platform: Setup device MSI domain just before driver probe#2019
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1101052

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

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

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>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1355.95 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2023.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.12 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
kdoc
Desc: Detects for kdoc errors
Duration: 0.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
module-param
Desc: Detect module_param changes
Duration: 0.80 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "driver core: platform: Setup device MSI domain just before driver probe"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants