17 Oct, 2007

1 commit

  • drivers/message/i2o/exec-osm.c:539: warning: `i2o_exec_lct_notify' defined but not used

    comes when CONFIG_I2O_LCT_NOTIFY_ON_CHANGES=n, because its only callsite
    is #ifdef'ed as such. So let's #ifdef the function definition also. Also
    move the definition to before the callsite, to get rid of forward prototype.

    [akpm@linux-foundation.org: fix warnings]
    Signed-off-by: Satyam Sharma
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Satyam Sharma
     

16 Oct, 2007

1 commit


01 Aug, 2007

1 commit

  • drivers/message/i2o/i2o_block.c: In function 'i2o_block_transfer':
    drivers/message/i2o/i2o_block.c:837: warning: integer overflow in expression

    msg->u.head[1] = cpu_to_le32(I2O_CMD_PRIVATE << 24 | HOST_TID << 12 | tid);
    and I2O_CMD_PRIVATE is defined as 0xFF. This gets "0xFF0100 | tid" and fits
    into 32-bit unsigned but not into 32-bit signed integer properly. Target
    value is defined as u32 so the claculation does not fit during computation.

    Change local variable tid to u32 so the whole expression is of u32 type and
    fits well into u32 result.

    Signed-off-by: Meelis Roos
    Cc: "Salyzyn, Mark"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Meelis Roos
     

24 Jul, 2007

1 commit

  • Some of the code has been gradually transitioned to using the proper
    struct request_queue, but there's lots left. So do a full sweet of
    the kernel and get rid of this typedef and replace its uses with
    the proper type.

    Signed-off-by: Jens Axboe

    Jens Axboe
     

20 Jul, 2007

1 commit

  • Slab destructors were no longer supported after Christoph's
    c59def9f222d44bb7e2f0a559f2906191a0862d7 change. They've been
    BUGs for both slab and slub, and slob never supported them
    either.

    This rips out support for the dtor pointer from kmem_cache_create()
    completely and fixes up every single callsite in the kernel (there were
    about 224, not including the slab allocator definitions themselves,
    or the documentation references).

    Signed-off-by: Paul Mundt

    Paul Mundt
     

18 Jul, 2007

5 commits

  • Fix output of i2o debug messages, extra KERN_ are removed.

    Signed-off-by: Vasily Averin
    Acked-by: Alan Cox
    Cc: Markus Lidel
    Acked-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • Fix oops on reading from some i2o proc files (i2o_seq_show_driver_store() and
    other) because their handlers uses "exec" field in struct i2o_controller

    Signed-off-by: Vasily Averin
    Acked-by: Alan Cox
    Cc: Markus Lidel
    Acked-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • We need to free i2o msg in case of error.

    Signed-off-by: Vasily Averin
    Acked-by: Alan Cox
    Cc: Markus Lidel
    Acked-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • This patch fixes access to memory that has not been allocated:
    i2o_msg_get_wait() can returns errors different from I2O_QUEUE_EMPTY. But the
    result is checked only against this code. If it is not I2O_QUEUE_EMPTY then
    we dereference the error code as the pointer later.

    Signed-off-by: Vasily Averin
    Acked-by: Alan Cox
    Cc: Markus Lidel
    Acked-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • This patch fixes a number of issues in i2o_cfg_passthru{,32}:
    - i2o_msg_get_wait() return vaile is not checked;
    - i2o_message memory leaks on error paths;
    - infinite loop to sg_list_cleanup in passthru32

    It's important issue because of i2o_cfg_passthru is used by raidutils for
    monitorig controllers state, and in case of memory shortage it leads to the
    node crash or disk IO stall.

    [akpm@linux-foundation.org: fix null-ptr deref]
    Signed-off-by: Vasily Averin
    Acked-by: Alan Cox
    Cc: Markus Lidel
    Acked-by: Kirill Korotaev
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     

17 Jul, 2007

3 commits

  • Make some offending drivers depend on it and set CONFIG_ARCH_NO_VIRT_TO_BUS
    for ppc64 so that we don't build those drivers.

    This gets PowerPC allmodconfig and allyesconfig much closer to building.

    Signed-off-by: Stephen Rothwell
    Cc: Al Viro
    Acked-by: David Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Rothwell
     
  • The I2O driver uses two semaphores as mutexes. Use the mutex API instead of
    the (binary) semaphores.

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

    Matthias Kaehlcke
     
  • Use menuconfigs instead of menus, so the whole menu can be disabled at once
    instead of going through all options.

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

    Jan Engelhardt
     

15 Jul, 2007

1 commit


18 Jun, 2007

1 commit


24 May, 2007

3 commits

  • There is no reason i2o_max_drivers must be a power of two. This patch
    eliminates such a constraint.

    Cc: Markus Lidel
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Maximum number of I2O drivers which could be registered is configurable by
    max_drivers module parameter.

    But the module parameter is ignored and default value (I2O_MAX_DRIVERS = 8)
    is used in the loops to notify all registered drivers.

    Cc: Markus Lidel
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • i2o_driver_register() initalizes event queue for driver only when
    drv->event is set. So similarly the event queue should be destroyed only
    when drv->event is set in the error path. Otherwise destroy_workqueue()
    will called with NULL.

    Cc: Markus Lidel
    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

10 May, 2007

1 commit


09 May, 2007

1 commit


28 Mar, 2007

1 commit

  • I2O subsystem has been broken in mainstream several months ago (after
    2.6.18). Commit 4aff5e2333c9a1609662f2091f55c3f6fffdad36 from Jens
    Axboe split struct request ->flags into two parts: cmd_type and
    cmd_flags.

    In i2o layer this patch has replaced flag REQ_SPECIAL by the according
    cmd_type. However i2o has used REQ_SPECIAL not as command type but as
    driver-specific flag for the debug purposes. As result all i2o requests
    have type "special" now, are not processed to the hardware and fail with
    I/O error:

    i2o/hda:Buffer I/O error on device i2o/hda, logical block 0
    Buffer I/O error on device i2o/hda, logical block 0
    Buffer I/O error on device i2o/hda, logical block 0
    unable to read partition table
    block-osm: device added (TID: 207): i2o/hda

    The following patch removes the extra debug checks without any drawbacks and
    restores the normal driver's work.

    Signed-off-by: Vasily Averin
    Acked-by: Markus Lidel
    Cc: Jens Axboe
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     

13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

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

    Arjan van de Ven
     

23 Dec, 2006

1 commit


14 Dec, 2006

2 commits

  • Run this:

    #!/bin/sh
    for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
    echo "De-casting $f..."
    perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
    done

    And then go through and reinstate those cases where code is casting pointers
    to non-pointers.

    And then drop a few hunks which conflicted with outstanding work.

    Cc: Russell King , Ian Molton
    Cc: Mikael Starvik
    Cc: Yoshinori Sato
    Cc: Roman Zippel
    Cc: Geert Uytterhoeven
    Cc: Ralf Baechle
    Cc: Paul Mackerras
    Cc: Kyle McMartin
    Cc: Benjamin Herrenschmidt
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Greg KH
    Cc: Jens Axboe
    Cc: Paul Fulghum
    Cc: Alan Cox
    Cc: Karsten Keil
    Cc: Mauro Carvalho Chehab
    Cc: Jeff Garzik
    Cc: James Bottomley
    Cc: Ian Kent
    Cc: Steven French
    Cc: David Woodhouse
    Cc: Neil Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     
  • i2o_exec_exit and i2o_driver_exit were marked as __exit which is a bug
    because both are invoked from __init and __exit functions.

    Signed-off-by: Ralf Baechle
    Cc: Markus Lidel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ralf Baechle
     

08 Dec, 2006

5 commits

  • Correct lots of typos, kernel-doc warnings, & kernel-doc usage in fusion and
    i2o drivers.

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

    Randy Dunlap
     
  • With I2O_CONFIG=y and I2O_EXT_ADAPTEC=n, kernel build gets:

    drivers/message/i2o/i2o_config.c:1115: error: 'i2o_cfg_compat_ioctl' undeclared here (not in a function)

    Signed-off-by: Randy Dunlap
    Cc: Markus Lidel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Handle __copy_from_user() return value.

    Noticed by inspection, not from build warning.

    Signed-off-by: Randy Dunlap
    Cc: Markus Lidel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • i2o_scsi: handle sysfs failure

    i2o_device:
    * convert i2o_device_add() to return integer error code
    rather than pointer. Fortunately -nobody- checks the return code of
    this function, so changing has nil impact.
    * handle errors thrown by device_register()

    More work in i2o_device remains.

    Signed-off-by: Jeff Garzik
    Cc: Markus Lidel
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     
  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

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

    Christoph Lameter
     

05 Dec, 2006

1 commit


02 Dec, 2006

1 commit


22 Nov, 2006

1 commit


31 Oct, 2006

1 commit

  • kernel: INFO: trying to register non-static key.
    kernel: the code is fine but needs lockdep annotation.
    kernel: turning off the locking correctness validator.
    kernel: [] show_trace_log_lvl+0x58/0x16a
    kernel: [] show_trace+0xd/0x10
    kernel: [] dump_stack+0x19/0x1b
    kernel: [] __lock_acquire+0xf0/0x90d
    kernel: [] lock_acquire+0x4b/0x6b
    kernel: [] _spin_lock_irqsave+0x22/0x32
    kernel: [] prepare_to_wait+0x17/0x4b
    kernel: [] lpfc_do_work+0xdd/0xcc2 [lpfc]
    kernel: [] kthread+0xc3/0xf2
    kernel: [] kernel_thread_helper+0x5/0xb

    Another case of non-static lockdep keys; duplicate the paradigm set by
    DECLARE_COMPLETION_ONSTACK and introduce DECLARE_WAIT_QUEUE_HEAD_ONSTACK.

    Signed-off-by: Peter Zijlstra
    Cc: Greg KH
    Cc: Markus Lidel
    Acked-by: Ingo Molnar
    Cc: Arjan van de Ven
    Cc: James Bottomley
    Cc: Marcel Holtmann
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

22 Oct, 2006

1 commit


17 Oct, 2006

1 commit


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
     

01 Oct, 2006

3 commits

  • Use the safe ref-counted API for the bridge check

    Signed-off-by: Alan Cox
    Cc: Markus Lidel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Make it possible to disable the block layer. Not all embedded devices require
    it, some can make do with just JFFS2, NFS, ramfs, etc - none of which require
    the block layer to be present.

    This patch does the following:

    (*) Introduces CONFIG_BLOCK to disable the block layer, buffering and blockdev
    support.

    (*) Adds dependencies on CONFIG_BLOCK to any configuration item that controls
    an item that uses the block layer. This includes:

    (*) Block I/O tracing.

    (*) Disk partition code.

    (*) All filesystems that are block based, eg: Ext3, ReiserFS, ISOFS.

    (*) The SCSI layer. As far as I can tell, even SCSI chardevs use the
    block layer to do scheduling. Some drivers that use SCSI facilities -
    such as USB storage - end up disabled indirectly from this.

    (*) Various block-based device drivers, such as IDE and the old CDROM
    drivers.

    (*) MTD blockdev handling and FTL.

    (*) JFFS - which uses set_bdev_super(), something it could avoid doing by
    taking a leaf out of JFFS2's book.

    (*) Makes most of the contents of linux/blkdev.h, linux/buffer_head.h and
    linux/elevator.h contingent on CONFIG_BLOCK being set. sector_div() is,
    however, still used in places, and so is still available.

    (*) Also made contingent are the contents of linux/mpage.h, linux/genhd.h and
    parts of linux/fs.h.

    (*) Makes a number of files in fs/ contingent on CONFIG_BLOCK.

    (*) Makes mm/bounce.c (bounce buffering) contingent on CONFIG_BLOCK.

    (*) set_page_dirty() doesn't call __set_page_dirty_buffers() if CONFIG_BLOCK
    is not enabled.

    (*) fs/no-block.c is created to hold out-of-line stubs and things that are
    required when CONFIG_BLOCK is not set:

    (*) Default blockdev file operations (to give error ENODEV on opening).

    (*) Makes some /proc changes:

    (*) /proc/devices does not list any blockdevs.

    (*) /proc/diskstats and /proc/partitions are contingent on CONFIG_BLOCK.

    (*) Makes some compat ioctl handling contingent on CONFIG_BLOCK.

    (*) If CONFIG_BLOCK is not defined, makes sys_quotactl() return -ENODEV if
    given command other than Q_SYNC or if a special device is specified.

    (*) In init/do_mounts.c, no reference is made to the blockdev routines if
    CONFIG_BLOCK is not defined. This does not prohibit NFS roots or JFFS2.

    (*) The bdflush, ioprio_set and ioprio_get syscalls can now be absent (return
    error ENOSYS by way of cond_syscall if so).

    (*) The seclvl_bd_claim() and seclvl_bd_release() security calls do nothing if
    CONFIG_BLOCK is not set, since they can't then happen.

    Signed-Off-By: David Howells
    Signed-off-by: Jens Axboe

    David Howells
     
  • Right now ->flags is a bit of a mess: some are request types, and
    others are just modifiers. Clean this up by splitting it into
    ->cmd_type and ->cmd_flags. This allows introduction of generic
    Linux block message types, useful for sending generic Linux commands
    to block devices.

    Signed-off-by: Jens Axboe

    Jens Axboe