1. 20 3月, 2009 2 次提交
    • E
      net: reorder struct Qdisc for better SMP performance · 5e140dfc
      Eric Dumazet 提交于
      dev_queue_xmit() needs to dirty fields "state", "q", "bstats" and "qstats"
      
      On x86_64 arch, they currently span three cache lines, involving more
      cache line ping pongs than necessary, making longer holding of queue spinlock.
      
      We can reduce this to one cache line, by grouping all read-mostly fields
      at the beginning of structure. (Or should I say, all highly modified fields
      at the end :) )
      
      Before patch :
      
      offsetof(struct Qdisc, state)=0x38
      offsetof(struct Qdisc, q)=0x48
      offsetof(struct Qdisc, bstats)=0x80
      offsetof(struct Qdisc, qstats)=0x90
      sizeof(struct Qdisc)=0xc8
      
      After patch :
      
      offsetof(struct Qdisc, state)=0x80
      offsetof(struct Qdisc, q)=0x88
      offsetof(struct Qdisc, bstats)=0xa0
      offsetof(struct Qdisc, qstats)=0xac
      sizeof(struct Qdisc)=0xc0
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5e140dfc
    • S
      rtnetlink: add new value for DHCP added routes · 2e1ab634
      Stephen Hemminger 提交于
      To improve manageability, it would be good to be able to disambiguate routes
      added by administrator from those added by DHCP client.  The only necessary
      kernel change is to add value to rtnetlink include file so iproute2 utility
      can use it.
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2e1ab634
  2. 17 3月, 2009 3 次提交
  3. 16 3月, 2009 3 次提交
    • I
      tcp: cache result of earlier divides when mss-aligning things · 2a3a041c
      Ilpo Järvinen 提交于
      The results is very unlikely change every so often so we
      hardly need to divide again after doing that once for a
      connection. Yet, if divide still becomes necessary we
      detect that and do the right thing and again settle for
      non-divide state. Takes the u16 space which was previously
      taken by the plain xmit_size_goal.
      
      This should take care part of the tso vs non-tso difference
      we found earlier.
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a3a041c
    • I
      tcp: simplify tcp_current_mss · 0c54b85f
      Ilpo Järvinen 提交于
      There's very little need for most of the callsites to get
      tp->xmit_goal_size updated. That will cost us divide as is,
      so slice the function in two. Also, the only users of the
      tp->xmit_goal_size are directly behind tcp_current_mss(),
      so there's no need to store that variable into tcp_sock
      at all! The drop of xmit_goal_size currently leaves 16-bit
      hole and some reorganization would again be necessary to
      change that (but I'm aiming to fill that hole with u16
      xmit_goal_size_segs to cache the results of the remaining
      divide to get that tso on regression).
      
      Bring xmit_goal_size parts into tcp.c
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Cc: Evgeniy Polyakov <zbr@ioremap.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c54b85f
    • E
      net: reorder fields of struct socket · 8bdd663a
      Eric Dumazet 提交于
      On x86_64, its rather unfortunate that "wait_queue_head_t wait"
      field of "struct socket" spans two cache lines (assuming a 64
      bytes cache line in current cpus)
      
      offsetof(struct socket, wait)=0x30
      sizeof(wait_queue_head_t)=0x18
      
      This might explain why Kenny Chang noticed that his multicast workload
      was performing bad with 64 bit kernels, since more cache lines ping pongs
      were involved.
      
      This litle patch moves "wait" field next "fasync_list" so that both
      fields share a single cache line, to speedup sock_def_readable()
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8bdd663a
  4. 14 3月, 2009 5 次提交
    • 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
    • M
      phylib: convert state_queue work to delayed_work · a390d1f3
      Marcin Slusarz 提交于
      It closes a race in phy_stop_machine when reprogramming of phy_timer
      (from phy_state_machine) happens between del_timer_sync and cancel_work_sync.
      
      Without this change it could lead to crash if phy_device would be freed after
      phy_stop_machine (timer would fire and schedule freed work).
      Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
      Acked-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a390d1f3
    • N
      Network Drop Monitor: Adding Build changes to enable drop monitor · 273ae44b
      Neil Horman 提交于
      Network Drop Monitor: Adding Build changes to enable drop monitor
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      
       include/linux/Kbuild |    1 +
       net/Kconfig          |   11 +++++++++++
       net/core/Makefile    |    1 +
       3 files changed, 13 insertions(+)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      273ae44b
    • N
      Network Drop Monitor: Adding drop monitor implementation & Netlink protocol · 9a8afc8d
      Neil Horman 提交于
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      
       include/linux/net_dropmon.h |   56 +++++++++
       net/core/drop_monitor.c     |  263 ++++++++++++++++++++++++++++++++++++++++++++
       2 files changed, 319 insertions(+)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a8afc8d
    • N
      Network Drop Monitor: Adding kfree_skb_clean for non-drops and modifying... · ead2ceb0
      Neil Horman 提交于
      Network Drop Monitor: Adding kfree_skb_clean for non-drops and modifying end-of-line points for skbs
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      
       include/linux/skbuff.h |    4 +++-
       net/core/datagram.c    |    2 +-
       net/core/skbuff.c      |   22 ++++++++++++++++++++++
       net/ipv4/arp.c         |    2 +-
       net/ipv4/udp.c         |    2 +-
       net/packet/af_packet.c |    2 +-
       6 files changed, 29 insertions(+), 5 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ead2ceb0
  5. 06 3月, 2009 1 次提交
  6. 05 3月, 2009 1 次提交
    • D
      vlan: Fix vlan-in-vlan crashes. · 9d40bbda
      David S. Miller 提交于
      As analyzed by Patrick McHardy, vlan needs to reset it's
      netdev_ops pointer in it's ->init() function but this
      leaves the compat method pointers stale.
      
      Add a netdev_resync_ops() and call it from the vlan code.
      
      Any other driver which changes ->netdev_ops after register_netdevice()
      will need to call this new function after doing so too.
      
      With help from Patrick McHardy.
      Tested-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9d40bbda
  7. 04 3月, 2009 1 次提交
  8. 02 3月, 2009 7 次提交
    • R
      skbuff.h: fix timestamps kernel-doc · d3a21be8
      Randy Dunlap 提交于
      Fix skbuff.h kernel-doc for timestamps: must include "struct" keyword,
      otherwise there are kernel-doc errors:
      
      Error(linux-next-20090227//include/linux/skbuff.h:161): cannot understand prototype: 'struct skb_shared_hwtstamps '
      Error(linux-next-20090227//include/linux/skbuff.h:177): cannot understand prototype: 'union skb_shared_tx '
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d3a21be8
    • I
      wimax/i2400m: implement RX reorder support · c747583d
      Inaky Perez-Gonzalez 提交于
      Allow the device to give the driver RX data with reorder information.
      
      When that is done, the device will indicate the driver if a packet has
      to be held in a (sorted) queue. It will also tell the driver when held
      packets have to be released to the OS.
      
      This is done to improve the WiMAX-protocol level retransmission
      support when missing frames are detected.
      
      The code docs provide details about the implementation.
      
      In general, this just hooks into the RX path in rx.c; if a packet with
      the reorder bit in the RX header is detected, the reorder information
      in the header is extracted and one of the four main reorder operations
      are executed. In one case (queue) no packet will be delivered to the
      networking stack, just queued, whereas in the others (reset, update_ws
      and queue_update_ws), queued packet might be delivered depending on
      the window start for the specific queue.
      
      The modifications to files other than rx.c are:
      
      - control.c: during device initialization, enable reordering support
        if the rx_reorder_disabled module parameter is not enabled
      
      - driver.c: expose a rx_reorder_disable module parameter and call
        i2400m_rx_setup/release() to initialize/shutdown RX reorder
        support.
      
      - i2400m.h: introduce members in 'struct i2400m' needed for
        implementing reorder support.
      
      - linux/i2400m.h: introduce TLVs, commands and constant definitions
        related to RX reorder
      
      Last but not least, the rx reorder code includes an small circular log
      where the last N reorder operations are recorded to be displayed in
      case of inconsistency. Otherwise diagnosing issues would be almost
      impossible.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c747583d
    • I
      wimax/i2400m: support extended data RX protocol (no need to reallocate skbs) · fd5c565c
      Inaky Perez-Gonzalez 提交于
      Newer i2400m firmwares (>= v1.4) extend the data RX protocol so that
      each packet has a 16 byte header. This header is mainly used to
      implement host reordeing (which is addressed in later commits).
      
      However, this header also allows us to overwrite it (once data has
      been extracted) with an Ethernet header and deliver to the networking
      stack without having to reallocate the skb (as it happened in fw <=
      v1.3) to make room for it.
      
      - control.c: indicate the device [dev_initialize()] that the driver
        wants to use the extended data RX protocol. Also involves adding the
        definition of the needed data types in include/linux/wimax/i2400m.h.
      
      - rx.c: handle the new payload type for the extended RX data
        protocol. Prepares the skb for delivery to
        netdev.c:i2400m_net_erx().
      
      - netdev.c: Introduce i2400m_net_erx() that adds the fake ethernet
        address to a prepared skb and delivers it to the networking
        stack.
      
      - cleanup: in most instances in rx.c, the variable 'single' was
        renamed to 'single_last' for it better conveys its meaning.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd5c565c
    • K
      wimax: struct device - replace bus_id with dev_name(), dev_set_name() · 347707ba
      Kay Sievers 提交于
      Cc: inaky.perez-gonzalez@intel.com
      Cc: linux-wimax@intel.com
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      347707ba
    • I
      wimax/i2400m: allow control of the base-station idle mode timeout · 8987691a
      Inaky Perez-Gonzalez 提交于
      For power saving reasons, WiMAX links can be put in idle mode while
      connected after a certain time of the link not being used for tx or
      rx. In this mode, the device pages the base-station regularly and when
      data is ready to be transmitted, the link is revived.
      
      This patch allows the user to control the time the device has to be
      idle before it decides to go to idle mode from a sysfs
      interace.
      
      It also updates the initialization code to acknowledge the module
      variable 'idle_mode_disabled' when the firmware is a newer version
      (upcoming 1.4 vs 2.6.29's v1.3).
      
      The method for setting the idle mode timeout in the older firmwares is
      much more limited and can be only done at initialization time. Thus,
      the sysfs file will return -ENOSYS on older ones.
      Signed-off-by: NInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8987691a
    • I
      tcp: kill eff_sacks "cache", the sole user can calculate itself · cabeccbd
      Ilpo Järvinen 提交于
      Also fixes insignificant bug that would cause sending of stale
      SACK block (would occur in some corner cases).
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cabeccbd
    • P
      5ce04e3d
  9. 01 3月, 2009 2 次提交
  10. 28 2月, 2009 2 次提交
  11. 27 2月, 2009 3 次提交
  12. 26 2月, 2009 3 次提交
    • J
      block: reduce stack footprint of blk_recount_segments() · 1e428079
      Jens Axboe 提交于
      blk_recalc_rq_segments() requires a request structure passed in, which
      we don't have from blk_recount_segments(). So the latter allocates one on
      the stack, using > 400 bytes of stack for that. This can cause us to spill
      over one page of stack from ext4 at least:
      
       0)     4560     400   blk_recount_segments+0x43/0x62
       1)     4160      32   bio_phys_segments+0x1c/0x24
       2)     4128      32   blk_rq_bio_prep+0x2a/0xf9
       3)     4096      32   init_request_from_bio+0xf9/0xfe
       4)     4064     112   __make_request+0x33c/0x3f6
       5)     3952     144   generic_make_request+0x2d1/0x321
       6)     3808      64   submit_bio+0xb9/0xc3
       7)     3744      48   submit_bh+0xea/0x10e
       8)     3696     368   ext4_mb_init_cache+0x257/0xa6a [ext4]
       9)     3328     288   ext4_mb_regular_allocator+0x421/0xcd9 [ext4]
      10)     3040     160   ext4_mb_new_blocks+0x211/0x4b4 [ext4]
      11)     2880     336   ext4_ext_get_blocks+0xb61/0xd45 [ext4]
      12)     2544      96   ext4_get_blocks_wrap+0xf2/0x200 [ext4]
      13)     2448      80   ext4_da_get_block_write+0x6e/0x16b [ext4]
      14)     2368     352   mpage_da_map_blocks+0x7e/0x4b3 [ext4]
      15)     2016     352   ext4_da_writepages+0x2ce/0x43c [ext4]
      16)     1664      32   do_writepages+0x2d/0x3c
      17)     1632     144   __writeback_single_inode+0x162/0x2cd
      18)     1488      96   generic_sync_sb_inodes+0x1e3/0x32b
      19)     1392      16   sync_sb_inodes+0xe/0x10
      20)     1376      48   writeback_inodes+0x69/0xb3
      21)     1328     208   balance_dirty_pages_ratelimited_nr+0x187/0x2f9
      22)     1120     224   generic_file_buffered_write+0x1d4/0x2c4
      23)      896     176   __generic_file_aio_write_nolock+0x35f/0x393
      24)      720      80   generic_file_aio_write+0x6c/0xc8
      25)      640      80   ext4_file_write+0xa9/0x137 [ext4]
      26)      560     320   do_sync_write+0xf0/0x137
      27)      240      48   vfs_write+0xb3/0x13c
      28)      192      64   sys_write+0x4c/0x74
      29)      128     128   system_call_fastpath+0x16/0x1b
      
      Split the segment counting out into a __blk_recalc_rq_segments() helper
      to avoid allocating an onstack request just for checking the physical
      segment count.
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      1e428079
    • P
      rcu: Teach RCU that idle task is not quiscent state at boot · a6826048
      Paul E. McKenney 提交于
      This patch fixes a bug located by Vegard Nossum with the aid of
      kmemcheck, updated based on review comments from Nick Piggin,
      Ingo Molnar, and Andrew Morton.  And cleans up the variable-name
      and function-name language.  ;-)
      
      The boot CPU runs in the context of its idle thread during boot-up.
      During this time, idle_cpu(0) will always return nonzero, which will
      fool Classic and Hierarchical RCU into deciding that a large chunk of
      the boot-up sequence is a big long quiescent state.  This in turn causes
      RCU to prematurely end grace periods during this time.
      
      This patch changes the rcutree.c and rcuclassic.c rcu_check_callbacks()
      function to ignore the idle task as a quiescent state until the
      system has started up the scheduler in rest_init(), introducing a
      new non-API function rcu_idle_now_means_idle() to inform RCU of this
      transition.  RCU maintains an internal rcu_idle_cpu_truthful variable
      to track this state, which is then used by rcu_check_callback() to
      determine if it should believe idle_cpu().
      
      Because this patch has the effect of disallowing RCU grace periods
      during long stretches of the boot-up sequence, this patch also introduces
      Josh Triplett's UP-only optimization that makes synchronize_rcu() be a
      no-op if num_online_cpus() returns 1.  This allows boot-time code that
      calls synchronize_rcu() to proceed normally.  Note, however, that RCU
      callbacks registered by call_rcu() will likely queue up until later in
      the boot sequence.  Although rcuclassic and rcutree can also use this
      same optimization after boot completes, rcupreempt must restrict its
      use of this optimization to the portion of the boot sequence before the
      scheduler starts up, given that an rcupreempt RCU read-side critical
      section may be preeempted.
      
      In addition, this patch takes Nick Piggin's suggestion to make the
      system_state global variable be __read_mostly.
      
      Changes since v4:
      
      o	Changes the name of the introduced function and variable to
      	be less emotional.  ;-)
      
      Changes since v3:
      
      o	WARN_ON(nr_context_switches() > 0) to verify that RCU
      	switches out of boot-time mode before the first context
      	switch, as suggested by Nick Piggin.
      
      Changes since v2:
      
      o	Created rcu_blocking_is_gp() internal-to-RCU API that
      	determines whether a call to synchronize_rcu() is itself
      	a grace period.
      
      o	The definition of rcu_blocking_is_gp() for rcuclassic and
      	rcutree checks to see if but a single CPU is online.
      
      o	The definition of rcu_blocking_is_gp() for rcupreempt
      	checks to see both if but a single CPU is online and if
      	the system is still in early boot.
      
      	This allows rcupreempt to again work correctly if running
      	on a single CPU after booting is complete.
      
      o	Added check to rcupreempt's synchronize_sched() for there
      	being but one online CPU.
      
      Tested all three variants both SMP and !SMP, booted fine, passed a short
      rcutorture test on both x86 and Power.
      Located-by: NVegard Nossum <vegard.nossum@gmail.com>
      Tested-by: NVegard Nossum <vegard.nossum@gmail.com>
      Tested-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a6826048
    • B
      ide: fix refcounting in device drivers · 8fed4368
      Bartlomiej Zolnierkiewicz 提交于
      During host driver module removal del_gendisk() results in a final
      put on drive->gendev and freeing the drive by drive_release_dev().
      
      Convert device drivers from using struct kref to use struct device
      so device driver's object holds reference on ->gendev and prevents
      drive from prematurely going away.
      
      Also fix ->remove methods to not erroneously drop reference on a
      host driver by using only put_device() instead of ide*_put().
      Reported-by: NStanislaw Gruszka <stf_xl@wp.pl>
      Tested-by: NStanislaw Gruszka <stf_xl@wp.pl>
      Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
      8fed4368
  13. 25 2月, 2009 3 次提交
    • V
      gpu/drm, x86, PAT: io_mapping_create_wc and resource_size_t · 4ab0d47d
      Venkatesh Pallipadi 提交于
      io_mapping_create_wc should take a resource_size_t parameter in place of
      unsigned long. With unsigned long, there will be no way to map greater than 4GB
      address in i386/32 bit.
      
      On x86, greater than 4GB addresses cannot be mapped on i386 without PAE. Return
      error for such a case.
      
      Patch also adds a structure for io_mapping, that saves the base, size and
      type on HAVE_ATOMIC_IOMAP archs, that can be used to verify the offset on
      io_mapping_map calls.
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NSuresh Siddha <suresh.b.siddha@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Keith Packard <keithp@keithp.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4ab0d47d
    • P
      netlink: change nlmsg_notify() return value logic · 1ce85fe4
      Pablo Neira Ayuso 提交于
      This patch changes the return value of nlmsg_notify() as follows:
      
      If NETLINK_BROADCAST_ERROR is set by any of the listeners and
      an error in the delivery happened, return the broadcast error;
      else if there are no listeners apart from the socket that
      requested a change with the echo flag, return the result of the
      unicast notification. Thus, with this patch, the unicast
      notification is handled in the same way of a broadcast listener
      that has set the NETLINK_BROADCAST_ERROR socket flag.
      
      This patch is useful in case that the caller of nlmsg_notify()
      wants to know the result of the delivery of a netlink notification
      (including the broadcast delivery) and take any action in case
      that the delivery failed. For example, ctnetlink can drop packets
      if the event delivery failed to provide reliable logging and
      state-synchronization at the cost of dropping packets.
      
      This patch also modifies the rtnetlink code to ignore the return
      value of rtnl_notify() in all callers. The function rtnl_notify()
      (before this patch) returned the error of the unicast notification
      which makes rtnl_set_sk_err() reports errors to all listeners. This
      is not of any help since the origin of the change (the socket that
      requested the echoing) notices the ENOBUFS error if the notification
      fails and should resync itself.
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ce85fe4
    • J
      i2c-dev: Clarify the unit of ioctl I2C_TIMEOUT · cd97f39b
      Jean Delvare 提交于
      The unit in which user-space can set the bus timeout value is jiffies
      for historical reasons (back when HZ was always 100.) This is however
      not good because user-space doesn't know how long a jiffy lasts. The
      timeout value should instead be set in a fixed time unit. Given the
      original value of HZ, this unit should be 10 ms, for compatibility.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Acked-by: NWolfram Sang <w.sang@pengutronix.de>
      cd97f39b
  14. 23 2月, 2009 1 次提交
  15. 22 2月, 2009 1 次提交
  16. 21 2月, 2009 2 次提交
    • M
      8250: fix boot hang with serial console when using with Serial Over Lan port · b6adea33
      Mauro Carvalho Chehab 提交于
      Intel 8257x Ethernet boards have a feature called Serial Over Lan.
      
      This feature works by emulating a serial port, and it is detected by
      kernel as a normal 8250 port.  However, this emulation is not perfect, as
      also noticed on changeset 7500b1f6.
      
      Before this patch, the kernel were trying to check if the serial TX is
      capable of work using IRQ's.
      
      This were done with a code similar this:
      
              serial_outp(up, UART_IER, UART_IER_THRI);
              lsr = serial_in(up, UART_LSR);
              iir = serial_in(up, UART_IIR);
              serial_outp(up, UART_IER, 0);
      
              if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT)
      		up->bugs |= UART_BUG_TXEN;
      
      This works fine for other 8250 ports, but, on 8250-emulated SoL port, the
      chip is a little lazy to down UART_IIR_NO_INT at UART_IIR register.
      
      Due to that, UART_BUG_TXEN is sometimes enabled.  However, as TX IRQ keeps
      working, and the TX polling is now enabled, the driver miss-interprets the
      IRQ received later, hanging up the machine until a key is pressed at the
      serial console.
      
      This is the 6 version of this patch.  Previous versions were trying to
      introduce a large enough delay between serial_outp and serial_in(up,
      UART_IIR), but not taking forever.  However, the needed delay couldn't be
      safely determined.
      
      At the experimental tests, a delay of 1us solves most of the cases, but
      still hangs sometimes.  Increasing the delay to 5us was better, but still
      doesn't solve.  A very high delay of 50 ms seemed to work every time.
      
      However, poking around with delays and pray for it to be enough doesn't
      seem to be a good approach, even for a quirk.
      
      So, instead of playing with random large arbitrary delays, let's just
      disable UART_BUG_TXEN for all SoL ports.
      
      [akpm@linux-foundation.org: fix warnings]
      Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      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>
      b6adea33
    • M
      spi_bitbang: add more lowlevel function documentation · 01b24fee
      Michael Buesch 提交于
      This adds more documentation of the lowlevel API to avoid future bugs.
      Signed-off-by: NMichael Buesch <mb@bu3sch.de>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      01b24fee