1. 16 Oct, 2011 24 commits
    • Alex Deucher's avatar
      drm/radeon/kms: retry aux transactions if there are status flags · 3450eab7
      Alex Deucher authored
      commit 4f332844 upstream.
      
      If there are error flags in the aux status, retry the transaction.
      This makes aux much more reliable, especially on llano systems.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3450eab7
    • srinidhi kasagar's avatar
      ARM: mach-ux500: enable fix for ARM errata 754322 · 33ab02d4
      srinidhi kasagar authored
      commit 98e87d57 upstream.
      
      This applies ARM errata fix 754322 for all ux500 platforms.
      Signed-off-by: default avatarsrinidhi kasagar <srinidhi.kasagar@stericsson.com>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      33ab02d4
    • Tetsuo Handa's avatar
      exec: do not call request_module() twice from search_binary_handler() · 2b7eea63
      Tetsuo Handa authored
      commit 91219352 upstream.
      
      Currently, search_binary_handler() tries to load binary loader module
      using request_module() if a loader for the requested program is not yet
      loaded.  But second attempt of request_module() does not affect the result
      of search_binary_handler().
      
      If request_module() triggered recursion, calling request_module() twice
      causes 2 to the power of MAX_KMOD_CONCURRENT (= 50) repetitions.  It is
      not an infinite loop but is sufficient for users to consider as a hang up.
      
      Therefore, this patch changes not to call request_module() twice, making 1
      to the power of MAX_KMOD_CONCURRENT repetitions in case of recursion.
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reported-by: default avatarRichard Weinberger <richard@nod.at>
      Tested-by: default avatarRichard Weinberger <richard@nod.at>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Cc: Maxim Uvarov <muvarov@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2b7eea63
    • Koen Beel's avatar
      mmc: mxs-mmc: fix clock rate setting · 6770fa9b
      Koen Beel authored
      commit d982dcdc upstream.
      
      Fix clock rate setting in the mxs-mmc driver. Previously, if div2 was 0
      then the value for TIMING_CLOCK_RATE would have been 255 instead of 0.
      The limits for div1 (TIMING_CLOCK_DIVIDE) and div2 (TIMING_CLOCK_RATE+1)
      were also not correctly defined.
      
      Can easily be reproduced on mx23evk: default clock for high speed sdio
      cards is 50 MHz. With a SSP_CLK of 28.8 MHz default), this resulted in
      an actual clock rate of about 56 kHz.  Tested on mx23evk.
      Signed-off-by: default avatarKoen Beel <koen.beel@barco.com>
      Reviewed-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      6770fa9b
    • Mike Snitzer's avatar
      dm table: avoid crash if integrity profile changes · 25dd1546
      Mike Snitzer authored
      commit 876fbba1 upstream.
      
      Commit a63a5cf8 (dm: improve block integrity support) introduced a
      two-phase initialization of a DM device's integrity profile.  This
      patch avoids dereferencing a NULL 'template_disk' pointer in
      blk_integrity_register() if there is an integrity profile mismatch in
      dm_table_set_integrity().
      
      This can occur if the integrity profiles for stacked devices in a DM
      table are changed between the call to dm_table_prealloc_integrity() and
      dm_table_set_integrity().
      Reported-by: default avatarZdenek Kabelac <zkabelac@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      25dd1546
    • NeilBrown's avatar
      md: Avoid waking up a thread after it has been freed. · 7f3b5ef8
      NeilBrown authored
      commit 01f96c0a upstream.
      
      Two related problems:
      
      1/ some error paths call "md_unregister_thread(mddev->thread)"
         without subsequently clearing ->thread.  A subsequent call
         to mddev_unlock will try to wake the thread, and crash.
      
      2/ Most calls to md_wakeup_thread are protected against the thread
         disappeared either by:
            - holding the ->mutex
            - having an active request, so something else must be keeping
              the array active.
         However mddev_unlock calls md_wakeup_thread after dropping the
         mutex and without any certainty of an active request, so the
         ->thread could theoretically disappear.
         So we need a spinlock to provide some protections.
      
      So change md_unregister_thread to take a pointer to the thread
      pointer, and ensure that it always does the required locking, and
      clears the pointer properly.
      Reported-by: default avatar"Moshe Melnikov" <moshe@zadarastorage.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7f3b5ef8
    • Mark Salyzyn's avatar
      libsas: fix panic when single phy is disabled on a wide port · 57fb87f0
      Mark Salyzyn authored
      commit a73914c3 upstream.
      
      When a wide port is being utilized to a target, if one disables only one
      of the
      phys, we get an OS crash:
      
      BUG: unable to handle kernel NULL pointer dereference at
      0000000000000238
      IP: [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
      PGD 4103f5067 PUD 41dba9067 PMD 0
      Oops: 0002 [#1] SMP
      last sysfs file: /sys/bus/pci/slots/5/address
      CPU 0
      Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
      ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl
      auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt
      llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom
      dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt
      iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3
      jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix
      libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
      
      Modules linked in: pm8001(U) ses enclosure fuse nfsd exportfs autofs4
      ipmi_devintf ipmi_si ipmi_msghandler nfs lockd fscache nfs_acl
      auth_rpcgss 8021q fcoe libfcoe garp libfc scsi_transport_fc stp scsi_tgt
      llc sunrpc cpufreq_ondemand acpi_cpufreq freq_table ipv6 sr_mod cdrom
      dm_mirror dm_region_hash dm_log uinput sg i2c_i801 i2c_core iTCO_wdt
      iTCO_vendor_support e1000e mlx4_ib ib_mad ib_core mlx4_en mlx4_core ext3
      jbd mbcache sd_mod crc_t10dif usb_storage ata_generic pata_acpi ata_piix
      libsas(U) scsi_transport_sas dm_mod [last unloaded: pm8001]
      Pid: 5146, comm: scsi_wq_5 Not tainted
      2.6.32-71.29.1.el6.lustre.7.x86_64 #1 Storage Server
      RIP: 0010:[<ffffffff814ca9b1>]  [<ffffffff814ca9b1>]
      mutex_lock+0x21/0x50
      RSP: 0018:ffff8803e4e33d30  EFLAGS: 00010246
      RAX: 0000000000000000 RBX: 0000000000000238 RCX: 0000000000000000
      RDX: 0000000000000000 RSI: ffff8803e664c800 RDI: 0000000000000238
      RBP: ffff8803e4e33d40 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
      R13: 0000000000000238 R14: ffff88041acb7200 R15: ffff88041c51ada0
      FS:  0000000000000000(0000) GS:ffff880028200000(0000)
      knlGS:0000000000000000
      CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
      CR2: 0000000000000238 CR3: 0000000410143000 CR4: 00000000000006f0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process scsi_wq_5 (pid: 5146, threadinfo ffff8803e4e32000, task
      ffff8803e4e294a0)
      Stack:
       ffff8803e664c800 0000000000000000 ffff8803e4e33d70 ffffffffa001f06e
      <0> ffff8803e4e33d60 ffff88041c51ada0 ffff88041acb7200 ffff88041bc0aa00
      <0> ffff8803e4e33d90 ffffffffa0032b6c 0000000000000014 ffff88041acb7200
      Call Trace:
       [<ffffffffa001f06e>] sas_port_delete_phy+0x2e/0xa0 [scsi_transport_sas]
       [<ffffffffa0032b6c>] sas_unregister_devs_sas_addr+0xac/0xe0 [libsas]
       [<ffffffffa0034914>] sas_ex_revalidate_domain+0x204/0x330 [libsas]
       [<ffffffffa00307f0>] ? sas_revalidate_domain+0x0/0x90 [libsas]
       [<ffffffffa0030855>] sas_revalidate_domain+0x65/0x90 [libsas]
       [<ffffffff8108c7d0>] worker_thread+0x170/0x2a0
       [<ffffffff81091ea0>] ? autoremove_wake_function+0x0/0x40
       [<ffffffff8108c660>] ? worker_thread+0x0/0x2a0
       [<ffffffff81091b36>] kthread+0x96/0xa0
       [<ffffffff810141ca>] child_rip+0xa/0x20
       [<ffffffff81091aa0>] ? kthread+0x0/0xa0
       [<ffffffff810141c0>] ? child_rip+0x0/0x20
      Code: ff ff 85 c0 75 ed eb d6 66 90 55 48 89 e5 48 83 ec 10 48 89 1c 24
      4c 89 64 24 08 0f 1f 44 00 00 48 89 fb e8 92 f4 ff ff 48 89 df <f0> ff
      0f 79 05 e8 25 00 00 00 65 48 8b 04 25 08 cc 00 00 48 2d
      RIP  [<ffffffff814ca9b1>] mutex_lock+0x21/0x50
       RSP <ffff8803e4e33d30>
      CR2: 0000000000000238
      
      The following patch is admittedly a band-aid, and does not solve the
      root cause, but it still is a good candidate for hardening as a pointer
      check before reference.
      Signed-off-by: default avatarMark Salyzyn <mark_salyzyn@us.xyratex.com>
      Tested-by: default avatarJack Wang <jack_wang@usish.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      57fb87f0
    • Roland Dreier's avatar
      qla2xxx: Fix crash in qla2x00_abort_all_cmds() on unload · afcb5001
      Roland Dreier authored
      commit 9bfacd01 upstream.
      
      I hit a crash in qla2x00_abort_all_cmds() if the qla2xxx module is
      unloaded right after it is loaded.  I debugged this down to the abort
      handling improperly treating a command of type SRB_ADISC_CMD as if it
      had a bsg_job to complete when that command actually uses the iocb_cmd
      part of the union.  (I guess to hit this one has to unload the module
      while the async FC initialization is still in progress)
      
      It seems we should only look for a bsg_job if type is SRB_ELS_CMD_RPT,
      SRB_ELS_CMD_HST or SRB_CT_CMD, so switch the test to make that explicit.
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Acked-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      afcb5001
    • Paul Menzel's avatar
      x86/PCI: use host bridge _CRS info on ASUS M2V-MX SE · 36f1ce1f
      Paul Menzel authored
      commit 29cf7a30 upstream.
      
      In summary, this DMI quirk uses the _CRS info by default for the ASUS
      M2V-MX SE by turning on `pci=use_crs` and is similar to the quirk
      added by commit 2491762c ("x86/PCI: use host bridge _CRS info on
      ASRock ALiveSATA2-GLAN") whose commit message should be read for further
      information.
      
      Since commit 3e3da00c ("x86/pci: AMD one chain system to use pci
      read out res") Linux gives the following oops:
      
          parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]
          HDA Intel 0000:20:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
          HDA Intel 0000:20:01.0: setting latency timer to 64
          BUG: unable to handle kernel paging request at ffffc90011c08000
          IP: [<ffffffffa0578402>] azx_probe+0x3ad/0x86b [snd_hda_intel]
          PGD 13781a067 PUD 13781b067 PMD 1300ba067 PTE 800000fd00000173
          Oops: 0009 [#1] SMP
          last sysfs file: /sys/module/snd_pcm/initstate
          CPU 0
          Modules linked in: snd_hda_intel(+) snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event tpm_tis tpm snd_seq tpm_bios psmouse parport_pc snd_timer snd_seq_device parport processor evdev snd i2c_viapro thermal_sys amd64_edac_mod k8temp i2c_core soundcore shpchp pcspkr serio_raw asus_atk0110 pci_hotplug edac_core button snd_page_alloc edac_mce_amd ext3 jbd mbcache sha256_generic cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod raid1 md_mod usbhid hid sg sd_mod crc_t10dif sr_mod cdrom ata_generic uhci_hcd sata_via pata_via libata ehci_hcd usbcore scsi_mod via_rhine mii nls_base [last unloaded: scsi_wait_scan]
          Pid: 1153, comm: work_for_cpu Not tainted 2.6.37-1-amd64 #1 M2V-MX SE/System Product Name
          RIP: 0010:[<ffffffffa0578402>]  [<ffffffffa0578402>] azx_probe+0x3ad/0x86b [snd_hda_intel]
          RSP: 0018:ffff88013153fe50  EFLAGS: 00010286
          RAX: ffffc90011c08000 RBX: ffff88013029ec00 RCX: 0000000000000006
          RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000246
          RBP: ffff88013341d000 R08: 0000000000000000 R09: 0000000000000040
          R10: 0000000000000286 R11: 0000000000003731 R12: ffff88013029c400
          R13: 0000000000000000 R14: 0000000000000000 R15: ffff88013341d090
          FS:  0000000000000000(0000) GS:ffff8800bfc00000(0000) knlGS:00000000f7610ab0
          CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
          CR2: ffffc90011c08000 CR3: 0000000132f57000 CR4: 00000000000006f0
          DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
          DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
          Process work_for_cpu (pid: 1153, threadinfo ffff88013153e000, task ffff8801303c86c0)
          Stack:
           0000000000000005 ffffffff8123ad65 00000000000136c0 ffff88013029c400
           ffff8801303c8998 ffff88013341d000 ffff88013341d090 ffff8801322d9dc8
           ffff88013341d208 0000000000000000 0000000000000000 ffffffff811ad232
          Call Trace:
           [<ffffffff8123ad65>] ? __pm_runtime_set_status+0x162/0x186
           [<ffffffff811ad232>] ? local_pci_probe+0x49/0x92
           [<ffffffff8105afc5>] ? do_work_for_cpu+0x0/0x1b
           [<ffffffff8105afc5>] ? do_work_for_cpu+0x0/0x1b
           [<ffffffff8105afd0>] ? do_work_for_cpu+0xb/0x1b
           [<ffffffff8105fd3f>] ? kthread+0x7a/0x82
           [<ffffffff8100a824>] ? kernel_thread_helper+0x4/0x10
           [<ffffffff8105fcc5>] ? kthread+0x0/0x82
           [<ffffffff8100a820>] ? kernel_thread_helper+0x0/0x10
          Code: f4 01 00 00 ef 31 f6 48 89 df e8 29 dd ff ff 85 c0 0f 88 2b 03 00 00 48 89 ef e8 b4 39 c3 e0 8b 7b 40 e8 fc 9d b1 e0 48 8b 43 38 <66> 8b 10 66 89 14 24 8b 43 14 83 e8 03 83 f8 01 77 32 31 d2 be
          RIP  [<ffffffffa0578402>] azx_probe+0x3ad/0x86b [snd_hda_intel]
           RSP <ffff88013153fe50>
          CR2: ffffc90011c08000
          ---[ end trace 8d1f3ebc136437fd ]---
      
      Trusting the ACPI _CRS information (`pci=use_crs`) fixes this problem.
      
          $ dmesg | grep -i crs # with the quirk
          PCI: Using host bridge windows from ACPI; if necessary, use "pci=nocrs" and report a bug
      
      The match has to be against the DMI board entries though since the vendor entries are not populated.
      
          DMI: System manufacturer System Product Name/M2V-MX SE, BIOS 0304    10/30/2007
      
      This quirk should be removed when `pci=use_crs` is enabled for machines
      from 2006 or earlier or some other solution is implemented.
      
      Using coreboot [1] with this board the problem does not exist but this
      quirk also does not affect it either. To be safe though the check is
      tightened to only take effect when the BIOS from American Megatrends is
      used.
      
              15:13 < ruik> but coreboot does not need that
              15:13 < ruik> because i have there only one root bus
              15:13 < ruik> the audio is behind a bridge
      
              $ sudo dmidecode
              BIOS Information
                      Vendor: American Megatrends Inc.
                      Version: 0304
                      Release Date: 10/30/2007
      
      [1] http://www.coreboot.org/
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=30552
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: x86@kernel.org
      Signed-off-by: default avatarPaul Menzel <paulepanter@users.sourceforge.net>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Acked-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      36f1ce1f
    • Gertjan van Wingerde's avatar
      rt2x00: Serialize TX operations on a queue. · 8a60d75b
      Gertjan van Wingerde authored
      commit 77a861c4 upstream.
      
      The rt2x00 driver gets frequent occurrences of the following error message
      when operating under load:
      phy0 -> rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the
      non-full queue 2.
      
      This is caused by simultaneous attempts from mac80211 to send a frame via
      rt2x00, which are not properly serialized inside rt2x00queue_write_tx_frame,
      causing the second frame to fail sending with the above mentioned error
      message.
      
      Fix this by introducing a per-queue spinlock to serialize the TX operations
      on that queue.
      Reported-by: default avatarAndreas Hartmann <andihartmann@01019freenet.de>
      Signed-off-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
      Acked-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      Cc: Tim Gardner <tim.gardner@canonical.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      8a60d75b
    • Richard Cochran's avatar
      ptp: fix L2 event message recognition · a94a36c3
      Richard Cochran authored
      commit f75159e9 upstream.
      
      The IEEE 1588 standard defines two kinds of messages, event and general
      messages. Event messages require time stamping, and general do not. When
      using UDP transport, two separate ports are used for the two message
      types.
      
      The BPF designed to recognize event messages incorrectly classifies L2
      general messages as event messages. This commit fixes the issue by
      extending the filter to check the message type field for L2 PTP packets.
      Event messages are be distinguished from general messages by testing
      the "general" bit.
      Signed-off-by: default avatarRichard Cochran <richard.cochran@omicron.at>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a94a36c3
    • Alex Deucher's avatar
      drm/radeon/kms: fix channel_remap setup (v2) · 416a1b04
      Alex Deucher authored
      commit 12d5180b upstream.
      
      Most asics just use the hw default value which requires
      no explicit programming.  For those that need a different
      value, the vbios will program it properly.  As such,
      there's no need to program these registers explicitly
      in the driver.  Changing MC_SHARED_CHREMAP requires a reload
      of all data in vram otherwise its contents will be scambled.
      
      Fixes:
      https://bugs.freedesktop.org/show_bug.cgi?id=40103
      
      v2: drop now unused channel_remap functions.
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      416a1b04
    • Alex Deucher's avatar
      drm/radeon/kms: add retry limits for native DP aux defer · c6e2e6ab
      Alex Deucher authored
      commit 6375bda0 upstream.
      
      The previous code could potentially loop forever.  Limit
      the number of DP aux defer retries to 4 for native aux
      transactions, same as i2c over aux transactions.
      
      Noticed by: Brad Campbell <lists2009@fnarfbargle.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: Brad Campbell <lists2009@fnarfbargle.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      c6e2e6ab
    • Alex Deucher's avatar
      drm/radeon/kms: fix regression in DP aux defer handling · 29077130
      Alex Deucher authored
      commit 109bc10d upstream.
      
      An incorrect ordering in the error checking code lead
      to DP aux defer being skipped in the aux native write
      path.  Move the bytes transferred check (ret == 0)
      below the defer check.
      
      Tracked down by: Brad Campbell <brad@fnarfbargle.com>
      
      Fixes:
      https://bugs.freedesktop.org/show_bug.cgi?id=41121Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: Brad Campbell <brad@fnarfbargle.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      29077130
    • Alex Deucher's avatar
      drm/radeon/kms: Fix logic error in DP HPD handler · 23882c85
      Alex Deucher authored
      commit 5ba7ddf8 upstream.
      
      Only disable the pipe if the monitor is physically
      disconnected.  The previous logic also disabled the
      pipe if the link was trained.
      
      Fixes:
      https://bugs.freedesktop.org/show_bug.cgi?id=41248Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      23882c85
    • Michel Dänzer's avatar
      drm/radeon: Update AVIVO cursor coordinate origin before x/yorigin calculation. · 1a795f75
      Michel Dänzer authored
      commit b8aee294 upstream.
      
      Fixes cursor disappearing prematurely when moving off a top/left edge which
      is not located at the desktop top/left edge.
      Signed-off-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      1a795f75
    • Axel Lin's avatar
      ASoC: Fix setting update bits for WM8753_LADC and WM8753_RADC · a671258d
      Axel Lin authored
      commit 21d17dd2 upstream.
      
      Current code set update bits for WM8753_LDAC and WM8753_RDAC twice,
      but missed setting update bits for WM8753_LADC and WM8753_RADC.
      
      I think it is a copy-paste bug in commit 776065
      "ASoC: codecs: wm8753: Fix register cache incoherency".
      Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      a671258d
    • Arnd Bergmann's avatar
      ASoC: use a valid device for dev_err() in Zylonite · 4f2b7b91
      Arnd Bergmann authored
      commit eff919ac upstream.
      
      A recent conversion has introduced references to &pdev->dev, which does
      not actually exist in all the contexts it's used in.
      
      Replace this with card->dev where necessary, in order to let
      the driver build again.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4f2b7b91
    • Takashi Iwai's avatar
      lis3: fix regression of HP DriveGuard with 8bit chip · d694ac34
      Takashi Iwai authored
      commit 05faadcf upstream.
      
      Commit 2a7fade7 ("hwmon: lis3: Power on corrections") caused a
      regression on HP laptops with 8bit chip.  Writing CTRL2_BOOT_8B bit seems
      clearing the BIOS setup, and no proper interrupt for DriveGuard will be
      triggered any more.
      
      Since the init code there is basically only for embedded devices, put a
      pdata check so that the problematic initialization will be skipped for
      hp_accel stuff.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Cc: Eric Piel <eric.piel@tremplin-utc.net>
      Cc: Samu Onkalo <samu.p.onkalo@nokia.com>
      Signed-off-by: default avatarAndrew Morton <akpm@google.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      d694ac34
    • Peter Zijlstra's avatar
      posix-cpu-timers: Cure SMP wobbles · 249cf808
      Peter Zijlstra authored
      commit d670ec13 upstream.
      
      David reported:
      
        Attached below is a watered-down version of rt/tst-cpuclock2.c from
        GLIBC.  Just build it with "gcc -o test test.c -lpthread -lrt" or
        similar.
      
        Run it several times, and you will see cases where the main thread
        will measure a process clock difference before and after the nanosleep
        which is smaller than the cpu-burner thread's individual thread clock
        difference.  This doesn't make any sense since the cpu-burner thread
        is part of the top-level process's thread group.
      
        I've reproduced this on both x86-64 and sparc64 (using both 32-bit and
        64-bit binaries).
      
        For example:
      
        [davem@boricha build-x86_64-linux]$ ./test
        process: before(0.001221967) after(0.498624371) diff(497402404)
        thread:  before(0.000081692) after(0.498316431) diff(498234739)
        self:    before(0.001223521) after(0.001240219) diff(16698)
        [davem@boricha build-x86_64-linux]$
      
        The diff of 'process' should always be >= the diff of 'thread'.
      
        I make sure to wrap the 'thread' clock measurements the most tightly
        around the nanosleep() call, and that the 'process' clock measurements
        are the outer-most ones.
      
        ---
        #include <unistd.h>
        #include <stdio.h>
        #include <stdlib.h>
        #include <time.h>
        #include <fcntl.h>
        #include <string.h>
        #include <errno.h>
        #include <pthread.h>
      
        static pthread_barrier_t barrier;
      
        static void *chew_cpu(void *arg)
        {
      	  pthread_barrier_wait(&barrier);
      	  while (1)
      		  __asm__ __volatile__("" : : : "memory");
      	  return NULL;
        }
      
        int main(void)
        {
      	  clockid_t process_clock, my_thread_clock, th_clock;
      	  struct timespec process_before, process_after;
      	  struct timespec me_before, me_after;
      	  struct timespec th_before, th_after;
      	  struct timespec sleeptime;
      	  unsigned long diff;
      	  pthread_t th;
      	  int err;
      
      	  err = clock_getcpuclockid(0, &process_clock);
      	  if (err)
      		  return 1;
      
      	  err = pthread_getcpuclockid(pthread_self(), &my_thread_clock);
      	  if (err)
      		  return 1;
      
      	  pthread_barrier_init(&barrier, NULL, 2);
      	  err = pthread_create(&th, NULL, chew_cpu, NULL);
      	  if (err)
      		  return 1;
      
      	  err = pthread_getcpuclockid(th, &th_clock);
      	  if (err)
      		  return 1;
      
      	  pthread_barrier_wait(&barrier);
      
      	  err = clock_gettime(process_clock, &process_before);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(my_thread_clock, &me_before);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(th_clock, &th_before);
      	  if (err)
      		  return 1;
      
      	  sleeptime.tv_sec = 0;
      	  sleeptime.tv_nsec = 500000000;
      	  nanosleep(&sleeptime, NULL);
      
      	  err = clock_gettime(th_clock, &th_after);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(my_thread_clock, &me_after);
      	  if (err)
      		  return 1;
      
      	  err = clock_gettime(process_clock, &process_after);
      	  if (err)
      		  return 1;
      
      	  diff = process_after.tv_nsec - process_before.tv_nsec;
      	  printf("process: before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
      		 process_before.tv_sec, process_before.tv_nsec,
      		 process_after.tv_sec, process_after.tv_nsec, diff);
      	  diff = th_after.tv_nsec - th_before.tv_nsec;
      	  printf("thread:  before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
      		 th_before.tv_sec, th_before.tv_nsec,
      		 th_after.tv_sec, th_after.tv_nsec, diff);
      	  diff = me_after.tv_nsec - me_before.tv_nsec;
      	  printf("self:    before(%lu.%.9lu) after(%lu.%.9lu) diff(%lu)\n",
      		 me_before.tv_sec, me_before.tv_nsec,
      		 me_after.tv_sec, me_after.tv_nsec, diff);
      
      	  return 0;
        }
      
      This is due to us using p->se.sum_exec_runtime in
      thread_group_cputime() where we iterate the thread group and sum all
      data. This does not take time since the last schedule operation (tick
      or otherwise) into account. We can cure this by using
      task_sched_runtime() at the cost of having to take locks.
      
      This also means we can (and must) do away with
      thread_group_sched_runtime() since the modified thread_group_cputime()
      is now more accurate and would deadlock when called from
      thread_group_sched_runtime().
      
      Aside of that it makes the function safe on 32 bit systems. The old
      code added t->se.sum_exec_runtime unprotected. sum_exec_runtime is a
      64bit value and could be changed on another cpu at the same time.
      Reported-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1314874459.7945.22.camel@twinsTested-by: default avatarDavid Miller <davem@davemloft.net>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      249cf808
    • Borislav Petkov's avatar
      ide-disk: Fix request requeuing · 3217df8e
      Borislav Petkov authored
      commit 2c8fc867 upstream.
      
      Simon Kirby reported that on his RAID setup with idedisk underneath
      the box OOMs after a couple of days of runtime. Running with
      CONFIG_DEBUG_KMEMLEAK pointed to idedisk_prep_fn() which unconditionally
      allocates an ide_cmd struct. However, ide_requeue_and_plug() can be
      called more than once per request, either from the request issue or the
      IRQ handler path and do blk_peek_request() ends up in idedisk_prep_fn()
      repeatedly, allocating a struct ide_cmd everytime and "forgetting" the
      previous pointer.
      
      Make sure the code reuses the old allocated chunk.
      Reported-and-tested-by: default avatarSimon Kirby <sim@hostway.ca>
      Link: http://marc.info/?l=linux-kernel&m=131667641517919
      Link: http://lkml.kernel.org/r/20110922072643.GA27232@hostway.caSigned-off-by: default avatarBorislav Petkov <bp@alien8.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3217df8e
    • Simon Kirby's avatar
      sched: Fix up wchan borkage · 4e41ce69
      Simon Kirby authored
      commit 6ebbe7a0 upstream.
      
      Commit c259e01a ("sched: Separate the scheduler entry for
      preemption") contained a boo-boo wrecking wchan output. It forgot to
      put the new schedule() function in the __sched section and thereby
      doesn't get properly ignored for things like wchan.
      Tested-by: default avatarSimon Kirby <sim@hostway.ca>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20110923000346.GA25425@hostway.caSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      4e41ce69
    • Shawn Bohrer's avatar
      sched/rt: Migrate equal priority tasks to available CPUs · 113f8b8f
      Shawn Bohrer authored
      commit 3be209a8 upstream.
      
      Commit 43fa5460 ("sched: Try not to
      migrate higher priority RT tasks") also introduced a change in behavior
      which keeps RT tasks on the same CPU if there is an equal priority RT
      task currently running even if there are empty CPUs available.
      
      This can cause unnecessary wakeup latencies, and can prevent the
      scheduler from balancing all RT tasks across available CPUs.
      
      This change causes an RT task to search for a new CPU if an equal
      priority RT task is already running on wakeup.  Lower priority tasks
      will still have to wait on higher priority tasks, but the system should
      still balance out because there is always the possibility that if there
      are both a high and low priority RT tasks on a given CPU that the high
      priority task could wakeup while the low priority task is running and
      force it to search for a better runqueue.
      Signed-off-by: default avatarShawn Bohrer <sbohrer@rgmadvisors.com>
      Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Tested-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1315837684-18733-1-git-send-email-sbohrer@rgmadvisors.comSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      113f8b8f
    • David S. Miller's avatar
      sparc64: Force the execute bit in OpenFirmware's translation entries. · ca64baea
      David S. Miller authored
      In the OF 'translations' property, the template TTEs in the mappings
      never specify the executable bit.  This is the case even though some
      of these mappings are for OF's code segment.
      
      Therefore, we need to force the execute bit on in every mapping.
      
      This problem can only really trigger on Niagara/sun4v machines and the
      history behind this is a little complicated.
      
      Previous to sun4v, the sun4u TTE entries lacked a hardware execute
      permission bit.  So OF didn't have to ever worry about setting
      anything to handle executable pages.  Any valid TTE loaded into the
      I-TLB would be respected by the chip.
      
      But sun4v Niagara chips have a real hardware enforced executable bit
      in their TTEs.  So it has to be set or else the I-TLB throws an
      instruction access exception with type code 6 (protection violation).
      
      We've been extremely fortunate to not get bitten by this in the past.
      
      The best I can tell is that the OF's mappings for it's executable code
      were mapped using permanent locked mappings on sun4v in the past.
      Therefore, the fact that we didn't have the exec bit set in the OF
      translations we would use did not matter in practice.
      
      Thanks to Greg Onufer for helping me track this down.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      ca64baea
  2. 03 Oct, 2011 16 commits