Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#10798 - Unify ata_read_sectors and ata_write_sectors

Attached to Project: Rockbox
Opened by Torne Wuff (torne) - Sunday, 22 November 2009, 00:36 GMT+2
Last edited by Torne Wuff (torne) - Tuesday, 24 November 2009, 19:04 GMT+2
Task Type Patches
Category Operating System/Drivers
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

This patch unifies the ATA driver's read/write sector implementation. This should have no effect on reading, but has several functional changes to writing:

1) Writes will be retried if they fail, with the same timeout as reads.
2) Write errors which previously caused panics now return regular error codes (but the FAT code will panic anyway when it sees the error).
3) PIO writes are now done with multi-sector transfers, which should be a little faster.

This is intended to be a precursor, or perhaps a substitute, to submitting  FS#9721 .

This affects all players with regular ATA hard disks (anything that uses firmware/drivers/ata.c) and thus I'd like to see some test results from a number of players before committing it - testing with/without LBA48, with/without large physical sectors, and with/without DMA at a minimum...

Commentary on the actual code would also be welcomed...
   ata_unify_read_write_1.diff (9.8 KiB)
 firmware/drivers/ata.c |  265 ++++++++++++++-----------------------------------
 1 file changed, 78 insertions(+), 187 deletions(-)

This task depends upon

Closed by  Torne Wuff (torne)
Tuesday, 24 November 2009, 19:04 GMT+2
Reason for closing:  Fixed
Additional comments about closing:  r23740
Comment by Torne Wuff (torne) - Monday, 23 November 2009, 00:42 GMT+2
Renamed _readwrite_sectors to ata_transfer_sectors, and removed the extra layer of shim functions _read_sectors and _write_sectors on large physical sector builds, since they are already wrapped. No functional changes.
   ata_unify_read_write_2.diff (11.1 KiB)
 firmware/drivers/ata.c |  277 +++++++++++++------------------------------------
 1 file changed, 78 insertions(+), 199 deletions(-)

Comment by Torne Wuff (torne) - Monday, 23 November 2009, 01:03 GMT+2
Oops, spoke too soon, this version actually compiles on non-large-physical-sector builds.
   ata_unify_read_write_3.diff (11.1 KiB)
 firmware/drivers/ata.c |  277 +++++++++++++------------------------------------
 1 file changed, 78 insertions(+), 199 deletions(-)

Loading...