[PATCH v6 04/10] drm/bridge: analogix_dp: Fix connector and encoder cleanup

2017-10-18 Thread Jeffy Chen
Since we are initing connector in the core driver and encoder in the plat driver, let's clean them up in the right places. Signed-off-by: Jeffy Chen Reviewed-by: Andrzej Hajda --- Changes in v6: Don't change order of rockchip_drm_psr_register(). Changes in v5: None drivers/gpu/

[PATCH v6 01/10] arm64: dts: rockchip: Enable edp disaplay on kevin

2017-10-18 Thread Jeffy Chen
Add edp panel and enable related nodes on kevin. Signed-off-by: Jeffy Chen Reviewed-by: Mark Yao --- Changes in v6: None Changes in v5: None arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 29 +++ arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 16

[PATCH v6 00/10] rockchip: kevin: Enable edp display

2017-10-18 Thread Jeffy Chen
hook in the error handling path like in unbind(). Update cleanup order in unbind(). Add disable to unbind(), and inline clk_prepare_enable() with bind(). Jeffy Chen (10): arm64: dts: rockchip: Enable edp disaplay on kevin drm/rockchip: analogix_dp: Remove unnecessary init code drm/bridge: ana

[PATCH v7 2/3] dt-bindings: PCI: Add definition of pcie wake irq

2017-10-19 Thread Jeffy Chen
Add an optional interrupt for PCIE_WAKE pin. Signed-off-by: Jeffy Chen Acked-by: Rob Herring --- Changes in v7: None Changes in v6: None Changes in v5: Move to pci.txt Changes in v3: None Changes in v2: None Documentation/devicetree/bindings/pci/pci.txt | 2 ++ 1 file changed, 2 insertions

[PATCH v7 3/3] arm64: dts: rockchip: Handle pcie wake in pcie driver for Gru

2017-10-19 Thread Jeffy Chen
Currently we are handling pcie wake irq in mrvl wifi driver. Move it to rockchip pcie driver for Gru boards. Signed-off-by: Jeffy Chen --- Changes in v7: None Changes in v6: None Changes in v5: Use "wakeup" instead of "wake" Changes in v3: None Changes in v2: None

[PATCH v7 1/3] PCI: Add support for wake irq

2017-10-19 Thread Jeffy Chen
Add support for PCIE_WAKE pin. Signed-off-by: Jeffy Chen --- Changes in v7: Move PCIE_WAKE handling into pci core. Changes in v6: Fix device_init_wake error handling, and add some comments. Changes in v5: Rebase Changes in v3: Fix error handling Changes in v2: Use

[PATCH v7 0/3] PCI: rockchip: Move PCIE_WAKE handling into pci core

2017-10-19 Thread Jeffy Chen
: Rebase Move to pci.txt Use "wakeup" instead of "wake" Changes in v3: Fix error handling Changes in v2: Use dev_pm_set_dedicated_wake_irq -- Suggested by Brian Norris Jeffy Chen (3): PCI: Add support for wake irq dt-bindings: PCI: Add definition of pcie wake irq

[PATCH v3] driver core: Move device_links_purge() after bus_remove_device()

2017-10-19 Thread Jeffy Chen
device_links_purge() call in device_del() after the invocation of bus_remove_device() which calls device_release_driver(). Signed-off-by: Jeffy Chen Reviewed-by: Rafael J. Wysocki --- Changes in v3: Remove wrong signed-off-by. Changes in v2: Update commit message provided by Rafael. drivers

[RFC PATCH v9 5/7] PCI: Make pci_platform_pm_ops's callbacks optional

2017-10-27 Thread Jeffy Chen
Allow platforms not to provide some of the pci_platform_pm_ops's callbacks. Also change the return value from -ENOSYS to -ENODEV for: warning: drivers/pci/pci.c,594: ENOSYS means 'invalid syscall nr' and nothing else Signed-off-by: Jeffy Chen --- Changes in v9: None Chan

[RFC PATCH v9 3/7] mwifiex: Disable wakeup irq handling for pcie

2017-10-27 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless/marvell/mwifiex/main.c | 4 1 file changed

[RFC PATCH v9 0/7] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-10-27 Thread Jeffy Chen
g into pci core. Changes in v6: Fix device_init_wake error handling, and add some comments. Changes in v5: Move to pci.txt Use "wakeup" instead of "wake" Rebase. Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (7): dt-binding

[RFC PATCH v9 7/7] PCI / PM: Add support for the PCIe WAKE# signal for OF

2017-10-27 Thread Jeffy Chen
Add pci-of.c to handle the PCIe WAKE# interrupt. Also use the dedicated wakeirq infrastructure to simplify it. Signed-off-by: Jeffy Chen --- Changes in v9: Fix check error in .cleanup(). Move dedicated wakeirq setup to setup() callback and use device_set_wakeup_enable() to enable/disable

[RFC PATCH v9 2/7] of/irq: Adjust of_pci_irq parsing for multiple interrupts

2017-10-27 Thread Jeffy Chen
Currently we are considering the first irq as the PCI interrupt pin, but a PCI device may have multiple interrupts(e.g. PCIe WAKE# pin). Only parse the PCI interrupt pin when the irq is unnamed or named as "pci". Signed-off-by: Jeffy Chen --- Changes in v9: None Changes in v8: None

[RFC PATCH v9 4/7] arm64: dts: rockchip: Move PCIe WAKE# irq to pcie driver for Gru

2017-10-27 Thread Jeffy Chen
Currently we are handling PCIe WAKE# irq in mrvl wifi driver. Move it to rockchip pcie driver since we are going to handle it in the pci core. Also avoid this irq been considered as the PCI interrupt pin in the of_irq_parse_pci(). Signed-off-by: Jeffy Chen --- Changes in v9: Rewrite the

[RFC PATCH v9 6/7] PCI / PM: Move acpi wakeup code to pci core

2017-10-27 Thread Jeffy Chen
Move acpi wakeup code to pci core as pci_set_wakeup(), so that other platforms could reuse it. Also add .setup_dev() / .setup_host_bridge() / .cleanup() platform pm ops's callbacks to setup and cleanup pci devices and host bridge for wakeup. Signed-off-by: Jeffy Chen --- Changes in v9:

[RFC PATCH v9 1/7] dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq

2017-10-27 Thread Jeffy Chen
. Signed-off-by: Jeffy Chen --- Changes in v9: Add section for PCI devices and rewrite the commit message. Changes in v8: Add optional "pci", and rewrite commit message. Changes in v7: None Changes in v6: None Changes in v5: Move to pci.txt Changes in v3: None Changes in v2: None Doc

[RFC PATCH v10 1/7] dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq

2017-10-27 Thread Jeffy Chen
. Signed-off-by: Jeffy Chen --- Changes in v10: None Changes in v9: Add section for PCI devices and rewrite the commit message. Changes in v8: Add optional "pci", and rewrite commit message. Changes in v7: None Changes in v6: None Changes in v5: Move to pci.txt Changes in v3: None Cha

[RFC PATCH v10 4/7] arm64: dts: rockchip: Move PCIe WAKE# irq to pcie driver for Gru

2017-10-27 Thread Jeffy Chen
Currently we are handling PCIe WAKE# irq in mrvl wifi driver. Move it to rockchip pcie driver since we are going to handle it in the pci core. Also avoid this irq been considered as the PCI interrupt pin in the of_irq_parse_pci(). Signed-off-by: Jeffy Chen --- Changes in v10: None Changes in

[RFC PATCH v10 5/7] PCI: Make pci_platform_pm_ops's callbacks optional

2017-10-27 Thread Jeffy Chen
Allow platforms not to provide some of the pci_platform_pm_ops's callbacks. Also change the return value from -ENOSYS to -ENODEV for: warning: drivers/pci/pci.c,594: ENOSYS means 'invalid syscall nr' and nothing else Signed-off-by: Jeffy Chen --- Changes in v10: None Chan

[RFC PATCH v10 3/7] mwifiex: Disable wakeup irq handling for pcie

2017-10-27 Thread Jeffy Chen
We are going to handle the wakeup irq in the pci core. Signed-off-by: Jeffy Chen --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v5: None Changes in v3: None Changes in v2: None drivers/net/wireless/marvell/mwifiex/main.c | 4

[RFC PATCH v10 2/7] of/irq: Adjust of_pci_irq parsing for multiple interrupts

2017-10-27 Thread Jeffy Chen
Currently we are considering the first irq as the PCI interrupt pin, but a PCI device may have multiple interrupts(e.g. PCIe WAKE# pin). Only parse the PCI interrupt pin when the irq is unnamed or named as "pci". Signed-off-by: Jeffy Chen --- Changes in v10: None Changes in v9: None

[RFC PATCH v10 6/7] PCI / PM: Move acpi wakeup code to pci core

2017-10-27 Thread Jeffy Chen
Move acpi wakeup code to pci core as pci_set_wakeup(), so that other platforms could reuse it. Also add .setup_dev() / .setup_host_bridge() / .cleanup() platform pm ops's callbacks to setup and cleanup pci devices and host bridge for wakeup. Signed-off-by: Jeffy Chen --- Changes in v10:

[RFC PATCH v10 7/7] PCI / PM: Add support for the PCIe WAKE# signal for OF

2017-10-27 Thread Jeffy Chen
Add pci-of.c to handle the PCIe WAKE# interrupt. Also use the dedicated wakeirq infrastructure to simplify it. Signed-off-by: Jeffy Chen --- Changes in v10: Use device_set_wakeup_capable() instead of device_set_wakeup_enable(), since dedicated wakeirq will be lost in device_set_wakeup_enable

[RFC PATCH v10 0/7] PCI: rockchip: Move PCIe WAKE# handling into pci core

2017-10-27 Thread Jeffy Chen
eup" instead of "wake" Rebase. Changes in v3: Fix error handling. Changes in v2: Use dev_pm_set_dedicated_wake_irq. Jeffy Chen (7): dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq of/irq: Adjust of_pci_irq parsing for multiple interrupts mwifiex: Disable wakeup

[PATCH v5 00/13] iommu/rockchip: Use OF_IOMMU

2018-01-24 Thread Jeffy Chen
startup() and shutdown() when iommu attached. Remove pm_mutex. Check runtime PM disabled. Check pm_runtime in rk_iommu_irq(). Remove rk_iommudata->domain. Changes in v2: Move irq request to probe(in patch[0]) Move bus_set_iommu() to rk_iommu_probe(). Jeffy Chen (9): iommu/rockchip: Prohibit unb

[PATCH v5 02/13] iommu/rockchip: Fix error handling in probe

2018-01-24 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a

[PATCH v5 03/13] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-01-24 Thread Jeffy Chen
Move request_irq to the end of rk_iommu_probe(). Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: Loop platform_get_irq() as Robin suggested. Changes in v2: None drivers/iommu/rockchip-iommu.c | 38

[PATCH v5 05/13] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-24 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v5

[PATCH v5 04/13] iommu/rockchip: Fix error handling in attach

2018-01-24 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa Signed-off

[PATCH v5 07/13] ARM: dts: rockchip: add clocks in vop iommu nodes

2018-01-24 Thread Jeffy Chen
Add clocks in vop iommu nodes, since we are going to control clocks in rockchip iommu driver. Signed-off-by: Jeffy Chen --- Changes in v5: Remove clk names. Changes in v4: None Changes in v3: None Changes in v2: None arch/arm/boot/dts/rk3036.dtsi | 1 + arch/arm/boot/dts/rk3288.dtsi | 2

[PATCH v5 06/13] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-24 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4

[PATCH v5 10/13] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-24 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v5: None Changes in v4: None Changes in v3: Add struct

[PATCH v5 13/13] iommu/rockchip: Support sharing IOMMU between masters

2018-01-24 Thread Jeffy Chen
There would be some masters sharing the same IOMMU device. Put them in the same iommu group and share the same iommu domain. Signed-off-by: Jeffy Chen Reviewed-by: Robin Murphy --- Changes in v5: None Changes in v4: None Changes in v3: Remove rk_iommudata->domain. Changes in v2: N

[PATCH v5 12/13] iommu/rockchip: Add runtime PM support

2018-01-24 Thread Jeffy Chen
When the power domain is powered off, the IOMMU cannot be accessed and register programming must be deferred until the power domain becomes enabled. Add runtime PM support, and use runtime PM device link from IOMMU to master to startup and shutdown IOMMU. Signed-off-by: Jeffy Chen --- Changes

[PATCH v5 11/13] iommu/rockchip: Fix error handling in init

2018-01-24 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of rk_iommu_probe(). Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Reviewed-by: Robin Murphy --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: Move bus_set_iommu() to rk_iommu_

[PATCH v5 09/13] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-24 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Reviewed-by: Robin Murphy --- Changes in v5: None Changes in v4: None Changes in v3: None Changes

[PATCH v5 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-24 Thread Jeffy Chen
mapping API and doesn't engage the master driver at all. This patch fixes the problem by letting clocks needed for IOMMU operation to be listed in Device Tree and making the driver enable them for the time of accessing the hardware. Signed-off-by: Jeffy Chen Signed-off-by: Tomasz Figa --- Ch

[PATCH v5 01/13] iommu/rockchip: Prohibit unbind and remove

2018-01-24 Thread Jeffy Chen
Removal of IOMMUs cannot be done reliably. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v5: None Changes in v4: Rewrite commit message. Changes in v3: Also remove remove() and module_exit() as Tomasz suggested. Changes in v2: None

[PATCH 1/9] iommu/of: Drop early initialisation hooks

2018-01-11 Thread Jeffy Chen
With the probe-deferral mechanism, early initialisation hooks are no longer needed. Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- drivers/iommu/arm-smmu-v3.c | 2 +- drivers/iommu/arm-smmu.c | 12 ++-- drivers/iommu/exynos-iommu.c | 2 +- drivers/iommu/ipmmu-vmsa.c

[PATCH 0/9] iommu/rockchip: Use OF_IOMMU

2018-01-11 Thread Jeffy Chen
This series fixes some issues in rockchip iommu driver, and add of_iommu support in it. Also drop of_iommu early initialisation hooks as Robin suggested. Jeffy Chen (5): iommu/of: Drop early initialisation hooks iommu/rockchip: Fix error handling in probe iommu/rockchip: Fix error

[PATCH 3/9] iommu/rockchip: Fix error handling in probe

2018-01-11 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index ee805e1dfba7..a05844cabb45 100644

[PATCH 5/9] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 68

[PATCH 2/9] iommu/rockchip: Fix error handling in attach

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa Signed-off

[PATCH 6/9] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-11 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c

[PATCH 4/9] iommu/rockchip: Fix error handling in init

2018-01-11 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of init call. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/roc

[PATCH 8/9] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-11 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 96 -- 1 file changed, 28 insertions(+), 68

[PATCH 9/9] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-11 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 13 + 1 file changed, 13 insertions(+) diff --git a

[PATCH 7/9] iommu/rockchip: Use iommu_group_get_for_dev() for add_device

2018-01-11 Thread Jeffy Chen
with this requirement. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- drivers/iommu/rockchip-iommu.c | 122 + 1 file changed, 64 insertions(+), 58 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index

[PATCH v3 00/12] iommu/rockchip: Use OF_IOMMU

2018-01-17 Thread Jeffy Chen
add_device Only call startup() and shutdown() when iommu attached. Remove pm_mutex. Check runtime PM disabled. Check pm_runtime in rk_iommu_irq(). Remove rk_iommudata->domain. Changes in v2: Move irq request to probe(in patch[0]) Move bus_set_iommu() to rk_iommu_probe(). Jeffy Chen (8): iommu/rockc

[PATCH v3 04/12] iommu/rockchip: Fix error handling in attach

2018-01-17 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa Signed-off

[PATCH v3 05/12] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-17 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v3: None Changes in v2: None

[PATCH v3 06/12] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-17 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v3: None Changes in v2

[PATCH v3 07/12] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-17 Thread Jeffy Chen
mapping API and doesn't engage the master driver at all. This patch fixes the problem by letting clocks needed for IOMMU operation to be listed in Device Tree and making the driver enable them for the time of accessing the hardware. Signed-off-by: Jeffy Chen Signed-off-by: Tomasz Figa --- Ch

[PATCH v3 09/12] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-17 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen --- Changes in v3: Add struct rk_iommudata. Squash iommu/rockchip: Use iommu_group_get_for_dev() for

[PATCH v3 08/12] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-17 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 85

[PATCH v3 12/12] iommu/rockchip: Support sharing IOMMU between masters

2018-01-17 Thread Jeffy Chen
There would be some masters sharing the same IOMMU device. Put them in the same iommu group and share the same iommu domain. Signed-off-by: Jeffy Chen --- Changes in v3: Remove rk_iommudata->domain. Changes in v2: None drivers/iommu/rockchip-iommu.c | 22 -- 1 f

[PATCH v3 11/12] iommu/rockchip: Add runtime PM support

2018-01-17 Thread Jeffy Chen
When the power domain is powered off, the IOMMU cannot be accessed and register programming must be deferred until the power domain becomes enabled. Add runtime PM support, and use runtime PM device link from IOMMU to master to startup and shutdown IOMMU. Signed-off-by: Jeffy Chen --- Changes

[PATCH v3 10/12] iommu/rockchip: Fix error handling in init

2018-01-17 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of rk_iommu_probe(). Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v3: None Changes in v2: Move bus_set_iommu() to rk_iommu_probe(). drivers/iommu/rockchip-iommu.c | 15 ++- 1

[PATCH v3 03/12] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-01-17 Thread Jeffy Chen
Move request_irq to the end of rk_iommu_probe(). Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- Changes in v3: Loop platform_get_irq() as Robin suggested. Changes in v2: None drivers/iommu/rockchip-iommu.c | 38 +- 1 file changed, 9 insertions

[PATCH v3 02/12] iommu/rockchip: Fix error handling in probe

2018-01-17 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers

[PATCH v3 01/12] iommu/rockchip: Prohibiat unbind and remove

2018-01-17 Thread Jeffy Chen
Removal the IOMMUs cannot be done reliably. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen --- Changes in v3: Also remove remove() and module_exit() as Tomasz suggested. Changes in v2: None drivers/iommu/rockchip-iommu.c | 21 + 1 file changed, 1

[PATCH v4 01/13] iommu/rockchip: Prohibit unbind and remove

2018-01-18 Thread Jeffy Chen
Removal of IOMMUs cannot be done reliably. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v4: Rewrite commit message. Changes in v3: Also remove remove() and module_exit() as Tomasz suggested. Changes in v2: None drivers/iommu

[PATCH v4 04/13] iommu/rockchip: Fix error handling in attach

2018-01-18 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa Signed-off

[PATCH v4 03/13] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-01-18 Thread Jeffy Chen
Move request_irq to the end of rk_iommu_probe(). Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: Loop platform_get_irq() as Robin suggested. Changes in v2: None drivers/iommu/rockchip-iommu.c | 38 +- 1 file

[PATCH v4 00/13] iommu/rockchip: Use OF_IOMMU

2018-01-18 Thread Jeffy Chen
to rk_iommu_probe(). Jeffy Chen (9): iommu/rockchip: Prohibit unbind and remove iommu/rockchip: Fix error handling in probe iommu/rockchip: Request irqs in rk_iommu_probe() ARM: dts: rockchip: add clocks in vop iommu nodes iommu/rockchip: Use IOMMU device for dma mapping operations iommu/rockchip:

[PATCH v4 05/13] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-18 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None

[PATCH v4 06/13] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-18 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3

[PATCH v4 09/13] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-18 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c

[PATCH v4 07/13] ARM: dts: rockchip: add clocks in vop iommu nodes

2018-01-18 Thread Jeffy Chen
Add clocks in vop iommu nodes, since we are going to control clocks in rockchip iommu driver. Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: None Changes in v2: None arch/arm/boot/dts/rk3036.dtsi | 2 ++ arch/arm/boot/dts/rk3288.dtsi | 4 2 files changed, 6 insertions

[PATCH v4 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-18 Thread Jeffy Chen
mapping API and doesn't engage the master driver at all. This patch fixes the problem by letting clocks needed for IOMMU operation to be listed in Device Tree and making the driver enable them for the time of accessing the hardware. Signed-off-by: Jeffy Chen Signed-off-by: Tomasz Figa --- Ch

[PATCH v4 13/13] iommu/rockchip: Support sharing IOMMU between masters

2018-01-18 Thread Jeffy Chen
There would be some masters sharing the same IOMMU device. Put them in the same iommu group and share the same iommu domain. Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: Remove rk_iommudata->domain. Changes in v2: None drivers/iommu/rockchip-iommu.c |

[PATCH v4 11/13] iommu/rockchip: Fix error handling in init

2018-01-18 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of rk_iommu_probe(). Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v4: None Changes in v3: None Changes in v2: Move bus_set_iommu() to rk_iommu_probe(). drivers/iommu/rockchip-iommu.c

[PATCH v4 12/13] iommu/rockchip: Add runtime PM support

2018-01-18 Thread Jeffy Chen
When the power domain is powered off, the IOMMU cannot be accessed and register programming must be deferred until the power domain becomes enabled. Add runtime PM support, and use runtime PM device link from IOMMU to master to startup and shutdown IOMMU. Signed-off-by: Jeffy Chen --- Changes

[PATCH v4 10/13] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-18 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen --- Changes in v4: None Changes in v3: Add struct rk_iommudata. Squash iommu/rockchip: Use

[PATCH v4 02/13] iommu/rockchip: Fix error handling in probe

2018-01-18 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu

[PATCH v2 03/13] iommu/rockchip: Fix error handling in attach

2018-01-16 Thread Jeffy Chen
From: Tomasz Figa Currently if the driver encounters an error while attaching device, it will leave the IOMMU in an inconsistent state. Even though it shouldn't really happen in reality, let's just add proper error path to keep things consistent. Signed-off-by: Tomasz Figa Signed-off

[PATCH v2 06/13] iommu/rockchip: Use iopoll helpers to wait for hardware

2018-01-16 Thread Jeffy Chen
From: Tomasz Figa This patch converts the rockchip-iommu driver to use the in-kernel iopoll helpers to wait for certain status bits to change in registers instead of an open-coded custom macro. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu

[PATCH v2 00/13] iommu/rockchip: Use OF_IOMMU

2018-01-16 Thread Jeffy Chen
This series fixes some issues in rockchip iommu driver, and add of_iommu support in it. Changes in v2: Move irq request to probe(in patch[0]) Move bus_set_iommu() to rk_iommu_probe(). Jeffy Chen (9): iommu/rockchip: Request irqs in rk_iommu_probe() iommu/rockchip: Suppress unbinding iommu

[PATCH v2 07/13] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-01-16 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v2: None drivers

[PATCH v2 10/13] iommu/rockchip: Use IOMMU device for dma mapping operations

2018-01-16 Thread Jeffy Chen
Use the first registered IOMMU device for dma mapping operations, and drop the domain platform device. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 91 +++--- 1 file changed, 24

[PATCH v2 09/13] iommu/rockchip: Use iommu_group_get_for_dev() for add_device

2018-01-16 Thread Jeffy Chen
. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 120 + 1 file changed, 63 insertions(+), 57 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index

[PATCH v2 08/13] iommu/rockchip: Control clocks needed to access the IOMMU

2018-01-16 Thread Jeffy Chen
mapping API and doesn't engage the master driver at all. This patch fixes the problem by letting clocks needed for IOMMU operation to be listed in Device Tree and making the driver enable them for the time of accessing the hardware. Signed-off-by: Jeffy Chen Signed-off-by: Tomasz Figa --- Ch

[PATCH v2 11/13] iommu/rockchip: Use OF_IOMMU to attach devices automatically

2018-01-16 Thread Jeffy Chen
Converts the rockchip-iommu driver to use the OF_IOMMU infrastructure, which allows attaching master devices to their IOMMUs automatically according to DT properties. Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 116

[PATCH v2 13/13] iommu/rockchip: Support sharing IOMMU between masters

2018-01-16 Thread Jeffy Chen
There would be some masters sharing the same IOMMU device. Put them in the same iommu group and share the same iommu domain. Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 39 +++ 1 file changed, 31 insertions(+), 8

[PATCH v2 12/13] iommu/rockchip: Add runtime PM support

2018-01-16 Thread Jeffy Chen
When the power domain is powered off, the IOMMU cannot be accessed and register programming must be deferred until the power domain becomes enabled. Add runtime PM support, and use runtime PM device link from IOMMU to master to startup and shutdown IOMMU. Signed-off-by: Jeffy Chen --- Changes

[PATCH v2 05/13] iommu/rockchip: Fix error handling in init

2018-01-16 Thread Jeffy Chen
It's hard to undo bus_set_iommu() in the error path, so move it to the end of rk_iommu_probe(). Signed-off-by: Jeffy Chen --- Changes in v2: Move bus_set_iommu() to rk_iommu_probe(). drivers/iommu/rockchip-iommu.c | 20 +++- 1 file changed, 7 insertions(+), 13 dele

[PATCH v2 04/13] iommu/rockchip: Fix error handling in probe

2018-01-16 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Also adjust sequence of deinit functions in the remove. Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/iommu

[PATCH v2 01/13] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-01-16 Thread Jeffy Chen
Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 38 +++--- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index

[PATCH v2 02/13] iommu/rockchip: Suppress unbinding

2018-01-16 Thread Jeffy Chen
It's not safe to unbind rockchip IOMMU driver. Signed-off-by: Jeffy Chen --- Changes in v2: None drivers/iommu/rockchip-iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 4a12d4746095..da4afe016a4e 100644

[PATCH v5 2/4] rtc: at91sam9: Set name of regmap_config

2018-03-12 Thread Jeffy Chen
We are now allowing to register debugfs without a valid device, and not having a valid name will end up using "dummy*" to create debugfs dir. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: Not to use rtc dev to init regmap, the gpbr is not directly related to the rtc

[PATCH v5 1/4] mfd: syscon: Set name of regmap_config

2018-03-12 Thread Jeffy Chen
We are now allowing to register debugfs without a valid device, and not having a valid name will end up using "dummy*" to create debugfs dir. Signed-off-by: Jeffy Chen --- Changes in v5: CC lee.jo...@linaro.org Changes in v4: None Changes in v3: Modify commit message. drivers/mf

[PATCH v5 0/4] Set name of regmap_config

2018-03-12 Thread Jeffy Chen
lee.jo...@linaro.org Changes in v4: Not to use rtc dev to init regmap, the gpbr is not directly related to the rtc. Changes in v3: Modify commit message. Jeffy Chen (4): mfd: syscon: Set name of regmap_config rtc: at91sam9: Set name of regmap_config clk: lpc32xx: Set name of regmap_config

[PATCH v5 3/4] clk: lpc32xx: Set name of regmap_config

2018-03-12 Thread Jeffy Chen
We are now allowing to register debugfs without a valid device, and not having a valid name will end up using "dummy*" to create debugfs dir. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: None drivers/clk/nxp/clk-lpc32xx.c | 1 + 1 file

[PATCH v5 4/4] ARM: rockchip: Set name of regmap_config

2018-03-12 Thread Jeffy Chen
We are now allowing to register debugfs without a valid device, and not having a valid name will end up using "dummy*" to create debugfs dir. Signed-off-by: Jeffy Chen --- Changes in v5: None Changes in v4: None Changes in v3: None arch/arm/mach-rockchip/platsmp.c | 1 + 1 file

[PATCH v7 02/14] iommu/rockchip: Fix error handling in probe

2018-03-05 Thread Jeffy Chen
Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 6 +- 1 file changed, 5

[PATCH v7 01/14] iommu/rockchip: Prohibit unbind and remove

2018-03-05 Thread Jeffy Chen
Removal of IOMMUs cannot be done reliably. This is similar to exynos iommu driver. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: Rewrite commit message. Changes in v3: Also remove remove() and module_exit

[PATCH v7 00/14] iommu/rockchip: Use OF_IOMMU

2018-03-05 Thread Jeffy Chen
irq request to probe(in patch[0]) Move bus_set_iommu() to rk_iommu_probe(). Jeffy Chen (10): iommu/rockchip: Prohibit unbind and remove iommu/rockchip: Fix error handling in probe iommu/rockchip: Request irqs in rk_iommu_probe() ARM: dts: rockchip: add clocks in iommu nodes dt-bindi

[PATCH v7 03/14] iommu/rockchip: Request irqs in rk_iommu_probe()

2018-03-05 Thread Jeffy Chen
Move request_irq to the end of rk_iommu_probe(). Suggested-by: Robin Murphy Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa --- Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: Loop platform_get_irq() as Robin suggested. Changes in v2: None

[PATCH v7 06/14] iommu/rockchip: Fix TLB flush of secondary IOMMUs

2018-03-05 Thread Jeffy Chen
From: Tomasz Figa Due to the bug in current code, only first IOMMU has the TLB lines flushed in rk_iommu_zap_lines. This patch fixes the inner loop to execute for all IOMMUs and properly flush the TLB. Signed-off-by: Tomasz Figa Signed-off-by: Jeffy Chen --- Changes in v7: None Changes in v6

[PATCH v7 08/14] iommu/rockchip: Control clocks needed to access the IOMMU

2018-03-05 Thread Jeffy Chen
mapping API and doesn't engage the master driver at all. This patch fixes the problem by letting clocks needed for IOMMU operation to be listed in Device Tree and making the driver enable them for the time of accessing the hardware. Signed-off-by: Jeffy Chen Signed-off-by: Tomasz Figa Ack

<    1   2   3   4   5   6   7   >