1. 09 Jul, 2007 10 commits
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add short cables support · 49521f97
      Bartlomiej Zolnierkiewicz authored
      This patch allows users to override both host and device side cable detection
      with "ideX=ata66" kernel parameter.  Thanks to this it should be now possible
      to use UDMA > 2 modes on systems (laptops mainly) which use short 40-pin cable
      instead of 80-pin one.
      
      Next patches add automatic detection of some systems using short cables.
      
      Changes:
      
      * Rename hwif->udma_four to hwif->cbl and make it u8.
      
      * Convert all existing users accordingly (use ATA_CBL_* defines while at it).  
      
      * Add ATA_CBL_PATA40_SHORT support to ide-iops.c:eighty_ninty_three().
      
      * Use ATA_CBL_PATA40_SHORT for "ideX=ata66" kernel parameter.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Reviewed-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      49521f97
    • Bartlomiej Zolnierkiewicz's avatar
      ide: convert ide_find_best_mode() users to use ide_max_dma_mode() · 75b1d975
      Bartlomiej Zolnierkiewicz authored
      ide-timing.h:
      
      * remove handling of DMA modes from ide_find_best_mode() and rename it to
        ide_find_best_pio_mode()
      
      * drop no longer needed "map" argument from ide_find_best_pio_mode()
        and delete needless ->id check
      
      * remove no longer needed XFER_SWDMA and XFER_UDMA* defines
      
      au1xxx-ide.c:
      
      * use ide_max_dma_mode() instead of ide_find_best_mode()
      
      * remove needless CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA #ifdef
      
      amd74xx.c:
      
      * store UDMA masks in amd_ide_chip[] and while at it make "base" field
        to be u8 instead of unsigned long
      
      * convert the driver to use UDMA masks from amd_ide_chip[]
      
      * use ide_max_dma_mode() and ide_find_best_pio_mode() instead
        of ide_find_best_mode()
      
      * delete stale comment from amd74xx_ide_dma_check()
      
      * remove no longer needed AMD_UDMA* defines
      
      via82cxxx.c:
      
      * remove unused DISPLAY_VIA_TIMINGS define
      
      * store UDMA masks in via_isa_bridges[] and while at it make "flags" field
        to be u8 instead of u16
      
      * convert the driver to use UDMA masks from via_isa_bridges[]
      
      * use ide_max_dma_mode() and ide_find_best_pio_mode() instead
        of ide_find_best_mode()
      
      * remove no longer needed VIA_UDMA* defines
      
      pmac.c:
      
      * use ide_max_dma_mode() instead of ide_find_best_mode()
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      Reviewed-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      75b1d975
    • Sergei Shtylyov's avatar
      aec62xx: kill speedproc() method wrapper (take 2) · 6d78013b
      Sergei Shtylyov authored
      There's no reason to have the speedproc() method wrapper for the two quite
      different chip families, so just get rid of it.
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      6d78013b
    • Sergei Shtylyov's avatar
      aec62xx: remove init_dma() method (take 2) · 1b9da32a
      Sergei Shtylyov authored
      Get rid of the init_dma() method (which had no particular reason to exist) by
      folding it into the init_hwif() method. While at it, also perform some cleanup
      in the latter method:
      
      - get rid of the useless clearing of hwif->autodma;
      
      - fold the serialization code into one 'if' statement;
      
      - fold setting the drives' 'autotune' and 'autodma' fields into the single
        statements...
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      1b9da32a
    • Sergei Shtylyov's avatar
      aec62xx: rework init_setup_aec6x80() · b1d19db4
      Sergei Shtylyov authored
      Rework init_setup_aec6x80() so that it won't rewrite the constant name strings
      anymore -- in order to do this:
      
      - in aec62xx_init_one(), pass a local copy of 'struct pci_device_id' down the
        call chain;
      
      - change the names for in aec62xx_chipsets[] to default to AEC-6280[R];
      
      - override the 'name' field in init_setup_aec6x80() only if bit 4 of the DMA
        status register is set.
      
      While at it, also change the 'udma_mask' field for AEC-6x80R chips in this
      function and remove the code doing the same from the init_hwif() method...
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b1d19db4
    • Sergei Shtylyov's avatar
      cmd64x: init. code cleanup · 83a6d4ab
      Sergei Shtylyov authored
      Fix two minor issues with PCI0646 chip reporting in the init_chipset() method:
      "IRQ workaround enabled" message printed out not only for revision 0x01 and
      "CMD646: chipset revision" printed twice (by IDE core and the driver itself).
      Also, remove empty/pointless switch cases for the chips other than PCI0646,
      duplicate write to the MRDMODE register when enabling interrupts and MEMORY
      READ LINE cycles, and needless/misplaced initialization of the timing registers
      in this method.
      Switch to reading only the PCI revision ID register itself, not the whole 32
      bits at its address in init_chipset() and init_hwif() methods; in addition,
      get rid of the useless clearing of hwif->autodma and perform some cosmetic
      style changes in the latter method.
      Refactor ata66_cmd64x() by moving all the code into the 'switch' statement,
      renaming/adding variables, and fixing the coding style.
      While at it, finally get rid of the meaningless aliasing register #define's...
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      83a6d4ab
    • Sergei Shtylyov's avatar
      hpt366: simplify UltraDMA filtering (take 4) · 2648e5d9
      Sergei Shtylyov authored
      Simplify UltraDMA mode filtering in the driver:
      
      - make use of the newly introduced 'udma_mask' field of 'ide_pci_device_t' to
        set the correct hwif->ultra_mask, modifying init_setup_hpt366() to select
        the correct mask based on the chip revision;
      
      - replace 'max_mode' field of the 'struct hpt_info' with 'max_ultra' specifying
        the maximum UltraDMA mode allowed;
      
      - rewrite hpt3xx_udma_filter() to differ the filters based on the 'chip_type'
        field, and only use it for HPT366 and HPT370[A] where it's really necessary.
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      2648e5d9
    • Sergei Shtylyov's avatar
      ide: make void and rename ide_dma_timeout() method · c283f5db
      Sergei Shtylyov authored
      Since ide_dma_timeout() method's result is discarded, make it return 'void'.
      While at it, drop 'ide_' from the method's name, drop the '__' prefix from
      the default method's name, and do some cleanups in this method driver-wise:
      
      - in ide-dma.c, au1xxx-ide.c, and pdc202xx_old.c, define/use 'hwif' variable;
      
      - in au1xxx-ide.c, get rid of commented out printk();
      
      - in sl82c105.c, get rid of unnecessary variables.
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c283f5db
    • Sergei Shtylyov's avatar
      ide: make void and rename ide_dma_lostirq() method · 841d2a9b
      Sergei Shtylyov authored
      Since ide_dma_lostirq() method's result is discarded, make it return 'void'.
      While at it, rename the method to dma_lost_irq(), drop the '__' prefix from the
      default method's name, and do some cleanups in this method driver-wise:
      
      - in aec62xx.c, rename the method in accordance with other drivers, and get rid
        of unnecessary variables there;
      
      - in pdc202xx_old.c, define/use 'hwif' variable;
      
      - in sgiioc4.c, rearrange the code to call the resetproc() method directly.
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      841d2a9b
    • 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
  2. 08 Jul, 2007 1 commit
    • Uwe Koziolek's avatar
      sis5513: adding PCI-ID · 4c6c914e
      Uwe Koziolek authored
      The SiS966 has one additional PCI-ID 1180.
      
      If the chipset is using this PCI-ID, the primary channel is connected to the
      first PATA-port. The secondary channel is connected to SATA-ports in IDE
      emulation mode.  The legacy IO-ports are used.
      
      The including of the PCI-ID into pata_sis is not sufficient, because the legacy
      driver in drivers/ide is initialized before pata_sis.
      Signed-off-by: default avatarUwe Koziolek <uwe.koziolek@gmx.net>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4c6c914e
  3. 03 Jul, 2007 5 commits
  4. 08 Jun, 2007 6 commits
    • Peer Chen's avatar
      ide: Add the MCP73/77 support to PATA driver · c1183a33
      Peer Chen authored
      Add the MCP73/MCP77 support to PATA driver.
      
      bart: Added amd74xx_chipsets[] and amd_pci_tbl[] entries.
      bart: Bumped driver version.
      Signed-off-by: default avatarPeer Chen <peerchen@gmail.com>
      Cc: Alan Cox <alan@redhat.com>,
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c1183a33
    • Sergei Shtylyov's avatar
      hpt366: disallow Ultra133 for HPT374 · 278978e9
      Sergei Shtylyov authored
      Eliminate UltraATA/133 support for HPT374 -- the chip isn't capable of this mode
      according to the manual, and doesn't even seem to tolerate 66 MHz DPLL clock...
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Geller Sandor <wildy@petra.hos.u-szeged.hu>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      278978e9
    • Jiri Slaby's avatar
      ide: generic IDE PCI driver, add another device exception · ea307596
      Jiri Slaby authored
      generic IDE PCI driver, add another device exception
      
      This device is char device and is grabbed by generic ide driver:
      00:0b.0 Class ffff: National Semiconductor Corporation 87410 IDE (rev ff) (prog-if ff)
      	Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
      
      Disallow generic IDE PCI driver to grab it by adding next condition. Also
      consolidate exceptions to one bigger 'switch (dev->vendor)'.
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Cc: Ingo Korb <ml@akana.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ea307596
    • Bartlomiej Zolnierkiewicz's avatar
      it821x: RAID mode fixes · 0380dad4
      Bartlomiej Zolnierkiewicz authored
      The DMA support for RAID mode broke after:
      
      	commit 71ef51cc
      	Author: Jens Axboe <axboe@suse.de>
      	Date:   Fri Jul 28 09:02:17 2006 +0200
      
      	    [PATCH] it821x: fix ide dma setup bug
      
      	    Only enable dma for a valid speed setting.
      
      	    Signed-off-by: Jens Axboe <axboe@suse.de>
      
      	commit 0a8348d0
      	Author: Jens Axboe <axboe@suse.de>
      	Date:   Fri Jul 28 08:58:26 2006 +0200
      
      	    [PATCH] ide: if the id fields looks screwy, disable DMA
      
      	    It's the safer choice. Originally due to a bug in itx821x, but a
      	    generally sound thing to do.
      
      	    Signed-off-by: Jens Axboe <axboe@suse.de>
      
      However it worked by pure luck before Jens' fixes: bogus ide_dma_enable()
      usage in it821x driver combined with loosy check in ide_dma_verbose() allowed
      the hardware to operate in DMA mode.  When these problems were fixed the DMA
      support broke...
      
      The source root for the regression turned out to be that the it821x.c code
      was clearing too much of id->field_valid.  The IDE core code was using the
      original value of id->field_valid to do the tuning but later DMA got disabled
      in ide_dma_verbose() because of the incorrect id->field_valid fixup.  Fix it.
      
      While at it:
      
      * Do fixup() after probing the drives but before tuning them (which is also
        OK w.r.t. ide_undecoded_slave() fixup).  This change fixes device IDENTIFY
        data to be consistent before/after the tuning and allows us to remove extra
        re-tuning of drives from it821x_fixups().
      
      * Fake MWDMA0 enabled/supported bits in IDENTIFY data if the device has
        DMA capable bit set (this is just to tell the IDE core that DMA is
        supported since it821x firmware takes care of DMA mode programming).
      
      * Don't touch timing registers and don't program transfer modes on devices
        et all when in RAID mode - depend solely on firmware to do the tuning
        (as suggested by Alan Cox and done in libata pata_it821x driver).
      
      Thanks for testing the patch goes out to Thomas Kuther.
      
      Cc: Thomas Kuther <gimpel@sonnenkinder.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Jens Axboe <axboe@suse.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      0380dad4
    • Bartlomiej Zolnierkiewicz's avatar
      serverworks: fix CSB6 tuning logic · 1abb8a8b
      Bartlomiej Zolnierkiewicz authored
      Problem noticed by Joe Zbiciak, see
      
      	http://kerneltrap.org/node/8252
      
      for details.
      
      On CSB6 the driver is using BIOS settings and not programming DMA/PIO timings
      itself.  However the logic was completely broken and resulted in wrong timings
      being silently allowed (instead of being corrected by the driver).
      
      This bug would explain some data corruption/timeout issues with Serverworks
      MegaIDE in RAID mode that Alan Cox has fixed recently with:
      
      http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2074a106f52b6371885afbd714e929d60d0e3f64
      
      For 2.6.23 we may be better off with completely switching the driver to always
      programming timings (libata pata_serverworks.c driver is doing things this way
      and there were no problems reported so far) but for 2.6.22 lets fix the bug
      in the simplest and the least intrusive way.
      
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      1abb8a8b
    • Bartlomiej Zolnierkiewicz's avatar
      serverworks: remove crappy code · ed84fad5
      Bartlomiej Zolnierkiewicz authored
      Remove crappy code noticed by Linus, see
      
      	http://lkml.org/lkml/2007/5/23/476
      
      for details.
      
      While at it simplify logic a bit.
      
      There should be no functionality changes caused by this patch.
      
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ed84fad5
  5. 23 May, 2007 3 commits
  6. 15 May, 2007 12 commits
    • Alan Cox's avatar
      sl82c105: Switch to ref counting API · 640b31bf
      Alan Cox authored
      Not sure how this one got missed in the great purge some time ago but it did.
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      640b31bf
    • Bartlomiej Zolnierkiewicz's avatar
      ide: remove ide_dma_enable() · 4728d546
      Bartlomiej Zolnierkiewicz authored
      * check ->speedproc return value in ide_tune_dma()
      * use ide_tune_dma() in cmd64x/cs5530/sc1200/siimage/sl82c105/scc_pata drivers
      * remove no longer needed ide_dma_enable()
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4728d546
    • Sergei Shtylyov's avatar
      sl82c105: add speedproc() method and MWDMA0/1 support · 46cedc9b
      Sergei Shtylyov authored
      Add the speedproc() method for setting transfer modes, modify config_for_dma()
      to call it and use ide_max_dma_mode() to select the best DMA mode.
      Add support for the multiword DMA modes 0 and 1, using the upper half of the
      'drive_data' field to store the DMA timings to program into the drive control
      register when DMA is turned on for real.
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      46cedc9b
    • Bartlomiej Zolnierkiewicz's avatar
      cs5530/sc1200: add ->speedproc support · 3c3f5d2c
      Bartlomiej Zolnierkiewicz authored
      * add {cs5530,sc1200}_tunepio() for programming PIO timings
      
      * add {cs5530,sc1200}_tune_chipset() (->speedproc method) for setting
        transfer mode and convert {cs5530,sc1200}_config_dma() to use it
      
      * bump driver version
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3c3f5d2c
    • Bartlomiej Zolnierkiewicz's avatar
      cs5530/sc1200: DMA support cleanup · a01ba401
      Bartlomiej Zolnierkiewicz authored
      sc1200.c:
      
      * remove open-coded variant of ide_dma_host_off() (== ->dma_host_off),
        it is not needed because ->dma_off_quietly calls ->dma_host_off
      
      * use ->dma_host_on (== ide_dma_host_on() for this driver) instead of
        open-coded variant, call it from the users of sc1200_config_dma2()
      
        [ there is no need to call ->dma_host_on in sc1200_config_dma() because
          core code takes care of calling ->ide_dma_on on successful execution
          of ->ide_dma_check ]
      
      * add comment about ->tuneproc interface abuse
      
      cs5530.c/sc1200.c:
      
      * core code takes care of calling ->dma_off_quietly before calling
        ->ide_dma_check so there is no need to call it in ->ide_dma_check methods
      
      * bump driver version
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      a01ba401
    • Bartlomiej Zolnierkiewicz's avatar
      ide: use ide_tune_dma() part #2 · bd203b57
      Bartlomiej Zolnierkiewicz authored
      Use ide_tune_dma() in ide-cris/it821x/pdc202xx_old/serverworks drivers.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      bd203b57
    • Bartlomiej Zolnierkiewicz's avatar
      cs5530/sc1200: add ->udma_filter methods · 5fd216bb
      Bartlomiej Zolnierkiewicz authored
      CS5530/SC1200 specifies that two drives on the same cable cannot mix
      UDMA/MDMA.  Add {cs5530,sc1200}_udma_filter() to handle this.  This also
      makes it possible to remove open-coded best DMA mode selection and use
      standard ide_use_dma()/ide_max_dma_mode() helpers.  While at it bump
      version numbers.
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      5fd216bb
    • Bartlomiej Zolnierkiewicz's avatar
      pdc202xx_new: use ide_tune_dma() · 7f86723a
      Bartlomiej Zolnierkiewicz authored
      * remove code enabling IORDY and prefetch from config_chipset_for_dma(),
        as the comment states it has no real effect because these settings are
        overriden when the PIO mode is set (and for this driver ->autotune == 1
        so PIO mode is always programmed)
      
      * use ide_tune_dma() in pdcnew_config_drive_xfer_rate() and remove no longer
        needed config_chipset_for_dma()
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7f86723a
    • Bartlomiej Zolnierkiewicz's avatar
      alim15x3: use ide_tune_dma() · 38ff8a74
      Bartlomiej Zolnierkiewicz authored
      Use ide_tune_dma() in ali15x3_config_drive_for_dma() and remove all the open
      coded DMA tuning code and also config_chipset_for_dma().  Set ->atapi_dma flag
      correctly in init_hwif_common_ali15x3() so ide_tune_dma() can take care of
      checking if ATAPI DMA is allowed and remove open coded ATAPI DMA check from
      ali15x3_config_drive_for_dma().
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      38ff8a74
    • Bartlomiej Zolnierkiewicz's avatar
      sis5513: PIO mode setup fixes · 6b8cf772
      Bartlomiej Zolnierkiewicz authored
      * limit max PIO mode to PIO4, this driver doesn't support PIO5 and attempt
        to program PIO5 by config_art_rwp_pio() could result in incorrect PIO
        timings being programmed and possibly the data corruption (for < ATA100
        family chipsets PIO0 timings were used, for ATA100 and ATA100a - the random
        content of test1 variable was used, for ATA133 - MWDMA0 timings were used)
      
      * BUG() in sis5513_tune_chipset() if somebody tries to force unsupported PIO5,
        also cleanup this function a bit while at it
      
      * add comment about PIO0 timings for < ATA100 family chipsets
      
      * remove open-coded best PIO mode selection from config_art_rwp_pio(),
        it contained numerous bugs:
      
        - it didn't check for validity of id->eide_pio_modes and id->eide_pio_iordy
          before using them
      
        - it tried to found out maximum PIO mode basing on minimum IORDY cycle time
          (moreover wrong cycle times were used for PIO1/5)
      
        - it was overriding PIO blacklist and conservative PIO "downgrade" done
          by ide_get_best_pio_mode()
      
      * use sis5513_tune_drive() instead of config_art_rwp_pio()
        in sis5513_config_xfer_rate() so the correct PIO mode is also set
        on drive even if the device is not IORDY/DMA capable
      
      * config_art_rwp_pio() was always setting the best possible mode and not
        the wanted one - fix it and move ide_get_best_pio_mode() call to
        config_chipset_for_pio()
      
      * don't use ide_find_best_mode() in config_chipset_for_pio(), it was being
        overriden by config_art_rwp_pio() for the host timings anyway + we need to
        set the same PIO mode on the device and the host
      
      * pass correct "pio" argument (255 instead of 5) to sis5513_tune_drive() call
        in sis5513_config_xfer_rate() so the best PIO mode is set on the drive
        and not PIO4
      
      * rename sis5513_tune_drive() to sis5513_tuneproc()
        and config_chipset_for_pio() to sis5513_tune_driver()
      
      * bump driver version
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      6b8cf772
    • Bartlomiej Zolnierkiewicz's avatar
      serverworks: PIO mode setup fixes · 9445de76
      Bartlomiej Zolnierkiewicz authored
      * limit max PIO mode to PIO4, this driver doesn't support PIO5 and attempt
        to program PIO5 by svwks_tune_chipset() could result in incorrect PIO
        timings being programmed and possibly the data corruption (it seems that
        the minimum possible values were used but I lack the datasheets to be sure)
      
      * select best PIO mode in svwks_tune_drive() and not in svwks_tune_chipset()
        when doing PIO autotuning (pio == 255)
      
      * don't try to tune PIO in config_chipset_for_dma() as ide_dma_enable() could
        return 1 if DMA was previously enabled (svwks_config_drive_xfer_rate()
        takes care of PIO tuning if no suitable DMA mode is found)
      
      * remove config_chipset_for_pio() and use svwks_tune_drive() instead,
        config_chipset_for_pio() contained numerous bugs when selecting PIO mode
        (luckily it was only used for devices limited to PIO by capabilities/BIOS):
      
        - it didn't check for validity of id->eide_pio_modes and id->eide_pio_iordy
          before using them
      
        - it tried to found out maximum PIO mode basing on minimum IORDY cycle time
          (moreover wrong cycle times were used for PIO0/1/5)
      
        - it was overriding PIO blacklist and conservative PIO "downgrade" done
          by ide_get_best_pio_mode()
      
        - if the max drive PIO was PIO5 then XFER_PIO_0/XFER_PIO_SLOW was selected
          (XFER_PIO_SLOW is not supported by svwks_tune_chipset() so the result
           was the same as if using XFER_PIO_5 => wrong PIO timings were set)
      
        - it was overriding drive->current_speed
      
      * bump driver version
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      9445de76
    • Bartlomiej Zolnierkiewicz's avatar
      pdc202xx_old: rewrite mode programming code (v2) · 4fce3164
      Bartlomiej Zolnierkiewicz authored
      This patch is based on the documentation (I would like to thank Promise
      for it) and also partially on the older vendor driver.
      
      Rewrite mode programming code:
      
      * disable 66MHz clock in pdc202xx_tune_chipset() so it is correctly disabled
        even if both devices on the channel are not DMA capable and after reset
      
      * enable/disable IORDY and PREFETCH bits in pdc202xx_tune_chipset()
        as they need to be setup correctly also for PIO only devices, plus IORDY
        wasn't disabled for non-IORDY devices and PREFETCH wasn't disabled for
        ATAPI devices
      
      * remove dead code for setting SYNC_ERDDY_EN bits from config_chipset_for_dma()
        (driver sets ->autotune to 1 so PIO modes are always programmed => lower
         nibble of register A never equals 4 => "chipset_is_set" is always true)
      
      * enable PIO mode programming for all ATAPI devices
        (it was limited to ->media == ide_cdrom devices)
      
      * remove extra reads of registers A/B/C, don't read register D et all
      
      * do clearing / programming of registers A/B/C in one go
        (gets rid of extra PCI config space read/write cycle)
      
      * set initial values of drive_conf/AP/BP/CP variables to zero
        (paranoia for the case when PCI reads fail)
      
      * remove XFER_UDMA6 to XFER_UDMA5 remapping case - it can't happen
        (ide_rate_filter() takes care of it)
      
      * fix XFER_MW_DMA0 timings (they were overclocked, use the official ones)
      
      * fix bitmasks for clearing bits of register B:
      
        - when programming DMA mode bit 0x10 of register B was cleared which
          resulted in overclocked PIO timing setting (iff PIO0 was used)
      
        - when programming PIO mode bits 0x18 weren't cleared so suboptimal
          timings were used for PIO1-4 if PIO0 was previously set (bit 0x10)
          and for PIO0/3/4 if PIO1/2 was previously set (bit 0x08)
      
      * add FIXME comment about missing locking for 66MHz clock register
      
      Also while at it:
      
      * remove unused defines
      
      * do a few cosmetic / CodingStyle fixes
      
      * bump driver version
      
      v2:
      * in pdc202xx_tune_chipset() the old content of drive configuration
        registers is used only by the debugging code so cover "drive_conf"
        PCI registers read by #if PDC202XX_DEBUG_DRIVE_INFO
        (Noticed by Sergei Shtylyov)
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4fce3164
  7. 09 May, 2007 3 commits
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add ide_proc_register_port() · 5cbf79cd
      Bartlomiej Zolnierkiewicz authored
      * create_proc_ide_interfaces() tries to add /proc entries for every probed
        and initialized IDE port, replace it by ide_proc_register_port() which does
        it only for the given port (also rename destroy_proc_ide_interface() to
        ide_proc_unregister_port() for consistency)
        
      * convert {create,destroy}_proc_ide_interface[s]() users to use new functions
      
      * pmac driver depended on proc_ide_create() to add /proc port entries, fix it
        
      * au1xxx-ide, swarm and cs5520 drivers depended indirectly on ide-generic
        driver (CONFIG_IDE_GENERIC=y) to add port /proc entries, fix them
      
      * there is now no need to add /proc entries for IDE ports in proc_ide_create()
        so don't do it
      
      * proc_ide_create() needs now to be called before drivers are probed - fix it,
        while at it make proc_ide_create() create /proc "ide" directory
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      5cbf79cd
    • Bartlomiej Zolnierkiewicz's avatar
      ide: add "initializing" argument to ide_register_hw() · 869c56ee
      Bartlomiej Zolnierkiewicz authored
      Add "initializing" argument to ide_register_hw() and use it instead of ide.c
      wide variable of the same name.  Update all users of ide_register_hw()
      accordingly.
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      869c56ee
    • Bartlomiej Zolnierkiewicz's avatar
      ide: cable detection fixes (take 2) · 7f8f48af
      Bartlomiej Zolnierkiewicz authored
      Tejun's recent eighty_ninty_three() fix has inspired me to do more thorough
      review of the cable detection code...
      
      * print user-friendly warning about limiting the maximum transfer speed
        to UDMA33 (and the reason behind it) when 80-wire cable is not detected,
        also while at it cleanup eighty_ninty_three() a bit
      
      * use eighty_ninty_three() in ide_ata66_check(), this actually fixes 3 bugs:
        - bit 14 (word 93 validity check) == 1 && bit 13 (80-wire cable test) == 1
          were used as 80-wire cable present test for CONFIG_IDEDMA_IVB=n case
          (please see FIXME comment in eighty_ninty_three() for more details)
        - CONFIG_IDEDMA_IVB=y/n cases were interchanged
        - check for SATA devices was missing
      
      * remove private cable warnings from pdc_202xx{old,new} drivers now that core
        code provides this functionality (plus, in pdc202xx_new case the test could
        give false warnings for ATAPI devices because pdc202xx_new driver doesn't
        even support ATAPI DMA)
      
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      7f8f48af