1. 27 Jul, 2021 4 commits
  2. 26 Jul, 2021 2 commits
    • Jiri Kosina's avatar
      drm/amdgpu: Avoid printing of stack contents on firmware load error · 6aade587
      Jiri Kosina authored
      In case when psp_init_asd_microcode() fails to load ASD microcode file,
      psp_v12_0_init_microcode() tries to print the firmware filename that
      failed to load before bailing out.
      
      This is wrong because:
      
      - the firmware filename it would want it print is an incorrect one as
        psp_init_asd_microcode() and psp_v12_0_init_microcode() are loading
        different filenames
      - it tries to print fw_name, but that's not yet been initialized by that
        time, so it prints random stack contents, e.g.
      
          amdgpu 0000:04:00.0: Direct firmware load for amdgpu/renoir_asd.bin failed with error -2
          amdgpu 0000:04:00.0: amdgpu: fail to initialize asd microcode
          amdgpu 0000:04:00.0: amdgpu: psp v12.0: Failed to load firmware "\xfeTO\x8e\xff\xff"
      
      Fix that by bailing out immediately, instead of priting the bogus error
      message.
      Reported-by: default avatarVojtech Pavlik <vojtech@ucw.cz>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      6aade587
    • Jiri Kosina's avatar
      drm/amdgpu: Fix resource leak on probe error path · d47255d3
      Jiri Kosina authored
      This reverts commit 4192f7b5.
      
      It is not true (as stated in the reverted commit changelog) that we never
      unmap the BAR on failure; it actually does happen properly on
      amdgpu_driver_load_kms() -> amdgpu_driver_unload_kms() ->
      amdgpu_device_fini() error path.
      
      What's worse, this commit actually completely breaks resource freeing on
      probe failure (like e.g. failure to load microcode), as
      amdgpu_driver_unload_kms() notices adev->rmmio being NULL and bails too
      early, leaving all the resources that'd normally be freed in
      amdgpu_acpi_fini() and amdgpu_device_fini() still hanging around, leading
      to all sorts of oopses when someone tries to, for example, access the
      sysfs and procfs resources which are still around while the driver is
      gone.
      
      Fixes: 4192f7b5 ("drm/amdgpu: unmap register bar on device init failure")
      Reported-by: default avatarVojtech Pavlik <vojtech@ucw.cz>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      d47255d3
  3. 25 Jul, 2021 9 commits
  4. 24 Jul, 2021 25 commits