SV: A few questions about SD/MMC drivers

Ian Lepore ian at freebsd.org
Wed Dec 28 18:22:20 UTC 2016


[trimming the CC list to just the poster and the embedded list]

On Fri, 2016-12-23 at 21:25 +0000, tony moseby via freebsd-embedded
wrote:
> Hello Ian,
> I can read that you have been involved in a similar problem that I am
> facing now.I am running FreeBSD 8.2 and a armv5TE (marvel mv78100), I
> have an ssd disk(4Giga).While running the system and doing disk
> acesses  after sometime (can be days or at least several hours)the
> system total freezes.Serial port freezes and  ethernet freezes.(just
> internal connections, no public).
> If I do not use the disk, this(the freeze) do not occur.My watchdog
> is disabled , so I am suspecting that the kernel crashes and that is
> the cause of the freeze.I connected an emulator to  the board, but
> whenever the freeze occur,the emulator looses also contactwith the
> CPU.I have tested to do a lot of read/write towards the ssd,often
> this also causes freeze, but for a coupleof times I can see the
> kernel crashing with alignment fault 1.Do you have any
> ideas?ThanksBR/T
> 
> 

We use 8.2 on a marvel Kirkwood 88F6281 at $work.  I've used it with an
ssd connected by usb, and connected by eSata, and have not seen the
problem you report, even when using Poudriere to build packages on that
machine, which uses the ssd drive for 18+ hours nonstop.

But I have seen the problem you report on every version of freebsd
later than 8.2 on armv4 and armv5 systems (which is why we still use
8.2 at work).  Our 8.2 isn't stock, we've pulled dozens of fixes from
later versions of freebsd into our repo.  I suppose that one of those
fixes might have helped the problem, but figuring out which one is
probably impossible.

I also spent many hours trying to get freebsd 10 and/or 11 to work
reliably on armv4/v5 without alignment faults related to disk IO, and
failed to ever track down what part of the system is using an unaligned
buffer.  It may be that the real problem isn't a simple unaligned
buffer, but maybe a wild pointer or other programming error.

An interesting thing to try is building the kernel with option 
ARM9_CACHE_WRITE_THROUGH.  We don't routinely do that, but when that
option makes a problem stop happening, that's a strong clue that busdma
cache coherency is part of the problem.

Another kernel option that you should be using if you use USB is 

 option USB_HOST_ALIGN=32

I've looked through all the fixes we've applied locally to 8.2 and
found some that are likely to be related to alignment faults, or should
just be helpful to anyone running armv5 on 8.2.  I'm attaching a set of
patches for you, maybe some or all of these will help your situation.
 Our starting snapshot that all these patches are based on is stable-8
at r223364.

-- Ian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busdma_intr.diff
Type: text/x-patch
Size: 14478 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20161228/7a529253/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disabled_icache_fix.diff
Type: text/x-patch
Size: 2425 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20161228/7a529253/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: minalloc.diff
Type: text/x-patch
Size: 2249 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20161228/7a529253/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ras_init.diff
Type: text/x-patch
Size: 3383 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20161228/7a529253/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rasfix.diff
Type: text/x-patch
Size: 6906 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20161228/7a529253/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stackprot_fix.diff
Type: text/x-patch
Size: 1510 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-embedded/attachments/20161228/7a529253/attachment-0005.bin>


More information about the freebsd-embedded mailing list