All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
@ 2019-02-06  9:48 Przemek Socha
  2019-02-07 15:32 ` Michel Dänzer
  2019-02-07 19:21 ` Wentland, Harry
  0 siblings, 2 replies; 7+ messages in thread
From: Przemek Socha @ 2019-02-06  9:48 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Chiawen Huang; +Cc: Tony Cheng


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

Good morning,

on my Lenovo G50-45 a6310 APU with R4 Mullins commit 
e261568f94d6c37ebb94d3c4b3f8a3085375dd9d is causing kernel Oops (unable to 
handle NULL pointer).
Cross-checked by reverting troublesome commit and machine without it is 
working fine.

Here is a part of the Oops message from pstore:


<1>[   13.200310] BUG: unable to handle kernel NULL pointer dereference at 
0000000000000008
<1>[   13.200323] #PF error: [normal kernel read fault]
<6>[   13.200328] PGD 0 P4D 0 
<4>[   13.200335] Oops: 0000 [#1] PREEMPT SMP
<4>[   13.200342] CPU: 2 PID: 2961 Comm: udevd Not tainted 5.0.0-rc1+ #47
<4>[   13.200347] Hardware name: LENOVO 80E3/Lancer 5B2, BIOS A2CN45WW(V2.13) 
08/04/2016
<4>[   13.200450] RIP: 0010:dal_gpio_open_ex+0x0/0x30 [amdgpu]
<4>[   13.200456] Code: d6 48 89 de 48 89 ef e8 6e f8 ff ff 84 c0 74 c7 48 89 e8 
5b 5d c3 0f 0b 31 ed 5b 48 89 e8 5d c3 66 2e 0f 1f 84 00 00 00 00 00 <48> 83 
7f 08 00 74 08 0f 0b b8 05 00 00 00 c3 89 77 18 8b 57 14 4c
<4>[   13.200466] RSP: 0018:ffffb78e82bb7650 EFLAGS: 00010282
<4>[   13.200471] RAX: 0000000000000000 RBX: ffffb78e82bb76a4 RCX: 
0000000000000000
<4>[   13.200476] RDX: 0000000000000006 RSI: 0000000000000004 RDI: 
0000000000000000
<4>[   13.200480] RBP: ffffa1d695e93300 R08: 0000000000000003 R09: 
ffffa1d692456600
<4>[   13.200485] R10: fffff7dc88574dc0 R11: ffffb78e82bb75b8 R12: ffffa1d695c68700
<4>[   13.200490] R13: ffffffffc07ef5a0 R14: ffffb78e82bb79b8 R15: ffffa1d692456600
<4>[   13.200495] FS:  00007f9c3fcac300(0000) GS:ffffa1d697b00000(0000) knlGS:
0000000000000000
<4>[   13.200501] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
<4>[   13.200506] CR2: 0000000000000008 CR3: 00000002124a0000 CR4: 
00000000000406e0
<4>[   13.200510] Call Trace:
<4>[   13.200605]  construct+0x15f/0x710 [amdgpu]
<4>[   13.200710]  link_create+0x2e/0x48 [amdgpu]
<4>[   13.200803]  dc_create+0x2c0/0x5f0 [amdgpu]
<4>[   13.200899]  dm_hw_init+0xe0/0x150 [amdgpu]
<4>[   13.200990]  amdgpu_device_init.cold.38+0xe06/0xf67 [amdgpu]
<4>[   13.201002]  ? kmalloc_order+0x13/0x38
<4>[   13.201102]  amdgpu_driver_load_kms+0x60/0x210 [amdgpu]
<4>[   13.201112]  drm_dev_register+0x10e/0x150
<4>[   13.201207]  amdgpu_pci_probe+0xb8/0x118 [amdgpu]
<4>[   13.201217]  ? _raw_spin_unlock_irqrestore+0xf/0x28
<4>[   13.201226]  pci_device_probe+0xd1/0x158
<4>[   13.201234]  really_probe+0xee/0x2a0
<4>[   13.201241]  driver_probe_device+0x4a/0xb0
<4>[   13.201247]  __driver_attach+0xaf/0xc8
<4>[   13.201253]  ? driver_probe_device+0xb0/0xb0
<4>[   13.201258]  bus_for_each_dev+0x6f/0xb8
<4>[   13.201265]  bus_add_driver+0x197/0x1d8
<4>[   13.201271]  ? 0xffffffffc0933000
<4>[   13.201276]  driver_register+0x66/0xa8
<4>[   13.201281]  ? 0xffffffffc0933000
<4>[   13.201287]  do_one_initcall+0x41/0x1e2
<4>[   13.201294]  ? wake_up_page_bit+0x21/0x100
<4>[   13.201301]  ? kmem_cache_alloc_trace+0x2e/0x1a0
<4>[   13.201308]  ? do_init_module+0x1d/0x1e0
<4>[   13.201315]  do_init_module+0x55/0x1e0
<4>[   13.201321]  load_module+0x205c/0x2488
<4>[   13.201329]  ? vfs_read+0x10e/0x138
<4>[   13.201337]  ? __do_sys_finit_module+0xba/0xd8
<4>[   13.201342]  __do_sys_finit_module+0xba/0xd8
<4>[   13.201350]  do_syscall_64+0x50/0x168
<4>[   13.201357]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
<4>[   13.201364] RIP: 0033:0x7f9c3fdcf409
<4>[   13.201371] Code: 18 c3 e8 3a 98 01 00 66 2e 0f 1f 84 00 00 00 00 00 48 
89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 
3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 6a 0c 00 f7 d8 64 89 01 48
<4>[   13.201381] RSP: 002b:00007fff9b4824f8 EFLAGS: 00000246 ORIG_RAX: 
0000000000000139
<4>[   13.201389] RAX: ffffffffffffffda RBX: 0000559d56fe1780 RCX: 00007f9c3fdcf409
<4>[   13.201394] RDX: 0000000000000000 RSI: 0000559d570385c0 RDI: 
000000000000000e
<4>[   13.201399] RBP: 0000000000000000 R08: 0000000000000000 R09: 
00007fff9b482610
<4>[   13.201404] R10: 000000000000000e R11: 0000000000000246 R12: 
0000559d56ff2120
<4>[   13.201409] R13: 0000000000020000 R14: 0000559d570385c0 R15: 
0000559d56fe1780
<4>[   13.201416] Modules linked in: kvm_amd kvm ath9k irqbypass crc32_pclmul 
ghash_clmulni_intel serio_raw ath9k_common ath9k_hw sdhci_pci cqhci sdhci 
amdgpu(+) mmc_core mac80211 ath mfd_core chash cfg80211 gpu_sched ttm xhci_pci 
ehci_pci xhci_hcd ehci_hcd sp5100_tco
<4>[   13.201448] CR2: 0000000000000008
<4>[   13.206222] ---[ end trace 2244da3024c5ad93 ]---


Here is a full git bisect log on amd-staging-drm-next branch synced today:

git bisect start
# good: [e1be4cb583800db36ed7f6303f7a8c205be24ceb] drm/amd/display: Use memset 
to initialize variables in fill_plane_dcc_attributes
git bisect good e1be4cb583800db36ed7f6303f7a8c205be24ceb
# bad: [25fa5507b06b8cfbec6db7933615ae603516bb7b] drm/amd/display: Disconnect 
mpcc when changing tg
git bisect bad 25fa5507b06b8cfbec6db7933615ae603516bb7b
# good: [e7b4cc9edcbe9c07e5bae2dbdebb04b054e3ff5b] drm/amd/display: Remove 
FreeSync timing changed debug output
git bisect good e7b4cc9edcbe9c07e5bae2dbdebb04b054e3ff5b
# good: [e92d0609eaba2d0a717864854eae3447a4273a29] drm/amd/display: 3.2.16
git bisect good e92d0609eaba2d0a717864854eae3447a4273a29
# bad: [7be6d18fce69c547ba2e0be72b67ac5bedc83dce] drm/amd/display: Modify ABM 
2.2 Max Reduction
git bisect bad 7be6d18fce69c547ba2e0be72b67ac5bedc83dce
# bad: [b18bdff1019443bec3a220857ee6f5350fc4af36] drm/amd/display: pass 
vline_config parameter by reference.
git bisect bad b18bdff1019443bec3a220857ee6f5350fc4af36
# bad: [e261568f94d6c37ebb94d3c4b3f8a3085375dd9d] drm/amd/display: add gpio 
lock/unlock
git bisect bad e261568f94d6c37ebb94d3c4b3f8a3085375dd9d
# first bad commit: [e261568f94d6c37ebb94d3c4b3f8a3085375dd9d] drm/amd/display: 
add gpio lock/unlock

commit e261568f94d6c37ebb94d3c4b3f8a3085375dd9d
Author: Chiawen Huang <chiawen.huang-5C7GfCeVMHo@public.gmane.org>
Date:   Fri Jan 18 14:07:54 2019 +0800

    drm/amd/display: add gpio lock/unlock
    
    [Why]
    When querying HPD via GPIO flow,
    it will create a new gpio object then free in the end of query.
    There is a irql issue for HPD querying at ISR level.
    
    [How]
    Therefore, creating the HPD gpio object in dc_link and set it as unlcok in 
default.
    1. reducing unnecessary malloc/free when HPD querying.
    2. reducing init GPIO flow.
    3. add lock/unlock to prevent multi gpio service running.
    
    Change-Id: Ibcf95d4d50c37b6831d40530194a7d6f08777c5c
    Signed-off-by: Chiawen Huang <chiawen.huang-5C7GfCeVMHo@public.gmane.org>
    Reviewed-by: Tony Cheng <Tony.Cheng-5C7GfCeVMHo@public.gmane.org>
    Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
    

Any help is appreciated.

Thanks,
Przemek.

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
  2019-02-06  9:48 BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock Przemek Socha
@ 2019-02-07 15:32 ` Michel Dänzer
       [not found]   ` <7284b267-cbcb-988f-f688-078f75f87a3d-otUistvHUpPR7s880joybQ@public.gmane.org>
  2019-02-07 19:21 ` Wentland, Harry
  1 sibling, 1 reply; 7+ messages in thread
From: Michel Dänzer @ 2019-02-07 15:32 UTC (permalink / raw)
  To: soprwa-Re5JQEeQqe8AvxtiuMwx3w, Chiawen Huang
  Cc: Tony Cheng, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1.1: Type: text/plain, Size: 630 bytes --]

On 2019-02-06 10:48 a.m., Przemek Socha wrote:
> Good morning,
> 
> on my Lenovo G50-45 a6310 APU with R4 Mullins commit 
> e261568f94d6c37ebb94d3c4b3f8a3085375dd9d is causing kernel Oops (unable to 
> handle NULL pointer).
> Cross-checked by reverting troublesome commit and machine without it is 
> working fine.

Same for me with Tonga.


Chiawen / Tony / other DC developers, any ideas? If it cannot be fixed
quickly, let's revert this change for now.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


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

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
       [not found]   ` <7284b267-cbcb-988f-f688-078f75f87a3d-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2019-02-07 15:37     ` Alex Deucher
       [not found]       ` <CADnq5_NZMMGdPvzFt1y0XU1GX7KNTtqOwY9GZg7xKSqJCK2X9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2019-02-07 15:37 UTC (permalink / raw)
  To: Michel Dänzer
  Cc: Tony Cheng, Chiawen Huang, amd-gfx list, soprwa-Re5JQEeQqe8AvxtiuMwx3w

On Thu, Feb 7, 2019 at 10:33 AM Michel Dänzer <michel@daenzer.net> wrote:
>
> On 2019-02-06 10:48 a.m., Przemek Socha wrote:
> > Good morning,
> >
> > on my Lenovo G50-45 a6310 APU with R4 Mullins commit
> > e261568f94d6c37ebb94d3c4b3f8a3085375dd9d is causing kernel Oops (unable to
> > handle NULL pointer).
> > Cross-checked by reverting troublesome commit and machine without it is
> > working fine.
>
> Same for me with Tonga.
>

Weird.  I'm not seeing this on my Tonga.  What displays are you using?
 DVI here.

Alex

>
> Chiawen / Tony / other DC developers, any ideas? If it cannot be fixed
> quickly, let's revert this change for now.
>
>
> --
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
       [not found]       ` <CADnq5_NZMMGdPvzFt1y0XU1GX7KNTtqOwY9GZg7xKSqJCK2X9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-02-07 15:42         ` Michel Dänzer
  0 siblings, 0 replies; 7+ messages in thread
From: Michel Dänzer @ 2019-02-07 15:42 UTC (permalink / raw)
  To: Alex Deucher
  Cc: Chiawen Huang, Tony Cheng, amd-gfx list, soprwa-Re5JQEeQqe8AvxtiuMwx3w

On 2019-02-07 4:37 p.m., Alex Deucher wrote:
> On Thu, Feb 7, 2019 at 10:33 AM Michel Dänzer <michel@daenzer.net> wrote:
>>
>> On 2019-02-06 10:48 a.m., Przemek Socha wrote:
>>> Good morning,
>>>
>>> on my Lenovo G50-45 a6310 APU with R4 Mullins commit
>>> e261568f94d6c37ebb94d3c4b3f8a3085375dd9d is causing kernel Oops (unable to
>>> handle NULL pointer).
>>> Cross-checked by reverting troublesome commit and machine without it is
>>> working fine.
>>
>> Same for me with Tonga.
>>
> 
> Weird.  I'm not seeing this on my Tonga.  What displays are you using?
>  DVI here.

DVI here as well, but it's actually a Bonaire, sorry for the confusion.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
  2019-02-06  9:48 BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock Przemek Socha
  2019-02-07 15:32 ` Michel Dänzer
@ 2019-02-07 19:21 ` Wentland, Harry
       [not found]   ` <f06d3abf-7aab-f77a-9bf9-cb7c01376467-5C7GfCeVMHo@public.gmane.org>
  1 sibling, 1 reply; 7+ messages in thread
From: Wentland, Harry @ 2019-02-07 19:21 UTC (permalink / raw)
  To: soprwa-Re5JQEeQqe8AvxtiuMwx3w,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Huang, ChiaWen
  Cc: Cheng, Tony


[-- Attachment #1.1.1: Type: text/plain, Size: 8060 bytes --]

On 2019-02-06 4:48 a.m., Przemek Socha wrote:
> Good morning,
> 
> on my Lenovo G50-45 a6310 APU with R4 Mullins commit 
> e261568f94d6c37ebb94d3c4b3f8a3085375dd9d is causing kernel Oops (unable to 
> handle NULL pointer).

Thanks. Obviously this change leads to a NULL pointer dereference as dal_gpio_open derefs it.

> -       hpd_gpio = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
> -
> -       if (hpd_gpio != NULL)
> -               link->irq_source_hpd = dal_irq_get_source(hpd_gpio);
> +       link->hpd_gpio = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
> +       dal_gpio_open(link->hpd_gpio, GPIO_MODE_INTERRUPT);
> +       dal_gpio_unlock_pin(link->hpd_gpio);
> +       if (link->hpd_gpio != NULL)
> +               link->irq_source_hpd = dal_irq_get_source(link->hpd_gpio);

I'll post a fix shortly.

Harry

> Cross-checked by reverting troublesome commit and machine without it is 
> working fine.
> 
> Here is a part of the Oops message from pstore:
> 
> 
> <1>[   13.200310] BUG: unable to handle kernel NULL pointer dereference at 
> 0000000000000008
> <1>[   13.200323] #PF error: [normal kernel read fault]
> <6>[   13.200328] PGD 0 P4D 0 
> <4>[   13.200335] Oops: 0000 [#1] PREEMPT SMP
> <4>[   13.200342] CPU: 2 PID: 2961 Comm: udevd Not tainted 5.0.0-rc1+ #47
> <4>[   13.200347] Hardware name: LENOVO 80E3/Lancer 5B2, BIOS A2CN45WW(V2.13) 
> 08/04/2016
> <4>[   13.200450] RIP: 0010:dal_gpio_open_ex+0x0/0x30 [amdgpu]
> <4>[   13.200456] Code: d6 48 89 de 48 89 ef e8 6e f8 ff ff 84 c0 74 c7 48 89 e8 
> 5b 5d c3 0f 0b 31 ed 5b 48 89 e8 5d c3 66 2e 0f 1f 84 00 00 00 00 00 <48> 83 
> 7f 08 00 74 08 0f 0b b8 05 00 00 00 c3 89 77 18 8b 57 14 4c
> <4>[   13.200466] RSP: 0018:ffffb78e82bb7650 EFLAGS: 00010282
> <4>[   13.200471] RAX: 0000000000000000 RBX: ffffb78e82bb76a4 RCX: 
> 0000000000000000
> <4>[   13.200476] RDX: 0000000000000006 RSI: 0000000000000004 RDI: 
> 0000000000000000
> <4>[   13.200480] RBP: ffffa1d695e93300 R08: 0000000000000003 R09: 
> ffffa1d692456600
> <4>[   13.200485] R10: fffff7dc88574dc0 R11: ffffb78e82bb75b8 R12: ffffa1d695c68700
> <4>[   13.200490] R13: ffffffffc07ef5a0 R14: ffffb78e82bb79b8 R15: ffffa1d692456600
> <4>[   13.200495] FS:  00007f9c3fcac300(0000) GS:ffffa1d697b00000(0000) knlGS:
> 0000000000000000
> <4>[   13.200501] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> <4>[   13.200506] CR2: 0000000000000008 CR3: 00000002124a0000 CR4: 
> 00000000000406e0
> <4>[   13.200510] Call Trace:
> <4>[   13.200605]  construct+0x15f/0x710 [amdgpu]
> <4>[   13.200710]  link_create+0x2e/0x48 [amdgpu]
> <4>[   13.200803]  dc_create+0x2c0/0x5f0 [amdgpu]
> <4>[   13.200899]  dm_hw_init+0xe0/0x150 [amdgpu]
> <4>[   13.200990]  amdgpu_device_init.cold.38+0xe06/0xf67 [amdgpu]
> <4>[   13.201002]  ? kmalloc_order+0x13/0x38
> <4>[   13.201102]  amdgpu_driver_load_kms+0x60/0x210 [amdgpu]
> <4>[   13.201112]  drm_dev_register+0x10e/0x150
> <4>[   13.201207]  amdgpu_pci_probe+0xb8/0x118 [amdgpu]
> <4>[   13.201217]  ? _raw_spin_unlock_irqrestore+0xf/0x28
> <4>[   13.201226]  pci_device_probe+0xd1/0x158
> <4>[   13.201234]  really_probe+0xee/0x2a0
> <4>[   13.201241]  driver_probe_device+0x4a/0xb0
> <4>[   13.201247]  __driver_attach+0xaf/0xc8
> <4>[   13.201253]  ? driver_probe_device+0xb0/0xb0
> <4>[   13.201258]  bus_for_each_dev+0x6f/0xb8
> <4>[   13.201265]  bus_add_driver+0x197/0x1d8
> <4>[   13.201271]  ? 0xffffffffc0933000
> <4>[   13.201276]  driver_register+0x66/0xa8
> <4>[   13.201281]  ? 0xffffffffc0933000
> <4>[   13.201287]  do_one_initcall+0x41/0x1e2
> <4>[   13.201294]  ? wake_up_page_bit+0x21/0x100
> <4>[   13.201301]  ? kmem_cache_alloc_trace+0x2e/0x1a0
> <4>[   13.201308]  ? do_init_module+0x1d/0x1e0
> <4>[   13.201315]  do_init_module+0x55/0x1e0
> <4>[   13.201321]  load_module+0x205c/0x2488
> <4>[   13.201329]  ? vfs_read+0x10e/0x138
> <4>[   13.201337]  ? __do_sys_finit_module+0xba/0xd8
> <4>[   13.201342]  __do_sys_finit_module+0xba/0xd8
> <4>[   13.201350]  do_syscall_64+0x50/0x168
> <4>[   13.201357]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
> <4>[   13.201364] RIP: 0033:0x7f9c3fdcf409
> <4>[   13.201371] Code: 18 c3 e8 3a 98 01 00 66 2e 0f 1f 84 00 00 00 00 00 48 
> 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 
> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 6a 0c 00 f7 d8 64 89 01 48
> <4>[   13.201381] RSP: 002b:00007fff9b4824f8 EFLAGS: 00000246 ORIG_RAX: 
> 0000000000000139
> <4>[   13.201389] RAX: ffffffffffffffda RBX: 0000559d56fe1780 RCX: 00007f9c3fdcf409
> <4>[   13.201394] RDX: 0000000000000000 RSI: 0000559d570385c0 RDI: 
> 000000000000000e
> <4>[   13.201399] RBP: 0000000000000000 R08: 0000000000000000 R09: 
> 00007fff9b482610
> <4>[   13.201404] R10: 000000000000000e R11: 0000000000000246 R12: 
> 0000559d56ff2120
> <4>[   13.201409] R13: 0000000000020000 R14: 0000559d570385c0 R15: 
> 0000559d56fe1780
> <4>[   13.201416] Modules linked in: kvm_amd kvm ath9k irqbypass crc32_pclmul 
> ghash_clmulni_intel serio_raw ath9k_common ath9k_hw sdhci_pci cqhci sdhci 
> amdgpu(+) mmc_core mac80211 ath mfd_core chash cfg80211 gpu_sched ttm xhci_pci 
> ehci_pci xhci_hcd ehci_hcd sp5100_tco
> <4>[   13.201448] CR2: 0000000000000008
> <4>[   13.206222] ---[ end trace 2244da3024c5ad93 ]---
> 
> 
> Here is a full git bisect log on amd-staging-drm-next branch synced today:
> 
> git bisect start
> # good: [e1be4cb583800db36ed7f6303f7a8c205be24ceb] drm/amd/display: Use memset 
> to initialize variables in fill_plane_dcc_attributes
> git bisect good e1be4cb583800db36ed7f6303f7a8c205be24ceb
> # bad: [25fa5507b06b8cfbec6db7933615ae603516bb7b] drm/amd/display: Disconnect 
> mpcc when changing tg
> git bisect bad 25fa5507b06b8cfbec6db7933615ae603516bb7b
> # good: [e7b4cc9edcbe9c07e5bae2dbdebb04b054e3ff5b] drm/amd/display: Remove 
> FreeSync timing changed debug output
> git bisect good e7b4cc9edcbe9c07e5bae2dbdebb04b054e3ff5b
> # good: [e92d0609eaba2d0a717864854eae3447a4273a29] drm/amd/display: 3.2.16
> git bisect good e92d0609eaba2d0a717864854eae3447a4273a29
> # bad: [7be6d18fce69c547ba2e0be72b67ac5bedc83dce] drm/amd/display: Modify ABM 
> 2.2 Max Reduction
> git bisect bad 7be6d18fce69c547ba2e0be72b67ac5bedc83dce
> # bad: [b18bdff1019443bec3a220857ee6f5350fc4af36] drm/amd/display: pass 
> vline_config parameter by reference.
> git bisect bad b18bdff1019443bec3a220857ee6f5350fc4af36
> # bad: [e261568f94d6c37ebb94d3c4b3f8a3085375dd9d] drm/amd/display: add gpio 
> lock/unlock
> git bisect bad e261568f94d6c37ebb94d3c4b3f8a3085375dd9d
> # first bad commit: [e261568f94d6c37ebb94d3c4b3f8a3085375dd9d] drm/amd/display: 
> add gpio lock/unlock
> 
> commit e261568f94d6c37ebb94d3c4b3f8a3085375dd9d
> Author: Chiawen Huang <chiawen.huang-5C7GfCeVMHo@public.gmane.org>
> Date:   Fri Jan 18 14:07:54 2019 +0800
> 
>     drm/amd/display: add gpio lock/unlock
>     
>     [Why]
>     When querying HPD via GPIO flow,
>     it will create a new gpio object then free in the end of query.
>     There is a irql issue for HPD querying at ISR level.
>     
>     [How]
>     Therefore, creating the HPD gpio object in dc_link and set it as unlcok in 
> default.
>     1. reducing unnecessary malloc/free when HPD querying.
>     2. reducing init GPIO flow.
>     3. add lock/unlock to prevent multi gpio service running.
>     
>     Change-Id: Ibcf95d4d50c37b6831d40530194a7d6f08777c5c
>     Signed-off-by: Chiawen Huang <chiawen.huang-5C7GfCeVMHo@public.gmane.org>
>     Reviewed-by: Tony Cheng <Tony.Cheng-5C7GfCeVMHo@public.gmane.org>
>     Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
>     
> 
> Any help is appreciated.
> 
> Thanks,
> Przemek.
> 
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 


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

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
       [not found]   ` <f06d3abf-7aab-f77a-9bf9-cb7c01376467-5C7GfCeVMHo@public.gmane.org>
@ 2019-02-07 21:59     ` Wentland, Harry
       [not found]       ` <4eee91c0-17bd-150c-dd94-0d4521b26e4c-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Wentland, Harry @ 2019-02-07 21:59 UTC (permalink / raw)
  To: soprwa-Re5JQEeQqe8AvxtiuMwx3w,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Huang, ChiaWen
  Cc: Cheng, Tony


[-- Attachment #1.1.1: Type: text/plain, Size: 8535 bytes --]



On 2019-02-07 2:21 p.m., Wentland, Harry wrote:
> On 2019-02-06 4:48 a.m., Przemek Socha wrote:
>> Good morning,
>>
>> on my Lenovo G50-45 a6310 APU with R4 Mullins commit 
>> e261568f94d6c37ebb94d3c4b3f8a3085375dd9d is causing kernel Oops (unable to 
>> handle NULL pointer).
> 
> Thanks. Obviously this change leads to a NULL pointer dereference as dal_gpio_open derefs it.
> 
>> -       hpd_gpio = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
>> -
>> -       if (hpd_gpio != NULL)
>> -               link->irq_source_hpd = dal_irq_get_source(hpd_gpio);
>> +       link->hpd_gpio = get_hpd_gpio(link->ctx->dc_bios, link->link_id, link->ctx->gpio_service);
>> +       dal_gpio_open(link->hpd_gpio, GPIO_MODE_INTERRUPT);
>> +       dal_gpio_unlock_pin(link->hpd_gpio);
>> +       if (link->hpd_gpio != NULL)
>> +               link->irq_source_hpd = dal_irq_get_source(link->hpd_gpio);
> 
> I'll post a fix shortly.
> 

Fix merged to amd-staging-drm-next.

Harry

> Harry
> 
>> Cross-checked by reverting troublesome commit and machine without it is 
>> working fine.
>>
>> Here is a part of the Oops message from pstore:
>>
>>
>> <1>[   13.200310] BUG: unable to handle kernel NULL pointer dereference at 
>> 0000000000000008
>> <1>[   13.200323] #PF error: [normal kernel read fault]
>> <6>[   13.200328] PGD 0 P4D 0 
>> <4>[   13.200335] Oops: 0000 [#1] PREEMPT SMP
>> <4>[   13.200342] CPU: 2 PID: 2961 Comm: udevd Not tainted 5.0.0-rc1+ #47
>> <4>[   13.200347] Hardware name: LENOVO 80E3/Lancer 5B2, BIOS A2CN45WW(V2.13) 
>> 08/04/2016
>> <4>[   13.200450] RIP: 0010:dal_gpio_open_ex+0x0/0x30 [amdgpu]
>> <4>[   13.200456] Code: d6 48 89 de 48 89 ef e8 6e f8 ff ff 84 c0 74 c7 48 89 e8 
>> 5b 5d c3 0f 0b 31 ed 5b 48 89 e8 5d c3 66 2e 0f 1f 84 00 00 00 00 00 <48> 83 
>> 7f 08 00 74 08 0f 0b b8 05 00 00 00 c3 89 77 18 8b 57 14 4c
>> <4>[   13.200466] RSP: 0018:ffffb78e82bb7650 EFLAGS: 00010282
>> <4>[   13.200471] RAX: 0000000000000000 RBX: ffffb78e82bb76a4 RCX: 
>> 0000000000000000
>> <4>[   13.200476] RDX: 0000000000000006 RSI: 0000000000000004 RDI: 
>> 0000000000000000
>> <4>[   13.200480] RBP: ffffa1d695e93300 R08: 0000000000000003 R09: 
>> ffffa1d692456600
>> <4>[   13.200485] R10: fffff7dc88574dc0 R11: ffffb78e82bb75b8 R12: ffffa1d695c68700
>> <4>[   13.200490] R13: ffffffffc07ef5a0 R14: ffffb78e82bb79b8 R15: ffffa1d692456600
>> <4>[   13.200495] FS:  00007f9c3fcac300(0000) GS:ffffa1d697b00000(0000) knlGS:
>> 0000000000000000
>> <4>[   13.200501] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> <4>[   13.200506] CR2: 0000000000000008 CR3: 00000002124a0000 CR4: 
>> 00000000000406e0
>> <4>[   13.200510] Call Trace:
>> <4>[   13.200605]  construct+0x15f/0x710 [amdgpu]
>> <4>[   13.200710]  link_create+0x2e/0x48 [amdgpu]
>> <4>[   13.200803]  dc_create+0x2c0/0x5f0 [amdgpu]
>> <4>[   13.200899]  dm_hw_init+0xe0/0x150 [amdgpu]
>> <4>[   13.200990]  amdgpu_device_init.cold.38+0xe06/0xf67 [amdgpu]
>> <4>[   13.201002]  ? kmalloc_order+0x13/0x38
>> <4>[   13.201102]  amdgpu_driver_load_kms+0x60/0x210 [amdgpu]
>> <4>[   13.201112]  drm_dev_register+0x10e/0x150
>> <4>[   13.201207]  amdgpu_pci_probe+0xb8/0x118 [amdgpu]
>> <4>[   13.201217]  ? _raw_spin_unlock_irqrestore+0xf/0x28
>> <4>[   13.201226]  pci_device_probe+0xd1/0x158
>> <4>[   13.201234]  really_probe+0xee/0x2a0
>> <4>[   13.201241]  driver_probe_device+0x4a/0xb0
>> <4>[   13.201247]  __driver_attach+0xaf/0xc8
>> <4>[   13.201253]  ? driver_probe_device+0xb0/0xb0
>> <4>[   13.201258]  bus_for_each_dev+0x6f/0xb8
>> <4>[   13.201265]  bus_add_driver+0x197/0x1d8
>> <4>[   13.201271]  ? 0xffffffffc0933000
>> <4>[   13.201276]  driver_register+0x66/0xa8
>> <4>[   13.201281]  ? 0xffffffffc0933000
>> <4>[   13.201287]  do_one_initcall+0x41/0x1e2
>> <4>[   13.201294]  ? wake_up_page_bit+0x21/0x100
>> <4>[   13.201301]  ? kmem_cache_alloc_trace+0x2e/0x1a0
>> <4>[   13.201308]  ? do_init_module+0x1d/0x1e0
>> <4>[   13.201315]  do_init_module+0x55/0x1e0
>> <4>[   13.201321]  load_module+0x205c/0x2488
>> <4>[   13.201329]  ? vfs_read+0x10e/0x138
>> <4>[   13.201337]  ? __do_sys_finit_module+0xba/0xd8
>> <4>[   13.201342]  __do_sys_finit_module+0xba/0xd8
>> <4>[   13.201350]  do_syscall_64+0x50/0x168
>> <4>[   13.201357]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
>> <4>[   13.201364] RIP: 0033:0x7f9c3fdcf409
>> <4>[   13.201371] Code: 18 c3 e8 3a 98 01 00 66 2e 0f 1f 84 00 00 00 00 00 48 
>> 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 
>> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 6a 0c 00 f7 d8 64 89 01 48
>> <4>[   13.201381] RSP: 002b:00007fff9b4824f8 EFLAGS: 00000246 ORIG_RAX: 
>> 0000000000000139
>> <4>[   13.201389] RAX: ffffffffffffffda RBX: 0000559d56fe1780 RCX: 00007f9c3fdcf409
>> <4>[   13.201394] RDX: 0000000000000000 RSI: 0000559d570385c0 RDI: 
>> 000000000000000e
>> <4>[   13.201399] RBP: 0000000000000000 R08: 0000000000000000 R09: 
>> 00007fff9b482610
>> <4>[   13.201404] R10: 000000000000000e R11: 0000000000000246 R12: 
>> 0000559d56ff2120
>> <4>[   13.201409] R13: 0000000000020000 R14: 0000559d570385c0 R15: 
>> 0000559d56fe1780
>> <4>[   13.201416] Modules linked in: kvm_amd kvm ath9k irqbypass crc32_pclmul 
>> ghash_clmulni_intel serio_raw ath9k_common ath9k_hw sdhci_pci cqhci sdhci 
>> amdgpu(+) mmc_core mac80211 ath mfd_core chash cfg80211 gpu_sched ttm xhci_pci 
>> ehci_pci xhci_hcd ehci_hcd sp5100_tco
>> <4>[   13.201448] CR2: 0000000000000008
>> <4>[   13.206222] ---[ end trace 2244da3024c5ad93 ]---
>>
>>
>> Here is a full git bisect log on amd-staging-drm-next branch synced today:
>>
>> git bisect start
>> # good: [e1be4cb583800db36ed7f6303f7a8c205be24ceb] drm/amd/display: Use memset 
>> to initialize variables in fill_plane_dcc_attributes
>> git bisect good e1be4cb583800db36ed7f6303f7a8c205be24ceb
>> # bad: [25fa5507b06b8cfbec6db7933615ae603516bb7b] drm/amd/display: Disconnect 
>> mpcc when changing tg
>> git bisect bad 25fa5507b06b8cfbec6db7933615ae603516bb7b
>> # good: [e7b4cc9edcbe9c07e5bae2dbdebb04b054e3ff5b] drm/amd/display: Remove 
>> FreeSync timing changed debug output
>> git bisect good e7b4cc9edcbe9c07e5bae2dbdebb04b054e3ff5b
>> # good: [e92d0609eaba2d0a717864854eae3447a4273a29] drm/amd/display: 3.2.16
>> git bisect good e92d0609eaba2d0a717864854eae3447a4273a29
>> # bad: [7be6d18fce69c547ba2e0be72b67ac5bedc83dce] drm/amd/display: Modify ABM 
>> 2.2 Max Reduction
>> git bisect bad 7be6d18fce69c547ba2e0be72b67ac5bedc83dce
>> # bad: [b18bdff1019443bec3a220857ee6f5350fc4af36] drm/amd/display: pass 
>> vline_config parameter by reference.
>> git bisect bad b18bdff1019443bec3a220857ee6f5350fc4af36
>> # bad: [e261568f94d6c37ebb94d3c4b3f8a3085375dd9d] drm/amd/display: add gpio 
>> lock/unlock
>> git bisect bad e261568f94d6c37ebb94d3c4b3f8a3085375dd9d
>> # first bad commit: [e261568f94d6c37ebb94d3c4b3f8a3085375dd9d] drm/amd/display: 
>> add gpio lock/unlock
>>
>> commit e261568f94d6c37ebb94d3c4b3f8a3085375dd9d
>> Author: Chiawen Huang <chiawen.huang-5C7GfCeVMHo@public.gmane.org>
>> Date:   Fri Jan 18 14:07:54 2019 +0800
>>
>>     drm/amd/display: add gpio lock/unlock
>>     
>>     [Why]
>>     When querying HPD via GPIO flow,
>>     it will create a new gpio object then free in the end of query.
>>     There is a irql issue for HPD querying at ISR level.
>>     
>>     [How]
>>     Therefore, creating the HPD gpio object in dc_link and set it as unlcok in 
>> default.
>>     1. reducing unnecessary malloc/free when HPD querying.
>>     2. reducing init GPIO flow.
>>     3. add lock/unlock to prevent multi gpio service running.
>>     
>>     Change-Id: Ibcf95d4d50c37b6831d40530194a7d6f08777c5c
>>     Signed-off-by: Chiawen Huang <chiawen.huang-5C7GfCeVMHo@public.gmane.org>
>>     Reviewed-by: Tony Cheng <Tony.Cheng-5C7GfCeVMHo@public.gmane.org>
>>     Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha-5C7GfCeVMHo@public.gmane.org>
>>     
>>
>> Any help is appreciated.
>>
>> Thanks,
>> Przemek.
>>
>>
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>>
> 
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> 


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

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock
       [not found]       ` <4eee91c0-17bd-150c-dd94-0d4521b26e4c-5C7GfCeVMHo@public.gmane.org>
@ 2019-02-07 22:15         ` Przemek Socha
  0 siblings, 0 replies; 7+ messages in thread
From: Przemek Socha @ 2019-02-07 22:15 UTC (permalink / raw)
  To: Wentland, Harry, Alex Deucher
  Cc: Michel Dänzer, Chiawen Huang, amd-gfx list


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

Dnia czwartek, 7 lutego 2019 22:59:59 CET piszesz:

> > I'll post a fix shortly.
> 
> Fix merged to amd-staging-drm-next.
> 
> Harry
> 


I apologize for the late response, 
and thank you very much.

I had a problem with applying the patch on top of clean amd-staging-drm-next 
because it is in one chunk,  I suppose ( but my patch-fu could be weak also) I 
had t o modify it like this:
"
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1127,10 +1127,11 @@
 		link->dc->res_pool->funcs->link_init(link);
 
 	link->hpd_gpio = get_hpd_gpio(link->ctx->dc_bios, link->link_id, 
link->ctx->gpio_service);
-	dal_gpio_open(link->hpd_gpio, GPIO_MODE_INTERRUPT);
-	dal_gpio_unlock_pin(link->hpd_gpio);
-	if (link->hpd_gpio != NULL)
-		link->irq_source_hpd = dal_irq_get_source(link-
>hpd_gpio);
+if (link->hpd_gpio != NULL) {
+               dal_gpio_open(link->hpd_gpio, GPIO_MODE_INTERRUPT);
+               dal_gpio_unlock_pin(link->hpd_gpio);
+                link->irq_source_hpd = dal_irq_get_source(link->hpd_gpio);
+       }
 
 	switch (link->link_id.id) {
 	case CONNECTOR_ID_HDMI_TYPE_A:
"

After that, machine works as it should.

So this patch also works on Mullins apu.

Once again, thank you all very much.

Przemek.



[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2019-02-07 22:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-06  9:48 BUG - unable to handle null pointer, bisected - drm/amd/display: add gpio lock/unlock Przemek Socha
2019-02-07 15:32 ` Michel Dänzer
     [not found]   ` <7284b267-cbcb-988f-f688-078f75f87a3d-otUistvHUpPR7s880joybQ@public.gmane.org>
2019-02-07 15:37     ` Alex Deucher
     [not found]       ` <CADnq5_NZMMGdPvzFt1y0XU1GX7KNTtqOwY9GZg7xKSqJCK2X9w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-02-07 15:42         ` Michel Dänzer
2019-02-07 19:21 ` Wentland, Harry
     [not found]   ` <f06d3abf-7aab-f77a-9bf9-cb7c01376467-5C7GfCeVMHo@public.gmane.org>
2019-02-07 21:59     ` Wentland, Harry
     [not found]       ` <4eee91c0-17bd-150c-dd94-0d4521b26e4c-5C7GfCeVMHo@public.gmane.org>
2019-02-07 22:15         ` Przemek Socha

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.