1
0
Fork 0
forked from len0rd/rockbox
foxbox/firmware/target/arm
Michael Sevakis 1654efc313 Unify storage threads into one
* Editing a bunch of drivers' thread routines in order to
implement a new feature is tedious.

* No matter the number of storage drivers, they share one thread.
No extra threads needed for CONFIG_STORAGE_MULTI.

* Each has an event callback called by the storage thread.

* A default callback is provided to fake sleeping in order to
trigger idle callbacks. It could also do other default processing.
Changes to it will be part of driver code without editing each
one.

* Drivers may sleep and wake as they please as long as they give
a low pulse on their storage bit to ask to go into sleep mode.
Idle callback is called on its behalf and driver immediately put
into sleep mode.

* Drivers may indicate they are to continue receiving events in
USB mode, otherwise they receve nothing until disconnect (they
do receive SYS_USB_DISCONNECTED no matter what).

* Rework a few things to keep the callback implementation sane
and maintainable. ata.c was dreadful with all those bools; make
it a state machine and easier to follow. Remove last_user_activity;
it has no purpose that isn't served by keeping the disk active
through last_disk_activity instead.

* Even-out stack sizes partly because of a lack of a decent place
to define them by driver or SoC or whatever; it doesn't seem too
critical to do that anyway. Many are simply too large while at
least one isn't really adequate. They may be individually
overridden if necessary (figure out where). The thread uses the
greatest size demanded. Newer file code is much more frugal with
stack space. I barely see use crack 50% after idle callbacks
(usually mid-40s). Card insert/eject doesn't demand much.

* No forcing of idle callbacks. If it isn't necessary for one or
more non-disk storage types, it really isn't any more necessary for
disk storage. Besides, it makes the whole thing easier to implement.

Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-10-26 14:35:41 -04:00
..
archos/av300 button-target.h : move prototypes to button.h 2012-01-08 00:07:19 +00:00
as3525 Unify storage threads into one 2017-10-26 14:35:41 -04:00
at91sam Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
imx31 Unify storage threads into one 2017-10-26 14:35:41 -04:00
imx233 Unify storage threads into one 2017-10-26 14:35:41 -04:00
ipod nano2g: fix dangerous mutex in hold switch 2017-02-04 16:30:08 +01:00
iriver Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
olympus Fix red/yellow 2015-01-12 12:02:24 +01:00
pbell Fix red/yellow round #2 2015-01-12 13:25:14 +01:00
philips HDD16X0/HDD63X0: Enable power status of charging from USB. 2016-10-02 23:30:30 +02:00
pnx0101 Do some housekeeping with fat.h and SECTOR_SIZE 2017-03-12 22:05:44 -04:00
pp Unify storage threads into one 2017-10-26 14:35:41 -04:00
rk27xx Unify storage threads into one 2017-10-26 14:35:41 -04:00
s3c2440 Unify storage threads into one 2017-10-26 14:35:41 -04:00
s5l8700 Unify storage threads into one 2017-10-26 14:35:41 -04:00
s5l8702 Unify storage threads into one 2017-10-26 14:35:41 -04:00
samsung Samsung YH92X: Remove unneeded line. 2016-01-12 21:02:16 +01:00
sandisk Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
tatung Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
tcc77x Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
tcc780x Unify storage threads into one 2017-10-26 14:35:41 -04:00
tms320dm320 Unify storage threads into one 2017-10-26 14:35:41 -04:00
ata-as-arm.S FS#11335 by me: make ARM assembly functions thumb-friendly 2010-06-11 04:41:36 +00:00
ata-nand-telechips.c Unify storage threads into one 2017-10-26 14:35:41 -04:00
bits-armv4.S Do some things to make -ffunction-sections work better. 2011-12-17 01:43:32 +00:00
bits-armv6.S Do some things to make -ffunction-sections work better. 2011-12-17 01:43:32 +00:00
crt0.S arm: factor all exception handlers out of the crt0.S files 2012-04-06 13:46:32 +02:00
i2c-telechips.c Remove bad mutex_* calls in telechips i2c driver 2017-08-10 21:53:55 -04:00
lcd-c200_c200v2.c lcd drivers: Convert lcd_[remote_]framebuffer to a pointer 2012-02-28 11:44:59 +11:00
lcd-ssd1815.c lcd drivers: Convert lcd_[remote_]framebuffer to a pointer 2012-02-28 11:44:59 +11:00
mmu-arm.h Commit to certain names for cache coherency APIs and discard the aliases. 2011-12-17 07:27:24 +00:00
mmu-arm.S imx233: define HAVE_TEST_AND_CLEAN_CACHE 2012-06-07 14:48:43 +02:00
mmu-armv6.S Commit to certain names for cache coherency APIs and discard the aliases. 2011-12-17 07:27:24 +00:00
pcm-telechips.c Fix errors in unintentionally merged gerrit commit. 2012-03-03 01:45:09 -05:00
powermgmt-ascodec.c AMSv2: add proper definitions for charge current 2012-03-04 12:23:05 +01:00
system-arm.c Initial commit for the Sony NWZ linux port 2017-09-05 21:42:12 +02:00
system-arm.h Add CPU mode asserts to kernel on blocking functions. 2017-01-21 14:25:52 -05:00
uc870x.c iPod Classic: updates for uc8702 driver 2016-05-13 23:21:42 +02:00
usb-designware.c Introduce new USB driver for Synopsys DesignWare USB OTG core. 2016-08-02 04:57:49 +02:00
usb-drv-arc.c Get rid of usb_drv_attach() from USB code. 2013-05-14 22:13:38 -04:00
usb-s3c6400x.c usb-s3c6400x: prevent calling usb_enable(enable) twice on USB insert 2016-03-18 14:55:53 +01:00
usb-tcc.c usb-target.h: remove 2011-12-31 18:44:55 +00:00
wmcodec-telechips.c