Skip to content

Commit

Permalink
Merge tag 'soc-fsl-fix-v4.19-2' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/leo/linux into fixes

NXP/FSL SoC driver fixes for v4.19 round 2

- Fix crash of qman_portal by deferring its probe if qman is not probed

* tag 'soc-fsl-fix-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux:
  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
  ARM: dts: BCM63xx: Fix incorrect interrupt specifiers
  MAINTAINERS: update the Annapurna Labs maintainer email
  ARM: dts: sun8i: drop A64 HDMI PHY fallback compatible from R40 DT
  ARM: dts: at91: sama5d2_ptc_ek: fix nand pinctrl

Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
arndb committed Oct 4, 2018
2 parents 30a0af8 + 5a1eb8b commit 3f4258b
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 10 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ N: meson

ARM/Annapurna Labs ALPINE ARCHITECTURE
M: Tsahee Zidenberg <[email protected]>
M: Antoine Tenart <antoine.tenart@free-electrons.com>
M: Antoine Tenart <antoine.tenart@bootlin.com>
L: [email protected] (moderated for non-subscribers)
S: Maintained
F: arch/arm/mach-alpine/
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "sama5d2-pinfunc.h"
#include <dt-bindings/mfd/atmel-flexcom.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/at91.h>

/ {
model = "Atmel SAMA5D2 PTC EK";
Expand Down Expand Up @@ -299,6 +300,7 @@
<PIN_PA30__NWE_NANDWE>,
<PIN_PB2__NRD_NANDOE>;
bias-pull-up;
atmel,drive-strength = <ATMEL_PIO_DRVSTR_ME>;
};

ale_cle_rdy_cs {
Expand Down
14 changes: 8 additions & 6 deletions arch/arm/boot/dts/bcm63138.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,23 @@
global_timer: timer@1e200 {
compatible = "arm,cortex-a9-global-timer";
reg = <0x1e200 0x20>;
interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
clocks = <&axi_clk>;
};

local_timer: local-timer@1e600 {
compatible = "arm,cortex-a9-twd-timer";
reg = <0x1e600 0x20>;
interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(2) |
IRQ_TYPE_EDGE_RISING)>;
clocks = <&axi_clk>;
};

twd_watchdog: watchdog@1e620 {
compatible = "arm,cortex-a9-twd-wdt";
reg = <0x1e620 0x20>;
interrupts = <GIC_PPI 14 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(2) |
IRQ_TYPE_LEVEL_HIGH)>;
};

armpll: armpll {
Expand Down Expand Up @@ -158,7 +160,7 @@
serial0: serial@600 {
compatible = "brcm,bcm6345-uart";
reg = <0x600 0x1b>;
interrupts = <GIC_SPI 32 0>;
interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&periph_clk>;
clock-names = "periph";
status = "disabled";
Expand All @@ -167,7 +169,7 @@
serial1: serial@620 {
compatible = "brcm,bcm6345-uart";
reg = <0x620 0x1b>;
interrupts = <GIC_SPI 33 0>;
interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&periph_clk>;
clock-names = "periph";
status = "disabled";
Expand All @@ -180,7 +182,7 @@
reg = <0x2000 0x600>, <0xf0 0x10>;
reg-names = "nand", "nand-int-base";
status = "disabled";
interrupts = <GIC_SPI 38 0>;
interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "nand";
};

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/boot/dts/sun8i-r40.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,7 @@
};

hdmi_phy: hdmi-phy@1ef0000 {
compatible = "allwinner,sun8i-r40-hdmi-phy",
"allwinner,sun50i-a64-hdmi-phy";
compatible = "allwinner,sun8i-r40-hdmi-phy";
reg = <0x01ef0000 0x10000>;
clocks = <&ccu CLK_BUS_HDMI1>, <&ccu CLK_HDMI_SLOW>,
<&ccu 7>, <&ccu 16>;
Expand Down
11 changes: 11 additions & 0 deletions drivers/soc/fsl/qbman/bman_ccsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ static void bm_set_memory(u64 ba, u32 size)
*/
static dma_addr_t fbpr_a;
static size_t fbpr_sz;
static int __bman_probed;

static int bman_fbpr(struct reserved_mem *rmem)
{
Expand Down Expand Up @@ -166,6 +167,12 @@ static irqreturn_t bman_isr(int irq, void *ptr)
return IRQ_HANDLED;
}

int bman_is_probed(void)
{
return __bman_probed;
}
EXPORT_SYMBOL_GPL(bman_is_probed);

static int fsl_bman_probe(struct platform_device *pdev)
{
int ret, err_irq;
Expand All @@ -175,6 +182,8 @@ static int fsl_bman_probe(struct platform_device *pdev)
u16 id, bm_pool_cnt;
u8 major, minor;

__bman_probed = -1;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
Expand Down Expand Up @@ -255,6 +264,8 @@ static int fsl_bman_probe(struct platform_device *pdev)
return ret;
}

__bman_probed = 1;

return 0;
};

Expand Down
3 changes: 3 additions & 0 deletions drivers/soc/fsl/qbman/qman.c
Original file line number Diff line number Diff line change
Expand Up @@ -2729,6 +2729,9 @@ static int qman_alloc_range(struct gen_pool *p, u32 *result, u32 cnt)
{
unsigned long addr;

if (!p)
return -ENODEV;

addr = gen_pool_alloc(p, cnt);
if (!addr)
return -ENOMEM;
Expand Down
11 changes: 11 additions & 0 deletions drivers/soc/fsl/qbman/qman_ccsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ static const struct qman_error_info_mdata error_mdata[] = {
static u32 __iomem *qm_ccsr_start;
/* A SDQCR mask comprising all the available/visible pool channels */
static u32 qm_pools_sdqcr;
static int __qman_probed;

static inline u32 qm_ccsr_in(u32 offset)
{
Expand Down Expand Up @@ -686,6 +687,12 @@ static int qman_resource_init(struct device *dev)
return 0;
}

int qman_is_probed(void)
{
return __qman_probed;
}
EXPORT_SYMBOL_GPL(qman_is_probed);

static int fsl_qman_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
Expand All @@ -695,6 +702,8 @@ static int fsl_qman_probe(struct platform_device *pdev)
u16 id;
u8 major, minor;

__qman_probed = -1;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
Expand Down Expand Up @@ -828,6 +837,8 @@ static int fsl_qman_probe(struct platform_device *pdev)
if (ret)
return ret;

__qman_probed = 1;

return 0;
}

Expand Down
8 changes: 8 additions & 0 deletions drivers/soc/fsl/qbman/qman_portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ static int qman_portal_probe(struct platform_device *pdev)
int irq, cpu, err;
u32 val;

err = qman_is_probed();
if (!err)
return -EPROBE_DEFER;
if (err < 0) {
dev_err(&pdev->dev, "failing probe due to qman probe error\n");
return -ENODEV;
}

pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);
if (!pcfg)
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion drivers/soc/fsl/qe/ucc.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ static u32 ucc_get_tdm_sync_shift(enum comm_dir mode, u32 tdm_num)
{
u32 shift;

shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : RX_SYNC_SHIFT_BASE;
shift = (mode == COMM_DIR_RX) ? RX_SYNC_SHIFT_BASE : TX_SYNC_SHIFT_BASE;
shift -= tdm_num * 2;

return shift;
Expand Down
8 changes: 8 additions & 0 deletions include/soc/fsl/bman.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,12 @@ int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num);
*/
int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num);

/**
* bman_is_probed - Check if bman is probed
*
* Returns 1 if the bman driver successfully probed, -1 if the bman driver
* failed to probe or 0 if the bman driver did not probed yet.
*/
int bman_is_probed(void);

#endif /* __FSL_BMAN_H */
8 changes: 8 additions & 0 deletions include/soc/fsl/qman.h
Original file line number Diff line number Diff line change
Expand Up @@ -1186,4 +1186,12 @@ int qman_alloc_cgrid_range(u32 *result, u32 count);
*/
int qman_release_cgrid(u32 id);

/**
* qman_is_probed - Check if qman is probed
*
* Returns 1 if the qman driver successfully probed, -1 if the qman driver
* failed to probe or 0 if the qman driver did not probed yet.
*/
int qman_is_probed(void);

#endif /* __FSL_QMAN_H */

0 comments on commit 3f4258b

Please sign in to comment.