2012-11-29 15:04:34

by Philipp Zabel

[permalink] [raw]
Subject: [PATCH] mfd: da9052-core: Fix interrupts reported to mfd child devices

The patch "mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe"
replaces the irq_base with the da9052_map_irq function but doesn't
update the irq_base parameter to the mfd_add_devices call.
This causes child devices to try and request IRQs with just the internal
offset number.

Signed-off-by: Philipp Zabel <[email protected]>
---
drivers/mfd/da9052-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c
index c96cdbc..0f12972 100644
--- a/drivers/mfd/da9052-core.c
+++ b/drivers/mfd/da9052-core.c
@@ -804,7 +804,7 @@ int __devinit da9052_device_init(struct da9052 *da9052, u8 chip_id)
dev_err(da9052->dev, "DA9052 ADC IRQ failed ret=%d\n", ret);

ret = mfd_add_devices(da9052->dev, -1, da9052_subdev_info,
- ARRAY_SIZE(da9052_subdev_info), NULL, 0, NULL);
+ ARRAY_SIZE(da9052_subdev_info), NULL, da9052_map_irq(da9052, 0), NULL);
if (ret) {
dev_err(da9052->dev, "mfd_add_devices failed: %d\n", ret);
goto err;
--
1.7.10.4


2012-11-30 11:04:44

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH] mfd: da9052-core: Fix interrupts reported to mfd child devices

Hi Philipp,

On Thu, Nov 29, 2012 at 04:04:28PM +0100, Philipp Zabel wrote:
> The patch "mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe"
> replaces the irq_base with the da9052_map_irq function but doesn't
> update the irq_base parameter to the mfd_add_devices call.
> This causes child devices to try and request IRQs with just the internal
> offset number.
>
> Signed-off-by: Philipp Zabel <[email protected]>
> ---
> drivers/mfd/da9052-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, although I'd like to get Fabio's ACK on it.
I think this is a problem he should have seen, although he could have missed
it since the original patch is a fairly old one and there have been some MFD
API changes in between.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/

2012-11-30 11:16:19

by Samuel Ortiz

[permalink] [raw]
Subject: Re: [PATCH] mfd: da9052-core: Fix interrupts reported to mfd child devices

Hi Philipp,

On Fri, Nov 30, 2012 at 12:04:38PM +0100, Samuel Ortiz wrote:
> Hi Philipp,
>
> On Thu, Nov 29, 2012 at 04:04:28PM +0100, Philipp Zabel wrote:
> > The patch "mfd: da9052-core: Use regmap_irq_get_virq() and fix the probe"
> > replaces the irq_base with the da9052_map_irq function but doesn't
> > update the irq_base parameter to the mfd_add_devices call.
> > This causes child devices to try and request IRQs with just the internal
> > offset number.
> >
> > Signed-off-by: Philipp Zabel <[email protected]>
> > ---
> > drivers/mfd/da9052-core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> Applied,
I'll take that back. It fails to build because on my for-next branch
da9052_map_irq() is a da9052-irq.c static function. It was moved from core.c
to irq.c with Fabio's patch "mfd: da9052: Introduce da9052-irq.c", commit
8bad1abd6303476d6f77878aa8ea737d5d1b625c.

Cheers,
Samuel.

--
Intel Open Source Technology Centre
http://oss.intel.com/