1. 12 12月, 2012 11 次提交
    • Z
      Thermal: Fix DEFAULT_THERMAL_GOVERNOR · 1f53ef17
      Zhang Rui 提交于
      Fix DEFAULT_THERMAL_GOVERNOR to be consistant with the
      default governor selected in kernel config file.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      1f53ef17
    • Z
      Thermal: fix a NULL pointer dereference when generic thermal layer is built as a module · d567c686
      Zhang Rui 提交于
      [   12.761956] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      [   12.762016] IP: [<ffffffffa0005277>] handle_thermal_trip+0x47/0x130 [thermal_sys]
      [   12.762060] PGD 1fec74067 PUD 1fee5b067 PMD 0
      [   12.762127] Oops: 0000 [#1] SMP
      [   12.762177] Modules linked in: hid_generic crc32c_intel usbhid hid firewire_ohci(+) e1000e(+) firewire_core crc_itu_t xhci_hcd(+) thermal(+) fan thermal_sys hwmon
      [   12.762423] CPU 1
      [   12.762443] Pid: 187, comm: modprobe Tainted: G       A     3.7.0-thermal-module+ #25                  /DH77DF
      [   12.762496] RIP: 0010:[<ffffffffa0005277>]  [<ffffffffa0005277>] handle_thermal_trip+0x47/0x130 [thermal_sys]
      [   12.762682] RSP: 0018:ffff8801fe7ddc18  EFLAGS: 00010282
      [   12.762704] RAX: 0000000000000000 RBX: ffff8801ff3e9c00 RCX: ffff8801fdc39800
      [   12.762728] RDX: ffff8801fe7ddc24 RSI: 0000000000000001 RDI: ffff8801ff3e9c00
      [   12.762764] RBP: ffff8801fe7ddc48 R08: 0000000004000000 R09: ffffffffa001f568
      [   12.762797] R10: ffffffff81363083 R11: 0000000000000001 R12: 0000000000000001
      [   12.762832] R13: 0000000000000000 R14: 0000000000000001 R15: ffff8801fde73e68
      [   12.762866] FS:  00007f5548516700(0000) GS:ffff88021f240000(0000) knlGS:0000000000000000
      [   12.762912] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   12.762946] CR2: 0000000000000018 CR3: 00000001fefe2000 CR4: 00000000001407e0
      [   12.762979] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   12.763014] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [   12.763048] Process modprobe (pid: 187, threadinfo ffff8801fe7dc000, task ffff8801fe5bdb40)
      [   12.763095] Stack:
      [   12.763122]  0000000000019640 00000000fdc39800 ffff8801fe7ddc48 ffff8801ff3e9c00
      [   12.763225]  0000000000000002 0000000000000000 ffff8801fe7ddc78 ffffffffa00053e7
      [   12.763338]  ffff8801ff3e9c00 0000000000006c98 ffffffffa0007480 ffff8801ff3e9c00
      [   12.763440] Call Trace:
      [   12.763470]  [<ffffffffa00053e7>] thermal_zone_device_update+0x77/0xa0 [thermal_sys]
      [   12.763515]  [<ffffffffa0006d38>] thermal_zone_device_register+0x788/0xa88 [thermal_sys]
      [   12.763562]  [<ffffffffa001f394>] acpi_thermal_add+0x360/0x4c8 [thermal]
      [   12.763598]  [<ffffffff8133902a>] acpi_device_probe+0x50/0x190
      [   12.763632]  [<ffffffff811bd793>] ? sysfs_create_link+0x13/0x20
      [   12.763666]  [<ffffffff813cc41b>] driver_probe_device+0x7b/0x240
      [   12.763699]  [<ffffffff813cc68b>] __driver_attach+0xab/0xb0
      [   12.763732]  [<ffffffff813cc5e0>] ? driver_probe_device+0x240/0x240
      [   12.763766]  [<ffffffff813ca836>] bus_for_each_dev+0x56/0x90
      [   12.763799]  [<ffffffff813cbf4e>] driver_attach+0x1e/0x20
      [   12.763831]  [<ffffffff813cbac0>] bus_add_driver+0x190/0x290
      [   12.763864]  [<ffffffffa0022000>] ? 0xffffffffa0021fff
      [   12.763896]  [<ffffffff813ccbea>] driver_register+0x7a/0x160
      [   12.763928]  [<ffffffffa0022000>] ? 0xffffffffa0021fff
      [   12.763960]  [<ffffffff813399fb>] acpi_bus_register_driver+0x43/0x45
      [   12.763995]  [<ffffffffa002203a>] acpi_thermal_init+0x3a/0x42 [thermal]
      [   12.764029]  [<ffffffff8100207f>] do_one_initcall+0x3f/0x170
      [   12.764063]  [<ffffffff810b1a5f>] sys_init_module+0x8f/0x200
      [   12.764097]  [<ffffffff815ff259>] system_call_fastpath+0x16/0x1b
      [   12.764129] Code: 48 8b 87 c8 02 00 00 41 89 f4 48 8d 55 dc ff 50 28 44 8b 6d dc 41 8d 45 fe 83 f8 01 76 5e 48 8b 83 d8 02 00 00 44 89 e6 48 89 df <ff> 50 18 4c 8d a3 10 03 00 00 4c 89 e7 e8 87 f1 5e e1 8b 83 bc
      [   12.765164] RIP  [<ffffffffa0005277>] handle_thermal_trip+0x47/0x130 [thermal_sys]
      [   12.765223]  RSP <ffff8801fe7ddc18>
      [   12.765252] CR2: 0000000000000018
      [   12.765284] ---[ end trace 7723294cdfb00d2a ]---
      
      This is because thermal_zone_device_update() is invoked before
      any thermal governors being registered.
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      d567c686
    • L
      mm, memory-hotplug: dynamic configure movable memory and portion memory · 511c2aba
      Lai Jiangshan 提交于
      Add online_movable and online_kernel for logic memory hotplug.  This is
      the dynamic version of "movablecore" & "kernelcore".
      
      We have the same reason to introduce it as to introduce "movablecore" &
      "kernelcore".  It has the same motive as "movablecore" & "kernelcore", but
      it is dynamic/running-time:
      
      o We can configure memory as kernelcore or movablecore after boot.
      
        Userspace workload is increased, we need more hugepage, we can't use
        "online_movable" to add memory and allow the system use more
        THP(transparent-huge-page), vice-verse when kernel workload is increase.
      
        Also help for virtualization to dynamic configure host/guest's memory,
        to save/(reduce waste) memory.
      
        Memory capacity on Demand
      
      o When a new node is physically online after boot, we need to use
        "online_movable" or "online_kernel" to configure/portion it as we
        expected when we logic-online it.
      
        This configuration also helps for physically-memory-migrate.
      
      o all benefit as the same as existed "movablecore" & "kernelcore".
      
      o Preparing for movable-node, which is very important for power-saving,
        hardware partitioning and high-available-system(hardware fault
        management).
      
      (Note, we don't introduce movable-node here.)
      
      Action behavior:
      When a memoryblock/memorysection is onlined by "online_movable", the kernel
      will not have directly reference to the page of the memoryblock,
      thus we can remove that memory any time when needed.
      
      When it is online by "online_kernel", the kernel can use it.
      When it is online by "online", the zone type doesn't changed.
      
      Current constraints:
      Only the memoryblock which is adjacent to the ZONE_MOVABLE
      can be online from ZONE_NORMAL to ZONE_MOVABLE.
      
      [akpm@linux-foundation.org: use min_t, cleanups]
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
      Cc: Jiang Liu <jiang.liu@huawei.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      511c2aba
    • L
      drivers/base/node.c: cleanup node_state_attr[] · fcf07d22
      Lai Jiangshan 提交于
      use [index] = init_value
      use N_xxxxx instead of hardcode.
      
      Make it more readability and easier to add new state.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fcf07d22
    • J
      bootmem: fix wrong call parameter for free_bootmem() · 81df9bff
      Joonsoo Kim 提交于
      It is strange that alloc_bootmem() returns a virtual address and
      free_bootmem() requires a physical address.  Anyway, free_bootmem()'s
      first parameter should be physical address.
      
      There are some call sites for free_bootmem() with virtual address.  So fix
      them.
      
      [akpm@linux-foundation.org: improve free_bootmem() and free_bootmem_pate() documentation]
      Signed-off-by: NJoonsoo Kim <js1304@gmail.com>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      81df9bff
    • D
      mm, oom: change type of oom_score_adj to short · a9c58b90
      David Rientjes 提交于
      The maximum oom_score_adj is 1000 and the minimum oom_score_adj is -1000,
      so this range can be represented by the signed short type with no
      functional change.  The extra space this frees up in struct signal_struct
      will be used for per-thread oom kill flags in the next patch.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Reviewed-by: NMichal Hocko <mhocko@suse.cz>
      Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9c58b90
    • Y
      mm: cleanup register_node() · fa264375
      Yasuaki Ishimatsu 提交于
      register_node() is defined as extern in include/linux/node.h.  But the
      function is only called from register_one_node() in driver/base/node.c.
      
      So the patch defines register_node() as static.
      Signed-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Acked-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fa264375
    • R
      virtio_balloon: introduce migration primitives to balloon pages · e2250429
      Rafael Aquini 提交于
      Memory fragmentation introduced by ballooning might reduce significantly
      the number of 2MB contiguous memory blocks that can be used within a guest,
      thus imposing performance penalties associated with the reduced number of
      transparent huge pages that could be used by the guest workload.
      
      Besides making balloon pages movable at allocation time and introducing
      the necessary primitives to perform balloon page migration/compaction,
      this patch also introduces the following locking scheme, in order to
      enhance the syncronization methods for accessing elements of struct
      virtio_balloon, thus providing protection against concurrent access
      introduced by parallel memory migration threads.
      
       - balloon_lock (mutex) : synchronizes the access demand to elements of
                                struct virtio_balloon and its queue operations;
      
      [yongjun_wei@trendmicro.com.cn: fix missing unlock on error in fill_balloon()]
      [akpm@linux-foundation.org: avoid having multiple return points in fill_balloon()]
      [akpm@linux-foundation.org: fix printk warning]Signed-off-by: Rafael Aquini <aquini@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e2250429
    • Y
      memory-hotplug: suppress "Device nodeX does not have a release() function" warning · 8c7b5b4e
      Yasuaki Ishimatsu 提交于
      When calling unregister_node(), the function shows following message at
      device_release().
      
      "Device 'node2' does not have a release() function, it is broken and must
      be fixed."
      
      The reason is node's device struct does not have a release() function.
      
      So the patch registers node_device_release() to the device's release()
      function for suppressing the warning message.  Additionally, the patch
      adds memset() to initialize a node struct into register_node().  Because
      the node struct is part of node_devices[] array and it cannot be freed by
      node_device_release().  So if system reuses the node struct, it has a
      garbage.
      Signed-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Jiang Liu <liuj97@gmail.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8c7b5b4e
    • W
      numa: convert static memory to dynamically allocated memory for per node device · 8732794b
      Wen Congyang 提交于
      We use a static array to store struct node.  In many cases, we don't have
      too many nodes, and some memory will be unused.  Convert it to per-device
      dynamically allocated memory.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Jiang Liu <liuj97@gmail.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8732794b
    • Y
      memory hotplug: suppress "Device memoryX does not have a release() function" warning · fa7194eb
      Yasuaki Ishimatsu 提交于
      When calling remove_memory_block(), the function shows following message
      at device_release().
      
      "Device 'memory528' does not have a release() function, it is broken and
      must be fixed."
      
      The reason is memory_block's device struct does not have a release()
      function.
      
      So the patch registers memory_block_release() to the device's release()
      function for suppressing the warning message.  Additionally, the patch
      moves kfree(mem) into the release function since the release function is
      prepared as a means to free a memory_block struct.
      Signed-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Jiang Liu <liuj97@gmail.com>
      Cc: Minchan Kim <minchan.kim@gmail.com>
      Acked-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Wen Congyang <wency@cn.fujitsu.com>
      Cc: Greg KH <greg@kroah.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fa7194eb
  2. 11 12月, 2012 8 次提交
    • V
      drivers: cma: represent physical addresses as phys_addr_t · 4009793e
      Vitaly Andrianov 提交于
      This commit changes the CMA early initialization code to use phys_addr_t
      for representing physical addresses instead of unsigned long.
      
      Without this change, among other things, dma_declare_contiguous() simply
      discards any memory regions whose address is not representable as unsigned
      long.
      
      This is a problem on 32-bit PAE machines where unsigned long is 32-bit
      but physical address space is larger.
      Signed-off-by: NVitaly Andrianov <vitalya@ti.com>
      Signed-off-by: NCyril Chemparathy <cyril@ti.com>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      4009793e
    • M
      clk: introduce optional disable_unused callback · 7c045a55
      Mike Turquette 提交于
      Some gate clocks have special needs which must be handled during the
      disable-unused clocks sequence.  These needs might be driven by software
      due to the fact that we're disabling a clock outside of the normal
      clk_disable path and a clk's enable_count will not be accurate.  On the
      other hand a specific hardware programming sequence might need to be
      followed for this corner case.
      
      This change is needed for the upcoming OMAP port to the common clock
      framework.  Specifically, it is undesirable to treat the disable-unused
      path identically to the normal clk_disable path since other software
      layers are involved.  In this case OMAP's clockdomain code throws WARNs
      and bails early due to the clock's enable_count being set to zero.  A
      custom callback mitigates this problem nicely.
      
      Cc: Paul Walmsley <paul@pwsan.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMike Turquette <mturquette@linaro.org>
      7c045a55
    • F
      Input: matrix-keymap - provide proper module license · 55220bb3
      Florian Fainelli 提交于
      The matrix-keymap module is currently lacking a proper module license,
      add one so we don't have this module tainting the entire kernel.  This
      issue has been present since commit 1932811f ("Input: matrix-keymap
      - uninline and prepare for device tree support")
      Signed-off-by: NFlorian Fainelli <florian@openwrt.org>
      CC: stable@vger.kernel.org # v3.5+
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      55220bb3
    • A
      mmc: sdhci-acpi: enable runtime-pm for device HID INT33C6 · e5571397
      Adrian Hunter 提交于
      sdhci-acpi supports ACPI devices which have compatibility ID
      PNP0D40, however it is not possible to know if those devices
      will all work correctly with runtime-pm, so that must be configured
      per hardware ID.
      
      For INT33C6, several related quirks, capabilities and flags are set:
      
      	MMC_CAP_NONREMOVABLE
      		The SDIO card will never be removable
      
      	SDHCI_ACPI_RUNTIME_PM
      		Enable runtime-pm of the host controller
      
      	MMC_CAP_POWER_OFF_CARD
      		Enable runtime-pm of the SDIO card
      
      	MMC_PM_KEEP_POWER
      		SDIO card has the capability to remain powered up
      		during system suspend
      
      	SDHCI_QUIRK2_HOST_OFF_CARD_ON
      		Always do a full reset during system resume
      		because the card may be already initialized having
      		not been powered off.
      
      Wake-ups from the INT33C6 host controller are not supported, so the
      following capability must *not* be set:
      
      	MMC_PM_WAKE_SDIO_IRQ
      		Enable wake on card interrupt
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NChris Ball <cjb@laptop.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e5571397
    • L
      Revert "revert "Revert "mm: remove __GFP_NO_KSWAPD""" and associated damage · caf49191
      Linus Torvalds 提交于
      This reverts commits a5091539 and
      d7c3b937.
      
      This is a revert of a revert of a revert.  In addition, it reverts the
      even older i915 change to stop using the __GFP_NO_KSWAPD flag due to the
      original commits in linux-next.
      
      It turns out that the original patch really was bogus, and that the
      original revert was the correct thing to do after all.  We thought we
      had fixed the problem, and then reverted the revert, but the problem
      really is fundamental: waking up kswapd simply isn't the right thing to
      do, and direct reclaim sometimes simply _is_ the right thing to do.
      
      When certain allocations fail, we simply should try some direct reclaim,
      and if that fails, fail the allocation.  That's the right thing to do
      for THP allocations, which can easily fail, and the GPU allocations want
      to do that too.
      
      So starting kswapd is sometimes simply wrong, and removing the flag that
      said "don't start kswapd" was a mistake.  Let's hope we never revisit
      this mistake again - and certainly not this many times ;)
      Acked-by: NMel Gorman <mgorman@suse.de>
      Acked-by: NJohannes Weiner <hannes@cmpxchg.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      caf49191
    • M
      regmap: debugfs: Cache offsets of valid regions for dump · 5166b7c0
      Mark Brown 提交于
      Avoid doing a linear scan of the entire register map for each read() of
      the debugfs register dump by recording the offsets where valid registers
      exist when we first read the registers file. This assumes the set of
      valid registers never changes, if this is not the case invalidation of
      the cache will be required.
      
      This could be further improved for large blocks of contiguous registers
      by calculating the register we will read from within the block - currently
      we do a linear scan of the block. An rbtree may also be worthwhile.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      5166b7c0
    • M
      regmap: debugfs: Factor out initial seek · afab2f7b
      Mark Brown 提交于
      In preparation for doing things a bit more quickly than a linear scan
      factor out the initial seek from the debugfs register dump.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      afab2f7b
    • M
      regmap: debugfs: Avoid overflows for very small reads · db04328c
      Mark Brown 提交于
      If count is less than the size of a register then we may hit integer
      wraparound when trying to move backwards to check if we're still in
      the buffer. Instead move the position forwards to check if it's still
      in the buffer, we are unlikely to be able to allocate a buffer
      sufficiently big to overflow here.
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: stable@vger.kernel.org
      db04328c
  3. 10 12月, 2012 2 次提交
  4. 08 12月, 2012 6 次提交
  5. 07 12月, 2012 13 次提交