Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jul 04, 2024
  2. Apr 12, 2024
  3. Mar 01, 2024
  4. Feb 16, 2024
  5. Nov 27, 2023
  6. Sep 25, 2023
  7. Mar 31, 2023
  8. Jan 13, 2023
  9. Nov 19, 2022
  10. Sep 07, 2022
  11. Jul 06, 2022
  12. May 13, 2022
    • Miles Chen's avatar
      iommu/mediatek: Fix NULL pointer dereference when printing dev_name · de78657e
      Miles Chen authored
      
      When larbdev is NULL (in the case I hit, the node is incorrectly set
      iommus = <&iommu NUM>), it will cause device_link_add() fail and
      kernel crashes when we try to print dev_name(larbdev).
      
      Let's fail the probe if a larbdev is NULL to avoid invalid inputs from
      dts.
      
      It should work for normal correct setting and avoid the crash caused
      by my incorrect setting.
      
      Error log:
      [   18.189042][  T301] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000050
      ...
      [   18.344519][  T301] pstate: a0400005 (NzCv daif +PAN -UAO)
      [   18.345213][  T301] pc : mtk_iommu_probe_device+0xf8/0x118 [mtk_iommu]
      [   18.346050][  T301] lr : mtk_iommu_probe_device+0xd0/0x118 [mtk_iommu]
      [   18.346884][  T301] sp : ffffffc00a5635e0
      [   18.347392][  T301] x29: ffffffc00a5635e0 x28: ffffffd44a46c1d8
      [   18.348156][  T301] x27: ffffff80c39a8000 x26: ffffffd44a80cc38
      [   18.348917][  T301] x25: 0000000000000000 x24: ffffffd44a80cc38
      [   18.349677][  T301] x23: ffffffd44e4da4c6 x22: ffffffd44a80cc38
      [   18.350438][  T301] x21: ffffff80cecd1880 x20: 0000000000000000
      [   18.351198][  T301] x19: ffffff80c439f010 x18: ffffffc00a50d0c0
      [   18.351959][  T301] x17: ffffffffffffffff x16: 0000000000000004
      [   18.352719][  T301] x15: 0000000000000004 x14: ffffffd44eb5d420
      [   18.353480][  T301] x13: 0000000000000ad2 x12: 0000000000000003
      [   18.354241][  T301] x11: 00000000fffffad2 x10: c0000000fffffad2
      [   18.355003][  T301] x9 : a0d288d8d7142d00 x8 : a0d288d8d7142d00
      [   18.355763][  T301] x7 : ffffffd44c2bc640 x6 : 0000000000000000
      [   18.356524][  T301] x5 : 0000000000000080 x4 : 0000000000000001
      [   18.357284][  T301] x3 : 0000000000000000 x2 : 0000000000000005
      [   18.358045][  T301] x1 : 0000000000000000 x0 : 0000000000000000
      [   18.360208][  T301] Hardware name: MT6873 (DT)
      [   18.360771][  T301] Call trace:
      [   18.361168][  T301]  dump_backtrace+0xf8/0x1f0
      [   18.361737][  T301]  dump_stack_lvl+0xa8/0x11c
      [   18.362305][  T301]  dump_stack+0x1c/0x2c
      [   18.362816][  T301]  mrdump_common_die+0x184/0x40c [mrdump]
      [   18.363575][  T301]  ipanic_die+0x24/0x38 [mrdump]
      [   18.364230][  T301]  atomic_notifier_call_chain+0x128/0x2b8
      [   18.364937][  T301]  die+0x16c/0x568
      [   18.365394][  T301]  __do_kernel_fault+0x1e8/0x214
      [   18.365402][  T301]  do_page_fault+0xb8/0x678
      [   18.366934][  T301]  do_translation_fault+0x48/0x64
      [   18.368645][  T301]  do_mem_abort+0x68/0x148
      [   18.368652][  T301]  el1_abort+0x40/0x64
      [   18.368660][  T301]  el1h_64_sync_handler+0x54/0x88
      [   18.368668][  T301]  el1h_64_sync+0x68/0x6c
      [   18.368673][  T301]  mtk_iommu_probe_device+0xf8/0x118 [mtk_iommu]
      ...
      
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Yong Wu <yong.wu@mediatek.com>
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Fixes: 635319a4
      
       ("media: iommu/mediatek: Add device_link between the consumer and the larb devices")
      Signed-off-by: default avatarMiles Chen <miles.chen@mediatek.com>
      Reviewed-by: default avatarYong Wu <yong.wu@mediatek.com>
      Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
      Link: https://lore.kernel.org/r/20220505132731.21628-1-miles.chen@mediatek.com
      
      
      Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      de78657e
  13. May 04, 2022
  14. Feb 28, 2022
  15. Feb 25, 2022
  16. Jan 28, 2022
  17. Aug 18, 2021
  18. Jun 08, 2021
  19. Apr 16, 2021
  20. Apr 07, 2021
  21. Jun 30, 2020
  22. May 19, 2020
  23. May 18, 2020
  24. May 05, 2020
  25. Mar 27, 2020
  26. Oct 15, 2019
  27. Sep 13, 2019
  28. Aug 30, 2019
  29. Jul 29, 2019
    • Will Deacon's avatar
      iommu: Pass struct iommu_iotlb_gather to ->unmap() and ->iotlb_sync() · 56f8af5e
      Will Deacon authored
      
      To allow IOMMU drivers to batch up TLB flushing operations and postpone
      them until ->iotlb_sync() is called, extend the prototypes for the
      ->unmap() and ->iotlb_sync() IOMMU ops callbacks to take a pointer to
      the current iommu_iotlb_gather structure.
      
      All affected IOMMU drivers are updated, but there should be no
      functional change since the extra parameter is ignored for now.
      
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      56f8af5e