19 Feb, 2016

1 commit

  • The RB532 platform specific irq_to_gpio() implementation has been
    removed with commit 832f5dacfa0b ("MIPS: Remove all the uses of
    custom gpio.h"). Now the platform uses the generic stub which causes
    the following error:

    pata-rb532-cf pata-rb532-cf: no GPIO found for irq149
    pata-rb532-cf: probe of pata-rb532-cf failed with error -2

    Drop the irq_to_gpio() call and get the GPIO number from platform
    data instead. After this change, the driver works again:

    scsi host0: pata-rb532-cf
    ata1: PATA max PIO4 irq 149
    ata1.00: CFA: CF 1GB, 20080820, max MWDMA4
    ata1.00: 1989792 sectors, multi 0: LBA
    ata1.00: configured for PIO4
    scsi 0:0:0:0: Direct-Access ATA CF 1GB 0820 PQ: 0\
    ANSI: 5
    sd 0:0:0:0: [sda] 1989792 512-byte logical blocks: (1.01 GB/971 MiB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't\
    support DPO or FUA
    sda: sda1 sda2
    sd 0:0:0:0: [sda] Attached SCSI disk

    Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h")
    Cc: Alban Bedel
    Cc: Ralf Baechle
    Cc: Arnd Bergmann
    Cc: #v4.3+
    Signed-off-by: Gabor Juhos
    Signed-off-by: Tejun Heo

    Gabor Juhos
     

03 Sep, 2015

1 commit

  • Currently CONFIG_ARCH_HAVE_CUSTOM_GPIO_H is defined for all MIPS
    machines, and each machine type provides its own gpio.h. However
    only a handful really implement the GPIO API, most just forward
    everythings to gpiolib.

    The Alchemy machine is notable as it provides a system to allow
    implementing the GPIO API at the board level. But it is not used by
    any board currently supported, so it can also be removed.

    For most machine types we can just remove the custom gpio.h, as well
    as the custom wrappers if some exists. Some of the code found in
    the wrappers must be moved to the respective GPIO driver.

    A few more fixes are need in some drivers as they rely on linux/gpio.h
    to provides some machine specific definitions, or used asm/gpio.h
    instead of linux/gpio.h for the gpio API.

    Signed-off-by: Alban Bedel
    Reviewed-by: Linus Walleij
    Cc: linux-mips@linux-mips.org
    Cc: Hauke Mehrtens
    Cc: Rafał Miłecki
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Tejun Heo
    Cc: Alexandre Courbot
    Cc: Dmitry Torokhov
    Cc: Florian Fainelli
    Cc: Manuel Lauss
    Cc: Joe Perches
    Cc: Daniel Walter
    Cc: Sergey Ryazanov
    Cc: Huacai Chen
    Cc: James Hartley
    Cc: Andrew Bresticker
    Cc: Paul Burton
    Cc: Jiri Kosina
    Cc: Bjorn Helgaas
    Cc: Wolfram Sang
    Cc: Randy Dunlap
    Cc: Varka Bhadram
    Cc: Masanari Iida
    Cc: Tomi Valkeinen
    Cc: Michael Buesch
    Cc: abdoulaye berthe
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-ide@vger.kernel.org
    Cc: linux-gpio@vger.kernel.org
    Cc: linux-input@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/10828/
    Signed-off-by: Ralf Baechle

    Alban Bedel
     

20 Oct, 2014

1 commit


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
     

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
     

29 Mar, 2011

1 commit


02 Mar, 2011

2 commits

  • All checks of ATA_FLAG_NO_LEGACY have been removed by the commits
    c791c30670ea61f19eec390124128bf278e854fe ([libata] minor PCI IDE probe
    fixes and cleanups) and f0d36efdc624beb3d9e29b9ab9e9537bf0f25d5b (libata:
    update libata core layer to use devres), so I think it's time to finally
    get rid of this flag...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     
  • Commit 0d5ff566779f894ca9937231a181eb31e4adff0e (libata: convert to iomap)
    removed all checks of ATA_FLAG_MMIO but neglected to remove the flag itself.
    Do it now, at last...

    Signed-off-by: Sergei Shtylyov
    Signed-off-by: Jeff Garzik

    Sergei Shtylyov
     

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
     

11 Sep, 2009

1 commit

  • Use the function resource_size, which reduces the chance of introducing
    off-by-one errors in calculating the resource size.

    The semantic patch that makes this change is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @@
    struct resource *res;
    @@

    - (res->end - res->start) + 1
    + resource_size(res)
    //

    Signed-off-by: Julia Lawall
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Jeff Garzik

    Julia Lawall
     

25 Mar, 2009

6 commits

  • platform_get_irq() can return -ENXIO, but since 'irq' is an
    unsigned int, it does not show when the IRQ resource wasn't found.
    Make irq an int so that we can use a single variable to test the
    platform_get_irq() return value.

    Signed-off-by: Roel Kluin
    Signed-off-by: Phil Sutter
    Signed-off-by: Florian Fainelli
    Signed-off-by: Jeff Garzik

    Florian Fainelli
     
  • No functional changes in this patch.

    Signed-off-by: Erik Inge Bolsø
    Signed-off-by: Jeff Garzik

    Erik Inge Bolsø
     
  • I'm not quite sure what freezing and thawing is used for. Tests showed
    that the port is being frozen at initialisation state and thawed right
    afterwards, then the functions were not called anymore. Dropping the
    complete custom code for handling the frozen state seems to work at
    least for a standard use case including mounting a partition, copying
    some files in it (in parallel) and finally removing them and unmounting
    the partition.

    Signed-off-by: Phil Sutter
    Signed-off-by: Jeff Garzik

    Phil Sutter
     
  • The biggest difference between rb532_pata_data_xfer() and
    ata_sff_data_xfer32() is the call to ata_sff_pause() at the end of
    rb532_pata_data_xfer() which I suppose to be unnecessary since it works
    without. I've also tested using ata_sff_data_xfer() as replacement, but
    since we know that the driver supports 32bit IO, using the optimised
    version should be safe.

    Signed-off-by: Phil Sutter
    Signed-off-by: Jeff Garzik

    Phil Sutter
     
  • The only difference between rb532_pata_exec_command() and
    ata_sff_exec_command() is added debugging output, so it can be dropped
    and the standard op used instead.

    Signed-off-by: Phil Sutter
    Signed-off-by: Jeff Garzik

    Phil Sutter
     
  • Since the delay used internally is just the same as ata_sff_pause()
    uses, rb532_pata_finish_io() does exactly the same as ata_sff_pause()
    and thus can be replaced by the later one.

    Signed-off-by: Phil Sutter
    Signed-off-by: Jeff Garzik

    Phil Sutter
     

27 Jan, 2009

1 commit


02 Dec, 2008

2 commits

  • Per definition, this function should return the number of bytes
    consumed. As the original parameter "buflen" is being decremented inside
    the read/write loop, save it in "retlen" at the beginning.

    Signed-off-by: Phil Sutter
    Acked-by: Sergei Shtyltov
    Acked-by: Bartlomiej Zolnierkiewicz
    Acked-by: Florian Fainelli
    Signed-off-by: Jeff Garzik

    Phil Sutter
     
  • The original standalone driver uses a custom address for the error
    register. Use it in pata_rb532_cf, too.

    Rename two register definitions:
    - The address offset 0x0800 in fact is the ATA base, not ATA command
    address.
    - The offset 0x0C00 is not a regular ATA data address, but a buffered one
    allowing 4-byte IO.

    Signed-off-by: Phil Sutter
    Signed-off-by: Jeff Garzik

    Phil Sutter
     

04 Jun, 2008

1 commit

  • - Make ata_sff_altstatus private so nobody uses it by mistake
    - Drop the 400nS delay from it

    Add

    ata_sff_irq_status - encapsulates the IRQ check logic

    This function keeps the existing behaviour for altstatus using devices. I
    actually suspect the logic was wrong before the changes but -rc isn't the
    time to play with that

    ata_sff_sync - ensure writes hit the device

    Really we want an io* operation for 'is posted' eg ioisposted(ioaddr) so
    that we can fix the nasty delay this causes on most systems.

    - ata_sff_pause - 400nS delay

    Ensure the command hit the device and delay 400nS

    - ata_sff_dma_pause

    Ensure the I/O hit the device and enforce an HDMA1:0 transition delay.
    Requires altstatus register exists, BUG if not so we don't risk
    corruption in MWDMA modes. (UDMA the checksum will save your backside in
    theory)

    The only other complication then is devices with their own handlers.
    rb532 can use dma_pause but scc needs to access its own altstatus
    register for internal errata workarounds so directly call the drivers own
    altstatus function.

    Signed-off-by: Alan Cox
    Signed-off-by: Jeff Garzik

    Alan Cox
     

29 Apr, 2008

1 commit