* About a suspicious msleep during doxfer in s3c2410 i2c bus driver
@ 2009-07-22 8:12 Dongsoo, Nathaniel Kim
[not found] ` <5e9665e10907220112m1dbf4975icf1511bc4ac3a1bf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 9+ messages in thread
From: Dongsoo, Nathaniel Kim @ 2009-07-22 8:12 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Cc: ben-Y5A6D6n0/KfQXOPxS62xeg, 박경민,
민병호, Dongsoo Kim,
jsgood.yang-Sze3O3UU22JBDgjK7y7TUQ
Hello,
Since I was working on S3C64XX and C1XX, I found something weird on
I2C bus device.
The thing is that when I try to write multiple registers through I2C
bus, it takes much more time for multiple registers to be written than
any other processor's i2c bus device.
I tracked down for which point does it take and finally found out that
following msleep was making a tremendous delay when I try to write
thousands of registers through I2C bus. Please look at this.
481 static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c,
482 struct i2c_msg *msgs, int num)
483 {
<snip>
521 /* ensure the stop has been through the bus */
522
523 msleep(1);
With several different target boards using s3c64xx and s5pc1xx, it
went good without that msleep(). And of course it is working great
with multiple i2c device attached as well.
So, I want to ask Ben and anyone else using I2C device about removing
that msleep might be ok or not. In my case, it went ok. Please let me
know your opinion.
Cheers,
Nate
--
=
DongSoo, Nathaniel Kim
Engineer
Mobile S/W Platform Lab.
Digital Media & Communications R&D Centre
Samsung Electronics CO., LTD.
e-mail : dongsoo.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
dongsoo45.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org
^ permalink raw reply [flat|nested] 9+ messages in thread[parent not found: <5e9665e10907220112m1dbf4975icf1511bc4ac3a1bf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <5e9665e10907220112m1dbf4975icf1511bc4ac3a1bf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-07-22 12:43 ` Mark Brown [not found] ` <20090722124333.GC7622-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Mark Brown @ 2009-07-22 12:43 UTC (permalink / raw) To: Dongsoo, Nathaniel Kim Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, jsgood.yang-Sze3O3UU22JBDgjK7y7TUQ On Wed, Jul 22, 2009 at 05:12:17PM +0900, Dongsoo, Nathaniel Kim wrote: > Since I was working on S3C64XX and C1XX, I found something weird on > I2C bus device. > The thing is that when I try to write multiple registers through I2C > bus, it takes much more time for multiple registers to be written than > any other processor's i2c bus device. Yes, this is extremely painful for a lot of devices - audio CODECs tend to be noticably affected, especially at resume. Depending on your device and what you're doing you *may* be able to speed things up by accessing many registers in a single I/O in the chip driver but obviously that's not ideal. > With several different target boards using s3c64xx and s5pc1xx, it > went good without that msleep(). And of course it is working great > with multiple i2c device attached as well. > So, I want to ask Ben and anyone else using I2C device about removing > that msleep might be ok or not. In my case, it went ok. Please let me > know your opinion. My *recollection* is that this is mostly there for multi-master configurations. I'm wondering if even if we can't remove the delay completely yet we could add platform data to allow it to be configured on a per-board basis? ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20090722124333.GC7622-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>]
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <20090722124333.GC7622-GFdadSzt00ze9xe1eoZjHA@public.gmane.org> @ 2009-07-22 15:58 ` Dongsoo Kim [not found] ` <E724615E-9F06-4406-9852-041261C5DAA6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Dongsoo Kim @ 2009-07-22 15:58 UTC (permalink / raw) To: Mark Brown Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, 진성 양 2009. 07. 22, 오후 9:43, Mark Brown 작성: > On Wed, Jul 22, 2009 at 05:12:17PM +0900, Dongsoo, Nathaniel Kim > wrote: > >> Since I was working on S3C64XX and C1XX, I found something weird on >> I2C bus device. >> The thing is that when I try to write multiple registers through I2C >> bus, it takes much more time for multiple registers to be written >> than >> any other processor's i2c bus device. > > Yes, this is extremely painful for a lot of devices - audio CODECs > tend > to be noticably affected, especially at resume. Depending on your > device and what you're doing you *may* be able to speed things up by > accessing many registers in a single I/O in the chip driver but > obviously that's not ideal. > >> With several different target boards using s3c64xx and s5pc1xx, it >> went good without that msleep(). And of course it is working great >> with multiple i2c device attached as well. >> So, I want to ask Ben and anyone else using I2C device about removing >> that msleep might be ok or not. In my case, it went ok. Please let me >> know your opinion. > > My *recollection* is that this is mostly there for multi-master > configurations. > > I'm wondering if even if we can't remove the delay completely yet we > could add platform data to allow it to be configured on a per-board > basis? I wish I could answer clearly about this but not having much experience over various I2C bus devices so I can't say with a strict "yes". But in my experience, I've never seen any i2c bus driver serving platform data to be configured with delay support. Tho if it is really necessary for some specified class of i2c devices, we should make one. I'm wondering why anybody has been issued this topic yet. the driver for s3c2410 i2c bus has been the way it is for ages I guess. It obviously seems to be taking long time to write down registers through the s3c2410 i2c bus driver than any other processor's i2c driver. maybe not so many people using enormous i2c register programming on Samsung processors could be the reason I suppose. anyway, let's figure it out the best way we can. Cheers, Nate = Dongsoo, Nathaniel Kim Engineer Mobile S/W Platform Lab. Digital Media & Communications R&D Centre Samsung Electronics CO., LTD. e-mail : dongsoo.kim-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org dongsoo45.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <E724615E-9F06-4406-9852-041261C5DAA6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <E724615E-9F06-4406-9852-041261C5DAA6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2009-07-22 16:06 ` Mark Brown [not found] ` <20090722160639.GB14026-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Mark Brown @ 2009-07-22 16:06 UTC (permalink / raw) To: Dongsoo Kim Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, 진성 양 On Thu, Jul 23, 2009 at 12:58:52AM +0900, Dongsoo Kim wrote: > 2009. 07. 22, 오후 9:43, Mark Brown 작성: > >My *recollection* is that this is mostly there for multi-master > >configurations. > I wish I could answer clearly about this but not having much > experience over various I2C bus devices so I can't say with a strict > "yes". But in my experience, I've never seen any i2c bus driver > serving platform data to be configured with delay support. Tho if it > is really necessary for some specified class of i2c devices, we > should make one. It wasn't for the client devices, it was for issues with synchronisation with the controller hardware. I'm just going on the basis of recollections of previous conversations with Ben here; I'm not sure to what extent this might be an issue with the way the hardware works requiring the driver to jump through hoops. > I'm wondering why anybody has been issued this topic yet. the driver > for s3c2410 i2c bus has been the way it is for ages I guess. It > obviously seems to be taking long time to write down registers > through the s3c2410 i2c bus driver than any other processor's i2c > driver. maybe not so many people using enormous i2c register > programming on Samsung processors could be the reason I suppose. > anyway, let's figure it out the best way we can. > Cheers, I expect most people would, like you, much rather just remove the sleep from the driver since in practice that seems to work well. For various reasons the S3C community isn't all that active upstream which doesn't help with issues like this. ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20090722160639.GB14026-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org>]
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <20090722160639.GB14026-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org> @ 2009-07-30 22:18 ` Ben Dooks [not found] ` <20090730221841.GG8850-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Ben Dooks @ 2009-07-30 22:18 UTC (permalink / raw) To: Mark Brown Cc: Dongsoo Kim, linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, ?????? ??? On Wed, Jul 22, 2009 at 05:06:40PM +0100, Mark Brown wrote: > On Thu, Jul 23, 2009 at 12:58:52AM +0900, Dongsoo Kim wrote: > > 2009. 07. 22, ?????? 9:43, Mark Brown ??????: > > > >My *recollection* is that this is mostly there for multi-master > > >configurations. > > > I wish I could answer clearly about this but not having much > > experience over various I2C bus devices so I can't say with a strict > > "yes". But in my experience, I've never seen any i2c bus driver > > serving platform data to be configured with delay support. Tho if it > > is really necessary for some specified class of i2c devices, we > > should make one. > > It wasn't for the client devices, it was for issues with synchronisation > with the controller hardware. I'm just going on the basis of > recollections of previous conversations with Ben here; I'm not sure to > what extent this might be an issue with the way the hardware works > requiring the driver to jump through hoops. I think this has been in here for a while, and may well not be necessary any more. If anyone else has tested this without the msleep() here, then I'd be interested to know. I will try and sort out testing a few boards as soon as possible to see what is going on. > > I'm wondering why anybody has been issued this topic yet. the driver > > for s3c2410 i2c bus has been the way it is for ages I guess. It > > obviously seems to be taking long time to write down registers > > through the s3c2410 i2c bus driver than any other processor's i2c > > driver. maybe not so many people using enormous i2c register > > programming on Samsung processors could be the reason I suppose. > > anyway, let's figure it out the best way we can. > > Cheers, > > I expect most people would, like you, much rather just remove the sleep > from the driver since in practice that seems to work well. For various > reasons the S3C community isn't all that active upstream which doesn't > help with issues like this. > -- > To unsubscribe from this list: send the line "unsubscribe linux-i2c" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/) 'a smiley only costs 4 bytes' ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <20090730221841.GG8850-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>]
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <20090730221841.GG8850-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> @ 2009-07-31 0:20 ` Dongsoo Kim 2009-07-31 8:05 ` Peter Korsgaard 2009-07-31 12:32 ` Mark Brown 2 siblings, 0 replies; 9+ messages in thread From: Dongsoo Kim @ 2009-07-31 0:20 UTC (permalink / raw) To: Ben Dooks Cc: Mark Brown, linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, ?????? ??? Hi Ben, 2009. 07. 31, 오전 7:18, Ben Dooks 작성: > On Wed, Jul 22, 2009 at 05:06:40PM +0100, Mark Brown wrote: >> On Thu, Jul 23, 2009 at 12:58:52AM +0900, Dongsoo Kim wrote: >>> 2009. 07. 22, ?????? 9:43, Mark Brown ??????: >> >>>> My *recollection* is that this is mostly there for multi-master >>>> configurations. >> >>> I wish I could answer clearly about this but not having much >>> experience over various I2C bus devices so I can't say with a strict >>> "yes". But in my experience, I've never seen any i2c bus driver >>> serving platform data to be configured with delay support. Tho if it >>> is really necessary for some specified class of i2c devices, we >>> should make one. >> >> It wasn't for the client devices, it was for issues with >> synchronisation >> with the controller hardware. I'm just going on the basis of >> recollections of previous conversations with Ben here; I'm not sure >> to >> what extent this might be an issue with the way the hardware works >> requiring the driver to jump through hoops. > > I think this has been in here for a while, and may well not be > necessary any more. If anyone else has tested this without the > msleep() here, then I'd be interested to know. > > I will try and sort out testing a few boards as soon as possible to > see what is going on. > I've been tested without msleep on s3c64xx and also s5pc1xx. And it went well. What I'm concerned is s3c24xx because I had no chance to test on it. Cheers, Nate >>> I'm wondering why anybody has been issued this topic yet. the driver >>> for s3c2410 i2c bus has been the way it is for ages I guess. It >>> obviously seems to be taking long time to write down registers >>> through the s3c2410 i2c bus driver than any other processor's i2c >>> driver. maybe not so many people using enormous i2c register >>> programming on Samsung processors could be the reason I suppose. >>> anyway, let's figure it out the best way we can. >>> Cheers, >> >> I expect most people would, like you, much rather just remove the >> sleep >> from the driver since in practice that seems to work well. For >> various >> reasons the S3C community isn't all that active upstream which >> doesn't >> help with issues like this. >> -- >> To unsubscribe from this list: send the line "unsubscribe linux- >> i2c" in >> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- > Ben (ben-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org, http://www.fluff.org/) > > 'a smiley only costs 4 bytes' ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <20090730221841.GG8850-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> 2009-07-31 0:20 ` Dongsoo Kim @ 2009-07-31 8:05 ` Peter Korsgaard [not found] ` <878wi5wa4z.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org> 2009-07-31 12:32 ` Mark Brown 2 siblings, 1 reply; 9+ messages in thread From: Peter Korsgaard @ 2009-07-31 8:05 UTC (permalink / raw) To: Ben Dooks Cc: Mark Brown, Dongsoo Kim, linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, ?????? ??? >>>>> "Ben" == Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> writes: Hi, >> It wasn't for the client devices, it was for issues with >> synchronisation with the controller hardware. I'm just going on >> the basis of recollections of previous conversations with Ben >> here; I'm not sure to what extent this might be an issue with the >> way the hardware works requiring the driver to jump through hoops. Ben> I think this has been in here for a while, and may well not be Ben> necessary any more. If anyone else has tested this without the Ben> msleep() here, then I'd be interested to know. I'll test on my 6410 board over the weekend. Notice that I've been hacking on the uboot drivers/i2c/s3c24x0_i2c.c file to add s3c64xx support, and I there had to add a udelay before setting the start condition to get it to work stable. -- Bye, Peter Korsgaard ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <878wi5wa4z.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>]
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <878wi5wa4z.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org> @ 2009-08-03 8:04 ` Ben Dooks 0 siblings, 0 replies; 9+ messages in thread From: Ben Dooks @ 2009-08-03 8:04 UTC (permalink / raw) To: Peter Korsgaard Cc: Ben Dooks, Mark Brown, Dongsoo Kim, linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, ?????? ??? On Fri, Jul 31, 2009 at 10:05:00AM +0200, Peter Korsgaard wrote: > >>>>> "Ben" == Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org> writes: > > Hi, > > >> It wasn't for the client devices, it was for issues with > >> synchronisation with the controller hardware. I'm just going on > >> the basis of recollections of previous conversations with Ben > >> here; I'm not sure to what extent this might be an issue with the > >> way the hardware works requiring the driver to jump through hoops. > > Ben> I think this has been in here for a while, and may well not be > Ben> necessary any more. If anyone else has tested this without the > Ben> msleep() here, then I'd be interested to know. > > I'll test on my 6410 board over the weekend. Notice that I've been > hacking on the uboot drivers/i2c/s3c24x0_i2c.c file to add s3c64xx > support, and I there had to add a udelay before setting the start > condition to get it to work stable. does it check for bus busy before starting? -- Ben Q: What's a light-year? A: One-third less calories than a regular year. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: About a suspicious msleep during doxfer in s3c2410 i2c bus driver [not found] ` <20090730221841.GG8850-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org> 2009-07-31 0:20 ` Dongsoo Kim 2009-07-31 8:05 ` Peter Korsgaard @ 2009-07-31 12:32 ` Mark Brown 2 siblings, 0 replies; 9+ messages in thread From: Mark Brown @ 2009-07-31 12:32 UTC (permalink / raw) To: Ben Dooks Cc: Dongsoo Kim, linux-i2c-u79uwXL29TY76Z2rM5mHXA, ben-Y5A6D6n0/KfQXOPxS62xeg, ?????????, ?????????, Dongsoo Kim, ?????? ??? On Thu, Jul 30, 2009 at 11:18:41PM +0100, Ben Dooks wrote: > I think this has been in here for a while, and may well not be > necessary any more. If anyone else has tested this without the > msleep() here, then I'd be interested to know. I didn't notice any issues when I tested on s3c64xx systems but this wasn't a particularly scientific test. ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-08-03 8:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-22 8:12 About a suspicious msleep during doxfer in s3c2410 i2c bus driver Dongsoo, Nathaniel Kim
[not found] ` <5e9665e10907220112m1dbf4975icf1511bc4ac3a1bf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-22 12:43 ` Mark Brown
[not found] ` <20090722124333.GC7622-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2009-07-22 15:58 ` Dongsoo Kim
[not found] ` <E724615E-9F06-4406-9852-041261C5DAA6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-07-22 16:06 ` Mark Brown
[not found] ` <20090722160639.GB14026-HF5t3jzXg/6ND3a5+9QAFujbO/Zr0HzV@public.gmane.org>
2009-07-30 22:18 ` Ben Dooks
[not found] ` <20090730221841.GG8850-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2009-07-31 0:20 ` Dongsoo Kim
2009-07-31 8:05 ` Peter Korsgaard
[not found] ` <878wi5wa4z.fsf-uXGAPMMVk8amE9MCos8gUmSdvHPH+/yF@public.gmane.org>
2009-08-03 8:04 ` Ben Dooks
2009-07-31 12:32 ` Mark Brown
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).