All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Twiss <stwiss.opensource@diasemi.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Cc: "mazziesaccount@gmail.com" <mazziesaccount@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Support Opensource <Support.Opensource@diasemi.com>
Subject: RE: [PATCH] regmap: regmap-irq: silently ignore unsupported type settings
Date: Tue, 8 Jan 2019 10:21:54 +0000	[thread overview]
Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7022179F236@SW-EX-MBX02.diasemi.com> (raw)
In-Reply-To: <CAMuHMdUg=C+pNrbauM-f7LchXRnwu1ufYyUSp=jO+8hs_SrgXQ@mail.gmail.com>

Hi Geert,

On 29 December 2018 11:14 Geert Uytterhoeven wrote:

> To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> Cc: mazziesaccount@gmail.com; Mark Brown <broonie@kernel.org>; Greg KH
> <gregkh@linuxfoundation.org>; Rafael J. Wysocki <rafael@kernel.org>; Linux
> Kernel Mailing List <linux-kernel@vger.kernel.org>; Support Opensource
> <Support.Opensource@diasemi.com>
> Subject: Re: [PATCH] regmap: regmap-irq: silently ignore unsupported type
> settings
> 
> Hi Matti,
> 
> On Thu, Dec 27, 2018 at 9:44 AM Matti Vaittinen
> <matti.vaittinen@fi.rohmeurope.com> wrote:
> > Do not return error if irq-type setting is requested for
> > controlloer which does not support this. This is how
> > regmap-irq has previously handled the undupported type
> > settings and existing drivers seem to be upset if failure
> > is now reported.
> >
> > Fixes: 1c2928e3e321 ("regmap: regmap-irq/gpio-max77620: add level-irq support")
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> 
> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> > ---
> >
> > Geert reported that 1c2928e3e321 breaks da9063-rtc on the Renesas
> > Koelsch board:
> >
> >
> https://lore.kernel.org/lkml/20181227075648.GB2461@localhost.localdomain/T/#
> m194616cc88d7b4c2a78f7ce07907608fdb64a092
> >
> > Geert, do you know if anyone vould to test this?
> 
> Thanks, that seems to fix the issue with da9063-rtc.
> 
> I don't know how to trigger an actual interrupt, though.
> 
> > --- a/drivers/base/regmap/regmap-irq.c
> > +++ b/drivers/base/regmap/regmap-irq.c
> > @@ -258,7 +258,7 @@ static int regmap_irq_set_type(struct irq_data *data,
> unsigned int type)
> >         const struct regmap_irq_type *t = &irq_data->type;
> >
> >         if ((t->types_supported & type) != type)
> > -               return -ENOTSUPP;
> > +               return 0;
> >
> >         reg = t->type_reg_offset / map->reg_stride;
> >
> > --
> > 2.14.3
> 

I've run this patch on the DA9063 set-up I have here. And this fixes the
problem.

Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>

Regards,
Steve

My previous report using the unmodified v5.0-rc1 Linux kernel is here:
https://lore.kernel.org/lkml/6ED8E3B22081A4459DAC7699F3695FB7022179F018@SW-EX-MBX02.diasemi.com

This v5.0-rc1 Linux kernel failed to allow IRQs for the MFD cells in the
DA9063. But, altering the v5.0-rc1 kernel with the patch given above (to
return 0 instead of -ENOTSUPP in regmap-irq.c), fixes the problem.

A cut-down console output for this result is given below.

--- 8< ---
[...]
da9063 1-0058: Device detected (chip-ID: 0x61, var-ID: 0x60)
[...]
da9063-onkey da9063-onkey: DMA mask not set
input: da9063-onkey as /devices/soc0/soc/2100000.aips-bus/21a4000.i2c/i2c-1/1-0058/da9063-onkey/input/input2
da9063-rtc da9063-rtc: DMA mask not set
da9063-rtc da9063-rtc: registered as rtc0
[...]
da9063-watchdog da9063-watchdog: DMA mask not set
[...]
da9063-rtc da9063-rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800)
[...]
--- 8< ---

and the results of setting an RTC alarm and waiting for the interrupt outputs
the following:

--- 8< ---
> cat *.res
[PASS] Set RTC alarms functional test for TEST with DA9063-TEST
[PASS] Setting test type to use BB RTC alarm functional test for TEST with DA9063-TEST
[PASS] Running set alarm tests for RTC { 1 }
[PASS] Running test for test_rtc_prog_set_simple_alarm_seconds()
[PASS] Setting the current date and time from the da9063-rtc as 2000-01-01 00:00:00
[PASS] Setting the alarm date and time from the da9063-rtc as 2000-01-01 00:00:05 (+5 secs into the future)
[PASS] Setting the listener on da9063-rtc then waiting for elapsed timeout of 15 seconds...
[PASS] The alarm was triggered on da9063-rtc within the expected time and the alarm happened at 2000-01-01 00:00:05
[PASS] Running test for test_rtc_prog_set_simple_alarm_seconds()
[PASS] Setting the current date and time from the da9063-rtc as 2000-01-01 00:00:00
[PASS] Setting the alarm date and time from the da9063-rtc as 2000-01-01 00:00:15 (+15 secs into the future)
[PASS] Setting the listener on da9063-rtc then waiting for elapsed timeout of 25 seconds...
[PASS] The alarm was triggered on da9063-rtc within the expected time and the alarm happened at 2000-01-01 00:00:15
[PASS] Finished running DA9063 set alarm tests for RTC { 1 } on TEST
> cat /proc/interrupts | grep da9063
249:          2          0          0          0  gpio-mxc  11 Level     da9063-irq
302:          0          0          0          0  da9063-irq   0 Level     ONKEY
303:          0          0          0          2  da9063-irq   1 Level     ALARM
310:          0          0          0          0  da9063-irq   8 Level     LDO_LIM
> uname -a
Linux test 5.0.0-rc1 #1 SMP Tue Jan 8 09:39:30 GMT 2019 armv7l GNU/Linux
--- 8< ---


  parent reply	other threads:[~2019-01-08 10:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-27  8:44 [PATCH] regmap: regmap-irq: silently ignore unsupported type settings Matti Vaittinen
2018-12-29 11:13 ` Geert Uytterhoeven
2018-12-31 19:14   ` Mark Brown
2019-01-01 17:36     ` Geert Uytterhoeven
2019-01-02 15:31       ` Steve Twiss
2019-01-04 15:47         ` Geert Uytterhoeven
2019-01-07 18:52           ` Steve Twiss
2019-01-08 10:21   ` Steve Twiss [this message]
2019-01-03 17:27 ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ED8E3B22081A4459DAC7699F3695FB7022179F236@SW-EX-MBX02.diasemi.com \
    --to=stwiss.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=broonie@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.