1. 13 10月, 2007 1 次提交
    • B
      ide: move ide_config_drive_speed() calls to upper layers (take 2) · 88b2b32b
      Bartlomiej Zolnierkiewicz 提交于
      * Convert {ide_hwif_t,ide_pci_device_t}->host_flag to be u16.
      
      * Add IDE_HFLAG_POST_SET_MODE host flag to indicate the need to program 
        the host for the transfer mode after programming the device.  Set it
        in au1xxx-ide, amd74xx, cs5530, cs5535, pdc202xx_new, sc1200, pmac
        and via82cxxx host drivers.
      
      * Add IDE_HFLAG_NO_SET_MODE host flag to indicate the need to completely
        skip programming of host/device for the transfer mode ("smart" hosts).
        Set it in it821x host driver and check it in ide_tune_dma().
      
      * Add ide_set_pio_mode()/ide_set_dma_mode() helpers and convert all
        direct ->set_pio_mode/->speedproc users to use these helpers.
      
      * Move ide_config_drive_speed() calls from ->set_pio_mode/->speedproc
        methods to callers.
      
      * Rename ->speedproc method to ->set_dma_mode, make it void and update
        all implementations accordingly.
      
      * Update ide_set_xfer_rate() comments.
      
      * Unexport ide_config_drive_speed().
      
      v2:
      * Fix issues noticed by Sergei:
        - export ide_set_dma_mode() instead of moving ->set_pio_mode abuse wrt
          to setting DMA modes from sc1200_set_pio_mode() to do_special()
        - check IDE_HFLAG_NO_SET_MODE in ide_tune_dma()
        - check for (hwif->set_pio_mode) == NULL in ide_set_pio_mode()
        - check for (hwif->set_dma_mode) == NULL in ide_set_dma_mode()
        - return -1 from ide_set_{pio,dma}_mode() if ->set_{pio,dma}_mode == NULL
        - don't set ->set_{pio,dma}_mode on it821x in "smart" mode
        - fix build problem in pmac.c
        - minor fixes in au1xxx-ide.c/cs5530.c/siimage.c
        - improve patch description
      
      Changes in behavior caused by this patch:
      - HDIO_SET_PIO_MODE ioctl would now return -ENOSYS for attempts to change
        PIO mode if it821x controller is in "smart" mode
      - removal of two debugging printk-s (from cs5530.c and sc1200.c)
      - transfer modes 0x00-0x07 passed from user space may be programmed twice on
        the device (not really an issue since 0x00 is not supported correctly by
        any host driver ATM, 0x01 is not supported at all and 0x02-0x07 are invalid)
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      88b2b32b
  2. 12 10月, 2007 4 次提交
  3. 02 8月, 2007 1 次提交
  4. 20 7月, 2007 3 次提交
  5. 12 7月, 2007 1 次提交
    • A
      PCI: Change all drivers to use pci_device->revision · 44c10138
      Auke Kok 提交于
      Instead of all drivers reading pci config space to get the revision
      ID, they can now use the pci_device->revision member.
      
      This exposes some issues where drivers where reading a word or a dword
      for the revision number, and adding useless error-handling around the
      read. Some drivers even just read it for no purpose of all.
      
      In devices where the revision ID is being copied over and used in what
      appears to be the equivalent of hotpath, I have left the copy code
      and the cached copy as not to influence the driver's performance.
      
      Compile tested with make all{yes,mod}config on x86_64 and i386.
      Signed-off-by: NAuke Kok <auke-jan.h.kok@intel.com>
      Acked-by: NDave Jones <davej@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      44c10138
  6. 10 7月, 2007 2 次提交
  7. 10 5月, 2007 3 次提交
    • B
      ide: add ide_tune_dma() helper · 29e744d0
      Bartlomiej Zolnierkiewicz 提交于
      After reworking the code responsible for selecting the best DMA
      transfer mode it is now possible to add generic ide_tune_dma() helper.
      
      Convert some IDE PCI host drivers to use it (the ones left need more work).
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      29e744d0
    • B
      ide: rework the code for selecting the best DMA transfer mode (v3) · 2d5eaa6d
      Bartlomiej Zolnierkiewicz 提交于
      Depends on the "ide: fix UDMA/MWDMA/SWDMA masks" patch.
      
      * add ide_hwif_t.udma_filter hook for filtering UDMA mask
        (use it in alim15x3, hpt366, siimage and serverworks drivers)
      * add ide_max_dma_mode() for finding best DMA mode for the device
        (loosely based on some older libata-core.c code)
      * convert ide_dma_speed() users to use ide_max_dma_mode()
      * make ide_rate_filter() take "ide_drive_t *drive" as an argument instead
        of "u8 mode" and teach it to how to use UDMA mask to do filtering
      * use ide_rate_filter() in hpt366 driver
      * remove no longer needed ide_dma_speed() and *_ratemask()
      * unexport eighty_ninty_three()
      
      v2:
      * rename ->filter_udma_mask to ->udma_filter
        [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]
      
      v3:
      * updated for scc_pata driver (fixes XFER_UDMA_6 filtering for user-space
        originated transfer mode change requests when 100MHz clock is used)
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      2d5eaa6d
    • B
      ide: fix UDMA/MWDMA/SWDMA masks (v3) · 18137207
      Bartlomiej Zolnierkiewicz 提交于
      * use 0x00 instead of 0x80 to disable ->{ultra,mwdma,swdma}_mask
      * add udma_mask field to ide_pci_device_t and use it to initialize
        ->ultra_mask in aec62xx, cmd64x, pdc202xx_{new,old} and piix drivers
      * fix UDMA masks to match with chipset specific *_ratemask()
        (alim15x3, hpt366, serverworks and siimage drivers need UDMA mask
         filtering method - done in the next patch)
      
      v2:
      * piix: fix cable detection for 82801AA_1 and 82372FB_1
        [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]
      * cmd64x: use hwif->cds->udma_mask
        [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]
      * aec62xx: fix newly introduced bug - check DMA status not command register
        [ Noticed by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]
      
      v3:
      * piix: use hwif->cds->udma_mask
        [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ]
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      18137207
  8. 04 3月, 2007 1 次提交
  9. 17 2月, 2007 6 次提交
  10. 08 2月, 2007 2 次提交
    • S
      piix: tuneproc() fixes/cleanups · 30dfd12f
      Sergei Shtylyov 提交于
      Fix/cleanup the driver's tuneproc() and ratemask() methods:
      
      - PPE, IE, and TIME bits need to be cleared beforehand for the slave drive as
        well as master (Alan probably just forgot about it);
      
      - this driver only supports PIO modes up to 4, so must pass the correct limit
        to ide_get_best_pio_mode();
      
      - use min_t() macro instead of min();
      
      - simplify slave vs master drive evaluation;
      
      - do come coding and formatting cleanups...
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      30dfd12f
    • S
      piix: fix 82371MX enablebits · d2872239
      Sergei Shtylyov 提交于
      According to the datasheet, Intel 82371MX (MPIIX) actually has only a
      single IDE channel mapped to the primary or secondary ports depending on
      the value of the bit 14 of the IDETIM register at PCI config.  offset 0x6C
      (the register at 0x6F which the driver refers to.  doesn't exist).  So,
      disguise the controller as dual channel and set enablebits masks/values
      such that only either primary or secondary channel is detected enabled. 
      Also, preclude the IDE probing code from reading PCI BARs, this controller
      just doesn't have them (it's not the separate PCI function like the other
      PCI controllers), it only decodes the legacy addresses.
      
      [ Alan sayeth " MPIIX does not work with or without the change.  It needs its
        own different driver and not to use setup-pci.  Huge job and since it works
        well with libata who cares.  Ditto the early PIIX chip." ]
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      d2872239
  11. 31 12月, 2006 2 次提交
  12. 11 12月, 2006 1 次提交
  13. 03 10月, 2006 1 次提交
    • A
      [PATCH] ide: backport piix fixes from libata into the legacy driver · 5ac24697
      Alan Cox 提交于
      There are three flags being set by default by the PIIX driver for speeds >
      PIO 1, and one not being cleared properly on fallback to PIO0.  The most
      important one is the prefetch/post write control which only works for ATA
      and can do bad things with ATAPI.
      
      The patch does its best to set the flags correctly for drivers/ide.  Its
      not 100% perfect but its closer than the original.  100% perfect requires
      proper IORDY handling but this isn't critical (and its not right in libata
      either ..  yet)
      
      Sergei Shtylyov <sshtylyov@ru.mvista.com> said:
      
      > +					{ 0, 0 },
      > +					{ 0, 0 },
      > +					{ 1, 0 },
      > +					{ 2, 1 },
      > +					{ 2, 3 }, };
      >
      >  	pio = ide_get_best_pio_mode(drive, pio, 5, NULL);
      
          BTW, there's quite obvious error here which leads to access outside of
      timings[] if somebody passes PIO mode 5 (or autotuning code finds out that
      drive supports PIO mode 5). Could have been fixed while at it... Those drives
      should be rare, though...
      
      > +		}
      >  		master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8);
      >  	}
      >  	pci_write_config_word(dev, master_port, master_data);
      
          Actually, there's one more serious issue with piix_tune_drive() -- it
      doesn't actually set the drive's own transfer mode.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5ac24697
  14. 01 10月, 2006 1 次提交
  15. 01 7月, 2006 1 次提交
  16. 27 6月, 2006 1 次提交
  17. 04 2月, 2006 1 次提交
  18. 17 4月, 2005 2 次提交