[PATCH 0/2] [SRU][B/C/D/OEM]Fix Xorg crash with nomodeset when BIOS

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/2] [SRU][B/C/D/OEM]Fix Xorg crash with nomodeset when BIOS

Aaron Ma
BugLink: https://bugs.launchpad.net/bugs/1812797

[Impact]
On dual GPU platform, BIOS set frame buffer addr to 64-bit,
usually when CSM=NO setting in BIOS.
When no proper GPU driver loaded, Xorg driver will use the wrong fb addr,
then crash.

[Fix]
Add 64-bit efifb support, make Xorg find the correct GPU fb addr.
If still failed, use the first GPU as default.

[Test]
Tested on Intel and NV dual GPU platform. Works fine.

[Regression Potential]
Upstream fix, low risk.
Verified on ThinkPad P1/P52.

Aaron Ma (2):
  vgaarb: Add support for 64-bit frame buffer address
  vgaarb: Keep adding VGA device in queue

 drivers/gpu/vga/vgaarb.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] vgaarb: Add support for 64-bit frame buffer address

Aaron Ma
BugLink: https://bugs.launchpad.net/bugs/1812797

EFI GOP uses 64-bit frame buffer address when some BIOS
disabled CSM support. vgaarb only stores lfb_base,
this will lead boot framebuffer to wrong device.

Add ext_lfb_base support to use 64-bit fb address.

Signed-off-by: Aaron Ma <[hidden email]>
Acked-by: Alex Deucher <[hidden email]>
Signed-off-by: Daniel Vetter <[hidden email]>
Link: https://patchwork.freedesktop.org/patch/msgid/1535739600-8842-1-git-send-email-aaron.ma@...
(cherry picked from commit a81c9ab678802075b7942c41cf640d9d9866d2db)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/gpu/vga/vgaarb.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index d35d6d271f3f..952227c3fef9 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -1408,6 +1408,18 @@ static void __init vga_arb_select_default_device(void)
  struct vga_device *vgadev;
 
 #if defined(CONFIG_X86) || defined(CONFIG_IA64)
+ u64 base = screen_info.lfb_base;
+ u64 size = screen_info.lfb_size;
+ u64 limit;
+ resource_size_t start, end;
+ unsigned long flags;
+ int i;
+
+ if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
+ base |= (u64)screen_info.ext_lfb_base << 32;
+
+ limit = base + size;
+
  list_for_each_entry(vgadev, &vga_list, list) {
  struct device *dev = &vgadev->pdev->dev;
  /*
@@ -1418,11 +1430,6 @@ static void __init vga_arb_select_default_device(void)
  * Select the device owning the boot framebuffer if there is
  * one.
  */
- resource_size_t start, end, limit;
- unsigned long flags;
- int i;
-
- limit = screen_info.lfb_base + screen_info.lfb_size;
 
  /* Does firmware framebuffer belong to us? */
  for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
@@ -1437,7 +1444,7 @@ static void __init vga_arb_select_default_device(void)
  if (!start || !end)
  continue;
 
- if (screen_info.lfb_base < start || limit >= end)
+ if (base < start || limit >= end)
  continue;
 
  if (!vga_default_device())
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] vgaarb: Keep adding VGA device in queue

Aaron Ma
In reply to this post by Aaron Ma
BugLink: https://bugs.launchpad.net/bugs/1812797

If failed to find the deivice owning the boot framebuffer,
try to use the first VGA device instead of the last one.

Usually the 1st device is integrated GPU who owns the boot framebuffer.

Signed-off-by: Aaron Ma <[hidden email]>
Acked-by: Alex Deucher <[hidden email]>
Signed-off-by: Daniel Vetter <[hidden email]>
Link: https://patchwork.freedesktop.org/patch/msgid/1535739600-8842-2-git-send-email-aaron.ma@...
(cherry picked from commit 3d42f1ddc47a69c0ce155f9f30d764c4d689a5fa)
Signed-off-by: Aaron Ma <[hidden email]>
---
 drivers/gpu/vga/vgaarb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 952227c3fef9..9a72757eed86 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -676,7 +676,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev)
  vga_arbiter_check_bridge_sharing(vgadev);
 
  /* Add to the list */
- list_add(&vgadev->list, &vga_list);
+ list_add_tail(&vgadev->list, &vga_list);
  vga_count++;
  vgaarb_info(&pdev->dev, "VGA device added: decodes=%s,owns=%s,locks=%s\n",
  vga_iostate_to_str(vgadev->decodes),
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK / APPLIED[D]: [PATCH 0/2] [SRU][B/C/D/OEM]Fix Xorg crash with nomodeset when BIOS

Seth Forshee
In reply to this post by Aaron Ma
On Tue, Jan 22, 2019 at 03:05:44PM +0800, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1812797
>
> [Impact]
> On dual GPU platform, BIOS set frame buffer addr to 64-bit,
> usually when CSM=NO setting in BIOS.
> When no proper GPU driver loaded, Xorg driver will use the wrong fb addr,
> then crash.
>
> [Fix]
> Add 64-bit efifb support, make Xorg find the correct GPU fb addr.
> If still failed, use the first GPU as default.
>
> [Test]
> Tested on Intel and NV dual GPU platform. Works fine.
>
> [Regression Potential]
> Upstream fix, low risk.
> Verified on ThinkPad P1/P52.

Upstream cherry picks, positive testing.

Acked-by: Seth Forshee <[hidden email]>

Applied to disco/master-next, thanks!

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 0/2] [SRU][B/C/D/OEM]Fix Xorg crash with nomodeset when BIOS

Stefan Bader-2
In reply to this post by Aaron Ma
On 22.01.19 08:05, Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1812797
>
> [Impact]
> On dual GPU platform, BIOS set frame buffer addr to 64-bit,
> usually when CSM=NO setting in BIOS.
> When no proper GPU driver loaded, Xorg driver will use the wrong fb addr,
> then crash.
>
> [Fix]
> Add 64-bit efifb support, make Xorg find the correct GPU fb addr.
> If still failed, use the first GPU as default.
>
> [Test]
> Tested on Intel and NV dual GPU platform. Works fine.
>
> [Regression Potential]
> Upstream fix, low risk.
> Verified on ThinkPad P1/P52.
>
> Aaron Ma (2):
>   vgaarb: Add support for 64-bit frame buffer address
>   vgaarb: Keep adding VGA device in queue
>
>  drivers/gpu/vga/vgaarb.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
Acked-by: Stefan Bader <[hidden email]>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED(B,C): [PATCH 0/2] [SRU][B/C/D/OEM]Fix Xorg crash with nomodeset when BIOS

Khaled Elmously
In reply to this post by Aaron Ma
On 2019-01-22 15:05:44 , Aaron Ma wrote:

> BugLink: https://bugs.launchpad.net/bugs/1812797
>
> [Impact]
> On dual GPU platform, BIOS set frame buffer addr to 64-bit,
> usually when CSM=NO setting in BIOS.
> When no proper GPU driver loaded, Xorg driver will use the wrong fb addr,
> then crash.
>
> [Fix]
> Add 64-bit efifb support, make Xorg find the correct GPU fb addr.
> If still failed, use the first GPU as default.
>
> [Test]
> Tested on Intel and NV dual GPU platform. Works fine.
>
> [Regression Potential]
> Upstream fix, low risk.
> Verified on ThinkPad P1/P52.
>
> Aaron Ma (2):
>   vgaarb: Add support for 64-bit frame buffer address
>   vgaarb: Keep adding VGA device in queue
>
>  drivers/gpu/vga/vgaarb.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> --
> 2.17.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team