03 Mar, 2010

1 commit


19 Jan, 2010

2 commits


08 Jan, 2010

1 commit

  • scc_pata host driver predated module unloading support for IDE host
    drivers so even though it supports PCI hot-unplug and implements
    PCI device ->remove method it doesn't allow module removal. Fix it.

    Add missing __init/__exit tags to module_init/module_exit functions
    while at it (from Peter Huewe).

    Noticed-by: Jiri Kosina
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

18 May, 2009

3 commits

  • Remove hw_regs_t typedef and rename struct hw_regs_s to struct ide_hw.

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     
  • Pass number of ports to ide_host_{alloc,add}() and then update
    all users accordingly.

    v2:
    - drop no longer needed NULL initializers in buddha.c, cmd640.c and gayle.c
    (noticed by Sergei)

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     
  • * Convert host drivers that still use hw_regs_t's chipset field to use
    the one in struct ide_port_info instead.

    * Move special handling of ide_pci chipset type from ide_hw_configure()
    to ide_init_port().

    * Remove chipset field from hw_regs_t.

    While at it:
    - remove stale comment in delkin_cb.c

    There should be no functional changes caused by this patch.

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

    Bartlomiej Zolnierkiewicz
     

08 Apr, 2009

7 commits

  • Simplify tf_read() method, making it deal only with 'struct ide_taskfile' and
    the validity flags that the upper layer passes, and factoring out the code that
    deals with the high order bytes into ide_tf_readback() to be called from the
    only two functions interested, ide_complete_cmd() and ide_dump_sector().

    This should stop the needless code duplication in this method and so make
    it about twice smaller than it was; along with simplifying the setup for
    the method call, this should save both time and space...

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

    Sergei Shtylyov
     
  • Simplify tf_load() method, making it deal only with 'struct ide_taskfile' and
    the validity flags that the upper layer passes, and moving the code that deals
    with the high order bytes into the only function interested, do_rw_taskfile().

    This should stop the needless code duplication in this method and so make
    it about twice smaller than it was; along with simplifying the setup for the
    method call, this should save both time and space...

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

    Sergei Shtylyov
     
  • Use write_devctl() method to clear/set the HOB bit in tf_read() method.

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

    Sergei Shtylyov
     
  • Move device register masking (and setting drive->select) out of tf_load() method
    and into the only function that needs to use this code, do_rw_taskfile()...

    Signed-off-by: Sergei Shtylyov
    [bart: fix whitespace error]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • Make 'struct ide_taskfile' cover only 8 register values and thus put two such
    fields ('tf' and 'hob') into 'struct ide_cmd', dropping unnecessary 'tf_array'
    field from it.

    This required changing the prototype of ide_get_lba_addr() and ide_tf_dump().

    Signed-off-by: Sergei Shtylyov
    [bart: fix setting of ATA_LBA bit for LBA48 commands in __ide_do_rw_disk()]
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Sergei Shtylyov
     
  • Replace IDE_TFLAG_{IN|OUT}_* flags meaning to the taskfile register validity on
    input/output by the IDE_VALID_* flags and introduce 4 symmetric 8-bit register
    validity indicator subfields, 'valid.{input/output}.{tf|hob}', into the 'struct
    ide_cmd' instead of using the 'tf_flags' field for that purpose (this field can
    then be turned from 32-bit into 8-bit one).

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

    Sergei Shtylyov
     
  • This patch:
    o replaces "mask" variable in ide_dma_end() with #define.
    o removes use of wmb() in ide-dma-sff.c and scc_pata.c.
    o is not tested - I don't have (or want) the HW.

    Signed-off-by: Grant Grundler
    Cc: KOBAYASHI Yoshitake
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Grant Grundler
     

01 Apr, 2009

10 commits

  • 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
     
  • Move IDE_FTFLAG_{IN|OUT}_DATA flag handling out of tf_{read|load}() methods
    into the only two functions where these flags actually need to be handled:
    do_rw_taskfile() and ide_complete_cmd()...

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

    Sergei Shtylyov
     
  • Handle IDE_FTFLAG_{IN|OUT}_DATA flags in tf_{read|load}() methods by calling
    {in|out}put_data() methods to transfer 2 bytes -- this will allow us to move
    that handling out of those methods altogether...

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

    Sergei Shtylyov
     
  • The feature register has never been readable -- when its location is read, one
    gets the error register value; hence rename IDE_TFLAG_IN_[HOB_]FEATURE into
    IDE_TFLAG_IN_[HOB_]ERROR and introduce the 'hob_error' field into the 'struct
    ide_taskfile' (despite the error register not really depending on the HOB bit).

    Signed-off-by: Sergei Shtylyov
    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
     
  • Make use of ATA_HOB instead of hard-coded value in the tf_read() method.

    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

7 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
     
  • * Add IDE_TFLAG_FS taskfile flag and set it for REQ_TYPE_FS requests.

    * Convert ->{in,out}put_data methods to take command instead of request
    as an argument. Then convert pre_task_out_intr(), task_end_request(),
    task_error(), task_in_unexpected(), ide_pio_sector(), ide_pio_multi()
    and ide_pio_datablock() in similar way.

    * Rename task_end_request() to ide_finish_cmd().

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • While at it:
    - rename struct ide_task_s to struct ide_cmd
    - remove stale comments from idedisk_{read_native,set}_max_address()
    - drop unused 'cmd' argument from ide_{cmd,task}_ioctl()
    - drop unused 'task' argument from tx4939ide_tf_load_fixup()
    - rename ide_complete_task() to ide_complete_cmd()
    - use consistent naming for struct ide_cmd variables

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ->ftf_flags field to struct ide_taskfile
    and convert flags for TASKFILE ioctl to use it.

    * Rename "flagged" taskfile flags:
    - IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
    - IDE_TFLAG_FLAGGED_SET_IN_FLAGS -> IDE_FTFLAG_SET_IN_FLAGS
    - IDE_TFLAG_{OUT,IN}_DATA -> IDE_FTFLAG_{OUT,IN}_DATA

    v2:
    * Remember to fully update ide-h8300.c, scc_pata.c and tx493{8,9}ide.c
    (thanks to Stephen Rothwell for noticing).

    There should be no functional changes caused by this patch.

    Cc: Stephen Rothwell
    Acked-by: Sergei Shtylyov
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Add ->irq_flags field to struct ide_port_info and struct ide_host.

    * Update host drivers and IDE PCI code to use ->irq_flags field.

    * Convert init_irq() and ide_intr() to use host->irq_flags.

    This fixes handling of shared IRQs for non-PCI hosts
    and removes ugly ifdeffery from core IDE code.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • v2:
    scc_chipsets[] -> scc_chipset fix (spotted by Daniel K.).

    Cc: "Daniel K."
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

07 Jan, 2009

6 commits

  • Make consistent use of scc_dma_sff_read_status() throughout the driver.

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

    Sergei Shtylyov
     
  • Move apparently misplaced read_sff_dma_status() method from 'struct ide_tp_ops'
    to 'struct ide_dma_ops', renaming it to dma_sff_read_status() and making only
    required for SFF-8038i compatible IDE controller drivers (greatly cutting down
    the number of initializers) as its only user (outside ide-dma-sff.c and such
    drivers) appears to be ide_pci_check_simplex() which is only called for such
    controllers...

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

    Sergei Shtylyov
     
  • Add ide_port_for_each_dev() / ide_host_for_each_port() iterators
    and update IDE code to use them.

    While at it:
    - s/unit/i/ variable in ide_port_wait_ready(), ide_probe_port(),
    ide_port_tune_devices(), ide_port_init_devices_data(), do_reset1(),
    ide_acpi_set_state() and scc_dma_end()
    - s/d/i/ variable in ide_proc_port_register_devices()

    There should be no functional changes caused by this patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Allocate device structures dynamically instead of having them embedded
    in ide_hwif_t:

    * Remove needless zeroing of port structure from ide_init_port_data().

    * Add ide_hwif_t.devices[MAX_DRIVES] (table of pointers to the devices).

    * Add ide_port_{alloc,free}_devices() helpers and use them respectively
    in ide_{host,free}_alloc().

    * Convert all users of ->drives[] to use ->devices[] instead.

    While at it:

    * Use drive->dn for the slave device check in scc_pata.c.

    As a nice side-effect this patch cuts ~1kB (x86-32) from the resulting
    code size:

    text data bss dec hex filename
    53963 1244 237 55444 d894 drivers/ide/ide-core.o.before
    52981 1244 237 54462 d4be drivers/ide/ide-core.o.after

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     
  • * Merge ide_hwgroup_t with ide_hwif_t.

    * Cleanup init_irq() accordingly, then remove no longer needed
    ide_remove_port_from_hwgroup() and ide_ports[].

    * Remove now unused HWGROUP() macro.

    While at it:

    * ide_dump_ata_error() fixups

    v2:
    * Fix ->quirk_list check in do_ide_request()
    (s/hwif->cur_dev/prev_port->cur_dev).

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

03 Nov, 2008

1 commit


24 Oct, 2008

1 commit


22 Oct, 2008

1 commit