diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-10-08 08:44:40 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2018-10-08 08:44:40 -0400 |
commit | 75bda3609f94a24a213fa56235bf369056565299 (patch) | |
tree | 4d8d39200aef7a552bad1ddf8291119607b53e1c | |
parent | e51e8d5de999cafec922bdd11235812161e12a69 (diff) | |
parent | 6d06009cb216d071e955b3814086595851627910 (diff) |
Merge tag 'soc-fsl-next-v4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into next/drivers
NXP/FSL SoC drivers updates for v4.20 take 2
- Update qbman driver to better work with CPU hotplug
- Add Kconfig dependency of 64-bit DMA addressing for qbman driver
- Use last reponse to determine valid bit for qbman driver
- Defer bman_portals probe if bman is not probed
- Add interrupt coalescing APIs to qbman driver
* tag 'soc-fsl-next-v4.20-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
soc: fsl: qbman: add interrupt coalesce changing APIs
soc: fsl: bman_portals: defer probe after bman's probe
soc: fsl: qbman: Use last response to determine valid bit
soc: fsl: qbman: Add 64 bit DMA addressing requirement to QBMan
soc: fsl: qbman: replace CPU 0 with any online CPU in hotplug handlers
soc: fsl: qbman: Check if CPU is offline when initializing portals
soc: fsl: qman_portals: defer probe after qman's probe
soc: fsl: qbman: add APIs to retrieve the probing status
soc: fsl: qe: Fix copy/paste bug in ucc_get_tdm_sync_shift()
soc: fsl: qbman: qman: avoid allocating from non existing gen_pool
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | MAINTAINERS | 2 | ||||
-rw-r--r-- | arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 2 | ||||
-rw-r--r-- | arch/arm/boot/dts/bcm63138.dtsi | 14 | ||||
-rw-r--r-- | arch/arm/boot/dts/sun8i-r40.dtsi | 3 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/Kconfig | 2 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/bman.c | 6 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/bman_ccsr.c | 11 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/bman_portal.c | 14 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/dpaa_sys.h | 20 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/qman.c | 56 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/qman_ccsr.c | 11 | ||||
-rw-r--r-- | drivers/soc/fsl/qbman/qman_portal.c | 14 | ||||
-rw-r--r-- | drivers/soc/fsl/qe/ucc.c | 2 | ||||
-rw-r--r-- | include/soc/fsl/bman.h | 8 | ||||
-rw-r--r-- | include/soc/fsl/qman.h | 36 |
15 files changed, 176 insertions, 25 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 9e536acfd5f8..1dc919e7f736 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1251,7 +1251,7 @@ N: meson | |||
1251 | 1251 | ||
1252 | ARM/Annapurna Labs ALPINE ARCHITECTURE | 1252 | ARM/Annapurna Labs ALPINE ARCHITECTURE |
1253 | M: Tsahee Zidenberg <tsahee@annapurnalabs.com> | 1253 | M: Tsahee Zidenberg <tsahee@annapurnalabs.com> |
1254 | M: Antoine Tenart <antoine.tenart@free-electrons.com> | 1254 | M: Antoine Tenart <antoine.tenart@bootlin.com> |
1255 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1255 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1256 | S: Maintained | 1256 | S: Maintained |
1257 | F: arch/arm/mach-alpine/ | 1257 | F: arch/arm/mach-alpine/ |
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts index b10dccd0958f..3b1baa8605a7 100644 --- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | |||
@@ -11,6 +11,7 @@ | |||
11 | #include "sama5d2-pinfunc.h" | 11 | #include "sama5d2-pinfunc.h" |
12 | #include <dt-bindings/mfd/atmel-flexcom.h> | 12 | #include <dt-bindings/mfd/atmel-flexcom.h> |
13 | #include <dt-bindings/gpio/gpio.h> | 13 | #include <dt-bindings/gpio/gpio.h> |
14 | #include <dt-bindings/pinctrl/at91.h> | ||
14 | 15 | ||
15 | / { | 16 | / { |
16 | model = "Atmel SAMA5D2 PTC EK"; | 17 | model = "Atmel SAMA5D2 PTC EK"; |
@@ -299,6 +300,7 @@ | |||
299 | <PIN_PA30__NWE_NANDWE>, | 300 | <PIN_PA30__NWE_NANDWE>, |
300 | <PIN_PB2__NRD_NANDOE>; | 301 | <PIN_PB2__NRD_NANDOE>; |
301 | bias-pull-up; | 302 | bias-pull-up; |
303 | atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>; | ||
302 | }; | 304 | }; |
303 | 305 | ||
304 | ale_cle_rdy_cs { | 306 | ale_cle_rdy_cs { |
diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi index 43ee992ccdcf..6df61518776f 100644 --- a/arch/arm/boot/dts/bcm63138.dtsi +++ b/arch/arm/boot/dts/bcm63138.dtsi | |||
@@ -106,21 +106,23 @@ | |||
106 | global_timer: timer@1e200 { | 106 | global_timer: timer@1e200 { |
107 | compatible = "arm,cortex-a9-global-timer"; | 107 | compatible = "arm,cortex-a9-global-timer"; |
108 | reg = <0x1e200 0x20>; | 108 | reg = <0x1e200 0x20>; |
109 | interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>; | 109 | interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>; |
110 | clocks = <&axi_clk>; | 110 | clocks = <&axi_clk>; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | local_timer: local-timer@1e600 { | 113 | local_timer: local-timer@1e600 { |
114 | compatible = "arm,cortex-a9-twd-timer"; | 114 | compatible = "arm,cortex-a9-twd-timer"; |
115 | reg = <0x1e600 0x20>; | 115 | reg = <0x1e600 0x20>; |
116 | interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>; | 116 | interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) | |
117 | IRQ_TYPE_EDGE_RISING)>; | ||
117 | clocks = <&axi_clk>; | 118 | clocks = <&axi_clk>; |
118 | }; | 119 | }; |
119 | 120 | ||
120 | twd_watchdog: watchdog@1e620 { | 121 | twd_watchdog: watchdog@1e620 { |
121 | compatible = "arm,cortex-a9-twd-wdt"; | 122 | compatible = "arm,cortex-a9-twd-wdt"; |
122 | reg = <0x1e620 0x20>; | 123 | reg = <0x1e620 0x20>; |
123 | interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>; | 124 | interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) | |
125 | IRQ_TYPE_LEVEL_HIGH)>; | ||
124 | }; | 126 | }; |
125 | 127 | ||
126 | armpll: armpll { | 128 | armpll: armpll { |
@@ -158,7 +160,7 @@ | |||
158 | serial0: serial@600 { | 160 | serial0: serial@600 { |
159 | compatible = "brcm,bcm6345-uart"; | 161 | compatible = "brcm,bcm6345-uart"; |
160 | reg = <0x600 0x1b>; | 162 | reg = <0x600 0x1b>; |
161 | interrupts = <GIC_SPI 32 0>; | 163 | interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>; |
162 | clocks = <&periph_clk>; | 164 | clocks = <&periph_clk>; |
163 | clock-names = "periph"; | 165 | clock-names = "periph"; |
164 | status = "disabled"; | 166 | status = "disabled"; |
@@ -167,7 +169,7 @@ | |||
167 | serial1: serial@620 { | 169 | serial1: serial@620 { |
168 | compatible = "brcm,bcm6345-uart"; | 170 | compatible = "brcm,bcm6345-uart"; |
169 | reg = <0x620 0x1b>; | 171 | reg = <0x620 0x1b>; |
170 | interrupts = <GIC_SPI 33 0>; | 172 | interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>; |
171 | clocks = <&periph_clk>; | 173 | clocks = <&periph_clk>; |
172 | clock-names = "periph"; | 174 | clock-names = "periph"; |
173 | status = "disabled"; | 175 | status = "disabled"; |
@@ -180,7 +182,7 @@ | |||
180 | reg = <0x2000 0x600>, <0xf0 0x10>; | 182 | reg = <0x2000 0x600>, <0xf0 0x10>; |
181 | reg-names = "nand", "nand-int-base"; | 183 | reg-names = "nand", "nand-int-base"; |
182 | status = "disabled"; | 184 | status = "disabled"; |
183 | interrupts = <GIC_SPI 38 0>; | 185 | interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>; |
184 | interrupt-names = "nand"; | 186 | interrupt-names = "nand"; |
185 | }; | 187 | }; |
186 | 188 | ||
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index ffd9f00f74a4..5f547c161baf 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi | |||
@@ -800,8 +800,7 @@ | |||
800 | }; | 800 | }; |
801 | 801 | ||
802 | hdmi_phy: hdmi-phy@1ef0000 { | 802 | hdmi_phy: hdmi-phy@1ef0000 { |
803 | compatible = "allwinner,sun8i-r40-hdmi-phy", | 803 | compatible = "allwinner,sun8i-r40-hdmi-phy"; |
804 | "allwinner,sun50i-a64-hdmi-phy"; | ||
805 | reg = <0x01ef0000 0x10000>; | 804 | reg = <0x01ef0000 0x10000>; |
806 | clocks = <&ccu CLK_BUS_HDMI1>, <&ccu CLK_HDMI_SLOW>, | 805 | clocks = <&ccu CLK_BUS_HDMI1>, <&ccu CLK_HDMI_SLOW>, |
807 | <&ccu 7>, <&ccu 16>; | 806 | <&ccu 7>, <&ccu 16>; |
diff --git a/drivers/soc/fsl/qbman/Kconfig b/drivers/soc/fsl/qbman/Kconfig index d570cb5fd381..b0943e541796 100644 --- a/drivers/soc/fsl/qbman/Kconfig +++ b/drivers/soc/fsl/qbman/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | menuconfig FSL_DPAA | 1 | menuconfig FSL_DPAA |
2 | bool "QorIQ DPAA1 framework support" | 2 | bool "QorIQ DPAA1 framework support" |
3 | depends on (FSL_SOC_BOOKE || ARCH_LAYERSCAPE) | 3 | depends on ((FSL_SOC_BOOKE || ARCH_LAYERSCAPE) && ARCH_DMA_ADDR_T_64BIT) |
4 | select GENERIC_ALLOCATOR | 4 | select GENERIC_ALLOCATOR |
5 | help | 5 | help |
6 | The Freescale Data Path Acceleration Architecture (DPAA) is a set of | 6 | The Freescale Data Path Acceleration Architecture (DPAA) is a set of |
diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c index f9485cedc648..f84ab596bde8 100644 --- a/drivers/soc/fsl/qbman/bman.c +++ b/drivers/soc/fsl/qbman/bman.c | |||
@@ -562,11 +562,9 @@ static int bman_create_portal(struct bman_portal *portal, | |||
562 | dev_err(c->dev, "request_irq() failed\n"); | 562 | dev_err(c->dev, "request_irq() failed\n"); |
563 | goto fail_irq; | 563 | goto fail_irq; |
564 | } | 564 | } |
565 | if (c->cpu != -1 && irq_can_set_affinity(c->irq) && | 565 | |
566 | irq_set_affinity(c->irq, cpumask_of(c->cpu))) { | 566 | if (dpaa_set_portal_irq_affinity(c->dev, c->irq, c->cpu)) |
567 | dev_err(c->dev, "irq_set_affinity() failed\n"); | ||
568 | goto fail_affinity; | 567 | goto fail_affinity; |
569 | } | ||
570 | 568 | ||
571 | /* Need RCR to be empty before continuing */ | 569 | /* Need RCR to be empty before continuing */ |
572 | ret = bm_rcr_get_fill(p); | 570 | ret = bm_rcr_get_fill(p); |
diff --git a/drivers/soc/fsl/qbman/bman_ccsr.c b/drivers/soc/fsl/qbman/bman_ccsr.c index 05c42235dd41..7c3cc968053c 100644 --- a/drivers/soc/fsl/qbman/bman_ccsr.c +++ b/drivers/soc/fsl/qbman/bman_ccsr.c | |||
@@ -120,6 +120,7 @@ static void bm_set_memory(u64 ba, u32 size) | |||
120 | */ | 120 | */ |
121 | static dma_addr_t fbpr_a; | 121 | static dma_addr_t fbpr_a; |
122 | static size_t fbpr_sz; | 122 | static size_t fbpr_sz; |
123 | static int __bman_probed; | ||
123 | 124 | ||
124 | static int bman_fbpr(struct reserved_mem *rmem) | 125 | static int bman_fbpr(struct reserved_mem *rmem) |
125 | { | 126 | { |
@@ -166,6 +167,12 @@ static irqreturn_t bman_isr(int irq, void *ptr) | |||
166 | return IRQ_HANDLED; | 167 | return IRQ_HANDLED; |
167 | } | 168 | } |
168 | 169 | ||
170 | int bman_is_probed(void) | ||
171 | { | ||
172 | return __bman_probed; | ||
173 | } | ||
174 | EXPORT_SYMBOL_GPL(bman_is_probed); | ||
175 | |||
169 | static int fsl_bman_probe(struct platform_device *pdev) | 176 | static int fsl_bman_probe(struct platform_device *pdev) |
170 | { | 177 | { |
171 | int ret, err_irq; | 178 | int ret, err_irq; |
@@ -175,6 +182,8 @@ static int fsl_bman_probe(struct platform_device *pdev) | |||
175 | u16 id, bm_pool_cnt; | 182 | u16 id, bm_pool_cnt; |
176 | u8 major, minor; | 183 | u8 major, minor; |
177 | 184 | ||
185 | __bman_probed = -1; | ||
186 | |||
178 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 187 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
179 | if (!res) { | 188 | if (!res) { |
180 | dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n", | 189 | dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n", |
@@ -255,6 +264,8 @@ static int fsl_bman_probe(struct platform_device *pdev) | |||
255 | return ret; | 264 | return ret; |
256 | } | 265 | } |
257 | 266 | ||
267 | __bman_probed = 1; | ||
268 | |||
258 | return 0; | 269 | return 0; |
259 | }; | 270 | }; |
260 | 271 | ||
diff --git a/drivers/soc/fsl/qbman/bman_portal.c b/drivers/soc/fsl/qbman/bman_portal.c index 2f71f7df3465..2c95cf59f3e7 100644 --- a/drivers/soc/fsl/qbman/bman_portal.c +++ b/drivers/soc/fsl/qbman/bman_portal.c | |||
@@ -65,7 +65,9 @@ static int bman_offline_cpu(unsigned int cpu) | |||
65 | if (!pcfg) | 65 | if (!pcfg) |
66 | return 0; | 66 | return 0; |
67 | 67 | ||
68 | irq_set_affinity(pcfg->irq, cpumask_of(0)); | 68 | /* use any other online CPU */ |
69 | cpu = cpumask_any_but(cpu_online_mask, cpu); | ||
70 | irq_set_affinity(pcfg->irq, cpumask_of(cpu)); | ||
69 | return 0; | 71 | return 0; |
70 | } | 72 | } |
71 | 73 | ||
@@ -91,7 +93,15 @@ static int bman_portal_probe(struct platform_device *pdev) | |||
91 | struct device_node *node = dev->of_node; | 93 | struct device_node *node = dev->of_node; |
92 | struct bm_portal_config *pcfg; | 94 | struct bm_portal_config *pcfg; |
93 | struct resource *addr_phys[2]; | 95 | struct resource *addr_phys[2]; |
94 | int irq, cpu; | 96 | int irq, cpu, err; |
97 | |||
98 | err = bman_is_probed(); | ||
99 | if (!err) | ||
100 | return -EPROBE_DEFER; | ||
101 | if (err < 0) { | ||
102 | dev_err(&pdev->dev, "failing probe due to bman probe error\n"); | ||
103 | return -ENODEV; | ||
104 | } | ||
95 | 105 | ||
96 | pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL); | 106 | pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL); |
97 | if (!pcfg) | 107 | if (!pcfg) |
diff --git a/drivers/soc/fsl/qbman/dpaa_sys.h b/drivers/soc/fsl/qbman/dpaa_sys.h index 9f379000da85..ae8afa552b1e 100644 --- a/drivers/soc/fsl/qbman/dpaa_sys.h +++ b/drivers/soc/fsl/qbman/dpaa_sys.h | |||
@@ -111,4 +111,24 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, | |||
111 | #define QBMAN_MEMREMAP_ATTR MEMREMAP_WC | 111 | #define QBMAN_MEMREMAP_ATTR MEMREMAP_WC |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | static inline int dpaa_set_portal_irq_affinity(struct device *dev, | ||
115 | int irq, int cpu) | ||
116 | { | ||
117 | int ret = 0; | ||
118 | |||
119 | if (!irq_can_set_affinity(irq)) { | ||
120 | dev_err(dev, "unable to set IRQ affinity\n"); | ||
121 | return -EINVAL; | ||
122 | } | ||
123 | |||
124 | if (cpu == -1 || !cpu_online(cpu)) | ||
125 | cpu = cpumask_any(cpu_online_mask); | ||
126 | |||
127 | ret = irq_set_affinity(irq, cpumask_of(cpu)); | ||
128 | if (ret) | ||
129 | dev_err(dev, "irq_set_affinity() on CPU %d failed\n", cpu); | ||
130 | |||
131 | return ret; | ||
132 | } | ||
133 | |||
114 | #endif /* __DPAA_SYS_H */ | 134 | #endif /* __DPAA_SYS_H */ |
diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index ecb22749df0b..5ce24718c2fd 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c | |||
@@ -850,12 +850,24 @@ static inline void qm_mr_set_ithresh(struct qm_portal *portal, u8 ithresh) | |||
850 | 850 | ||
851 | static inline int qm_mc_init(struct qm_portal *portal) | 851 | static inline int qm_mc_init(struct qm_portal *portal) |
852 | { | 852 | { |
853 | u8 rr0, rr1; | ||
853 | struct qm_mc *mc = &portal->mc; | 854 | struct qm_mc *mc = &portal->mc; |
854 | 855 | ||
855 | mc->cr = portal->addr.ce + QM_CL_CR; | 856 | mc->cr = portal->addr.ce + QM_CL_CR; |
856 | mc->rr = portal->addr.ce + QM_CL_RR0; | 857 | mc->rr = portal->addr.ce + QM_CL_RR0; |
857 | mc->rridx = (mc->cr->_ncw_verb & QM_MCC_VERB_VBIT) | 858 | /* |
858 | ? 0 : 1; | 859 | * The expected valid bit polarity for the next CR command is 0 |
860 | * if RR1 contains a valid response, and is 1 if RR0 contains a | ||
861 | * valid response. If both RR contain all 0, this indicates either | ||
862 | * that no command has been executed since reset (in which case the | ||
863 | * expected valid bit polarity is 1) | ||
864 | */ | ||
865 | rr0 = mc->rr->verb; | ||
866 | rr1 = (mc->rr+1)->verb; | ||
867 | if ((rr0 == 0 && rr1 == 0) || rr0 != 0) | ||
868 | mc->rridx = 1; | ||
869 | else | ||
870 | mc->rridx = 0; | ||
859 | mc->vbit = mc->rridx ? QM_MCC_VERB_VBIT : 0; | 871 | mc->vbit = mc->rridx ? QM_MCC_VERB_VBIT : 0; |
860 | #ifdef CONFIG_FSL_DPAA_CHECKING | 872 | #ifdef CONFIG_FSL_DPAA_CHECKING |
861 | mc->state = qman_mc_idle; | 873 | mc->state = qman_mc_idle; |
@@ -1000,6 +1012,37 @@ static inline void put_affine_portal(void) | |||
1000 | 1012 | ||
1001 | static struct workqueue_struct *qm_portal_wq; | 1013 | static struct workqueue_struct *qm_portal_wq; |
1002 | 1014 | ||
1015 | void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh) | ||
1016 | { | ||
1017 | if (!portal) | ||
1018 | return; | ||
1019 | |||
1020 | qm_dqrr_set_ithresh(&portal->p, ithresh); | ||
1021 | portal->p.dqrr.ithresh = ithresh; | ||
1022 | } | ||
1023 | EXPORT_SYMBOL(qman_dqrr_set_ithresh); | ||
1024 | |||
1025 | void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh) | ||
1026 | { | ||
1027 | if (portal && ithresh) | ||
1028 | *ithresh = portal->p.dqrr.ithresh; | ||
1029 | } | ||
1030 | EXPORT_SYMBOL(qman_dqrr_get_ithresh); | ||
1031 | |||
1032 | void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod) | ||
1033 | { | ||
1034 | if (portal && iperiod) | ||
1035 | *iperiod = qm_in(&portal->p, QM_REG_ITPR); | ||
1036 | } | ||
1037 | EXPORT_SYMBOL(qman_portal_get_iperiod); | ||
1038 | |||
1039 | void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod) | ||
1040 | { | ||
1041 | if (portal) | ||
1042 | qm_out(&portal->p, QM_REG_ITPR, iperiod); | ||
1043 | } | ||
1044 | EXPORT_SYMBOL(qman_portal_set_iperiod); | ||
1045 | |||
1003 | int qman_wq_alloc(void) | 1046 | int qman_wq_alloc(void) |
1004 | { | 1047 | { |
1005 | qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1); | 1048 | qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1); |
@@ -1210,11 +1253,9 @@ static int qman_create_portal(struct qman_portal *portal, | |||
1210 | dev_err(c->dev, "request_irq() failed\n"); | 1253 | dev_err(c->dev, "request_irq() failed\n"); |
1211 | goto fail_irq; | 1254 | goto fail_irq; |
1212 | } | 1255 | } |
1213 | if (c->cpu != -1 && irq_can_set_affinity(c->irq) && | 1256 | |
1214 | irq_set_affinity(c->irq, cpumask_of(c->cpu))) { | 1257 | if (dpaa_set_portal_irq_affinity(c->dev, c->irq, c->cpu)) |
1215 | dev_err(c->dev, "irq_set_affinity() failed\n"); | ||
1216 | goto fail_affinity; | 1258 | goto fail_affinity; |
1217 | } | ||
1218 | 1259 | ||
1219 | /* Need EQCR to be empty before continuing */ | 1260 | /* Need EQCR to be empty before continuing */ |
1220 | isdr &= ~QM_PIRQ_EQCI; | 1261 | isdr &= ~QM_PIRQ_EQCI; |
@@ -2729,6 +2770,9 @@ static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt) | |||
2729 | { | 2770 | { |
2730 | unsigned long addr; | 2771 | unsigned long addr; |
2731 | 2772 | ||
2773 | if (!p) | ||
2774 | return -ENODEV; | ||
2775 | |||
2732 | addr = gen_pool_alloc(p, cnt); | 2776 | addr = gen_pool_alloc(p, cnt); |
2733 | if (!addr) | 2777 | if (!addr) |
2734 | return -ENOMEM; | 2778 | return -ENOMEM; |
diff --git a/drivers/soc/fsl/qbman/qman_ccsr.c b/drivers/soc/fsl/qbman/qman_ccsr.c index 79cba58387a5..6fd5fef5f39b 100644 --- a/drivers/soc/fsl/qbman/qman_ccsr.c +++ b/drivers/soc/fsl/qbman/qman_ccsr.c | |||
@@ -273,6 +273,7 @@ static const struct qman_error_info_mdata error_mdata[] = { | |||
273 | static u32 __iomem *qm_ccsr_start; | 273 | static u32 __iomem *qm_ccsr_start; |
274 | /* A SDQCR mask comprising all the available/visible pool channels */ | 274 | /* A SDQCR mask comprising all the available/visible pool channels */ |
275 | static u32 qm_pools_sdqcr; | 275 | static u32 qm_pools_sdqcr; |
276 | static int __qman_probed; | ||
276 | 277 | ||
277 | static inline u32 qm_ccsr_in(u32 offset) | 278 | static inline u32 qm_ccsr_in(u32 offset) |
278 | { | 279 | { |
@@ -686,6 +687,12 @@ static int qman_resource_init(struct device *dev) | |||
686 | return 0; | 687 | return 0; |
687 | } | 688 | } |
688 | 689 | ||
690 | int qman_is_probed(void) | ||
691 | { | ||
692 | return __qman_probed; | ||
693 | } | ||
694 | EXPORT_SYMBOL_GPL(qman_is_probed); | ||
695 | |||
689 | static int fsl_qman_probe(struct platform_device *pdev) | 696 | static int fsl_qman_probe(struct platform_device *pdev) |
690 | { | 697 | { |
691 | struct device *dev = &pdev->dev; | 698 | struct device *dev = &pdev->dev; |
@@ -695,6 +702,8 @@ static int fsl_qman_probe(struct platform_device *pdev) | |||
695 | u16 id; | 702 | u16 id; |
696 | u8 major, minor; | 703 | u8 major, minor; |
697 | 704 | ||
705 | __qman_probed = -1; | ||
706 | |||
698 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 707 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
699 | if (!res) { | 708 | if (!res) { |
700 | dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n", | 709 | dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n", |
@@ -828,6 +837,8 @@ static int fsl_qman_probe(struct platform_device *pdev) | |||
828 | if (ret) | 837 | if (ret) |
829 | return ret; | 838 | return ret; |
830 | 839 | ||
840 | __qman_probed = 1; | ||
841 | |||
831 | return 0; | 842 | return 0; |
832 | } | 843 | } |
833 | 844 | ||
diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index a120002b630e..661c9b234d32 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c | |||
@@ -195,8 +195,10 @@ static int qman_offline_cpu(unsigned int cpu) | |||
195 | if (p) { | 195 | if (p) { |
196 | pcfg = qman_get_qm_portal_config(p); | 196 | pcfg = qman_get_qm_portal_config(p); |
197 | if (pcfg) { | 197 | if (pcfg) { |
198 | irq_set_affinity(pcfg->irq, cpumask_of(0)); | 198 | /* select any other online CPU */ |
199 | qman_portal_update_sdest(pcfg, 0); | 199 | cpu = cpumask_any_but(cpu_online_mask, cpu); |
200 | irq_set_affinity(pcfg->irq, cpumask_of(cpu)); | ||
201 | qman_portal_update_sdest(pcfg, cpu); | ||
200 | } | 202 | } |
201 | } | 203 | } |
202 | return 0; | 204 | return 0; |
@@ -227,6 +229,14 @@ static int qman_portal_probe(struct platform_device *pdev) | |||
227 | int irq, cpu, err; | 229 | int irq, cpu, err; |
228 | u32 val; | 230 | u32 val; |
229 | 231 | ||
232 | err = qman_is_probed(); | ||
233 | if (!err) | ||
234 | return -EPROBE_DEFER; | ||
235 | if (err < 0) { | ||
236 | dev_err(&pdev->dev, "failing probe due to qman probe error\n"); | ||
237 | return -ENODEV; | ||
238 | } | ||
239 | |||
230 | pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL); | 240 | pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL); |
231 | if (!pcfg) | 241 | if (!pcfg) |
232 | return -ENOMEM; | 242 | return -ENOMEM; |
diff --git a/drivers/soc/fsl/qe/ucc.c b/drivers/soc/fsl/qe/ucc.c index c646d8713861..681f7d4b7724 100644 --- a/drivers/soc/fsl/qe/ucc.c +++ b/drivers/soc/fsl/qe/ucc.c | |||
@@ -626,7 +626,7 @@ static u32 ucc_get_tdm_sync_shift(enum comm_dir mode, u32 tdm_num) | |||
626 | { | 626 | { |
627 | u32 shift; | 627 | u32 shift; |
628 | 628 | ||
629 | shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : RX_SYNC_SHIFT_BASE; | 629 | shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : TX_SYNC_SHIFT_BASE; |
630 | shift -= tdm_num * 2; | 630 | shift -= tdm_num * 2; |
631 | 631 | ||
632 | return shift; | 632 | return shift; |
diff --git a/include/soc/fsl/bman.h b/include/soc/fsl/bman.h index eaaf56df4086..5b99cb2ea5ef 100644 --- a/include/soc/fsl/bman.h +++ b/include/soc/fsl/bman.h | |||
@@ -126,4 +126,12 @@ int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num); | |||
126 | */ | 126 | */ |
127 | int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num); | 127 | int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num); |
128 | 128 | ||
129 | /** | ||
130 | * bman_is_probed - Check if bman is probed | ||
131 | * | ||
132 | * Returns 1 if the bman driver successfully probed, -1 if the bman driver | ||
133 | * failed to probe or 0 if the bman driver did not probed yet. | ||
134 | */ | ||
135 | int bman_is_probed(void); | ||
136 | |||
129 | #endif /* __FSL_BMAN_H */ | 137 | #endif /* __FSL_BMAN_H */ |
diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index d4dfefdee6c1..56877660d5ba 100644 --- a/include/soc/fsl/qman.h +++ b/include/soc/fsl/qman.h | |||
@@ -1186,4 +1186,40 @@ int qman_alloc_cgrid_range(u32 *result, u32 count); | |||
1186 | */ | 1186 | */ |
1187 | int qman_release_cgrid(u32 id); | 1187 | int qman_release_cgrid(u32 id); |
1188 | 1188 | ||
1189 | /** | ||
1190 | * qman_is_probed - Check if qman is probed | ||
1191 | * | ||
1192 | * Returns 1 if the qman driver successfully probed, -1 if the qman driver | ||
1193 | * failed to probe or 0 if the qman driver did not probed yet. | ||
1194 | */ | ||
1195 | int qman_is_probed(void); | ||
1196 | |||
1197 | /** | ||
1198 | * qman_dqrr_get_ithresh - Get coalesce interrupt threshold | ||
1199 | * @portal: portal to get the value for | ||
1200 | * @ithresh: threshold pointer | ||
1201 | */ | ||
1202 | void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh); | ||
1203 | |||
1204 | /** | ||
1205 | * qman_dqrr_set_ithresh - Set coalesce interrupt threshold | ||
1206 | * @portal: portal to set the new value on | ||
1207 | * @ithresh: new threshold value | ||
1208 | */ | ||
1209 | void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh); | ||
1210 | |||
1211 | /** | ||
1212 | * qman_dqrr_get_iperiod - Get coalesce interrupt period | ||
1213 | * @portal: portal to get the value for | ||
1214 | * @iperiod: period pointer | ||
1215 | */ | ||
1216 | void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod); | ||
1217 | |||
1218 | /** | ||
1219 | * qman_dqrr_set_iperiod - Set coalesce interrupt period | ||
1220 | * @portal: portal to set the new value on | ||
1221 | * @ithresh: new period value | ||
1222 | */ | ||
1223 | void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod); | ||
1224 | |||
1189 | #endif /* __FSL_QMAN_H */ | 1225 | #endif /* __FSL_QMAN_H */ |