From: Greg Kroah-Hartman gregkh@linuxfoundation.org
stable inclusion from stable-5.10.52 commit b3aea76efe90d7676e6965fe2f017d7ffc128b37 bugzilla: 175542 https://gitee.com/openeuler/kernel/issues/I4DTKU
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
This reverts commit fcb041ca5c7787b096aafc899e45f93583e66cbd which is commit 0ecb51824e838372e01330752503ddf9c0430ef7 upstream.
Turns out this was incomplete, as it is missing a dependancy, so drop it from the tree.
Link: https://lore.kernel.org/r/CAJn8CcHHKSo7GF29Z1ufXJJpMUzn6+fdvwiqe9=JvgpcfvnbH... Reported-by: Xiaotian Feng xtfeng@gmail.com Cc: Thomas Zimmermann tzimmermann@suse.de Cc: Michael J. Ruhl michael.j.ruhl@intel.com Cc: KuoHsiang Chou kuohsiang_chou@aspeedtech.com Cc: kernel test robot lkp@intel.com Cc: Thomas Zimmermann tzimmermann@suse.de Cc: Dave Airlie airlied@redhat.com Cc: dri-devel@lists.freedesktop.org Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org Signed-off-by: Chen Jun chenjun102@huawei.com Acked-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Chen Jun chenjun102@huawei.com --- drivers/gpu/drm/ast/ast_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index cf08215a9f21..0d163511564e 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -406,6 +406,7 @@ struct ast_private *ast_device_create(struct drm_driver *drv, return ast; dev = &ast->base;
+ dev->pdev = pdev; pci_set_drvdata(pdev, dev);
ast->regs = pcim_iomap(pdev, 1, 0); @@ -447,8 +448,8 @@ struct ast_private *ast_device_create(struct drm_driver *drv,
/* map reserved buffer */ ast->dp501_fw_buf = NULL; - if (dev->vram_mm->vram_size < pci_resource_len(pdev, 0)) { - ast->dp501_fw_buf = pci_iomap_range(pdev, 0, dev->vram_mm->vram_size, 0); + if (dev->vram_mm->vram_size < pci_resource_len(dev->pdev, 0)) { + ast->dp501_fw_buf = pci_iomap_range(dev->pdev, 0, dev->vram_mm->vram_size, 0); if (!ast->dp501_fw_buf) drm_info(dev, "failed to map reserved buffer!\n"); }