• Bartlomiej Zolnierkiewicz's avatar
    serverworks: always tune CSB6 · b740d884
    Bartlomiej Zolnierkiewicz authored
    Switch the driver to always program DMA/PIO timings and set device transfer
    mode instead of trusting BIOS on CSB6 controllers (libata pata_serverworks.c
    driver is also doing things this way and there were no problems reported so
    far).  While doing conversion I noticed that the old code had many issues:
    
    * the code was assuming that hwif->dma_status is always valid
      (which obviously isn't true if hwif->dma_base == NULL)
    
    * value of "(ultra_timing >> (4*unit)) & ~(0xF0)" expression wasn't checked
      to fit into udma_modes[5]
    
    * code validating DMA timings didn't validate corresponding PIO timings
    
    * extra CSB5 PIO register wasn't validated et all
    
    * hwif->ide_dma_off_quietly() is always called before ide_set_dma() (which in
      turn calls hwif->speedproc() method - svwks_tune_chipset() in this case)
      so the code depending on DMA capable bit of DMA status to be set was never
      executed (=> the code was never validating DMA timings despite actually
      enabling DMA if the PIO timings were OK!)
    
    * on resume driver dependend entirely on BIOS to restore timings and set
      transfer mode on the device
    
    While at it:
    
    There is no need to read PIO/MWDMA timings now so don't do it.
    Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
    Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
    b740d884
serverworks.c 15.3 KB