09 Dec, 2009

1 commit

  • The hotplug mediabay has tendrils deep into drivers/ide code
    which makes a libata port reather difficult. In addition it's
    ugly and could be done better.

    This reworks the interface between the mediabay and the rest
    of the world so that:

    - Any macio_driver can now have a mediabay_event callback
    which will be called when that driver sits on a mediabay and
    it's been either plugged or unplugged. The device type is
    passed as an argument. We can now move all the IDE cruft
    into the IDE driver itself

    - A check_media_bay() function can be used to take a peek
    at the type of device currently in the bay if any, a cleaner
    variant of the previous function with the same name.

    - A pair of lock/unlock functions are exposed to allow the
    IDE driver to block the hotplug callbacks during the initial
    setup and probing of the bay in order to avoid nasty race
    conditions.

    - The mediabay code no longer needs to spin on the status
    register of the IDE interface when it detects an IDE device,
    this is done just fine by the IDE code itself

    Overall, less code, simpler, and allows for another driver
    than our old drivers/ide based one.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

18 May, 2009

2 commits


18 Apr, 2009

1 commit

  • Remove uneeded void casts

    Signed-off-by: Jack Stone
    Cc: jeff@garzik.org
    Cc: kernel-janitors@vger.kernel.org
    Cc: Jack Stone
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Jack Stone
     

01 Apr, 2009

7 commits

  • As IDE cable used on Apple PowerBook/iBook laptops are always of "Short 40"
    type when the firmware says it's 80 conductor one, the cable detection should
    return ATA_CBL_PATA40_SHORT on those machines. This enables to automatically
    use UDMA5 even with drives that doesn't correctly detect those cables on Apple
    laptops.

    Signed-off-by: TOMARI Hisanobu
    Cc: Sergei Shtylyov
    Cc: benh@kernel.crashing.org
    [bart: beautify patch description]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    TOMARI Hisanobu
     
  • Turn selectproc() method into dev_select() method by teaching it to write to the
    device register and moving it from 'struct ide_port_ops' to 'struct ide_tp_ops'.

    Signed-off-by: Sergei Shtylyov
    Cc: benh@kernel.crashing.org
    Cc: petkovbb@gmail.com
    [bart: add ->dev_select to at91_ide.c and tx4939.c (__BIG_ENDIAN case)]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • Turn set_irq() method with its software reset hack into write_devctl() method
    (for just writing a value into the device control register) at last...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • Set/clear drive->waiting_for_dma flag in the core code
    instead of in ->dma_setup and ->dma_end methods.

    There should be no functional changes caused by this patch.

    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Move ide_map_sg() call from ->dma_setup implementations and
    ide_destroy_dmatable() one from *_build_dmatable() to ide_dma_prepare().

    There should be no functional changes caused by this patch.

    Sergei:
    Removed 'use_pio_instead' labels and replaced 'goto' with 'return 0' --
    that required no changes to the follow-up patches...

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Move ide_destroy_dmatable() call out from ->dma_end method to
    {ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
    and sgiioc4_resetproc().

    This causes minor/safe behavior changes w.r.t.:
    * cmd64x.c::cmd64{8,x}_dma_end()
    * cs5536.c::cs5536_dma_end()
    * icside.c::icside_dma_end()
    * it821x.c::it821x_dma_end()
    * scc_pata.c::__scc_dma_end()
    * sl82c105.c::sl82c105_dma_end()
    * tx4939ide.c::tx4939ide_dma_end()

    v2:
    * Fix build for CONFIG_BLK_DEV_IDEDMA=n (reported by Randy Dunlap).

    Cc: Randy Dunlap
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • All custom ->dma_timeout implementations call the generic one thus it is
    possible to have only an optional method for resetting DMA engine instead:

    * Add ->dma_clear method and convert hpt366, pdc202xx_old and sl82c105
    host drivers to use it.

    * Always use ide_dma_timeout() in ide_dma_timeout_retry() and remove
    ->dma_timeout method.

    * Make ide_dma_timeout() static.

    There should be no functional changes caused by this patch.

    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

27 Mar, 2009

4 commits

  • * Rename dma_timer_expiry() to ide_dma_sff_timer_expiry() and export it.

    * Add ->dma_timer_expiry method and use it to set hwif->expiry for
    ATA_PROT_DMA protocol in do_rw_taskfile().

    * Initialize ->dma_timer_expiry to ide_dma_sff_timer_expiry() for SFF hosts.

    * Move setting hwif->expiry from ide_execute_command() to its users and drop
    'expiry' argument.

    * Use ide_execute_command() instead of ->dma_exec_cmd in do_rw_taskfile().

    * Remove ->dma_exec_cmd method and its implementations.

    * Unexport ide_execute_command() and ide_dma_intr().

    v2:
    * Fix CONFIG_BLK_DEV_IDEDMA=n build (noticed by Randy Dunlap).

    * Fix *dma_expiry naming (suggested by Sergei Shtylyov).

    There should be no functional changes caused by this patch.

    Cc: Randy Dunlap
    Cc: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Set IDE_TFLAG_WRITE flag and ->rq also for ATA_CMD_PACKET
    commands.

    * Pass command to ->dma_setup method and update all its
    implementations accordingly.

    * Pass command instead of request to ide_build_sglist(),
    *_build_dmatable() and ide_map_sg().

    While at it:

    * Fix scc_dma_setup() documentation + use ATA_DMA_WR define.

    * Rename sgiioc4_build_dma_table() to sgiioc4_build_dmatable(),
    change return value type to 'int' and drop unused 'ddir'
    argument.

    * Do some minor cleanups in [tx4939]ide_dma_setup().

    There should be no functional changes caused by this patch.

    Acked-by: Borislav Petkov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Move command related fields from ide_hwif_t to struct ide_cmd.

    * Make ide_init_sg_cmd() take command and sectors number as arguments.

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Re-map sg table if needed in ide_build_sglist().

    * Move ide_build_sglist() call from ->dma_setup to its users.

    * Un-export ide_build_sglist().

    v2:
    * Build fix for CONFIG_BLK_DEV_IDEDMA=n (noticed by Randy Dunlap).

    There should be no functional changes caused by this patch.

    Cc: Randy Dunlap
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

07 Jan, 2009

3 commits


09 Dec, 2008

1 commit

  • IDE pmac host driver build fails with CONFIG_BLK_DEV_IDEDMA_PMAC=n
    as reported by Kamalesh:

    > drivers/ide/pmac.c: In function 'pmac_ide_set_pio_mode':
    > drivers/ide/pmac.c:527: error: implicit declaration of function 'kauai_lookup_timing'
    > drivers/ide/pmac.c:527: error: 'shasta_pio_timings' undeclared (first use in this function)
    > drivers/ide/pmac.c:527: error: (Each undeclared identifier is reported only once
    > drivers/ide/pmac.c:527: error: for each function it appears in.)
    > drivers/ide/pmac.c:534: error: 'kauai_pio_timings' undeclared (first use in this function)
    > drivers/ide/pmac.c: In function 'pmac_ide_do_resume':
    > drivers/ide/pmac.c:914: error: 'IDE_WAKEUP_DELAY' undeclared (first use in this function)
    > drivers/ide/pmac.c: At top level:
    > drivers/ide/pmac.c:1007: error: 'pmac_ide_init_dma' undeclared here (not in a function)
    > drivers/ide/pmac.c: In function 'pmac_ide_setup_device':
    > drivers/ide/pmac.c:1107: error: 'IDE_WAKEUP_DELAY' undeclared (first use in this function)
    > drivers/ide/pmac.c: In function 'pmac_ide_macio_attach':
    > drivers/ide/pmac.c:1209: error: 'pmac_ide_hwif_t' has no member named 'dma_regs'
    > drivers/ide/pmac.c:1210: error: 'pmac_ide_hwif_t' has no member named 'dma_regs'
    > make[2]: *** [drivers/ide/pmac.o] Error 1

    Fix it by removing the superfluous config option.

    Reported-and-tested-by: Kamalesh Babulal
    Cc: Benjamin Herrenschmidt
    Cc: Sergei Shtylyov
    Cc: Stephen Rothwell
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

22 Oct, 2008

1 commit