linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Problem with i2c-algo-ibm_ocp driver on ppc405 board
@ 2004-01-28  8:25 Matteo Bortolin
  2004-01-28  9:14 ` Wolfgang Denk
  2004-01-28 18:16 ` Eugene Surovegin
  0 siblings, 2 replies; 4+ messages in thread
From: Matteo Bortolin @ 2004-01-28  8:25 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: llandre


Hi all,

I've developed an RTC driver that uses i2c core and for a PPC405-based
board (PPChameleonEVB).
The i2c-Algorithm driver is the i2c-algo-ibm_ocp.c and the i2c-adapter is
the i2c-adap-ibm_ocp.c
The problem is in timer_interrupt() function (/arch/ppc/kernel/time.c) with
CONFIG_RTC_11_MINUTE_MODE enabled.
Into this function there is a call to a ppc_md.set_rtc_time  that is a
pointer to a my set_rtc_device function that in turn
calls the i2c_master_send().
The problem is that kernel crashes (kenrel panic) when ppc_md.set_rtc_time
is called.
Debugging the coed,  I've seen that kernel crashes into iic_sendbytes()
function (i2c-algo-ibm_opc.c) .

After debugging inside of  iic_sendbytes() function I asked to me:

As in the time_interrupt() function, interrupt are disabled,
i2c-algo-ibm_ocp.c cannot work properly.

This would mean that a kernel that use  i2c-algo-ibm_ocp.c and a i2c
RTC-driver cannot work properly
with CONFIG_RTC_11_MINUTE_MODE!!!

Is this correct?

If yes, how can I solve my problem?




Matteo Bortolin

DAVE Srl


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with i2c-algo-ibm_ocp driver on ppc405 board
  2004-01-28  8:25 Problem with i2c-algo-ibm_ocp driver on ppc405 board Matteo Bortolin
@ 2004-01-28  9:14 ` Wolfgang Denk
  2004-01-28 10:24   ` Matteo Bortolin
  2004-01-28 18:16 ` Eugene Surovegin
  1 sibling, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2004-01-28  9:14 UTC (permalink / raw)
  To: Matteo Bortolin; +Cc: linuxppc-embedded, llandre


Dear Matteo,

in message <6.0.1.1.1.20040128085052.01b12d40@192.168.2.1> you wrote:
>
> This would mean that a kernel that use  i2c-algo-ibm_ocp.c and a i2c
> RTC-driver cannot work properly
> with CONFIG_RTC_11_MINUTE_MODE!!!
>
> Is this correct?

This is correct.  This  is  exactly  the  reason  why  we  added  the
CONFIG_RTC_11_MINUTE_MODE config option in our kernel tree - with the
official kernels you will ALWAYS crash, as there is no such option.

> If yes, how can I solve my problem?

Do not enable CONFIG_RTC_11_MINUTE_MODE?

Do you understand what 11 minute  mode  means?  And  do  you  really,
really  want  such  a  behaviour?  In  almost all cases I've seen the
accuracy of the external RTC was much better than that of the  system
clock.  In  such  a case you may either just set the system time from
the RTC at boot time (and then let  the  system  time  drift  out  of
sync),  or  run NTPD to keep the system time synced with the RTC (the
RTC being the normal). I have been told that there are  installations
where  the  11 minute mode is being used (and believed to be useful),
but I don't know any. Especially not in embedded systems.

Best regards,

Wolfgang Denk

--
See us @ Embedded World, Nuremberg, Feb 17 - 19,  Hall 12.0 Booth 440
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
The light at the end of the tunnel is usually a "No Exit" sign.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with i2c-algo-ibm_ocp driver on ppc405 board
  2004-01-28  9:14 ` Wolfgang Denk
@ 2004-01-28 10:24   ` Matteo Bortolin
  0 siblings, 0 replies; 4+ messages in thread
From: Matteo Bortolin @ 2004-01-28 10:24 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-embedded


At 10.14 28/01/2004, Wolfgang Denk wrote:

>Dear Matteo,
>
>in message <6.0.1.1.1.20040128085052.01b12d40@192.168.2.1> you wrote:
> >
> > This would mean that a kernel that use  i2c-algo-ibm_ocp.c and a i2c
> > RTC-driver cannot work properly
> > with CONFIG_RTC_11_MINUTE_MODE!!!
> >
> > Is this correct?
>
>This is correct.  This  is  exactly  the  reason  why  we  added  the
>CONFIG_RTC_11_MINUTE_MODE config option in our kernel tree - with the
>official kernels you will ALWAYS crash, as there is no such option.
>
> > If yes, how can I solve my problem?
>
>Do not enable CONFIG_RTC_11_MINUTE_MODE?
>
>Do you understand what 11 minute  mode  means?  And  do  you  really,
>really  want  such  a  behaviour?  In  almost all cases I've seen the
>accuracy of the external RTC was much better than that of the  system
>clock.  In  such  a case you may either just set the system time from
>the RTC at boot time (and then let  the  system  time  drift  out  of
>sync),  or  run NTPD to keep the system time synced with the RTC (the
>RTC being the normal). I have been told that there are  installations
>where  the  11 minute mode is being used (and believed to be useful),
>but I don't know any. Especially not in embedded systems.
>
>Best regards,
>
>Wolfgang Denk
>
>--
>See us @ Embedded World, Nuremberg, Feb 17 - 19,  Hall 12.0 Booth 440
>Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
>The light at the end of the tunnel is usually a "No Exit" sign.
>


thank you very much for your help!

Matteo Bortolin

DAVE Srl


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with i2c-algo-ibm_ocp driver on ppc405 board
  2004-01-28  8:25 Problem with i2c-algo-ibm_ocp driver on ppc405 board Matteo Bortolin
  2004-01-28  9:14 ` Wolfgang Denk
@ 2004-01-28 18:16 ` Eugene Surovegin
  1 sibling, 0 replies; 4+ messages in thread
From: Eugene Surovegin @ 2004-01-28 18:16 UTC (permalink / raw)
  To: Matteo Bortolin; +Cc: linuxppc-embedded, llandre


On Wed, Jan 28, 2004 at 09:25:40AM +0100, Matteo Bortolin wrote:
> I've developed an RTC driver that uses i2c core and for a PPC405-based
> board (PPChameleonEVB).
> The i2c-Algorithm driver is the i2c-algo-ibm_ocp.c and the i2c-adapter is
> the i2c-adap-ibm_ocp.c
> The problem is in timer_interrupt() function (/arch/ppc/kernel/time.c) with
> CONFIG_RTC_11_MINUTE_MODE enabled.
> Into this function there is a call to a ppc_md.set_rtc_time  that is a
> pointer to a my set_rtc_device function that in turn
> calls the i2c_master_send().
> The problem is that kernel crashes (kenrel panic) when ppc_md.set_rtc_time
> is called.
> Debugging the coed,  I've seen that kernel crashes into iic_sendbytes()
> function (i2c-algo-ibm_opc.c) .
>
> After debugging inside of  iic_sendbytes() function I asked to me:
>
> As in the time_interrupt() function, interrupt are disabled,
> i2c-algo-ibm_ocp.c cannot work properly.
>
> This would mean that a kernel that use  i2c-algo-ibm_ocp.c and a i2c
> RTC-driver cannot work properly
> with CONFIG_RTC_11_MINUTE_MODE!!!
>
> Is this correct?

Yes, i2c layer must be called from process context only,
timer_interrupt is IRQ context.

> If yes, how can I solve my problem?

Please, search mail list archives, there was _lengthly_ discussion
about this problem before, even some patches were posted.

Eugene

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-28 18:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-28  8:25 Problem with i2c-algo-ibm_ocp driver on ppc405 board Matteo Bortolin
2004-01-28  9:14 ` Wolfgang Denk
2004-01-28 10:24   ` Matteo Bortolin
2004-01-28 18:16 ` Eugene Surovegin

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).