1. 15 7月, 2009 7 次提交
  2. 14 7月, 2009 11 次提交
  3. 13 7月, 2009 22 次提交
    • T
      ext4: Fix ext4_mb_initialize_context() to initialize all fields · 833576b3
      Theodore Ts'o 提交于
      Pavel Roskin pointed out that kmemcheck indicated that
      ext4_mb_store_history() was accessing uninitialized values of
      ac->ac_tail and ac->ac_buddy leading to garbage in the mballoc
      history.  Fix this by initializing the entire structure to all zeros
      first.
      
      Also, two fields were getting doubly initialized by the caller of
      ext4_mb_initialize_context, so remove them for efficiency's sake.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      833576b3
    • P
      ext4: fix null handler of ioctls in no journal mode · ac046f1d
      Peng Tao 提交于
      The EXT4_IOC_GROUP_ADD and EXT4_IOC_GROUP_EXTEND ioctls should not
      flush the journal in no_journal mode.  Otherwise, running resize2fs on
      a mounted no_journal partition triggers the following error messages:
      
      BUG: unable to handle kernel NULL pointer dereference at 00000014
      IP: [<c039d282>] _spin_lock+0x8/0x19
      *pde = 00000000 
      Oops: 0002 [#1] SMP
      Signed-off-by: NPeng Tao <bergwolf@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      ac046f1d
    • C
      ext4: Fix buffer head reference leak in no-journal mode · e6b5d301
      Curt Wohlgemuth 提交于
      We found a problem with buffer head reference leaks when using an ext4
      partition without a journal.  In particular, calls to ext4_forget() would
      not to a brelse() on the input buffer head, which will cause pages they
      belong to to not be reclaimable.
      
      Further investigation showed that all places where ext4_journal_forget() and
      ext4_journal_revoke() are called are subject to the same problem.  The patch
      below changes __ext4_journal_forget/__ext4_journal_revoke to do an explicit
      release of the buffer head when the journal handle isn't valid.
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      e6b5d301
    • S
      tracing/function-profiler: do not free per cpu variable stat · 6ab5d668
      Steven Rostedt 提交于
      The per cpu variable stat is freeded if we fail to allocate a name
      on start up. This was due to stat at first being allocated in the
      initial design. But since then, it has become a static per cpu variable
      but the free on error was not removed.
      
      Also added __init annotation to the function that this is in.
      
      [ Impact: prevent possible memory corruption on low mem at boot up ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6ab5d668
    • L
      tracing/events: Move TRACE_SYSTEM outside of include guard · d0b6e04a
      Li Zefan 提交于
      If TRACE_INCLDUE_FILE is defined, <trace/events/TRACE_INCLUDE_FILE.h>
      will be included and compiled, otherwise it will be
      <trace/events/TRACE_SYSTEM.h>
      
      So TRACE_SYSTEM should be defined outside of #if proctection,
      just like TRACE_INCLUDE_FILE.
      
      Imaging this scenario:
      
       #include <trace/events/foo.h>
          -> TRACE_SYSTEM == foo
       ...
       #include <trace/events/bar.h>
          -> TRACE_SYSTEM == bar
       ...
       #define CREATE_TRACE_POINTS
       #include <trace/events/foo.h>
          -> TRACE_SYSTEM == bar !!!
      
      and then bar.h will be included and compiled.
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      LKML-Reference: <4A5A9CF1.2010007@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d0b6e04a
    • R
      NET: Fix locking issues in PPP, 6pack, mkiss and strip line disciplines. · adeab1af
      Ralf Baechle 提交于
      Guido Trentalancia reports:
      
      I am trying to use the kiss driver in the Linux kernel that is being
      shipped with Fedora 10 but unfortunately I get the following oops:
      
      mkiss: AX.25 Multikiss, Hans Albas PE1AYX
      mkiss: ax0: crc mode is auto.
      ADDRCONF(NETDEV_CHANGE): ax0: link becomes ready
      ------------[ cut here ]------------
      WARNING: at kernel/softirq.c:77 __local_bh_disable+0x2f/0x83() (Not
      tainted)
      [...]
      unloaded: microcode]
      Pid: 0, comm: swapper Not tainted 2.6.27.25-170.2.72.fc10.i686 #1
       [<c042ddfb>] warn_on_slowpath+0x65/0x8b
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
       [<c042431e>] ? enqueue_entity+0x203/0x20b
       [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
       [<c041f88c>] ? resched_task+0x3a/0x6e
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
       [<c043255b>] __local_bh_disable+0x2f/0x83
       [<c04325ba>] local_bh_disable+0xb/0xd
       [<c06ab4e2>] _spin_lock_bh+0xb/0x16
       [<f8b6f600>] mkiss_receive_buf+0x2fb/0x3a6 [mkiss]
       [<c0572a30>] flush_to_ldisc+0xf7/0x198
       [<c0572b12>] tty_flip_buffer_push+0x41/0x51
       [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
       [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
       [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
       [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
       [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
       [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
       [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
       [<c05ec5b0>] uhci_irq+0x110/0x125
       [<c05d4834>] usb_hcd_irq+0x40/0xa3
       [<c0465313>] handle_IRQ_event+0x2f/0x64
       [<c046642b>] handle_level_irq+0x74/0xbe
       [<c04663b7>] ? handle_level_irq+0x0/0xbe
       [<c0406e6e>] do_IRQ+0xc7/0xfe
       [<c0405668>] common_interrupt+0x28/0x30
       [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
       [<c0617f52>] cpuidle_idle_call+0x60/0x92
       [<c0403c61>] cpu_idle+0x101/0x134
       [<c069b1ba>] rest_init+0x4e/0x50
       =======================
      ---[ end trace b7cc8076093467ad ]---
      ------------[ cut here ]------------
      WARNING: at kernel/softirq.c:136 _local_bh_enable_ip+0x3d/0xc4()
      [...]
      Pid: 0, comm: swapper Tainted: G        W 2.6.27.25-170.2.72.fc10.i686
       [<c042ddfb>] warn_on_slowpath+0x65/0x8b
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c04228b4>] ? __enqueue_entity+0xe3/0xeb
       [<c042431e>] ? enqueue_entity+0x203/0x20b
       [<c0424361>] ? enqueue_task_fair+0x3b/0x3f
       [<c041f88c>] ? resched_task+0x3a/0x6e
       [<c06ab62b>] ? _spin_unlock_irqrestore+0x22/0x38
       [<c06ab4e2>] ? _spin_lock_bh+0xb/0x16
       [<f8b6f642>] ? mkiss_receive_buf+0x33d/0x3a6 [mkiss]
       [<c04325f9>] _local_bh_enable_ip+0x3d/0xc4
       [<c0432688>] local_bh_enable_ip+0x8/0xa
       [<c06ab54d>] _spin_unlock_bh+0x11/0x13
       [<f8b6f642>] mkiss_receive_buf+0x33d/0x3a6 [mkiss]
       [<c0572a30>] flush_to_ldisc+0xf7/0x198
       [<c0572b12>] tty_flip_buffer_push+0x41/0x51
       [<f89477f2>] ftdi_process_read+0x375/0x4ad [ftdi_sio]
       [<f8947a5a>] ftdi_read_bulk_callback+0x130/0x138 [ftdi_sio]
       [<c05d4bec>] usb_hcd_giveback_urb+0x63/0x93
       [<c05ea290>] uhci_giveback_urb+0xe5/0x15f
       [<c05eaabf>] uhci_scan_schedule+0x52e/0x767
       [<c05f6288>] ? psmouse_handle_byte+0xc/0xe5
       [<c054df78>] ? acpi_ev_gpe_detect+0xd6/0xe1
       [<c05ec5b0>] uhci_irq+0x110/0x125
       [<c05d4834>] usb_hcd_irq+0x40/0xa3
       [<c0465313>] handle_IRQ_event+0x2f/0x64
       [<c046642b>] handle_level_irq+0x74/0xbe
       [<c04663b7>] ? handle_level_irq+0x0/0xbe
       [<c0406e6e>] do_IRQ+0xc7/0xfe
       [<c0405668>] common_interrupt+0x28/0x30
       [<c056821a>] ? acpi_idle_enter_simple+0x162/0x19d
       [<c0617f52>] cpuidle_idle_call+0x60/0x92
       [<c0403c61>] cpu_idle+0x101/0x134
       [<c069b1ba>] rest_init+0x4e/0x50
       =======================
      ---[ end trace b7cc8076093467ad ]---
      mkiss: ax0: Trying crc-smack
      mkiss: ax0: Trying crc-flexnet
      
      The issue was, that the locking code in mkiss was assuming it was only
      ever being called in process or bh context.  Fixed by converting the
      involved locking code to use irq-safe locks.
      
      Review of other networking line disciplines shows that 6pack, both sync
      and async PPP and STRIP have similar issues.  The ppp_async one is the
      most interesting one as it sorts out half of the issue as far back as
      2004 in commit http://git.kernel.org/?p=linux/kernel/git/tglx/history.git;a=commitdiff;h=2996d8deaeddd01820691a872550dc0cfba0c37dSigned-off-by: NRalf Baechle <ralf@linux-mips.org>
      Reported-by: NGuido Trentalancia <guido@trentalancia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      adeab1af
    • A
      USB: otg: fix module reinsert issue · dc7520c1
      Ajay Kumar Gupta 提交于
      Platform_device instance (pd) is not set to NULL in
      usb_nop_xceiv_unregister() causing usb_nop_xceiv_register()
      to fail during module reinsert.
      
      From: Ajay Kumar Gupta <ajay.gupta@ti.com>
      Signed-off-by: NBabu Ravi <ravibabu@ti.com>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      dc7520c1
    • A
      USB: handle zero-length usbfs submissions correctly · 9180135b
      Alan Stern 提交于
      This patch (as1262) fixes a bug in usbfs: It refuses to accept
      zero-length transfers, and it insists that the buffer pointer be valid
      even if there is no data being transferred.
      
      The patch also consolidates a bunch of repetitive access_ok() checks
      into a single check, which incidentally fixes the lack of such a check
      for Isochronous URBs.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9180135b
    • A
      USB: EHCI: report actual_length for iso transfers · ec6d67e3
      Alan Stern 提交于
      This patch (as1259b) makes ehci-hcd return the total number of bytes
      transferred in urb->actual_length for Isochronous transfers.
      Until now, the actual_length value was unaccountably left at 0.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ec6d67e3
    • A
      USB: option: remove unnecessary and erroneous code · f092c240
      Alan Stern 提交于
      This patch (as1264) removes a bunch of unnecessary and erroneous stuff
      from the option USB-serial driver.  Clearly there's no need to verify
      that the device pointer stored in the URBs is right or to store the
      same pointer over again.  After all, the pointer can't change once it
      has been set up.
      
      There's also no need to call usb_clear_halt for the IN endpoint
      multiple times -- in fact, doing so is an error since every time after
      the first there will be active URBs queued for that endpoint.  Since
      the Clear-Halts don't appear to be needed at all, the patch simply
      removes them.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f092c240
    • A
      USB: cypress_m8: remove invalid Clear-Halt · 4d2fae8b
      Alan Stern 提交于
      This patch (as1265) removes an erroneous call to usb_clear_halt from
      the cypress_m8 driver.  The call isn't valid because it is made from
      interrupt context whereas usb_clear_halt is a blocking routine.
      
      Presumably the code has never been executed; if it did it would cause
      an oops.  So instead treat -EPIPE like any other sort of unexplained
      error.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4d2fae8b
    • S
      USB: musb_host: undo incorrect change in musb_advance_schedule() · 1fe975f9
      Sergei Shtylyov 提交于
      Commit c9cd06b3 (musb_host: refactor
      URB giveback) included due to my overlook the change incorrect in the
      context of the current kernel -- undo it.
      Signed-off-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1fe975f9
    • D
      USB: fix LANGID=0 regression · 0cce2eda
      Daniel Mack 提交于
      commit b7af0bb2 ("USB: allow malformed LANGID descriptors") broke support
      for devices without string descriptor support.
      
      Reporting string descriptors is optional to USB devices, and a device
      lets us know it can't deal with strings by responding to the LANGID
      request with a STALL token.
      
      The kernel handled that correctly before b7af0bb2 came in, but failed
      hard if the LANGID was reported but broken. More than that, if a device
      was not able to provide string descriptors, the LANGID was retrieved
      over and over again at each string read request.
      
      This patch changes the behaviour so that
      
       a) the LANGID is only queried once
       b) devices which can't handle string requests are not asked again
       c) devices with malformed LANGID values have a sane fallback to 0x0409
      Signed-off-by: NDaniel Mack <daniel@caiaq.de>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0cce2eda
    • E
      USB: serial: sierra driver id_table additions · c5f3d87d
      Elina Pasheva 提交于
      - Updated the id_table with all devices that Sierra Wireless currently
         support
       - Re-ordered the contents of the id_table for better readability
      Signed-off-by: NElina Pasheva <epasheva@sierrawireless.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c5f3d87d
    • K
      USB serial: Add ID for Turtelizer, an FT2232L-based JTAG/RS-232 adapter. · 14511412
      Krzysztof Halasa 提交于
      Adds USB ID for Turtelizer, an FT2232L-based JTAG/RS-232 adapter.
      Signed-off-by: NKrzysztof Ha³asa <khc@pm.waw.pl>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      14511412
    • O
      USB: fix race leading to a write after kfree in usbfs · 516a1a07
      Oliver Neukum 提交于
      this fixes a race between async_completed() and proc_reapurbnonblock().
      
      CPU A                   CPU B
      
      spin_lock(&ps->lock);
      list_move_tail(&as->asynclist, &ps->async_completed);
      spin_unlock(&ps->lock);
      
                                      if (!(as = async_getcompleted(ps)))
                                              return -EAGAIN;
                                      return processcompl(as, (void __user * __user *)arg);
      
      processcompl() calls free_async() which calls kfree(as)
      
      as->status = urb->status;
      if (as->signr) {
              sinfo.si_signo = as->signr;
              sinfo.si_errno = as->status;
              sinfo.si_code = SI_ASYNCIO;
              sinfo.si_addr = as->userurb;
              kill_pid_info_as_uid(as->signr, &sinfo, as->pid, as->uid,
                                    as->euid, as->secid);
      }
      snoop(&urb->dev->dev, "urb complete\n");
      snoop_urb(urb, as->userurb);
      
      write after kfree
      Signed-off-by: NOliver Neukum <oliver@neukum.org>
      516a1a07
    • A
      USB: Sierra: fix oops upon device close · 7bae0a07
      Alan Stern 提交于
      This patch (as1263) fixes a mixup that occurred when conflicting
      patches for the sierra driver were merged incorrectly.  The former
      sierra_shutdown routine should have been become sierra_release, not
      sierra_disconnect.
      
      The symptom this fixes is an oops when the device file is closed after
      a Sierra device has been unplugged (Bugzilla #13675).
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Tested-by: NPeter Naulls <peter@mushroomnetworks.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7bae0a07
    • A
      USB: option.c: add A-Link 3GU device id · c3325eb1
      Anssi Hannula 提交于
      Add A-Link 3GU device id 1e0e:9200 into option driver. The device
      has 4 interfaces, of which 1 is handled by storage and the other 3
      by option driver.
      
      The device appears first as CD-only 1e0e:f000 device and must be
      switched to 1e0e:9200 mode either by using "eject CD" or
      usb_modeswitch.
      
      For the record, the device does not work with generic usbserial
      driver (usb disconnect when sending the ATDT command).
      Signed-off-by: NAnssi Hannula <anssi.hannula@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      c3325eb1
    • A
      USB: Serial: Add support for Arkham Technology adapters · 0601e116
      Amit Kucheria 提交于
      As reported by David Potts from Arkham Technology, the current driver
      works with their hardware on addition of the device ids.
      Signed-off-by: NAmit Kucheria <amit.kucheria@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      0601e116
    • J
      USB: Fix option_ms regression in 2.6.31-rc2 · 2ab2178c
      Jonathan McDowell 提交于
      Commit 32ebbe7b which filters the
      SCSI REZERO command in option_ms based on a SCSI INQUIRY with a vendor
      of Option breaks my Option Icon 225 (0af0:6971). This device returns a
      vendor of ZCOPTION for the ZeroCD device. The following trivial patch
      fixes things for me.
      Signed-Off-By: NJonathan McDowell <noodles@earth.li>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2ab2178c
    • R
      USB: gadget audio: select SND_PCM · 04950737
      Randy Dunlap 提交于
      Fix USB gadget audio: select SND_PCM, like many other sound
      drivers do, to fix build errors:
      
      drivers/built-in.o: In function `f_audio_playback_work':
      audio.c:(.text+0x15a3e7): undefined reference to `snd_pcm_kernel_ioctl'
      audio.c:(.text+0x15a471): undefined reference to `snd_pcm_lib_write'
      drivers/built-in.o: In function `_snd_pcm_hw_param_set':
      audio.c:(.text+0x15aca7): undefined reference to `snd_interval_refine'
      drivers/built-in.o: In function `gaudio_setup':
      (.init.text+0x12adf): undefined reference to `_snd_pcm_hw_params_any'
      drivers/built-in.o: In function `gaudio_setup':
      (.init.text+0x12b43): undefined reference to `snd_pcm_kernel_ioctl'
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      04950737
    • M
      USB: ftdi: support NDI devices · b760dac2
      Martin Geleynse 提交于
      It enhances the driver for FTDI-based USB serial adapters to recognize and
      support Northern Digital Inc (NDI) measurement equipment. NDI has been
      providing this patch for various kernel flavors for several years and we would
      like to see these changes built in to the driver so that our equipement works
      without the need for customers to patch the kernel themselves.
      
      The patch makes small modifications to 2 files: ./drivers/usb/serial/ftdi_sio.c
      and ./drivers/usb/serial/ftdi_sio.h. It accomplishes 3 things:
      
      1. Define the VID and PIDs to allow the driver to recognize the NDI devices.
      2. Map the 19200 baud rate setting to our higher baud rate of 1.2Mb
         We would have chosen to map 38400 to the higher rate, similar to what
         several other vendors have done, but some of our legacy customers actually
         use 38400, therefore we remap 19200 to the higher rate.
      3. We set the default transmit latency in the FTDI chip to 1ms for our devices.
         Our devices are typically polled at 60Hz and the default ftdi latency
         seriously affects turn-around time and results in missed data frames. We
         have created a modprobe option that allows this setting to be increased.
         This has proven necessary particularly in some virtualized environments.
      Signed-off-by: NMartin P. Geleynse <mgeleyns@ndigital.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      b760dac2