1. 02 6月, 2016 1 次提交
    • G
      xhci: Cleanup only when releasing primary hcd · 27a41a83
      Gabriel Krisman Bertazi 提交于
      Under stress occasions some TI devices might not return early when
      reading the status register during the quirk invocation of xhci_irq made
      by usb_hcd_pci_remove.  This means that instead of returning, we end up
      handling this interruption in the middle of a shutdown.  Since
      xhci->event_ring has already been freed in xhci_mem_cleanup, we end up
      accessing freed memory, causing the Oops below.
      
      commit 8c24d6d7 ("usb: xhci: stop everything on the first call to
      xhci_stop") is the one that changed the instant in which we clean up the
      event queue when stopping a device.  Before, we didn't call
      xhci_mem_cleanup at the first time xhci_stop is executed (for the shared
      HCD), instead, we only did it after the invocation for the primary HCD,
      much later at the removal path.  The code flow for this oops looks like
      this:
      
      xhci_pci_remove()
      	usb_remove_hcd(xhci->shared)
      	        xhci_stop(xhci->shared)
       			xhci_halt()
      			xhci_mem_cleanup(xhci);  // Free the event_queue
      	usb_hcd_pci_remove(primary)
      		xhci_irq()  // Access the event_queue if STS_EINT is set. Crash.
      		xhci_stop()
      			xhci_halt()
      			// return early
      
      The fix modifies xhci_stop to only cleanup the xhci data when releasing
      the primary HCD.  This way, we still have the event_queue configured
      when invoking xhci_irq.  We still halt the device on the first call to
      xhci_stop, though.
      
      I could reproduce this issue several times on the mainline kernel by
      doing a bind-unbind stress test with a specific storage gadget attached.
      I also ran the same test over-night with my patch applied and didn't
      observe the issue anymore.
      
      [  113.334124] Unable to handle kernel paging request for data at address 0x00000028
      [  113.335514] Faulting instruction address: 0xd00000000d4f767c
      [  113.336839] Oops: Kernel access of bad area, sig: 11 [#1]
      [  113.338214] SMP NR_CPUS=1024 NUMA PowerNV
      
      [c000000efe47ba90] c000000000720850 usb_hcd_irq+0x50/0x80
      [c000000efe47bac0] c00000000073d328 usb_hcd_pci_remove+0x68/0x1f0
      [c000000efe47bb00] d00000000daf0128 xhci_pci_remove+0x78/0xb0
      [xhci_pci]
      [c000000efe47bb30] c00000000055cf70 pci_device_remove+0x70/0x110
      [c000000efe47bb70] c00000000061c6bc __device_release_driver+0xbc/0x190
      [c000000efe47bba0] c00000000061c7d0 device_release_driver+0x40/0x70
      [c000000efe47bbd0] c000000000619510 unbind_store+0x120/0x150
      [c000000efe47bc20] c0000000006183c4 drv_attr_store+0x64/0xa0
      [c000000efe47bc60] c00000000039f1d0 sysfs_kf_write+0x80/0xb0
      [c000000efe47bca0] c00000000039e14c kernfs_fop_write+0x18c/0x1f0
      [c000000efe47bcf0] c0000000002e962c __vfs_write+0x6c/0x190
      [c000000efe47bd90] c0000000002eab40 vfs_write+0xc0/0x200
      [c000000efe47bde0] c0000000002ec85c SyS_write+0x6c/0x110
      [c000000efe47be30] c000000000009260 system_call+0x38/0x108
      Signed-off-by: NGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
      Cc: Roger Quadros <rogerq@ti.com>
      Cc: joel@jms.id.au
      Cc: stable@vger.kernel.org
      Reviewed-by: NRoger Quadros <rogerq@ti.com>
      Cc: <stable@vger.kernel.org> #v4.3+
      Tested-by: NJoel Stanley <joel@jms.id.au>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      27a41a83
  2. 01 6月, 2016 1 次提交
  3. 31 5月, 2016 16 次提交
  4. 29 5月, 2016 1 次提交
    • G
      Eliminate bad hash multipliers from hash_32() and hash_64() · ef703f49
      George Spelvin 提交于
      The "simplified" prime multipliers made very bad hash functions, so get rid
      of them.  This completes the work of 689de1d6.
      
      To avoid the inefficiency which was the motivation for the "simplified"
      multipliers, hash_64() on 32-bit systems is changed to use a different
      algorithm.  It makes two calls to hash_32() instead.
      
      drivers/media/usb/dvb-usb-v2/af9015.c uses the old GOLDEN_RATIO_PRIME_32
      for some horrible reason, so it inherits a copy of the old definition.
      Signed-off-by: NGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Antti Palosaari <crope@iki.fi>
      Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
      ef703f49
  5. 28 5月, 2016 17 次提交
  6. 27 5月, 2016 4 次提交
    • W
      i2c: dev: don't start function name with 'return' · 72a71f86
      Wolfram Sang 提交于
      I stumbled multiple times over 'return_i2c_dev', especially before the
      actual 'return res'. It makes the code hard to read, so reanme the
      function to 'put_i2c_dev' which also better matches 'get_free_i2c_dev'.
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      72a71f86
    • A
      drivers/pinctrl/intel/pinctrl-baytrail.c: fix build with gcc-4.4 · bbccb9c7
      Andrew Morton 提交于
      gcc-4.4 and thereabouts has issues with initializers of anonymous
      unions, and it generates the following warnings:
      
        drivers/pinctrl/intel/pinctrl-baytrail.c:413: error: unknown field 'simple_funcs' specified in initializer
        drivers/pinctrl/intel/pinctrl-baytrail.c:413: warning: missing braces around initializer
        drivers/pinctrl/intel/pinctrl-baytrail.c:413: warning: (near initialization for 'byt_score_groups[0].<anonymous>')
        drivers/pinctrl/intel/pinctrl-baytrail.c:415: error: unknown field 'simple_funcs' specified in initializer
        drivers/pinctrl/intel/pinctrl-baytrail.c:417: error: unknown field 'simple_funcs' specified in initializer
        ...
      
      Work around this.
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bbccb9c7
    • E
      i2c: dev: switch from register_chrdev to cdev API · d6760b14
      Erico Nunes 提交于
      i2c-dev had never moved away from the older register_chrdev interface to
      implement its char device registration. The register_chrdev API has the
      limitation of enabling only up to 256 i2c-dev busses to exist.
      
      Large platforms with lots of i2c devices (i.e. pluggable transceivers)
      with dedicated busses may have to exceed that limit.
      In particular, there are also platforms making use of the i2c bus
      multiplexing API, which instantiates a virtual bus for each possible
      multiplexed selection.
      
      This patch removes the register_chrdev usage and replaces it with the
      less old cdev API, which takes away the 256 i2c-dev bus limitation.
      It should not have any other impact for i2c bus drivers or user space.
      
      This patch has been tested on qemu x86 and qemu powerpc platforms with
      the aid of a module which adds and removes 5000 virtual i2c busses, as
      well as validated on an existing powerpc hardware platform which makes
      use of the i2c bus multiplexing API.
      i2c-dev busses with device minor numbers larger than 256 have also been
      validated to work with the existing i2c-tools.
      Signed-off-by: NErico Nunes <erico.nunes@datacom.ind.br>
      [wsa: kept includes sorted]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      d6760b14
    • M
      i2c: xlr: rename ARCH_TANGOX to ARCH_TANGO · e3879e4f
      Marc Gonzalez 提交于
      The ARCH name was changed during the review process of the mach, and
      this driver was forgotten to be converted. Fix it now.
      http://article.gmane.org/gmane.linux.ports.arm.kernel/456331Signed-off-by: NMarc Gonzalez <marc_gonzalez@sigmadesigns.com>
      [wsa: updated commit message slightly]
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      e3879e4f