iommu/pamu: WARN when fsl_pamu_probe() is called more than once
The function probes the PAMU hardware from device-tree specifications. It initializes global variables and can thus be only safely called once. Add a check that that prints a warning when its called more than once. Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
parent
af29d9fa41
commit
07eb6fdf49
@ -42,6 +42,8 @@ struct pamu_isr_data {
|
|||||||
static struct paace *ppaact;
|
static struct paace *ppaact;
|
||||||
static struct paace *spaact;
|
static struct paace *spaact;
|
||||||
|
|
||||||
|
static bool probed; /* Has PAMU been probed? */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Table for matching compatible strings, for device tree
|
* Table for matching compatible strings, for device tree
|
||||||
* guts node, for QorIQ SOCs.
|
* guts node, for QorIQ SOCs.
|
||||||
@ -1033,6 +1035,9 @@ static int fsl_pamu_probe(struct platform_device *pdev)
|
|||||||
* NOTE : All PAMUs share the same LIODN tables.
|
* NOTE : All PAMUs share the same LIODN tables.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (WARN_ON(probed))
|
||||||
|
return -EBUSY;
|
||||||
|
|
||||||
pamu_regs = of_iomap(dev->of_node, 0);
|
pamu_regs = of_iomap(dev->of_node, 0);
|
||||||
if (!pamu_regs) {
|
if (!pamu_regs) {
|
||||||
dev_err(dev, "ioremap of PAMU node failed\n");
|
dev_err(dev, "ioremap of PAMU node failed\n");
|
||||||
@ -1172,6 +1177,8 @@ static int fsl_pamu_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
setup_liodns();
|
setup_liodns();
|
||||||
|
|
||||||
|
probed = true;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_genpool:
|
error_genpool:
|
||||||
|
Loading…
Reference in New Issue
Block a user