1. 07 10月, 2009 1 次提交
  2. 17 7月, 2009 1 次提交
  3. 15 7月, 2009 1 次提交
  4. 13 7月, 2009 1 次提交
    • 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
  5. 23 6月, 2009 1 次提交
    • A
      ppp: Fix throttling bugs · a6540f73
      Alan Cox 提交于
      The ppp layer goes around calling the unthrottle method from non sleeping
      paths. This isn't safe because the unthrottle methods in the tty layer need
      to be able to sleep (consider a USB dongle).
      
      Until now this didn't show up because the ppp layer never actually throttled
      a port so the unthrottle was always a no-op. Currently it's a mutex taking
      path so warnings are spewed if the unthrottle occurs via certain paths.
      
      Fix this by removing the unneccessary unthrottle calls.
      Signed-off-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a6540f73
  6. 14 3月, 2009 1 次提交
    • G
      ppp: ppp_mp_explode() redesign · 9c705260
      Gabriele Paoloni 提交于
      I found the PPP subsystem to not work properly when connecting channels
      with different speeds to the same bundle.
      
      Problem Description:
      
      As the "ppp_mp_explode" function fragments the sk_buff buffer evenly
      among the PPP channels that are connected to a certain PPP unit to
      make up a bundle, if we are transmitting using an upper layer protocol
      that requires an Ack before sending the next packet (like TCP/IP for
      example), we will have a bandwidth bottleneck on the slowest channel
      of the bundle.
      
      Let's clarify by an example. Let's consider a scenario where we have
      two PPP links making up a bundle: a slow link (10KB/sec) and a fast
      link (1000KB/sec) working at the best (full bandwidth). On the top we
      have a TCP/IP stack sending a 1000 Bytes sk_buff buffer down to the
      PPP subsystem. The "ppp_mp_explode" function will divide the buffer in
      two fragments of 500B each (we are neglecting all the headers, crc,
      flags etc?.). Before the TCP/IP stack sends out the next buffer, it
      will have to wait for the ACK response from the remote peer, so it
      will have to wait for both fragments to have been sent over the two
      PPP links, received by the remote peer and reconstructed. The
      resulting behaviour is that, rather than having a bundle working
      @1010KB/sec (the sum of the channels bandwidths), we'll have a bundle
      working @20KB/sec (the double of the slowest channels bandwidth).
      
      
      Problem Solution:
      
      The problem has been solved by redesigning the "ppp_mp_explode"
      function in such a way to make it split the sk_buff buffer according
      to the speeds of the underlying PPP channels (the speeds of the serial
      interfaces respectively attached to the PPP channels). Referring to
      the above example, the redesigned "ppp_mp_explode" function will now
      divide the 1000 Bytes buffer into two fragments whose sizes are set
      according to the speeds of the channels where they are going to be
      sent on (e.g .  10 Byets on 10KB/sec channel and 990 Bytes on
      1000KB/sec channel).  The reworked function grants the same
      performances of the original one in optimal working conditions (i.e. a
      bundle made up of PPP links all working at the same speed), while
      greatly improving performances on the bundles made up of channels
      working at different speeds.
      Signed-off-by: NGabriele Paoloni <gabriele.paoloni@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c705260
  7. 27 2月, 2009 1 次提交
  8. 26 12月, 2008 1 次提交
    • J
      drivers/net: Remove redundant test · 90f5dfcc
      Julia Lawall 提交于
      In each case, ap is checked not to be NULL a few lines before.
      
      A simplified version of the semantic patch that makes this change is as
      follows: (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      @r exists@
      local idexpression x;
      expression E;
      position p1,p2;
      @@
      
      if (x@p1 == NULL || ...) { ... when forall
         return ...; }
      ... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
      (
      x@p2 == NULL
      |
      x@p2 != NULL
      )
      
      // another path to the test that is not through p1?
      @s exists@
      local idexpression r.x;
      position r.p1,r.p2;
      @@
      
      ... when != x@p1
      (
      x@p2 == NULL
      |
      x@p2 != NULL
      )
      
      @fix depends on !s@
      position r.p1,r.p2;
      expression x,E;
      statement S1,S2;
      @@
      
      (
      - if ((x@p2 != NULL) || ...)
        S1
      |
      - if ((x@p2 == NULL) && ...) S1
      |
      - BUG_ON(x@p2 == NULL);
      )
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      90f5dfcc
  9. 21 7月, 2008 1 次提交
    • A
      tty: Ldisc revamp · a352def2
      Alan Cox 提交于
      Move the line disciplines towards a conventional ->ops arrangement.  For
      the moment the actual 'tty_ldisc' struct in the tty is kept as part of
      the tty struct but this can then be changed if it turns out that when it
      all settles down we want to refcount ldiscs separately to the tty.
      
      Pull the ldisc code out of /proc and put it with our ldisc code.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a352def2
  10. 30 4月, 2008 2 次提交
  11. 13 11月, 2007 1 次提交
  12. 07 11月, 2007 1 次提交
  13. 20 7月, 2007 1 次提交
  14. 20 4月, 2007 1 次提交
    • P
      [PPP]: Fix skbuff.c:BUG due incorrect logic in process_input_packet() · 7c5050e3
      Paul Mackerras 提交于
      From: Paul Mackerras <paulus@samba.org>
      
      This fixes:
      
      Subject: kernel BUG at net/core/skbuff.c in linux-2.6.21-rc6
      
      process_input_packet() treats the case where the first byte is 0xff
      (PPP_ALLSTATIONS) but the second byte is 0x03 (PPP_UI) as indicating a
      packet with a PPP protocol number of 0xff.  Arguably that's wrong
      since PPP protocol 0xff is reserved, and the RFC does envision the
      possibility of receiving frames where the control field has values
      other than 0x03.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c5050e3
  15. 14 9月, 2006 1 次提交
  16. 17 1月, 2006 1 次提交
  17. 11 1月, 2006 1 次提交
    • A
      [PATCH] TTY layer buffering revamp · 33f0f88f
      Alan Cox 提交于
      The API and code have been through various bits of initial review by
      serial driver people but they definitely need to live somewhere for a
      while so the unconverted drivers can get knocked into shape, existing
      drivers that have been updated can be better tuned and bugs whacked out.
      
      This replaces the tty flip buffers with kmalloc objects in rings. In the
      normal situation for an IRQ driven serial port at typical speeds the
      behaviour is pretty much the same, two buffers end up allocated and the
      kernel cycles between them as before.
      
      When there are delays or at high speed we now behave far better as the
      buffer pool can grow a bit rather than lose characters. This also means
      that we can operate at higher speeds reliably.
      
      For drivers that receive characters in blocks (DMA based, USB and
      especially virtualisation) the layer allows a lot of driver specific
      code that works around the tty layer with private secondary queues to be
      removed. The IBM folks need this sort of layer, the smart serial port
      people do, the virtualisers do (because a virtualised tty typically
      operates at infinite speed rather than emulating 9600 baud).
      
      Finally many drivers had invalid and unsafe attempts to avoid buffer
      overflows by directly invoking tty methods extracted out of the innards
      of work queue structs. These are no longer needed and all go away. That
      fixes various random hangs with serial ports on overflow.
      
      The other change in here is to optimise the receive_room path that is
      used by some callers. It turns out that only one ldisc uses receive room
      except asa constant and it updates it far far less than the value is
      read. We thus make it a variable not a function call.
      
      I expect the code to contain bugs due to the size alone but I'll be
      watching and squashing them and feeding out new patches as it goes.
      
      Because the buffers now dynamically expand you should only run out of
      buffering when the kernel runs out of memory for real.  That means a lot of
      the horrible hacks high performance drivers used to do just aren't needed any
      more.
      
      Description:
      
      tty_insert_flip_char is an old API and continues to work as before, as does
      tty_flip_buffer_push() [this is why many drivers dont need modification].  It
      does now also return the number of chars inserted
      
      There are also
      
      tty_buffer_request_room(tty, len)
      
      which asks for a buffer block of the length requested and returns the space
      found.  This improves efficiency with hardware that knows how much to
      transfer.
      
      and tty_insert_flip_string_flags(tty, str, flags, len)
      
      to insert a string of characters and flags
      
      For a smart interface the usual code is
      
          len = tty_request_buffer_room(tty, amount_hardware_says);
          tty_insert_flip_string(tty, buffer_from_card, len);
      
      More description!
      
      At the moment tty buffers are attached directly to the tty.  This is causing a
      lot of the problems related to tty layer locking, also problems at high speed
      and also with bursty data (such as occurs in virtualised environments)
      
      I'm working on ripping out the flip buffers and replacing them with a pool of
      dynamically allocated buffers.  This allows both for old style "byte I/O"
      devices and also helps virtualisation and smart devices where large blocks of
      data suddenely materialise and need storing.
      
      So far so good.  Lots of drivers reference tty->flip.*.  Several of them also
      call directly and unsafely into function pointers it provides.  This will all
      break.  Most drivers can use tty_insert_flip_char which can be kept as an API
      but others need more.
      
      At the moment I've added the following interfaces, if people think more will
      be needed now is a good time to say
      
       int tty_buffer_request_room(tty, size)
      
      Try and ensure at least size bytes are available, returns actual room (may be
      zero).  At the moment it just uses the flipbuf space but that will change.
      Repeated calls without characters being added are not cumulative.  (ie if you
      call it with 1, 1, 1, and then 4 you'll have four characters of space.  The
      other functions will also try and grow buffers in future but this will be a
      more efficient way when you know block sizes.
      
       int tty_insert_flip_char(tty, ch, flag)
      
      As before insert a character if there is room.  Now returns 1 for success, 0
      for failure.
      
       int tty_insert_flip_string(tty, str, len)
      
      Insert a block of non error characters.  Returns the number inserted.
      
       int tty_prepare_flip_string(tty, strptr, len)
      
      Adjust the buffer to allow len characters to be added.  Returns a buffer
      pointer in strptr and the length available.  This allows for hardware that
      needs to use functions like insl or mencpy_fromio.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NJohn Hawkes <hawkes@sgi.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      33f0f88f
  18. 09 11月, 2005 1 次提交
  19. 09 7月, 2005 1 次提交
  20. 24 6月, 2005 1 次提交
  21. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4