1. 02 2月, 2008 5 次提交
  2. 27 1月, 2008 5 次提交
  3. 26 1月, 2008 2 次提交
    • B
      ide: add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag · 4db90a14
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_HFLAG_ABUSE_SET_DMA_MODE host flag and use it to decide
        what to do with transfer modes < XFER_PIO_0 in ide_set_xfer_rate().
      
      * Set IDE_HFLAG_ABUSE_SET_DMA_MODE in host drivers that need it
        (aec62xx, amd74xx, cs5520, cs5535, hpt34x, hpt366, pdc202xx_old,
        serverworks, tc86c001 and via82cxxx) and cleanup ->set_dma_mode
        methods in host drivers that don't (IDE core code guarantees that
        ->set_dma_mode will be called only for modes which are present
        in SWDMA/MWDMA/UDMA masks).
      
      While at it:
      
      * Add IDE_HFLAGS_HPT34X/HPT3XX/PDC202XX/SVWKS define in
        hpt34x/hpt366/pdc202xx_old/serverworks host driver.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      4db90a14
    • B
      ide-pmac: fix pmac_ide_init_hwif_ports() · d26805fd
      Bartlomiej Zolnierkiewicz 提交于
      * pmac_ide_init_hwif_ports() can be called by ide_init_hwif_ports()
        (through ppc_ide_md.ide_init_hwif hook) for non IDE PMAC interfaces.
        If this is the case the hw->io_ports[] should be already setup by
        ide_init_hwif_ports()->ide_std_init_ports() so remove redundant code
        from pmac_ide_init_hwif_ports().
      
        As side-effect this change fixes ctl_addr == 0 special handling in
        ide_init_hwif_ports().
      
      * Fix misleading comment while at it.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      d26805fd
  4. 28 11月, 2007 1 次提交
  5. 14 11月, 2007 1 次提交
  6. 20 10月, 2007 2 次提交
  7. 19 10月, 2007 1 次提交
  8. 17 10月, 2007 4 次提交
    • B
      ide: remove hwif->autodma and drive->autodma · 9ff6f72f
      Bartlomiej Zolnierkiewicz 提交于
      * hpt34x.c: disable DMA masks for HPT345
        (hwif->autodma is zero so DMA won't be enabled anyway).
      
      * trm290.c: disable IDE_HFLAG_TRUST_BIOS_FOR_DMA flag
        (hwif->autodma is zero so DMA won't be enabled anyway).
      
      * Check noautodma global variable instead of drive->autodma in ide_tune_dma().
      
        This fixes handling of "ide=nodma" kernel parameter for icside, ide-cris,
        au1xxx-ide, pmac, it821x, jmicron, sgiioc4 and siimage host drivers.
      
      * Remove hwif->autodma (it was not checked by IDE core code anyway) and
        drive->autodma (was set by all host drivers - except HPT345/TRM290 special
        cases - unless "ide=nodma" was used).
      
      While at it:
      - remove needless printk() from icside.c
      - remove stale FIXME/comment from ide-probe.c
      - don't force DMA off if PCI bus-mastering had to be enabled in setup-pci.c
        (this setting was always later over-ridden by host drivers anyway)
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      9ff6f72f
    • B
      ide: use PCI_VDEVICE() macro · 9cbcc5e3
      Bartlomiej Zolnierkiewicz 提交于
      While at it:
      - make struct pci_device_id tables const
      - use PCI_DEVICE_ID_ITE_8213 define in it8213.c
      - fix comment in generic.c
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      9cbcc5e3
    • B
      ide: remove ->ide_dma_check (take 2) · 0ae2e178
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_HFLAG_TRUST_BIOS_FOR_DMA host flag for host drivers that depend
        on BIOS for programming device/controller for DMA.  Set it in cy82c693,
        generic, ns87415, opti621 and trm290 host drivers.
      
      * Add IDE_HFLAG_VDMA host flag for host drivers using VDMA.  Set it in cs5520
        host driver.
      
      * Teach ide_tune_dma() about IDE_HFLAG_TRUST_BIOS_FOR_DMA flag.
      
      * Add generic ide_dma_check() helper and remove all open coded ->ide_dma_check
        implementations.  Fix all places checking for presence of ->ide_dma_check
        hook to check for ->ide_dma_on instead.
      
      * Remove no longer needed code from config_drive_for_dma().
      
      * Make ide_tune_dma() static.
      
      v2:
      * Fix config_drive_for_dma() return values.
      
      * Fix ide-dma.c build for CONFIG_BLK_DEV_IDEDMA_PCI=n by adding
        dummy config_drive_for_dma() inline.
      
      * Fix IDE_HFLAG_TRUST_BIOS_FOR_DMA handling in ide_dma_check().
      
      * Fix init_hwif_it8213() comment.
      
      There should be no functionality changes caused by this patch.
      
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      0ae2e178
    • B
      ide-pmac: add PIO autotune fallback to ->ide_dma_check · b8b739d3
      Bartlomiej Zolnierkiewicz 提交于
      Since ide-pmac allows separate PIO and DMA timings, and ide-pmac always sets
      ->autotune this change shouldn't have any other effect than bringing ide-pmac
      driver in-line with other host drivers wrt ->ide_dma_check implementation.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b8b739d3
  9. 16 10月, 2007 1 次提交
  10. 13 10月, 2007 12 次提交
    • 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
    • B
    • B
      ide-pmac: use ide_tune_dma() (take 2) · 254bb550
      Bartlomiej Zolnierkiewicz 提交于
      * Add missing initialization of hwif->autodma and drive->autodma to
        pmac_ide_setup_dma().
      
      * Use ide_tune_dma() in pmac_ide_dma_check().
      
      While at it:
      
      * Fix pmac_ide_dma_check() return value if DMA mode is not programmed
        (should be "-1" otherwise ide_set_dma() will try to enable DMA).
      
      * Remove unnecessary drive->using_dma fiddling (->dma_off_quietly is always
        called before ide_set_dma() call and ide_set_dma() calls ->ide_dma_on if
        ->ide_dma_check returns "0").
      
      v2:
      * No reason to blacklist all ide_floppy devices and the old code was always
        enabling DMA anyway (without even programming controller/device if the
        device was ide_floppy).
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      254bb550
    • B
      ide-pmac: remove pmac_ide_do_setfeature() (take 2) · aedea591
      Bartlomiej Zolnierkiewicz 提交于
      Use ide_config_drive_speed() instead of pmac_ide_do_setfeature() and remove
      the latter, also  ide-iops.c::__ide_wait_stat() could be static again.
      
      Since for IDE PMAC host driver IDE_CONTROL_REG is always true, device's
      ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than
      the only changes in behavior are:
      
      * if PIO mode is set then ->dma_off_queitly is called to disable DMA
      
      * if setting transfer mode fails ide_dump_status() is called to dump status
      
      v2:
      * IDE PMAC controllers allow separate PIO and DMA timings and PPC userland
        depends on this fact, and calls "hdparm -p" without calling "hdparm -d".
      
        Therefore to compensate for DMA being disabled by ide_config_drive_speed()
        for PIO modes:
      
        - add IDE_HFLAG_SET_PIO_MODE_KEEP_DMA flag and set it in PMAC host driver
      
        - add handling of the new flag to ide-io.c::do_special()
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      aedea591
    • B
      ide-pmac: remove nIEN clearing from pmac_ide_do_setfeature() · 3b2d0093
      Bartlomiej Zolnierkiewicz 提交于
      Upper layers are responsible for controlling nIEN so don't clear nIEN after
      command execution in pmac_ide_do_setfeature().
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      3b2d0093
    • B
      ide-pmac: use __ide_wait_stat() · ddf15102
      Bartlomiej Zolnierkiewicz 提交于
      * Use __ide_wait_stat() instead of wait_for_ready() in pmac_ide_do_setfeature().
      
      While at it do following changes to match __ide_wait_stat() call in
      ide_config_drive_speed():
      
      * Wait WAIT_CMD time (20 sec) instead of 2 sec for device to clear BUSY_STAT.
      
      * Check DRQ_STAT bit (shouldn't be set for good device status).
      
      Also remove no longer needed wait_for_ready() from ide-iops.c.
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      ddf15102
    • B
      ide-pmac: remove extra good status wait from pmac_ide_do_setfeature() · 218ee5f3
      Bartlomiej Zolnierkiewicz 提交于
      Don't check for good device status before executing the command in
      pmac_ide_do_setfeature() (ide_config_drive_speed() doesn't do this).
      
      It is a job of upper layers to guarantee that the device is ready to
      accept new command before we get here.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      218ee5f3
    • B
      ide-pmac: remove pmac_ide_{m,u}dma_enable() (take 2) · fd553ce8
      Bartlomiej Zolnierkiewicz 提交于
      * Fix pmac_ide_dma_check() to use pmac_ide_tune_chipset() and remove no longer
        necessary pmac_ide_{m,u}dma_enable().
      
      * While at it remove some dead code from pmac_ide_dma_check() (leftovers from
        conversion to use ide_max_dma_mode()).
      
      There should be no functionality changes caused by this patch.
      
      v2:
      * Fix compile by replacing "id" with "drive->id" in pmac_ide_dma_check()
        (Noticed by Ben).
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      fd553ce8
    • B
      ide-pmac: remove control register messing from pmac_ide_dma_check() · 78103940
      Bartlomiej Zolnierkiewicz 提交于
      pmac_ide_do_setfeature() contains matching nIEN setting/clearing so this
      Device Control register messing in pmac_ide_dma_check() is totally unnecessary.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      78103940
    • B
      ide-pmac: fix set_timings_mdma() · 90f72eca
      Bartlomiej Zolnierkiewicz 提交于
      * Move adjusting of cycle time for devices providing explicit DMA cycle time
        from pmac_ide_mdma_enable() to set_timings_mdma().
      
      * Remove no longer needed drive_cycle_time argument.
      
      * BUG() if unsupported speed argument value is passed (shouldn't happen).
      
      * Matching access/recovery timings always exist so remove redundant check.
      
      * Make set_timings_mdma() void.
      
      * Update pmac_ide_tune_chipset()'s comment.
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      90f72eca
    • B
      ide-pmac: pmac_ide_tune_chipset() fixes · 085798b1
      Bartlomiej Zolnierkiewicz 提交于
      * Don't check check for pmif == NULL (it should never be NULL if we got here).
      
      * Make a local copy of the timings and set the pmif->timings[] only after
        setting the transfer mode on the device (otherwise SELECT_DRIVE() call in
        pmac_ide_do_setfeature() will program new timings before the transfer mode
        is set on the device - this was pointed out by Sergei).  This change makes
        pmac_ide_tune_chipset() behavior match this of pmac_ide_{m,u}dma_enable().
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      085798b1
    • B
      ide-pmac: don't check kauai_lookup_timing() return value · 90a87ea4
      Bartlomiej Zolnierkiewicz 提交于
      kauai_lookup_timing() should always return non-zero return value:
      
      * BUG() in kauai_lookup_timing() if the timing info cannot be found.
      
      * Remove code checking for zero return value from all callers.
      Acked-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      90a87ea4
  11. 12 10月, 2007 5 次提交
    • B
      ide: use only ->set_pio_mode method for programming PIO modes (take 2) · 8f4dd2e4
      Bartlomiej Zolnierkiewicz 提交于
      Use ->set_pio_mode method to program PIO modes in ide_set_xfer_rate()
      (the only place which used ->speedproc to program PIO modes) and remove
      handling of PIO modes from all ->speedproc implementations.
      
      v2:
      * Fix pmac_ide_tune_chipset() comment.
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      8f4dd2e4
    • B
      ide-pmac: PIO mode setup fixes (take 3) · c15d5d43
      Bartlomiej Zolnierkiewicz 提交于
      * Add { 0, 0 } entry to {kauai,shasta}_pio_timings[] so kauai_lookup_timing()
        always returns a valid PIO timing (fixes PIO timing not being set for devices
        with minimum PIO cycle <= 120ns).
      
      * Add setting transfer mode on the device to pmac_ide_set_pio_mode().
      
      * Fix pmac_ide_set_pio() to always program chipset for given PIO timing instead
        of only when the device we want to program PIO timing for is the currently
        selected one.
      
      * Now that pmac_ide_set_pio() is fixed there is no need to set transfer mode
        on the device and program chipset for PIO in pmac_ide_tune_chipset()
        (returning 0 == success is not entirely correct but is OK for now since
        the upper layers are only checking ->speedproc return value for DMA modes).
      
      v2:
      * s/speed/XFER_PIO_0 + pio/ in pmac_ide_set_pio_mode() so it actually compiles.
      
      * Removal of kauai_lookup_timing() return value checking went to separate patch.
      
      v3:
      * Use XFER_PIO_0 not XFER_PIO. (Noticed by Ben)
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c15d5d43
    • B
      ide: add ide_set{_max}_pio() (take 4) · 26bcb879
      Bartlomiej Zolnierkiewicz 提交于
      * Add IDE_HFLAG_ABUSE_{PREFETCH,FAST_DEVSEL,DMA_MODES} flags
        and set them in ht6560, cmd640, cmd64x and sc1200 host drivers.
      
      * Add set_pio_mode_abuse() for checking if host driver has a non-standard
        ->tuneproc() implementation and use it in do_special().
      
      * Add ide_set_pio() for setting PIO mode (it uses hwif->pio_mask to find
        the maximum PIO mode supported by the host), also add ide_set_max_pio()
        wrapper for ide_set_pio() to use for auto-tuning.  Convert users of
        ->tuneproc to use ide_set{_max}_pio() where possible.  This leaves only
        do_special(), set_using_pio(), ide_hwif_restore() and ide_set_pio() as
        a direct users of ->tuneproc.
      
      * Remove no longer needed ide_get_best_pio_mode() calls and printk-s
        reporting PIO mode selected from ->tuneproc implementations.
      
      * Rename ->tuneproc hook to ->set_pio_mode and make 'pio' argument const.
      
      * Remove stale comment from ide_config_drive_speed().
      
      v2:
      * Fix "ata_" prefix (Noticed by Jeff).
      
      v3:
      * Minor cleanups/fixups per Sergei's suggestions.
      
      v4:
      * Fix compile problem in drivers/ide/pci/cmd640.c
        (Noticed by Andrew Morton).
      
      * Improve some ->set_pio_mode comments.
      Reviewed-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Jeff Garzik <jeff@garzik.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      26bcb879
    • B
      ide: move ide_rate_filter() calls to the upper layer (take 2) · f212ff28
      Bartlomiej Zolnierkiewicz 提交于
      * Move ide_rate_filter() calls from host drivers to IDE core.
      
      * Make ide_rate_filter() static.
      
      * Make 'speed' argument of ->speedproc const.
      
      v2:
      * Fix it8213_tune_chipset() comment.
      
      There should be no functionality changes caused by this patch.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      f212ff28
    • B
      ide: add missing ide_rate_filter() calls to ->speedproc()-s · a8028fcb
      Bartlomiej Zolnierkiewicz 提交于
      * Fix icside, cris-ide, au1xxx-ide, amd74xx, via82cxxx and pmac host drivers
        to use ide_rate_filter().
      
        This results in the following modes (from user requests) being clipped down:
        - invalid modes (values 0x46-0xFF)  [ for all hosts ]
        - unsupported by a host UDMA modes  [ for hosts which support UDMA]
        - all UDMA modes and MWDMA3-4 modes [ for hosts which don't support UDMA ]
        - invalid modes (values 0x25-0x39)  [ for hosts which don't support UDMA ]
      
      * Host driver specific changes in behavior:
      
        icside:
          - no change
      
        cris-ide
          - clip unsupported UDMA3-6 modes down
          - fix BUG() on trying to set unsupported UDMA3-6 modes
      
        au1xxx-ide/pmac
          - clip unsupported UDMA modes down
      
        amd74xx/via82cxxx
          - clip unsupported UDMA modes down
          - fix random PIO timings being set for unsupported/invalid modes
          - fix unsupported/invalid modes being set on the device
      
      * While at it remove no longer needed checks from pmac.c driver.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      a8028fcb
  12. 07 10月, 2007 1 次提交
    • B
      Fix non-terminated PCI match table in PowerMac IDE · 71e4eda8
      Benjamin Herrenschmidt 提交于
      The PCI device table in the powermac IDE driver isn't properly
      terminated.  Depending on how your kernel is linked and other random
      factors, you can end up with this driver matched against any other PCI
      device in your system, possibly crashing at boot.
      
      Thanks to Heikki for tracking this down with me, the bug have been there
      for some time, though it rarely hurts due to luck.  In this case, the
      switch from .22 to .23-rc9 is causing it to show up due to differences
      in the resulting layout of .data I suppose.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <pmac@au1.ibm.com>
      Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
      Cc: Heikki Lindholm <holindho@cs.helsinki.fi>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      71e4eda8