1. 07 5月, 2012 3 次提交
    • K
      xen/pte: Fix crashes when trying to see non-existent PGD/PMD/PUD/PTEs · b7e5ffe5
      Konrad Rzeszutek Wilk 提交于
      If I try to do "cat /sys/kernel/debug/kernel_page_tables"
      I end up with:
      
      BUG: unable to handle kernel paging request at ffffc7fffffff000
      IP: [<ffffffff8106aa51>] ptdump_show+0x221/0x480
      PGD 0
      Oops: 0000 [#1] SMP
      CPU 0
      .. snip..
      RAX: 0000000000000000 RBX: ffffc00000000fff RCX: 0000000000000000
      RDX: 0000800000000000 RSI: 0000000000000000 RDI: ffffc7fffffff000
      
      which is due to the fact we are trying to access a PFN that is not
      accessible to us. The reason (at least in this case) was that
      PGD[256] is set to __HYPERVISOR_VIRT_START which was setup (by the
      hypervisor) to point to a read-only linear map of the MFN->PFN array.
      During our parsing we would get the MFN (a valid one), try to look
      it up in the MFN->PFN tree and find it invalid and return ~0 as PFN.
      Then pte_mfn_to_pfn would happilly feed that in, attach the flags
      and return it back to the caller. 'ptdump_show' bitshifts it and
      gets and invalid value that it tries to dereference.
      
      Instead of doing all of that, we detect the ~0 case and just
      return !_PAGE_PRESENT.
      
      This bug has been in existence .. at least until 2.6.37 (yikes!)
      
      CC: stable@kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b7e5ffe5
    • K
      xen/apic: Return the APIC ID (and version) for CPU 0. · 558daa28
      Konrad Rzeszutek Wilk 提交于
      On x86_64 on AMD machines where the first APIC_ID is not zero, we get:
      
      ACPI: LAPIC (acpi_id[0x01] lapic_id[0x10] enabled)
      BIOS bug: APIC version is 0 for CPU 1/0x10, fixing up to 0x10
      BIOS bug: APIC version mismatch, boot CPU: 0, CPU 1: version 10
      
      which means that when the ACPI processor driver loads and
      tries to parse the _Pxx states it fails to do as, as it
      ends up calling acpi_get_cpuid which does this:
      
      for_each_possible_cpu(i) {
              if (cpu_physical_id(i) == apic_id)
                      return i;
      }
      
      And the bootup CPU, has not been found so it fails and returns -1
      for the first CPU - which then subsequently in the loop that
      "acpi_processor_get_info" does results in returning an error, which
      means that "acpi_processor_add" failing and per_cpu(processor)
      is never set (and is NULL).
      
      That means that when xen-acpi-processor tries to load (much much
      later on) and parse the P-states it gets -ENODEV from
      acpi_processor_register_performance() (which tries to read
      the per_cpu(processor)) and fails to parse the data.
      Reported-by-and-Tested-by: NStefan Bader <stefan.bader@canonical.com>
      Suggested-by: NBoris Ostrovsky <boris.ostrovsky@amd.com>
      [v2: Bit-shift APIC ID by 24 bits]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      558daa28
    • J
      drivers/video/xen-fbfront.c: add missing cleanup code · a7a97c63
      Julia Lawall 提交于
      The operations in the subsequent error-handling code appear to be also
      useful here.
      Acked-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      [v1: Collapse some of the error handling functions]
      [v2: Fix compile warning]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a7a97c63
  2. 28 4月, 2012 1 次提交
  3. 27 4月, 2012 4 次提交
    • K
      xen/acpi: Workaround broken BIOSes exporting non-existing C-states. · b930fe5e
      Konrad Rzeszutek Wilk 提交于
      We did a similar check for the P-states but did not do it for
      the C-states. What we want to do is ignore cases where the DSDT
      has definition for sixteen CPUs, but the machine only has eight
      CPUs and we get:
      xen-acpi-processor: (CX): Hypervisor error (-22) for ACPI CPU14
      Reported-by: NTobias Geiger <tobias.geiger@vido.info>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      b930fe5e
    • K
      xen/smp: Fix crash when booting with ACPI hotplug CPUs. · cf405ae6
      Konrad Rzeszutek Wilk 提交于
      When we boot on a machine that can hotplug CPUs and we
      are using 'dom0_max_vcpus=X' on the Xen hypervisor line
      to clip the amount of CPUs available to the initial domain,
      we get this:
      
      (XEN) Command line: com1=115200,8n1 dom0_mem=8G noreboot dom0_max_vcpus=8 sync_console mce_verbosity=verbose console=com1,vga loglvl=all guest_loglvl=all
      .. snip..
      DMI: Intel Corporation S2600CP/S2600CP, BIOS SE5C600.86B.99.99.x032.072520111118 07/25/2011
      .. snip.
      SMP: Allowing 64 CPUs, 32 hotplug CPUs
      installing Xen timer for CPU 7
      cpu 7 spinlock event irq 361
      NMI watchdog: disabled (cpu7): hardware events not enabled
      Brought up 8 CPUs
      .. snip..
      	[acpi processor finds the CPUs are not initialized and starts calling
      	arch_register_cpu, which creates /sys/devices/system/cpu/cpu8/online]
      CPU 8 got hotplugged
      CPU 9 got hotplugged
      CPU 10 got hotplugged
      .. snip..
      initcall 1_acpi_battery_init_async+0x0/0x1b returned 0 after 406 usecs
      calling  erst_init+0x0/0x2bb @ 1
      
      	[and the scheduler sticks newly started tasks on the new CPUs, but
      	said CPUs cannot be initialized b/c the hypervisor has limited the
      	amount of vCPUS to 8 - as per the dom0_max_vcpus=8 flag.
      	The spinlock tries to kick the other CPU, but the structure for that
      	is not initialized and we crash.]
      BUG: unable to handle kernel paging request at fffffffffffffed8
      IP: [<ffffffff81035289>] xen_spin_lock+0x29/0x60
      PGD 180d067 PUD 180e067 PMD 0
      Oops: 0002 [#1] SMP
      CPU 7
      Modules linked in:
      
      Pid: 1, comm: swapper/0 Not tainted 3.4.0-rc2upstream-00001-gf5154e8 #1 Intel Corporation S2600CP/S2600CP
      RIP: e030:[<ffffffff81035289>]  [<ffffffff81035289>] xen_spin_lock+0x29/0x60
      RSP: e02b:ffff8801fb9b3a70  EFLAGS: 00010282
      
      With this patch, we cap the amount of vCPUS that the initial domain
      can run, to exactly what dom0_max_vcpus=X has specified.
      
      In the future, if there is a hypercall that will allow a running
      domain to expand past its initial set of vCPUS, this patch should
      be re-evaluated.
      
      CC: stable@kernel.org
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      cf405ae6
    • S
      xen: use the pirq number to check the pirq_eoi_map · 521394e4
      Stefano Stabellini 提交于
      In pirq_check_eoi_map use the pirq number rather than the Linux irq
      number to check whether an eoi is needed in the pirq_eoi_map.
      
      The reason is that the irq number is not always identical to the
      pirq number so if we wrongly use the irq number to check the
      pirq_eoi_map we are going to check for the wrong pirq to EOI.
      
      As a consequence some interrupts might not be EOI'ed by the
      guest correctly.
      Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Tested-by: NTobias Geiger <tobias.geiger@vido.info>
      [v1: Added some extra wording to git commit]
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      521394e4
    • K
      xen/enlighten: Disable MWAIT_LEAF so that acpi-pad won't be loaded. · df88b2d9
      Konrad Rzeszutek Wilk 提交于
      There are exactly four users of __monitor and __mwait:
      
       - cstate.c (which allows acpi_processor_ffh_cstate_enter to be called
         when the cpuidle API drivers are used. However patch
         "cpuidle: replace xen access to x86 pm_idle and default_idle"
         provides a mechanism to disable the cpuidle and use safe_halt.
       - smpboot (which allows mwait_play_dead to be called). However
         safe_halt is always used so we skip that.
       - intel_idle (same deal as above).
       - acpi_pad.c. This the one that we do not want to run as we
         will hit the below crash.
      
      Why do we want to expose MWAIT_LEAF in the first place?
      We want it for the xen-acpi-processor driver - which uploads
      C-states to the hypervisor. If MWAIT_LEAF is set, the cstate.c
      sets the proper address in the C-states so that the hypervisor
      can benefit from using the MWAIT functionality. And that is
      the sole reason for using it.
      
      Without this patch, if a module performs mwait or monitor we
      get this:
      
      invalid opcode: 0000 [#1] SMP
      CPU 2
      .. snip..
      Pid: 5036, comm: insmod Tainted: G           O 3.4.0-rc2upstream-dirty #2 Intel Corporation S2600CP/S2600CP
      RIP: e030:[<ffffffffa000a017>]  [<ffffffffa000a017>] mwait_check_init+0x17/0x1000 [mwait_check]
      RSP: e02b:ffff8801c298bf18  EFLAGS: 00010282
      RAX: ffff8801c298a010 RBX: ffffffffa03b2000 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff8801c29800d8 RDI: ffff8801ff097200
      RBP: ffff8801c298bf18 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
      R13: ffffffffa000a000 R14: 0000005148db7294 R15: 0000000000000003
      FS:  00007fbb364f2700(0000) GS:ffff8801ff08c000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 000000000179f038 CR3: 00000001c9469000 CR4: 0000000000002660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process insmod (pid: 5036, threadinfo ffff8801c298a000, task ffff8801c29cd7e0)
      Stack:
       ffff8801c298bf48 ffffffff81002124 ffffffffa03b2000 00000000000081fd
       000000000178f010 000000000178f030 ffff8801c298bf78 ffffffff810c41e6
       00007fff3fb30db9 00007fff3fb30db9 00000000000081fd 0000000000010000
      Call Trace:
       [<ffffffff81002124>] do_one_initcall+0x124/0x170
       [<ffffffff810c41e6>] sys_init_module+0xc6/0x220
       [<ffffffff815b15b9>] system_call_fastpath+0x16/0x1b
      Code: <0f> 01 c8 31 c0 0f 01 c9 c9 c3 00 00 00 00 00 00 00 00 00 00 00 00
      RIP  [<ffffffffa000a017>] mwait_check_init+0x17/0x1000 [mwait_check]
       RSP <ffff8801c298bf18>
      ---[ end trace 16582fc8a3d1e29a ]---
      Kernel panic - not syncing: Fatal exception
      
      With this module (which is what acpi_pad.c would hit):
      
      MODULE_AUTHOR("Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>");
      MODULE_DESCRIPTION("mwait_check_and_back");
      MODULE_LICENSE("GPL");
      MODULE_VERSION();
      
      static int __init mwait_check_init(void)
      {
      	__monitor((void *)&current_thread_info()->flags, 0, 0);
      	__mwait(0, 0);
      	return 0;
      }
      static void __exit mwait_check_exit(void)
      {
      }
      module_init(mwait_check_init);
      module_exit(mwait_check_exit);
      Reported-by: NLiu, Jinsong <jinsong.liu@intel.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      df88b2d9
  4. 20 4月, 2012 3 次提交
  5. 19 4月, 2012 2 次提交
    • K
      xen/blkback: Fix warning error. · a71e23d9
      Konrad Rzeszutek Wilk 提交于
      drivers/block/xen-blkback/xenbus.c: In function 'xen_blkbk_discard':
      drivers/block/xen-blkback/xenbus.c:419:4: warning: passing argument 1 of 'dev_warn' makes pointer from integer without a cast
      +[enabled by default]
      include/linux/device.h:894:5: note: expected 'const struct device *' but argument is of type 'long int'
      
      It is unclear how that mistake made it in. It surely is wrong.
      Acked-by: NJens Axboe <axboe@kernel.dk>
      Reported-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      a71e23d9
    • K
      Merge commit 'c104f1fa' into stable/for-linus-3.4 · 681e4a5e
      Konrad Rzeszutek Wilk 提交于
      * commit 'c104f1fa': (14566 commits)
        cpufreq: OMAP: fix build errors: depends on ARCH_OMAP2PLUS
        sparc64: Eliminate obsolete __handle_softirq() function
        sparc64: Fix bootup crash on sun4v.
        kconfig: delete last traces of __enabled_ from autoconf.h
        Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols"
        kconfig: fix IS_ENABLED to not require all options to be defined
        irq_domain: fix type mismatch in debugfs output format
        staging: android: fix mem leaks in __persistent_ram_init()
        staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl()
        staging: iio: hmc5843: Fix crash in probe function.
        panic: fix stack dump print on direct call to panic()
        drivers/rtc/rtc-pl031.c: enable clock on all ST variants
        Revert "mm: vmscan: fix misused nr_reclaimed in shrink_mem_cgroup_zone()"
        hugetlb: fix race condition in hugetlb_fault()
        drivers/rtc/rtc-twl.c: use static register while reading time
        drivers/rtc/rtc-s3c.c: add placeholder for driver private data
        drivers/rtc/rtc-s3c.c: fix compilation error
        MAINTAINERS: add PCDP console maintainer
        memcg: do not open code accesses to res_counter members
        drivers/rtc/rtc-efi.c: fix section mismatch warning
        ...
      681e4a5e
  6. 18 4月, 2012 2 次提交
  7. 17 4月, 2012 1 次提交
  8. 14 4月, 2012 9 次提交
    • L
      Merge branch 'for-3.4/drivers' of git://git.kernel.dk/linux-block · c104f1fa
      Linus Torvalds 提交于
      Pull block driver bits from Jens Axboe:
      
       - A series of fixes for mtip32xx.  Most from Asai at Micron, but also
         one from Greg, getting rid of the dependency on PCIE_HOTPLUG.
      
       - A few bug fixes for xen-blkfront, and blkback.
      
       - A virtio-blk fix for Vivek, making resize actually work.
      
       - Two fixes from Stephen, making larger transfers possible on cciss.
         This is needed for tape drive support.
      
      * 'for-3.4/drivers' of git://git.kernel.dk/linux-block:
        block: mtip32xx: remove HOTPLUG_PCI_PCIE dependancy
        mtip32xx: dump tagmap on failure
        mtip32xx: fix handling of commands in various scenarios
        mtip32xx: Shorten macro names
        mtip32xx: misc changes
        mtip32xx: Add new sysfs entry 'status'
        mtip32xx: make setting comp_time as common
        mtip32xx: Add new bitwise flag 'dd_flag'
        mtip32xx: fix error handling in mtip_init()
        virtio-blk: Call revalidate_disk() upon online disk resize
        xen/blkback: Make optional features be really optional.
        xen/blkback: Squash the discard support for 'file' and 'phy' type.
        mtip32xx: fix incorrect value set for drv_cleanup_done, and re-initialize and start port in mtip_restart_port()
        cciss: Fix scsi tape io with more than 255 scatter gather elements
        cciss: Initialize scsi host max_sectors for tape drive support
        xen-blkfront: make blkif_io_lock spinlock per-device
        xen/blkfront: don't put bdev right after getting it
        xen-blkfront: use bitmap_set() and bitmap_clear()
        xen/blkback: Enable blkback on HVM guests
        xen/blkback: use grant-table.c hypercall wrappers
      c104f1fa
    • L
      Merge branch 'for-3.4/core' of git://git.kernel.dk/linux-block · d8dd0b6d
      Linus Torvalds 提交于
      Pull block core bits from Jens Axboe:
       "It's a nice and quiet round this time, since most of the tricky stuff
        has been pushed to 3.5 to give it more time to mature.  After a few
        hectic block IO core changes for 3.3 and 3.2, I'm quite happy with a
        slow round.
      
        Really minor stuff in here, the only real functional change is making
        the auto-unplug threshold a per-queue entity.  The threshold is set so
        that it's low enough that we don't hold off IO for too long, but still
        big enough to get a nice benefit from the batched insert (and hence
        queue lock cost reduction).  For raid configurations, this currently
        breaks down."
      
      * 'for-3.4/core' of git://git.kernel.dk/linux-block:
        block: make auto block plug flush threshold per-disk based
        Documentation: Add sysfs ABI change for cfq's target latency.
        block: Make cfq_target_latency tunable through sysfs.
        block: use lockdep_assert_held for queue locking
        block: blk_alloc_queue_node(): use caller's GFP flags instead of GFP_KERNEL
      d8dd0b6d
    • 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
    • L
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 7d93101f
      Linus Torvalds 提交于
      Pull sparc fixes from David Miller.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Eliminate obsolete __handle_softirq() function
        sparc64: Fix bootup crash on sun4v.
      7d93101f
    • L
      Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging · 6e117339
      Linus Torvalds 提交于
      Pull hwmon patches from Guenter Roeck:
       "Fix build warnings in four drivers"
      
      * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (pmbus_core) Fix compiler warning
        hwmon: (smsc47m1) Fix compiler warning
        hwmon: (acpi_power_meter) Fix compiler warning seen in some configurations
        hwmon: (smsc47b397) Fix compiler warning
      6e117339
    • L
      Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6 · 461c1491
      Linus Torvalds 提交于
      Pull GPIO bug fixes from Grant Likely:
       "Miscellaneous bug fixes to GPIO drivers and for a corner case in the
        gpio device tree parsing code."
      
      * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        gpio/exynos: Fix compiler warning in gpio-samsung.c file
        gpio: Fix range check in of_gpio_simple_xlate()
        gpio: Fix uninitialized variable bit in adp5588_irq_handler
        gpio/sodaville: Convert sodaville driver to new irqdomain API
      461c1491
    • L
      Merge tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6 · cf7d8a55
      Linus Torvalds 提交于
      Pull SPI bug fixes from Grant Likely:
       "Miscellaneous driver bug fixes.  No major changes in this branch."
      
      * tag 'spi-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        spi/imx: prevent NULL pointer dereference in spi_imx_probe()
        spi/imx: mark base member in spi_imx_data as __iomem
        spi/mpc83xx: fix NULL pdata dereference bug
        spi/davinci: Fix DMA API usage in davinci
        spi/pL022: include types.h to remove compilation warnings
      cf7d8a55
    • P
      sparc64: Eliminate obsolete __handle_softirq() function · 3d3eeb2e
      Paul E. McKenney 提交于
      The invocation of softirq is now handled by irq_exit(), so there is no
      need for sparc64 to invoke it on the trap-return path.  In fact, doing so
      is a bug because if the trap occurred in the idle loop, this invocation
      can result in lockdep-RCU failures.  The problem is that RCU ignores idle
      CPUs, and the sparc64 trap-return path to the softirq handlers fails to
      tell RCU that the CPU must be considered non-idle while those handlers
      are executing.  This means that RCU is ignoring any RCU read-side critical
      sections in those handlers, which in turn means that RCU-protected data
      can be yanked out from under those read-side critical sections.
      
      The shiny new lockdep-RCU ability to detect RCU read-side critical sections
      that RCU is ignoring located this problem.
      
      The fix is straightforward: Make sparc64 stop manually invoking the
      softirq handlers.
      Reported-by: NMeelis Roos <mroos@linux.ee>
      Suggested-by: NDavid Miller <davem@davemloft.net>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Tested-by: NMeelis Roos <mroos@linux.ee>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d3eeb2e
    • D
      sparc64: Fix bootup crash on sun4v. · 9e0daff3
      David S. Miller 提交于
      The DS driver registers as a subsys_initcall() but this can be too
      early, in particular this risks registering before we've had a chance
      to allocate and setup module_kset in kernel/params.c which is
      performed also as a subsyts_initcall().
      
      Register DS using device_initcall() insteal.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Cc: stable@vger.kernel.org
      9e0daff3
  9. 13 4月, 2012 15 次提交
    • L
      Merge tag 'srpt-srq-type' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband · 4166fb64
      Linus Torvalds 提交于
      Pull infiniband fix from Roland Dreier:
       "Add a fix for a bug hit by Alexey Shvetsov in ib_srtp that hits on
        non-mlx4 hardware."
      
      * tag 'srpt-srq-type' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
        IB/srpt: Set srq_type to IB_SRQT_BASIC
      4166fb64
    • P
      kconfig: delete last traces of __enabled_ from autoconf.h · e4757cab
      Paul Gortmaker 提交于
      We've now fixed IS_ENABLED() and friends to not require any special
      "__enabled_" prefixed versions of the normal Kconfig options, so delete
      the last traces of them being generated.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4757cab
    • P
      Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols" · a9596135
      Paul Gortmaker 提交于
      This reverts commit 953742c8.
      
      Dumping two lines into autoconf.h for all existing Kconfig options
      results in a giant file (~16k lines) we have to process each time we
      compile something.  We've weaned IS_ENABLED() and similar off of
      requiring the __enabled_ definitions so now we can revert the change
      which caused all the extra lines.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a9596135
    • P
      kconfig: fix IS_ENABLED to not require all options to be defined · 69349c2d
      Paul Gortmaker 提交于
      Using IS_ENABLED() within C (vs.  within CPP #if statements) in its
      current form requires us to actually define every possible bool/tristate
      Kconfig option twice (__enabled_* and __enabled_*_MODULE variants).
      
      This results in a huge autoconf.h file, on the order of 16k lines for a
      x86_64 defconfig.
      
      Fixing IS_ENABLED to be able to work on the smaller subset of just
      things that we really have defined is step one to fixing this.  Which
      means it has to not choke when fed non-enabled options, such as:
      
        include/linux/netdevice.h:964:1: warning: "__enabled_CONFIG_FCOE_MODULE" is not defined [-Wundef]
      
      The original prototype of how to implement a C and preprocessor
      compatible way of doing this came from the Google+ user "comex ." in
      response to Linus' crowdsourcing challenge for a possible improvement on
      his earlier C specific solution:
      
      	#define config_enabled(x)       (__stringify(x)[0] == '1')
      
      In this implementation, I've chosen variable names that hopefully make
      how it works more understandable.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      69349c2d
    • L
      Merge tag 'usb-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 7c427f45
      Linus Torvalds 提交于
      Pull USB fixes from Greg KH:
       "Here are a number of fixes for the USB core and drivers for 3.4-rc2
      
        Lots of tiny xhci fixes here, a few usb-serial driver fixes and new
        device ids, and a smattering of other minor fixes in different USB
        drivers.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'usb-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (30 commits)
        USB: update usbtmc api documentation
        xHCI: Correct the #define XHCI_LEGACY_DISABLE_SMI
        xHCI: use gfp flags from caller instead of GFP_ATOMIC
        xHCI: add XHCI_RESET_ON_RESUME quirk for VIA xHCI host
        USB: fix bug of device descriptor got from superspeed device
        xhci: Fix register save/restore order.
        xhci: Restore event ring dequeue pointer on resume.
        xhci: Don't write zeroed pointers to xHC registers.
        xhci: Warn when hosts don't halt.
        xhci: don't re-enable IE constantly
        usb: xhci: fix section mismatch in linux-next
        xHCI: correct to print the true HSEE of USBCMD
        USB: serial: fix race between probe and open
        UHCI: hub_status_data should indicate if ports are resuming
        EHCI: keep track of ports being resumed and indicate in hub_status_data
        USB: fix race between root-hub suspend and remote wakeup
        USB: sierra: add support for Sierra Wireless MC7710
        USB: ftdi_sio: fix race condition in TIOCMIWAIT, and abort of TIOCMIWAIT when the device is removed
        USB: ftdi_sio: fix status line change handling for TIOCMIWAIT and TIOCGICOUNT
        USB: don't ignore suspend errors for root hubs
        ...
      7c427f45
    • L
      Merge tag 'tty-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · f4f9c1ac
      Linus Torvalds 提交于
      Pull tty and serial fixes from Greg KH:
       "Here are some tty and serial fixes for 3.4-rc2.
      
        Most important here is the pl011 fix, which has been reported by about
        100 different people, which means more people use it than I expected
        :)
      
        There are also some 8250 driver reverts due to some problems reported
        by them.  And other minor fixes as well.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'tty-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        pch_uart: Add Kontron COMe-mTT10 uart clock quirk
        pch_uart: Fix MSI setting issue
        serial/8250_pci: add a "force background timer" flag and use it for the "kt" serial port
        Revert "serial/8250_pci: setup-quirk workaround for the kt serial controller"
        Revert "serial/8250_pci: init-quirk msi support for kt serial controller"
        tty/serial/omap: console can only be built-in
        serial: samsung: fix omission initialize ulcon in reset port fn()
        printk(): add KERN_CONT where needed in hpet and vt code
        tty/serial: atmel_serial: fix RS485 half-duplex problem
        tty: serial: altera_uart: Check for NULL platform_data in probe.
        isdn/gigaset: use gig_dbg() for debugging output
        omap-serial: Fix the error handling in the omap_serial probe
        serial: PL011: move interrupt clearing
      f4f9c1ac
    • L
      Merge tag 'staging-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 3dbc35a3
      Linus Torvalds 提交于
      Pull staging tree fixes from Greg KH:
       "Here are a number of bugfixes for the drivers/staging/ portion of the
        kernel that have been reported recently.
      
        Nothing major here, with maybe the exception of the ramster code can
        now be built so it is enabled in the build again, and lots of memory
        leaks that people like to have fixed on their systems.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'staging-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: android: fix mem leaks in __persistent_ram_init()
        staging: vt6656: Don't leak memory in drivers/staging/vt6656/ioctl.c::private_ioctl()
        staging: iio: hmc5843: Fix crash in probe function.
        staging/xgifb: fix display on XGI Volari Z11m cards
        Staging: android: timed_gpio: Fix resource leak in timed_gpio_probe error paths
        android: make persistent_ram based drivers depend on HAVE_MEMBLOCK
        staging: iio: ak8975: Remove i2c client data corruption
        staging: drm/omap: move where DMM driver is registered
        staging: zsmalloc: fix memory leak
        Staging: rts_pstor: off by one in for loop
        staging: ozwpan: Added new maintainer for ozwpan
        staging:rts_pstor:Avoid "Bad target number" message when probing driver
        staging:rts_pstor:Fix possible panic by NULL pointer dereference
        Staging: vt6655-6: check keysize before memcpy()
        staging/media/as102: Don't call release_firmware() on uninitialized variable
        staging:iio:core add missing increment of loop index in iio_map_array_unregister()
        staging: ramster: unbreak my heart
        staging/vme: Fix module parameters
        staging: sep: Fix sign of error
      3dbc35a3
    • L
      Merge tag 'driver-core-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core · f5ad5010
      Linus Torvalds 提交于
      Pull driver core and kobject fixes from Greg KH:
       "Here are some minor fixes for the driver core and kobjects that people
        have reported recently.
      
        Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
      
      * tag 'driver-core-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        kobject: provide more diagnostic info for kobject_add_internal() failures
        sysfs: handle 'parent deleted before child added'
        sysfs: Prevent crash on unset sysfs group attributes
        sysfs: Update the name hash for an entry after changing the namespace
        drivers/base: fix compiler warning in SoC export driver - idr should be ida
        drivers/base: Remove unneeded spin_lock_init call for soc_lock
      f5ad5010
    • L
      Merge tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6 · b3dfd76c
      Linus Torvalds 提交于
      Pull a fix for the recent irqdomain bug fixes from Grant Likely:
       "I flubbed one patch in the last pull request which broke a format
        string on 64 bit platforms.  Here's the fix."
      
      * tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux-2.6:
        irq_domain: fix type mismatch in debugfs output format
      b3dfd76c
    • G
      irq_domain: fix type mismatch in debugfs output format · 5269a9ab
      Grant Likely 提交于
      sizeof(void*) returns an unsigned long, but it was being used as a width parameter to a "%-*s" format string which requires an int.  On 64 bit platforms this causes a type mismatch:
      
          linux/kernel/irq/irqdomain.c:575: warning: field width should have type
          'int', but argument 6 has type 'long unsigned int'
      
      This change casts the size to an int so printf gets the right data type.
      Reported-by: NAndreas Schwab <schwab@linux-m68k.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: David Daney <david.daney@cavium.com>
      5269a9ab
    • L
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9b1ef1de
      Linus Torvalds 提交于
      Pull trivial perf build failure fix from Thomas Gleixner.
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf tools: Fix getrusage() related build failure on glibc trunk
      9b1ef1de
    • L
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ccb1ec95
      Linus Torvalds 提交于
      Pull timer fixes from Thomas Gleixner:
       "The itimer removal one is not strictly a fix, but I really wanted to
        avoid a rebase of the urgent ones."
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Revert "clocksource: Load the ACPI PM clocksource asynchronously"
        clockevents: tTack broadcast device mode change in tick_broadcast_switch_to_oneshot()
        itimer: Use printk_once instead of WARN_ONCE
        nohz: Fix stale jiffies update in tick_nohz_restart()
        tick: Document TICK_ONESHOT config option
        proc: stats: Use arch_idle_time for idle and iowait times if available
        itimer: Schedule silent NULL pointer fixup in setitimer() for removal
      ccb1ec95
    • L
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4a1d7544
      Linus Torvalds 提交于
      Pull x86 fixes from Thomas Gleixner.
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86: Use correct byte-sized register constraint in __add()
        x86: Use correct byte-sized register constraint in __xchg_op()
        x86: vsyscall: Use NULL instead 0 for a pointer argument
      4a1d7544
    • 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