20 Oct, 2014

1 commit


10 May, 2014

1 commit

  • This patch fixes host drivers to use CONFIG_PM_SLEEP instead of CONFIG_PM
    where applicable. Benefits of this change:

    * unused code is not being compiled in for CONFIG_PM=y, CONFIG_PM_SLEEP=n
    and CONFIG_PM_RUNTIME=y configurations

    * easier transition to use struct dev_pm_ops and SIMPLE_DEV_PM_OPS() in
    the future

    * more consistent code (there are host drivers which are using the correct
    CONFIG_PM_SLEEP checks already)

    The patch leaves the core libata code and ->port_[suspend,resume] support
    in sata_[inic162x,nv,sil24].c alone for now.

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Tejun Heo

    Bartlomiej Zolnierkiewicz
     

24 May, 2013

1 commit

  • Use the wrapper functions for getting and setting the driver data using
    platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
    so we can directly pass a struct platform_device.

    Also, unnecessary dev_set_drvdata() is removed, because the driver core
    clears the driver data to NULL after device_release or on probe failure.

    Signed-off-by: Jingoo Han
    Signed-off-by: Tejun Heo

    Jingoo Han
     

20 Feb, 2013

1 commit

  • <<
    Please pull mpc5xxx patches for v3.9. The bestcomm driver is
    moved to drivers/dma (so it will be usable for ColdFire).
    mpc5121 now provides common dtsi file and existing mpc5121 device
    trees use it. There are some minor clock init and sparse fixes
    and updates for various 5200 device tree files from Grant. Some
    fixes for bugs in the mpc5121 DIU driver are also included here
    (Andrew Morton suggested to push them via my mpc5xxx tree).
    >>

    Benjamin Herrenschmidt
     

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,
    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: Jeff Garzik
    Cc: Viresh Kumar
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

03 Jan, 2013

1 commit

  • The bestcomm dma hardware, and some of its users like the FEC ethernet
    component, is used in different FreeScale parts, including non-powerpc
    parts like the ColdFire MCF547x & MCF548x families. Don't keep the
    driver hidden in arch/powerpc where it is inaccessible for other arches.
    .c files are moved to drivers/dma/bestcomm, while .h files are moved to
    include/linux/fsl/bestcomm. Makefiles, Kconfigs and #include directives
    are updated for the new file locations.

    Tested by recompiling for MPC5200 with all bestcomm users enabled.

    Signed-off-by: Philippe De Muyter
    Signed-off-by: Anatolij Gustschin

    Philippe De Muyter
     

03 Dec, 2012

1 commit


14 Mar, 2012

1 commit

  • This patch makes a number of changes with respect to the error-handling
    code:

    * Remove cleanup calls for the devm functions in both the error handling
    code and the remove function. This cleanup is done automatically.

    * The previous change simplifies the cleanup code at the end of the
    function such that there is nothing to do on the failure of the call to
    devm_ioremap. So it is changed to just return directly.

    * There is no need for the ifs in the cleanup code at the end of the
    function, because in each case the cleanup needed is statically
    known. Drop the ifs, add new err labels, and drop the initializations of
    the tested variables to NULL.

    * Change the call to request_irq to a call to devm_request_irq, so that it
    is cleaned up on exit.

    * Cause the return value of devm_request_irq to go into the returned
    variable rv rather than the unused variable ret. Drop ret.

    Signed-off-by: Julia Lawall
    Signed-off-by: Jeff Garzik

    Julia Lawall
     

09 Jan, 2012

1 commit

  • This patch converts the drivers in drivers/ata/* to use the
    module_platform_driver() macro which makes the code smaller and a bit
    simpler.

    Cc: Viresh Kumar
    Cc: Jeff Garzik
    Cc: Arnaud Patard
    Cc: Alessandro Zummo
    Cc: Sylvain Munaut
    Cc: Anton Vorontsov
    Cc: Marek Vasut
    Cc: Florian Fainelli
    Cc: Mark Miesfeld
    Cc: Ashish Kalra
    Cc: Paul Mundt
    Signed-off-by: Axel Lin
    Signed-off-by: Jeff Garzik

    Axel Lin
     

08 Oct, 2011

1 commit

  • Since commit [c58543c8: genirq: Run irq handlers with interrupts disabled],
    We run all interrupt handlers with interrupts disabled
    and we even check and yell when an interrupt handler
    returns with interrupts enabled (see commit [b738a50a:
    genirq: Warn when handler enables interrupts]).

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Signed-off-by: Jeff Garzik

    Yong Zhang
     

01 Mar, 2011

1 commit


28 Jan, 2011

1 commit


06 Aug, 2010

1 commit

  • of_device is just an alias for platform_device, so remove it entirely. Also
    replace to_of_device() with to_platform_device() and update comment blocks.

    This patch was initially generated from the following semantic patch, and then
    edited by hand to pick up the bits that coccinelle didn't catch.

    @@
    @@
    -struct of_device
    +struct platform_device

    Signed-off-by: Grant Likely
    Reviewed-by: David S. Miller

    Grant Likely
     

26 May, 2010

1 commit

  • Separate out BMDMA irq handler from SFF irq handler. The misnamed
    host_intr() functions are renamed to ata_sff_port_intr() and
    ata_bmdma_port_intr(). Common parts are factored into
    __ata_sff_port_intr() and __ata_sff_interrupt() and used by sff and
    bmdma interrupt routines.

    All BMDMA drivers now use ata_bmdma_interrupt() or
    ata_bmdma_port_intr() while all non-BMDMA SFF ones use
    ata_sff_interrupt() or ata_sff_port_intr().

    For now, ata_pci_sff_init_one() uses ata_bmdma_interrupt() as it's
    used by both SFF and BMDMA drivers.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     

22 May, 2010

2 commits

  • Merging in current state of Linus' tree to deal with merge conflicts and
    build failures in vio.c after merge.

    Conflicts:
    drivers/i2c/busses/i2c-cpm.c
    drivers/i2c/busses/i2c-mpc.c
    drivers/net/gianfar.c

    Also fixed up one line in arch/powerpc/kernel/vio.c to use the
    correct node pointer.

    Signed-off-by: Grant Likely

    Grant Likely
     
  • .name, .match_table and .owner are duplicated in both of_platform_driver
    and device_driver. This patch is a removes the extra copies from struct
    of_platform_driver and converts all users to the device_driver members.

    This patch is a pretty mechanical change. The usage model doesn't change
    and if any drivers have been missed, or if anything has been fixed up
    incorrectly, then it will fail with a compile time error, and the fixup
    will be trivial. This patch looks big and scary because it touches so
    many files, but it should be pretty safe.

    Signed-off-by: Grant Likely
    Acked-by: Sean MacLennan

    Grant Likely
     

19 May, 2010

1 commit


15 May, 2010

1 commit

  • I've prepared a totally simple patch that, if I did it and measured it
    correctly, reduces the text size as of the ppc-6xx-size command of
    pata-mpc52xx by more than 10%, by reducing the rodata size from 0x4a4
    to 0x17e bytes. This is simply done by changing the data types of the
    ATA timing constants.

    If you are interested at all, and it's worth the trouble, here the
    details:

    ppc-6xx-size:
    text data bss dec hex filename
    old: 6532 1068 0 7600 1db0 pata-mpc52xx.o
    new: 5718 1068 0 6786 1a82 pata-mpc52xx.o

    The (assembler) code itself doesn't really change very much. I double
    checked the final results inside mpc52xx-ata-apply-timings() and they
    match. The driver is still working fine of course.

    Signed-off-by: Roman Fietze
    Signed-off-by: Jeff Garzik

    Roman Fietze
     

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
     

17 Jun, 2009

1 commit


25 Mar, 2009

1 commit


21 Dec, 2008

1 commit

  • This patch adds MDMA/UDMA support using BestComm for DMA on the MPC5200
    platform. Based heavily on previous work by Freescale (Bernard Kuhn,
    John Rigby) and Domen Puncer.

    With this patch, a SanDisk Extreme IV CF card gets read speeds of
    approximately 26.70 MB/sec.

    Signed-off-by: Tim Yamin
    Signed-off-by: Grant Likely

    Tim Yamin
     

13 Jul, 2008

1 commit


18 Apr, 2008

7 commits

  • Add sff_ prefix to SFF specific port ops.

    This rename is in preparation of separating SFF support out of libata
    core layer. This patch strictly renames ops and doesn't introduce any
    behavior difference.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • SFF functions have confusing names. Some have sff prefix, some have
    bmdma, some std, some pci and some none. Unify the naming by...

    * SFF functions which are common to both BMDMA and non-BMDMA are
    prefixed with ata_sff_.

    * SFF functions which are specific to BMDMA are prefixed with
    ata_bmdma_.

    * SFF functions which are specific to PCI but apply to both BMDMA and
    non-BMDMA are prefixed with ata_pci_sff_.

    * SFF functions which are specific to PCI and BMDMA are prefixed with
    ata_pci_bmdma_.

    * Drop generic prefixes from LLD specific routines. For example,
    bfin_std_dev_select -> bfin_dev_select.

    The following renames are noteworthy.

    ata_qc_issue_prot() -> ata_sff_qc_issue()
    ata_pci_default_filter() -> ata_bmdma_mode_filter()
    ata_dev_try_classify() -> ata_sff_dev_classify()

    This rename is in preparation of separating SFF support out of libata
    core layer. This patch strictly renames functions and doesn't
    introduce any behavior difference.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Currently reset methods are not specified directly in the
    ata_port_operations table. If a LLD wants to use custom reset
    methods, it should construct and use a error_handler which uses those
    reset methods. It's done this way for two reasons.

    First, the ops table already contained too many methods and adding
    four more of them would noticeably increase the amount of necessary
    boilerplate code all over low level drivers.

    Second, as ->error_handler uses those reset methods, it can get
    confusing. ie. By overriding ->error_handler, those reset ops can be
    made useless making layering a bit hazy.

    Now that ops table uses inheritance, the first problem doesn't exist
    anymore. The second isn't completely solved but is relieved by
    providing default values - most drivers can just override what it has
    implemented and don't have to concern itself about higher level
    callbacks. In fact, there currently is no driver which actually
    modifies error handling behavior. Drivers which override
    ->error_handler just wraps the standard error handler only to prepare
    the controller for EH. I don't think making ops layering strict has
    any noticeable benefit.

    This patch makes ->prereset, ->softreset, ->hardreset, ->postreset and
    their PMP counterparts propoer ops. Default ops are provided in the
    base ops tables and drivers are converted to override individual reset
    methods instead of creating custom error_handler.

    * ata_std_error_handler() doesn't use sata_std_hardreset() if SCRs
    aren't accessible. sata_promise doesn't need to use separate
    error_handlers for PATA and SATA anymore.

    * softreset is broken for sata_inic162x and sata_sx4. As libata now
    always prefers hardreset, this doesn't really matter but the ops are
    forced to NULL using ATA_OP_NULL for documentation purpose.

    * pata_hpt374 needs to use different prereset for the first and second
    PCI functions. This used to be done by branching from
    hpt374_error_handler(). The proper way to do this is to use
    separate ops and port_info tables for each function. Converted.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • libata lets low level drivers build ata_port_operations table and
    register it with libata core layer. This allows low level drivers
    high level of flexibility but also burdens them with lots of
    boilerplate entries.

    This becomes worse for drivers which support related similar
    controllers which differ slightly. They share most of the operations
    except for a few. However, the driver still needs to list all
    operations for each variant. This results in large number of
    duplicate entries, which is not only inefficient but also error-prone
    as it becomes very difficult to tell what the actual differences are.

    This duplicate boilerplates all over the low level drivers also make
    updating the core layer exteremely difficult and error-prone. When
    compounded with multi-branched development model, it ends up
    accumulating inconsistencies over time. Some of those inconsistencies
    cause immediate problems and fixed. Others just remain there dormant
    making maintenance increasingly difficult.

    To rectify the problem, this patch implements ata_port_operations
    inheritance. To allow LLDs to easily re-use their own ops tables
    overriding only specific methods, this patch implements poor man's
    class inheritance. An ops table has ->inherits field which can be set
    to any ops table as long as it doesn't create a loop. When the host
    is started, the inheritance chain is followed and any operation which
    isn't specified is taken from the nearest ancestor which has it
    specified. This operation is called finalization and done only once
    per an ops table and the LLD doesn't have to do anything special about
    it other than making the ops table non-const such that libata can
    update it.

    libata provides four base ops tables lower drivers can inherit from -
    base, sata, pmp, sff and bmdma. To avoid overriding these ops
    accidentaly, these ops are declared const and LLDs should always
    inherit these instead of using them directly.

    After finalization, all the ops table are identical before and after
    the patch except for setting .irq_handler to ata_interrupt in drivers
    which didn't use to. The .irq_handler doesn't have any actual effect
    and the field will soon be removed by later patch.

    * sata_sx4 is still using old style EH and currently doesn't take
    advantage of ops inheritance.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • libata lets low level drivers build scsi_host_template and register it
    to the SCSI layer. This allows low level drivers high level of
    flexibility but also burdens them with lots of boilerplate entries.

    This patch implements SHT initializers which can be used to initialize
    all the boilerplate entries in a sht. Three variants of them are
    implemented - BASE, BMDMA and NCQ - for different types of drivers.
    Note that entries can be overriden by putting individual initializers
    after the helper macro.

    All sht tables are identical before and after this patch.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • Over the time, port info, ops and sht structures developed quite a bit
    of inconsistencies. This patch updates drivers.

    * Enable/disable_pm callbacks added to all ahci ops tables.

    * Every driver for SFF controllers now uses ata_sff_port_start()
    instead of ata_port_start() unless the driver has custom
    implementation.

    * Every driver for SFF controllers now uses ata_pci_default_filter()
    unless the driver has custom implementation.

    * Removed an odd port_info->sht initialization from ata_piix.c.
    Likely a merge byproduct.

    * A port which has ATA_FLAG_SATA set doesn't need to set cable_detect
    to ata_cable_sata(). Remove it from via and mv port ops.

    * Some drivers had unnecessary .max_sectors initialization which is
    ignored and was missing .slave_destroy callback. Fixed.

    * Removed unnecessary sht initializations port_info's.

    * Removed onsolete scsi device suspend/resume callbacks from
    pata_bf54x.

    * No reason to set ata_pci_default_filter() and bmdma functions for
    PIO-only drivers. Remove those callbacks and replace
    ata_bmdma_irq_clear with ata_noop_irq_clear.

    * pata_platform sets port_start to ata_dummy_ret0. port_start can
    just be set to NULL.

    * sata_fsl supports NCQ but was missing qc_defer. Fixed.

    * pata_rb600_cf implements dummy port_start. Removed.

    Signed-off-by: Tejun Heo

    Tejun Heo
     
  • ->irq_clear() is used to clear IRQ bit of a SFF controller and isn't
    useful for drivers which don't use libata SFF HSM implementation.
    However, it's a required callback and many drivers implement their own
    noop version as placeholder. This patch implements ata_noop_irq_clear
    and use it to replace those custom placeholders.

    Also, SFF drivers which don't support BMDMA don't need to use
    ata_bmdma_irq_clear(). It becomes noop if BMDMA address isn't
    initialized. Convert them to use ata_noop_irq_clear().

    Signed-off-by: Tejun Heo

    Tejun Heo
     

31 Jan, 2008

1 commit


27 Jan, 2008

1 commit

  • Update MPC5200 drivers to also look for compatible properties in the
    form "fsl,mpc5200-*" to better conform to open firmware generic names
    recommended practice as published here:

    http://www.openfirmware.org/1275/practice/gnames/gnamv14a.html

    This patch should *not* break compatibility with older device trees
    which do not use the 'fsl,' prefix. The drivers will still bind against
    the older names also.

    Signed-off-by: Grant Likely

    Grant Likely
     

23 Jan, 2008

1 commit


14 Oct, 2007

1 commit


13 Oct, 2007

3 commits

  • Currently, port configuration reporting has the following problems.

    * iomapped address is reported instead of raw address
    * report contains irrelevant fields or lacks necessary fields for
    non-SFF controllers.
    * host->irq/irq2 are there just for reporting and hacky.

    This patch implements and uses ata_port_desc() and
    ata_port_pbar_desc(). ata_port_desc() is almost identical to
    ata_ehi_push_desc() except that it takes @ap instead of @ehi, has no
    locking requirement, can only be used during host initialization and "
    " is used as separator instead of ", ". ata_port_pbar_desc() is a
    helper to ease reporting of a PCI BAR or an offsetted address into it.

    LLD pushes whatever description it wants using the above two
    functions. The accumulated description is printed on host
    registration after "[S/P]ATA max MAX_XFERMODE ".

    SFF init helpers and ata_host_activate() automatically add
    descriptions for addresses and irq respectively, so only LLDs which
    isn't standard SFF need to add custom descriptions. In many cases,
    such controllers need to report different things anyway.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo
     
  • It was always set to ata_port_disable(). Removed the hook, and replaced
    the very few ap->ops->port_disable() callsites with direct calls to
    ata_port_disable().

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     
  • * ->irq_ack() is redundant to what the irq handler already
    performs... chk-status + irq-clear. Furthermore, it is only
    called in one place, when screaming-irq-debugging is enabled,
    so we don't want to bother with a hook just for that.

    * ata_dummy_irq_on() is only ever used in drivers that have
    no callpath reaching ->irq_on(). Remove .irq_on hook from
    those drivers, and the now-unused ata_dummy_irq_on()

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     

31 Aug, 2007

1 commit


11 Jul, 2007

1 commit


12 May, 2007

1 commit

  • Reimplement suspend/resume support using sdev->manage_start_stop.

    * Device suspend/resume is now SCSI layer's responsibility and the
    code is simplified a lot.

    * DPM is dropped. This also simplifies code a lot. Suspend/resume
    status is port-wide now.

    * ata_scsi_device_suspend/resume() and ata_dev_ready() removed.

    * Resume now has to wait for disk to spin up before proceeding. I
    couldn't find easy way out as libata is in EH waiting for the
    disk to be ready and sd is waiting for EH to complete to issue
    START_STOP.

    * sdev->manage_start_stop is set to 1 in ata_scsi_slave_config().
    This fixes spindown on shutdown and suspend-to-disk.

    Signed-off-by: Tejun Heo
    Signed-off-by: Jeff Garzik

    Tejun Heo