27 Mar, 2015

1 commit


05 Mar, 2014

1 commit

  • On m68k, host->get_lock is used to both lock and register the interrupt
    that the IDE host shares with other device drivers. Registering the
    IDE interrupt handler in ide-probe.c results in duplicating the
    interrupt registered (once via host->get lock, and also via init_irq()),
    and may result in IDE accepting interrupts even when another driver has
    locked the interrupt hardware. This opens the whole locking scheme up
    to races.

    host->get_lock is set on m68k only, so other drivers' behaviour is not
    changed.

    Signed-off-by: Michael Schmitz
    Cc: Geert Uytterhoeven
    Cc: David S. Miller
    Cc: linux-ide@vger.kernel.org
    Signed-off-by: David S. Miller

    Michael Schmitz
     

04 Jul, 2013

1 commit

  • Calling dev_set_name with a single paramter causes it to be handled as a
    format string. Many callers are passing potentially dynamic string
    content, so use "%s" in those cases to avoid any potential accidents,
    including wrappers like device_create*() and bdi_register().

    Signed-off-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kees Cook
     

14 Sep, 2010

1 commit

  • We must ensure that ide_proc_port_register_devices() occurs on an
    interface before ide_proc_register_driver() executes for that
    interfaces drives.

    Therefore defer the registry of the driver device objects backed by
    ide_bus_type until after ide_proc_port_register_devices() has run
    and thus all of the drive->proc procfs directory pointers have been
    setup.

    Signed-off-by: Wolfram Sang
    Signed-off-by: David S. Miller

    Wolfram Sang
     

29 Mar, 2010

1 commit


05 Mar, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/ide-next-2.6: (49 commits)
    drivers/ide: Fix continuation line formats
    ide: fixed section mismatch warning in cmd640.c
    ide: ide_timing_compute() fixup
    ide: make ide_get_best_pio_mode() static
    via82cxxx: use ->pio_mode value to determine pair device speed
    tx493xide: use ->pio_mode value to determine pair device speed
    siimage: use ->pio_mode value to determine pair device speed
    palm_bk3710: use ->pio_mode value to determine pair device speed
    it821x: use ->pio_mode value to determine pair device speed
    cs5536: use ->pio_mode value to determine pair device speed
    cs5535: use ->pio_mode value to determine pair device speed
    cmd64x: fix handling of address setup timings
    amd74xx: use ->pio_mode value to determine pair device speed
    alim15x3: fix handling of UDMA enable bit
    alim15x3: fix handling of DMA timings
    alim15x3: fix handling of command timings
    alim15x3: fix handling of address setup timings
    ide-timings: use ->pio_mode value to determine fastest PIO speed
    ide: change ->set_dma_mode method parameters
    ide: change ->set_pio_mode method parameters
    ...

    Linus Torvalds
     

26 Feb, 2010

2 commits


19 Jan, 2010

1 commit


06 Nov, 2009

1 commit

  • This reverts commit 6029336426a2b43e4bc6f4a84be8789a047d139e.

    Ok, we really do need to revert this, even with Bart's sis5513.c
    fix in there.

    The problem is that several driver's ->set_pio_mode() method
    depends upon the drive->media type being set properly. Most
    of them use this to enable prefetching, which can only be done
    for disk media.

    But the commit being reverted here calls ->set_pio_mode() before
    it's setup. Actually it considers everything disk because that
    is the default media type set by ide_port_init_devices_data().

    The set of drivers that depend upon the media type in their
    ->set_pio_method() are:

    drivers/ide/alim15x3.c
    drivers/ide/it8172.c
    drivers/ide/it8213.c
    drivers/ide/pdc202xx_old.c
    drivers/ide/piix.c
    drivers/ide/qd65xx.c
    drivers/ide/sis5513.c
    drivers/ide/slc90e66.c

    And it is possible that we could fix this by guarding the prefetching
    and other media dependent setting changes with a test on
    IDE_PFLAG_PROBING in hwif->port_flags, that's simply too risky for
    2.6.32-rcX and -stable.

    Signed-off-by: David S. Miller

    David S. Miller
     

07 Oct, 2009

1 commit


05 Oct, 2009

1 commit


21 Sep, 2009

1 commit


08 Aug, 2009

1 commit

  • * Un-static __ide_wait_stat().

    * Allow ide_dev_read_id() helper to be called from the IRQ context by
    adding irq_ctx flag and using mdelay()/__ide_wait_stat() when needed.

    * Switch ide_driveid_update() to set irq_ctx flag.

    This change is needed for the consecutive patch which fixes races in
    handling of user-space SET XFER commands but for improved bisectability
    and clarity it is better to do it in a separate patch.

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

24 Jun, 2009

1 commit

  • Add ide_host_enable_irqs() helper and use it in ide_host_register()
    before registering ports. Then remove no longer needed IRQ unmasking
    from in init_irq().

    This should fix the problem with "screaming" shared IRQ on the first
    port (after request_irq() call while we have the unexpected IRQ pending
    on the second port) which was uncovered by my rework of the serialized
    interfaces support.

    Reported-by: Frans Pop
    Tested-by: Frans Pop
    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: David S. Miller

    Bartlomiej Zolnierkiewicz
     

21 Jun, 2009

1 commit

  • * 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (34 commits)
    ide-cd: prevent null pointer deref via cdrom_newpc_intr
    ide: BUG() on unknown requests
    ide: filter out invalid DMA xfer mode changes in HDIO_DRIVE_CMD ioctl handler
    ide: do not access ide_drive_t 'drive_data' field directly
    sl82c105: implement test_irq() method
    siimage: implement test_irq() method
    pdc202xx_old: implement test_irq() method (take 2)
    cmd64x: implement test_irq() method
    cmd640: implement test_irq() method
    ide: move ack_intr() method into 'struct ide_port_ops' (take 2)
    ide: move IRQ clearing from ack_intr() method to clear_irq() method (take 2)
    siimage: use ide_dma_test_irq() (take 2)
    cmd64x: implement clear_irq() method (take 2)
    ide: call clear_irq() method in ide_timer_expiry()
    sgiioc4: coding style cleanup
    ide: don't enable IORDY at a probe time
    ide: IORDY handling fixes
    ata: add ata_id_pio_need_iordy() helper (v2)
    ide-tape: fix build issue
    ide: unify interrupt reason checking
    ...

    Linus Torvalds
     

16 Jun, 2009

3 commits

  • In the near future, the driver core is going to not allow direct access
    to the driver_data pointer in struct device. Instead, the functions
    dev_get_drvdata() and dev_set_drvdata() should be used. These functions
    have been around since the beginning, so are backwards compatible with
    all older kernel versions.

    Cc: linux-ide@vger.kernel.org
    Acked-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • Move the ack_intr() method into 'struct ide_port_ops', also renaming it to
    test_irq() while at it...

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

    Sergei Shtylyov
     
  • * Add 'unsigned long port_flags' field to ide_hwif_t.

    * Add IDE_PFLAG_PROBING port flag and keep it set during probing.

    * Fix ide_pio_need_iordy() to not enable IORDY at a probe time
    (IORDY may lead to controller lock up on certain controllers
    if the port is not occupied).

    Loosely based on the recent libata's fix by Tejun, thanks to Alan
    for the hint that IDE may also need it.

    Signed-off-by: Bartlomiej Zolnierkiewicz

    Bartlomiej Zolnierkiewicz
     

10 Jun, 2009

1 commit

  • PowerMac bootup with CONFIG_IDE=y oopses in ide_pio_cycle_time():
    because "ide: try to use PIO Mode 0 during probe if possible" causes
    pmac_ide_set_pio_mode() to be called before drive->id has been set.

    Bart points out other places which now need drive->id set earlier,
    so follow his advice to allocate it in ide_port_alloc_devices()
    (using kzalloc_node, without error message, as when allocating drive)
    and memset it for reuse in ide_port_init_devices_data().

    Fixed in passing: ide_host_alloc() was missing ide_port_free_devices()
    from an error path.

    Signed-off-by: Hugh Dickins
    Cc: Joao Ramos
    Cc: Sergei Shtylyov
    Cc: Benjamin Herrenschmidt
    Cc: Andrew Morton
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Hugh Dickins
     

09 Jun, 2009

1 commit


07 Jun, 2009

1 commit


22 May, 2009

2 commits


18 May, 2009

4 commits


17 May, 2009

1 commit


08 Apr, 2009

4 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
     
  • 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
     
  • commit 255115fb35f80735c21a1cbe9809e9795a3af26e ("ide: allow host drivers to
    specify IRQ flags") added irq_flags fields to struct ide_port_info and struct
    ide_host. Drivers can now set ide_port_info.irq_flags = IRQF_SHARED, while
    init_irq() passes ide_host.irq_flags to request_irq().

    Unfortunately ide_host.irq_flags is never set, causing (on ARAnyM):

    | Uniform Multi-Platform E-IDE driver
    | ide: Falcon IDE controller
    | Probing IDE interface ide0...
    | hda: Sarge m68k, ATA DISK drive
    | init_irq: sa = 0
    | ide0: disabled, unable to get IRQ 15
    | ide0: failed to initialize IDE interface
    | ide0: disabling port

    Solve this by copying ide_port_info.irq_flags to ide_host.irq_flags in
    ide_host_alloc().

    This bug probably affects the following IDE host drivers:
    - buddha
    - delkin_cb
    - falconide
    - gayle
    - ide-cs
    - macide
    - q40ide
    - scc_pata
    - sgiioc4

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Bartlomiej Zolnierkiewicz

    Geert Uytterhoeven
     

01 Apr, 2009

3 commits


27 Mar, 2009

4 commits