1. 07 7月, 2020 2 次提交
    • V
      drm/i915/fbc: Fix fence_y_offset handling · 9eb0463c
      Ville Syrjälä 提交于
      The current fence_y_offset calculation is broken. I think it more or
      less used to do the right thing, but then I changed the plane code
      to put the final x/y source offsets back into the src rectangle so
      now it's just subtraacting the same value from itself. The code would
      never have worked if we allowed the framebuffer to have a non-zero
      offset.
      
      Let's do this in a better way by just calculating the fence_y_offset
      from the final plane surface offset. Note that we don't align the
      plane surface address to fence rows so with horizontal panning there's
      often a horizontal offset from the fence start to the surface address
      as well. We have no way to tell the hardware about that so we just
      ignore it. Based on some quick tests the invlidation still happens
      correctly. I presume due to the invalidation nuking at least the full
      line (or a segment of multiple lines).
      
      Fixes: 54d4d719 ("drm/i915: Overcome display engine stride limits via GTT remapping")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200429101034.8208-4-ville.syrjala@linux.intel.comReviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      (cherry picked from commit 5331889b)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      9eb0463c
    • C
      drm/i915: Skip stale object handle for debugfs per-file-stats · 7dfbf8a0
      Chris Wilson 提交于
      As we close a handle GEM object, we update the drm_file's idr with an
      error^W NULL pointer to indicate the in-progress closure, and finally
      removing it. If we read the idr directly, we may then see an invalid
      object pointer, and in our debugfs per_file_stats() we therefore need
      to protect against the entry being invalid.
      
      [ 1016.651637] RIP: 0010:per_file_stats+0xe/0x16e
      [ 1016.651646] Code: d2 41 0f b6 8e 69 8c 00 00 48 89 df 48 c7 c6 7b 74 8c be 31 c0 e8 0c 89 cf ff eb d2 0f 1f 44 00 00 55 48 89 e5 41
      57 41 56 53 <8b> 06 85 c0 0f 84 4d 01 00 00 49 89 d6 48 89 f3 3d ff ff ff 7f 73
      [ 1016.651651] RSP: 0018:ffffad3a01337ba0 EFLAGS: 00010293
      [ 1016.651656] RAX: 0000000000000018 RBX: ffff96fe040d65e0 RCX: 0000000000000002
      [ 1016.651660] RDX: ffffad3a01337c50 RSI: 0000000000000000 RDI: 00000000000001e8
      [ 1016.651663] RBP: ffffad3a01337bb8 R08: 0000000000000000 R09: 00000000000001c0
      [ 1016.651667] R10: 0000000000000000 R11: ffffffffbdbe5fce R12: 0000000000000000
      [ 1016.651671] R13: ffffffffbdbe5fce R14: ffffad3a01337c50 R15: 0000000000000001
      [ 1016.651676] FS:  00007a597e2d7480(0000) GS:ffff96ff3bb00000(0000) knlGS:0000000000000000
      [ 1016.651680] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1016.651683] CR2: 0000000000000000 CR3: 0000000171fc2001 CR4: 00000000003606e0
      [ 1016.651687] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1016.651690] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 1016.651693] Call Trace:
      [ 1016.651693] Call Trace:
      [ 1016.651703]  idr_for_each+0x8a/0xe8
      [ 1016.651711]  i915_gem_object_info+0x2a3/0x3eb
      [ 1016.651720]  seq_read+0x162/0x3ca
      [ 1016.651727]  full_proxy_read+0x5b/0x8d
      [ 1016.651733]  __vfs_read+0x45/0x1bb
      [ 1016.651741]  vfs_read+0xc9/0x15e
      [ 1016.651746]  ksys_read+0x7e/0xde
      [ 1016.651752]  do_syscall_64+0x54/0x68
      [ 1016.651758]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Fixes: a8c15954 ("drm/i915: Protect debugfs per_file_stats with RCU lock")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: stable@vger.kernel.org
      Reviewed-by: NMika Kuoppala <mika.kuoppala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200630152724.3734-1-chris@chris-wilson.co.uk
      (cherry picked from commit c1b9fd3d)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      7dfbf8a0
  2. 04 7月, 2020 6 次提交
  3. 03 7月, 2020 3 次提交
  4. 02 7月, 2020 11 次提交
  5. 01 7月, 2020 3 次提交
  6. 30 6月, 2020 1 次提交
  7. 29 6月, 2020 12 次提交
  8. 27 6月, 2020 2 次提交
    • C
      scsi: mptfusion: Don't use GFP_ATOMIC for larger DMA allocations · 311950f8
      Christoph Hellwig 提交于
      The mpt fusion driver still uses the legacy PCI DMA API which hardcodes
      atomic allocations.  This caused the driver to fail to load on some powerpc
      VMs with incoherent DMA and small memory sizes.  Switch to use the modern
      DMA API and sleeping allocations for large allocations instead.  This is
      not a full cleanup of the PCI DMA API usage yet, but just enough to fix the
      regression caused by reducing the default atomic pool size.
      
      Link: https://lore.kernel.org/r/20200624165724.1818496-1-hch@lst.de
      Fixes: 3ee06a6d ("dma-pool: fix too large DMA pools on medium memory size systems")
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      311950f8
    • J
      scsi: libfc: Skip additional kref updating work event · 823a6540
      Javed Hasan 提交于
      When an rport event (RPORT_EV_READY) is updated without work being queued,
      avoid taking an additional reference.
      
      This issue was leading to memory leak. Trace from KMEMLEAK tool:
      
        unreferenced object 0xffff8888259e8780 (size 512):
        comm "kworker/2:1", jiffies 4433237386 (age 113021.971s)
          hex dump (first 32 bytes):
      	58 0a ec cf 83 88 ff ff 00 00 00 00 00 00 00 00
      	01 00 00 00 08 00 00 00 13 7d f0 1e 0e 00 00 10
        backtrace:
        [<000000006b25760f>] fc_rport_recv_req+0x3c6/0x18f0 [libfc]
        [<00000000f208d994>] fc_lport_recv_els_req+0x120/0x8a0 [libfc]
        [<00000000a9c437b8>] fc_lport_recv+0xb9/0x130 [libfc]
        [<00000000a9c437b8>] fc_lport_recv+0xb9/0x130 [libfc]
        [<00000000ad5be37b>] qedf_ll2_process_skb+0x73d/0xad0 [qedf]
        [<00000000e0eb6893>] process_one_work+0x382/0x6c0
        [<000000002dfd9e21>] worker_thread+0x57/0x5c0
        [<00000000b648204f>] kthread+0x1a0/0x1c0
        [<0000000072f5ab20>] ret_from_fork+0x35/0x40
        [<000000001d5c05d8>] 0xffffffffffffffff
      
      Below is the log sequence which leads to memory leak.  Here we get the
      RPORT_EV_READY and RPORT_EV_STOP back to back, which lead to overwrite the
      event RPORT_EV_READY by event RPORT_EV_STOP.  Because of this, kref_count
      gets incremented by 1.
      
        kernel: host0: rport fffce5: Received PLOGI request
        kernel: host0: rport fffce5: Received PLOGI in INIT state
        kernel: host0: rport fffce5: Port is Ready
        kernel: host0: rport fffce5: Received PRLI request while in state Ready
        kernel: host0: rport fffce5: PRLI rspp type 8 active 1 passive 0
        kernel: host0: rport fffce5: Received LOGO request while in state Ready
        kernel: host0: rport fffce5: Delete port
        kernel: host0: rport fffce5: Received PLOGI request
        kernel: host0: rport fffce5: Received PLOGI in state Delete - send busy
        kernel: host0: rport fffce5: work event 3
        kernel: host0: rport fffce5: lld callback ev 3
        kernel: host0: rport fffce5: work delete
      
      Link: https://lore.kernel.org/r/20200626094959.32151-1-jhasan@marvell.comReviewed-by: NGirish Basrur <gbasrur@marvell.com>
      Reviewed-by: NSaurav Kashyap <skashyap@marvell.com>
      Reviewed-by: NShyam Sundar <ssundar@marvell.com>
      Signed-off-by: NJaved Hasan <jhasan@marvell.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      823a6540