linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Kurtz <djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
Cc: Ellen Wang
	<ellen-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>,
	wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v1 i2c/for-next] i2c-i801: recover from hardware PEC errors
Date: Fri, 24 Apr 2015 19:00:53 +0800	[thread overview]
Message-ID: <CAGS+omCv0UL1hGRME_LiMGZhcd75G6x3eb7F9v5PvoxgwVAGVQ@mail.gmail.com> (raw)
In-Reply-To: <20150424120852.717966f9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>

Hi guys,

On Fri, Apr 24, 2015 at 6:08 PM, Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org> wrote:
> Hi Ellen,
>
> On Mon, 20 Apr 2015 15:52:47 -0700, Ellen Wang wrote:
>> This leads to a related question:  If the driver is serialized, then the
>> (status = priv->status) inside wait_event_timeout() isn't strictly
>> necessary, correct?  It can just be priv->status.  I'm just want to
>> double check that there's no race and I can add a priv->auxsts and not
>> have to stick something like this inside the wait_event_timeout():
>>
>>     (auxsts = priv->auxsts, status = priv->status)
>
> To be honest I'm not 100% certain. I think this was only a minor
> optimization, but I may be wrong. Adding Daniel to Cc, he added that
> code to the i2c-i801 driver. Daniel, any comment on this?
>
> Equally mysterious to me is:
>
>                 priv->status |= status;
>
> in i801_isr() where it would seem that a simple "=" would suffice.

Sorry, it has been a long time since i looked at i801 code,
I think you guys are correct.  You can probably just do:

            wait_event(priv->waitq, priv->status);
            status = priv->status;
            priv->status = 0;
            return i801_check_post(priv, status);

And, I agree with Jean in i801_isr(),
   priv->status |= status;

Could probably just be:
   priv->status = status;

-Dan

>
> --
> Jean Delvare
> SUSE L3 Support

  parent reply	other threads:[~2015-04-24 11:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  0:11 [PATCH v1 i2c/for-next] i1c: i801: recover from hardware PEC errors Ellen Wang
     [not found] ` <1428970319-32544-1-git-send-email-ellen-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2015-04-15 12:08   ` Jean Delvare
     [not found]     ` <20150415140834.44b1add8-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-04-15 20:46       ` Ellen Wang
     [not found]         ` <552ECE19.4090705-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2015-04-17  7:17           ` [PATCH v1 i2c/for-next] i2c-i801: " Jean Delvare
     [not found]             ` <20150417091751.1ae986f2-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-04-20 22:52               ` Ellen Wang
     [not found]                 ` <5535833F.7090809-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
2015-04-24 10:08                   ` Jean Delvare
     [not found]                     ` <20150424120852.717966f9-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-04-24 11:00                       ` Daniel Kurtz [this message]
     [not found]                         ` <CAGS+omCv0UL1hGRME_LiMGZhcd75G6x3eb7F9v5PvoxgwVAGVQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-25 19:51                           ` Ellen Wang

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=CAGS+omCv0UL1hGRME_LiMGZhcd75G6x3eb7F9v5PvoxgwVAGVQ@mail.gmail.com \
    --to=djkurtz-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=ellen-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org \
    --cc=jdelvare-l3A5Bk7waGM@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).