12 May, 2011

1 commit


31 Mar, 2011

1 commit


01 Dec, 2010

1 commit


23 Oct, 2010

1 commit

  • * 'llseek' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/bkl:
    vfs: make no_llseek the default
    vfs: don't use BKL in default_llseek
    llseek: automatically add .llseek fop
    libfs: use generic_file_llseek for simple_attr
    mac80211: disallow seeks in minstrel debug code
    lirc: make chardev nonseekable
    viotape: use noop_llseek
    raw: use explicit llseek file operations
    ibmasmfs: use generic_file_llseek
    spufs: use llseek in all file operations
    arm/omap: use generic_file_llseek in iommu_debug
    lkdtm: use generic_file_llseek in debugfs
    net/wireless: use generic_file_llseek in debugfs
    drm: use noop_llseek

    Linus Torvalds
     

15 Oct, 2010

1 commit

  • All file_operations should get a .llseek operation so we can make
    nonseekable_open the default for future file operations without a
    .llseek pointer.

    The three cases that we can automatically detect are no_llseek, seq_lseek
    and default_llseek. For cases where we can we can automatically prove that
    the file offset is always ignored, we use noop_llseek, which maintains
    the current behavior of not returning an error from a seek.

    New drivers should normally not use noop_llseek but instead use no_llseek
    and call nonseekable_open at open time. Existing drivers can be converted
    to do the same when the maintainer knows for certain that no user code
    relies on calling seek on the device file.

    The generated code is often incorrectly indented and right now contains
    comments that clarify for each added line why a specific variant was
    chosen. In the version that gets submitted upstream, the comments will
    be gone and I will manually fix the indentation, because there does not
    seem to be a way to do that using coccinelle.

    Some amount of new code is currently sitting in linux-next that should get
    the same modifications, which I will do at the end of the merge window.

    Many thanks to Julia Lawall for helping me learn to write a semantic
    patch that does all this.

    ===== begin semantic patch =====
    // This adds an llseek= method to all file operations,
    // as a preparation for making no_llseek the default.
    //
    // The rules are
    // - use no_llseek explicitly if we do nonseekable_open
    // - use seq_lseek for sequential files
    // - use default_llseek if we know we access f_pos
    // - use noop_llseek if we know we don't access f_pos,
    // but we still want to allow users to call lseek
    //
    @ open1 exists @
    identifier nested_open;
    @@
    nested_open(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ read disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {

    }

    @ read_no_fpos disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ write @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {

    }

    @ write_no_fpos @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ fops0 @
    identifier fops;
    @@
    struct file_operations fops = {
    ...
    };

    @ has_llseek depends on fops0 @
    identifier fops0.fops;
    identifier llseek_f;
    @@
    struct file_operations fops = {
    ...
    .llseek = llseek_f,
    ...
    };

    @ has_read depends on fops0 @
    identifier fops0.fops;
    identifier read_f;
    @@
    struct file_operations fops = {
    ...
    .read = read_f,
    ...
    };

    @ has_write depends on fops0 @
    identifier fops0.fops;
    identifier write_f;
    @@
    struct file_operations fops = {
    ...
    .write = write_f,
    ...
    };

    @ has_open depends on fops0 @
    identifier fops0.fops;
    identifier open_f;
    @@
    struct file_operations fops = {
    ...
    .open = open_f,
    ...
    };

    // use no_llseek if we call nonseekable_open
    ////////////////////////////////////////////
    @ nonseekable1 depends on !has_llseek && has_open @
    identifier fops0.fops;
    identifier nso ~= "nonseekable_open";
    @@
    struct file_operations fops = {
    ... .open = nso, ...
    +.llseek = no_llseek, /* nonseekable */
    };

    @ nonseekable2 depends on !has_llseek @
    identifier fops0.fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ... .open = open_f, ...
    +.llseek = no_llseek, /* open uses nonseekable */
    };

    // use seq_lseek for sequential files
    /////////////////////////////////////
    @ seq depends on !has_llseek @
    identifier fops0.fops;
    identifier sr ~= "seq_read";
    @@
    struct file_operations fops = {
    ... .read = sr, ...
    +.llseek = seq_lseek, /* we have seq_read */
    };

    // use default_llseek if there is a readdir
    ///////////////////////////////////////////
    @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier readdir_e;
    @@
    // any other fop is used that changes pos
    struct file_operations fops = {
    ... .readdir = readdir_e, ...
    +.llseek = default_llseek, /* readdir is present */
    };

    // use default_llseek if at least one of read/write touches f_pos
    /////////////////////////////////////////////////////////////////
    @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read.read_f;
    @@
    // read fops use offset
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = default_llseek, /* read accesses f_pos */
    };

    @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ... .write = write_f, ...
    + .llseek = default_llseek, /* write accesses f_pos */
    };

    // Use noop_llseek if neither read nor write accesses f_pos
    ///////////////////////////////////////////////////////////

    @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    identifier write_no_fpos.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ...
    .write = write_f,
    .read = read_f,
    ...
    +.llseek = noop_llseek, /* read and write both use no f_pos */
    };

    @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write_no_fpos.write_f;
    @@
    struct file_operations fops = {
    ... .write = write_f, ...
    +.llseek = noop_llseek, /* write uses no f_pos */
    };

    @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    @@
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = noop_llseek, /* read uses no f_pos */
    };

    @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    @@
    struct file_operations fops = {
    ...
    +.llseek = noop_llseek, /* no read or write fn */
    };
    ===== End semantic patch =====

    Signed-off-by: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann
     

21 Sep, 2010

1 commit


03 Aug, 2010

1 commit

  • Change all call sites in drivers/input to not access the ABS axis
    information directly anymore. Make them use the access helpers instead.

    Also use input_set_abs_params() when possible.
    Did some code refactoring as I was on it.

    Signed-off-by: Daniel Mack
    Cc: Dmitry Torokhov
    Signed-off-by: Dmitry Torokhov

    Daniel Mack
     

16 Jul, 2010

1 commit


21 May, 2010

1 commit


04 May, 2010

1 commit


04 Feb, 2010

2 commits


05 Oct, 2009

1 commit


28 Aug, 2009

1 commit

  • Up to now axis and button map validation was done after the user-supplied
    values were copied over the driver's map. This patch copies the
    user-supplied values into temporary buffers and validated them before
    overwriting the driver's permanent maps.

    Also change JSIOCGBTNMAP and JSIOCGAXMAP to return number of bytes returned
    to userspace instead of 0.

    Signed-off-by: Stephen Kitt
    Signed-off-by: Dmitry Torokhov

    Stephen Kitt
     

12 Aug, 2009

1 commit

  • The KEY_MAX change in 2.6.28 changed the values of the JSIOCSBTNMAP and
    JSIOCGBTNMAP constants; software compiled with the old values no longer
    works with kernels following 2.6.28, because the ioctl switch statement
    no longer matches the values given by the software. This patch handles
    these ioctls independently of the length of data specified, and applies the
    same treatment to JSIOCSAXMAP and JSIOCGAXMAP which currently depend on
    ABS_MAX.

    Signed-off-by: Stephen Kitt
    Signed-off-by: Dmitry Torokhov

    Stephen Kitt
     

14 Jul, 2009

1 commit

  • Commit 3d5cb60e ("Input: simplify name handling for certain input
    handles") introduced a regression for the EVIOCGNAME/JSIOCGNAME
    ioctl.

    Before this, patch, the platform device's name was given back to
    userspace which was good to identify devices. After this patch, the
    device is ("event%d", minor) which is not descriptive at all.

    This fixes the behaviour by taking dev->name.

    Reported-by: Sven Neumann
    Signed-off-by: Daniel Mack
    Reviewed-by: Thadeu Lima de Souza Cascardo
    Signed-off-by: Dmitry Torokhov

    Daniel Mack
     

11 Jun, 2009

1 commit


11 May, 2009

1 commit


08 May, 2009

1 commit

  • BTN_TOUCH is not set by the wacom driver which causes it to be handled by the
    joydev driver while the resulting device is broken. This causes problems with
    applications that try to use a joystick device.

    Ubuntu BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/300143

    Signed-off-by: Tim Cole
    Signed-off-by: Stefan Bader
    Acked-by: Tim Gardner
    Acked-by: Amit Kucheria
    Signed-off-by: Dmitry Torokhov

    Tim Cole
     

16 Mar, 2009

1 commit

  • Most fasync implementations do something like:

    return fasync_helper(...);

    But fasync_helper() will return a positive value at times - a feature used
    in at least one place. Thus, a number of other drivers do:

    err = fasync_helper(...);
    if (err < 0)
    return err;
    return 0;

    In the interests of consistency and more concise code, it makes sense to
    map positive return values onto zero where ->fasync() is called.

    Cc: Al Viro
    Signed-off-by: Jonathan Corbet

    Jonathan Corbet
     

20 Dec, 2008

1 commit


02 Nov, 2008

1 commit

  • As it is, all instances of ->release() for files that have ->fasync()
    need to remember to evict file from fasync lists; forgetting that
    creates a hole and we actually have a bunch that *does* forget.

    So let's keep our lives simple - let __fput() check FASYNC in
    file->f_flags and call ->fasync() there if it's been set. And lose that
    crap in ->release() instances - leaving it there is still valid, but we
    don't have to bother anymore.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

30 Oct, 2008

1 commit


01 Apr, 2008

1 commit


20 Oct, 2007

1 commit

  • get rid of input BIT* duplicate defines

    use newly global defined macros for input layer. Also remove includes of
    input.h from non-input sources only for BIT macro definiton. Define the
    macro temporarily in local manner, all those local definitons will be
    removed further in this patchset (to not break bisecting).
    BIT macro will be globally defined (1<
    Cc:
    Acked-by: Jiri Kosina
    Cc:
    Acked-by: Marcel Holtmann
    Cc:
    Acked-by: Mauro Carvalho Chehab
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

14 Oct, 2007

1 commit

  • RT guys alerted me to the fact that in their tree spinlocks
    are preemptible and it is better to use full RCU API
    (rcu_read_lock()/rcu_read_unlock()) to be safe.

    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

13 Oct, 2007

1 commit


30 Aug, 2007

1 commit


10 Jul, 2007

1 commit


05 Jun, 2007

1 commit


04 Jun, 2007

1 commit

  • There is a race between input handler's release() and disconnect()
    methods: when input handler disconnects it wakes up all regular
    users and then process to walk user list to wake up async. users.
    While disconnect() walks the list release() removes elements of
    the same list causing oopses.

    While this is not a substibute for proper locking we can reduce
    odds of getting an oops if we wake up normal readers after walking
    the list.

    Signed-off-by: Dmitry Torokhov

    Dmitry Torokhov
     

09 May, 2007

1 commit


05 May, 2007

1 commit

  • * 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/dtor/input: (65 commits)
    Input: gpio_keys - add support for switches (EV_SW)
    Input: cobalt_btns - convert to use polldev library
    Input: add skeleton for simple polled devices
    Input: update some documentation
    Input: wistron - fix typo in keymap for Acer TM610
    Input: add input_set_capability() helper
    Input: i8042 - add Fujitsu touchscreen/touchpad PNP IDs
    Input: i8042 - add Panasonic CF-29 to nomux list
    Input: lifebook - split into 2 devices
    Input: lifebook - add signature of Panasonic CF-29
    Input: lifebook - activate 6-byte protocol on select models
    Input: lifebook - work properly on Panasonic CF-18
    Input: cobalt buttons - separate device and driver registration
    Input: ati_remote - make button repeat sensitivity configurable
    Input: pxa27x - do not use deprecated SA_INTERRUPT flag
    Input: ucb1400 - make delays configurable
    Input: misc devices - switch to using input_dev->dev.parent
    Input: joysticks - switch to using input_dev->dev.parent
    Input: touchscreens - switch to using input_dev->dev.parent
    Input: mice - switch to using input_dev->dev.parent
    ...

    Fixed up conflicts with core device model removal of "struct subsystem" manually.

    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

03 May, 2007

1 commit


12 Apr, 2007

3 commits


14 Sep, 2006

2 commits


26 Jun, 2006

1 commit