1. 14 2月, 2012 3 次提交
    • L
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · ed5016d7
      Linus Torvalds 提交于
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        ARM: 7322/1: Print BUG instead of undefined instruction on BUG_ON()
        ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR
        ARM: 7320/1: Fix proc_info table alignment
      ed5016d7
    • L
      i387: make irq_fpu_usable() tests more robust · 5b1cbac3
      Linus Torvalds 提交于
      Some code - especially the crypto layer - wants to use the x86
      FP/MMX/AVX register set in what may be interrupt (typically softirq)
      context.
      
      That *can* be ok, but the tests for when it was ok were somewhat
      suspect.  We cannot touch the thread-specific status bits either, so
      we'd better check that we're not going to try to save FP state or
      anything like that.
      
      Now, it may be that the TS bit is always cleared *before* we set the
      USEDFPU bit (and only set when we had already cleared the USEDFP
      before), so the TS bit test may actually have been sufficient, but it
      certainly was not obviously so.
      
      So this explicitly verifies that we will not touch the TS_USEDFPU bit,
      and adds a few related sanity-checks.  Because it seems that somehow
      AES-NI is corrupting user FP state.  The cause is not clear, and this
      patch doesn't fix it, but while debugging it I really wanted the code to
      be more obviously correct and robust.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5b1cbac3
    • L
      i387: math_state_restore() isn't called from asm · be98c2cd
      Linus Torvalds 提交于
      It was marked asmlinkage for some really old and stale legacy reasons.
      Fix that and the equally stale comment.
      
      Noticed when debugging the irq_fpu_usable() bugs.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      be98c2cd
  2. 12 2月, 2012 1 次提交
    • L
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 3ec1e88b
      Linus Torvalds 提交于
      Says Jens:
      
       "Time to push off some of the pending items.  I really wanted to wait
        until we had the regression nailed, but alas it's not quite there yet.
        But I'm very confident that it's "just" a missing expire on exit, so
        fix from Tejun should be fairly trivial.  I'm headed out for a week on
        the slopes.
      
        - Killing the barrier part of mtip32xx.  It doesn't really support
          barriers, and it doesn't need them (writes are fully ordered).
      
        - A few fixes from Dan Carpenter, preventing overflows of integer
          multiplication.
      
        - A fixup for loop, fixing a previous commit that didn't quite solve
          the partial read problem from Dave Young.
      
        - A bio integer overflow fix from Kent Overstreet.
      
        - Improvement/fix of the door "keep locked" part of the cdrom shared
          code from Paolo Benzini.
      
        - A few cfq fixes from Shaohua Li.
      
        - A fix for bsg sysfs warning when removing a file it did not create
          from Stanislaw Gruszka.
      
        - Two fixes for floppy from Vivek, preventing a crash.
      
        - A few block core fixes from Tejun.  One killing the over-optimized
          ioc exit path, cleaning that up nicely.  Two others fixing an oops
          on elevator switch, due to calling into the scheduler merge check
          code without holding the queue lock."
      
      * 'for-linus' of git://git.kernel.dk/linux-block:
        block: fix lockdep warning on io_context release put_io_context()
        relay: prevent integer overflow in relay_open()
        loop: zero fill bio instead of return -EIO for partial read
        bio: don't overflow in bio_get_nr_vecs()
        floppy: Fix a crash during rmmod
        floppy: Cleanup disk->queue before caling put_disk() if add_disk() was never called
        cdrom: move shared static to cdrom_device_info
        bsg: fix sysfs link remove warning
        block: don't call elevator callbacks for plug merges
        block: separate out blk_rq_merge_ok() and blk_try_merge() from elevator functions
        mtip32xx: removed the irrelevant argument of mtip_hw_submit_io() and the unused member of struct driver_data
        block: strip out locking optimization in put_io_context()
        cdrom: use copy_to_user() without the underscores
        block: fix ioc locking warning
        block: fix NULL icq_cache reference
        block,cfq: change code order
      3ec1e88b
  3. 11 2月, 2012 11 次提交
    • T
      block: fix lockdep warning on io_context release put_io_context() · d8c66c5d
      Tejun Heo 提交于
      11a3122f "block: strip out locking optimization in put_io_context()"
      removed ioc_lock depth lockdep annoation along with locking
      optimization; however, while recursing from put_io_context() is no
      longer possible, ioc_release_fn() may still end up putting the last
      reference of another ioc through elevator, which wlil grab ioc->lock
      triggering spurious (as the ioc is always different one) A-A deadlock
      warning.
      
      As this can only happen one time from ioc_release_fn(), using non-zero
      subclass from ioc_release_fn() is enough.  Use subclass 1.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      d8c66c5d
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 8df54d62
      Linus Torvalds 提交于
      Quoth David:
      
      1) GRO MAC header comparisons were ethernet specific, breaking other
         link types.  This required a multi-faceted fix to cure the originally
         noted case (Infiniband), because IPoIB was lying about it's actual
         hard header length.  Thanks to Eric Dumazet, Roland Dreier, and
         others.
      
      2) Fix build failure when INET_UDP_DIAG is built in and ipv6 is modular.
         From Anisse Astier.
      
      3) Off by ones and other bug fixes in netprio_cgroup from Neil Horman.
      
      4) ipv4 TCP reset generation needs to respect any network interface
         binding from the socket, otherwise route lookups might give a
         different result than all the other segments received.  From Shawn
         Lu.
      
      5) Fix unintended regression in ipv4 proxy ARP responses, from Thomas
         Graf.
      
      6) Fix SKB under-allocation bug in sh_eth, from Yoshihiro Shimoda.
      
      7) Revert skge PCI mapping changes that are causing crashes for some
         folks, from Stephen Hemminger.
      
      8) IPV4 route lookups fill in the wildcarded fields of the given flow
         lookup key passed in, which is fine most of the time as this is
         exactly what the caller's want.  However there are a few cases that
         want to retain the original flow key values afterwards, so handle
         those cases properly.  Fix from Julian Anastasov.
      
      9) IGB/IXGBE VF lookup bug fixes from Greg Rose.
      
      10) Properly null terminate filename passed to ethtool flash device
          method, from Ben Hutchings.
      
      11) S3 resume fix in via-velocity from David Lv.
      
      12) Fix double SKB free during xmit failure in CAIF, from Dmitry
          Tarnyagin.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (72 commits)
        net: Don't proxy arp respond if iif == rt->dst.dev if private VLAN is disabled
        ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr.
        netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m
        netprio_cgroup: don't allocate prio table when a device is registered
        netprio_cgroup: fix an off-by-one bug
        bna: fix error handling of bnad_get_flash_partition_by_offset()
        isdn: type bug in isdn_net_header()
        net: Make qdisc_skb_cb upper size bound explicit.
        ixgbe: ethtool: stats user buffer overrun
        ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state
        ixgbe: do not update real num queues when netdev is going away
        ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size
        ixgbe: Fix case of Tx Hang in PF with 32 VFs
        ixgbe: fix vf lookup
        igb: fix vf lookup
        e1000: add dropped DMA receive enable back in for WoL
        gro: more generic L2 header check
        IPoIB: Stop lying about hard_header_len and use skb->cb to stash LL addresses
        zd1211rw: firmware needs duration_id set to zero for non-pspoll frames
        net: enable TC35815 for MIPS again
        ...
      8df54d62
    • T
      net: Don't proxy arp respond if iif == rt->dst.dev if private VLAN is disabled · 70620c46
      Thomas Graf 提交于
      Commit 653241 (net: RFC3069, private VLAN proxy arp support) changed
      the behavior of arp proxy to send arp replies back out on the interface
      the request came in even if the private VLAN feature is disabled.
      
      Previously we checked rt->dst.dev != skb->dev for in scenarios, when
      proxy arp is enabled on for the netdevice and also when individual proxy
      neighbour entries have been added.
      
      This patch adds the check back for the pneigh_lookup() scenario.
      Signed-off-by: NThomas Graf <tgraf@suug.ch>
      Acked-by: NJesper Dangaard Brouer <hawk@comx.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      70620c46
    • L
      ipv4: Fix wrong order of ip_rt_get_source() and update iph->daddr. · 5dc7883f
      Li Wei 提交于
      This patch fix a bug which introduced by commit ac8a4810 (ipv4: Save
      nexthop address of LSRR/SSRR option to IPCB.).In that patch, we saved
      the nexthop of SRR in ip_option->nexthop and update iph->daddr until
      we get to ip_forward_options(), but we need to update it before
      ip_rt_get_source(), otherwise we may get a wrong src.
      Signed-off-by: NLi Wei <lw@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5dc7883f
    • N
      netprio_cgroup: fix wrong memory access when NETPRIO_CGROUP=m · 2b73bc65
      Neil Horman 提交于
      When the netprio_cgroup module is not loaded, net_prio_subsys_id
      is -1, and so sock_update_prioidx() accesses cgroup_subsys array
      with negative index subsys[-1].
      
      Make the code resembles cls_cgroup code, which is bug free.
      Origionally-authored-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b73bc65
    • N
      netprio_cgroup: don't allocate prio table when a device is registered · f5c38208
      Neil Horman 提交于
      So we delay the allocation till the priority is set through cgroup,
      and this makes skb_update_priority() faster when it's not set.
      
      This also eliminates an off-by-one bug similar with the one fixed
      in the previous patch.
      Origionally-authored-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5c38208
    • N
      netprio_cgroup: fix an off-by-one bug · a87dfe14
      Neil Horman 提交于
      # mount -t cgroup xxx /mnt
        # mkdir /mnt/tmp
        # cat /mnt/tmp/net_prio.ifpriomap
        lo 0
        eth0 0
        virbr0 0
        # echo 'lo 999' > /mnt/tmp/net_prio.ifpriomap
        # cat /mnt/tmp/net_prio.ifpriomap
        lo 999
        eth0 0
        virbr0 4101267344
      
      We got weired output, because we exceeded the boundary of the array.
      We may even crash the kernel..
      Origionally-authored-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a87dfe14
    • L
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 612b8507
      Linus Torvalds 提交于
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/i915: fixup interlaced bits clearing in PIPECONF on PCH_SPLIT (v2)
        drm/i915: no lvds quirk for AOpen MP45
        drm/i915: Force explicit bpp selection for intel_dp_link_required
        drm/radeon: do not continue after error from r600_ib_test
        drivers/gpu/drm/drm_ioc32.c: initialize all fields
        drm/i915: fixup interlaced bits clearing in PIPECONF on PCH_SPLIT
        drm/i915:: Disable FBC on SandyBridge
      612b8507
    • L
      Merge tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux · af5feae3
      Linus Torvalds 提交于
      fix 1 mysterious divide error
      fix 3 NULL dereference bugs in writeback tracing, on SD card removal w/o umount
      
      * tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
        writeback: fix dereferencing NULL bdi->dev on trace_writeback_queue
        lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit kernel
        writeback: fix NULL bdi->dev in trace writeback_single_inode
        backing-dev: fix wakeup timer races with bdi_unregister()
      af5feae3
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ce2814f2
      Linus Torvalds 提交于
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf: Fix double start/stop in x86_pmu_start()
        perf evsel: Fix an issue where perf report fails to show the proper percentage
        perf tools: Fix prefix matching for kernel maps
        perf tools: Fix perf stack to non executable on x86_64
        perf: Remove deprecated WARN_ON_ONCE()
      ce2814f2
    • L
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 1282ab3f
      Linus Torvalds 提交于
      Couple of regressions, couple of zero-day bugs, a minor enhancement.
      Nothing really major.
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value
        hwmon: (f75375s) Fix bit shifting in f75375_write16
        hwmon: (f75375s) Fix reading of wrong register when initializing the F75387
        hwmon: (f75375s) Fix automatic pwm mode setting for F75373 & F75375
        hwmon: (w83627ehf) Remove duplicate code
      1282ab3f
  4. 10 2月, 2012 18 次提交
    • D
      Merge branch 'drm-intel-fixes' of... · 28a4d567
      Dave Airlie 提交于
      Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux into drm-fixes
      
      * 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux:
        drm/i915: fixup interlaced bits clearing in PIPECONF on PCH_SPLIT (v2)
        drm/i915: no lvds quirk for AOpen MP45
        drm/i915: Force explicit bpp selection for intel_dp_link_required
        drm/i915: fixup interlaced bits clearing in PIPECONF on PCH_SPLIT
        drm/i915:: Disable FBC on SandyBridge
      28a4d567
    • D
      relay: prevent integer overflow in relay_open() · f6302f1b
      Dan Carpenter 提交于
      "subbuf_size" and "n_subbufs" come from the user and they need to be
      capped to prevent an integer overflow.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable@kernel.org
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      f6302f1b
    • L
      Merge tag 'tty-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 19e00f2f
      Linus Torvalds 提交于
      Serial/TTY fixes for the 3.3-rc3 tree
      
      Just a few new device ids, omap serial driver regression fixes, and a
      build fix for the 8250 driver movement.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      * tag 'tty-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds
        tty: serial: OMAP: block idle while the UART is transferring data in PIO mode
        tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode
        m32r: relocate drivers back out of 8250 dir
        tty: fix a build failure on sparc
        serial: samsung: Add support for EXYNOS5250
        serial: samsung: Add support for EXYNOS4212 and EXYNOS4412
        drivers/tty/vt/vt_ioctl.c: fix KDFONTOP 32bit compatibility layer
      19e00f2f
    • L
      Merge tag 'staging-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · b05ee6bf
      Linus Torvalds 提交于
      Staging tree patches for 3.3-rc3
      
      Big things here is the deletion of the Android pmem driver, as it's
      obsolete and no one uses it, the gma500 driver as it's already in the
      drm portion of the kernel tree, and the pohmelfs filesystem as it's
      obsolete and a rewritten version is being proposed for the fs/ section
      of the kernel.
      
      Other than that, a smattering of different bugfixes and regressions, and
      some omap drm api merge fixups that were needed due to api changes in
      the main portion of the drm tree, allowing this code to build properly
      again.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      * tag 'staging-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (28 commits)
        staging: pohmelfs: remove drivers/staging/pohmelfs
        staging: android/ram_console: Don't build on arches w/o ioremap
        staging: r8712u: Use asynchronous firmware loading
        staging: usbip: fix to prevent potentially using uninitialized spinlock
        staging: r8712u: Fix problem when CONFIG_R8712_AP is set
        staging: tidspbridge: fix incorrect free to drv_datap
        staging: tidspbridge: fix bridge_open memory leaks
        staging: android: lowmemorykiller: Don't wait more than one second for a process to die
        MAINTAINERS: staging: iio: add iio information
        staging: zcache: fix serialization bug in zv stats
        staging: fix go7007-usb license
        Staging: android: binder: Fix crashes when sharing a binder file between processes
        Staging: android: Remove pmem driver
        Staging: asus_oled: fix NULL-ptr crash on unloading
        Staging: asus_oled: fix image processing
        Staging: android: binder: Don't call dump_stack in binder_vma_open
        staging: r8712u: Add new Sitecom UsB ID
        zcache: Set SWIZ_BITS to 8 to reduce tmem bucket lock contention.
        zcache: fix deadlock condition
        staging: drm/omap: fix locking issue
        ...
      b05ee6bf
    • L
      Merge tag 'driver-core-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · b0286db4
      Linus Torvalds 提交于
      Driver core fixes for the 3.3-rc3 tree.
      
      A few fixes for kobject warnings that have popped up in the cpu hotplug path,
      and a regression fix for the speed of the hotplug memory code.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      * tag 'driver-core-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        driver-core: cpu: fix kobject warning when hotplugging a cpu
        ACPI: remove duplicated lines of merging problems with acpi_processor_add
        docbook: fix fatal errors in device-drivers docbook and add DMA Management section
        drivers/base/memory.c: fix memory_dev_init() long delay
        driver core: cpu: remove kernel warning when removing a cpu
      b0286db4
    • L
      Merge tag 'char-misc-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · ae5cdd40
      Linus Torvalds 提交于
      Minor char-misc fixes for 3.3-rc3
      
      Nothing big here, some Kconfig fixes for the MISC_DEVICES config option
      that was being used incorrectly, and some other minor bug fixes.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      * tag 'char-misc-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        mmc: cb710 core: Add missing spin_lock_init for irq_lock of struct cb710_chip
        cs5535-mfgpt: don't call __init function from __devinit
        vmw_balloon: fix for a -Wuninitialized warning
        drivers: misc: Remove MISC_DEVICES config option
        c2port: fix build error for duramar2150 due to missing header.
      ae5cdd40
    • L
      Merge tag 'usb-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · fe250923
      Linus Torvalds 提交于
      USB fixes for 3.3-rc3
      
      Here are a few minor USB fixes and a bunch of device id updates for the
      USB drivers.
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      * tag 'usb-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: usbserial: add new PID number (0xa951) to the ftdi driver
        usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu()
        usb: musb: fix a build error on mips
        uwb & wusb & usb wireless controllers: fix kconfig error & build errors
        usb: Skip PCI USB quirk handling for Netlogic XLP
        powerpc/usb: fix issue of CPU halt when missing USB PHY clock
        usb: otg: mv_otg: Add dependence
        usb: host: Distinguish Kconfig text for Freescale controllers
        USB: add new zte 3g-dongle's pid to option.c
        usb: ch9.h: usb_endpoint_maxp() uses __le16_to_cpu()
        USB: qcserial: don't enable autosuspend
        USB: qcserial: add several new serial devices
        usb: otg: mv_otg: Add dependence
        usb: gadget: zero: fix bug in loopback autoresume handling
      fe250923
    • D
      bna: fix error handling of bnad_get_flash_partition_by_offset() · 027a3b61
      Dan Carpenter 提交于
      The current error handling doesn't work because we flash_part is a u32
      so the checks for negative error codes don't work.  I considered making
      things signed but I don't know the hardware enough to say if that's a
      problem.  Really, we don't use the error codes so just returning zero
      for all problems is fine.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      027a3b61
    • D
      isdn: type bug in isdn_net_header() · 5a46e0f9
      Dan Carpenter 提交于
      We use len to store the return value from eth_header().  eth_header()
      can return -ETH_HLEN (-14).  We want to pass this back instead of
      truncating it to 65522 and returning that.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a46e0f9
    • N
      hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value · a1c1baf0
      Nikolaus Schulz 提交于
      Treat pwmX as a measured value, not as a (mostly static) limit value, so
      that it is updated more frequently from the device register.
      Signed-off-by: NNikolaus Schulz <mail@microschulz.de>
      Signed-off-by: NGuenter Roeck <guenter.roeck@ericsson.com>
      a1c1baf0
    • D
      net: Make qdisc_skb_cb upper size bound explicit. · 16bda13d
      David S. Miller 提交于
      Just like skb->cb[], so that qdisc_skb_cb can be encapsulated inside
      of other data structures.
      
      This is intended to be used by IPoIB so that it can remember
      addressing information stored at hard_header_ops->create() time that
      it can fetch when the packet gets to the transmit routine.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16bda13d
    • P
      tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds · 19723452
      Paul Walmsley 提交于
      The receive FIFO wakeup latency estimate in the omap-serial driver is
      three orders of magnitude too small.  This effectively prevents the
      MPU from going to a low-power state when CONFIG_CPU_IDLE=y.  This is a
      major power management regression and masks some other FIFO-related
      bugs in the driver.
      
      Fix by correcting the most egregious problem in the RX wakeup latency
      estimate.  There are several other flaws in the estimator; these will
      be fixed by a separate patch series intended for 3.4.
      
      The difference in low-power states with this patch can be observed via
      debugfs in pm_debug/count.
      
      This estimate does not have any effect when CONFIG_CPU_IDLE=n.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Acked-by: NGovindraj.R <govindraj.raja@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19723452
    • P
      tty: serial: OMAP: block idle while the UART is transferring data in PIO mode · be4b0281
      Paul Walmsley 提交于
      Prevent OMAP UARTs from going idle while they are still transferring
      data in PIO mode.  This works around an oversight in the OMAP UART
      hardware present in OMAP34xx and earlier: an idle UART won't send a
      wakeup when the TX FIFO threshold is reached.  This causes long delays
      during data transmission when the MPU powerdomain enters a low-power
      mode.  The MPU interrupt controller is not able to respond to
      interrupts when it's in a low-power state, so the TX buffer is not
      refilled until another wakeup event occurs.
      
      This fix changes the erratum i291 DMA idle workaround.  Rather than
      toggling between force-idle and no-idle, it will toggle between
      smart-idle and no-idle.  The important part of the workaround is the
      no-idle part, so this shouldn't result in any change in behavior.
      
      This fix should work on all OMAP UARTs.  Future patches intended for
      the 3.4 merge window will make this workaround conditional on a
      "feature" flag, and will use the OMAP36xx+ TX event wakeup support.
      
      Thanks to Kevin Hilman <khilman@ti.com> for mentioning the erratum i291
      workaround, which led to the development of this approach.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: NGovindraj.R <govindraj.raja@ti.com>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be4b0281
    • P
      tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode · 0ba5f668
      Paul Walmsley 提交于
      In the (default) PIO mode, use a one-byte RX FIFO threshold.  The OMAP
      UART IP blocks do not appear to be capable of waking the system under
      an RX timeout condition.  Since the previous RX FIFO threshold was 16
      bytes, this meant that omap-serial.c did not become aware of any
      received data until all those bytes arrived or until another UART
      interrupt occurred.  This made the serial console and presumably other
      serial applications (GPS, serial Bluetooth) unusable or extremely
      slow.  A 1-byte RX FIFO threshold also allows the MPU to enter a
      low-power consumption state while waiting for the FIFO to fill.
      
      This can be verified using the serial console by comparing the
      behavior when "0123456789abcde" is pasted in from another window, with
      the behavior when "0123456789abcdef" is pasted in.  Since the former
      string is less than sixteen bytes long, the string is not echoed for
      some time, while the latter string is echoed immediately.
      
      DMA operation is unaffected by this patch.
      
      Thanks to Russell King - ARM Linux <linux@arm.linux.org.uk> for some
      additional information on the standard behavior of the RX timeout
      event, which was used to improve this commit description.
      Signed-off-by: NPaul Walmsley <paul@pwsan.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Govindraj Raja <govindraj.r@ti.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Tested-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0ba5f668
    • D
      Reduce the number of expensive division instructions done by _parse_integer() · 690d137f
      David Howells 提交于
      _parse_integer() does one or two division instructions (which are slow)
      per digit parsed to perform the overflow check.
      
      Furthermore, these are particularly expensive examples of division
      instruction as the number of clock cycles required to complete them may
      go up with the position of the most significant set bit in the dividend:
      
      	if (*res > div_u64(ULLONG_MAX - val, base))
      
      which is as maximal as possible.
      
      Worse, on 32-bit arches, more than one of these division instructions
      may be required per digit.
      
      So, assuming we don't support a base of more than 16, skip the check if the
      top nibble of the result is not set at this point.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      [ Changed it to not dereference the pointer all the time - even if the
        compiler can and does optimize it away, the code just looks cleaner.
        And edited the top nybble test slightly to make the code generated on
        x86-64 better in the loop - test against a hoisted constant instead of
        shifting and testing the result ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      690d137f
    • S
      ARM: 7322/1: Print BUG instead of undefined instruction on BUG_ON() · bdf800c4
      Stephen Boyd 提交于
      The ARM kernel uses undefined instructions to implement
      BUG/BUG_ON(). This leads to problems where people don't read one
      line above the Oops message and see the "kernel BUG at ..."
      message and so they wrongly assume the kernel has hit an
      undefined instruction.
      
      Instead of printing:
      
       Internal error: Oops - undefined instruction: 0 [#1] PREEMPT SMP
      
      print
      
       Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
      
      This should prevent people from thinking the BUG_ON was an
      undefined instruction when it was actually intentional.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: NSimon Glass <sjg@chromium.org>
      Tested-by: NSimon Glass <sjg@chromium.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      bdf800c4
    • S
      ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR · b46c0f74
      Stephen Boyd 提交于
      armv7's flush_cache_all() flushes caches via set/way. To
      determine the cache attributes (line size, number of sets,
      etc.) the assembly first writes the CSSELR register to select a
      cache level and then reads the CCSIDR register. The CSSELR register
      is banked per-cpu and is used to determine which cache level CCSIDR
      reads. If the task is migrated between when the CSSELR is written and
      the CCSIDR is read the CCSIDR value may be for an unexpected cache
      level (for example L1 instead of L2) and incorrect cache flushing
      could occur.
      
      Disable interrupts across the write and read so that the correct
      cache attributes are read and used for the cache flushing
      routine. We disable interrupts instead of disabling preemption
      because the critical section is only 3 instructions and we want
      to call v7_dcache_flush_all from __v7_setup which doesn't have a
      full kernel stack with a struct thread_info.
      
      This fixes a problem we see in scm_call() when flush_cache_all()
      is called from preemptible context and sometimes the L2 cache is
      not properly flushed out.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: NCatalin Marinas <catalin.marinas@arm.com>
      Reviewed-by: NNicolas Pitre <nico@linaro.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b46c0f74
    • M
      ARM: 7320/1: Fix proc_info table alignment · b8b9987f
      Marc Zyngier 提交于
      With an admittedly exotic choice of configuration options
      (CC_OPTIMIZE_FOR_SIZE, THUMB2, some other size-minimizing ones)
      and compiler, the proc_info table can end up being misaligned,
      and the kernel being unbootable (Error: unrecognized/unsupported
      processor variant).
      
      Forcing the alignement to 4 bytes in the linker script fixes the
      issue.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      b8b9987f
  5. 09 2月, 2012 7 次提交
    • J
      ixgbe: ethtool: stats user buffer overrun · 9cc00b51
      John Fastabend 提交于
      If the number of tx/rx queues changes the ethtool ioctl
      ETHTOOL_GSTATS may overrun the userspace buffer. This
      occurs because the general practice in user space to
      query stats is to issue a ETHTOOL_GSSET cmd to learn the
      buffer size needed, allocate the buffer, then call
      ETHTOOL_GSTIRNGS and ETHTOOL_GSTATS. If the number of
      real_num_queues is changed or flow control attributes
      are changed after ETHTOOL_GSSET but before the
      ETHTOOL_GSTRINGS/ETHTOOL_GSTATS a user space buffer
      overrun occurs.
      
      To fix the overrun always return the max buffer size
      needed from get_sset_count() then return all strings
      and stats from get_strings()/get_ethtool_stats().
      
      This _will_ change the output from the ioctl() call
      which could break applications and script parsing in
      theory. I believe these changes should not break existing
      tools because the only changes will be more {tx|rx}_queues
      and the {tx|rx}_pb_* stats will always be returned.
      Existing scripts already need to handle changing number
      of queues because this occurs today depending on system
      and current features. The {tx|rx}_pb_* stats are at the
      end of the output and should be handled by scripts today
      regardless.
      
      Finally get_ethtool_stats and get_strings are free-form
      outputs tools parsing these outputs should be defensive
      anyways. In the end these updates are better then
      having a tool segfault because of a buffer overrun.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9cc00b51
    • J
      ixgbe: dcb: up2tc mapping lost on disable/enable CEE DCB state · 5facb8e0
      John Fastabend 提交于
      Users expect the up2tc mapping to be maintained across a DCB
      enable/disable/enable transition. And since we maintain all
      the other DCB attributes we should do this for up2tc mappings
      as well just to be consistent. Also without this we break
      user space applications that expect this to occur that
      previously worked.
      Signed-off-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Tested-by: NStephen Ko <stephen.s.ko@intel.com>
      Tested-by: NRoss Brattain <ross.b.brattain@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      5facb8e0
    • Y
      ixgbe: do not update real num queues when netdev is going away · 9d837ea2
      Yi Zou 提交于
      If the netdev is already in NETREG_UNREGISTERING/_UNREGISTERED state, do not
      update the real num tx queues. netdev_queue_update_kobjects() is already
      called via remove_queue_kobjects() at NETREG_UNREGISTERING time. So, when
      upper layer driver, e.g., FCoE protocol stack is monitoring the netdev
      event of NETDEV_UNREGISTER and calls back to LLD ndo_fcoe_disable() to remove
      extra queues allocated for FCoE, the associated txq sysfs kobjects are already
      removed, and trying to update the real num queues would cause something like
      below:
      
      ...
      PID: 25138  TASK: ffff88021e64c440  CPU: 3   COMMAND: "kworker/3:3"
       #0 [ffff88021f007760] machine_kexec at ffffffff810226d9
       #1 [ffff88021f0077d0] crash_kexec at ffffffff81089d2d
       #2 [ffff88021f0078a0] oops_end at ffffffff813bca78
       #3 [ffff88021f0078d0] no_context at ffffffff81029e72
       #4 [ffff88021f007920] __bad_area_nosemaphore at ffffffff8102a155
       #5 [ffff88021f0079f0] bad_area_nosemaphore at ffffffff8102a23e
       #6 [ffff88021f007a00] do_page_fault at ffffffff813bf32e
       #7 [ffff88021f007b10] page_fault at ffffffff813bc045
          [exception RIP: sysfs_find_dirent+17]
          RIP: ffffffff81178611  RSP: ffff88021f007bc0  RFLAGS: 00010246
          RAX: ffff88021e64c440  RBX: ffffffff8156cc63  RCX: 0000000000000004
          RDX: ffffffff8156cc63  RSI: 0000000000000000  RDI: 0000000000000000
          RBP: ffff88021f007be0   R8: 0000000000000004   R9: 0000000000000008
          R10: ffffffff816fed00  R11: 0000000000000004  R12: 0000000000000000
          R13: ffffffff8156cc63  R14: 0000000000000000  R15: ffff8802222a0000
          ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
       #8 [ffff88021f007be8] sysfs_get_dirent at ffffffff81178c07
       #9 [ffff88021f007c18] sysfs_remove_group at ffffffff8117ac27
      #10 [ffff88021f007c48] netdev_queue_update_kobjects at ffffffff813178f9
      #11 [ffff88021f007c88] netif_set_real_num_tx_queues at ffffffff81303e38
      #12 [ffff88021f007cc8] ixgbe_set_num_queues at ffffffffa0249763 [ixgbe]
      #13 [ffff88021f007cf8] ixgbe_init_interrupt_scheme at ffffffffa024ea89 [ixgbe]
      #14 [ffff88021f007d48] ixgbe_fcoe_disable at ffffffffa0267113 [ixgbe]
      #15 [ffff88021f007d68] vlan_dev_fcoe_disable at ffffffffa014fef5 [8021q]
      #16 [ffff88021f007d78] fcoe_interface_cleanup at ffffffffa02b7dfd [fcoe]
      #17 [ffff88021f007df8] fcoe_destroy_work at ffffffffa02b7f08 [fcoe]
      #18 [ffff88021f007e18] process_one_work at ffffffff8105d7ca
      #19 [ffff88021f007e68] worker_thread at ffffffff81060513
      #20 [ffff88021f007ee8] kthread at ffffffff810648b6
      #21 [ffff88021f007f48] kernel_thread_helper at ffffffff813c40f4
      Signed-off-by: NYi Zou <yi.zou@intel.com>
      Tested-by: NRoss Brattain <ross.b.brattain@intel.com>
      Tested-by: NStephen Ko <stephen.s.ko@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9d837ea2
    • A
      ixgbe: Fix broken dependency on MAX_SKB_FRAGS being related to page size · 642c680e
      Alexander Duyck 提交于
      This patch fixes an issue in which RSC will generate corrupted frames when
      PAGE_SIZE is larger than 8K.  Specifically it looks like that in 2.6.39 a
      change was made so that GRO would always have at least 16 frags available
      for coalescing, but the ixgbe RSC logic was not updated.  As such the RSC
      feature would generate a frame larger than 64K and then overflow the value
      in the IP length field.
      
      To correct that I am now basing things on the PAGE_SIZE.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@intel.com>
      Tested-by: NStephen Ko <stephen.s.ko@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      642c680e
    • G
      ixgbe: Fix case of Tx Hang in PF with 32 VFs · 4cd6923d
      Greg Rose 提交于
      A check for the number of VFs allocated should have used a greater than
      equal operator instead of just greater than.  This caused allocation of
      exactly 32 VFs to not enable the PF transmit and receive enables.
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Tested-by: NRobert E Garrett <robertX.e.garrett@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      4cd6923d
    • G
      ixgbe: fix vf lookup · a4b08329
      Greg Rose 提交于
      Recent addition of code to find already allocated VFs failed to take
      account that systems with 2 or more multi-port SR-IOV capable controllers
      might have already enabled VFs.  Make sure that the VFs the function is
      finding are actually subordinate to the particular instance of the adapter
      that is looking for them and not subordinate to some device that has
      previously enabled SR-IOV.
      
      This bug exists in 3.2 stable as well as 3.3 release candidates.
      
      CC: stable@vger.kernel.org
      Reported-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Tested-by: NRobert E Garrett <robertX.e.garrett@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      a4b08329
    • G
      igb: fix vf lookup · 06292921
      Greg Rose 提交于
      Recent addition of code to find already allocated VFs failed to take
      account that systems with 2 or more multi-port SR-IOV capable controllers
      might have already enabled VFs.  Make sure that the VFs the function is
      finding are actually subordinate to the particular instance of the adapter
      that is looking for them and not subordinate to some device that has
      previously enabled SR-IOV.
      
      This is applicable to 3.2+ kernels.
      
      CC: stable@vger.kernel.org
      Reported-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NGreg Rose <gregory.v.rose@intel.com>
      Tested-by: NRobert E Garrett <robertX.e.garrett@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      06292921