1. 26 8月, 2013 1 次提交
  2. 23 8月, 2013 2 次提交
    • M
      [SCSI] zfcp: remove access control tables interface (keep sysfs files) · b5dc3c48
      Martin Peschke 提交于
      By popular demand, this patch brings back a couple of sysfs attributes
      removed by commit 663e0890
      "[SCSI] zfcp: remove access control tables interface".
      The content has been irrelevant for years, but the files must be
      there forever for whatever user space tools that may rely on them.
      
      Since these files always return a constant value, a new stripped
      down show-macro was required. Otherwise build warnings would have
      been introduced.
      Signed-off-by: NMartin Peschke <mpeschke@linux.vnet.ibm.com>
      Signed-off-by: NSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      b5dc3c48
    • M
      [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops · 924dd584
      Martin Peschke 提交于
      BUG: sleeping function called from invalid context at kernel/workqueue.c:2752
      in_atomic(): 1, irqs_disabled(): 1, pid: 360, name: zfcperp0.0.1700
      CPU: 1 Not tainted 3.9.3+ #69
      Process zfcperp0.0.1700 (pid: 360, task: 0000000075b7e080, ksp: 000000007476bc30)
      <snip>
      Call Trace:
      ([<00000000001165de>] show_trace+0x106/0x154)
       [<00000000001166a0>] show_stack+0x74/0xf4
       [<00000000006ff646>] dump_stack+0xc6/0xd4
       [<000000000017f3a0>] __might_sleep+0x128/0x148
       [<000000000015ece8>] flush_work+0x54/0x1f8
       [<00000000001630de>] __cancel_work_timer+0xc6/0x128
       [<00000000005067ac>] scsi_device_dev_release_usercontext+0x164/0x23c
       [<0000000000161816>] execute_in_process_context+0x96/0xa8
       [<00000000004d33d8>] device_release+0x60/0xc0
       [<000000000048af48>] kobject_release+0xa8/0x1c4
       [<00000000004f4bf2>] __scsi_iterate_devices+0xfa/0x130
       [<000003ff801b307a>] zfcp_erp_strategy+0x4da/0x1014 [zfcp]
       [<000003ff801b3caa>] zfcp_erp_thread+0xf6/0x2b0 [zfcp]
       [<000000000016b75a>] kthread+0xf2/0xfc
       [<000000000070c9de>] kernel_thread_starter+0x6/0xc
       [<000000000070c9d8>] kernel_thread_starter+0x0/0xc
      
      Apparently, the ref_count for some scsi_device drops down to zero,
      triggering device removal through execute_in_process_context(), while
      the lldd error recovery thread iterates through a scsi device list.
      Unfortunately, execute_in_process_context() decides to immediately
      execute that device removal function, instead of scheduling asynchronous
      execution, since it detects process context and thinks it is safe to do
      so. But almost all calls to shost_for_each_device() in our lldd are
      inside spin_lock_irq, even in thread context. Obviously, schedule()
      inside spin_lock_irq sections is a bad idea.
      
      Change the lldd to use the proper iterator function,
      __shost_for_each_device(), in combination with required locking.
      
      Occurences that need to be changed include all calls in zfcp_erp.c,
      since those might be executed in zfcp error recovery thread context
      with a lock held.
      
      Other occurences of shost_for_each_device() in zfcp_fsf.c do not
      need to be changed (no process context, no surrounding locking).
      
      The problem was introduced in Linux 2.6.37 by commit
      b62a8d9b
      "[SCSI] zfcp: Use SCSI device data zfcp_scsi_dev instead of zfcp_unit".
      Reported-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMartin Peschke <mpeschke@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org #2.6.37+
      Signed-off-by: NSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      924dd584
  3. 22 8月, 2013 2 次提交
    • M
      [SCSI] zfcp: fix lock imbalance by reworking request queue locking · d79ff142
      Martin Peschke 提交于
      This patch adds wait_event_interruptible_lock_irq_timeout(), which is a
      straight-forward descendant of wait_event_interruptible_timeout() and
      wait_event_interruptible_lock_irq().
      
      The zfcp driver used to call wait_event_interruptible_timeout()
      in combination with some intricate and error-prone locking. Using
      wait_event_interruptible_lock_irq_timeout() as a replacement
      nicely cleans up that locking.
      
      This rework removes a situation that resulted in a locking imbalance
      in zfcp_qdio_sbal_get():
      
      BUG: workqueue leaked lock or atomic: events/1/0xffffff00/10
          last function: zfcp_fc_wka_port_offline+0x0/0xa0 [zfcp]
      
      It was introduced by commit c2af7545
      "[SCSI] zfcp: Do not wait for SBALs on stopped queue", which had a new
      code path related to ZFCP_STATUS_ADAPTER_QDIOUP that took an early exit
      without a required lock being held. The problem occured when a
      special, non-SCSI I/O request was being submitted in process context,
      when the adapter's queues had been torn down. In this case the bug
      surfaced when the Fibre Channel port connection for a well-known address
      was closed during a concurrent adapter shut-down procedure, which is a
      rare constellation.
      
      This patch also fixes these warnings from the sparse tool (make C=1):
      
      drivers/s390/scsi/zfcp_qdio.c:224:12: warning: context imbalance in
       'zfcp_qdio_sbal_check' - wrong count at exit
      drivers/s390/scsi/zfcp_qdio.c:244:5: warning: context imbalance in
       'zfcp_qdio_sbal_get' - unexpected unlock
      
      Last but not least, we get rid of that crappy lock-unlock-lock
      sequence at the beginning of the critical section.
      
      It is okay to call zfcp_erp_adapter_reopen() with req_q_lock held.
      Reported-by: NMikulas Patocka <mpatocka@redhat.com>
      Reported-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Peschke <mpeschke@linux.vnet.ibm.com>
      Cc: stable@vger.kernel.org #2.6.35+
      Signed-off-by: NSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      d79ff142
    • A
      [SCSI] lpfc: Don't force CONFIG_GENERIC_CSUM on · f5944daa
      Anton Blanchard 提交于
      We want ppc64 to be able to select between optimised assembly
      checksum routines in big endian and the generic lib/checksum.c
      routines in little endian.
      
      The lpfc driver is forcing CONFIG_GENERIC_CSUM on which means
      we are unable to make the decision to enable it in the arch
      Kconfig. If the option exists it is always forced on.
      
      This got introduced in 3.10 via commit 6a7252fd ([SCSI] lpfc:
      fix up Kconfig dependencies). I spoke to Randy about it and
      the original issue was with CRC_T10DIF not being defined.
      
      As such, remove the select of CONFIG_GENERIC_CSUM.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Cc: <stable@vger.kernel.org> # 3.10
      Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
      f5944daa
  4. 09 8月, 2013 2 次提交
    • J
      Revert "HID: hid-logitech-dj: querying_devices was never set" · 8e5654ce
      Jiri Kosina 提交于
      This reverts commit 407a2c2a.
      
      Explanation provided by Benjamin Tissoires:
      
      Commit "HID: hid-logitech-dj, querying_devices was never set" activate
      a flag which guarantees that we do not ask the receiver for too many
      enumeration. When the flag is set, each following enumeration call is
      discarded (the usb request is not forwarded to the receiver). The flag
      is then released when the driver receive a pairing information event,
      which normally follows the enumeration request.
      However, the USB3 bug makes the driver think the enumeration request
      has been forwarded to the receiver. However, it is actually not the
      case because the USB stack returns -EPIPE. So, when a new unknown
      device appears, the workaround consisting in asking for a new
      enumeration is not working anymore: this new enumeration is discarded
      because of the flag, which is never reset.
      
      A solution could be to trigger a timeout before releasing it, but for
      now, let's just revert the patch.
      Reported-by: NBenjamin Tissoires <benjamin.tissoires@gmail.com>
      Tested-by: NSune Mølgaard <sune@molgaard.org>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      8e5654ce
    • C
      hwmon: (adt7470) Fix incorrect return code check · 93d783bc
      Curt Brune 提交于
      In adt7470_write_word_data(), which writes two bytes using
      i2c_smbus_write_byte_data(), the return codes are incorrectly AND-ed
      together when they should be OR-ed together.
      
      The return code of i2c_smbus_write_byte_data() is zero for success.
      
      The upshot is only the first byte was ever written to the hardware.
      The 2nd byte was never written out.
      
      I noticed that trying to set the fan speed limits was not working
      correctly on my system.  Setting the fan speed limits is the only
      code that uses adt7470_write_word_data().  After making the change
      the limit settings work and the alarms work also.
      Signed-off-by: NCurt Brune <curt@cumulusnetworks.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      93d783bc
  5. 08 8月, 2013 21 次提交
  6. 07 8月, 2013 8 次提交
    • J
      drm/i915: do not disable backlight on vgaswitcheroo switch off · 3f577573
      Jani Nikula 提交于
      On muxed systems, the other vgaswitcheroo client may depend on i915 to
      handle the backlight. We began switching off the backlight since
      
      commit a261b246
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jul 26 19:21:47 2012 +0200
      
          drm/i915: disable all crtcs at suspend time
      
      breaking backlight on discreet graphics in (some) muxed systems.
      
      Keep the backlight on when the state is changed through vgaswitcheroo.
      
      Note: The alternative would be to add a quirk table to achieve the same
      based on system identifiers, but AFAICS it would asymptotically approach
      effectively the same as this patch as more IDs are added, but with the
      maintenance burden of the quirk table.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55311Tested-by: NFede <fedevx@yahoo.com>
      Tested-by: NAximab <laurent.debian@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59785Tested-by: Nsfievet <sebastien.fievet@free.fr>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3f577573
    • V
      drm/i915: Don't call encoder's get_config unless encoder is active · 3eaba51c
      Ville Syrjälä 提交于
      The SDVO code tries to compare the encoder's and crtc's idea of the
      pixel_multiplier. Normally they have to match, but when transitioning
      to DPMS off, we turn off the pipe before reading out the pipe_config,
      so the pixel_multiplier in the pipe_config will be 0, whereas the
      encoder will still have its pixel_multiplier set to whatever value we
      were using when the display was active. This leads to a warning
      from intel_modeset_check_state().
      
      WARNING: CPU: 1 PID: 2846 at drivers/gpu/drm/i915/intel_sdvo.c:1378 intel_sdvo_get_config+0x158/0x160()
      SDVO pixel multiplier mismatch, port: 0, encoder: 1
      Modules linked in: snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep
      CPU: 1 PID: 2846 Comm: Xorg Not tainted 3.11.0-rc3-00208-gbe1e8d7-dirty #19
      Hardware name: Apple Computer, Inc. Macmini1,1/Mac-F4208EC8, BIOS  MM11.88Z.0055.B03.0604071521 04/07/06
       00000000 00000000 ef0afa54 c1597bbb c1737ea4 ef0afa84 c10392ca c1737e6c
       ef0afab0 00000b1e c1737ea4 00000562 c12dfbe8 c12dfbe8 ef0afb14 00000000
       f697ec00 ef0afa9c c103936e 00000009 ef0afa94 c1737e6c ef0afab0 ef0afadc
      Call Trace:
       [<c1597bbb>] dump_stack+0x41/0x56
       [<c10392ca>] warn_slowpath_common+0x7a/0xa0
       [<c103936e>] warn_slowpath_fmt+0x2e/0x30
       [<c12dfbe8>] intel_sdvo_get_config+0x158/0x160
       [<c12c3220>] check_crtc_state+0x1e0/0xb10
       [<c12cdc7d>] intel_modeset_check_state+0x29d/0x7c0
       [<c12dfe5c>] intel_sdvo_dpms+0x5c/0xa0
       [<c12985de>] drm_mode_obj_set_property_ioctl+0x40e/0x420
       [<c1298625>] drm_mode_connector_property_set_ioctl+0x35/0x40
       [<c1289294>] drm_ioctl+0x3e4/0x540
       [<c10fc1a2>] do_vfs_ioctl+0x72/0x570
       [<c10fc72f>] SyS_ioctl+0x8f/0xa0
       [<c159b7fa>] sysenter_do_call+0x12/0x22
      ---[ end trace 7ce940aff1366d60 ]---
      
      Fix the problem by skipping the encoder get_config() function for
      inactive encoders.
      Tested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3eaba51c
    • A
      drm/i915: avoid brightness overflow when doing scale · 22505b82
      Aaron Lu 提交于
      Some card's max brightness level is pretty large, e.g. on Acer Aspire
      4732Z, the max level is 989910. If user space set a large enough level
      then the current scale done in intel_panel_set_backlight will cause an
      integer overflow and the scaled level will be mistakenly small, leaving
      user with an almost black screen. This patch fixes this problem.
      Signed-off-by: NAaron Lu <aaron.lu@intel.com>
      [danvet: Add a comment to explain what's going on.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      22505b82
    • P
      drm/i915: update last_vblank when disabling the power well · 9dbd8feb
      Paulo Zanoni 提交于
      The DRM layer keeps track of our vblanks and it assumes our vblank
      counters only go back to zero when they overflow. The problem is that
      when we disable the power well our counters also go to zero, but it
      doesn't mean they did overflow. So on this patch we grab the lock and
      update last_vblank so the DRM layer won't think our counters
      overflowed.
      
      This patch fixes the following intel-gpu-tools test:
      ./kms_flip --run-subtest blocking-absolute-wf_vblank
      
      Regression introduced by the following commit:
      
      commit bf51d5e2
      Author: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Date:   Wed Jul 3 17:12:13 2013 -0300
          drm/i915: switch disable_power_well default value to 1
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66808Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Added a comment that this might be better done in
      drm_vblank_post_modeset in general.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9dbd8feb
    • D
      drm/i915: fix gen4 digital port hotplug definitions · 0ce99f74
      Daniel Vetter 提交于
      Apparently Bspec is wrong in this case here even for gm45. Note that
      Bspec is horribly misguided on i965g/gm, so we don't have any other
      data points besides that it seems to make machines work better.
      
      With this changes all the bits in PORT_HOTPLUG_STAT for the digital
      ports are ordered the same way. This seems to agree with what register
      dumps from the hpd storm handling code shows, where the LIVE bit and
      the short/long pulse STATUS bits light up at the same time with this
      enumeration (but no with the one from Bspec).
      
      Also tested on my gm45 which has two DP+ ports, and everything seems
      to still work as expected.
      
      References: http://www.mail-archive.com/intel-gfx@lists.freedesktop.org/msg23054.html
      Cc: Egbert Eich <eich@suse.com>
      Cc: Jan Niggemann <jn@hz6.de>
      Tested-by: NJan Niggemann <jn@hz6.de>
      [danvet: Add a big warning that Bspec seems to be wrong for these
      bits, suggested by Jani.]
      Acked-by: NJani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0ce99f74
    • D
      drm/ast: invalidate page tables when pinning a BO · 3ac65259
      Dave Airlie 提交于
      same fix as cirrus and mgag200.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3ac65259
    • E
      drm/mgag200: Invalidate page tables when pinning a BO · ecaac1c8
      Egbert Eich 提交于
      When a BO gets pinned the placement may get changed. If the memory is
      mapped into user space and user space has already accessed the mapped
      range the page tables are set up but now point to the wrong memory.
      Set bo.mdev->dev_mapping in mgag200_bo_create() to make sure that
      ttm_bo_unmap_virtual() called from ttm_bo_handle_move_mem() will take
      care of this.
      
      v2: Don't call ttm_bo_unmap_virtual() in mgag200_bo_pin(), fix comment.
      Signed-off-by: NEgbert Eich <eich@suse.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ecaac1c8
    • M
      drm/cirrus: Invalidate page tables when pinning a BO · 109a5159
      Michal Srb 提交于
      This is a cirrus version of Egbert Eich's patch for mgag200.
      
      Without bo.bdev->dev_mapping set, the ttm_bo_unmap_virtual_locked
      called from ttm_bo_handle_move_mem returns with no effect. If any
      application accessed the memory before it was moved, it will
      access wrong memory next time. This causes crashes when changing
      resolution down.
      Signed-off-by: NMichal Srb <msrb@suse.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      109a5159
  7. 06 8月, 2013 2 次提交
    • R
      ACPI: Drop physical_node_id_bitmap from struct acpi_device · 007ccfcf
      Rafael J. Wysocki 提交于
      The physical_node_id_bitmap in struct acpi_device is only used for
      looking up the first currently unused dependent phyiscal node ID
      by acpi_bind_one().  It is not really necessary, however, because
      acpi_bind_one() walks the entire physical_node_list of the given
      device object for sanity checking anyway and if that list is always
      sorted by node_id, it is straightforward to find the first gap
      between the currently used node IDs and use that number as the ID
      of the new list node.
      
      This also removes the artificial limit of the maximum number of
      dependent physical devices per ACPI device object, which now depends
      only on the capacity of unsigend int.  As a result, it fixes a
      regression introduced by commit e2ff3940 (ACPI / memhotplug: Bind
      removable memory blocks to ACPI device nodes) that caused
      acpi_memory_enable_device() to fail when the number of 128 MB blocks
      within one removable memory module was greater than 32.
      Reported-and-tested-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NToshi Kani <toshi.kani@hp.com>
      Reviewed-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      007ccfcf
    • R
      ACPI / PM: Walk physical_node_list under physical_node_lock · 623cf33c
      Rafael J. Wysocki 提交于
      The list of physical devices corresponding to an ACPI device
      object is walked by acpi_system_wakeup_device_seq_show() and
      physical_device_enable_wakeup() without taking that object's
      physical_node_lock mutex.  Since each of those functions may be
      run at any time as a result of a user space action, the lack of
      appropriate locking in them may lead to a kernel crash if that
      happens during device hot-add or hot-remove involving the device
      object in question.
      
      Fix the issue by modifying acpi_system_wakeup_device_seq_show() and
      physical_device_enable_wakeup() to use physical_node_lock as
      appropriate.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: All <stable@vger.kernel.org>
      623cf33c
  8. 05 8月, 2013 2 次提交