mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Yi Zhang <yizhang@marvell.com>
Cc: zhouqiao@marvell.com, zhangwm@marvell.com,
	yizhang.mrvl@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap: irq: clear status when disable irq
Date: Tue, 15 Oct 2013 12:48:12 +0100	[thread overview]
Message-ID: <20131015114812.GY2443@sirena.org.uk> (raw)
In-Reply-To: <1381813438-5386-1-git-send-email-yizhang@marvell.com>

[-- Attachment #1: Type: text/plain, Size: 893 bytes --]

On Tue, Oct 15, 2013 at 01:03:58PM +0800, Yi Zhang wrote:

> +			bits_length = d->map->format.val_bytes * BITS_PER_BYTE;
> +			for (j = 0; j < bits_length; j++) {
> +				d->mask_buf[i] &= (0x1 << j);
> +				if (!d->mask_buf[i])
> +					ret = regmap_update_bits(d->map, reg,
> +								 (0x1 << j), 0);
> +				if (ret != 0)
> +					dev_err(d->map->dev, "Failed to ack 0x%x: %d\n",
> +						reg, ret);

I don't entirely understand this code - what's the loop doing?  It
looks like it's trying to acknowledge things bit by bit but it's doing
this by updating mask_buf so it looks like it'll corrupt the set of
masked interrupts.  After the zeroth iteration any bits other than bit 0
should get cleared by the &= (0x1 << j).  I'd have expected to just
write mask_buf back or something similar.

It's possible I'm missing something here but if that is the case perhaps
some comments would be good.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-10-15 11:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-15  5:03 Yi Zhang
2013-10-15 11:48 ` Mark Brown [this message]
2013-10-15 12:03   ` Yi Zhang
  -- strict thread matches above, loose matches on Subject: below --
2013-10-14  4:23 Yi Zhang
2013-10-14 11:09 ` Mark Brown
2013-10-14 11:55   ` Yi Zhang

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=20131015114812.GY2443@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yizhang.mrvl@gmail.com \
    --cc=yizhang@marvell.com \
    --cc=zhangwm@marvell.com \
    --cc=zhouqiao@marvell.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®