27 Jul, 2016

1 commit

  • There was clearly supposed to be a break statement here. Currently we
    use the k2 ata timings instead of sh ata ones we intended. Probably no
    one has this hardware anymore so it likely doesn't make a difference
    beyond the static checker warning.

    Signed-off-by: Dan Carpenter
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: David S. Miller

    Dan Carpenter
     

06 Feb, 2016

1 commit

  • Drivers should include asm/pci-bridge.h only when they need the arch-
    specific things provided there. Outside of the arch/ directories, the only
    drivers that actually need things provided by asm/pci-bridge.h are the
    powerpc RPA hotplug drivers in drivers/pci/hotplug/rpa*.

    Remove the includes of asm/pci-bridge.h from the other drivers, adding an
    include of linux/pci.h if necessary.

    Signed-off-by: Bjorn Helgaas

    Bjorn Helgaas
     

18 Apr, 2015

1 commit

  • Replace occurences of the pci api by appropriate call to the dma api.

    A simplified version of the semantic patch that finds this problem is as
    follows: (http://coccinelle.lip6.fr)

    @deprecated@
    idexpression id;
    position p;
    @@

    (
    pci_dma_supported@p ( id, ...)
    |
    pci_alloc_consistent@p ( id, ...)
    )

    @bad1@
    idexpression id;
    position deprecated.p;
    @@
    ...when != &id->dev
    when != pci_get_drvdata ( id )
    when != pci_enable_device ( id )
    (
    pci_dma_supported@p ( id, ...)
    |
    pci_alloc_consistent@p ( id, ...)
    )

    @depends on !bad1@
    idexpression id;
    expression direction;
    position deprecated.p;
    @@

    (
    - pci_dma_supported@p ( id,
    + dma_supported ( &id->dev,
    ...
    + , GFP_ATOMIC
    )
    |
    - pci_alloc_consistent@p ( id,
    + dma_alloc_coherent ( &id->dev,
    ...
    + , GFP_ATOMIC
    )
    )

    Signed-off-by: Quentin Lambert
    Signed-off-by: David S. Miller

    Quentin Lambert
     

23 Mar, 2015

1 commit

  • ppc has special instruction forms to efficiently load and store values
    in non-native endianness. These can be accessed via the arch-specific
    {ld,st}_le{16,32}() inlines in arch/powerpc/include/asm/swab.h.

    However, gcc is perfectly capable of generating the byte-reversing
    load/store instructions when using the normal, generic cpu_to_le*() and
    le*_to_cpu() functions eaning the arch-specific functions don't have much
    point.

    Worse the "le" in the names of the arch specific functions is now
    misleading, because they always generate byte-reversing forms, but some
    ppc machines can now run a little-endian kernel.

    To start getting rid of the arch-specific forms, this patch removes them
    from all the old Power Macintosh drivers, replacing them with the
    generic byteswappers.

    Signed-off-by: David Gibson
    Signed-off-by: Benjamin Herrenschmidt

    David Gibson
     

15 Nov, 2013

2 commits


04 Jan, 2013

1 commit

  • CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
    markings need to be removed.

    This change removes the use of __devinit, __devexit_p, __devinitdata,
    __devinitconst, and __devexit from these drivers.

    Based on patches originally written by Bill Pemberton, but redone by me
    in order to handle some of the coding style issues better, by hand.

    Cc: Bill Pemberton
    Cc: "David S. Miller"
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

01 Nov, 2011

1 commit


23 Nov, 2010

1 commit


02 Jun, 2010

1 commit

  • Grant patches added an of mach table to struct device_driver. However,
    while he changed the macio device code to use that, he left the match
    table pointer in struct macio_driver and didn't update drivers to use
    the "new" one, thus breaking the probing.

    This completes the change by moving all drivers to setup the "new"
    one, removing all traces of the old one, and while at it (since it
    changes the exact same locations), I also remove two other duplicates
    from struct driver which are the name and owner fields.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

19 May, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

04 Feb, 2010

1 commit


19 Jan, 2010

2 commits


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