• Jeff Garzik's avatar
    [libata sata_sil] Re-fix mod15write bug · 48c1a573
    Jeff Garzik authored
    Certain early SATA drives have problems with write requests whose
    length satisfy the equation "sectors % 15 == 1", on the SiI 3112.
    Other drives, and other SiI controllers, are not affected.
    
    The fix for this problem is to avoid such requests, in one of three
    ways, for the affect drive+controller combos:
    1) Limit all writes to 15 sectors
    2) Use block layer features to avoid creating requests whose
       length satisfies the above equation.
    3) When a request satisfies the above equation, split the request
       into two writes, neither of which satisfies the equation.
    
    I chose fix #1, the most simple to implement.  After discussion with
    Silicon Image and others regarding the impact of this fix, I have
    decided to remain with fix #1, and will not be implementing a
    "better fix".  This means that the affected SATA drives will see
    decreased performance, but set of affected drives is small and will
    never grow larger.
    
    Further, the complexity of implementing solution #2 or
    solution #3 is rather large.
    
    When implementing lba48 'large request' support, I unintentionally
    broke the fix for these affected drives.  Kudos to Ricky Beam for
    noticing this.
    
    This change restores the fix, by adding a flag ATA_DFLAG_LOCK_SECTORS
    to indicate that the max_sectors value set by the low-level driver
    should never be changed.
    48c1a573
sata_sil.c 12.5 KB