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
     

16 Dec, 2009

2 commits

  • Two IOC3 and IOC4 drivers have broken error paths on registration. Fix
    them.

    Signed-off-by: Jean Delvare
    Cc: Pat Gefre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     
  • Several IOC3 and IOC4 drivers misuse the __devinit and __devexit section
    markers. Use __init and __exit instead as appropriate, then add __devinit
    and __devexit where they really belong for PCI drivers.

    Also make ioc4_serial_init static.

    Signed-off-by: Jean Delvare
    Cc: Pat Gefre
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jean Delvare
     

07 Apr, 2009

1 commit


17 Mar, 2008

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
     

12 Feb, 2007

1 commit

  • The SGI IOC3 and IOC4 PCI devices implement memory space apertures, not I/O
    space apertures. Use the appropriate region management functions.

    Signed-off-by: Brent Casavant
    Cc: Pat Gefre
    Cc: Stanislaw Skowronek
    Cc: Brent Casavant
    Acked-by: Ralf Baechle
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     

17 Oct, 2006

2 commits

  • The SGI PCI-RT card, based on the SGI IOC4 chip, will be made available on
    Altix XE (x86_64) platforms in the near future. As such it is now a
    misnomer for the IOC4 base device driver to live under drivers/sn, and
    would complicate builds for non-SN2.

    This patch moves the IOC4 base driver code from drivers/sn to drivers/misc,
    and updates the associated Makefiles and Kconfig files to allow building on
    non-SN2 configs. Due to the resulting change in link order, it is now
    necessary to use late_initcall() for IOC4 subdriver initialization.

    [akpm@osdl.org: __udivdi3 fix]
    [akpm@osdl.org: fix default in Kconfig]
    Acked-by: Pat Gefre
    Acked-by: Jeremy Higdon
    Signed-off-by: Brent Casavant
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     
  • The SGI PCI-RT card, based on the SGI IOC4 chip, will be made available on
    Altix XE (x86_64) platforms in the near future. As such dependencies on
    SN2-specific features and config dependencies need to be removed.

    This patch updates the Kconfig files to remove the config dependency, and
    updates the IOC4 bus speed detection routine to use universally available
    time interfaces instead of mmtimer.

    Signed-off-by: Brent Casavant
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     

07 Oct, 2006

1 commit

  • - Eliminate casts to/from void*

    - Eliminate checks for conditions that never occur. These typically
    fall into two classes:

    1) Checking for 'dev_id == NULL', then it is never called with
    NULL as an argument.

    2) Checking for invalid irq number, when the only caller (the
    system) guarantees the irq handler is called with the proper
    'irq' number argument.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     

05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

03 Jul, 2006

1 commit


01 Jul, 2006

1 commit


30 Jun, 2006

1 commit

  • Documention/pci.txt states..
    "The struct pci_driver shouldn't be marked with any of these tags."
    (Referring to __devinit and friends).

    (akpm: good documentation, that. Link this driver into vmlinux with hotplug
    CPU disabled and it'll crash).

    Signed-off-by: Dave Jones
    Cc: Brent Casavant
    Cc: Pat Gefre
    Cc: Jes Sorensen
    Cc: Tony Luck
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     

28 Jun, 2006

1 commit

  • locking init cleanups:

    - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
    - convert rwlocks in a similar manner

    this patch was generated automatically.

    Motivation:

    - cleanliness
    - lockdep needs control of lock initialization, which the open-coded
    variants do not give
    - it's also useful for -rt and for lock debugging in general

    Signed-off-by: Ingo Molnar
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

23 Jun, 2006

1 commit

  • There are three different IO cards which an SGI IOC4 controller may find
    itself on. One of these variants does not bring out the IDE and serial
    signals, so we need to disable attaching the corresponding IOC4 subdrivers
    to such cards.

    Cleans up message clutter emitted during device probing.

    Signed-off-by: Brent Casavant
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     

04 May, 2006

1 commit

  • Currently loading the ioc3 as a module will cause the ports to be numbered
    in reverse order. This mod maintains the proper order of cards for port
    numbering.

    Signed-off-by: Brent Casavant
    Cc: Pat Gefre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     

02 May, 2006

1 commit

  • Currently loading the ioc3 as a module will cause the ports to be numbered
    in reverse order. This mod maintains the proper order of cards for port
    numbering.

    Signed-off-by: Patrick Gefre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pat Gefre
     

11 Apr, 2006

1 commit

  • These are the last conversions of pci_set_dma_mask(),
    pci_set_consistent_dma_mask() and pci_dma_supported() to use DMA_xBIT_MASK
    constants from linux/dma-mapping.h

    Signed-off-by: Tobias Klauser
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

22 Mar, 2006

1 commit


01 Mar, 2006

2 commits


28 Feb, 2006

1 commit

  • Adrian> On architectures like i386, the "Multimedia Capabilities Port
    Adrian> drivers" menu is visible, but it can't be visited since it
    Adrian> contains nothing usable for CONFIG_SGI_SN=n.

    Jes> Thats only a third of the patch, if you want to do that, you should
    Jes> remove the redundant SGI_SN checks below.

    Signed-off-by: Tony Luck

    Jes Sorensen
     

08 Feb, 2006

1 commit


02 Feb, 2006

1 commit


27 Jan, 2006

1 commit


15 Jan, 2006

1 commit

  • Add driver support for a 2 port PCI IOC3-based serial card on Altix boxes:

    This is a re-submission. On the original submission I was asked to
    organize the code so that the MIPS ioc3 ethernet and serial parts could be
    used with this driver. Stanislaw Skowronek was kind enough to provide the
    shim layer for this - thanks Stanislaw. This patch includes the shim layer
    and the Altix PCI ioc3 serial driver. The MIPS merged ioc3 ethernet and
    serial support is forthcoming.

    Signed-off-by: Patrick Gefre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Gefre
     

22 Jun, 2005

3 commits

  • Several hardware features of SGI's IOC4 I/O controller chip require
    timing-related driver calculations dependent upon the PCI bus speed. This
    patch enables the core IOC4 driver code to detect the actual bus speed and
    store a value that can later be used by the IOC4 subdrivers as needed.

    Signed-off-by: Brent Casavant
    Acked-by: Pat Gefre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     
  • The SGI IOC4 I/O controller chip drivers are currently all configured by
    CONFIG_BLK_DEV_SGIIOC4. This is undesirable as not all IOC4 hardware features
    are needed by all systems.

    This patch adds two configuration variables, CONFIG_SGI_IOC4 for core IOC4
    driver support (see patch 1/3 in this series for further explanation) and
    CONFIG_SERIAL_SGI_IOC4 to independently enable serial port support.

    Signed-off-by: Brent Casavant
    Acked-by: Pat Gefre
    Acked-by: Jeremy Higdon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     
  • This series of patches reworks the configuration and internal structure
    of the SGI IOC4 I/O controller device drivers.

    These changes are motivated by several factors:

    - The IOC4 chip PCI resources are of mixed use between functions (i.e.
    multiple functions are handled in the same address range, sometimes
    within the same register), muddling resource ownership and initialization
    issues. Centralizing this ownership in a core driver is desirable.

    - The IOC4 chip implements multiple functions (serial, IDE, others not
    yet implemented in the mainline kernel) but is not a multifunction
    PCI device. In order to properly handle device addition and removal
    as well as module insertion and deletion, an intermediary IOC4-specific
    driver layer is needed to handle these operations cleanly.

    - All IOC4 drivers are currently enabled by a single CONFIG value. As
    not all systems need all IOC4 functions, it is desireable to enable
    these drivers independently.

    - The current IOC4 core driver will trigger loading of all function-level
    drivers, as it makes direct calls to them. This situation should be
    reversed (i.e. function-level drivers cause loading of core driver)
    in order to maintain a clear and least-surprise driver loading model.

    - IOC4 hardware design necessitates some driver-level dependency on
    the PCI bus clock speed. Current code assumes a 66MHz bus, but the
    speed should be autodetected and appropriate compensation taken.

    This patch series effects the above changes by a newly and better designed
    IOC4 core driver with which the function-level drivers can register and
    deregister themselves upon module insertion/removal. By tracking these
    modules, device addition/removal is also handled properly. PCI resource
    management and ownership issues are centralized in this core driver, and
    IOC4-wide configuration actions such as bus speed detection are also
    handled in this core driver.

    This patch:

    The SGI IOC4 I/O controller chip implements multiple functions, though it is
    not a multi-function PCI device. Additionally, various PCI resources of the
    IOC4 are shared by multiple hardware functions, and thus resource ownership by
    driver is not clearly delineated. Due to the current driver design, all core
    and subordinate drivers must be loaded, or none, which is undesirable if not
    all IOC4 hardware features are being used.

    This patch reorganizes the IOC4 drivers so that the core driver provides a
    subdriver registration service. Through appropriate callbacks the subdrivers
    can now handle device addition and removal, as well as module insertion and
    deletion (though the IOC4 IDE driver requires further work before module
    deletion will work). The core driver now takes care of allocating PCI
    resources and data which must be shared between subdrivers, to clearly
    delineate module ownership of these items.

    Signed-off-by: Brent Casavant
    Acked-by: Pat Gefre
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brent Casavant
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds