19 Jul, 2020

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

22 Dec, 2018

1 commit

  • Convert string compares of DT node names to use of_node_name_{eq,prefix}
    helpers instead. This removes direct access to the node name pointer.

    This changes a single case insensitive node name comparison to case
    sensitive for "ata4". This is the only instance of a case insensitive
    comparison for all the open coded node name comparisons on powerpc.
    Searching the commit history, there doesn't appear to be any reason for
    it to be case insensitive.

    A couple of open coded iterating thru the child node names are converted
    to use for_each_child_of_node() instead.

    Signed-off-by: Rob Herring
    Signed-off-by: Michael Ellerman

    Rob Herring
     

26 Nov, 2018

1 commit


03 Oct, 2018

1 commit


14 Feb, 2018

1 commit

  • We have expected busses to set up a coherent mask to properly use the
    common dma mapping code for a long time, and now that I've added a warning
    macio turned out to not set one up yet. This sets it to the same value
    as the dma_mask, which seems to be what the drivers expect.

    Reported-by: Mathieu Malaterre
    Tested-by: Mathieu Malaterre
    Reported-by: Meelis Roos
    Tested-by: Meelis Roos
    Signed-off-by: Christoph Hellwig

    Christoph Hellwig
     

09 Jun, 2017

1 commit


10 Mar, 2017

1 commit

  • Commit 5657933dbb6e ("treewide: Move dma_ops from struct dev_archdata
    into struct device") introduced a crash for macio devices, an example
    backtrace being:

    kernel BUG at ./include/linux/dma-mapping.h:465!
    Oops: Exception in kernel mode, sig: 5 [#1]
    ...
    NIP [c031ddb0] dmam_alloc_coherent+0x74/0x140
    LR [c031de70] dmam_alloc_coherent+0x134/0x140
    Call Trace:
    dmam_alloc_coherent+0x134/0x140 (unreliable)
    pata_macio_port_start+0x3c/0x8c
    ata_host_start.part.5+0xfc/0x208
    ata_host_activate+0x128/0x154
    pata_macio_common_init+0x2f0/0x538
    pata_macio_attach+0xd8/0x180
    macio_device_probe+0x5c/0xec
    driver_probe_device+0x21c/0x314
    __driver_attach+0xcc/0xd0
    bus_for_each_dev+0x68/0xb4
    bus_add_driver+0x1dc/0x244
    driver_register+0x88/0x130
    pata_macio_init+0x5c/0x88
    do_one_initcall+0x40/0x170
    kernel_init_freeable+0x134/0x1d0
    kernel_init+0x18/0x110
    ret_from_kernel_thread+0x5c/0x64

    This was caused by the device having NULL dma_ops, triggering the
    BUG_ON(). Previously the device inherited its dma_ops via the assignment
    to dev->ofdev.dev.archdata. However after commit 5657933dbb6e the
    dma_ops are moved into dev->ofdev.dev, and so they need to be explicitly
    copied.

    Fixes: 5657933dbb6e ("treewide: Move dma_ops from struct dev_archdata into struct device")
    Signed-off-by: Larry Finger
    Suggested-by: Benjamin Herrenschmidt
    [mpe: Rewrite change log, add backtrace]
    Signed-off-by: Michael Ellerman

    Larry Finger
     

20 Sep, 2016

1 commit

  • NO_IRQ has been == 0 on powerpc for just over ten years (since commit
    0ebfff1491ef ("[POWERPC] Add new interrupt mapping core and change
    platforms to use it")). It's also 0 on most other arches.

    Although it's fairly harmless, every now and then it causes confusion
    when a driver is built on powerpc and another arch which doesn't define
    NO_IRQ. There's at least 6 definitions of NO_IRQ in drivers/, at least
    some of which are to work around that problem.

    So we'd like to remove it. This is fairly trivial in the arch code, we
    just convert:

    if (irq == NO_IRQ) to if (!irq)
    if (irq != NO_IRQ) to if (irq)
    irq = NO_IRQ; to irq = 0;
    return NO_IRQ; to return 0;

    And a few other odd cases as well.

    At least for now we keep the #define NO_IRQ, because there is driver
    code that uses NO_IRQ and the fixes to remove those will go via other
    trees.

    Note we also change some occurrences in PPC sound drivers, drivers/ps3,
    and drivers/macintosh.

    Signed-off-by: Michael Ellerman

    Michael Ellerman
     

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
     

10 Oct, 2013

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, __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: Benjamin Herrenschmidt
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

06 Oct, 2012

1 commit


02 Feb, 2012

1 commit

  • When userspace needs to find a specific device, it currently isn't easy to
    resolve a /sys/devices/ path from a specific device tree node. Nor is it
    easy to obtain the compatible list for devices.

    This patch generalizes the code that inserts OF_* values into the uevent
    device attribute so that any device that is attached to an OF node will
    have that information exported to userspace. Without this patch only
    platform devices and some powerpc-specific busses have access to this
    data.

    The original function also creates a MODALIAS property for the compatible
    list, but that code has not been generalized into the common case because
    it has the potential to break module loading on a lot of bus types. Bus
    types are still responsible for their own MODALIAS properties.

    Boot tested on ARM and compile tested on PowerPC and SPARC.

    Signed-off-by: Grant Likely
    Acked-by: Greg Kroah-Hartman
    Cc: Tobias Klauser
    Cc: Frederic Lambert
    Cc: Rob Herring
    Cc: Mark Brown
    Cc: "David S. Miller"
    Cc: Benjamin Herrenschmidt

    Grant Likely
     

29 Nov, 2010

1 commit


02 Jun, 2010

2 commits


22 May, 2010

3 commits


19 May, 2010

1 commit


08 Dec, 2009

2 commits


20 Aug, 2009

1 commit


26 Jun, 2009

1 commit

  • The macio_dev's created to map devices inside the MacIO ASICs
    don't have proper dma_ops. This causes crashes on some machines
    since the SCSI code calls dma_map_* on our behalf using the
    device we hang from.

    This fixes it by copying the parent PCI device dma_ops into
    the macio_dev when creating it.

    Signed-off-by: Benjamin Herrenschmidt

    Benjamin Herrenschmidt
     

07 Jan, 2009

1 commit


20 Jul, 2007

1 commit

  • Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc).

    Here is a short excerpt of the semantic patch performing
    this transformation:

    @@
    type T2;
    expression x;
    identifier f,fld;
    expression E;
    expression E1,E2;
    expression e1,e2,e3,y;
    statement S;
    @@

    x =
    - kmalloc
    + kzalloc
    (E1,E2)
    ... when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\)
    - memset((T2)x,0,E1);

    @@
    expression E1,E2,E3;
    @@

    - kzalloc(E1 * E2,E3)
    + kcalloc(E1,E2,E3)

    [akpm@linux-foundation.org: get kcalloc args the right way around]
    Signed-off-by: Yoann Padioleau
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Acked-by: Russell King
    Cc: Bryan Wu
    Acked-by: Jiri Slaby
    Cc: Dave Airlie
    Acked-by: Roland Dreier
    Cc: Jiri Kosina
    Acked-by: Dmitry Torokhov
    Cc: Benjamin Herrenschmidt
    Acked-by: Mauro Carvalho Chehab
    Acked-by: Pierre Ossman
    Cc: Jeff Garzik
    Cc: "David S. Miller"
    Acked-by: Greg KH
    Cc: James Bottomley
    Cc: "Antonino A. Daplas"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yoann Padioleau
     

27 Apr, 2007

1 commit


26 Apr, 2007

1 commit


13 Apr, 2007

2 commits


01 Aug, 2006

1 commit


31 Jul, 2006

1 commit

  • Now that get_property() returns a void *, there's no need to cast its
    return value. Also, treat the return value as const, so we can
    constify get_property later.

    powermac platform & macintosh driver changes.

    Built for pmac32_defconfig, g5_defconfig

    Signed-off-by: Jeremy Kerr
    Signed-off-by: Paul Mackerras

    Jeremy Kerr
     

11 Jul, 2006

1 commit

  • This patch slightly reworks the new irq code to fix a small design error. I
    removed the passing of the trigger to the map() calls entirely, it was not a
    good idea to have one call do two different things. It also fixes a couple of
    corner cases.

    Mapping a linux virtual irq to a physical irq now does only that. Setting the
    trigger is a different action which has a different call.

    The main changes are:

    - I no longer call host->ops->map() for an already mapped irq, I just return
    the virtual number that was already mapped. It was called before to give an
    opportunity to change the trigger, but that was causing issues as that could
    happen while the interrupt was in use by a device, and because of the
    trigger change, map would potentially muck around with things in a racy way.
    That was causing much burden on a given's controller implementation of
    map() to get it right. This is much simpler now. map() is only called on
    the initial mapping of an irq, meaning that you know that this irq is _not_
    being used. You can initialize the hardware if you want (though you don't
    have to).

    - Controllers that can handle different type of triggers (level/edge/etc...)
    now implement the standard irq_chip->set_type() call as defined by the
    generic code. That means that you can use the standard set_irq_type() to
    configure an irq line manually if you wish or (though I don't like that
    interface), pass explicit trigger flags to request_irq() as defined by the
    generic kernel interfaces. Also, using those interfaces guarantees that
    your controller set_type callback is called with the descriptor lock held,
    thus providing locking against activity on the same interrupt (including
    mask/unmask/etc...) automatically. A result is that, for example, MPIC's
    own map() implementation calls irq_set_type(NONE) to configure the hardware
    to the default triggers.

    - To allow the above, the irq_map array entry for the new mapped interrupt
    is now set before map() callback is called for the controller.

    - The irq_create_of_mapping() (also used by irq_of_parse_and_map()) function
    for mapping interrupts from the device-tree now also call the separate
    set_irq_type(), and only does so if there is a change in the trigger type.

    - While I was at it, I changed pci_read_irq_line() (which is the helper I
    would expect most archs to use in their pcibios_fixup() to get the PCI
    interrupt routing from the device tree) to also handle a fallback when the
    DT mapping fails consisting of reading the PCI_INTERRUPT_PIN to know wether
    the device has an interrupt at all, and the the PCI_INTERRUPT_LINE to get an
    interrupt number from the device. That number is then mapped using the
    default controller, and the trigger is set to level low. That default
    behaviour works for several platforms that don't have a proper interrupt
    tree like Pegasos. If it doesn't work for your platform, then either
    provide a proper interrupt tree from the firmware so that fallback isn't
    needed, or don't call pci_read_irq_line()

    - Add back a bit that got dropped by my main rework patch for properly
    clearing pending IPIs on pSeries when using a kexec

    Signed-off-by: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     

03 Jul, 2006

1 commit

  • This adds the new irq remapper core and removes the old one. Because
    there are some fundamental conflicts with the old code, like the value
    of NO_IRQ which I'm now setting to 0 (as per discussions with Linus),
    etc..., this commit also changes the relevant platform and driver code
    over to use the new remapper (so as not to cause difficulties later
    in bisecting).

    This patch removes the old pre-parsing of the open firmware interrupt
    tree along with all the bogus assumptions it made to try to renumber
    interrupts according to the platform. This is all to be handled by the
    new code now.

    For the pSeries XICS interrupt controller, a single remapper host is
    created for the whole machine regardless of how many interrupt
    presentation and source controllers are found, and it's set to match
    any device node that isn't a 8259. That works fine on pSeries and
    avoids having to deal with some of the complexities of split source
    controllers vs. presentation controllers in the pSeries device trees.

    The powerpc i8259 PIC driver now always requests the legacy interrupt
    range. It also has the feature of being able to match any device node
    (including NULL) if passed no device node as an input. That will help
    porting over platforms with broken device-trees like Pegasos who don't
    have a proper interrupt tree.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     

02 Jul, 2006

1 commit

  • The 64 bits resource patches did a bit of damage on PowerMac causing a
    buffer overflow in macio_asic and a warning in a sound driver. The
    former is fixed by reverting the sprintf of the bus_id to %08x as it was
    before. The bus_id used for macio devices is always a 32 bits value
    (macio always sits in 32 bits space) and since it's exposed to userland,
    the format of the string shouldn't be changed like that anyway. The
    second by using the proper type for printk.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     

01 Jul, 2006

1 commit


28 Jun, 2006

1 commit


23 Mar, 2006

1 commit

  • Remove the assumption that driver_register() returns the number of devices
    bound to the driver. In fact, it returns zero for success or a negative
    error value.

    All callers of macio_register_driver() either ignore the return value or
    return it as the return value of a module_init() function.

    Signed-off-by: Bjorn Helgaas
    Cc: Benjamin Herrenschmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Paul Mackerras

    Bjorn Helgaas
     

02 Feb, 2006

1 commit

  • Prodive a MODALIAS= enviroment variable for devices on the mac-io bus.
    Change the buffer length counter to not waste memory by advancing the
    pointer for the next string too far. Tested on an ibook1 with modular
    pmac_zilog.

    Signed-off-by: Olaf Hering
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering