public inbox for ecos-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug 1001879] Kinetis DSPI infinite polling
  2013-07-09 17:54 [Bug 1001879] New: Kinetis DSPI infinite polling bugzilla-daemon
@ 2013-07-09 17:54 ` bugzilla-daemon
  2013-07-09 20:52 ` bugzilla-daemon
  2013-07-09 23:09 ` bugzilla-daemon
  2 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-07-09 17:54 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001879

Mike Jones <mjones@linear.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #2322|0                           |1
           is patch|                            |
   Attachment #2322|application/octet-stream    |text/plain
          mime type|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.


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

* [Bug 1001879] New: Kinetis DSPI infinite polling
@ 2013-07-09 17:54 bugzilla-daemon
  2013-07-09 17:54 ` [Bug 1001879] " bugzilla-daemon
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-07-09 17:54 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001879

            Bug ID: 1001879
           Summary: Kinetis DSPI infinite polling
           Product: eCos
           Version: CVS
            Target: freescale_twr_k70f120m (Freescale Kinetis TWR-K70F120M
                    board)
  Architecture/Host Cortex-M
                OS:
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: SPI
          Assignee: unassigned@bugs.ecos.sourceware.org
          Reporter: mjones@linear.com
                CC: ecos-bugs@ecos.sourceware.org

Created attachment 2322
  --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2322&action=edit
DSPI Polling Patch

I believe I have found the source of all my intermittent MMC/SD problems
discussed in bug 10011764. (Note, this does not apply to the 4GB Samsung Card
issue) I was fortunate to finally have a persistent failure that I could debug.

The problem is related to polling in file api_freescale_spi.c.

There is a function called dspi_transaction_end(...) and this function has the
following code:

DSPI_EOQ_CLEAR(dspi_p);
while(!(dspi_p->sr & FREESCALE_DSPI_SR_EOQF_M));

Sometimes execution hangs on the while.

I believe the problem is that the clear sometimes clears before the bit is set,
and sometimes it clears after. There is a race condition between the code and
the peripheral.

I believe the code should be:

while(!(dspi_p->sr & FREESCALE_DSPI_SR_EOQF_M));
DSPI_EOQ_CLEAR(dspi_p);

which clears the bit after the polling is satisfied.

As soon as I made this change, all my problems disappeared. I verified that my
application can now read/write the SD. My application that logs telemetry to SD
will now run for a long time without failure. I retested several SD cards and
they are fine.

-- 
You are receiving this mail because:
You are the assignee for the bug.


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

* [Bug 1001879] Kinetis DSPI infinite polling
  2013-07-09 17:54 [Bug 1001879] New: Kinetis DSPI infinite polling bugzilla-daemon
  2013-07-09 17:54 ` [Bug 1001879] " bugzilla-daemon
@ 2013-07-09 20:52 ` bugzilla-daemon
  2013-07-09 23:09 ` bugzilla-daemon
  2 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-07-09 20:52 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001879

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |ilijak@siva.com.mk
     Ever confirmed|0                           |1

--- Comment #1 from Ilija Kocho <ilijak@siva.com.mk> ---
Thank you Mike,

Coincidently, I found out the same bug y-day, by performing a version of your
MMC stress test.

Checked in.

Ilija

-- 
You are receiving this mail because:
You are the assignee for the bug.


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

* [Bug 1001879] Kinetis DSPI infinite polling
  2013-07-09 17:54 [Bug 1001879] New: Kinetis DSPI infinite polling bugzilla-daemon
  2013-07-09 17:54 ` [Bug 1001879] " bugzilla-daemon
  2013-07-09 20:52 ` bugzilla-daemon
@ 2013-07-09 23:09 ` bugzilla-daemon
  2 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-07-09 23:09 UTC (permalink / raw)
  To: unassigned

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001879

Ilija Kocho <ilijak@siva.com.mk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |CURRENTRELEASE

--- Comment #2 from Ilija Kocho <ilijak@siva.com.mk> ---
It seem that I clicked wrong option. Should have been "resolved".

-- 
You are receiving this mail because:
You are the assignee for the bug.


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

* [Bug 1001879] New: Kinetis DSPI infinite polling
@ 2013-07-09 17:54 bugzilla-daemon
  0 siblings, 0 replies; 5+ messages in thread
From: bugzilla-daemon @ 2013-07-09 17:54 UTC (permalink / raw)
  To: ecos-bugs

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001879

            Bug ID: 1001879
           Summary: Kinetis DSPI infinite polling
           Product: eCos
           Version: CVS
            Target: freescale_twr_k70f120m (Freescale Kinetis TWR-K70F120M
                    board)
  Architecture/Host Cortex-M
                OS:
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: SPI
          Assignee: unassigned@bugs.ecos.sourceware.org
          Reporter: mjones@linear.com
                CC: ecos-bugs@ecos.sourceware.org

Created attachment 2322
  --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2322&action=edit
DSPI Polling Patch

I believe I have found the source of all my intermittent MMC/SD problems
discussed in bug 10011764. (Note, this does not apply to the 4GB Samsung Card
issue) I was fortunate to finally have a persistent failure that I could debug.

The problem is related to polling in file api_freescale_spi.c.

There is a function called dspi_transaction_end(...) and this function has the
following code:

DSPI_EOQ_CLEAR(dspi_p);
while(!(dspi_p->sr & FREESCALE_DSPI_SR_EOQF_M));

Sometimes execution hangs on the while.

I believe the problem is that the clear sometimes clears before the bit is set,
and sometimes it clears after. There is a race condition between the code and
the peripheral.

I believe the code should be:

while(!(dspi_p->sr & FREESCALE_DSPI_SR_EOQF_M));
DSPI_EOQ_CLEAR(dspi_p);

which clears the bit after the polling is satisfied.

As soon as I made this change, all my problems disappeared. I verified that my
application can now read/write the SD. My application that logs telemetry to SD
will now run for a long time without failure. I retested several SD cards and
they are fine.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2013-07-09 23:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-09 17:54 [Bug 1001879] New: Kinetis DSPI infinite polling bugzilla-daemon
2013-07-09 17:54 ` [Bug 1001879] " bugzilla-daemon
2013-07-09 20:52 ` bugzilla-daemon
2013-07-09 23:09 ` bugzilla-daemon
  -- strict thread matches above, loose matches on Subject: below --
2013-07-09 17:54 [Bug 1001879] New: " bugzilla-daemon

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 read-only IMAP folder(s) and NNTP newsgroup(s).