Skip to content

Commit bab5c80

Browse files
committed
Merge tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Arnd writes: "ARM: SoC fixes for 4.19 Two last minute bugfixes, both for NXP platforms: * The Layerscape 'qbman' infrastructure suffers from probe ordering bugs in some configurations, a two-patch series adds a hotfix for this. 4.20 will have a longer set of patches to rework it. * The old imx53-qsb board regressed in 4.19 after the addition of cpufreq support, adding a set of explicit operating points fixes this." * tag 'armsoc-fixes-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: soc: fsl: qman_portals: defer probe after qman's probe soc: fsl: qbman: add APIs to retrieve the probing status ARM: dts: imx53-qsb: disable 1.2GHz OPP
2 parents f014ffb + 3f4258b commit bab5c80

File tree

6 files changed

+57
-0
lines changed

6 files changed

+57
-0
lines changed

arch/arm/boot/dts/imx53-qsb-common.dtsi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@
123123
};
124124
};
125125

126+
&cpu0 {
127+
/* CPU rated to 1GHz, not 1.2GHz as per the default settings */
128+
operating-points = <
129+
/* kHz uV */
130+
166666 850000
131+
400000 900000
132+
800000 1050000
133+
1000000 1200000
134+
>;
135+
};
136+
126137
&esdhc1 {
127138
pinctrl-names = "default";
128139
pinctrl-0 = <&pinctrl_esdhc1>;

drivers/soc/fsl/qbman/bman_ccsr.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ static void bm_set_memory(u64 ba, u32 size)
120120
*/
121121
static dma_addr_t fbpr_a;
122122
static size_t fbpr_sz;
123+
static int __bman_probed;
123124

124125
static int bman_fbpr(struct reserved_mem *rmem)
125126
{
@@ -166,6 +167,12 @@ static irqreturn_t bman_isr(int irq, void *ptr)
166167
return IRQ_HANDLED;
167168
}
168169

170+
int bman_is_probed(void)
171+
{
172+
return __bman_probed;
173+
}
174+
EXPORT_SYMBOL_GPL(bman_is_probed);
175+
169176
static int fsl_bman_probe(struct platform_device *pdev)
170177
{
171178
int ret, err_irq;
@@ -175,6 +182,8 @@ static int fsl_bman_probe(struct platform_device *pdev)
175182
u16 id, bm_pool_cnt;
176183
u8 major, minor;
177184

185+
__bman_probed = -1;
186+
178187
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
179188
if (!res) {
180189
dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
@@ -255,6 +264,8 @@ static int fsl_bman_probe(struct platform_device *pdev)
255264
return ret;
256265
}
257266

267+
__bman_probed = 1;
268+
258269
return 0;
259270
};
260271

drivers/soc/fsl/qbman/qman_ccsr.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ static const struct qman_error_info_mdata error_mdata[] = {
273273
static u32 __iomem *qm_ccsr_start;
274274
/* A SDQCR mask comprising all the available/visible pool channels */
275275
static u32 qm_pools_sdqcr;
276+
static int __qman_probed;
276277

277278
static inline u32 qm_ccsr_in(u32 offset)
278279
{
@@ -686,6 +687,12 @@ static int qman_resource_init(struct device *dev)
686687
return 0;
687688
}
688689

690+
int qman_is_probed(void)
691+
{
692+
return __qman_probed;
693+
}
694+
EXPORT_SYMBOL_GPL(qman_is_probed);
695+
689696
static int fsl_qman_probe(struct platform_device *pdev)
690697
{
691698
struct device *dev = &pdev->dev;
@@ -695,6 +702,8 @@ static int fsl_qman_probe(struct platform_device *pdev)
695702
u16 id;
696703
u8 major, minor;
697704

705+
__qman_probed = -1;
706+
698707
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
699708
if (!res) {
700709
dev_err(dev, "Can't get %pOF property 'IORESOURCE_MEM'\n",
@@ -828,6 +837,8 @@ static int fsl_qman_probe(struct platform_device *pdev)
828837
if (ret)
829838
return ret;
830839

840+
__qman_probed = 1;
841+
831842
return 0;
832843
}
833844

drivers/soc/fsl/qbman/qman_portal.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ static int qman_portal_probe(struct platform_device *pdev)
227227
int irq, cpu, err;
228228
u32 val;
229229

230+
err = qman_is_probed();
231+
if (!err)
232+
return -EPROBE_DEFER;
233+
if (err < 0) {
234+
dev_err(&pdev->dev, "failing probe due to qman probe error\n");
235+
return -ENODEV;
236+
}
237+
230238
pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);
231239
if (!pcfg)
232240
return -ENOMEM;

include/soc/fsl/bman.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,12 @@ int bman_release(struct bman_pool *pool, const struct bm_buffer *bufs, u8 num);
126126
*/
127127
int bman_acquire(struct bman_pool *pool, struct bm_buffer *bufs, u8 num);
128128

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+
129137
#endif /* __FSL_BMAN_H */

include/soc/fsl/qman.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,4 +1186,12 @@ int qman_alloc_cgrid_range(u32 *result, u32 count);
11861186
*/
11871187
int qman_release_cgrid(u32 id);
11881188

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+
11891197
#endif /* __FSL_QMAN_H */

0 commit comments

Comments
 (0)