Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3599441pxv; Mon, 19 Jul 2021 04:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBgkEG4RlRuCkqOMVsEsICCvGvCm1qDhthIbtUjIDKirhmvlVMjQ4FnsFxvFRCjBj71kS+ X-Received: by 2002:a17:907:3da5:: with SMTP id he37mr26724240ejc.189.1626693935712; Mon, 19 Jul 2021 04:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626693935; cv=none; d=google.com; s=arc-20160816; b=HnOZdUhs6mwasKrZKIAcDsBxupqYimHpsg7I8b/1FsSyf/do95fEVbWyXgEzqlM5hv 58D9OBmN8g6i4SjFZUqUaoqeXGp/BlM4S84Q9N8eeZ7LYLKTvRpWczuUGKwea/xrCk9U OAQLt4Qcy9qqRgU1rTu5/7fTM/nd3ncouT0+EKmHdgs4yXihrSyI7fFD9GQ98X3n5yuP LmrLZv/QmWRa4AYDtj6HAkGU+wmTG5uWwRylV0c2zrD/j8dFXCAuLYHSurvJUHR9yfza tVVQZH2tXsCCLgHvmxH3Vv2hFLPi5Sni1U1laxB+Zgi0GzWIaMC49opzRzrXNpt9Kw1w lziQ== 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=X8WIt33caNz6dYd5JNzTPQ8pv2zVViHFshqBlN99W30=; b=B5rfBAWPYlqjuY5Var5ChMwfrwMPZRPJQluAWpI8iRiMDvOSza5NbHa5bD1rClxBLk io/4UBtPmUeaMKEVX4qRPhuvJjqWib3NQTmhY5Hxhyw+jxjZsJCrDuM2cVYintAl8MXx nZPhsv81hYM2sppwqiE0Tgk6cLWm+ebzYYzFpcOEzt9ZpAYJDanVaRT7at91PZ0CgPIm 9DCiskmFdsLGcngZFhxgpvWgy/XLIQvfVyMswf2km/gGNd8943DU9xPgimh6PMhVWNlq o+gK8Sb4DlA8SscwgxgfxYnk57qEOUyBVLmJ9vSjPnOAa+c+fqEW19X4DMUSEQ6VB1DX ur8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ScUCC1Y7; 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 k4si20206869edv.523.2021.07.19.04.25.12; Mon, 19 Jul 2021 04:25:35 -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=ScUCC1Y7; 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 S236468AbhGSKnM (ORCPT + 99 others); Mon, 19 Jul 2021 06:43:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:34212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236491AbhGSKm7 (ORCPT ); Mon, 19 Jul 2021 06:42:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 09334610CC; Mon, 19 Jul 2021 11:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626693818; bh=+MNpgNaFqW2ZiZAktLeNlF/Hkgwafj2mHobAqr4pDLA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ScUCC1Y7kdv7dK2/NeDyS8NhlT2mNvZk32vV1wVVFmvB720kHlqaDVhu3JyWjai5x 4cOLogx6sH/0OaHVrHkK0GXQYujlWsBNb5kkS1HAXR/On3dXD/tqJq9UFXJpf5GA3u Qei34IAUauGndiVVJW6lM5P/K7Kw9bZMMlOMOqMg= Date: Mon, 19 Jul 2021 13:23:35 +0200 From: Greg Kroah-Hartman To: Xiaotian Feng Cc: linux-kernel , stable@vger.kernel.org, Thomas Zimmermann , "Michael J. Ruhl" , KuoHsiang Chou , kernel test robot , Dave Airlie , dri-devel@lists.freedesktop.org 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? thanks, greg k-h