* [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
[not found] <20210715182551.731989182@linuxfoundation.org>
@ 2021-07-15 18:39 ` Greg Kroah-Hartman
2021-07-19 9:57 ` Xiaotian Feng
0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2021-07-15 18:39 UTC (permalink / raw)
To: linux-kernel
Cc: kernel test robot, Greg Kroah-Hartman, stable, Michael J. Ruhl,
dri-devel, Thomas Zimmermann, Dave Airlie
From: Thomas Zimmermann <tzimmermann@suse.de>
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 <tzimmermann@suse.de>
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
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
Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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");
}
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
2021-07-15 18:39 ` [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev Greg Kroah-Hartman
@ 2021-07-19 9:57 ` Xiaotian Feng
2021-07-19 11:23 ` Greg Kroah-Hartman
0 siblings, 1 reply; 7+ messages in thread
From: Xiaotian Feng @ 2021-07-19 9:57 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: kernel test robot, linux-kernel, stable, Michael J. Ruhl,
dri-devel, Thomas Zimmermann, Dave Airlie
On Fri, Jul 16, 2021 at 5:13 AM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> From: Thomas Zimmermann <tzimmermann@suse.de>
>
> 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 <tzimmermann@suse.de>
> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
> 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
> Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> 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.
Best Regards
Xiaotian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
2021-07-19 9:57 ` Xiaotian Feng
@ 2021-07-19 11:23 ` Greg Kroah-Hartman
2021-07-19 11:43 ` Xiaotian Feng
2021-07-19 14:35 ` Thomas Zimmermann
0 siblings, 2 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2021-07-19 11:23 UTC (permalink / raw)
To: Xiaotian Feng
Cc: kernel test robot, linux-kernel, stable, Michael J. Ruhl,
dri-devel, Thomas Zimmermann, Dave Airlie
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
> <gregkh@linuxfoundation.org> wrote:
> >
> > From: Thomas Zimmermann <tzimmermann@suse.de>
> >
> > 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 <tzimmermann@suse.de>
> > Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> > Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
> > 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
> > Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> > 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
2021-07-19 11:23 ` Greg Kroah-Hartman
@ 2021-07-19 11:43 ` Xiaotian Feng
2021-07-19 13:05 ` Greg Kroah-Hartman
2021-07-19 14:35 ` Thomas Zimmermann
1 sibling, 1 reply; 7+ messages in thread
From: Xiaotian Feng @ 2021-07-19 11:43 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: kernel test robot, linux-kernel, stable, Michael J. Ruhl,
dri-devel, Thomas Zimmermann, Dave Airlie
On Mon, Jul 19, 2021 at 7:23 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> 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
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > From: Thomas Zimmermann <tzimmermann@suse.de>
> > >
> > > 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 <tzimmermann@suse.de>
> > > Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> > > Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
> > > 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
> > > Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > ---
> > > 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?
>
I think we can just simply revert the patch. Because commit 46fb883c
removed drm_device.pdev usage,
then commit ba4e0339 used drm_device.pdev again. Since commit 46fb883c
is not in 5.10.50 kernel,
it's not a stable fix.
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
2021-07-19 11:43 ` Xiaotian Feng
@ 2021-07-19 13:05 ` Greg Kroah-Hartman
0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2021-07-19 13:05 UTC (permalink / raw)
To: Xiaotian Feng
Cc: kernel test robot, linux-kernel, stable, Michael J. Ruhl,
dri-devel, Thomas Zimmermann, Dave Airlie
On Mon, Jul 19, 2021 at 07:43:39PM +0800, Xiaotian Feng wrote:
> On Mon, Jul 19, 2021 at 7:23 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > 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
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > From: Thomas Zimmermann <tzimmermann@suse.de>
> > > >
> > > > 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 <tzimmermann@suse.de>
> > > > Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> > > > Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
> > > > 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
> > > > Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
> > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > ---
> > > > 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?
> >
> I think we can just simply revert the patch. Because commit 46fb883c
> removed drm_device.pdev usage,
> then commit ba4e0339 used drm_device.pdev again. Since commit 46fb883c
> is not in 5.10.50 kernel,
> it's not a stable fix.
Now qropped, thanks.
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
2021-07-19 11:23 ` Greg Kroah-Hartman
2021-07-19 11:43 ` Xiaotian Feng
@ 2021-07-19 14:35 ` Thomas Zimmermann
2021-07-22 14:12 ` Greg Kroah-Hartman
1 sibling, 1 reply; 7+ messages in thread
From: Thomas Zimmermann @ 2021-07-19 14:35 UTC (permalink / raw)
To: Greg Kroah-Hartman, Xiaotian Feng
Cc: kernel test robot, linux-kernel, dri-devel, Michael J. Ruhl,
stable, Dave Airlie
[-- Attachment #1.1: Type: text/plain, Size: 3884 bytes --]
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
>> <gregkh@linuxfoundation.org> wrote:
>>>
>>> From: Thomas Zimmermann <tzimmermann@suse.de>
>>>
>>> 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 <tzimmermann@suse.de>
>>> Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
>>> Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
>>> 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
>>> Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
>>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>> ---
>>> 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.
Best regards
Thomas
>
> thanks,
>
> greg k-h
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev
2021-07-19 14:35 ` Thomas Zimmermann
@ 2021-07-22 14:12 ` Greg Kroah-Hartman
0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2021-07-22 14:12 UTC (permalink / raw)
To: Thomas Zimmermann
Cc: kernel test robot, linux-kernel, dri-devel, Michael J. Ruhl,
stable, Dave Airlie, Xiaotian Feng
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
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > From: Thomas Zimmermann <tzimmermann@suse.de>
> > > >
> > > > 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 <tzimmermann@suse.de>
> > > > Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
> > > > Fixes: ba4e0339a6a3 ("drm/ast: Fixed CVE for DP501")
> > > > 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
> > > > Link: https://patchwork.freedesktop.org/patch/msgid/20210429105101.25667-2-tzimmermann@suse.de
> > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > ---
> > > > 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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-07-22 14:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20210715182551.731989182@linuxfoundation.org>
2021-07-15 18:39 ` [PATCH 5.12 237/242] drm/ast: Remove reference to struct drm_device.pdev Greg Kroah-Hartman
2021-07-19 9:57 ` Xiaotian Feng
2021-07-19 11:23 ` Greg Kroah-Hartman
2021-07-19 11:43 ` Xiaotian Feng
2021-07-19 13:05 ` Greg Kroah-Hartman
2021-07-19 14:35 ` Thomas Zimmermann
2021-07-22 14:12 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox