1. 07 May, 2012 12 commits
    • Daniel Vetter's avatar
      drm/i915: handle input/output sdvo timings separately in mode_set · 8c9def92
      Daniel Vetter authored
      commit 6651819b upstream.
      
      We seem to have a decent confusion between the output timings and the
      input timings of the sdvo encoder. If I understand the code correctly,
      we use the original mode unchanged for the output timings, safe for
      the lvds case. And we should use the adjusted mode for input timings.
      
      Clarify the situation by adding an explicit output_dtd to the sdvo
      mode_set function and streamline the code-flow by moving the input and
      output mode setting in the sdvo encode together.
      
      Furthermore testing showed that the sdvo input timing needs the
      unadjusted dotclock, the sdvo chip will automatically compute the
      required pixel multiplier to get a dotclock above 100 MHz.
      
      Fix this up when converting a drm mode to an sdvo dtd.
      
      This regression was introduced in
      
      commit c74696b9
      Author: Pavel Roskin <proski@gnu.org>
      Date:   Thu Sep 2 14:46:34 2010 -0400
      
          i915: revert some checks added by commit 32aad86f
      
      particularly the following hunk:
      
      #	diff --git a/drivers/gpu/drm/i915/intel_sdvo.c
      #	b/drivers/gpu/drm/i915/intel_sdvo.c
      #	index 093e914..62d22ae 100644
      #	--- a/drivers/gpu/drm/i915/intel_sdvo.c
      #	+++ b/drivers/gpu/drm/i915/intel_sdvo.c
      #	@@ -1122,11 +1123,9 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder,
      #
      #	     /* We have tried to get input timing in mode_fixup, and filled into
      #		adjusted_mode */
      #	-    if (intel_sdvo->is_tv || intel_sdvo->is_lvds) {
      #	-        intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
      #	+    intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode);
      #	+    if (intel_sdvo->is_tv || intel_sdvo->is_lvds)
      #		 input_dtd.part2.sdvo_flags = intel_sdvo->sdvo_flags;
      #	-    } else
      #	-        intel_sdvo_get_dtd_from_mode(&input_dtd, mode);
      #
      #	     /* If it's a TV, we already set the output timing in mode_fixup.
      #	      * Otherwise, the output timing is equal to the input timing.
      
      Due to questions raised in review, below a more elaborate analysis of
      the bug at hand:
      
      Sdvo seems to have two timings, one is the output timing which will be
      sent over whatever is connected on the other side of the sdvo chip (panel,
      hdmi screen, tv), the other is the input timing which will be generated by
      the gmch pipe. It looks like sdvo is expected to scale between the two.
      
      To make things slightly more complicated, we have a bunch of special
      cases:
      - For lvds panel we always use a fixed output timing, namely
        intel_sdvo->sdvo_lvds_fixed_mode, hence that special case.
      - Sdvo has an interface to generate a preferred input timing for a given
        output timing. This is the confusing thing that I've tried to clear up
        with the follow-on patches.
      - A special requirement is that the input pixel clock needs to be between
        100MHz and 200MHz (likely to keep it within the electromechanical design
        range of PCIe), 270MHz on later gen4+. Lower pixel clocks are
        doubled/quadrupled.
      
      The thing this patch tries to fix is that the pipe needs to be
      explicitly instructed to double/quadruple the pixels and needs the
      correspondingly higher pixel clock, whereas the sdvo adaptor seems to
      do that itself and needs the unadjusted pixel clock. For the sdvo
      encode side we already set the pixel mutliplier with a different
      command (0x21).
      
      This patch tries to fix this mess by:
      - Keeping the output mode timing in the unadjusted plain mode, safe
        for the lvds case.
      - Storing the input timing in the adjusted_mode with the adjusted
        pixel clock. This way we don't need to frob around with the core
        crtc mode set code.
      - Fixing up the pixelclock when constructing the sdvo dtd timing
        struct. This is why the first hunk of the patch is an integral part
        of the series.
      - Dropping the is_tv special case because input_dtd is equivalent to
        adjusted_mode after these changes. Follow-up patches clear this up
        further (by simply ripping out intel_sdvo->input_dtd because it's
        not needed).
      
      v2: Extend commit message with an in-depth bug analysis.
      Reported-and-Tested-by: default avatarBernard Blackham <b-linuxgit@largestprime.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48157Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8c9def92
    • Guenter Roeck's avatar
      hwmon: (fam15h_power) Fix pci_device_id array · 893127e4
      Guenter Roeck authored
      commit c3e40a99 upstream.
      
      pci_match_id() takes an *array* of IDs which must be properly zero-
      terminated.
      Reported-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
      Acked-by: default avatarJean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      893127e4
    • Andre Przywara's avatar
      hwmon: fam15h_power: fix bogus values with current BIOSes · 7d841e23
      Andre Przywara authored
      commit 00250ec9 upstream.
      
      Newer BKDG[1] versions recommend a different initialization value for
      the running average range register in the northbridge. This improves
      the power reading by avoiding counter saturations resulting in bogus
      values for anything below about 80% of TDP power consumption.
      Updated BIOSes will have this new value set up from the beginning,
      but meanwhile we correct this value ourselves.
      This needs to be done on all northbridges, even on those where the
      driver itself does not register at.
      
      This fixes the driver on all current machines to provide proper
      values for idle load.
      
      [1]
      http://support.amd.com/us/Processor_TechDocs/42301_15h_Mod_00h-0Fh_BKDG.pdf
      Chapter 3.8: D18F5xE0 Processor TDP Running Average (p. 452)
      Signed-off-by: default avatarAndre Przywara <andre.przywara@amd.com>
      Acked-by: default avatarJean Delvare <khali@linux-fr.org>
      [guenter.roeck@ericsson.com: Removed unnecessary return statement]
      Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7d841e23
    • Nicolas Ferre's avatar
      dmaengine: at_hdmac: remove clear-on-read in atc_dostart() · 17a766de
      Nicolas Ferre authored
      commit ed8b0d67 upstream.
      
      This loop on EBCISR register was designed to clear IRQ sources before enabling
      a DMA channel. This register is clear-on-read so a race condition can appear if
      another channel is already active and has just finished its transfer.
      Removing this read on EBCISR is fixing the issue as there is no case where an IRQ
      could be pending: we already make sure that this register is drained at probe()
      time and during resume.
      Signed-off-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17a766de
    • Mark Brown's avatar
      ASoC: dapm: Ensure power gets managed for line widgets · 7a474629
      Mark Brown authored
      commit 7e1f7c8a upstream.
      
      Line widgets had not been included in either the power up or power down
      sequences so if a widget had an event associated with it that event would
      never be run. Fix this minimally by adding them to the sequences, we
      should probably be doing away with the specific widget types as they all
      have the same priority anyway.
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7a474629
    • Konrad Rzeszutek Wilk's avatar
      xen/smp: Fix crash when booting with ACPI hotplug CPUs. · 5b094710
      Konrad Rzeszutek Wilk authored
      commit cf405ae6 upstream.
      
      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.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5b094710
    • David Vrabel's avatar
      xen: correctly check for pending events when restoring irq flags · aa4a6ac6
      David Vrabel authored
      commit 7eb7ce4d upstream.
      
      In xen_restore_fl_direct(), xen_force_evtchn_callback() was being
      called even if no events were pending.  This resulted in (depending on
      workload) about a 100 times as many xen_version hypercalls as
      necessary.
      
      Fix this by correcting the sense of the conditional jump.
      
      This seems to give a significant performance benefit for some
      workloads.
      
      There is some subtle tricksy "..since the check here is trying to
      check both pending and masked in a single cmpw, but I think this is
      correct. It will call check_events now only when the combined
      mask+pending word is 0x0001 (aka unmasked, pending)." (Ian)
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aa4a6ac6
    • Linus Torvalds's avatar
      Revert "autofs: work around unhappy compat problem on x86-64" · d25895e8
      Linus Torvalds authored
      commit fcbf94b9 upstream.
      
      This reverts commit a32744d4.
      
      While that commit was technically the right thing to do, and made the
      x86-64 compat mode work identically to native 32-bit mode (and thus
      fixing the problem with a 32-bit systemd install on a 64-bit kernel), it
      turns out that the automount binaries had workarounds for this compat
      problem.
      
      Now, the workarounds are disgusting: doing an "uname()" to find out the
      architecture of the kernel, and then comparing it for the 64-bit cases
      and fixing up the size of the read() in automount for those.  And they
      were confused: it's not actually a generic 64-bit issue at all, it's
      very much tied to just x86-64, which has different alignment for an
      'u64' in 64-bit mode than in 32-bit mode.
      
      But the end result is that fixing the compat layer actually breaks the
      case of a 32-bit automount on a x86-64 kernel.
      
      There are various approaches to fix this (including just doing a
      "strcmp()" on current->comm and comparing it to "automount"), but I
      think that I will do the one that teaches pipes about a special "packet
      mode", which will allow user space to not have to care too deeply about
      the padding at the end of the autofs packet.
      
      That change will make the compat workaround unnecessary, so let's revert
      it first, and get automount working again in compat mode.  The
      packetized pipes will then fix autofs for systemd.
      Reported-and-requested-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Cc: Ian Kent <raven@themaw.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d25895e8
    • Bryan O'Donoghue's avatar
      x86, apic: APIC code touches invalid MSR on P5 class machines · 322fd620
      Bryan O'Donoghue authored
      commit cbf2829b upstream.
      
      Current APIC code assumes MSR_IA32_APICBASE is present for all systems.
      Pentium Classic P5 and friends didn't have this MSR. MSR_IA32_APICBASE
      was introduced as an architectural MSR by Intel @ P6.
      
      Code paths that can touch this MSR invalidly are when vendor == Intel &&
      cpu-family == 5 and APIC bit is set in CPUID - or when you simply pass
      lapic on the kernel command line, on a P5.
      
      The below patch stops Linux incorrectly interfering with the
      MSR_IA32_APICBASE for P5 class machines. Other code paths exist that
      touch the MSR - however those paths are not currently reachable for a
      conformant P5.
      Signed-off-by: default avatarBryan O'Donoghue <bryan.odonoghue@linux.intel.com>
      Link: http://lkml.kernel.org/r/4F8EEDD3.1080404@linux.intel.comSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      322fd620
    • Trond Myklebust's avatar
      NFSv4: Ensure that we check lock exclusive/shared type against open modes · 95cb2c60
      Trond Myklebust authored
      commit 55725513 upstream.
      
      Since we may be simulating flock() locks using NFS byte range locks,
      we can't rely on the VFS having checked the file open mode for us.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95cb2c60
    • Trond Myklebust's avatar
      NFSv4: Ensure that the LOCK code sets exception->inode · 03a9f194
      Trond Myklebust authored
      commit 05ffe24f upstream.
      
      All callers of nfs4_handle_exception() that need to handle
      NFS4ERR_OPENMODE correctly should set exception->inode
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      03a9f194
    • Jan Kara's avatar
      nfs: Enclose hostname in brackets when needed in nfs_do_root_mount · cb2fee32
      Jan Kara authored
      commit 98a2139f upstream.
      
      When hostname contains colon (e.g. when it is an IPv6 address) it needs
      to be enclosed in brackets to make parsing of NFS device string possible.
      Fix nfs_do_root_mount() to enclose hostname properly when needed. NFS code
      actually does not need this as it does not parse the string passed by
      nfs_do_root_mount() but the device string is exposed to userspace in
      /proc/mounts.
      
      CC: Josh Boyer <jwboyer@redhat.com>
      CC: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb2fee32
  2. 27 Apr, 2012 28 commits