1. 14 10月, 2008 1 次提交
    • A
      tty: usb-serial krefs · 4a90f09b
      Alan Cox 提交于
      Use kref in the USB serial drivers so that we don't free tty structures
      from under the URB receive handlers as has historically been the case if
      you were unlucky. This also gives us a framework for general tty drivers to
      use tty_port objects and refcount.
      
      Contains two err->dev_err changes merged together to fix clashes in the
      -next tree.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      4a90f09b
  2. 24 9月, 2008 1 次提交
  3. 14 8月, 2008 1 次提交
  4. 23 7月, 2008 3 次提交
  5. 22 7月, 2008 4 次提交
  6. 30 4月, 2008 1 次提交
    • A
      tty: The big operations rework · f34d7a5b
      Alan Cox 提交于
      - Operations are now a shared const function block as with most other Linux
        objects
      
      - Introduce wrappers for some optional functions to get consistent behaviour
      
      - Wrap put_char which used to be patched by the tty layer
      
      - Document which functions are needed/optional
      
      - Make put_char report success/fail
      
      - Cache the driver->ops pointer in the tty as tty->ops
      
      - Remove various surplus lock calls we no longer need
      
      - Remove proc_write method as noted by Alexey Dobriyan
      
      - Introduce some missing sanity checks where certain driver/ldisc
        combinations would oops as they didn't check needed methods were present
      
      [akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
      [akpm@linux-foundation.org: fix isicom]
      [akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
      [akpm@linux-foundation.org: fix kgdb]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f34d7a5b
  7. 25 4月, 2008 4 次提交
  8. 16 4月, 2008 1 次提交
    • G
      USB: remove broken usb-serial num_endpoints check · 07c3b1a1
      Greg Kroah-Hartman 提交于
      The num_interrupt_in, num_bulk_in, and other checks in the usb-serial
      code are just wrong, there are too many different devices out there with
      different numbers of endpoints.  We need to just be sticking with the
      device ids instead of trying to catch this kind of thing.  It broke too
      many different devices.
      
      This fixes a large number of usb-serial devices to get them working
      properly again.
      
      
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: stable <stable@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      07c3b1a1
  9. 02 2月, 2008 3 次提交
    • O
      USB: stop io performed by mos7720 upon close() · a1cd7e99
      Oliver Neukum 提交于
      This fixes a problem where the mos7720 driver will make io to a device from
      which it has been logically disconnected. It does so by introducing a flag by
      which the generic usb serial code can signal the subdrivers their
      disconnection and appropriate locking.
      Signed-off-by: NOliver Neukum <oneukum@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      a1cd7e99
    • S
      USB: Prepare serial core for autosuspend. · f0fbd5b9
      Sarah Sharp 提交于
      Claim the interface for a USB to serial converter when the tty is open,
      and release the interface when the tty is closed.
      
      If a driver doesn't provide a resume function, use the generic resume
      instead.
      
      Make sure the generic resume function does not submit the URBs if we're
      coming back from autosuspend.  On autoresume, we know that the open
      function will be called next, which will attempt to submit the URBs.  If
      we submit them in the resume function, the open will fail.
      
      This works for:
       - autosuspend
       - suspending with the tty open or closed
       - hibernate with the tty closed
      
      A hibernate (or a suspend that causes the USB subsystem to lose power)
      has issues.  If you have the tty open when you hibernate, a new tty will
      be created when the device re-enumerates during resume.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f0fbd5b9
    • A
      USB: usb_serial: clean tty reference in the last close · 9a6b1efa
      Aristeu Rozanski 提交于
      When a usb serial adapter is used as console, the usb serial console
      driver bumps the open_count on the port struct used but doesn't attach
      a real tty to it (only a fake one temporaly). If this port is opened later
      using the regular character device interface, the open method won't
      initialize the port, which is the expected, and will receive a brand new
      tty struct created by tty layer, which will be stored in port->tty.
      
      When the last close is issued, open_count won't be 0 because of the
      console usage and the port->tty will still contain the old tty value. This
      is the last ttyUSB<n> close so the allocated tty will be freed by the
      tty layer. The usb_serial and usb_serial_port are still in use by the
      console, so port_free() won't be called (serial_close() ->
      usb_serial_put() -> destroy_serial() -> port_free()), so the scheduled
      work (port->work, usb_serial_port_work()) will still run. And
      usb_serial_port_work() does:
      (...)
              tty = port->tty;
              if (!tty)
                      return;
      
              tty_wakeup(tty);
      which causes (manually copied):
      
      Faulting instruction address: 0x6b6b6b68
      Oops: Kernel access of bad area, sig: 11 [#1]
      PREEMPT PowerMac
      Modules linked in: binfmt_misc ipv6 nfs lockd nfs_acl sunrpc dm_snapshot dm_mirror dm_mod hfsplus uinput ams input_polldev genrtc cpufreq_powersave i2c_powermac therm_adt746x snd_aoa_codec_tas snd_aoa_fabric_layout snd_aoa joydev snd_aoa_i2sbus snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc pmac_zilog serial_core evdev ide_cd cdrom snd appletouch soundcore snd_aoa_soundbus bcm43xx firmware_class usbhid ieee80211softmac ff_memless firewire_ohci firewire_core ieee80211 ieee80211_crypt crc_itu_t sungem sungem_phy uninorth_agp agpart ssb
      NIP: 6b6b6b68 LR: c01b2108 CTR: 6b6b6b6b
      REGS: c106de80 TRAP: 0400   Not tainted  (2.6.24-rc2)
      MSR: 40009032 <EE,ME,IR,DR>  CR: 82004024  XER: 00000000
      TASK = c106b4c0[5] 'events/0' THREAD: c106c000
      GPR00: 6b6b6b6b c106df30 c106b4c0 c2d613a0 00009032 00000001 00001a00 00000001
      GPR08: 00000008 00000000 00000000 c106c000 42004028 00000000 016ffbe0 0171a724
      GPR16: 016ffcf4 00240e24 00240e70 016fee68 016ff9a4 c03046c4 c0327f50 c03046fc
      GPR24: c106b6b9 c106b4c0 c101d610 c106c000 c02160fc c1eac1dc c2d613ac c2d613a0
      NIP [6b6b6b68] 0x6b6b6b68
      LR [c01b2108] tty_wakeup+0x6c/0x9c
      Call Trace:
      [c106df30] [c01b20e8] tty_wakeup+0x4c/0x9c (unreliable)
      [c106df40] [c0216138] usb_serial_port_work+0x3c/0x78
      [c106df50] [c00432e8] run_workqueue+0xc4/0x15c
      [c106df90] [c0043798] worker_thread+0xa0/0x124
      [c106dfd0] [c0048224] kthread+0x48/0x84
      [c106dff0] [c00129bc] kernel_thread+0x44/0x60
      Instruction dump:
      XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
      XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
      Slab corruption: size-2048 start=c2d613a0, len=2048
      Redzone: 0x9f911029d74e35b/0x9f911029d74e35b.
      Last user: [<c01b16d8>](release_one_tty+0xbc/0xf4)
      050: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
      Prev obj: start=c2d60b88, len=2048
      Redzone: 0x9f911029d74e35b/0x9f911029d74e35b.
      Last user: [<c00f30ec>](show_stat+0x410/0x428)
      000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
      010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
      
      This patch avoids this, clearing port->tty considering if the port is
      used as serial console or not
      Signed-off-by: NAristeu Rozanski <arozansk@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      9a6b1efa
  10. 26 10月, 2007 2 次提交
  11. 13 10月, 2007 2 次提交
  12. 31 7月, 2007 2 次提交
  13. 13 7月, 2007 2 次提交
  14. 09 5月, 2007 1 次提交
  15. 20 3月, 2007 1 次提交
  16. 10 3月, 2007 3 次提交
  17. 08 2月, 2007 4 次提交
  18. 09 12月, 2006 1 次提交
    • A
      [PATCH] tty: switch to ktermios · 606d099c
      Alan Cox 提交于
      This is the grungy swap all the occurrences in the right places patch that
      goes with the updates.  At this point we have the same functionality as
      before (except that sgttyb() returns speeds not zero) and are ready to
      begin turning new stuff on providing nobody reports lots of bugs
      
      If you are a tty driver author converting an out of tree driver the only
      impact should be termios->ktermios name changes for the speed/property
      setting functions from your upper layers.
      
      If you are implementing your own TCGETS function before then your driver
      was broken already and its about to get a whole lot more painful for you so
      please fix it 8)
      
      Also fill in c_ispeed/ospeed on init for most devices, although the current
      code will do this for you anyway but I'd like eventually to lose that extra
      paranoia
      
      [akpm@osdl.org: bluetooth fix]
      [mp3@de.ibm.com: sclp fix]
      [mp3@de.ibm.com: warning fix for tty3270]
      [hugh@veritas.com: fix tty_ioctl powerpc build]
      [jdike@addtoit.com: uml: fix ->set_termios declaration]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NMartin Peschke <mp3@de.ibm.com>
      Acked-by: NPeter Oberparleiter <oberpar@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      606d099c
  19. 02 12月, 2006 1 次提交
  20. 22 11月, 2006 1 次提交
  21. 02 10月, 2006 1 次提交
    • J
      [PATCH] const struct tty_operations · b68e31d0
      Jeff Dike 提交于
      As part of an SMP cleanliness pass over UML, I consted a bunch of
      structures in order to not have to document their locking.  One of these
      structures was a struct tty_operations.  In order to const it in UML
      without introducing compiler complaints, the declaration of
      tty_set_operations needs to be changed, and then all of its callers need to
      be fixed.
      
      This patch declares all struct tty_operations in the tree as const.  In all
      cases, they are static and used only as input to tty_set_operations.  As an
      extra check, I ran an i386 allyesconfig build which produced no extra
      warnings.
      
      53 drivers are affected.  I checked the history of a bunch of them, and in
      most cases, there have been only a handful of maintenance changes in the
      last six months.  serial_core.c was the busiest one that I looked at.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b68e31d0