Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1610046

Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing handle_reread

From Mark Brown <broonie@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing handle_reread
Date 2017-03-27 20:30 +0200
Message-ID <tpHyV-3ND-5@gated-at.bofh.it> (permalink)
References <tnS5s-5Vz-27@gated-at.bofh.it> <tnS5s-5Vz-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Wed, Mar 22, 2017 at 10:10:49AM -0700, Tony Lindgren wrote:
> At least Motorola CPCAP PMIC needs it's device interrupts re-read
> until there are no more interrupts. Otherwise the PMIC interrupt to
> the SoC will eventually stop toggling. This seems to be a bug in the
> CPCAP PMIC where it can stop driving the GPIO interrupt to the SoC
> with pending CPCAP interrupts.

> Let's allow handling issues like this by introducing a flag for
> handle_reread and by splitting regmap_irq_thread() into two separate
> functions for regmap_read_irq_status() and regmap_irq_handle_pending().

So, I see your use case but the fact is that as Charles observed this is
exactly the code used for emulating level triggered IRQs with edge
triggered interrupt controllers.  This means someone is doubtless going
to end up using it for precisely that.  This makes me uncomfortable, we
do have this open coded into various drivers already but this is more of
a core thing and it feels like this should be in genirq rather than
here...  that said, looking at the code:

> +	do {
> +		ret = regmap_read_irq_status(data);
> +		if (ret)
> +			goto out_runtime_put;
> +
> +		ret = regmap_irq_handle_pending(data);
> +		if (ret < 0)
> +			goto out_runtime_put;
> +
> +		if (!ret)
> +			break;
> +
> +		handled += ret;
> +	} while (chip->handle_reread);

There's no protection against screaming interrupts here, I'd really like
to see that.  Also some tracing of the number of times we spin.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/4] regmap: irq: Fix lost interrupts by introducing handle_reread Tony Lindgren <tony@atomide.com> - 2017-03-22 18:20 +0100
  Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Mark Brown <broonie@kernel.org> - 2017-03-27 20:30 +0200
    Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Tony Lindgren <tony@atomide.com> - 2017-03-28 02:40 +0200
      Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Mark Brown <broonie@kernel.org> - 2017-03-28 17:30 +0200
        Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Tony Lindgren <tony@atomide.com> - 2017-03-28 17:50 +0200
          Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Mark Brown <broonie@kernel.org> - 2017-03-28 19:00 +0200
            Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Tony Lindgren <tony@atomide.com> - 2017-03-28 19:20 +0200
              Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Tony Lindgren <tony@atomide.com> - 2017-04-04 05:10 +0200
                Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Mark Brown <broonie@kernel.org> - 2017-04-04 14:30 +0200
                Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Tony Lindgren <tony@atomide.com> - 2017-04-04 16:00 +0200
                Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Mark Brown <broonie@kernel.org> - 2017-04-04 17:30 +0200
  Re: [PATCH 1/4] regmap: irq: Fix lost interrupts by introducing  handle_reread Lee Jones <lee.jones@linaro.org> - 2017-04-03 13:30 +0200

csiph-web