From: Federico Vaga <federico.vaga@cern.ch>
To: Peter Korsgaard <peter@korsgaard.com>,
linux-i2c <linux-i2c@vger.kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] i2c:ocores: add polling interface
Date: Mon, 29 Oct 2018 14:11:14 +0100 [thread overview]
Message-ID: <5709014.JH4KZFlPMP@pcbe13614> (raw)
In-Reply-To: <87muqwzyya.fsf@dell.be.48ers.dk>
On Monday, October 29, 2018 2:04:13 PM CET Peter Korsgaard wrote:
> > I think that something like this could be better
> >
> > (2) usleep_range(sleep_min, sleep_min * XXX);
> >
> > But.
> > Since it is better to make this patch ready for xfer_irqless, then I will
> > definitively go for udelay(). The reason is that, xfer_irqless may run in
> > atomic context where we can't sleep at all.
>
> Great! BTW I noticed that your sleep_min calculation looked odd:
>
> int sleep_min = (8/i2c->bus_clock_khz) * 1000; /* us for 8bits
>
> bus_clock_khz almost certainly will be bigger than 8 (E.G. likely
> 100KHz), so the above set sleep_min to 0. Please move the * 1000 before
> the division.
True, oops
WARNING: multiple messages have this Message-ID (diff)
From: Federico Vaga <federico.vaga@cern.ch>
To: Peter Korsgaard <peter@korsgaard.com>,
linux-i2c <linux-i2c@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] i2c:ocores: add polling interface
Date: Mon, 29 Oct 2018 14:11:14 +0100 [thread overview]
Message-ID: <5709014.JH4KZFlPMP@pcbe13614> (raw)
In-Reply-To: <87muqwzyya.fsf@dell.be.48ers.dk>
On Monday, October 29, 2018 2:04:13 PM CET Peter Korsgaard wrote:
> > I think that something like this could be better
> >
> > (2) usleep_range(sleep_min, sleep_min * XXX);
> >
> > But.
> > Since it is better to make this patch ready for xfer_irqless, then I will
> > definitively go for udelay(). The reason is that, xfer_irqless may run in
> > atomic context where we can't sleep at all.
>
> Great! BTW I noticed that your sleep_min calculation looked odd:
>
> int sleep_min = (8/i2c->bus_clock_khz) * 1000; /* us for 8bits
>
> bus_clock_khz almost certainly will be bigger than 8 (E.G. likely
> 100KHz), so the above set sleep_min to 0. Please move the * 1000 before
> the division.
True, oops
next prev parent reply other threads:[~2018-10-29 13:11 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 16:13 i2c:ocores: fixes and polling mechanism Federico Vaga
2018-06-25 16:13 ` Federico Vaga
2018-06-25 16:13 ` [PATCH 1/3] i2c:ocores: stop transfer on timeout Federico Vaga
2018-06-25 16:13 ` Federico Vaga
2018-10-21 14:10 ` Peter Korsgaard
2018-10-24 14:51 ` Federico Vaga
2018-10-24 14:51 ` Federico Vaga
2018-10-26 17:46 ` Peter Korsgaard
2018-10-26 17:46 ` Peter Korsgaard
2018-10-25 7:42 ` Federico Vaga
2018-10-25 7:42 ` Federico Vaga
2018-06-25 16:13 ` [PATCH 2/3] i2c:ocores: do not handle IRQ if IF is not set Federico Vaga
2018-06-25 16:13 ` Federico Vaga
2018-10-21 14:12 ` Peter Korsgaard
2018-10-29 8:53 ` Wolfram Sang
2018-10-29 14:27 ` Federico Vaga
2018-10-29 14:27 ` Federico Vaga
2018-06-25 16:13 ` [PATCH 3/3] i2c:ocores: add polling interface Federico Vaga
2018-06-25 16:13 ` Federico Vaga
2018-10-21 14:39 ` Peter Korsgaard
2018-10-24 9:51 ` Federico Vaga
2018-10-24 9:51 ` Federico Vaga
2018-10-26 17:45 ` Peter Korsgaard
2018-10-26 17:45 ` Peter Korsgaard
2018-10-29 8:50 ` Federico Vaga
2018-10-29 8:50 ` Federico Vaga
2018-10-29 13:04 ` Peter Korsgaard
2018-10-29 13:04 ` Peter Korsgaard
2018-10-29 13:11 ` Federico Vaga [this message]
2018-10-29 13:11 ` Federico Vaga
2018-10-25 7:47 ` Federico Vaga
2018-10-25 7:47 ` Federico Vaga
2018-08-11 17:13 ` i2c:ocores: fixes and polling mechanism Federico Vaga
2018-08-11 17:13 ` Federico Vaga
2018-08-12 15:34 ` Wolfram Sang
2018-08-22 16:16 ` Peter Korsgaard
2018-09-17 16:42 ` Wolfram Sang
2018-09-19 5:15 ` Peter Korsgaard
2018-09-19 6:51 ` Wolfram Sang
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=5709014.JH4KZFlPMP@pcbe13614 \
--to=federico.vaga@cern.ch \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@korsgaard.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 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.