1. 16 2月, 2010 1 次提交
  2. 08 2月, 2010 1 次提交
    • L
      Fix race in tty_fasync() properly · 80e1e823
      Linus Torvalds 提交于
      This reverts commit 70362511 ("tty: fix race in tty_fasync") and
      commit b04da8bf ("fnctl: f_modown should call write_lock_irqsave/
      restore") that tried to fix up some of the fallout but was incomplete.
      
      It turns out that we really cannot hold 'tty->ctrl_lock' over calling
      __f_setown, because not only did that cause problems with interrupt
      disables (which the second commit fixed), it also causes a potential
      ABBA deadlock due to lock ordering.
      
      Thanks to Tetsuo Handa for following up on the issue, and running
      lockdep to show the problem.  It goes roughly like this:
      
       - f_getown gets filp->f_owner.lock for reading without interrupts
         disabled, so an interrupt that happens while that lock is held can
         cause a lockdep chain from f_owner.lock -> sighand->siglock.
      
       - at the same time, the tty->ctrl_lock -> f_owner.lock chain that
         commit 70362511 introduced, together with the pre-existing
         sighand->siglock -> tty->ctrl_lock chain means that we have a lock
         dependency the other way too.
      
      So instead of extending tty->ctrl_lock over the whole __f_setown() call,
      we now just take a reference to the 'pid' structure while holding the
      lock, and then release it after having done the __f_setown.  That still
      guarantees that 'struct pid' won't go away from under us, which is all
      we really ever needed.
      Reported-and-tested-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: NAmérico Wang <xiyou.wangcong@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      80e1e823
  3. 06 2月, 2010 3 次提交
    • J
      hwmon: (w83781d) Request I/O ports individually for probing · b0bcdd3c
      Jean Delvare 提交于
      Different motherboards have different PNP declarations for
      W83781D/W83782D chips. Some declare the whole range of I/O ports (8
      ports), some declare only the useful ports (2 ports at offset 5) and
      some declare fancy ranges, for example 4 ports at offset 4. To
      properly handle all cases, request all ports individually for probing.
      After we have determined that we really have a W83781D or W83782D
      chip, the useful port range will be requested again, as a single
      block.
      
      I did not see a board which needs this yet, but I know of one for lm78
      driver and I'd like to keep the logic of these two drivers in sync.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: stable@kernel.org
      b0bcdd3c
    • J
      hwmon: (lm78) Request I/O ports individually for probing · 197027e6
      Jean Delvare 提交于
      Different motherboards have different PNP declarations for LM78/LM79
      chips. Some declare the whole range of I/O ports (8 ports), some
      declare only the useful ports (2 ports at offset 5) and some declare
      fancy ranges, for example 4 ports at offset 4. To properly handle all
      cases, request all ports individually for probing. After we have
      determined that we really have an LM78 or LM79 chip, the useful port
      range will be requested again, as a single block.
      
      This fixes the driver on the Olivetti M3000 DT 540, at least.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: stable@kernel.org
      197027e6
    • R
      hwmon: (adt7462) Wrong ADT7462_VOLT_COUNT · 85f8d3e5
      Ray Copeland 提交于
      The #define ADT7462_VOLT_COUNT is wrong, it should be 13 not 12. All the 
      for loops that use this as a limit count are of the typical form, "for 
      (n = 0; n < ADT7462_VOLT_COUNT; n++)", so to loop through all voltages 
      w/o missing the last one it is necessary for the count to be one greater 
      than it is.  (Specifically, you will miss the +1.5V 3GPIO input with count 
      = 12 vs. 13.)
      Signed-off-by: NRay Copeland <ray.copeland@aprius.com>
      Acked-by: N"Darrick J. Wong" <djwong@us.ibm.com>
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Cc: stable@kernel.org
      85f8d3e5
  4. 05 2月, 2010 14 次提交
  5. 04 2月, 2010 3 次提交
  6. 03 2月, 2010 8 次提交
    • T
      pktcdvd: removing device does not remove its sysfs dir · ca0bf64d
      Thadeu Lima de Souza Cascardo 提交于
      This is the counterpart to cba76717
      ("pktcdvd: remove broken dev_t export of class devices").  Device is not
      registered using dev_t, so it should not be destroyed using device_destroy
      which looks up the device by dev_t.  This will fail and adding the device
      again will fail with the "duplicate name" error.  This is fixed using
      device_unregister instead of device_destroy.
      Signed-off-by: NThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Peter Osterlund <petero2@telia.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ca0bf64d
    • R
      uartlite: fix crash when using as console · 03eac7bb
      Richard Röjfors 提交于
      Move the ulite_console_setup to the .devinit section since it might be
      called on probe, which is in devinit.  Fixes the crash below where the
      uartlite hw is probed after the .init section is freed from the kernel.
      
      uartlite: ttyUL0 at MMIO 0xc8000100 (irq = 30) is a uartlite
      BUG: unable to handle kernel NULL pointer dereference at (null)
      IP: [<c176720e>] ulite_console_setup+0x6f/0xa8
      *pdpt = 0000000036fb0001 *pde = 0000000000000000
      Oops: 0000 [#1] PREEMPT SMP
      last sysfs file: /sys/devices/pci0000:00/0000:00:1f.1/host0/uevent
      Modules linked in: puffin(+) serio_raw
      
      Pid: 151, comm: modprobe Not tainted (2.6.31.5-1.0.b1-b1 #1) POULSBO
      EIP: 0060:[<c176720e>] EFLAGS: 00010246 CPU: 0
      EIP is at ulite_console_setup+0x6f/0xa8
      EAX: c16ec824 EBX: c16ec824 ECX: c176719f EDX: 00000000
      ESI: 00000000 EDI: c17b42c4 EBP: f6fd1cf0 ESP: f6fd1cd8
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      Process modprobe (pid: 151, ti=f6fd0000 task=f6fa1020 task.ti=f6fd0000)
      Stack:
       c1031f51 00000000 00000000 00000246 c182237c f7742000 f6fd1d5c c11fd316
      <0> c16ec85c f77420d4 0000001e 00000000 00000000 c1633e78 4f494d4d 63783020
      <0> 30303038 00303031 f6fd1d3c c10e0786 f6fd1d48 00000000 f6fd1d48 00000000
      Call Trace:
       [<c1031f51>] ? register_console+0xf6/0x1fc
       [<c11fd316>] ? uart_add_one_port+0x237/0x2bb
       [<c10e0786>] ? sysfs_add_one+0x13/0xd3
       [<c10e142f>] ? sysfs_do_create_link+0xba/0xfc
       [<c146f200>] ? ulite_probe+0x198/0x1eb
       [<c12064ee>] ? platform_drv_probe+0xc/0xe
       [<c120597b>] ? driver_probe_device+0x79/0x105
       [<c1205a8e>] ? __device_attach+0x28/0x30
       [<c120511f>] ? bus_for_each_drv+0x3d/0x67
       [<c1205af9>] ? device_attach+0x44/0x58
       [<c1205a66>] ? __device_attach+0x0/0x30
       [<c1204fb8>] ? bus_probe_device+0x1f/0x34
       [<c1203e68>] ? device_add+0x385/0x4c0
       [<c148491f>] ? _write_unlock+0x8/0x1f
       [<c1206aac>] ? platform_device_add+0xd9/0x11c
       [<c120c685>] ? mfd_add_devices+0x165/0x1bc
       [<f831b378>] ? puffin_probe+0x2d0/0x390 [puffin]
       [<c11a08ef>] ? pci_match_device+0xa0/0xa7
       [<c11a07bc>] ? local_pci_probe+0xe/0x10
       [<c11a11db>] ? pci_device_probe+0x43/0x66
       [<c120597b>] ? driver_probe_device+0x79/0x105
       [<c1205a4a>] ? __driver_attach+0x43/0x5f
       [<c120535d>] ? bus_for_each_dev+0x3d/0x67
       [<c1205852>] ? driver_attach+0x14/0x16
       [<c1205a07>] ? __driver_attach+0x0/0x5f
       [<c1204dea>] ? bus_add_driver+0xf9/0x220
       [<c1205c8f>] ? driver_register+0x8b/0xeb
       [<c11a1518>] ? __pci_register_driver+0x43/0x9f
       [<c10477ef>] ? __blocking_notifier_call_chain+0x40/0x4c
       [<f831f000>] ? puffin_init+0x0/0x48 [puffin]
       [<f831f017>] ? puffin_init+0x17/0x48 [puffin]
       [<c1001139>] ? do_one_initcall+0x4c/0x131
       [<c105607b>] ? sys_init_module+0xa7/0x1b7
       [<c1002a61>] ? syscall_call+0x7/0xb
       Code: 6e 74 00 00 00 92 33 00 00 18 00 0e 01 73 79 6e 63 65 2d 72 65 67 69 73 74 72 79 0c 00 49 32
      00 00 14 00 09 01 61 6c 73 61 2d 69 <6e> 66 6f 00 00 00 42 37 00 00 10 00 07 01 6b 69 6c 6c 61 6c 6c
      EIP: [<c176720e>] ulite_console_setup+0x6f/0xa8 SS:ESP 0068:f6fd1cd8
      CR2: 0000000000000000
      Signed-off-by: NRichard Röjfors <richard.rojfors@pelagicore.com>
      Acked-by: NPeter Korsgaard <jacmet@sunsite.dk>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      03eac7bb
    • U
      imxfb: correct location of callbacks in suspend and resume · 1ec56203
      Uwe Kleine-König 提交于
      The probe function passes a pointer to a struct fb_info to
      platform_set_drvdata(), so don't interpret the return value of
      platform_get_drvdata() as a pointer to struct imxfb_info.
      
      The original imxfb_info *fbi backlight_power was NULL but in imxfb_suspend
      it was 4 resulting in an oops as imxfb_suspend calls
      imxfb_disable_controller(fbi) which in turn has
      
      	if (fbi->backlight_power)
      			fbi->backlight_power(0);
      Signed-off-by: NUwe Kleine-König  <u.kleine-koenig@pengutronix.de>
      Acked-by: NSascha Hauer <kernel@pengutronix.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1ec56203
    • W
      devmem: fix kmem write bug on memory holes · c85e9a97
      Wu Fengguang 提交于
      write_kmem() used to assume vwrite() always return the full buffer length.
      However now vwrite() could return 0 to indicate memory hole.  This
      creates a bug that "buf" is not advanced accordingly.
      
      Fix it to simply ignore the return value, hence the memory hole.
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c85e9a97
    • K
      devmem: check vmalloc address on kmem read/write · 325fda71
      KAMEZAWA Hiroyuki 提交于
      Otherwise vmalloc_to_page() will BUG().
      
      This also makes the kmem read/write implementation aligned with mem(4):
      "References to nonexistent locations cause errors to be returned." Here we
      return -ENXIO (inspired by Hugh) if no bytes have been transfered to/from
      user space, otherwise return partial read/write results.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      325fda71
    • S
      rtc-fm3130: add missing braces · f4b51628
      Sergey Matyukevich 提交于
      Add missing braces for multiline 'if' statements in fm3130_probe.
      Signed-off-by: NSergey Matyukevich <geomatsi@gmail.com>
      Signed-off-by: NAlessandro Zummo <a.zummo@towertech.it>
      Cc: Sergey Lapin <slapin@ossfans.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f4b51628
    • A
      mx3fb: some debug and initialisation fixes · b3cb5372
      Alberto Panizzo 提交于
      Fix the kernel oops when dev_dbg is called with mx3_fbi->txd == NULL
      
      Fix the late initialisation of mx3fb->backlight_level.  If not, in the
      chain of function started by init_fb_chan(), in __blank() call
      sdc_set_brightness(mx3fb, mx3fb->backlight_level) that will shut down the
      CONTRAST PWM output.
      Signed-off-by: NAlberto Panizzo <maramaopercheseimorto@gmail.com>
      Acked-by: Guennadi Liakhovetski <g.liakhovetski <at> gmx.de>
      Cc: Sascha Hauer <s.hauer@pengutronix.de>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b3cb5372
    • E
      connector: Delete buggy notification code. · f98bfbd7
      Evgeniy Polyakov 提交于
      On Tue, Feb 02, 2010 at 02:57:14PM -0800, Greg KH (gregkh@suse.de) wrote:
      > > There are at least two ways to fix it: using a big cannon and a small
      > > one. The former way is to disable notification registration, since it is
      > > not used by anyone at all. Second way is to check whether calling
      > > process is root and its destination group is -1 (kind of priveledged
      > > one) before command is dispatched to workqueue.
      > 
      > Well if no one is using it, removing it makes the most sense, right?
      > 
      > No objection from me, care to make up a patch either way for this?
      
      Getting it is not used, let's drop support for notifications about
      (un)registered events from connector.
      Another option was to check credentials on receiving, but we can always
      restore it without bugs if needed, but genetlink has a wider code base
      and none complained, that userspace can not get notification when some
      other clients were (un)registered.
      
      Kudos for Sebastian Krahmer <krahmer@suse.de>, who found a bug in the
      code.
      Signed-off-by: NEvgeniy Polyakov <zbr@ioremap.net>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f98bfbd7
  7. 02 2月, 2010 7 次提交
  8. 01 2月, 2010 3 次提交