Message ID | 20240123111456.739381-1-romain.naour@smile.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] regulator: ti-abb: don't use devm_platform_ioremap_resource_byname for shared interrupt register | expand |
On Tue, 23 Jan 2024 12:14:56 +0100, Romain Naour wrote: > We can't use devm_platform_ioremap_resource_byname() to remap the > interrupt register that can be shared between > regulator-abb-{ivahd,dspeve,gpu} drivers instances. > > The combined helper introduce a call to devm_request_mem_region() that > creates a new busy resource region on PRM_IRQSTATUS_MPU register > (0x4ae06010). The first devm_request_mem_region() call succeeds for > regulator-abb-ivahd but fails for the two other regulator-abb-dspeve > and regulator-abb-gpu. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next Thanks! [1/1] regulator: ti-abb: don't use devm_platform_ioremap_resource_byname for shared interrupt register commit: a67e1f0bd4564b485e0f0c3ed7f6bf17688be268 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c index f48214e2c3b4..04133510e5af 100644 --- a/drivers/regulator/ti-abb-regulator.c +++ b/drivers/regulator/ti-abb-regulator.c @@ -726,9 +726,25 @@ static int ti_abb_probe(struct platform_device *pdev) return PTR_ERR(abb->setup_reg); } - abb->int_base = devm_platform_ioremap_resource_byname(pdev, "int-address"); - if (IS_ERR(abb->int_base)) - return PTR_ERR(abb->int_base); + pname = "int-address"; + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname); + if (!res) { + dev_err(dev, "Missing '%s' IO resource\n", pname); + return -ENODEV; + } + /* + * The MPU interrupt status register (PRM_IRQSTATUS_MPU) is + * shared between regulator-abb-{ivahd,dspeve,gpu} driver + * instances. Therefore use devm_ioremap() rather than + * devm_platform_ioremap_resource_byname() to avoid busy + * resource region conflicts. + */ + abb->int_base = devm_ioremap(dev, res->start, + resource_size(res)); + if (!abb->int_base) { + dev_err(dev, "Unable to map '%s'\n", pname); + return -ENOMEM; + } /* Map Optional resources */ pname = "efuse-address";