linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yadi <yadi.hu@windriver.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: jdelvare@suse.de, linux-i2c@vger.kernel.org
Subject: Re: RESEND:i2c-eg20t: fix race between i2c init and interrupt enable
Date: Sun, 18 Sep 2016 10:55:14 +0800	[thread overview]
Message-ID: <738c387b-2a7e-19fb-d9d9-034426ce3b49@windriver.com> (raw)
In-Reply-To: <20160916200456.GA2216@katana>



在 2016/9/17 4:04, Wolfram Sang 写道:
>> after testing last patch, replacing request_irq() location is not a
>> good idea,it might produce a little time windows ,in which the interrupts
>> occurring inside  will be omitted.
>>
>> the new patch adds a check point on interrupt handler in case field
>> 'pch_base_address' has not been initialed.
> What about using two for-loops in probe like this pseudo code?
>
> for (all_channels)
> 	do_initialization
>
> request_irq()
>
> for (all_channels)
> 	register_adapter
>
>
> This seems to me the correct order and most readable solution.
if we use two for-loops, we would have to put  pch_i2c_init on the 
second loop in order to avoid littel interval, in which the interrupts 
occuring inside will be omitted.
it seems to me so uncomfortable. how do you like it?

for (all_channels)
	do_initialization

request_irq()

for (all_channels) {
	 pch_i2c_init  /* Enable interrupts at end of function*/
	 register_adapter
}

Yadi

  reply	other threads:[~2016-09-18  2:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  9:25 RESEND:i2c-eg20t: fix race between i2c init and interrupt enable Yadi Hu
2016-09-07  9:25 ` [PATCH] i2c-eg20t: " Yadi Hu
2016-09-12  0:41 ` RESEND:i2c-eg20t: " Yadi
2016-09-14  6:39 ` Yadi
2016-09-14  7:28 ` Wolfram Sang
2016-09-14  7:49   ` Yadi
2016-09-16 20:04 ` Wolfram Sang
2016-09-18  2:55   ` Yadi [this message]
2016-09-18  7:53     ` Wolfram Sang
2016-09-18  8:51       ` Yadi

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=738c387b-2a7e-19fb-d9d9-034426ce3b49@windriver.com \
    --to=yadi.hu@windriver.com \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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).