1. 14 10月, 2008 2 次提交
  2. 24 7月, 2008 4 次提交
    • B
      ide: add ide_host_add() helper · 6f904d01
      Bartlomiej Zolnierkiewicz 提交于
      Add ide_host_add() helper which does ide_host_alloc()+ide_host_register(),
      then convert ide_setup_pci_device[s](), ide_legacy_device_add() and some
      host drivers to use it.
      
      While at it:
      
      * Fix ide_setup_pci_device[s](), ide_arm.c, gayle.c, ide-4drives.c,
        macide.c, q40ide.c, cmd640.c and cs5520.c to return correct error value.
      
      * -ENOENT -> -ENOMEM in rapide.c, ide-h8300.c, ide-generic.c, au1xxx-ide.c
        and pmac.c
      
      * -ENODEV -> -ENOMEM in palm_bk3710.c, ide_platform.c and delkin_cb.c
      
      * -1 -> -ENOMEM in ide-pnp.c
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      6f904d01
    • B
      ide: add struct ide_host (take 3) · 48c3c107
      Bartlomiej Zolnierkiewicz 提交于
      * Add struct ide_host which keeps pointers to host's ports.
      
      * Add ide_host_alloc[_all]() and ide_host_remove() helpers.
      
      * Pass 'struct ide_host *host' instead of 'u8 *idx' to
        ide_device_add[_all]() and rename it to ide_host_register[_all]().
      
      * Convert host drivers and core code to use struct ide_host.
      
      * Remove no longer needed ide_find_port().
      
      * Make ide_find_port_slot() static.
      
      * Unexport ide_unregister().
      
      v2:
      * Add missing 'struct ide_host *host' to macide.c.
      
      v3:
      * Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/)
        (Noticed by Stephen Rothwell).
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      48c3c107
    • B
      ide: add struct ide_tp_ops (take 2) · 374e042c
      Bartlomiej Zolnierkiewicz 提交于
      * Add struct ide_tp_ops for transport methods.
      
      * Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
        and ide_hwif_t.
      
      * Set the default hwif->tp_ops in ide_init_port_data().
      
      * Set host driver specific hwif->tp_ops in ide_init_port().
      
      * Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
        ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
        and ata_{in,out}put_data().
      
      * Convert host drivers and core code to use struct ide_tp_ops.
      
      * Remove no longer needed default_hwif_transport().
      
      * Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.
      
      While at it:
      
      * Use struct ide_port_info in falconide.c and q40ide.c.
      
      * Rename ata_{in,out}put_data() to ide_{in,out}put_data().
      
      v2:
      
      * Fix missing convertion in ns87415.c.
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      374e042c
    • B
      ide: pass hw_regs_t-s to ide_device_add[_all]() (take 3) · c97c6aca
      Bartlomiej Zolnierkiewicz 提交于
      * Add 'hw_regs_t **hws' argument to ide_device_add[_all]() and convert
        host drivers + ide_legacy_init_one() + ide_setup_pci_device[s]() to use
        it instead of calling ide_init_port_hw() directly.
      
        [ However if host has > 1 port we must still set hwif->chipset to hint
          consecutive ide_find_port() call that the previous slot is occupied. ]
      
      * Unexport ide_init_port_hw().
      
      v2:
      * Use defines instead of hard-coded values in buddha.c, gayle.c and q40ide.c.
        (Suggested by Geert Uytterhoeven)
      
      * Better patch description.
      
      v3:
      * Fix build problem in ide-cs.c. (Noticed by Stephen Rothwell)
      
      There should be no functional changes caused by this patch.
      
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c97c6aca
  3. 17 7月, 2008 2 次提交
  4. 29 4月, 2008 4 次提交
    • B
      ide: remove ->INS{W,L} and ->OUTS{W,L} methods · 16bb69c1
      Bartlomiej Zolnierkiewicz 提交于
      * Use ins{w,l}()/outs{w,l}() and __ide_mm_ins{w,l}()/__ide_mm_outs{w,l}()
        directly in ata_{in,out}put_data() (by using IDE_HFLAG_MMIO host flag to
        decide which I/O ops are required).
      
      * Remove no longer needed ->INS{W,L} and ->OUTS{W,L} methods (ide-h8300,
        au1xxx-ide and scc_pata implement their own ->{in,out}put_data methods).
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      16bb69c1
    • B
      au1xxx-ide: add ->{in,out}put_data methods (take 2) · 70f91e0d
      Bartlomiej Zolnierkiewicz 提交于
      v2:
      
      * Update ->{in,out}_data methods to take 'struct request *rq' argument.
      
      There should be no functional changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      70f91e0d
    • B
      ide: fix au1xxx-ide breakage · 284aa76b
      Bartlomiej Zolnierkiewicz 提交于
      On Monday 28 April 2008, Sergei Shtylyov wrote:
      > Hello, I wrote:
      > 
      > > Fix these warnings emitted when compiling drivers/ide/mips/au1xxx-ide.c:
      > 
      > > include/asm/mach-au1x00/au1xxx_ide.h:137: warning: 'auide_tune_drive' declared 
      > > `static' but never defined
      > > include/asm/mach-au1x00/au1xxx_ide.h:138: warning: 'auide_tune_chipset' declared
      > >  `static' but never defined
      > 
      > > by wiping out the whole "function prototyping" section from the header file
      > > <asm-mips/mach-au1x00/au1xxx_ide.h> as it mostly declared functions that are
      > > already dead in the IDE driver; move the only useful prototype into the driver.
      > > 
      > > Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      > 
      > > ---
      > > I'm not sure thru which tree this should go -- probably thru Linux/MIPS one...
      > 
      > > Bart, au1xxx-ide-fix-mwdma-support.patch will probably need to be updated to
      > > remove that added prototype since it won't be needed anymore...
      > 
      >     Which you haven't done either in that patch or in 
      > au1xxx-ide-use-init_dma-method.patch. So, face the consequences:
      > 
      > drivers/ide/mips/au1xxx-ide.c:456: error: conflicting types for 'auide_ddma_init'
      > drivers/ide/mips/au1xxx-ide.c:51: error: previous declaration of
      > 'auide_ddma_init' was here
      > drivers/ide/mips/au1xxx-ide.c:456: error: conflicting types for 'auide_ddma_init'
      > drivers/ide/mips/au1xxx-ide.c:51: error: previous declaration of
      > 'auide_ddma_init' was here
      > drivers/ide/mips/au1xxx-ide.c:51: warning: 'auide_ddma_init' used but never
      > defined
      
      Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      284aa76b
    • S
      [MIPS] Pb1200/DBAu1200: move platform code to its proper place · fcbd3b4b
      Sergei Shtylyov 提交于
      Since both the IDE interface and SMC 91C111 Ethernet chip are on-board
      devices, not SOC devices, move the platform device registration form the
      common to the board specific code.
      
      While at it, remove semicolon (which didn't break compilation only by
      chance) from the AU1XXX_ATA_DDMA_REQ macro and do some renaming:
      
      - change 'au1200_ide0_' variable name prefix to the mere 'ide_';
      
      - change 'smc91x_' variable name prefix to 'smc91c111_' since that's the
        name of the chip used on the boards;
      
      - drop 'AU1XXX_' prefix from the names of macros describing IDE and Ethernet
        on-board devices;
      
      - change 'SMC91111_' to 'SMC91C111_', change 'IRQ' to 'INT' in the names of
        the macros describing the Ethernet chip for consistency with the IDE
        macros;
      
      - change 'ATA_' to 'IDE_' and 'OFFSET' to 'SHIFT' (since this value is
        indeed a shift count) in the names of the macros describing the IDE
        interface.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      fcbd3b4b
  5. 27 4月, 2008 9 次提交
  6. 26 4月, 2008 1 次提交
  7. 18 4月, 2008 2 次提交
    • B
      ide: remove ->hold field from ide_hwif_t (take 2) · 2304dc64
      Bartlomiej Zolnierkiewicz 提交于
      ->hold is write-only now, remove it.
      
      v2:
      * v1 missed bast-ide, palm_bk3710, ide-cs and delkin_cb host drivers.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      2304dc64
    • B
      ide: remove broken/dangerous HDIO_[UNREGISTER,SCAN]_HWIF ioctls (take 3) · 93de00fd
      Bartlomiej Zolnierkiewicz 提交于
      hdparm explicitely marks HDIO_[UNREGISTER,SCAN]_HWIF ioctls as DANGEROUS
      and given the number of bugs we can assume that there are no real users:
      
      * DMA has no chance of working because DMA resources are released by
        ide_unregister() and they are never allocated again.
      
      * Since ide_init_hwif_ports() is used for ->io_ports[] setup the ioctls
        don't work for almost all hosts with "non-standard" (== non ISA-like)
        layout of IDE taskfile registers (there is a lot of such host drivers).
      
      * ide_port_init_devices() is not called when probing IDE devices so:
        - drive->autotune is never set and IDE host/devices are not programmed
          for the correct PIO/DMA transfer modes (=> possible data corruption)
        - host specific I/O 32-bit and IRQ unmasking settings are not applied
          (=> possible data corruption)
        - host specific ->port_init_devs method is not called (=> no luck with
          ht6560b, qd65xx and opti621 host drivers)
      
      * ->rw_disk method is not preserved (=> no HPT3xxN chipsets support).
      
      * ->serialized flag is not preserved (=> possible data corruption when
         using icside, aec62xx (ATP850UF chipset), cmd640, cs5530, hpt366
         (HPT3xxN chipsets), rz1000, sc1200, dtc2278 and ht6560b host drivers).
      
      * ->ack_intr method is not preserved (=> needed by ide-cris, buddha,
        gayle and macide host drivers).
      
      * ->sata_scr[] and sata_misc[] is cleared by ide_unregister() and it
        isn't initialized again (SiI3112 support needs them).
      
      * To issue an ioctl() there need to be at least one IDE device present
        in the system.
      
      * ->cable_detect method is not preserved + it is not called when probing
        IDE devices so cable detection is broken (however since DMA support is
        also broken it doesn't really matter ;-).
      
      * Some objects which may have already been freed in ide_unregister()
        are restored by ide_hwif_restore() (i.e. ->hwgroup).
      
      * ide_register_hw() may unregister unrelated IDE ports if free ide_hwifs[]
        slot cannot be found.
      
      * When IDE host drivers are modular unregistered port may be re-used by
        different host driver that owned it first causing subtle bugs.
      
      Since we now have a proper warm-plug support remove these ioctls,
      then remove no longer needed:
      - ide_register_hw() and ide_hwif_restore() functions
      - 'init_default' and 'restore' arguments of ide_unregister()
      - zeroeing of hwif->{dma,extra}_* fields in ide_unregister()
      
      As an added bonus IDE core code size shrinks by ~3kB (x86-32).
      
      v2:
      * fix ide_unregister() arguments in cleanup_module() (Andrew Morton).
      
      v3:
      * fix ide_unregister() arguments in palm_bk3710.c.
      Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      93de00fd
  8. 17 4月, 2008 3 次提交
    • S
      Pb1200/DBAu1200: fix bad IDE resource size · b4dcaea3
      Sergei Shtylyov 提交于
      The header files for the Pb1200/DBAu1200 boards have wrong definition for the
      IDE interface's decoded range length -- it should be 512 bytes according to
      what the IDE driver does.  In addition, the IDE platform device claims 1 byte
      too many for its memory resource -- fix the platform code and the IDE driver
      in accordance.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      b4dcaea3
    • S
      Au1200: IDE driver build fix · fabd3a22
      Sergei Shtylyov 提交于
      The driver fails to compile with CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA enabled:
      
      drivers/ide/mips/au1xxx-ide.c: In function `auide_build_dmatable':
      drivers/ide/mips/au1xxx-ide.c:256: error: implicit declaration of function
      `sg_virt'
      drivers/ide/mips/au1xxx-ide.c:275: error: implicit declaration of function
      `sg_next'
      drivers/ide/mips/au1xxx-ide.c:275: warning: assignment makes pointer from
      integer without a cast
      
      Fix this by including <linux/scatterlist.h>. While at it, remove the #include's
      without which the driver happily builds.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      fabd3a22
    • S
      Au1200: kill IDE driver function prototypes · 09a77441
      Sergei Shtylyov 提交于
      Fix these warnings emitted when compiling drivers/ide/mips/au1xxx-ide.c:
      
      include/asm/mach-au1x00/au1xxx_ide.h:137: warning: 'auide_tune_drive' declared 
      `static' but never defined
      include/asm/mach-au1x00/au1xxx_ide.h:138: warning: 'auide_tune_chipset' declared
       `static' but never defined
      
      by wiping out the whole "function prototyping" section from the header file
      <asm-mips/mach-au1x00/au1xxx_ide.h> as it mostly declared functions that are
      already dead in the IDE driver; move the only useful prototype into the driver.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      09a77441
  9. 03 2月, 2008 5 次提交
    • B
      ide: add IDE_HFLAG_NO_{IO32_BIT,UNMASK_IRQS} host flags · 807b90d0
      Bartlomiej Zolnierkiewicz 提交于
      * Use the same bit for IDE_HFLAG_CS5520 and IDE_HFLAG_VDMA host flags
        (both are used only by cs5520 host driver currently).
      
      * Add IDE_HFLAG_NO_IO32_BIT host flag and use it instead of ->no_io_32bit
        ide_hwif_t field.
      
      * Add IDE_HFLAG_NO_UNMASK_IRQS host flag, then convert dtc2278 and rz1000
        host drivers to use it.
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      807b90d0
    • B
      ide: fix ide_unregister() usage in host drivers · 909f4369
      Bartlomiej Zolnierkiewicz 提交于
      bast-ide.c/ide-cs.c/delkin_cb.c:
      
      * Don't set 'restore' flag for ide_unregister() when initializing new
        interface.
      
      rapide.c/ide-pnp.c/ide-cs.c/ide_platform.c/au1xxx-ide.c/delkin_cb.c/scc_pata.c:
      
      * Don't set 'init_default' and 'restore' flags for ide_unregister() when
        removing interface.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      909f4369
    • B
      ide: add 'init_default' and 'restore' arguments to ide_unregister() · f82c2b17
      Bartlomiej Zolnierkiewicz 提交于
      * Add 'init_default' (flag for calling init_hwif_default()) and 'restore'
        (flag for calling ide_hwif_restore()) arguments to ide_unregister().
      
      * Update ide_unregister() users to set 'init_default' and 'restore' flags.
      
      * No need to set 'init_default' flag in ide_register_hw() if the setup done
        by init_hwif_default() is going to be overridden by ide_init_port_hw().
      
      * No need to set 'init_default' and 'restore' flags in cleanup_module().
      
      There should be no functionality changes caused by this patch.
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      f82c2b17
    • B
      ide: add struct ide_port_info instances to legacy host drivers · c413b9b9
      Bartlomiej Zolnierkiewicz 提交于
      * Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma().
      
      * Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version.
      
      * Add 'const struct ide_port_info *d' argument to ide_device_add[_all]().
      
      * Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(),
        move it to ide-probe.c and call it in in ide_device_add_all() instead of
        ide_pci_setup_ports().
      
      * Move ->mate setup to ide_device_add_all() from ide_port_init().
      
      * Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable
        ->autotune currently.
      
      * Setup hwif->chipset in ide_init_port() but iff pi->chipset is set
        (to not override setup done by ide_hwif_configure()).
      
      * Add ETRAX host handling to ide_device_add_all().
      
      * cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n.
      
      * pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks
        setup to pmac_ide_setup_device().
      
      * Add 'struct ide_port_info' instances to legacy host drivers, pass them to
        ide_device_add() calls and then remove open-coded ports initialization.
      Reviewed-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      c413b9b9
    • B
      au1xxx-ide: fix ->io_32bit handling · bd38dd3c
      Bartlomiej Zolnierkiewicz 提交于
      The host driver must set hwif's ->no_io_32bit setting not drive's one
      (ide_port_tune_devices() overrides drive's setting).
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      bd38dd3c
  10. 02 2月, 2008 5 次提交
  11. 27 1月, 2008 3 次提交