1. 17 11月, 2016 6 次提交
  2. 14 11月, 2016 3 次提交
    • M
      gp8psk: Fix DVB frontend attach · 7a0786c1
      Mauro Carvalho Chehab 提交于
      The DVB binding schema at the DVB core assumes that the frontend is a
      separate driver.  Faling to do that causes OOPS when the module is
      removed, as it tries to do a symbol_put_addr on an internal symbol,
      causing craches like:
      
          WARNING: CPU: 1 PID: 28102 at kernel/module.c:1108 module_put+0x57/0x70
          Modules linked in: dvb_usb_gp8psk(-) dvb_usb dvb_core nvidia_drm(PO) nvidia_modeset(PO) snd_hda_codec_hdmi snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_timer snd soundcore nvidia(PO) [last unloaded: rc_core]
          CPU: 1 PID: 28102 Comm: rmmod Tainted: P        WC O 4.8.4-build.1 #1
          Hardware name: MSI MS-7309/MS-7309, BIOS V1.12 02/23/2009
          Call Trace:
             dump_stack+0x44/0x64
             __warn+0xfa/0x120
             module_put+0x57/0x70
             module_put+0x57/0x70
             warn_slowpath_null+0x23/0x30
             module_put+0x57/0x70
             gp8psk_fe_set_frontend+0x460/0x460 [dvb_usb_gp8psk]
             symbol_put_addr+0x27/0x50
             dvb_usb_adapter_frontend_exit+0x3a/0x70 [dvb_usb]
      
      From Derek's tests:
          "Attach bug is fixed, tuning works, module unloads without
           crashing. Everything seems ok!"
      Reported-by: NDerek <user.vdr@gmail.com>
      Tested-by: NDerek <user.vdr@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7a0786c1
    • M
      gp8psk: fix gp8psk_usb_in_op() logic · 1596c387
      Mauro Carvalho Chehab 提交于
      Commit bc29131ecb10 ("[media] gp8psk: don't do DMA on stack") fixed the
      usage of DMA on stack, but the memcpy was wrong for gp8psk_usb_in_op().
      Fix it.
      
      From Derek's email:
          "Fix confirmed using 2 different Skywalker models with
           HD mpeg4, SD mpeg2."
      Suggested-by: NJohannes Stezenbach <js@linuxtv.org>
      Fixes: bc29131ecb10 ("[media] gp8psk: don't do DMA on stack")
      Tested-by: NDerek <user.vdr@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1596c387
    • M
      dvb-usb: move data_mutex to struct dvb_usb_device · 7724325a
      Mauro Carvalho Chehab 提交于
      The data_mutex is initialized too late, as it is needed for
      each device driver's power control, causing an OOPS:
      
          dvb-usb: found a 'TerraTec/qanu USB2.0 Highspeed DVB-T Receiver' in warm state.
          BUG: unable to handle kernel NULL pointer dereference at           (null)
          IP: [<ffffffff846617af>] __mutex_lock_slowpath+0x6f/0x100 PGD 0
          Oops: 0002 [#1] SMP
          Modules linked in: dvb_usb_cinergyT2(+) dvb_usb
          CPU: 0 PID: 2029 Comm: modprobe Not tainted 4.9.0-rc4-dvbmod #24
          Hardware name: FUJITSU LIFEBOOK A544/FJNBB35 , BIOS Version 1.17 05/09/2014
          task: ffff88020e943840 task.stack: ffff8801f36ec000
          RIP: 0010:[<ffffffff846617af>]  [<ffffffff846617af>] __mutex_lock_slowpath+0x6f/0x100
          RSP: 0018:ffff8801f36efb10  EFLAGS: 00010282
          RAX: 0000000000000000 RBX: ffff88021509bdc8 RCX: 00000000c0000100
          RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffff88021509bdcc
          RBP: ffff8801f36efb58 R08: ffff88021f216320 R09: 0000000000100000
          R10: ffff88021f216320 R11: 00000023fee6c5a1 R12: ffff88020e943840
          R13: ffff88021509bdcc R14: 00000000ffffffff R15: ffff88021509bdd0
          FS:  00007f21adb86740(0000) GS:ffff88021f200000(0000) knlGS:0000000000000000
          CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
          CR2: 0000000000000000 CR3: 0000000215bce000 CR4: 00000000001406f0
          Call Trace:
             mutex_lock+0x16/0x25
             cinergyt2_power_ctrl+0x1f/0x60 [dvb_usb_cinergyT2]
             dvb_usb_device_init+0x21e/0x5d0 [dvb_usb]
             cinergyt2_usb_probe+0x21/0x50 [dvb_usb_cinergyT2]
             usb_probe_interface+0xf3/0x2a0
             driver_probe_device+0x208/0x2b0
             __driver_attach+0x87/0x90
             driver_probe_device+0x2b0/0x2b0
             bus_for_each_dev+0x52/0x80
             bus_add_driver+0x1a3/0x220
             driver_register+0x56/0xd0
             usb_register_driver+0x77/0x130
             do_one_initcall+0x46/0x180
             free_vmap_area_noflush+0x38/0x70
             kmem_cache_alloc+0x84/0xc0
             do_init_module+0x50/0x1be
             load_module+0x1d8b/0x2100
             find_symbol_in_section+0xa0/0xa0
             SyS_finit_module+0x89/0x90
             entry_SYSCALL_64_fastpath+0x13/0x94
          Code: e8 a7 1d 00 00 8b 03 83 f8 01 0f 84 97 00 00 00 48 8b 43 10 4c 8d 7b 08 48 89 63 10 4c 89 3c 24 41 be ff ff ff ff 48 89 44 24 08 <48> 89 20 4c 89 64 24 10 eb 1a 49 c7 44 24 08 02 00 00 00 c6 43 RIP  [<ffffffff846617af>] __mutex_lock_slowpath+0x6f/0x100 RSP <ffff8801f36efb10>
          CR2: 0000000000000000
      
      So, move it to the struct dvb_usb_device and initialize it
      before calling the driver's callbacks.
      Reported-by: NJörg Otte <jrg.otte@gmail.com>
      Tested-by: NJörg Otte <jrg.otte@gmail.com>
      Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7724325a
  3. 13 11月, 2016 1 次提交
  4. 12 11月, 2016 7 次提交
  5. 11 11月, 2016 7 次提交
  6. 10 11月, 2016 5 次提交
  7. 09 11月, 2016 6 次提交
    • L
      drm/imx: disable planes before DC · 5ced937b
      Lucas Stach 提交于
      If the DC clock is disabled before the attached IDMACs are properly
      stopped the IDMACs may hang the IPU or even the whole system.
      
      Make sure the IDMACs are in safe state by disabling the planes before
      removal of the DC clock.
      
      Also set the atomic parameter to false to stop calling the atomic_begin
      hook, which does nothing useful as we immediately afterwards turn off
      vblank interrupts and possibly send the pending vblank event.
      
      Fixes: 33f14235 (drm/imx: atomic phase 1: Use transitional atomic
                           CRTC and plane helpers)
      Signed-off-by: NLucas Stach <l.stach@pengutronix.de>
      Signed-off-by: NPhilipp Zabel <p.zabel@pengutronix.de>
      5ced937b
    • M
      scsi: qla2xxx: fix invalid DMA access after command aborts in PCI device remove · 1535aa75
      Mauricio Faria de Oliveira 提交于
      If a command is aborted in the kernel but not in the adapter, it might be
      considered complete and its DMA memory released, but it is still alive in
      the adapter, which will trigger an invalid DMA access upon its completion
      (in the DMA operations to deliver the command response to the driver).
      
      On powerpc platforms with IOMMU/EEH capabilities, the problem is observed
      during PCI device removal with ongoing IO requests -- which might trigger
      an EEH event very often, pointing to a 'TCE Request Page Access Error'.
      
      In that path, which is qla2x00_remove_one(), the commands are aborted in
      qla2x00_abort_all_cmds(), which does not perform an abort in the adapter
      as is done in qla2xxx_eh_abort() for example.
      
      So, this patch changes qla2x00_abort_all_cmds() to abort commands in the
      adapter too, with a call to qla2xxx_eh_abort(), which already implements
      all the logic to submit abort requests and handle responses.
      Reported-by: NNaresh Bannoth <nbannoth@in.ibm.com>
      Signed-off-by: NMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Acked-by: NHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      1535aa75
    • M
      scsi: qla2xxx: do not queue commands when unloading · 04dfaa53
      Mauricio Faria de Oliveira 提交于
      When the driver is unloading, in qla2x00_remove_one(), there is a single
      call/point in time to abort ongoing commands, qla2x00_abort_all_cmds(),
      which is still several steps away from the call to scsi_remove_host().
      
      If more commands continue to arrive and be processed during that
      interval, when the driver is tearing down and releasing its structures,
      it might potentially hit an oops due to invalid memory access:
      
          Unable to handle kernel paging request for data at address 0x00000138
          <...>
          NIP [d000000004700a40] qla2xxx_queuecommand+0x80/0x3f0 [qla2xxx]
          LR [d000000004700a10] qla2xxx_queuecommand+0x50/0x3f0 [qla2xxx]
      
      So, fail commands in qla2xxx_queuecommand() if the UNLOADING bit is set.
      Signed-off-by: NMauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
      Acked-by: NHimanshu Madhani <himanshu.madhani@cavium.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      04dfaa53
    • V
      scsi: libcxgbi: fix incorrect DDP resource cleanup · 69e2d1e6
      Varun Prakash 提交于
      Before calling task_release_itt() task data is memset to zero because of
      which DDP context information is lost resulting in incorrect DDP
      resource cleanup, to fix this call task_release_itt() before memset.
      Signed-off-by: NVarun Prakash <varun@chelsio.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      69e2d1e6
    • B
      PCI: Don't attempt to claim shadow copies of ROM · 16d917b1
      Bjorn Helgaas 提交于
      If we're using a shadow copy of a PCI device ROM, the shadow copy is in RAM
      and the device never sees accesses to it and doesn't respond to it.  We
      don't have to route the shadow range to the PCI device, and the device
      doesn't have to claim the range.
      
      Previously we treated the shadow copy as though it were the ROM BAR, and we
      failed to claim it because the region wasn't routed to the device:
      
        pci 0000:01:00.0: Video device with shadowed ROM at [mem 0x000c0000-0x000dffff]
        pci_bus 0000:01: Allocating resources
        pci 0000:01:00.0: can't claim BAR 6 [mem 0x000c0000-0x000dffff]: no compatible bridge window
      
      The failure path of pcibios_allocate_dev_rom_resource() cleared out the
      resource start address, which also caused the following ioremap() warning:
      
        WARNING: CPU: 0 PID: 116 at /build/linux-akdJXO/linux-4.8.0/arch/x86/mm/ioremap.c:121 __ioremap_caller+0x1ec/0x370
        ioremap on RAM at 0x0000000000000000 - 0x000000000001ffff
      
      Handle an option ROM shadow copy as RAM, without trying to insert it into
      the iomem resource tree.
      
      This fixes a regression caused by 0c0e0736 ("PCI: Set ROM shadow
      location in arch code, not in PCI core"), which appeared in v4.6.  The
      regression causes video device initialization to fail.  This was reported
      on AMD Turks, but it likely affects others as well.
      
      Fixes: 0c0e0736 ("PCI: Set ROM shadow location in arch code, not in PCI core")
      Reported-and-tested-by: NVecu Bosseur <vecu.bosseur@gmail.com>
      Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1627496
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=175391
      Link: https://bugzilla.redhat.com/show_bug.cgi?id=1352272Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      CC: stable@vger.kernel.org	# v4.6+
      16d917b1
    • A
      drm/amd/powerplay: return false instead of -EINVAL · f20024d8
      Andrew Shadura 提交于
      Returning -EINVAL from a bool-returning function
      phm_check_smc_update_required_for_display_configuration has an unexpected
      effect of returning true, which is probably not what was intended.
      Replace -EINVAL by false.
      
      The only place this function is called from is
      psm_adjust_power_state_dynamic in
      drivers/gpu/drm/amd/powerplay/eventmgr/psm.c:106:
      
      	if (!equal || phm_check_smc_update_required_for_display_configuration(hwmgr)) {
      		phm_apply_state_adjust_rules(hwmgr, requested, pcurrent);
      		phm_set_power_state(hwmgr, &pcurrent->hardware, &requested->hardware);
      		hwmgr->current_ps = requested;
      	}
      
      It seems to expect a boolean value here.
      
      This issue has been found using the following Coccinelle semantic patch
      written by Peter Senna Tschudin:
      <smpl>
      @@
      identifier f;
      constant C;
      typedef bool;
      @@
      bool f (...){
      <+...
      * return -C;
      ...+>
      }
      </smpl>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NAndrew Shadura <andrew.shadura@collabora.co.uk>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      f20024d8
  8. 08 11月, 2016 5 次提交
    • A
      drm/amdgpu/powerplay/smu7: fix unintialized data usage · a29d1260
      Arnd Bergmann 提交于
      A recent bugfix replaced an out-of-bounds access with direct
      use of unintialized data:
      
      drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c: In function 'smu7_patch_limits_vddc':
      drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:2033:6: error: 'vddc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:2146:11: note: 'vddc' was declared here
      drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:2033:6: error: 'vddci' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c:2146:17: note: 'vddci' was declared here
        uint32_t vddc, vddci;
      
      This initializes the data as before using the correct type.
      
      Fixes: 77f7f71f ("drm/amdgpu/powerplay/smu7: fix static checker warning")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      a29d1260
    • J
      iommu/vt-d: Fix dead-locks in disable_dmar_iommu() path · bea64033
      Joerg Roedel 提交于
      It turns out that the disable_dmar_iommu() code-path tried
      to get the device_domain_lock recursivly, which will
      dead-lock when this code runs on dmar removal. Fix both
      code-paths that could lead to the dead-lock.
      
      Fixes: 55d94043 ('iommu/vt-d: Get rid of domain->iommu_lock')
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      bea64033
    • R
      iommu/arm-smmu: Fix out-of-bounds dereference · 8c82d6ec
      Robin Murphy 提交于
      When we iterate a master's config entries, what we generally care
      about is the entry's stream map index, rather than the entry index
      itself, so it's nice to have the iterator automatically assign the
      former from the latter. Unfortunately, booting with KASAN reveals
      the oversight that using a simple comma operator results in the
      entry index being dereferenced before being checked for validity,
      so we always access one element past the end of the fwspec array.
      
      Flip things around so that the check always happens before the index
      may be dereferenced.
      
      Fixes: adfec2e7 ("iommu/arm-smmu: Convert to iommu_fwspec")
      Reported-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      8c82d6ec
    • R
      iommu/arm-smmu: Check that iommu_fwspecs are ours · 3c117b54
      Robin Murphy 提交于
      We seem to have forgotten to check that iommu_fwspecs actually belong to
      us before we go ahead and dereference their private data. Oops.
      
      Fixes: 021bb842 ("iommu/arm-smmu: Wire up generic configuration support")
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      3c117b54
    • R
      iommu/arm-smmu: Don't inadvertently reject multiple SMMUv3s · ec615f43
      Robin Murphy 提交于
      We now delay installing our per-bus iommu_ops until we know an SMMU has
      successfully probed, as they don't serve much purpose beforehand, and
      doing so also avoids fights between multiple IOMMU drivers in a single
      kernel. However, the upshot of passing the return value of bus_set_iommu()
      back from our probe function is that if there happens to be more than
      one SMMUv3 device in a system, the second and subsequent probes will
      wind up returning -EBUSY to the driver core and getting torn down again.
      
      Avoid re-setting ops if ours are already installed, so that any genuine
      failures stand out.
      
      Fixes: 08d4ca2a ("iommu/arm-smmu: Support non-PCI devices with SMMUv3")
      CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      CC: Hanjun Guo <hanjun.guo@linaro.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      ec615f43