Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp571989pxv; Thu, 22 Jul 2021 07:15:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSLZRtEA9q5+MtmDujMzwVAZ4CA/xI5naP0bqCCkzO7KFHxbmHlwByEhOR87tMLyR7PiK5 X-Received: by 2002:a05:6602:1203:: with SMTP id y3mr5628iot.192.1626963301722; Thu, 22 Jul 2021 07:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626963301; cv=none; d=google.com; s=arc-20160816; b=mLHJ7tU3CRitugsRiroYQBTMJUBWDEqa4g3trbLLiriP/2AS9rGw00vbm2YQsMiB+r ca+44A2Qii4F3jv99xyo1wSHMgLWn4dwyzyW3SNpIreZm/0Y35UIZh8gBi3ZYixlhhFw 2FCeg67L2HQr9pdjEaw0EmDcaQxfJ5gR+xDLoh1JDoSXaGv1EBUvVHUV/Tkei29k9/BP 9UxvsLuEriE8ZQFxCnga/btdweKGs96Q2QiIJbgoTQwxx+9kbfvyvK6dnbRwR6xUNNaV zVLlZXuqcmcdp+Q08efkvdahnBAN3OGDUKGvXS1vVbx9f0QVRGaDQultjAcn6xseVBsc Q4mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ALqJhCVkys9gafFjMP2YjCRw2UKoeiPg90MVyuxjqKk=; b=K0x9a0R9b57BaZKBBgZdqjaTDVlxxseA4ZM8pWoSwZ5EwTxNml5aCX4OaVnYCm1Th7 2VPMWHx2jGW8l49eCaVOpvGHUghooOYZkKh/rf42fgO+BgR/puQ4FCPjX+7cDBQJdeIO AULRNOg5Pk+vopn8MWhnqLEuhmIoJ5duXqDCG/1RiUxkZcW/53oM5B5IvdJsUwuxDLFA CaPphFn3l4v8l2Y0atSpViecZfgWppTZ8C9eGhAsbckkgLXSenEWcRMvo9t11fOcHubi WwbDG4qh32xBDLvqy1rrQ7bAUj9ggYS5gbmUGu0iWit/7zv01+56H2zerpDA2T98cLTG z/rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tl4NKjzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b20si21166229jat.16.2021.07.22.07.14.50; Thu, 22 Jul 2021 07:15:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Tl4NKjzu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232242AbhGVNbo (ORCPT + 99 others); Thu, 22 Jul 2021 09:31:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:40768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbhGVNbn (ORCPT ); Thu, 22 Jul 2021 09:31:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4972B613AA; Thu, 22 Jul 2021 14:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626963137; bh=Uws4FcnI2E78ZjWf4YvL6GyC8qkD43T2o2gKpCOur5c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Tl4NKjzuSQpoHwqkt0rtf0GQ6qfD/Ge3rYMGIlWS1BSDX493/Sx5chHONM/07gMs2 HxrNrwqw/OwHpLk7QwSEkVWqqgcXL6/MceEVa1NCj6vL8LYn6YCdvffYwibTIYP5BM pxiWDgVU2Af82hdRaBYgZtfB5vr4FOvYfv2xBKow= Date: Thu, 22 Jul 2021 16:12:15 +0200 From: Greg Kroah-Hartman To: Thomas Zimmermann Cc: Xiaotian Feng , kernel test robot , linux-kernel , stable@vger.kernel.org, "Michael J. Ruhl" , dri-devel@lists.freedesktop.org, Dave Airlie Subject: Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev Message-ID: References: <20210715182551.731989182@linuxfoundation.org> <20210715182634.577299401@linuxfoundation.org> <2ba3d853-f334-ba0e-3cdc-1e9a03f99b51@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ba3d853-f334-ba0e-3cdc-1e9a03f99b51@suse.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 19, 2021 at 04:35:21PM +0200, Thomas Zimmermann wrote: > hi > > Am 19.07.21 um 13:23 schrieb Greg Kroah-Hartman: > > On Mon, Jul 19, 2021 at 05:57:30PM +0800, Xiaotian Feng wrote: > > > On Fri, Jul 16, 2021 at 5:13 AM Greg Kroah-Hartman > > > wrote: > > > > > > > > From: Thomas Zimmermann > > > > > > > > commit 0ecb51824e838372e01330752503ddf9c0430ef7 upstream. > > > > > > > > Using struct drm_device.pdev is deprecated. Upcast with to_pci_dev() > > > > from struct drm_device.dev to get the PCI device structure. > > > > > > > > v9: > > > > * fix remaining pdev references > > > > > > > > Signed-off-by: Thomas Zimmermann > > > > Reviewed-by: Michael J. Ruhl > > > > Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501") > > > > Cc: KuoHsiang Chou > > > > Cc: kernel test robot > > > > Cc: Thomas Zimmermann > > > > Cc: Dave Airlie > > > > Cc: dri-devel@lists.freedesktop.org > > > > Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de > > > > Signed-off-by: Greg Kroah-Hartman > > > > --- > > > > drivers/gpu/drm/ast/ast_main.c | 5 ++--- > > > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > > > > > --- a/drivers/gpu/drm/ast/ast_main.c > > > > +++ b/drivers/gpu/drm/ast/ast_main.c > > > > @@ -411,7 +411,6 @@ struct ast_private *ast_device_create(co > > > > return ast; > > > > dev = &ast->base; > > > > > > > > - dev->pdev = pdev; > > > > pci_set_drvdata(pdev, dev); > > > > > > > > ast->regs = pcim_iomap(pdev, 1, 0); > > > > @@ -453,8 +452,8 @@ struct ast_private *ast_device_create(co > > > > > > > > /* map reserved buffer */ > > > > ast->dp501_fw_buf = NULL; > > > > - 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 (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 (!ast->dp501_fw_buf) > > > > drm_info(dev, "failed to map reserved buffer!\n"); > > > > } > > > > > > > > > > Hi Greg, > > > > > > This backport is incomplete for 5.10 kernel, kernel is panicked > > > on RIP: ast_device_create+0x7d. When I look into the crash code, I > > > found > > > > > > struct ast_private *ast_device_create(struct drm_driver *drv, > > > struct pci_dev *pdev, > > > unsigned long flags) > > > { > > > ....... > > > dev->pdev = pdev; // This is removed > > > pci_set_drvdata(pdev, dev); > > > > > > ast->regs = pcim_iomap(pdev, 1, 0); > > > if (!ast->regs) > > > return ERR_PTR(-EIO); > > > > > > /* > > > * If we don't have IO space at all, use MMIO now and > > > * assume the chip has MMIO enabled by default (rev 0x20 > > > * and higher). > > > */ > > > if (!(pci_resource_flags(dev->pdev, 2) & IORESOURCE_IO)) { // > > > dev->pdev is in used here. > > > drm_info(dev, "platform has no IO space, trying MMIO\n"); > > > ast->ioregs = ast->regs + AST_IO_MM_OFFSET; > > > } > > > > > > That's because commit 46fb883c3d0d8a823ef995ddb1f9b0817dea6882 > > > is not backported to 5.10 kernel. > > > > So what should I do here? Backport that commit (was was not called > > out), or just revert this? > > Best drop all these 'remove pdev' patches from stable. They are no bugfixes. Which specific commits were they? thanks, greg k-h