All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device
@ 2016-09-13  5:53 Yongji Xie
  2016-09-27  3:02 ` Yongji Xie
  2016-09-27  7:55 ` Tomi Valkeinen
  0 siblings, 2 replies; 3+ messages in thread
From: Yongji Xie @ 2016-09-13  5:53 UTC (permalink / raw)
  To: linux-fbdev

Currently the offb module will use the PCI VGA device as frame
buffer device without calling something like pci_enable_device().
However, this would cause some problem if we disable memory
decoding of the upstream bridge before. When the console driver
issued memory access to the VGA device, the access cannot be
supported by the bridge which will cause EEH error on Power machine.

Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
---
 drivers/video/fbdev/offb.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
index fb60a8f..906c6e7 100644
--- a/drivers/video/fbdev/offb.c
+++ b/drivers/video/fbdev/offb.c
@@ -625,6 +625,21 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
 	if (address = OF_BAD_ADDR && addr_prop)
 		address = (u64)addr_prop;
 	if (address != OF_BAD_ADDR) {
+#ifdef CONFIG_PCI
+		const __be32 *vidp, *didp;
+		u32 vid, did;
+		struct pci_dev *pdev;
+
+		vidp = of_get_property(dp, "vendor-id", NULL);
+		didp = of_get_property(dp, "device-id", NULL);
+		if (vidp && didp) {
+			vid = be32_to_cpup(vidp);
+			did = be32_to_cpup(didp);
+			pdev = pci_get_device(vid, did, NULL);
+			if (!pdev || pci_enable_device(pdev))
+				return;
+		}
+#endif
 		/* kludge for valkyrie */
 		if (strcmp(dp->name, "valkyrie") = 0)
 			address += 0x1000;
-- 
1.8.3.1


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

* Re: [PATCH] video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device
  2016-09-13  5:53 [PATCH] video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device Yongji Xie
@ 2016-09-27  3:02 ` Yongji Xie
  2016-09-27  7:55 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Yongji Xie @ 2016-09-27  3:02 UTC (permalink / raw)
  To: linux-fbdev

Kindly ping...

Thanks,

Yongji

On 2016/9/13 13:53, Yongji Xie wrote:
> Currently the offb module will use the PCI VGA device as frame
> buffer device without calling something like pci_enable_device().
> However, this would cause some problem if we disable memory
> decoding of the upstream bridge before. When the console driver
> issued memory access to the VGA device, the access cannot be
> supported by the bridge which will cause EEH error on Power machine.
>
> Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
> ---
>   drivers/video/fbdev/offb.c | 15 +++++++++++++++
>   1 file changed, 15 insertions(+)
>
> diff --git a/drivers/video/fbdev/offb.c b/drivers/video/fbdev/offb.c
> index fb60a8f..906c6e7 100644
> --- a/drivers/video/fbdev/offb.c
> +++ b/drivers/video/fbdev/offb.c
> @@ -625,6 +625,21 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
>   	if (address = OF_BAD_ADDR && addr_prop)
>   		address = (u64)addr_prop;
>   	if (address != OF_BAD_ADDR) {
> +#ifdef CONFIG_PCI
> +		const __be32 *vidp, *didp;
> +		u32 vid, did;
> +		struct pci_dev *pdev;
> +
> +		vidp = of_get_property(dp, "vendor-id", NULL);
> +		didp = of_get_property(dp, "device-id", NULL);
> +		if (vidp && didp) {
> +			vid = be32_to_cpup(vidp);
> +			did = be32_to_cpup(didp);
> +			pdev = pci_get_device(vid, did, NULL);
> +			if (!pdev || pci_enable_device(pdev))
> +				return;
> +		}
> +#endif
>   		/* kludge for valkyrie */
>   		if (strcmp(dp->name, "valkyrie") = 0)
>   			address += 0x1000;


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

* Re: [PATCH] video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device
  2016-09-13  5:53 [PATCH] video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device Yongji Xie
  2016-09-27  3:02 ` Yongji Xie
@ 2016-09-27  7:55 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2016-09-27  7:55 UTC (permalink / raw)
  To: linux-fbdev


[-- Attachment #1.1: Type: text/plain, Size: 634 bytes --]

On 13/09/16 08:53, Yongji Xie wrote:
> Currently the offb module will use the PCI VGA device as frame
> buffer device without calling something like pci_enable_device().
> However, this would cause some problem if we disable memory
> decoding of the upstream bridge before. When the console driver
> issued memory access to the VGA device, the access cannot be
> supported by the bridge which will cause EEH error on Power machine.
> 
> Signed-off-by: Yongji Xie <xyjxie@linux.vnet.ibm.com>
> ---
>  drivers/video/fbdev/offb.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)

Thanks, queued for 4.9.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-09-27  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-13  5:53 [PATCH] video: fbdev: offb: Call pci_enable_device() before using the PCI VGA device Yongji Xie
2016-09-27  3:02 ` Yongji Xie
2016-09-27  7:55 ` Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.