1. 16 12月, 2009 3 次提交
  2. 01 12月, 2009 1 次提交
  3. 26 11月, 2009 1 次提交
  4. 20 11月, 2009 1 次提交
  5. 19 11月, 2009 1 次提交
  6. 18 11月, 2009 1 次提交
  7. 13 11月, 2009 1 次提交
  8. 04 11月, 2009 1 次提交
  9. 31 10月, 2009 1 次提交
  10. 22 10月, 2009 2 次提交
  11. 15 10月, 2009 4 次提交
    • A
      tty: fix vt_compat_ioctl · 4b1fe779
      Andreas Schwab 提交于
      Call compat_unimap_ioctl, not do_unimap_ioctl.
      
      This was broken by commit e9216651.
      
      The compat_unimap_ioctl was originally called do_unimap_ioctl in
      fs/compat_ioctl.h which got moved to drivers/char/vt_ioctl.c.
      In that patch, the caller was not updated and consequently called
      the native handler.
      Signed-off-by: NAndreas Schwab <schwab@linux-m68k.org>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4b1fe779
    • L
      tty: use the new 'flush_delayed_work()' helper to do ldisc flush · 97ad5a03
      Linus Torvalds 提交于
      This way all flush_to_ldisc work is always done through the workqueues,
      and we thus have a single point of serialization.  It also means that we
      can avoid calling flush_to_ldisc() entirely if there was no delayed work
      pending.
      
      [ Side note: using workqueues and keventd as the single way to enter
        flush_to_ldisc() still doesn't absolutely guarantee that we can't have
        concurrency: keventd is multithreaded and has a thread per CPU, and
        while the WORK_STRUCT_PENDING bit guarantees a single work only being
        on the pending list once, the work might be both pending and _running_
        at the same time. Workqueues are not simple. ]
      
      This was also confirmed to fix bugzilla #14388, even without the earlier
      locking fix and cleanup (commit c8e33141: "tty: Make flush_to_ldisc()
      locking more robust").  So both commits fix the same bug differently,
      and either would have worked on its own.  But I'm committing them both
      since they are cleanups independent of each other.
      Reported-and-tested-by: NBoyan <btanastasov@yahoo.co.uk>
      Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      97ad5a03
    • L
      tty: Make flush_to_ldisc() locking more robust · c8e33141
      Linus Torvalds 提交于
      The locking logic in this function is extremely subtle, and it broke
      when we started doing potentially concurrent 'flush_to_ldisc()' calls in
      commit e043e42b ("pty: avoid forcing
      'low_latency' tty flag").
      
      The code in flush_to_ldisc() used to set 'tty->buf.head' to NULL, with
      the intention that this would then cause any other concurrent calls to
      not do anything (locking note: we have to drop the buf.lock over the
      call to ->receive_buf that can block, which is why we can have
      concurrency here at all in the first place).
      
      It also used to set the TTY_FLUSHING bit, which would then cause any
      concurrent 'tty_buffer_flush()' to not free all the tty buffers and
      clear 'tty->buf.tail'.  And with 'buf.head' being NULL, and 'buf.tail'
      being non-NULL, new data would never touch 'buf.head'.
      
      Does that sound a bit too subtle? It was.  If another concurrent call to
      'flush_to_ldisc()' were to come in, the NULL buf.head would indeed cause
      it to not process the buffer list, but it would still clear TTY_FLUSHING
      afterwards, making the buffer protection against 'tty_buffer_flush()' no
      longer work.
      
      So this clears it all up.  We depend purely on TTY_FLUSHING for handling
      re-entrancy, and stop playing games with the buffer list entirely.  In
      fact, the buffer list handling is now robust enough that we could
      probably stop doing the whole "protect against 'tty_buffer_flush()'"
      thing entirely.
      
      However, Alan also points out that we would probably be better off
      simplifying the locking even further, and just take the tty ldisc_mutex
      around all the buffer flushing calls.  That seems like a good idea, but
      in the meantime this is a conceptually minimal fix (with the patch
      itself being bigger than required just to clean the code up and make it
      readable).
      
      This fixes keyboard trouble under X:
      
      	http://bugzilla.kernel.org/show_bug.cgi?id=14388Reported-and-tested-by: NFrédéric Meunier <fredlwm@gmail.com>
      Reported-and-tested-by: NBoyan <btanastasov@yahoo.co.uk>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c8e33141
    • L
      tty: use the new 'flush_delayed_work()' helper to do ldisc flush · 514fc01d
      Linus Torvalds 提交于
      This way all flush_to_ldisc work is always done through the workqueues,
      and we thus have a single point of serialization.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      514fc01d
  12. 14 10月, 2009 2 次提交
  13. 12 10月, 2009 1 次提交
  14. 09 10月, 2009 1 次提交
  15. 05 10月, 2009 1 次提交
  16. 04 10月, 2009 1 次提交
    • L
      tty: Avoid dropping ldisc_mutex over hangup tty re-initialization · 0b5759c6
      Linus Torvalds 提交于
      A couple of people have hit the WARN_ON() in drivers/char/tty_io.c,
      tty_open() that is unhappy about seeing the tty line discipline go away
      during the tty hangup. See for example
      
      	http://bugzilla.kernel.org/show_bug.cgi?id=14255
      
      and the reason is that we do the tty_ldisc_halt() outside the
      ldisc_mutex in order to be able to flush the scheduled work without a
      deadlock with vhangup_work.
      
      However, it turns out that we can solve this particular case by
      
       - using "cancel_delayed_work_sync()" in tty_ldisc_halt(), which waits
         for just the particular work, rather than synchronizing with any
         random outstanding pending work.
      
         This won't deadlock, since the buf.work we synchronize with doesn't
         care about the ldisc_mutex, it just flushes the tty ldisc buffers.
      
       - realize that for this particular case, we don't need to wait for any
         hangup work, because we are inside the hangup codepaths ourselves.
      
      so as a result we can just drop the flush_scheduled_work() entirely, and
      then move the tty_ldisc_halt() call to inside the mutex.  That way we
      never expose the partially torn down ldisc state to tty_open(), and hold
      the ldisc_mutex over the whole sequence.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Reported-by: NHeinz Diehl <htd@fancy-poultry.org>
      Cc: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0b5759c6
  17. 03 10月, 2009 1 次提交
  18. 02 10月, 2009 4 次提交
  19. 30 9月, 2009 1 次提交
    • L
      pty: reconnect the BSD TIOCSPTLCK handling to legacy ptys · 342a5971
      Linus Torvalds 提交于
      David Howells noticed (due to the compiler warning about an unused
      'pty_ops_bsd' variable) that we haven't actually been using the code
      that implements TIOCSPTLCK for legacy pty handling.  It's been that way
      since 2.6.26, commit 3e8e88ca to be
      exact ("pty: prepare for tty->ops changes").
      
      DavidH initially submitted a patch just removing the dead code entirely,
      and since nobody has apparently ever complained, I'm not entirely sure
      that wouldn't be the right thing to do.  But since the whole and only
      point of the legacy pty code is to be compatible with legacy distros
      that don't use the new unix98 pty model, let's just wire it up again.
      
      And clean it up a bit while we're at it.
      Acked-by: NDavid Howells <dhowells@redhat.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      342a5971
  20. 28 9月, 2009 2 次提交
    • D
      tty: Fix regressions caused by commit b50989dc · f278a2f7
      Dave Young 提交于
      The following commit made console open fails while booting:
      
      	commit b50989dc
      	Author: Alan Cox <alan@linux.intel.com>
      	Date:   Sat Sep 19 13:13:22 2009 -0700
      
      	tty: make the kref destructor occur asynchronously
      
      Due to tty release routines run in a workqueue now, error like the
      following will be reported while booting:
      
      INIT open /dev/console Input/output error
      
      It also causes hibernation regression to appear as reported at
      http://bugzilla.kernel.org/show_bug.cgi?id=14229
      
      The reason is that now there's latency issue with closing, but when
      we open a "closing not finished" tty, -EIO will be returned.
      
      Fix it as per the following Alan's suggestion:
      
        Fun but it's actually not a bug and the fix is wrong in itself as
        the port may be closing but not yet being destructed, in which case
        it seems to do the wrong thing.  Opening a tty that is closing (and
        could be closing for long periods) is supposed to return -EIO.
      
        I suspect a better way to deal with this and keep the old console
        timing is to split tty->shutdown into two functions.
      
        tty->shutdown() - called synchronously just before we dump the tty
        onto the waitqueue for destruction
      
        tty->cleanup() - called when the destructor runs.
      
        We would then do the shutdown part which can occur in IRQ context
        fine, before queueing the rest of the release (from tty->magic = 0
        ...  the end) to occur asynchronously
      
        The USB update in -next would then need a call like
      
             if (tty->cleanup)
                     tty->cleanup(tty);
      
        at the top of the async function and the USB shutdown to be split
        between shutdown and cleanup as the USB resource cleanup and final
        tidy cannot occur synchronously as it needs to sleep.
      
        In other words the logic becomes
      
             final kref put
                     make object unfindable
      
             async
                     clean it up
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      [ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ]
      Signed-off-by: N"Rafael J. Wysocki" <rjw@sisk.pl>
      [ Changed serial naming to match new rules, dropped tty_shutdown as per
        comments from Alan Stern  - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f278a2f7
    • A
      const: mark struct vm_struct_operations · f0f37e2f
      Alexey Dobriyan 提交于
      * mark struct vm_area_struct::vm_ops as const
      * mark vm_ops in AGP code
      
      But leave TTM code alone, something is fishy there with global vm_ops
      being used.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f0f37e2f
  21. 25 9月, 2009 1 次提交
  22. 24 9月, 2009 8 次提交