[RESEND][SRU][A][PATCH 0/1] Fix for LP#1738334 - hibmc regression

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

[RESEND][SRU][A][PATCH 0/1] Fix for LP#1738334 - hibmc regression

Daniel Axtens
[SRU Justification]

[Impact]
On Artful kernels, X fails to start and a kernel splat is printed.

This is because ea642c3216cb ("drm/ttm: add io_mem_pfn callback") is
incomplete: the hisilicon hibmc driver does not contain the callback
and so the kernel tries to execute code at NULL.

[Fix]
There is a discussion and potential fix at
https://lists.freedesktop.org/archives/dri-devel/2017-November/159002.html

That was deemed too ad-hoc and the community went with a larger fix
instead:
https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html
However, this comes with an uncomfortably large regression potential,
so I have stuck with the smaller fix for Artful - we can bring the
larger fix in for Bionic.

[Regression Potential]
Minimal - fix only touches hibmc driver. Tested on D05 board.

[Testcase]
Install patched kernel, try to start X. If it succeeds, the fix
works. If there's a kernel splat and X does not start, the fix does
not work.

[Notes]
HiSilicon would really like this fix in Artful in such time so that
when the next 16.04 point release ships in February, the HWE kernel
will work with Xorg.

Michal Srb (1):
  UBUNTU: SAUCE: drm: hibmc: Initialize the hibmc_bo_driver.io_mem_pfn

 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 1 +
 1 file changed, 1 insertion(+)

--
2.11.0


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

[RESEND][SRU][A][PATCH 1/1] UBUNTU: SAUCE: drm: hibmc: Initialize the hibmc_bo_driver.io_mem_pfn

Daniel Axtens
From: Michal Srb <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1738334

The io_mem_pfn field was added in ea642c3216cb2a60d1c0e760ae47ee85c9c16447 and
is used unconditionally. Most drivers were updated to set it to the default
implementation ttm_bo_default_io_mem_pfn, but hibmc was not.

This fixes crash in ttm_bo_vm_fault when hibmc driver is used.

Signed-off-by: Michal Srb <[hidden email]>
(cherry-picked from https://lists.freedesktop.org/archives/dri-devel/2017-November/159002.html)
[upstream fix at
  https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html
  is quite intrusive - this is the minimal fix]
Signed-off-by: Daniel Axtens <[hidden email]>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
index ac457c779caa..1a6c2a34771a 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
@@ -243,6 +243,7 @@ struct ttm_bo_driver hibmc_bo_driver = {
  .verify_access = hibmc_bo_verify_access,
  .io_mem_reserve = &hibmc_ttm_io_mem_reserve,
  .io_mem_free = NULL,
+ .io_mem_pfn = ttm_bo_default_io_mem_pfn,
 };
 
 int hibmc_mm_init(struct hibmc_drm_private *hibmc)
--
2.11.0


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

Re: [RESEND][SRU][A][PATCH 0/1] Fix for LP#1738334 - hibmc regression

Seth Forshee
In reply to this post by Daniel Axtens
On Thu, Jan 04, 2018 at 10:23:55AM +1100, Daniel Axtens wrote:

> [SRU Justification]
>
> [Impact]
> On Artful kernels, X fails to start and a kernel splat is printed.
>
> This is because ea642c3216cb ("drm/ttm: add io_mem_pfn callback") is
> incomplete: the hisilicon hibmc driver does not contain the callback
> and so the kernel tries to execute code at NULL.
>
> [Fix]
> There is a discussion and potential fix at
> https://lists.freedesktop.org/archives/dri-devel/2017-November/159002.html
>
> That was deemed too ad-hoc and the community went with a larger fix
> instead:
> https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html
> However, this comes with an uncomfortably large regression potential,
> so I have stuck with the smaller fix for Artful - we can bring the
> larger fix in for Bionic.
>
> [Regression Potential]
> Minimal - fix only touches hibmc driver. Tested on D05 board.
>
> [Testcase]
> Install patched kernel, try to start X. If it succeeds, the fix
> works. If there's a kernel splat and X does not start, the fix does
> not work.
>
> [Notes]
> HiSilicon would really like this fix in Artful in such time so that
> when the next 16.04 point release ships in February, the HWE kernel
> will work with Xorg.

I assume this will be wante for bionic also?

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

Re: [RESEND][SRU][A][PATCH 0/1] Fix for LP#1738334 - hibmc regression

Daniel Axtens
Just realised I replied to Seth directly - oops! Here's what I said:

======
Hi Seth,

I was thinking we might want to pull in the full patch set that
upstream settled upon for Bionic
(https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html)
It's a more general purpose solution that will prevent this from
recurring on other sorts of cards. It has been picked up for 4.16.

I can submit that separately - I haven't had time to do a backport and
test yet. Would you want this now, or later once we've moved to a 4.15
kernel? (just thinking of minimising your rebase effort...)
======

I've since had a look at what ended up landing in drm-next, and it
seems the series has been only partially merged, and we can just
cherry-pick the first patch - c67fa6edc8b11. It applies cleanly to
4.15-rc7 and is a trivial backport on to 4.14. (It is still a more
aggressive fix than the patch I submitted for Artful, and I can't
provide test coverage beyond the HiSilicon device, hence why I didn't
propose it for Artful.)

As I mentioned above, I can test and submit it now or later - Huawei's
concern is getting the Artful fix merged in time for inclusion in the
16.04.4 HWE edge kernel, so their users get Xorg support when they
boot the install media. So whatever will make that more likely I will
happily do :)

Regards,
Daniel

On Mon, Jan 8, 2018 at 7:57 AM, Daniel Axtens
<[hidden email]> wrote:

>
> Hi Seth,
>
> I was thinking we might want to pull in the full patch set that
> upstream settled upon for Bionic
> (https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html)
> It's a more general purpose solution that will prevent this from
> recurring on other sorts of cards. It has been picked up for 4.16.
>
> I can submit that separately - I haven't had time to do a backport and
> test yet. Would you want this now, or later once we've moved to a 4.15
> kernel? (just thinking of minimising your rebase effort...)
>
> Regards,
> Daniel
>
> On Sat, Jan 6, 2018 at 2:55 AM, Seth Forshee <[hidden email]> wrote:
> > On Thu, Jan 04, 2018 at 10:23:55AM +1100, Daniel Axtens wrote:
> >> [SRU Justification]
> >>
> >> [Impact]
> >> On Artful kernels, X fails to start and a kernel splat is printed.
> >>
> >> This is because ea642c3216cb ("drm/ttm: add io_mem_pfn callback") is
> >> incomplete: the hisilicon hibmc driver does not contain the callback
> >> and so the kernel tries to execute code at NULL.
> >>
> >> [Fix]
> >> There is a discussion and potential fix at
> >> https://lists.freedesktop.org/archives/dri-devel/2017-November/159002.html
> >>
> >> That was deemed too ad-hoc and the community went with a larger fix
> >> instead:
> >> https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html
> >> However, this comes with an uncomfortably large regression potential,
> >> so I have stuck with the smaller fix for Artful - we can bring the
> >> larger fix in for Bionic.
> >>
> >> [Regression Potential]
> >> Minimal - fix only touches hibmc driver. Tested on D05 board.
> >>
> >> [Testcase]
> >> Install patched kernel, try to start X. If it succeeds, the fix
> >> works. If there's a kernel splat and X does not start, the fix does
> >> not work.
> >>
> >> [Notes]
> >> HiSilicon would really like this fix in Artful in such time so that
> >> when the next 16.04 point release ships in February, the HWE kernel
> >> will work with Xorg.
> >
> > I assume this will be wante for bionic also?

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

ACK: [RESEND][SRU][A][PATCH 0/1] Fix for LP#1738334 - hibmc regression

Marcelo Henrique Cerri
In reply to this post by Daniel Axtens
Good test results with low impact risk.

Acked-by: Marcelo Henrique Cerri <[hidden email]>

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

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

Re: [RESEND][SRU][A][PATCH 1/1] UBUNTU: SAUCE: drm: hibmc: Initialize the hibmc_bo_driver.io_mem_pfn

Paolo Pisati-5
In reply to this post by Daniel Axtens
The fix is small and corresponds to what was posted upstream.

Acked-by: Paolo Pisati <[hidden email]>

On Thu, Jan 4, 2018 at 12:23 AM, Daniel Axtens
<[hidden email]> wrote:

> From: Michal Srb <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1738334
>
> The io_mem_pfn field was added in ea642c3216cb2a60d1c0e760ae47ee85c9c16447 and
> is used unconditionally. Most drivers were updated to set it to the default
> implementation ttm_bo_default_io_mem_pfn, but hibmc was not.
>
> This fixes crash in ttm_bo_vm_fault when hibmc driver is used.
>
> Signed-off-by: Michal Srb <[hidden email]>
> (cherry-picked from https://lists.freedesktop.org/archives/dri-devel/2017-November/159002.html)
> [upstream fix at
>   https://lists.freedesktop.org/archives/dri-devel/2017-December/161184.html
>   is quite intrusive - this is the minimal fix]
> Signed-off-by: Daniel Axtens <[hidden email]>
> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
> index ac457c779caa..1a6c2a34771a 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c
> @@ -243,6 +243,7 @@ struct ttm_bo_driver hibmc_bo_driver = {
>         .verify_access          = hibmc_bo_verify_access,
>         .io_mem_reserve         = &hibmc_ttm_io_mem_reserve,
>         .io_mem_free            = NULL,
> +       .io_mem_pfn             = ttm_bo_default_io_mem_pfn,
>  };
>
>  int hibmc_mm_init(struct hibmc_drm_private *hibmc)
> --
> 2.11.0
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



--
bye,
p.

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