1. 16 Feb, 2012 5 commits
    • majianpeng's avatar
      64f8c135
    • Benjamin Herrenschmidt's avatar
      powerpc: Disable interrupts early in Program Check · 54321242
      Benjamin Herrenschmidt authored
      Program Check exceptions are the result of WARNs, BUGs, some
      type of breakpoints, kprobe, and other illegal instructions.
      
      We want interrupts (and thus preemption) to remain disabled
      while doing the initial stage of testing the reason and
      branching off to a debugger or kprobe, so we are still on
      the original CPU which makes debugging easier in various cases.
      
      This is how the code was intended, hence the local_irq_enable()
      right in the middle of program_check_exception().
      
      However, the assembly exception prologue for that exception was
      incorrectly marked as enabling interrupts, which defeats that
      (and records a redundant enable with lockdep).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      54321242
    • Stephen Rothwell's avatar
      powerpc: Remove legacy iSeries from ppc64_defconfig · a1a1d1bf
      Stephen Rothwell authored
      Since we are heading towards removing the Legacy iSeries platform, start
      by no longer building it for ppc64_defconfig.
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a1a1d1bf
    • Benjamin Herrenschmidt's avatar
      powerpc/fsl/pci: Fix PCIe fixup regression · 13635dfd
      Benjamin Herrenschmidt authored
      Upstream changes to the way PHB resources are registered
      broke the resource fixup for FSL boards.
      
      We can no longer rely on the resource pointer array for the PHB's
      pci_bus structure, so let's leave it alone and go straight for
      the PHB resources instead. This also makes the code generally
      more readable.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      13635dfd
    • Ira Snyder's avatar
      powerpc: Fix kernel log of oops/panic instruction dump · 40c8cefa
      Ira Snyder authored
      A kernel oops/panic prints an instruction dump showing several
      instructions before and after the instruction which caused the
      oops/panic.
      
      The code intended that the faulting instruction be enclosed in angle
      brackets, however a bug caused the faulting instruction to be
      interpreted by printk() as the message log level.
      
      To fix this, the KERN_CONT log level is added before the actual text of
      the printed message.
      
      === Before the patch ===
      
      [ 1081.587266] Instruction dump:
      [ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
      [ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000
      [ 1081.602500]  4e800020 3803ffd0 2b800009
      
      <4>[ 1081.587266] Instruction dump:
      <4>[ 1081.590236] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
      <4>[ 1081.598034] 3d20c03a 9009a114 7c0004ac 39200000
      <98090000>[ 1081.602500]  4e800020 3803ffd0 2b800009
      
      === After the patch ===
      
      [   51.385216] Instruction dump:
      [   51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
      [   51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <98090000> 4e800020 3803ffd0 2b800009
      
      <4>[   51.385216] Instruction dump:
      <4>[   51.388186] 7c000110 7c0000f8 5400077c 552907f6 7d290378 992b0003 4e800020 38000001
      <4>[   51.395986] 3d20c03a 9009a114 7c0004ac 39200000 <98090000> 4e800020 3803ffd0 2b800009
      Signed-off-by: default avatarIra W. Snyder <iws@ovro.caltech.edu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      40c8cefa
  2. 14 Feb, 2012 7 commits
    • Thadeu Lima de Souza Cascardo's avatar
      powerpc/pseries/eeh: Fix crash when error happens during device probe · 778a785f
      Thadeu Lima de Souza Cascardo authored
      EEH may happen during a PCI driver probe. If the driver is trying to
      access some register in a loop, the EEH code will try to print the
      driver name. But the driver pointer in struct pci_dev is not set until
      probe returns successfully.
      
      Use a function to test if the device and the driver pointer is NULL
      before accessing the driver's name.
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      778a785f
    • Brian King's avatar
      powerpc/pseries: Fix partition migration hang in stop_topology_update · 444080d1
      Brian King authored
      This fixes a hang that was observed during live partition migration.
      Since stop_topology_update must not be called from an interrupt
      context, call it earlier in the migration process. The hang observed
      can be seen below:
      
      WARNING: at kernel/timer.c:1011
      Modules linked in: ip6t_LOG xt_tcpudp xt_pkttype ipt_LOG xt_limit ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_raw xt_NOTRACK ipt_REJECT xt_state iptable_raw iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 ip_tables ip6table_filter ip6_tables x_tables ipv6 fuse loop ibmveth sg ext3 jbd mbcache raid456 async_raid6_recov async_pq raid6_pq async_xor xor async_memcpy async_tx raid10 raid1 raid0 scsi_dh_alua scsi_dh_rdac scsi_dh_hp_sw scsi_dh_emc dm_round_robin dm_multipath scsi_dh sd_mod crc_t10dif ibmvfc scsi_transport_fc scsi_tgt scsi_mod dm_snapshot dm_mod
      NIP: c0000000000c52d8 LR: c00000000004be28 CTR: 0000000000000000
      REGS: c00000005ffd77d0 TRAP: 0700   Not tainted  (3.2.0-git-00001-g07d106d0)
      MSR: 8000000000021032 <ME,CE,IR,DR>  CR: 48000084  XER: 00000001
      CFAR: c00000000004be20
      TASK = c00000005ec78860[0] 'swapper/3' THREAD: c00000005ec98000 CPU: 3
      GPR00: 0000000000000001 c00000005ffd7a50 c000000000fbbc98 c000000000ec8340
      GPR04: 00000000282a0020 0000000000000000 0000000000004000 0000000000000101
      GPR08: 0000000000000012 c00000005ffd4000 0000000000000020 c000000000f3ba88
      GPR12: 0000000000000000 c000000007f40900 0000000000000001 0000000000000004
      GPR16: 0000000000000001 0000000000000000 0000000000000000 c000000001022310
      GPR20: 0000000000000001 0000000000000000 0000000000200200 c000000001029e14
      GPR24: 0000000000000000 0000000000000001 0000000000000040 c00000003f74bc80
      GPR28: c00000003f74bc84 c000000000f38038 c000000000f16b58 c000000000ec8340
      NIP [c0000000000c52d8] .del_timer_sync+0x28/0x60
      LR [c00000000004be28] .stop_topology_update+0x20/0x38
      Call Trace:
      [c00000005ffd7a50] [c00000005ec78860] 0xc00000005ec78860 (unreliable)
      [c00000005ffd7ad0] [c00000000004be28] .stop_topology_update+0x20/0x38
      [c00000005ffd7b40] [c000000000028378] .__rtas_suspend_last_cpu+0x58/0x260
      [c00000005ffd7bf0] [c0000000000fa230] .generic_smp_call_function_interrupt+0x160/0x358
      [c00000005ffd7cf0] [c000000000036ec8] .smp_ipi_demux+0x88/0x100
      [c00000005ffd7d80] [c00000000005c154] .icp_hv_ipi_action+0x5c/0x80
      [c00000005ffd7e00] [c00000000012a088] .handle_irq_event_percpu+0x100/0x318
      [c00000005ffd7f00] [c00000000012e774] .handle_percpu_irq+0x84/0xd0
      [c00000005ffd7f90] [c000000000022ba8] .call_handle_irq+0x1c/0x2c
      [c00000005ec9ba20] [c00000000001157c] .do_IRQ+0x22c/0x2a8
      [c00000005ec9bae0] [c0000000000054bc] hardware_interrupt_entry+0x18/0x1c
      Exception: 501 at .cpu_idle+0x194/0x2f8
          LR = .cpu_idle+0x194/0x2f8
      [c00000005ec9bdd0] [c000000000017e58] .cpu_idle+0x188/0x2f8 (unreliable)
      [c00000005ec9be90] [c00000000067ec18] .start_secondary+0x3e4/0x524
      [c00000005ec9bf90] [c0000000000093e8] .start_secondary_prolog+0x10/0x14
      Instruction dump:
      ebe1fff8 4e800020 fbe1fff8 7c0802a6 f8010010 7c7f1b78 f821ff81 78290464
      80090014 5400019e 7c0000d0 78000fe0 <0b000000> 4800000c 7c210b78 7c421378
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      444080d1
    • Michael Ellerman's avatar
      powerpc/powernv: Disable interrupts while taking phb->lock · f1c853b5
      Michael Ellerman authored
      We need to disable interrupts when taking the phb->lock. Otherwise
      we could deadlock with pci_lock taken from an interrupt.
      Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      f1c853b5
    • Benjamin Herrenschmidt's avatar
      powerpc: Fix WARN_ON in decrementer_check_overflow · 6fe5f5f3
      Benjamin Herrenschmidt authored
      We use __get_cpu_var() which triggers a false positive warning
      in smp_processor_id() thinking interrupts are enabled (at this
      point, they are soft-enabled but hard-disabled).
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      6fe5f5f3
    • Benjamin Herrenschmidt's avatar
      powerpc/wsp: Fix IRQ affinity setting · 7a768d30
      Benjamin Herrenschmidt authored
      We call the cache_hwirq_map() function with a linux IRQ number
      but it expects a HW irq number. This triggers a BUG on multic-chip
      setups in addition to not doing the right thing.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7a768d30
    • Srikar Dronamraju's avatar
      powerpc: Implement GET_IP/SET_IP · e6289427
      Srikar Dronamraju authored
      With this change, helpers such as instruction_pointer() et al, get defined
      in the generic header in terms of GET_IP
      
      Removed the unnecessary definition of profile_pc in !CONFIG_SMP case as
      suggested by Mike Frysinger.
      Signed-off-by: default avatarSrikar Dronamraju <srikar@linux.vnet.ibm.com>
      Signed-off-by: default avatarAnanth N Mavinakayanahalli <ananth@in.ibm.com>
      Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e6289427
    • Benjamin Herrenschmidt's avatar
      powerpc/wsp: Permanently enable PCI class code workaround · 454c0bfd
      Benjamin Herrenschmidt authored
      It appears that on the Chroma card, the class code of the root
      complex is still wrong even on DD2 or later chips. This could
      be a firmware issue, but that breaks resource allocation so let's
      unconditionally fix it up.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      454c0bfd
  3. 11 Feb, 2012 2 commits
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.dk/linux-block · 3ec1e88b
      Linus Torvalds authored
      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
    • Tejun Heo's avatar
      block: fix lockdep warning on io_context release put_io_context() · d8c66c5d
      Tejun Heo authored
      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: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      d8c66c5d
  4. 10 Feb, 2012 12 commits
  5. 09 Feb, 2012 14 commits
    • Linus Torvalds's avatar
      Merge tag 'tty-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 19e00f2f
      Linus Torvalds authored
      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: default avatarGreg 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
    • Linus Torvalds's avatar
      Merge tag 'staging-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · b05ee6bf
      Linus Torvalds authored
      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: default avatarGreg 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
    • Linus Torvalds's avatar
      Merge tag 'driver-core-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · b0286db4
      Linus Torvalds authored
      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: default avatarGreg 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
    • Linus Torvalds's avatar
      Merge tag 'char-misc-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · ae5cdd40
      Linus Torvalds authored
      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: default avatarGreg 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
    • Linus Torvalds's avatar
      Merge tag 'usb-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · fe250923
      Linus Torvalds authored
      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: default avatarGreg 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
    • Dan Carpenter's avatar
      bna: fix error handling of bnad_get_flash_partition_by_offset() · 027a3b61
      Dan Carpenter authored
      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: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      027a3b61
    • Dan Carpenter's avatar
      isdn: type bug in isdn_net_header() · 5a46e0f9
      Dan Carpenter authored
      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: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5a46e0f9
    • Nikolaus Schulz's avatar
      hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value · a1c1baf0
      Nikolaus Schulz authored
      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: default avatarNikolaus Schulz <mail@microschulz.de>
      Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
      a1c1baf0
    • David S. Miller's avatar
      net: Make qdisc_skb_cb upper size bound explicit. · 16bda13d
      David S. Miller authored
      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: default avatarDavid S. Miller <davem@davemloft.net>
      16bda13d
    • Paul Walmsley's avatar
      tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds · 19723452
      Paul Walmsley authored
      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: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Acked-by: default avatarGovindraj.R <govindraj.raja@ti.com>
      Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
      Tested-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19723452
    • Paul Walmsley's avatar
      tty: serial: OMAP: block idle while the UART is transferring data in PIO mode · be4b0281
      Paul Walmsley authored
      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: default avatarPaul Walmsley <paul@pwsan.com>
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Acked-by: default avatarGovindraj.R <govindraj.raja@ti.com>
      Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
      Tested-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be4b0281
    • Paul Walmsley's avatar
      tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode · 0ba5f668
      Paul Walmsley authored
      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: default avatarPaul 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: default avatarKevin Hilman <khilman@ti.com>
      Tested-by: default avatarKevin Hilman <khilman@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0ba5f668
    • David Howells's avatar
      Reduce the number of expensive division instructions done by _parse_integer() · 690d137f
      David Howells authored
      _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: default avatarDavid 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: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      690d137f
    • John Fastabend's avatar
      ixgbe: ethtool: stats user buffer overrun · 9cc00b51
      John Fastabend authored
      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: default avatarJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9cc00b51