1. 26 11月, 2020 11 次提交
  2. 23 11月, 2020 6 次提交
    • S
      iommu: Check return of __iommu_attach_device() · 77c38c8c
      Shameer Kolothum 提交于
      Currently iommu_create_device_direct_mappings() is called
      without checking the return of __iommu_attach_device(). This
      may result in failures in iommu driver if dev attach returns
      error.
      
      Fixes: ce574c27 ("iommu: Move iommu_group_create_direct_mappings() out of iommu_group_add_device()")
      Signed-off-by: NShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
      Link: https://lore.kernel.org/r/20201119165846.34180-1-shameerali.kolothum.thodi@huawei.comSigned-off-by: NWill Deacon <will@kernel.org>
      77c38c8c
    • J
      arm-smmu-qcom: Ensure the qcom_scm driver has finished probing · 72b55c96
      John Stultz 提交于
      Robin Murphy pointed out that if the arm-smmu driver probes before
      the qcom_scm driver, we may call qcom_scm_qsmmu500_wait_safe_toggle()
      before the __scm is initialized.
      
      Now, getting this to happen is a bit contrived, as in my efforts it
      required enabling asynchronous probing for both drivers, moving the
      firmware dts node to the end of the dtsi file, as well as forcing a
      long delay in the qcom_scm_probe function.
      
      With those tweaks we ran into the following crash:
      [    2.631040] arm-smmu 15000000.iommu:         Stage-1: 48-bit VA -> 48-bit IPA
      [    2.633372] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
      ...
      [    2.633402] [0000000000000000] user address but active_mm is swapper
      [    2.633409] Internal error: Oops: 96000005 [#1] PREEMPT SMP
      [    2.633415] Modules linked in:
      [    2.633427] CPU: 5 PID: 117 Comm: kworker/u16:2 Tainted: G        W         5.10.0-rc1-mainline-00025-g272a618fc36-dirty #3971
      [    2.633430] Hardware name: Thundercomm Dragonboard 845c (DT)
      [    2.633448] Workqueue: events_unbound async_run_entry_fn
      [    2.633456] pstate: 80c00005 (Nzcv daif +PAN +UAO -TCO BTYPE=--)
      [    2.633465] pc : qcom_scm_qsmmu500_wait_safe_toggle+0x78/0xb0
      [    2.633473] lr : qcom_smmu500_reset+0x58/0x78
      [    2.633476] sp : ffffffc0105a3b60
      ...
      [    2.633567] Call trace:
      [    2.633572]  qcom_scm_qsmmu500_wait_safe_toggle+0x78/0xb0
      [    2.633576]  qcom_smmu500_reset+0x58/0x78
      [    2.633581]  arm_smmu_device_reset+0x194/0x270
      [    2.633585]  arm_smmu_device_probe+0xc94/0xeb8
      [    2.633592]  platform_drv_probe+0x58/0xa8
      [    2.633597]  really_probe+0xec/0x398
      [    2.633601]  driver_probe_device+0x5c/0xb8
      [    2.633606]  __driver_attach_async_helper+0x64/0x88
      [    2.633610]  async_run_entry_fn+0x4c/0x118
      [    2.633617]  process_one_work+0x20c/0x4b0
      [    2.633621]  worker_thread+0x48/0x460
      [    2.633628]  kthread+0x14c/0x158
      [    2.633634]  ret_from_fork+0x10/0x18
      [    2.633642] Code: a9034fa0 d0007f73 29107fa0 91342273 (f9400020)
      
      To avoid this, this patch adds a check on qcom_scm_is_available() in
      the qcom_smmu_impl_init() function, returning -EPROBE_DEFER if its
      not ready.
      
      This allows the driver to try to probe again later after qcom_scm has
      finished probing.
      Reported-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Andy Gross <agross@kernel.org>
      Cc: Maulik Shah <mkshah@codeaurora.org>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Saravana Kannan <saravanak@google.com>
      Cc: Marc Zyngier <maz@kernel.org>
      Cc: Lina Iyer <ilina@codeaurora.org>
      Cc: iommu@lists.linux-foundation.org
      Cc: linux-arm-msm <linux-arm-msm@vger.kernel.org>
      Link: https://lore.kernel.org/r/20201112220520.48159-1-john.stultz@linaro.orgSigned-off-by: NWill Deacon <will@kernel.org>
      72b55c96
    • S
      iommu/amd: Enforce 4k mapping for certain IOMMU data structures · 6d39bdee
      Suravee Suthikulpanit 提交于
      AMD IOMMU requires 4k-aligned pages for the event log, the PPR log,
      and the completion wait write-back regions. However, when allocating
      the pages, they could be part of large mapping (e.g. 2M) page.
      This causes #PF due to the SNP RMP hardware enforces the check based
      on the page level for these data structures.
      
      So, fix by calling set_memory_4k() on the allocated pages.
      
      Fixes: c69d89af ("iommu/amd: Use 4K page for completion wait write-back semaphore")
      Signed-off-by: NSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Link: https://lore.kernel.org/r/20201105145832.3065-1-suravee.suthikulpanit@amd.comSigned-off-by: NWill Deacon <will@kernel.org>
      6d39bdee
    • S
      ACPI/IORT: Fix doc warnings in iort.c · 774c4a3b
      Shiju Jose 提交于
      Fix following warnings caused by mismatch between
      function parameters and function comments.
      
      drivers/acpi/arm64/iort.c:55: warning: Function parameter or member 'iort_node' not described in 'iort_set_fwnode'
      drivers/acpi/arm64/iort.c:55: warning: Excess function parameter 'node' description in 'iort_set_fwnode'
      drivers/acpi/arm64/iort.c:682: warning: Function parameter or member 'id' not described in 'iort_get_device_domain'
      drivers/acpi/arm64/iort.c:682: warning: Function parameter or member 'bus_token' not described in 'iort_get_device_domain'
      drivers/acpi/arm64/iort.c:682: warning: Excess function parameter 'req_id' description in 'iort_get_device_domain'
      drivers/acpi/arm64/iort.c:1142: warning: Function parameter or member 'dma_size' not described in 'iort_dma_setup'
      drivers/acpi/arm64/iort.c:1142: warning: Excess function parameter 'size' description in 'iort_dma_setup'
      drivers/acpi/arm64/iort.c:1534: warning: Function parameter or member 'ops' not described in 'iort_add_platform_device'
      Signed-off-by: NShiju Jose <shiju.jose@huawei.com>
      Acked-by: NHanjun Guo <guohanjun@huawei.com>
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Link: https://lore.kernel.org/r/20201014093139.1580-1-shiju.jose@huawei.comSigned-off-by: NWill Deacon <will@kernel.org>
      774c4a3b
    • S
      cpufreq: scmi: Fix build for !CONFIG_COMMON_CLK · f943849f
      Sudeep Holla 提交于
      Commit 8410e7f3 ("cpufreq: scmi: Fix OPP addition failure with a
      dummy clock provider") registers a dummy clock provider using
      devm_of_clk_add_hw_provider. These *_hw_provider functions are defined
      only when CONFIG_COMMON_CLK=y. One possible fix is to add the Kconfig
      dependency, but since we plan to move away from the clock dependency
      for scmi cpufreq, it is preferrable to avoid that.
      
      Let us just conditionally compile out the offending call to
      devm_of_clk_add_hw_provider. It also uses the variable 'dev' outside
      of the #ifdef block to avoid build warning.
      
      Fixes: 8410e7f3 ("cpufreq: scmi: Fix OPP addition failure with a dummy clock provider")
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      f943849f
    • D
      mm: fix phys_to_target_node() and memory_add_physaddr_to_nid() exports · a927bd6b
      Dan Williams 提交于
      The core-mm has a default __weak implementation of phys_to_target_node()
      to mirror the weak definition of memory_add_physaddr_to_nid().  That
      symbol is exported for modules.  However, while the export in
      mm/memory_hotplug.c exported the symbol in the configuration cases of:
      
      	CONFIG_NUMA_KEEP_MEMINFO=y
      	CONFIG_MEMORY_HOTPLUG=y
      
      ...and:
      
      	CONFIG_NUMA_KEEP_MEMINFO=n
      	CONFIG_MEMORY_HOTPLUG=y
      
      ...it failed to export the symbol in the case of:
      
      	CONFIG_NUMA_KEEP_MEMINFO=y
      	CONFIG_MEMORY_HOTPLUG=n
      
      Not only is that broken, but Christoph points out that the kernel should
      not be exporting any __weak symbol, which means that
      memory_add_physaddr_to_nid() example that phys_to_target_node() copied
      is broken too.
      
      Rework the definition of phys_to_target_node() and
      memory_add_physaddr_to_nid() to not require weak symbols.  Move to the
      common arch override design-pattern of an asm header defining a symbol
      to replace the default implementation.
      
      The only common header that all memory_add_physaddr_to_nid() producing
      architectures implement is asm/sparsemem.h.  In fact, powerpc already
      defines its memory_add_physaddr_to_nid() helper in sparsemem.h.
      Double-down on that observation and define phys_to_target_node() where
      necessary in asm/sparsemem.h.  An alternate consideration that was
      discarded was to put this override in asm/numa.h, but that entangles
      with the definition of MAX_NUMNODES relative to the inclusion of
      linux/nodemask.h, and requires powerpc to grow a new header.
      
      The dependency on NUMA_KEEP_MEMINFO for DEV_DAX_HMEM_DEVICES is invalid
      now that the symbol is properly exported / stubbed in all combinations
      of CONFIG_NUMA_KEEP_MEMINFO and CONFIG_MEMORY_HOTPLUG.
      
      [dan.j.williams@intel.com: v4]
        Link: https://lkml.kernel.org/r/160461461867.1505359.5301571728749534585.stgit@dwillia2-desk3.amr.corp.intel.com
      [dan.j.williams@intel.com: powerpc: fix create_section_mapping compile warning]
        Link: https://lkml.kernel.org/r/160558386174.2948926.2740149041249041764.stgit@dwillia2-desk3.amr.corp.intel.com
      
      Fixes: a035b6bf ("mm/memory_hotplug: introduce default phys_to_target_node() implementation")
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Reported-by: NThomas Gleixner <tglx@linutronix.de>
      Reported-by: Nkernel test robot <lkp@intel.com>
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Tested-by: NRandy Dunlap <rdunlap@infradead.org>
      Tested-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Cc: Joao Martins <joao.m.martins@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Fenghua Yu <fenghua.yu@intel.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Vishal Verma <vishal.l.verma@intel.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Link: https://lkml.kernel.org/r/160447639846.1133764.7044090803980177548.stgit@dwillia2-desk3.amr.corp.intel.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a927bd6b
  3. 20 11月, 2020 3 次提交
    • D
      video: hyperv_fb: Fix the cache type when mapping the VRAM · 5f1251a4
      Dexuan Cui 提交于
      x86 Hyper-V used to essentially always overwrite the effective cache type
      of guest memory accesses to WB. This was problematic in cases where there
      is a physical device assigned to the VM, since that often requires that
      the VM should have control over cache types. Thus, on newer Hyper-V since
      2018, Hyper-V always honors the VM's cache type, but unexpectedly Linux VM
      users start to complain that Linux VM's VRAM becomes very slow, and it
      turns out that Linux VM should not map the VRAM uncacheable by ioremap().
      Fix this slowness issue by using ioremap_cache().
      
      On ARM64, ioremap_cache() is also required as the host also maps the VRAM
      cacheable, otherwise VM Connect can't display properly with ioremap() or
      ioremap_wc().
      
      With this change, the VRAM on new Hyper-V is as fast as regular RAM, so
      it's no longer necessary to use the hacks we added to mitigate the
      slowness, i.e. we no longer need to allocate physical memory and use
      it to back up the VRAM in Generation-1 VM, and we also no longer need to
      allocate physical memory to back up the framebuffer in a Generation-2 VM
      and copy the framebuffer to the real VRAM. A further big change will
      address these for v5.11.
      
      Fixes: 68a2d20b ("drivers/video: add Hyper-V Synthetic Video Frame Buffer Driver")
      Tested-by: NBoqun Feng <boqun.feng@gmail.com>
      Signed-off-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NMichael Kelley <mikelley@microsoft.com>
      Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Link: https://lore.kernel.org/r/20201118000305.24797-1-decui@microsoft.comSigned-off-by: NWei Liu <wei.liu@kernel.org>
      5f1251a4
    • C
      drm/i915/gt: Fixup tgl mocs for PTE tracking · be33805c
      Chris Wilson 提交于
      Forcing mocs:1 [used for our winsys follows-pte mode] to be cached
      caused display glitches. Though it is documented as deprecated (and so
      likely behaves as uncached) use the follow-pte bit and force it out of
      L3 cache.
      
      Testcase: igt/kms_frontbuffer_tracking
      Testcase: igt/kms_big_fb
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Ayaz A Siddiqui <ayaz.siddiqui@intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201015122138.30161-4-chris@chris-wilson.co.uk
      (cherry picked from commit a04ac827)
      Fixes: 849c0fe9 ("drm/i915/gt: Initialize reserved and unspecified MOCS indices")
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      [Rodrigo: Updated Fixes tag]
      be33805c
    • T
      drm/vram-helper: Fix use of top-down placement · 01822dd1
      Thomas Zimmermann 提交于
      Commit 7053e0ea ("drm/vram-helper: stop using TTM placement flags")
      cleared the BO placement flags if top-down placement had been selected.
      Hence, BOs that were supposed to go into VRAM are now placed in a default
      location in system memory.
      
      Trying to scanout the incorrectly pinned BO results in displayed garbage
      and an error message.
      
      [  146.108127] ------------[ cut here ]------------
      [  146.1V08180] WARNING: CPU: 0 PID: 152 at drivers/gpu/drm/drm_gem_vram_helper.c:284 drm_gem_vram_offset+0x59/0x60 [drm_vram_helper]
      ...
      [  146.108591]  ast_cursor_page_flip+0x3e/0x150 [ast]
      [  146.108622]  ast_cursor_plane_helper_atomic_update+0x8a/0xc0 [ast]
      [  146.108654]  drm_atomic_helper_commit_planes+0x197/0x4c0
      [  146.108699]  drm_atomic_helper_commit_tail_rpm+0x59/0xa0
      [  146.108718]  commit_tail+0x103/0x1c0
      ...
      [  146.109302] ---[ end trace d901a1ba1d949036 ]---
      
      Fix the bug by keeping the placement flags. The top-down placement flag
      is stored in a separate variable.
      Signed-off-by: NThomas Zimmermann <tzimmermann@suse.de>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Fixes: 7053e0ea ("drm/vram-helper: stop using TTM placement flags")
      Reported-by: Pu Wen <puwen@hygon.cn> [for 5.10-rc1]
      Tested-by: NPu Wen <puwen@hygon.cn>
      Cc: Christian König <christian.koenig@amd.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <mripard@kernel.org>
      Cc: Thomas Zimmermann <tzimmermann@suse.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: dri-devel@lists.freedesktop.org
      Link: https://patchwork.freedesktop.org/patch/msgid/20200921142536.4392-1-tzimmermann@suse.de
      (cherry picked from commit b8f8dbf6)
      [pulled into fixes from drm-next]
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      01822dd1
  4. 19 11月, 2020 16 次提交
  5. 18 11月, 2020 4 次提交