22 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
     

12 Dec, 2009

1 commit

  • Unfortunately, one cannot hold on to the struct firmware
    that request_firmware_nowait() hands off, which is needed
    in some cases. Allow this by requiring the callback to
    free it (via release_firmware).

    Additionally, give it a gfp_t parameter -- all the current
    users call it from a GFP_KERNEL context so the GFP_ATOMIC
    isn't necessary. This also marks an API break which is
    useful in a sense, although that is obviously not the
    primary purpose of this change.

    Signed-off-by: Johannes Berg
    Acked-by: Marcel Holtmann
    Cc: Ming Lei
    Cc: Catalin Marinas
    Cc: David Woodhouse
    Cc: Pavel Roskin
    Cc: Abhay Salunke
    Signed-off-by: Greg Kroah-Hartman

    Johannes Berg
     

18 Jan, 2009

1 commit


26 Jul, 2008

1 commit


10 Jul, 2008

1 commit


29 Apr, 2008

1 commit


12 Jul, 2007

2 commits

  • Well, first of all, I don't want to change so many files either.

    What I do:
    Adding a new parameter "struct bin_attribute *" in the
    .read/.write methods for the sysfs binary attributes.

    In fact, only the four lines change in fs/sysfs/bin.c and
    include/linux/sysfs.h do the real work.
    But I have to update all the files that use binary attributes
    to make them compatible with the new .read and .write methods.
    I'm not sure if I missed any. :(

    Why I do this:
    For a sysfs attribute, we can get a pointer pointing to the
    struct attribute in the .show/.store method,
    while we can't do this for the binary attributes.
    I don't know why this is different, but this does make it not
    so handy to use the binary attributes as the regular ones.
    So I think this patch is reasonable. :)

    Who benefits from it:
    The patch that exposes ACPI tables in sysfs
    requires such an improvement.
    All the table binary attributes share the same .read method.
    Parameter "struct bin_attribute *" is used to get
    the table signature and instance number which are used to
    distinguish different ACPI table binary attributes.

    Without this parameter, we need to offer different .read methods
    for different ACPI table binary attributes.
    This is impossible as there are various ACPI tables on different
    platforms, and we don't know what they are until they are loaded.

    Signed-off-by: Zhang Rui
    Signed-off-by: Greg Kroah-Hartman

    Zhang Rui
     
  • sysfs is now completely out of driver/module lifetime game. After
    deletion, a sysfs node doesn't access anything outside sysfs proper,
    so there's no reason to hold onto the attribute owners. Note that
    often the wrong modules were accounted for as owners leading to
    accessing removed modules.

    This patch kills now unnecessary attribute->owner. Note that with
    this change, userland holding a sysfs node does not prevent the
    backing module from being unloaded.

    For more info regarding lifetime rule cleanup, please read the
    following message.

    http://article.gmane.org/gmane.linux.kernel/510293

    (tweaked by Greg to not delete the field just yet, to make it easier to
    merge things properly.)

    Signed-off-by: Tejun Heo
    Cc: Cornelia Huck
    Cc: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Tejun Heo
     

17 Nov, 2006

1 commit

  • platform_device_register_simple() returns error code as pointer when it
    fails. The return value should be checked by IS_ERR().

    Cc: Abhay Salunke
    Signed-off-by: Akinobu Mita
    Cc: Matt Domsch
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

12 Oct, 2006

2 commits


03 Oct, 2006

1 commit


01 Jul, 2006

1 commit


15 Jan, 2006

1 commit

  • This fixes http://bugzilla.kernel.org/show_bug.cgi?id=5854

    Root cause:

    The dell_rbu driver creates entries in /sys/class/firmware/dell_rbu/ by
    calling request_firmware_nowait (without hotplug ) this function inturn
    starts a kernel thread which creates the entries in
    /sys/class/firmware/dell_rbu/loading , data and the thread waits on the
    user action to return control back to the callback fucntion of dell_rbu.
    The thread calls wait_on_completion which puts it in a D state until the
    user action happens. If there is no user action happening the load average
    goes up as the thread D state is taken in to account. Also after
    downloading the BIOS image the enrties go away momentarily but they are
    recreated from the callback function in dell_rbu. This causes the thread
    to get recreated causing the load average to permenently stay around 1.

    Fix:

    The dell_rbu also creates the entry
    /sys/devices/platform/dell_rbu/image_type at driver load time. The image
    type by default is mono if required the user can echo packet to image_type
    to make the BIOS update mechanism using packets. Also by echoing init in
    to image_type the /sys/class/firmware/dell_rbu entries can be created.

    The driver code was changed to not create /sys/class/firmware/dell_rbu
    entries during load time, and also to not create the above entries from the
    callback function. The entries are only created by echoing init to
    /sys/devices/platform/dell_rbu/image_type The user now needs to create the
    entries to download the image monolithic or packet. This fixes the issue
    since the kernel thread only is created when ever the user is ready to
    download the BIOS image; this minimizes the life span of the kernel thread
    and the load average goes back to normal.

    Signed off by Abhay Salunke

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

    Abhay Salunke
     

16 Dec, 2005

1 commit


09 Nov, 2005

1 commit

  • This patch removes almost all inclusions of linux/version.h. The 3
    #defines are unused in most of the touched files.

    A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is
    unfortunatly in linux/version.h.

    There are also lots of #ifdef for long obsolete kernels, this was not
    touched. In a few places, the linux/version.h include was move to where
    the LINUX_VERSION_CODE was used.

    quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'`

    search pattern:
    /UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h

    Signed-off-by: Olaf Hering
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Olaf Hering
     

07 Nov, 2005

1 commit

  • This patch has the changes to support the memory floor fix done in Dell
    BIOS. The BIOS incase of packet update mechanism would not accept packet
    placed in memory below a cretain address. This address is by default 128K
    but can change. The driver now can accept the memory floor if the user
    chooses to make it will try to allocate contiguous physical memory above
    the memory floor by allocating a set of packets till a valid memory
    allocation is made. All the allocates then are freed. This repeats for
    everty packet.

    This patch was created by Michael E Brown and has been tested on 2.6.14-rc5

    Signed-of-by: Michael E Brown
    Signed-off-by: Abhay Salunke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Abhay Salunke
     

30 Oct, 2005

1 commit


12 Oct, 2005

1 commit

  • In the current dell_rbu code ver 2.0 the packet update mechanism makes the
    user app dump every individual packet in to the driver.

    This adds in efficiency as every packet update makes the
    /sys/class/firmware/dell_rbu/loading and data files to disappear and reappear
    again. Thus the user app needs to wait for the files to reappear to dump
    another packet. This slows down the packet update tremendously in case of
    large number of packets. I am submitting a new patch for dell_rbu which will
    change the way we do packet updates;

    In the new method the user app will create a new single file which has already
    packetized the rbu image and all the packets are now staged in this file.

    This driver also creates a new entry in
    /sys/devices/platform/dell_rbu/packet_size ; the user needs to echo the packet
    size here before downloading the packet file.

    The user should do the following:

    create one single file which has all the packets stacked together.
    echo the packet size in to /sys/devices/platform/dell_rbu/packet_size.
    echo 1 > /sys/class/firmware/dell_rbu/loading
    cat the packetfile > /sys/class/firmware/dell_rbu/data
    echo 0 > /sys/class/firmware/dell_rbu/loading

    The driver takes the file which came through /sys/class/firmware/dell_rbu/data
    and takes chunks of paket_size data from it and place in contiguous memory.

    This makes packet update process very efficient and fast. As all the packet
    update happens in one single operation. The user can still read back the
    downloaded file from /sys/devices/platform/dell_rbu/data.

    Signed-off-by: Abhay Salunke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Abhay Salunke
     

18 Sep, 2005

2 commits

  • Whitespace standardisation.

    Cc: Abhay Salunke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • BUG fixes:

    The driver used to allocate memory with spinlock held which has been
    fixed in this patch.

    The driver was printing the entire buffer when it received a invalid
    entry in image_type. The fix is to only print a warning message and not
    the buffer.

    Usability enhancements:

    It is possible that due to user error the /sys/class/firmware/dell_rbu
    entries might be missing, this can happen if the user does the following

    echo 1 > /sys/class/firmware/dell_rbu/loading
    echo 0 > /sys/class/firmware/dell_rbu/loading

    This will make the entries in /sys/class/firmware/ to disappear and the
    only way get them back was bby unloading and loading the driver.

    This patch makes the user recreate these entries by echoing init in to
    image_type.

    This patch has been tested with Libsmbios and Dell OpenManage.

    Signed-off-by: Abhay Salunke
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Abhay Salunke
     

08 Sep, 2005

1 commit