Skip to contentSkip to conversation

OMAP IOMMU fixes to go with 5.4 OMAP IOMMU changes

PATCH In review Suman Anna via iommu 3 participants 7 messages Aug 27, 2019 – Oct 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover OMAP IOMMU fixes to go with 5.4 OMAP IOMMU changes

Hi Tony,

The following 2 patches need to go along with the recent "iommu/omap: misc fixes" series [1] that is currently staged [2] for a 5.4 merge and available in linux-next. That series added runtime pm callbacks in preparation for the ti-sysc migration, but without adding the necessary platform data callbacks for the existing functional MMUs on OMAP3, OMAP4 and OMAP5 SoCs. These 2 patches add the same to maintain the functionality (l3_noc errors are the visible symptom while enabling the MMUs without these patches).

OMAP4 and OMAP5 would also need another set of fixes related to the breakage caused by the switch to clkctrl clocks as seen in [3].

These patches do have a dependency on the staged patches, so either you submit a pull-request towards 5.4-rc2 using 5.4-rc1 baseline, or let Joerg pick these through the arm/omap IOMMU branch for 5.4-rc1 itself.

Sakari/Laurent,
Appreciate it if you can check the OMAP3 ISP functionality on latest linux-next with the second patch. I have verified the ISP MMU programming only through an unit-test.

Tero,
I will be submitting another patch against OMAP IOMMU driver to skip the pdata callbacks for ti-sysc in the next couple of days.

regards
Suman

[1] https://lore.kernel.org/linux-iommu/[email protected]/T/#mec99f8e8ed351689f4fcc76f4f000f9144a02b51
[2] https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/log/?h=arm/omap
[3] https://patchwork.kernel.org/patch/11082125/#22829477

Suman Anna (2):
ARM: OMAP2+: Plug in device_enable/idle ops for IOMMUs
ARM: OMAP2+: Add pdata for OMAP3 ISP IOMMU

 arch/arm/mach-omap2/pdata-quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
Signature · 1 line
2.22.0
#1 lore raw

PATCH 1/2 ARM: OMAP2+: Plug in device_enable/idle ops for IOMMUs

The OMAP IOMMU driver requires the device_enable/idle platform data ops on all the IOMMU devices to be able to enable and disable the clocks after commit db8918f61d51 ("iommu/omap: streamline enable/disable through runtime pm callbacks"). Plug in these pdata ops for all the existing IOMMUs through pdata quirks to maintain functionality.

---
 arch/arm/mach-omap2/pdata-quirks.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +4 -0
index 6c6f8fce854e..dbe8d9718f70 100644
@@ -89,6 +89,8 @@ static struct iommu_platform_data omap3_iommu_pdata = {
 	.reset_name = "mmu",
 	.assert_reset = omap_device_assert_hardreset,
 	.deassert_reset = omap_device_deassert_hardreset,
+	.device_enable = omap_device_enable,
+	.device_idle = omap_device_idle,
 };
 
 static int omap3_sbc_t3730_twl_callback(struct device *dev,
@@ -424,6 +426,8 @@ static struct iommu_platform_data omap4_iommu_pdata = {
 	.reset_name = "mmu_cache",
 	.assert_reset = omap_device_assert_hardreset,
 	.deassert_reset = omap_device_deassert_hardreset,
+	.device_enable = omap_device_enable,
+	.device_idle = omap_device_idle,
 };
 #endif
 
Signature · 1 line
2.22.0
#2 lore raw

Re: [PATCH 1/2] ARM: OMAP2+: Plug in device_enable/idle ops for IOMMUs

Thank you for the patch! Yet something to improve:

Hi Suman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on arm/for-next]
[cannot apply to v5.3-rc6 next-20190826]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Suman-Anna/OMAP-IOMMU-fixes-to-go-with-5-4-OMAP-IOMMU-changes/20190827-121217
base:   git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag

All error/warnings (new ones prefixed by >>):

>> arch/arm/mach-omap2/pdata-quirks.c:92:3: error: 'struct iommu_platform_data' has no member named 'device_enable'
     .device_enable = omap_device_enable,
      ^~~~~~~~~~~~~
>> arch/arm/mach-omap2/pdata-quirks.c:92:19: warning: excess elements in struct initializer
     .device_enable = omap_device_enable,
                      ^~~~~~~~~~~~~~~~~~
   arch/arm/mach-omap2/pdata-quirks.c:92:19: note: (near initialization for 'omap3_iommu_pdata')
>> arch/arm/mach-omap2/pdata-quirks.c:93:3: error: 'struct iommu_platform_data' has no member named 'device_idle'

.device_idle = omap_device_idle,
^~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:93:17: warning: excess elements in struct initializer
.device_idle = omap_device_idle,
^~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:93:17: note: (near initialization for 'omap3_iommu_pdata') arch/arm/mach-omap2/pdata-quirks.c:429:3: error: 'struct iommu_platform_data' has no member named 'device_enable'
.device_enable = omap_device_enable,
^~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:429:19: warning: excess elements in struct initializer
.device_enable = omap_device_enable,
^~~~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:429:19: note: (near initialization for 'omap4_iommu_pdata') arch/arm/mach-omap2/pdata-quirks.c:430:3: error: 'struct iommu_platform_data' has no member named 'device_idle'
.device_idle = omap_device_idle,
^~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:430:17: warning: excess elements in struct initializer
.device_idle = omap_device_idle,
^~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:430:17: note: (near initialization for 'omap4_iommu_pdata')

vim +92 arch/arm/mach-omap2/pdata-quirks.c

    87	
    88	static struct iommu_platform_data omap3_iommu_pdata = {
    89		.reset_name = "mmu",
    90		.assert_reset = omap_device_assert_hardreset,
    91		.deassert_reset = omap_device_deassert_hardreset,
  > 92		.device_enable = omap_device_enable,
  > 93		.device_idle = omap_device_idle,
    94	};
    95	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw

PATCH 2/2 ARM: OMAP2+: Add pdata for OMAP3 ISP IOMMU

In reply to Suman Anna via iommu

The OMAP3 ISP IOMMU does not have any reset lines, so it didn't need any pdata previously. The OMAP IOMMU driver now requires the platform data ops for device_enable/idle on all the IOMMU devices after commit db8918f61d51 ("iommu/omap: streamline enable/disable through runtime pm callbacks") to enable/disable the clocks properly and maintain the reference count and the omap_hwmod state machine. So, add these callbacks through iommu pdata quirks for the OMAP3 ISP IOMMU.

---
 arch/arm/mach-omap2/pdata-quirks.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +7 -0
index dbe8d9718f70..3d597fb962e9 100644
@@ -93,6 +93,11 @@ static struct iommu_platform_data omap3_iommu_pdata = {
 	.device_idle = omap_device_idle,
 };
 
+static struct iommu_platform_data omap3_iommu_isp_pdata = {
+	.device_enable = omap_device_enable,
+	.device_idle = omap_device_idle,
+};
+
 static int omap3_sbc_t3730_twl_callback(struct device *dev,
 					   unsigned gpio,
 					   unsigned ngpio)
@@ -621,6 +626,8 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {
 #ifdef CONFIG_ARCH_OMAP3
 	OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
 		       &omap3_iommu_pdata),
+	OF_DEV_AUXDATA("ti,omap2-iommu", 0x480bd400, "480bd400.mmu",
+		       &omap3_iommu_isp_pdata),
 	OF_DEV_AUXDATA("ti,omap3-smartreflex-core", 0x480cb000,
 		       "480cb000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
 	OF_DEV_AUXDATA("ti,omap3-smartreflex-mpu-iva", 0x480c9000,
Signature · 1 line
2.22.0
#4 lore raw

Re: [PATCH 2/2] ARM: OMAP2+: Add pdata for OMAP3 ISP IOMMU

Thank you for the patch! Yet something to improve:

Hi Suman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on arm/for-next]
[cannot apply to v5.3-rc6 next-20190827]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Suman-Anna/OMAP-IOMMU-fixes-to-go-with-5-4-OMAP-IOMMU-changes/20190827-121217
base:   git://git.armlinux.org.uk/~rmk/linux-arm.git for-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 7.4.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=arm

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

arch/arm/mach-omap2/pdata-quirks.c:92:3: error: 'struct iommu_platform_data' has no member named 'device_enable'
.device_enable = omap_device_enable,
^~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:92:19: warning: excess elements in struct initializer
.device_enable = omap_device_enable,
^~~~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:92:19: note: (near initialization for 'omap3_iommu_pdata') arch/arm/mach-omap2/pdata-quirks.c:93:3: error: 'struct iommu_platform_data' has no member named 'device_idle'
.device_idle = omap_device_idle,
^~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:93:17: warning: excess elements in struct initializer
.device_idle = omap_device_idle,
^~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:93:17: note: (near initialization for 'omap3_iommu_pdata') arch/arm/mach-omap2/pdata-quirks.c:97:3: error: 'struct iommu_platform_data' has no member named 'device_enable'
.device_enable = omap_device_enable,
^~~~~~~~~~~~~

>> arch/arm/mach-omap2/pdata-quirks.c:97:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]

.device_enable = omap_device_enable,
^~~~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:97:19: note: (near initialization for 'omap3_iommu_isp_pdata.reset_name') arch/arm/mach-omap2/pdata-quirks.c:98:3: error: 'struct iommu_platform_data' has no member named 'device_idle'
.device_idle = omap_device_idle,
^~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:98:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.device_idle = omap_device_idle,
^~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:98:17: note: (near initialization for 'omap3_iommu_isp_pdata.assert_reset') arch/arm/mach-omap2/pdata-quirks.c:434:3: error: 'struct iommu_platform_data' has no member named 'device_enable'
.device_enable = omap_device_enable,
^~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:434:19: warning: excess elements in struct initializer
.device_enable = omap_device_enable,
^~~~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:434:19: note: (near initialization for 'omap4_iommu_pdata') arch/arm/mach-omap2/pdata-quirks.c:435:3: error: 'struct iommu_platform_data' has no member named 'device_idle'
.device_idle = omap_device_idle,
^~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:435:17: warning: excess elements in struct initializer
.device_idle = omap_device_idle,
^~~~~~~~~~~~~~~~
arch/arm/mach-omap2/pdata-quirks.c:435:17: note: (near initialization for 'omap4_iommu_pdata')
cc1: some warnings being treated as errors

vim +97 arch/arm/mach-omap2/pdata-quirks.c

87
88 static struct iommu_platform_data omap3_iommu_pdata = {
89 .reset_name = "mmu",
90 .assert_reset = omap_device_assert_hardreset,
91 .deassert_reset = omap_device_deassert_hardreset,
92 .device_enable = omap_device_enable,

  > 93		.device_idle = omap_device_idle,
    94	};
    95	
    96	static struct iommu_platform_data omap3_iommu_isp_pdata = {
  > 97		.device_enable = omap_device_enable,
    98		.device_idle = omap_device_idle,
    99	};

100

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#5 lore raw
In reply to Suman Anna via iommu

Hi Tony,

Quoted 29 lines · Suman Anna

Hi Tony,

The following 2 patches need to go along with the recent "iommu/omap: misc fixes" series [1] that is currently staged [2] for a 5.4 merge and available in linux-next. That series added runtime pm callbacks in preparation for the ti-sysc migration, but without adding the necessary platform data callbacks for the existing functional MMUs on OMAP3, OMAP4 and OMAP5 SoCs. These 2 patches add the same to maintain the functionality (l3_noc errors are the visible symptom while enabling the MMUs without these patches).

OMAP4 and OMAP5 would also need another set of fixes related to the breakage caused by the switch to clkctrl clocks as seen in [3].

These patches do have a dependency on the staged patches, so either you submit a pull-request towards 5.4-rc2 using 5.4-rc1 baseline, or let Joerg pick these through the arm/omap IOMMU branch for 5.4-rc1 itself.

Sakari/Laurent,
Appreciate it if you can check the OMAP3 ISP functionality on latest linux-next with the second patch. I have verified the ISP MMU programming only through an unit-test.

Tero,
I will be submitting another patch against OMAP IOMMU driver to skip the pdata callbacks for ti-sysc in the next couple of days.

regards
Suman

Quoted 7 lines

[1] https://lore.kernel.org/linux-iommu/[email protected]/T/#mec99f8e8ed351689f4fcc76f4f000f9144a02b51
[2] https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/log/?h=arm/omap
[3] https://patchwork.kernel.org/patch/11082125/#22829477

Suman Anna (2):
ARM: OMAP2+: Plug in device_enable/idle ops for IOMMUs
ARM: OMAP2+: Add pdata for OMAP3 ISP IOMMU

Can you please pick these patches up for 5.4-rc cycle? The OMAP IOMMU changes that went in for 5.4-rc1 need the pdata to be plugged in.

regards
Suman

Quoted 4 lines
 arch/arm/mach-omap2/pdata-quirks.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
maintainer
#6 lore raw
Quoted 36 lines · Suman Anna

Hi Tony,

Quoted 33 lines · Suman Anna

Hi Tony,

The following 2 patches need to go along with the recent "iommu/omap: misc fixes" series [1] that is currently staged [2] for a 5.4 merge and available in linux-next. That series added runtime pm callbacks in preparation for the ti-sysc migration, but without adding the necessary platform data callbacks for the existing functional MMUs on OMAP3, OMAP4 and OMAP5 SoCs. These 2 patches add the same to maintain the functionality (l3_noc errors are the visible symptom while enabling the MMUs without these patches).

OMAP4 and OMAP5 would also need another set of fixes related to the breakage caused by the switch to clkctrl clocks as seen in [3].

These patches do have a dependency on the staged patches, so either you submit a pull-request towards 5.4-rc2 using 5.4-rc1 baseline, or let Joerg pick these through the arm/omap IOMMU branch for 5.4-rc1 itself.

Sakari/Laurent,
Appreciate it if you can check the OMAP3 ISP functionality on latest linux-next with the second patch. I have verified the ISP MMU programming only through an unit-test.

Tero,
I will be submitting another patch against OMAP IOMMU driver to skip the pdata callbacks for ti-sysc in the next couple of days.

regards
Suman

[1] https://lore.kernel.org/linux-iommu/[email protected]/T/#mec99f8e8ed351689f4fcc76f4f000f9144a02b51
[2] https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git/log/?h=arm/omap
[3] https://patchwork.kernel.org/patch/11082125/#22829477

Quoted 6 lines
Quoted 3 lines

Suman Anna (2):
ARM: OMAP2+: Plug in device_enable/idle ops for IOMMUs
ARM: OMAP2+: Add pdata for OMAP3 ISP IOMMU

Can you please pick these patches up for 5.4-rc cycle? The OMAP IOMMU changes that went in for 5.4-rc1 need the pdata to be plugged in.

Oh OK. Sorry for missing these, I untagged them earlier as they produced kbuilder test failures as the dependencies were missing earlier.

Applying both into fixes.

Regards,

Tony