[#3850] rcp, ftpd, USB Mass storage not working

Document created by Aaronwu Employee on Aug 28, 2013
Version 1Show Document
  • View in full screen mode

[#3850] rcp, ftpd, USB Mass storage not working

Submitted By: Michael Hennerich

Open Date

2008-01-23 03:38:43     Close Date

2008-03-17 18:47:28


Medium     Assignee:

Sonic Zhang


Closed     Fixed In Release:


Found In Release:

N/A     Release:



N/A     Board:



BF548     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:


Uboot version or rev.:

    Toolchain version or rev.:

App binary format:


Summary: rcp, ftpd, USB Mass storage not working



1)Compile a big Application, into the rootfs let's say Mplayer

2)Select FDPIC format

3)Increase genext2fs fs size in vendors Makefile to 18432 BLOCKS


Compile and run.


I notice that several things don't work as expected such as:

FTP into the board - it youst says CONNECT to .... but nothing happens then

RCP into the board - doesn't work


In case you enable USB Mass Storage.

You will see the SCSI messages and then just saying:

:sdb but no partion found...



I attached all files to this bug.


root:/> version

kernel:    Linux release, build #34 Wed Jan 23 11:25:49 CET 2008

toolchain: bfin-linux-uclibc-gcc release gcc version 4.1.2 (ADI svn)

user-dist: release svn-5752, build #700 Wed Jan 23 11:24:56 CET 2008






--- Robin Getz                                               2008-01-24 13:17:28

What chip are you trying things on? 548-EZkit?




--- Michael Hennerich                                        2008-01-24 14:20:57

Latest and greatest BF548-EZKIT (HW Rev. 1.3, BOM Rev 1.6, Silicon Rev. 0.1)

I don't think this is a HW related issue

- My guess - a memory allocation BUG.




--- Michael Hennerich                                        2008-01-25 07:14:00

I found that the issue is related to

/etc/rc: echo 20 > /proc/sys/vm/pagecache_ratio

In case I remove this command, the system works expected.


Also noticed that for the issue to occur, MUSB driver needs to be compiled in.




--- Mike Frysinger                                           2008-01-25 09:55:46

everything fixes itself or just the usb mass storage detection ?


--- Michael Hennerich                                        2008-01-28 03:34:32

Obviously for the Mass Storage Bug - MUSB needs to be enabled.


If you don't touch proc/sys/vm/pagecache_ratio all three issues are not seen.

In case I disable MUSB/USB - I also can't recreate the issues - however I think

it's directly related to USB - USB just adds some additional memory





--- Sonic Zhang                                              2008-02-25 02:12:23

A fixed cachepage_ratio value may not fit all kinds of application. How about

remove the default 20% in bf548 and ask user to set it when they want to run

fsck.ext2 and mplayer?


--- Michael Hennerich                                        2008-02-25 16:18:35

I’m pretty sure the limit pagecache support is not longer working correctly.

It prevents memory allocations to fail. It should just operate on file cache


See below how this should work.


As a side note – we’re not using this patch described below – we’re

using an initial try done by Aubrey and Roy.

Maybe we should implement Vaidyanathan approach.





"Hi Roy,


I have added a different pagecache reclaim logic around your

sysctl interface. This would ensure that only pagecache pages are

reclaimed if the limit is exceeded.




Pagecache pages in memory can be limited to a percentage of total

RAM using this patch.


New sysctl entry /proc/sys/vm/pagecache_ratio has been added that

holds the total percentage of RAM that the user wants as pagecache. 

The default percentage is 90.


Depending on the work load, any percentage value can be set to derive

optimum overall performance. Minimum is 5 and max is 100.


balance_pagecache() routine is called on file backed access and the

current pagecache_limit is checked against utilisation.


If the limit is exceeded, then shrink_all_pagecache_memory() is

called that will walk the LRU list and remove unmapped pagecache

pages.  New scancontrol fields have been added to make decisions

in shrink_page_list() and shrink_active_list().


Pages counted under pagecache limit are file pages that are not mapped. 

Shared memory is mapped and not counted in the limit.




echo 40 > /proc/sys/vm/pagecache_ratio

(that is around 400MB on a 1GB RAM machine)

dd if=/dev/zero of=/tmp/foo bs=1M count=1024


cat /proc/meminfo

The "Cached: xxx" count should hit the set limit and not consume all

available memory.


Any feedback is appreciated."


--- Sonic Zhang                                              2008-02-26 04:28:17



--- Mike Frysinger                                           2008-03-17 18:47:28

pagecache no longer in the kernel












File Name     File Type     File Size     Posted By

bugreport.tgz    application/x-compressed-tar    16370    Michael Hennerich

vendors.diff    text/x-patch    521    Michael Hennerich