• A
    libata: cable detection fixes · be0d18df
    Alan Cox 提交于
    2.6.21-rc has horrible problems with libata and PATA cable types (and
    thus speeds). This occurs because Tejun fixed a pile of other bugs and
    we now do cable detect enforcement for drive side detection properly.
    
    Unfortunately we don't do the process around cable detection right. Tejun
    identified the problem and pointed to the right Annex in the spec, this patch
    implements the rest of the needed changes.
    
    We add a ->cable_detect() method called after the identify
    sequence which allows a host to do host side detection at this point
    should it wish, or to modify the results of the drive side identify.
    
    This separate ->cable_detect method also cleans up a lot of code because
    many drivers have their own error_handler methods which really just set
    the cable type.
    
    If there is no ->cable_detect method the cable type is left alone so a
    driver setting it earlier (eg because it has the SATA flags set or
    because it uses the old error_handler approach) will still do the right
    thing (or at least the same thing) as before.
    
    This patch simply adds the cable_detect method and helpers it doesn't use
    them but other follow up patches will (ie Adrian please don't submit
    patches to unexport them ;))
    Signed-off-by: NAlan Cox <alan@redhat.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NJeff Garzik <jeff@garzik.org>
    be0d18df
libata.h 37.5 KB