linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
@ 2020-03-13  8:41 Gerd Hoffmann
  2020-03-13  9:03 ` Sam Ravnborg
  2020-03-17 16:49 ` Daniel Vetter
  0 siblings, 2 replies; 7+ messages in thread
From: Gerd Hoffmann @ 2020-03-13  8:41 UTC (permalink / raw)
  To: dri-devel
  Cc: marmarek, Gerd Hoffmann, David Airlie, Daniel Vetter,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

Shutdown of firmware framebuffer has a bunch of problems.  Because
of this the framebuffer region might still be reserved even after
drm_fb_helper_remove_conflicting_pci_framebuffers() returned.

Don't consider pci_request_region() failure for the framebuffer
region as fatal error to workaround this issue.

Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/bochs/bochs_hw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
index 952199cc0462..dce4672e3fc8 100644
--- a/drivers/gpu/drm/bochs/bochs_hw.c
+++ b/drivers/gpu/drm/bochs/bochs_hw.c
@@ -157,10 +157,8 @@ int bochs_hw_init(struct drm_device *dev)
 		size = min(size, mem);
 	}
 
-	if (pci_request_region(pdev, 0, "bochs-drm") != 0) {
-		DRM_ERROR("Cannot request framebuffer\n");
-		return -EBUSY;
-	}
+	if (pci_request_region(pdev, 0, "bochs-drm") != 0)
+		DRM_WARN("Cannot request framebuffer, boot fb still active?\n");
 
 	bochs->fb_map = ioremap(addr, size);
 	if (bochs->fb_map == NULL) {
-- 
2.18.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
  2020-03-13  8:41 [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning Gerd Hoffmann
@ 2020-03-13  9:03 ` Sam Ravnborg
  2020-03-13 14:35   ` Gerd Hoffmann
  2020-03-17 16:49 ` Daniel Vetter
  1 sibling, 1 reply; 7+ messages in thread
From: Sam Ravnborg @ 2020-03-13  9:03 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, marmarek, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

Hi Gred.

On Fri, Mar 13, 2020 at 09:41:52AM +0100, Gerd Hoffmann wrote:
> Shutdown of firmware framebuffer has a bunch of problems.  Because
> of this the framebuffer region might still be reserved even after
> drm_fb_helper_remove_conflicting_pci_framebuffers() returned.
> 
> Don't consider pci_request_region() failure for the framebuffer
> region as fatal error to workaround this issue.
> 
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/bochs/bochs_hw.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> index 952199cc0462..dce4672e3fc8 100644
> --- a/drivers/gpu/drm/bochs/bochs_hw.c
> +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> @@ -157,10 +157,8 @@ int bochs_hw_init(struct drm_device *dev)

There is a drm_device avilable.

>  		size = min(size, mem);
>  	}
>  
> -	if (pci_request_region(pdev, 0, "bochs-drm") != 0) {
> -		DRM_ERROR("Cannot request framebuffer\n");
> -		return -EBUSY;
> -	}
> +	if (pci_request_region(pdev, 0, "bochs-drm") != 0)
> +		DRM_WARN("Cannot request framebuffer, boot fb still active?\n");
So you could use drm_WARN() which is what is preferred these days.
With this fixed:
Acked-by: Sam Ravnborg <sam@ravnborg.org>

	Sam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
  2020-03-13  9:03 ` Sam Ravnborg
@ 2020-03-13 14:35   ` Gerd Hoffmann
  2020-03-13 18:16     ` Sam Ravnborg
  0 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2020-03-13 14:35 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: dri-devel, marmarek, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

  Hi,

> > +	if (pci_request_region(pdev, 0, "bochs-drm") != 0)
> > +		DRM_WARN("Cannot request framebuffer, boot fb still active?\n");
> So you could use drm_WARN() which is what is preferred these days.

Nope, this isn't yet in -fixes.

cheers,
  Gerd


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
  2020-03-13 14:35   ` Gerd Hoffmann
@ 2020-03-13 18:16     ` Sam Ravnborg
  0 siblings, 0 replies; 7+ messages in thread
From: Sam Ravnborg @ 2020-03-13 18:16 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, marmarek, David Airlie, open list,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU

On Fri, Mar 13, 2020 at 03:35:30PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > > +	if (pci_request_region(pdev, 0, "bochs-drm") != 0)
> > > +		DRM_WARN("Cannot request framebuffer, boot fb still active?\n");
> > So you could use drm_WARN() which is what is preferred these days.
> 
> Nope, this isn't yet in -fixes.
Ups, did not see this was for -fixes.
My ack stands without ths change then.

	Sam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
  2020-03-13  8:41 [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning Gerd Hoffmann
  2020-03-13  9:03 ` Sam Ravnborg
@ 2020-03-17 16:49 ` Daniel Vetter
  2020-03-18  6:42   ` Gerd Hoffmann
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2020-03-17 16:49 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, marmarek, David Airlie, Daniel Vetter,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

On Fri, Mar 13, 2020 at 09:41:52AM +0100, Gerd Hoffmann wrote:
> Shutdown of firmware framebuffer has a bunch of problems.  Because
> of this the framebuffer region might still be reserved even after
> drm_fb_helper_remove_conflicting_pci_framebuffers() returned.

Is that still the fbdev lifetime fun where the cleanup might be delayed if
the char device node is still open?
-Daniel

> 
> Don't consider pci_request_region() failure for the framebuffer
> region as fatal error to workaround this issue.
> 
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/bochs/bochs_hw.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c
> index 952199cc0462..dce4672e3fc8 100644
> --- a/drivers/gpu/drm/bochs/bochs_hw.c
> +++ b/drivers/gpu/drm/bochs/bochs_hw.c
> @@ -157,10 +157,8 @@ int bochs_hw_init(struct drm_device *dev)
>  		size = min(size, mem);
>  	}
>  
> -	if (pci_request_region(pdev, 0, "bochs-drm") != 0) {
> -		DRM_ERROR("Cannot request framebuffer\n");
> -		return -EBUSY;
> -	}
> +	if (pci_request_region(pdev, 0, "bochs-drm") != 0)
> +		DRM_WARN("Cannot request framebuffer, boot fb still active?\n");
>  
>  	bochs->fb_map = ioremap(addr, size);
>  	if (bochs->fb_map == NULL) {
> -- 
> 2.18.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
  2020-03-17 16:49 ` Daniel Vetter
@ 2020-03-18  6:42   ` Gerd Hoffmann
  2020-03-19  8:39     ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Gerd Hoffmann @ 2020-03-18  6:42 UTC (permalink / raw)
  To: dri-devel, marmarek, David Airlie,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

On Tue, Mar 17, 2020 at 05:49:41PM +0100, Daniel Vetter wrote:
> On Fri, Mar 13, 2020 at 09:41:52AM +0100, Gerd Hoffmann wrote:
> > Shutdown of firmware framebuffer has a bunch of problems.  Because
> > of this the framebuffer region might still be reserved even after
> > drm_fb_helper_remove_conflicting_pci_framebuffers() returned.
> 
> Is that still the fbdev lifetime fun where the cleanup might be delayed if
> the char device node is still open?

Yes.

cheers,
  Gerd


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning
  2020-03-18  6:42   ` Gerd Hoffmann
@ 2020-03-19  8:39     ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2020-03-19  8:39 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: dri-devel, marmarek, David Airlie,
	open list:DRM DRIVER FOR BOCHS VIRTUAL GPU, open list

On Wed, Mar 18, 2020 at 7:49 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Tue, Mar 17, 2020 at 05:49:41PM +0100, Daniel Vetter wrote:
> > On Fri, Mar 13, 2020 at 09:41:52AM +0100, Gerd Hoffmann wrote:
> > > Shutdown of firmware framebuffer has a bunch of problems.  Because
> > > of this the framebuffer region might still be reserved even after
> > > drm_fb_helper_remove_conflicting_pci_framebuffers() returned.
> >
> > Is that still the fbdev lifetime fun where the cleanup might be delayed if
> > the char device node is still open?
>
> Yes.

In that case I think a FIXME comment that this should be upgraded
again to a full error once fbdev unloading is fixed should be added.
With that:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I guess you might want a cc: stable on this too?
-Daniel

>
> cheers,
>   Gerd
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-03-19  8:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-13  8:41 [PATCH v3] drm/bochs: downgrade pci_request_region failure from error to warning Gerd Hoffmann
2020-03-13  9:03 ` Sam Ravnborg
2020-03-13 14:35   ` Gerd Hoffmann
2020-03-13 18:16     ` Sam Ravnborg
2020-03-17 16:49 ` Daniel Vetter
2020-03-18  6:42   ` Gerd Hoffmann
2020-03-19  8:39     ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).