1. 16 4月, 2012 3 次提交
  2. 14 4月, 2012 2 次提交
    • K
      cpufreq: OMAP: fix build errors: depends on ARCH_OMAP2PLUS · 2d59dcfb
      Kevin Hilman 提交于
      The OMAP driver needs a 'depends on ARCH_OMAP2PLUS' since it only
      builds for OMAP2+ platforms.
      
      This 'depends on' was in the original patch from Russell King, but was
      erroneously removed by me when making this option user-selectable in
      commit b09db45c (cpufreq: OMAP driver depends CPUfreq tables.)  This
      patch remedies that.
      
      Apologies to Russell King for breaking his originally working patch.
      
      Also, thanks to Grazvydas Ignotas for reporting the same problem.
      
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Grazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2d59dcfb
    • D
      video: msm: Fix section mismatches in mddi.c · e89c0e43
      David Brown 提交于
      The change
          commit 461cbe77
          Author: Gregory Bean <gbean@codeaurora.org>
          Date:   Wed Jul 28 10:22:13 2010 -0700
      
              video: msm: Fix section mismatch in mddi.c.
      
      fixes a section mismatch between the board file and the driver's probe
      function, however, it misses the additional mismatches between the
      probe function and some routines it calls.  Fix these up as well.
      Signed-off-by: NDavid Brown <davidb@codeaurora.org>
      e89c0e43
  3. 13 4月, 2012 11 次提交
    • M
      ARM: 7366/3: amba: Remove AMBA level regulator support · 1e45860f
      Mark Brown 提交于
      The AMBA bus regulator support is being used to model on/off switches
      for power domains which isn't terribly idiomatic for modern kernels with
      the generic power domain code and creates integration problems on platforms
      which don't use regulators for their power domains as it's hard to tell
      the difference between a regulator that is needed but failed to be provided
      and one that isn't supposed to be there (though DT does make that easier).
      
      Platforms that wish to use the regulator API to manage their power domains
      can indirect via the power domain interface.
      
      This feature is only used with the vape supply of the db8500 PRCMU
      driver which supplies the UARTs and MMC controllers, none of which have
      support for managing vcore at runtime in mainline (only pl022 SPI
      controller does).  Update that supply to have an always_on constraint
      until the power domain support for the system is updated so that it is
      enabled for these users, this is likely to have no impact on practical
      systems as probably at least one of these devices will be active and
      cause AMBA to hold the supply on anyway.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      1e45860f
    • J
      staging: android: fix mem leaks in __persistent_ram_init() · 474a8988
      Jesper Juhl 提交于
      If, in __persistent_ram_init(), the call to
      persistent_ram_buffer_init() fails or the call to
      persistent_ram_init_ecc() fails then we fail to free the memory we
      allocated to 'prz' with kzalloc() - thus leaking it.
      
      To prevent the leaks I consolidated all error exits from the function
      at a 'err:' label at the end and made all error cases jump to that
      label where we can then make sure we always free 'prz'. This is safe
      since all the situations where the code bails out happen before 'prz'
      has been stored anywhere and although we'll do a redundant kfree(NULL)
      call in the case of kzalloc() itself failing that's OK since kfree()
      deals gracefully with NULL pointers and I felt it was more important
      to keep all error exits at a single location than to avoid that one
      harmless/redundant kfree() on a error path.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Acked-by: NColin Cross <ccross@android.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      474a8988
    • J
      staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl() · 17b7e1ba
      Jesper Juhl 提交于
      If copy_to_user() fails in the WLAN_CMD_GET_NODE_LIST case of the
      switch in drivers/staging/vt6656/ioctl.c::private_ioctl() we'll leak
      the memory allocated to 'pNodeList'. Fix that by kfree'ing the memory
      in the failure case.
      Also remove a pointless cast (to type 'PSNodeList') of a kmalloc()
      return value - kmalloc() returns a void pointer that is implicitly
      converted, so there is no need for an explicit cast.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17b7e1ba
    • M
      staging: iio: hmc5843: Fix crash in probe function. · 62d2feb9
      Marek Belisko 提交于
      Fix crash after issuing:
      	echo hmc5843 0x1e > /sys/class/i2c-dev/i2c-2/device/new_device
      
      	[   37.180999] device: '2-001e': device_add
      	[   37.188293] bus: 'i2c': add device 2-001e
      	[   37.194549] PM: Adding info for i2c:2-001e
      	[   37.200958] bus: 'i2c': driver_probe_device: matched device 2-001e with driver hmc5843
      	[   37.210815] bus: 'i2c': really_probe: probing driver hmc5843 with device 2-001e
      	[   37.224884] HMC5843 initialized
      	[   37.228759] ------------[ cut here ]------------
      	[   37.233612] kernel BUG at mm/slab.c:505!
      	[   37.237701] Internal error: Oops - BUG: 0 [#1] PREEMPT
      	[   37.243103] Modules linked in:
      	[   37.246337] CPU: 0    Not tainted  (3.3.1-gta04+ #28)
      	[   37.251647] PC is at kfree+0x84/0x144
      	[   37.255493] LR is at kfree+0x20/0x144
      	[   37.259338] pc : [<c00b408c>]    lr : [<c00b4028>]    psr: 40000093
      	[   37.259368] sp : de249cd8  ip : 0000000c  fp : 00000090
      	[   37.271362] r10: 0000000a  r9 : de229eac  r8 : c0236274
      	[   37.276855] r7 : c09d6490  r6 : a0000013  r5 : de229c00  r4 : de229c10
      	[   37.283691] r3 : c0f00218  r2 : 00000400  r1 : c0eea000  r0 : c00b4028
      	[   37.290527] Flags: nZcv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
      	[   37.298095] Control: 10c5387d  Table: 9e1d0019  DAC: 00000015
      	[   37.304107] Process sh (pid: 91, stack limit = 0xde2482f0)
      	[   37.309844] Stack: (0xde249cd8 to 0xde24a000)
      	[   37.314422] 9cc0:                                                       de229c10 de229c00
      	[   37.322998] 9ce0: de229c10 ffffffea 00000005 c0236274 de140a80 c00b4798 dec00080 de140a80
      	[   37.331573] 9d00: c032f37c dec00080 000080d0 00000001 de229c00 de229c10 c048d578 00000005
      	[   37.340148] 9d20: de229eac 0000000a 00000090 c032fa40 00000001 00000000 00000001 de229c10
      	[   37.348724] 9d40: de229eac 00000029 c075b558 00000001 00000003 00000004 de229c10 c048d594
      	[   37.357299] 9d60: 00000000 60000013 00000018 205b0007 37332020 3432322e 5d343838 c0060020
      	[   37.365905] 9d80: de251600 00000001 00000000 de251600 00000001 c0065a84 de229c00 de229c48
      	[   37.374481] 9da0: 00000006 0048d62c de229c38 de229c00 de229c00 de1f6c00 de1f6c20 00000001
      	[   37.383056] 9dc0: 00000000 c048d62c 00000000 de229c00 de229c00 de1f6c00 de1f6c20 00000001
      	[   37.391632] 9de0: 00000000 c048d62c 00000000 c0330164 00000000 de1f6c20 c048d62c de1f6c00
      	[   37.400207] 9e00: c0330078 de1f6c04 c078d714 de189b58 00000000 c02ccfd8 de1f6c20 c0795f40
      	[   37.408782] 9e20: c0238330 00000000 00000000 c02381a8 de1b9fc0 de1f6c20 de1f6c20 de249e48
      	[   37.417358] 9e40: c0238330 c0236bb0 decdbed8 de7d0f14 de1f6c20 de1f6c20 de1f6c54 de1f6c20
      	[   37.425933] 9e60: 00000000 c0238030 de1f6c20 c078d7bc de1f6c20 c02377ec de1f6c20 de1f6c28
      	[   37.434509] 9e80: dee64cb0 c0236138 c047c554 de189b58 00000000 c004b45c de1f6c20 de1f6cd8
      	[   37.443084] 9ea0: c0edfa6c de1f6c00 dee64c68 de1f6c04 de1f6c20 dee64cb8 c047c554 de189b58
      	[   37.451690] 9ec0: 00000000 c02cd634 dee64c68 de249ef4 de23b008 dee64cb0 0000000d de23b000
      	[   37.460266] 9ee0: de23b007 c02cd78c 00000002 00000000 00000000 35636d68 00333438 00000000
      	[   37.468841] 9f00: 00000000 00000000 001e0000 00000000 00000000 00000000 00000000 0a10cec0
      	[   37.477416] 9f20: 00000002 de249f80 0000000d dee62990 de189b40 c0234d88 0000000d c010c354
      	[   37.485992] 9f40: 0000000d de210f28 000acc88 de249f80 0000000d de248000 00000000 c00b7bf8
      	[   37.494567] 9f60: de210f28 000acc88 de210f28 000acc88 00000000 00000000 0000000d c00b7ed8
      	[   37.503143] 9f80: 00000000 00000000 0000000d 00000000 0007fa28 0000000d 000acc88 00000004
      	[   37.511718] 9fa0: c000e544 c000e380 0007fa28 0000000d 00000001 000acc88 0000000d 00000000
      	[   37.520294] 9fc0: 0007fa28 0000000d 000acc88 00000004 00000001 00000020 00000002 00000000
      	[   37.528869] 9fe0: 00000000 beab8624 0000ea05 b6eaebac 600d0010 00000001 00000000 00000000
      	[   37.537475] [<c00b408c>] (kfree+0x84/0x144) from [<c0236274>] (device_add+0x530/0x57c)
      	[   37.545806] [<c0236274>] (device_add+0x530/0x57c) from [<c032fa40>] (iio_device_register+0x8c8/0x990)
      	[   37.555480] [<c032fa40>] (iio_device_register+0x8c8/0x990) from [<c0330164>] (hmc5843_probe+0xec/0x114)
      	[   37.565338] [<c0330164>] (hmc5843_probe+0xec/0x114) from [<c02ccfd8>] (i2c_device_probe+0xc4/0xf8)
      	[   37.574737] [<c02ccfd8>] (i2c_device_probe+0xc4/0xf8) from [<c02381a8>] (driver_probe_device+0x118/0x218)
      	[   37.584777] [<c02381a8>] (driver_probe_device+0x118/0x218) from [<c0236bb0>] (bus_for_each_drv+0x4c/0x84)
      	[   37.594818] [<c0236bb0>] (bus_for_each_drv+0x4c/0x84) from [<c0238030>] (device_attach+0x78/0xa4)
      	[   37.604125] [<c0238030>] (device_attach+0x78/0xa4) from [<c02377ec>] (bus_probe_device+0x28/0x9c)
      	[   37.613433] [<c02377ec>] (bus_probe_device+0x28/0x9c) from [<c0236138>] (device_add+0x3f4/0x57c)
      	[   37.622650] [<c0236138>] (device_add+0x3f4/0x57c) from [<c02cd634>] (i2c_new_device+0xf8/0x19c)
      	[   37.631805] [<c02cd634>] (i2c_new_device+0xf8/0x19c) from [<c02cd78c>] (i2c_sysfs_new_device+0xb4/0x130)
      	[   37.641754] [<c02cd78c>] (i2c_sysfs_new_device+0xb4/0x130) from [<c0234d88>] (dev_attr_store+0x18/0x24)
      	[   37.651611] [<c0234d88>] (dev_attr_store+0x18/0x24) from [<c010c354>] (sysfs_write_file+0x10c/0x140)
      	[   37.661193] [<c010c354>] (sysfs_write_file+0x10c/0x140) from [<c00b7bf8>] (vfs_write+0xb0/0x178)
      	[   37.670410] [<c00b7bf8>] (vfs_write+0xb0/0x178) from [<c00b7ed8>] (sys_write+0x3c/0x68)
      	[   37.678833] [<c00b7ed8>] (sys_write+0x3c/0x68) from [<c000e380>] (ret_fast_syscall+0x0/0x3c)
      	[   37.687683] Code: 1593301c e5932000 e3120080 1a000000 (e7f001f2)
      	[   37.700775] ---[ end trace aaf805debdb69390 ]---
      
      Client data was assigned to iio_dev structure in probe but in
      hmc5843_init_client function casted to private driver data structure which
      is wrong. Possibly calling mutex_init(&data->lock); corrupt data
      which the lead to above crash.
      Signed-off-by: NMarek Belisko <marek.belisko@open-nandra.com>
      Cc: stable <stable@vger.kernel.org>
      Acked-by: NJonathan Cameron <jic23@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      62d2feb9
    • L
      drivers/rtc/rtc-pl031.c: enable clock on all ST variants · 2f397216
      Linus Walleij 提交于
      The ST variants of the PL031 all require bit 26 in the control register
      to be set before they work properly.  Discovered this when testing on
      the Nomadik board where it would suprisingly just stand still.
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Cc: Alessandro Rubini <rubini@unipv.it>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2f397216
    • K
      drivers/rtc/rtc-twl.c: use static register while reading time · f3ec434c
      Konstantin Shlyakhovoy 提交于
      RTC stores time and date in several registers.  Due to the fact that
      these registers can't be read instantaneously, there is a chance that
      reading from counting registers gives an error of one minute, one hour,
      one day, etc.
      
      To address this issue, the RTC has hardware support to copy the RTC
      counting registers to static shadowed registers.  The current
      implementation does not use this feature, and in a stress test, we can
      reproduce this error at a rate of around two times per 300000 readings.
      
      Fix the implementation to ensure that the right snapshot of time is
      captured.
      Signed-off-by: NKonstantin Shlyakhovoy <x0155534@ti.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: linux-omap <linux-omap@vger.kernel.org>
      Acked-by: NMykola Oleksiienko <x0174904@ti.com>
      Acked-by: NOleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com>
      Acked-by: NGraeme Gregory <gg@slimlogic.co.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f3ec434c
    • T
      drivers/rtc/rtc-s3c.c: add placeholder for driver private data · c3cba928
      Tushar Behera 提交于
      Driver data field is a pointer, hence assigning that to an integer results
      in compilation warnings.
      
      Fixes following compilation warnings:
      
        drivers/rtc/rtc-s3c.c: In function `s3c_rtc_get_driver_data':
        drivers/rtc/rtc-s3c.c:452:3: warning: return makes integer from pointer without a cast [enabled by default]
        drivers/rtc/rtc-s3c.c: At top level:
        drivers/rtc/rtc-s3c.c:674:3: warning: initialization makes pointer from integer without a cast [enabled by default]
        drivers/rtc/rtc-s3c.c:674:3: warning: (near initialization for `s3c_rtc_dt_match[1].data') [enabled by default]
        drivers/rtc/rtc-s3c.c:677:3: warning: initialization makes pointer from integer without a cast [enabled by default]
        drivers/rtc/rtc-s3c.c:677:3: warning: (near initialization for `s3c_rtc_dt_match[2].data') [enabled by default]
        drivers/rtc/rtc-s3c.c:680:3: warning: initialization makes pointer from integer without a cast [enabled by default]
        drivers/rtc/rtc-s3c.c:680:3: warning: (near initialization for `s3c_rtc_dt_match[3].data') [enabled by default]
      Signed-off-by: NTushar Behera <tushar.behera@linaro.org>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c3cba928
    • T
      drivers/rtc/rtc-s3c.c: fix compilation error · cd1e6f9e
      Tushar Behera 提交于
      Fix this error:
      
        drivers/rtc/rtc-s3c.c: At top level:
        drivers/rtc/rtc-s3c.c:671:3: error: request for member `data' in something not a structure or union
        drivers/rtc/rtc-s3c.c:674:3: error: request for member `data' in something not a structure or union
        drivers/rtc/rtc-s3c.c:677:3: error: request for member `data' in something not a structure or union
        drivers/rtc/rtc-s3c.c:680:3: error: request for member `data' in something not a structure or union
      Signed-off-by: NTushar Behera <tushar.behera@linaro.org>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd1e6f9e
    • J
      drivers/rtc/rtc-efi.c: fix section mismatch warning · 32050017
      Jan Beulich 提交于
      efi_rtc_init() uses platform_driver_probe(), so there's no need to also
      set efi_rtc_driver's probe member (as it won't be used anyway).  This
      fixes a modpost section mismatch warning (as efi_rtc_probe() validly is
      __init).
      Signed-off-by: NJan Beulich <jbeulich@suse.com>
      Cc: Matthew Garrett <mjg@redhat.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      32050017
    • A
      drivers/rtc/rtc-r9701.c: reset registers if invalid values are detected · bb58da08
      Andreas Dumberger 提交于
      hwclock refuses to set date/time if RTC registers contain invalid
      values.  Check the date/time register values at probe time and
      initialize them to make hwclock happy.
      Signed-off-by: NAndreas Dumberger <andreas.dumberger@tqs.de>
      Signed-off-by: NAnatolij Gustschin <agust@denx.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bb58da08
    • M
      drivers/char/random.c: fix boot id uniqueness race · 44e4360f
      Mathieu Desnoyers 提交于
      /proc/sys/kernel/random/boot_id can be read concurrently by userspace
      processes.  If two (or more) user-space processes concurrently read
      boot_id when sysctl_bootid is not yet assigned, a race can occur making
      boot_id differ between the reads.  Because the whole point of the boot id
      is to be unique across a kernel execution, fix this by protecting this
      operation with a spinlock.
      
      Given that this operation is not frequently used, hitting the spinlock
      on each call should not be an issue.
      Signed-off-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Cc: Greg Kroah-Hartman <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      44e4360f
  4. 12 4月, 2012 17 次提交
  5. 11 4月, 2012 7 次提交
    • A
      xHCI: Correct the #define XHCI_LEGACY_DISABLE_SMI · 95018a53
      Alex He 提交于
      Re-define XHCI_LEGACY_DISABLE_SMI and used it in right way. All SMI enable
      bits will be cleared to zero and flag bits 29:31 are also cleared to zero.
      Other bits should be presvered as Table 146.
      
      This patch should be backported to kernels as old as 2.6.31.
      Signed-off-by: NAlex He <alex.he@amd.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      95018a53
    • D
      xHCI: use gfp flags from caller instead of GFP_ATOMIC · 3fc8206d
      Dan Carpenter 提交于
      The caller is allowed to specify the GFP flags for these functions.
      We should prefer their flags unless we have good reason.  For
      example, if we take a spin_lock ourselves we'd need to use
      GFP_ATOMIC.  But in this case it's safe to use the callers GFP
      flags.
      
      The callers all pass GFP_ATOMIC here, so this change doesn't affect
      how the kernel behaves but we may add other callers later and this
      is a cleanup.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      3fc8206d
    • E
      xHCI: add XHCI_RESET_ON_RESUME quirk for VIA xHCI host · 457a4f61
      Elric Fu 提交于
      The suspend operation of VIA xHCI host have some issues and
      hibernate operation works fine, so The XHCI_RESET_ON_RESUME
      quirk is added for it.
      
      This patch should base on "xHCI: Don't write zeroed pointer
      to xHC registers" that is released by Sarah. Otherwise, the
      host system error will ocurr in the hibernate operation
      process.
      
      This should be backported to stable kernels as old as 2.6.37,
      that contain the commit c877b3b2
      "xhci: Add reset on resume quirk for asrock p67 host".
      Signed-off-by: NElric Fu <elricfu1@gmail.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      457a4f61
    • E
      USB: fix bug of device descriptor got from superspeed device · d8aec3db
      Elric Fu 提交于
      When the Seagate Goflex USB3.0 device is attached to VIA xHCI
      host, sometimes the device will downgrade mode to high speed.
      By the USB analyzer, I found the device finished the link
      training process and worked at superspeed mode. But the device
      descriptor got from the device shows the device works at 2.1.
      It is very strange and seems like the device controller of
      Seagate Goflex has a little confusion.
      
      The first 8 bytes of device descriptor should be:
      12 01 00 03 00 00 00 09
      
      But the first 8 bytes of wrong device descriptor are:
      12 01 10 02 00 00 00 40
      
      The wrong device descriptor caused the initialization of mass
      storage failed. After a while, the device would be recognized
      as a high speed device and works fine.
      
      This patch will warm reset the device to fix the issue after
      finding the bcdUSB field of device descriptor isn't 0x0300
      but the speed mode of device is superspeed.
      
      This patch should be backported to kernels as old as 3.2, or ones that
      contain the commit 75d7cf72 "usbcore:
      refine warm reset logic".
      Signed-off-by: NElric Fu <elricfu1@gmail.com>
      Acked-by: NAndiry Xu <Andiry.Xu@amd.com>
      Acked-by: NSergei Shtylyov <sshtylyov@mvista.com>
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: stable@vger.kernel.org
      d8aec3db
    • S
      xhci: Fix register save/restore order. · c7713e73
      Sarah Sharp 提交于
      The xHCI 1.0 spec errata released on June 13, 2011, changes the ordering
      that the xHCI registers are saved and restored in.  It moves the
      interrupt pending (IMAN) and interrupt control (IMOD) registers to be
      saved and restored last.  I believe that's because the host controller
      may attempt to fetch the event ring table when interrupts are
      re-enabled.  Therefore we need to restore the event ring registers
      before we re-enable interrupts.
      
      This should be backported to kernels as old as 2.6.37, that contain the
      commit 5535b1d5 "USB: xHCI: PCI power
      management implementation"
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NElric Fu <elricfu1@gmail.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Cc: stable@vger.kernel.org
      c7713e73
    • S
      xhci: Restore event ring dequeue pointer on resume. · fb3d85bc
      Sarah Sharp 提交于
      The xhci_save_registers() function saved the event ring dequeue pointer
      in the s3 register structure, but xhci_restore_registers() never
      restored it.  No other code in the xHCI successful resume path would
      ever restore it either.  Fix that.
      
      This should be backported to kernels as old as 2.6.37, that contain the
      commit 5535b1d5 "USB: xHCI: PCI power
      management implementation".
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NElric Fu <elricfu1@gmail.com>
      Cc: Andiry Xu <andiry.xu@amd.com>
      Cc: stable@vger.kernel.org
      fb3d85bc
    • S
      xhci: Don't write zeroed pointers to xHC registers. · 159e1fcc
      Sarah Sharp 提交于
      When xhci_mem_cleanup() is called, we can't be sure if the xHC is
      actually halted.  We can ask the xHC to halt by writing to the RUN bit
      in the command register, but that might timeout due to a HW hang.
      
      If the host controller is still running, we should not write zeroed
      values to the event ring dequeue pointers or base tables, the DCBAA
      pointers, or the command ring pointers.  Eric Fu reports his VIA VL800
      host accesses the event ring pointers after a failed register restore on
      resume from suspend.  The hypothesis is that the host never actually
      halted before the register write to change the event ring pointer to
      zero.
      
      Remove all writes of zeroed values to pointer registers in
      xhci_mem_cleanup().  Instead, make all callers of the function reset the
      host controller first, which will reset those registers to zero.
      xhci_mem_init() is the only caller that doesn't first halt and reset the
      host controller before calling xhci_mem_cleanup().
      
      This should be backported to kernels as old as 2.6.32.
      Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Tested-by: NElric Fu <elricfu1@gmail.com>
      Cc: stable@vger.kernel.org
      159e1fcc