Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1220100 > unrolled thread
| Started by | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| First post | 2015-09-07 14:00 +0200 |
| Last post | 2015-09-17 13:20 +0200 |
| Articles | 9 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] drm/mgag200: fix memory leak Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-07 14:00 +0200
Re: [PATCH] drm/mgag200: fix memory leak Ingo Molnar <mingo@kernel.org> - 2015-09-13 11:40 +0200
Re: [PATCH] drm/mgag200: fix memory leak Dave Airlie <airlied@gmail.com> - 2015-09-14 12:10 +0200
Re: [PATCH] drm/mgag200: fix memory leak Dave Airlie <airlied@gmail.com> - 2015-09-14 12:10 +0200
Re: [PATCH] drm/mgag200: fix memory leak Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-14 12:40 +0200
Re: [PATCH] drm/mgag200: fix memory leak Archit Taneja <architt@codeaurora.org> - 2015-09-14 17:30 +0200
[PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice Ingo Molnar <mingo@kernel.org> - 2015-09-16 11:50 +0200
Re: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice Archit Taneja <architt@codeaurora.org> - 2015-09-17 13:00 +0200
Re: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-09-17 13:20 +0200
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-07 14:00 +0200 |
| Subject | [PATCH] drm/mgag200: fix memory leak |
| Message-ID | <q63fA-4Fg-7@gated-at.bofh.it> |
If drm_fb_helper_alloc_fbi() fails then we were directly returning
without freeing sysram. Also if drm_fb_helper_alloc_fbi() succeeds but
mgag200_framebuffer_init() fails then we were not releasing sysram and
we were not releasing fbi helper also.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/gpu/drm/mgag200/mgag200_fb.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 87de15e..5fe476a 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -189,14 +189,16 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
return -ENOMEM;
info = drm_fb_helper_alloc_fbi(helper);
- if (IS_ERR(info))
- return PTR_ERR(info);
+ if (IS_ERR(info)) {
+ ret = PTR_ERR(info);
+ goto err_alloc_fbi;
+ }
info->par = mfbdev;
ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
if (ret)
- return ret;
+ goto err_framebuffer_init;
mfbdev->sysram = sysram;
mfbdev->size = size;
@@ -226,6 +228,13 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
DRM_DEBUG_KMS("allocated %dx%d\n",
fb->width, fb->height);
return 0;
+
+err_framebuffer_init:
+ drm_fb_helper_release_fbi(helper);
+
+err_alloc_fbi:
+ vfree(sysram);
+ return ret;
}
static int mga_fbdev_destroy(struct drm_device *dev,
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-09-13 11:40 +0200 |
| Message-ID | <q8bVn-3Is-7@gated-at.bofh.it> |
| In reply to | #1220100 |
* Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> If drm_fb_helper_alloc_fbi() fails then we were directly returning
> without freeing sysram. Also if drm_fb_helper_alloc_fbi() succeeds but
> mgag200_framebuffer_init() fails then we were not releasing sysram and
> we were not releasing fbi helper also.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/gpu/drm/mgag200/mgag200_fb.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
> index 87de15e..5fe476a 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_fb.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
> @@ -189,14 +189,16 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
> return -ENOMEM;
>
> info = drm_fb_helper_alloc_fbi(helper);
> - if (IS_ERR(info))
> - return PTR_ERR(info);
> + if (IS_ERR(info)) {
> + ret = PTR_ERR(info);
> + goto err_alloc_fbi;
> + }
>
> info->par = mfbdev;
>
> ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
> if (ret)
> - return ret;
> + goto err_framebuffer_init;
>
> mfbdev->sysram = sysram;
> mfbdev->size = size;
> @@ -226,6 +228,13 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
> DRM_DEBUG_KMS("allocated %dx%d\n",
> fb->width, fb->height);
> return 0;
> +
> +err_framebuffer_init:
> + drm_fb_helper_release_fbi(helper);
> +
> +err_alloc_fbi:
> + vfree(sysram);
> + return ret;
> }
>
> static int mga_fbdev_destroy(struct drm_device *dev,
There's a new regression: v4.3-rc1 crashes on bootup on non-supported hardware, if
CONFIG_DRM_MGAG200=y (built into the kernel).
[ 10.191561] bus: 'i2c': add device i2c-0
[ 10.227367] mgadrmfb: enable CONFIG_FB_LITTLE_ENDIAN to support this framebuffer
[ 10.235781] [drm:mgag200_modeset_init] *ERROR* mga_fbdev_init failed
[ 10.242992] mgag200 0000:0b:00.0: Fatal error during modeset init: -22
[ 10.250456] kfree_debugcheck: out of range ptr 6b6b6b6b6b6b6b6bh.
[ 10.257378] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
[ 10.264730] Modules linked in:
[ 10.268319] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc1-01643-g6013d75-dirty #15
[ 10.277498] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013
[ 10.289111] task: ffff88017fb6c040 ti: ffff88017fb70000 task.ti: ffff88017fb70000
[ 10.297611] RIP: 0010:[<ffffffffa493d1a7>] [<ffffffffa493d1a7>] kfree_debugcheck+0x20/0x25
[ 10.307170] RSP: 0000:ffff88017fb73b28 EFLAGS: 00010086
[ 10.313213] RAX: 0000000000000035 RBX: 6b6b6b6b6b6b6b6b RCX: 0000000000000000
[ 10.321297] RDX: ffffffffa489ac8f RSI: ffffffffa489b27b RDI: ffffffffa489b11e
[ 10.329381] RBP: ffff88017fb73b30 R08: 0000000000000001 R09: 0000000000000000
[ 10.337466] R10: ffffffffa537dec0 R11: 0000000000000000 R12: 0000000000000001
[ 10.345549] R13: ffffffffa4c2c22a R14: 0000000000000202 R15: ffff8807ee3f1018
[ 10.353632] FS: 0000000000000000(0000) GS:ffff88081b200000(0000) knlGS:0000000000000000
[ 10.362812] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 10.369330] CR2: 0000000000000000 CR3: 00000000258c0000 CR4: 00000000001406f0
[ 10.377415] Stack:
[ 10.379761] 6b6b6b6b6b6b6b6b ffff88017fb73b70 ffffffffa493e421 ffff8807ee784ea0
[ 10.388499] ffff8807ee784e18 0000000000000001 ffff8807ee361060 00000000ffffffea
[ 10.397238] ffff8807ee3f1018 ffff88017fb73b98 ffffffffa4c2c22a ffff8807ee784e18
[ 10.405968] Call Trace:
[ 10.408804] [<ffffffffa493e421>] kfree+0x5a/0x195
[ 10.414256] [<ffffffffa4c2c22a>] drm_fb_helper_crtc_free+0x28/0x75
[ 10.421368] [<ffffffffa4c2cbbd>] drm_fb_helper_fini+0x6b/0x6e
[ 10.427996] [<ffffffffa4ce522d>] mgag200_fbdev_fini+0x8a/0xb9
[ 10.434621] [<ffffffffa4ce0a17>] mgag200_driver_unload+0x23/0x43
[ 10.441539] [<ffffffffa4ce0ee1>] mgag200_driver_load+0x4aa/0x4bc
[ 10.448458] [<ffffffffa4c3537c>] drm_dev_register+0x6a/0xab
[ 10.454889] [<ffffffffa4c36e42>] drm_get_pci_dev+0xe8/0x1ab
[ 10.461322] [<ffffffffa4ce4b73>] mga_pci_probe+0xa1/0xaa
[ 10.467465] [<ffffffffa4b785ba>] pci_device_probe+0x7e/0xe8
...
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Airlie <airlied@gmail.com> |
|---|---|
| Date | 2015-09-14 12:10 +0200 |
| Message-ID | <q8yRZ-34p-47@gated-at.bofh.it> |
| In reply to | #1223565 |
>
>> If drm_fb_helper_alloc_fbi() fails then we were directly returning
>> without freeing sysram. Also if drm_fb_helper_alloc_fbi() succeeds but
>> mgag200_framebuffer_init() fails then we were not releasing sysram and
>> we were not releasing fbi helper also.
>>
>> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>> ---
>> drivers/gpu/drm/mgag200/mgag200_fb.c | 15 ++++++++++++---
>> 1 file changed, 12 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
>> index 87de15e..5fe476a 100644
>> --- a/drivers/gpu/drm/mgag200/mgag200_fb.c
>> +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
>> @@ -189,14 +189,16 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
>> return -ENOMEM;
>>
>> info = drm_fb_helper_alloc_fbi(helper);
>> - if (IS_ERR(info))
>> - return PTR_ERR(info);
>> + if (IS_ERR(info)) {
>> + ret = PTR_ERR(info);
>> + goto err_alloc_fbi;
>> + }
>>
>> info->par = mfbdev;
>>
>> ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
>> if (ret)
>> - return ret;
>> + goto err_framebuffer_init;
>>
>> mfbdev->sysram = sysram;
>> mfbdev->size = size;
>> @@ -226,6 +228,13 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
>> DRM_DEBUG_KMS("allocated %dx%d\n",
>> fb->width, fb->height);
>> return 0;
>> +
>> +err_framebuffer_init:
>> + drm_fb_helper_release_fbi(helper);
>> +
>> +err_alloc_fbi:
>> + vfree(sysram);
>> + return ret;
>> }
>>
>> static int mga_fbdev_destroy(struct drm_device *dev,
>
> There's a new regression: v4.3-rc1 crashes on bootup on non-supported hardware, if
> CONFIG_DRM_MGAG200=y (built into the kernel).
Archit, I'm guessing this is some fallout from the fbdev changes.
There is no reason we should need CONFIG_FB_LITTLE_ENDIAN I don't think.
Dave.
>
> [ 10.191561] bus: 'i2c': add device i2c-0
> [ 10.227367] mgadrmfb: enable CONFIG_FB_LITTLE_ENDIAN to support this framebuffer
> [ 10.235781] [drm:mgag200_modeset_init] *ERROR* mga_fbdev_init failed
> [ 10.242992] mgag200 0000:0b:00.0: Fatal error during modeset init: -22
> [ 10.250456] kfree_debugcheck: out of range ptr 6b6b6b6b6b6b6b6bh.
> [ 10.257378] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
> [ 10.264730] Modules linked in:
> [ 10.268319] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc1-01643-g6013d75-dirty #15
> [ 10.277498] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013
> [ 10.289111] task: ffff88017fb6c040 ti: ffff88017fb70000 task.ti: ffff88017fb70000
> [ 10.297611] RIP: 0010:[<ffffffffa493d1a7>] [<ffffffffa493d1a7>] kfree_debugcheck+0x20/0x25
> [ 10.307170] RSP: 0000:ffff88017fb73b28 EFLAGS: 00010086
> [ 10.313213] RAX: 0000000000000035 RBX: 6b6b6b6b6b6b6b6b RCX: 0000000000000000
> [ 10.321297] RDX: ffffffffa489ac8f RSI: ffffffffa489b27b RDI: ffffffffa489b11e
> [ 10.329381] RBP: ffff88017fb73b30 R08: 0000000000000001 R09: 0000000000000000
> [ 10.337466] R10: ffffffffa537dec0 R11: 0000000000000000 R12: 0000000000000001
> [ 10.345549] R13: ffffffffa4c2c22a R14: 0000000000000202 R15: ffff8807ee3f1018
> [ 10.353632] FS: 0000000000000000(0000) GS:ffff88081b200000(0000) knlGS:0000000000000000
> [ 10.362812] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 10.369330] CR2: 0000000000000000 CR3: 00000000258c0000 CR4: 00000000001406f0
> [ 10.377415] Stack:
> [ 10.379761] 6b6b6b6b6b6b6b6b ffff88017fb73b70 ffffffffa493e421 ffff8807ee784ea0
> [ 10.388499] ffff8807ee784e18 0000000000000001 ffff8807ee361060 00000000ffffffea
> [ 10.397238] ffff8807ee3f1018 ffff88017fb73b98 ffffffffa4c2c22a ffff8807ee784e18
> [ 10.405968] Call Trace:
> [ 10.408804] [<ffffffffa493e421>] kfree+0x5a/0x195
> [ 10.414256] [<ffffffffa4c2c22a>] drm_fb_helper_crtc_free+0x28/0x75
> [ 10.421368] [<ffffffffa4c2cbbd>] drm_fb_helper_fini+0x6b/0x6e
> [ 10.427996] [<ffffffffa4ce522d>] mgag200_fbdev_fini+0x8a/0xb9
> [ 10.434621] [<ffffffffa4ce0a17>] mgag200_driver_unload+0x23/0x43
> [ 10.441539] [<ffffffffa4ce0ee1>] mgag200_driver_load+0x4aa/0x4bc
> [ 10.448458] [<ffffffffa4c3537c>] drm_dev_register+0x6a/0xab
> [ 10.454889] [<ffffffffa4c36e42>] drm_get_pci_dev+0xe8/0x1ab
> [ 10.461322] [<ffffffffa4ce4b73>] mga_pci_probe+0xa1/0xaa
> [ 10.467465] [<ffffffffa4b785ba>] pci_device_probe+0x7e/0xe8
> ...
>
> Thanks,
>
> Ingo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Airlie <airlied@gmail.com> |
|---|---|
| Date | 2015-09-14 12:10 +0200 |
| Message-ID | <q8yRZ-34p-63@gated-at.bofh.it> |
| In reply to | #1223998 |
(this time with correct email address).
On 14 September 2015 at 20:04, Dave Airlie <airlied@gmail.com> wrote:
>>
>>> If drm_fb_helper_alloc_fbi() fails then we were directly returning
>>> without freeing sysram. Also if drm_fb_helper_alloc_fbi() succeeds but
>>> mgag200_framebuffer_init() fails then we were not releasing sysram and
>>> we were not releasing fbi helper also.
>>>
>>> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>>> ---
>>> drivers/gpu/drm/mgag200/mgag200_fb.c | 15 ++++++++++++---
>>> 1 file changed, 12 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
>>> index 87de15e..5fe476a 100644
>>> --- a/drivers/gpu/drm/mgag200/mgag200_fb.c
>>> +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
>>> @@ -189,14 +189,16 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
>>> return -ENOMEM;
>>>
>>> info = drm_fb_helper_alloc_fbi(helper);
>>> - if (IS_ERR(info))
>>> - return PTR_ERR(info);
>>> + if (IS_ERR(info)) {
>>> + ret = PTR_ERR(info);
>>> + goto err_alloc_fbi;
>>> + }
>>>
>>> info->par = mfbdev;
>>>
>>> ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
>>> if (ret)
>>> - return ret;
>>> + goto err_framebuffer_init;
>>>
>>> mfbdev->sysram = sysram;
>>> mfbdev->size = size;
>>> @@ -226,6 +228,13 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
>>> DRM_DEBUG_KMS("allocated %dx%d\n",
>>> fb->width, fb->height);
>>> return 0;
>>> +
>>> +err_framebuffer_init:
>>> + drm_fb_helper_release_fbi(helper);
>>> +
>>> +err_alloc_fbi:
>>> + vfree(sysram);
>>> + return ret;
>>> }
>>>
>>> static int mga_fbdev_destroy(struct drm_device *dev,
>>
>> There's a new regression: v4.3-rc1 crashes on bootup on non-supported hardware, if
>> CONFIG_DRM_MGAG200=y (built into the kernel).
>
> Archit, I'm guessing this is some fallout from the fbdev changes.
>
> There is no reason we should need CONFIG_FB_LITTLE_ENDIAN I don't think.
>
> Dave.
>
>>
>> [ 10.191561] bus: 'i2c': add device i2c-0
>> [ 10.227367] mgadrmfb: enable CONFIG_FB_LITTLE_ENDIAN to support this framebuffer
>> [ 10.235781] [drm:mgag200_modeset_init] *ERROR* mga_fbdev_init failed
>> [ 10.242992] mgag200 0000:0b:00.0: Fatal error during modeset init: -22
>> [ 10.250456] kfree_debugcheck: out of range ptr 6b6b6b6b6b6b6b6bh.
>> [ 10.257378] invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
>> [ 10.264730] Modules linked in:
>> [ 10.268319] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc1-01643-g6013d75-dirty #15
>> [ 10.277498] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013
>> [ 10.289111] task: ffff88017fb6c040 ti: ffff88017fb70000 task.ti: ffff88017fb70000
>> [ 10.297611] RIP: 0010:[<ffffffffa493d1a7>] [<ffffffffa493d1a7>] kfree_debugcheck+0x20/0x25
>> [ 10.307170] RSP: 0000:ffff88017fb73b28 EFLAGS: 00010086
>> [ 10.313213] RAX: 0000000000000035 RBX: 6b6b6b6b6b6b6b6b RCX: 0000000000000000
>> [ 10.321297] RDX: ffffffffa489ac8f RSI: ffffffffa489b27b RDI: ffffffffa489b11e
>> [ 10.329381] RBP: ffff88017fb73b30 R08: 0000000000000001 R09: 0000000000000000
>> [ 10.337466] R10: ffffffffa537dec0 R11: 0000000000000000 R12: 0000000000000001
>> [ 10.345549] R13: ffffffffa4c2c22a R14: 0000000000000202 R15: ffff8807ee3f1018
>> [ 10.353632] FS: 0000000000000000(0000) GS:ffff88081b200000(0000) knlGS:0000000000000000
>> [ 10.362812] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> [ 10.369330] CR2: 0000000000000000 CR3: 00000000258c0000 CR4: 00000000001406f0
>> [ 10.377415] Stack:
>> [ 10.379761] 6b6b6b6b6b6b6b6b ffff88017fb73b70 ffffffffa493e421 ffff8807ee784ea0
>> [ 10.388499] ffff8807ee784e18 0000000000000001 ffff8807ee361060 00000000ffffffea
>> [ 10.397238] ffff8807ee3f1018 ffff88017fb73b98 ffffffffa4c2c22a ffff8807ee784e18
>> [ 10.405968] Call Trace:
>> [ 10.408804] [<ffffffffa493e421>] kfree+0x5a/0x195
>> [ 10.414256] [<ffffffffa4c2c22a>] drm_fb_helper_crtc_free+0x28/0x75
>> [ 10.421368] [<ffffffffa4c2cbbd>] drm_fb_helper_fini+0x6b/0x6e
>> [ 10.427996] [<ffffffffa4ce522d>] mgag200_fbdev_fini+0x8a/0xb9
>> [ 10.434621] [<ffffffffa4ce0a17>] mgag200_driver_unload+0x23/0x43
>> [ 10.441539] [<ffffffffa4ce0ee1>] mgag200_driver_load+0x4aa/0x4bc
>> [ 10.448458] [<ffffffffa4c3537c>] drm_dev_register+0x6a/0xab
>> [ 10.454889] [<ffffffffa4c36e42>] drm_get_pci_dev+0xe8/0x1ab
>> [ 10.461322] [<ffffffffa4ce4b73>] mga_pci_probe+0xa1/0xaa
>> [ 10.467465] [<ffffffffa4b785ba>] pci_device_probe+0x7e/0xe8
>> ...
>>
>> Thanks,
>>
>> Ingo
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-14 12:40 +0200 |
| Message-ID | <q8zl0-3Cs-25@gated-at.bofh.it> |
| In reply to | #1224000 |
On Mon, Sep 14, 2015 at 08:05:37PM +1000, Dave Airlie wrote:
> (this time with correct email address).
>
> On 14 September 2015 at 20:04, Dave Airlie <airlied@gmail.com> wrote:
> >>
> >>
> >> There's a new regression: v4.3-rc1 crashes on bootup on non-supported hardware, if
> >> CONFIG_DRM_MGAG200=y (built into the kernel).
> >
> > Archit, I'm guessing this is some fallout from the fbdev changes.
> >
> > There is no reason we should need CONFIG_FB_LITTLE_ENDIAN I don't think.
I am assuming v4.2 has worked for Ingo. So in that case I don't see any
change in fbdev/core/fbmem.c between 4.2 and 4.3-rc1. But in drm (I
almost know nothing about drm) commit e829d7ef9f17 changes few codes
related to the card revision. Can this help?
regards
sudip
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index c99d3fe..5cdfa53 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -1602,7 +1602,7 @@ static int mga_vga_mode_valid(struct drm_connector *connector,
if (mga_vga_calculate_mode_bandwidth(mode, bpp)
> (24400 * 1024))
return MODE_BANDWIDTH;
- } else if (mdev->unique_rev_id == 0x02) {
+ } else if (mdev->unique_rev_id >= 0x02) {
if (mode->hdisplay > 1920)
return MODE_VIRTUAL_X;
if (mode->vdisplay > 1200)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Archit Taneja <architt@codeaurora.org> |
|---|---|
| Date | 2015-09-14 17:30 +0200 |
| Message-ID | <q8DRD-1Is-3@gated-at.bofh.it> |
| In reply to | #1224000 |
Hi,
On 9/14/2015 3:35 PM, Dave Airlie wrote:
> (this time with correct email address).
>
> On 14 September 2015 at 20:04, Dave Airlie <airlied@gmail.com> wrote:
>>>
>>>> If drm_fb_helper_alloc_fbi() fails then we were directly returning
>>>> without freeing sysram. Also if drm_fb_helper_alloc_fbi() succeeds but
>>>> mgag200_framebuffer_init() fails then we were not releasing sysram and
>>>> we were not releasing fbi helper also.
>>>>
>>>> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
>>>> ---
>>>> drivers/gpu/drm/mgag200/mgag200_fb.c | 15 ++++++++++++---
>>>> 1 file changed, 12 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c
>>>> index 87de15e..5fe476a 100644
>>>> --- a/drivers/gpu/drm/mgag200/mgag200_fb.c
>>>> +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
>>>> @@ -189,14 +189,16 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
>>>> return -ENOMEM;
>>>>
>>>> info = drm_fb_helper_alloc_fbi(helper);
>>>> - if (IS_ERR(info))
>>>> - return PTR_ERR(info);
>>>> + if (IS_ERR(info)) {
>>>> + ret = PTR_ERR(info);
>>>> + goto err_alloc_fbi;
>>>> + }
>>>>
>>>> info->par = mfbdev;
>>>>
>>>> ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
>>>> if (ret)
>>>> - return ret;
>>>> + goto err_framebuffer_init;
>>>>
>>>> mfbdev->sysram = sysram;
>>>> mfbdev->size = size;
>>>> @@ -226,6 +228,13 @@ static int mgag200fb_create(struct drm_fb_helper *helper,
>>>> DRM_DEBUG_KMS("allocated %dx%d\n",
>>>> fb->width, fb->height);
>>>> return 0;
>>>> +
>>>> +err_framebuffer_init:
>>>> + drm_fb_helper_release_fbi(helper);
>>>> +
>>>> +err_alloc_fbi:
>>>> + vfree(sysram);
>>>> + return ret;
>>>> }
>>>>
>>>> static int mga_fbdev_destroy(struct drm_device *dev,
>>>
>>> There's a new regression: v4.3-rc1 crashes on bootup on non-supported hardware, if
>>> CONFIG_DRM_MGAG200=y (built into the kernel).
>>
>> Archit, I'm guessing this is some fallout from the fbdev changes.
>>
>> There is no reason we should need CONFIG_FB_LITTLE_ENDIAN I don't think.
It looks like the mgag200 driver load fails and we crash in the error
handling path. drm_fb_helper_fini ends up being called twice. The second
call tries to free resources that were already free'd.
The erroneous path above should have existed even without the recent
fbdev helper changes. I'm not sure what's causing the driver load
to fail in the first place. It looks like it's failing at
register_framebuffer. Is it possible that we never tried running
this driver before with Big Endian set?
The patch below fixes the problem with the error path mentioned
above. Could we try this?
From: Archit Taneja <architt@codeaurora.org>
Date: Mon, 14 Sep 2015 20:11:43 +0530
Subject: [PATCH] drm/mgag200: Prevent calling drm_fb_helper_fini twice
mgag200_fbdev_init's error handling path calls drm_fb_helper_fini before
bailing out. The error handling path of mgag200_driver_load also ends
up calling drm_fb_helper_fini.
This results in drm_fb_helper_fini being called twice if the driver load
drm op fails somewhere in between.
Make only mgag200_driver_unload call drm_fb_helper_fini, remove the call
from mgag200_fbdev_init.
Signed-off-by: Archit Taneja <architt@codeaurora.org>
---
drivers/gpu/drm/mgag200/mgag200_fb.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c
b/drivers/gpu/drm/mgag200/mgag200_fb.c
index 87de15e..6259b0a 100644
--- a/drivers/gpu/drm/mgag200/mgag200_fb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_fb.c
@@ -280,20 +280,16 @@ int mgag200_fbdev_init(struct mga_device *mdev)
ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper);
if (ret)
- goto fini;
+ return ret;
/* disable all the possible outputs/crtcs before entering KMS mode */
drm_helper_disable_unused_functions(mdev->dev);
ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel);
if (ret)
- goto fini;
+ return ret;
return 0;
-
-fini:
- drm_fb_helper_fini(&mfbdev->helper);
- return ret;
}
void mgag200_fbdev_fini(struct mga_device *mdev)
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Ingo Molnar <mingo@kernel.org> |
|---|---|
| Date | 2015-09-16 11:50 +0200 |
| Subject | [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice |
| Message-ID | <q9hvI-G1-17@gated-at.bofh.it> |
| In reply to | #1224245 |
* Archit Taneja <architt@codeaurora.org> wrote: > From: Archit Taneja <architt@codeaurora.org> > Date: Mon, 14 Sep 2015 20:11:43 +0530 > Subject: [PATCH] drm/mgag200: Prevent calling drm_fb_helper_fini twice > > mgag200_fbdev_init's error handling path calls drm_fb_helper_fini before > bailing out. The error handling path of mgag200_driver_load also ends > up calling drm_fb_helper_fini. > > This results in drm_fb_helper_fini being called twice if the driver load > drm op fails somewhere in between. > > Make only mgag200_driver_unload call drm_fb_helper_fini, remove the call > from mgag200_fbdev_init. > > Signed-off-by: Archit Taneja <architt@codeaurora.org> > --- > drivers/gpu/drm/mgag200/mgag200_fb.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c > b/drivers/gpu/drm/mgag200/mgag200_fb.c > index 87de15e..6259b0a 100644 > --- a/drivers/gpu/drm/mgag200/mgag200_fb.c > +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c > @@ -280,20 +280,16 @@ int mgag200_fbdev_init(struct mga_device *mdev) > > ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper); > if (ret) > - goto fini; > + return ret; > > /* disable all the possible outputs/crtcs before entering KMS mode */ > drm_helper_disable_unused_functions(mdev->dev); > > ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel); > if (ret) > - goto fini; > + return ret; > > return 0; > - > -fini: > - drm_fb_helper_fini(&mfbdev->helper); > - return ret; > } > > void mgag200_fbdev_fini(struct mga_device *mdev) So this patch was whitespace damaged - I applied it by hand and made the commit below. This has solved the crash, thanks Archit! And yes, you are right that my config probably crashed with older kernels too. Ingo =============> From 60d733a3ec19dc72372e12207a0a86293cd40cf5 Mon Sep 17 00:00:00 2001 From: Archit Taneja <architt@codeaurora.org> Date: Mon, 14 Sep 2015 20:53:57 +0530 Subject: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice mgag200_fbdev_init()'s error handling path calls drm_fb_helper_fini() before bailing out. The error handling path of mgag200_driver_load() also ends up calling drm_fb_helper_fini(). This results in drm_fb_helper_fini() being called twice if the driver load drm op fails somewhere in between. Make only mgag200_driver_unload() call drm_fb_helper_fini(), remove the call from mgag200_fbdev_init(). Reported-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Archit Taneja <architt@codeaurora.org> Cc: Archit Taneja <archit@ti.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Dave Airlie <airlied@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: dri-devel <dri-devel@lists.freedesktop.org> Link: http://lkml.kernel.org/r/55F6E68D.8070800@codeaurora.org Signed-off-by: Ingo Molnar <mingo@kernel.org> --- drivers/gpu/drm/mgag200/mgag200_fb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_fb.c b/drivers/gpu/drm/mgag200/mgag200_fb.c index 87de15ea1f93..6259b0a5fc38 100644 --- a/drivers/gpu/drm/mgag200/mgag200_fb.c +++ b/drivers/gpu/drm/mgag200/mgag200_fb.c @@ -280,20 +280,16 @@ int mgag200_fbdev_init(struct mga_device *mdev) ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper); if (ret) - goto fini; + return ret; /* disable all the possible outputs/crtcs before entering KMS mode */ drm_helper_disable_unused_functions(mdev->dev); ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel); if (ret) - goto fini; + return ret; return 0; - -fini: - drm_fb_helper_fini(&mfbdev->helper); - return ret; } void mgag200_fbdev_fini(struct mga_device *mdev) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Archit Taneja <architt@codeaurora.org> |
|---|---|
| Date | 2015-09-17 13:00 +0200 |
| Subject | Re: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice |
| Message-ID | <q9F50-1gS-13@gated-at.bofh.it> |
| In reply to | #1225900 |
On 9/17/2015 2:04 PM, Ingo Molnar wrote: > > > * Ingo Molnar <mingo@kernel.org> wrote: > > > >> So this patch was whitespace damaged - I applied it by hand and made the commit > >> below. This has solved the crash, thanks Archit! > > > > Spoke too soon - the attached (allyesconfig-ish) config still crashes, first there > > are a handful of kobject debug warnings, then: The error handling in the driver is bad. The main problem is that the driver_load op calls mgag200_driver_unload if anything fails, which doesn't work well if driver_load fails mid way. I'll post out patches to fix this. But you'll need to undo the patch I'd sent previously. Thanks, Archit > > > > [ 115.274847] [drm:mgag200_mm_init] *ERROR* Failed setting up TTM memory accounting subsystem. > > [ 115.274853] BUG: unable to handle kernel NULL pointer dereference at (null) > > [ 115.274856] IP: [<ffffffff81b88285>] drm_mode_config_cleanup+0x1f/0x1cc > > [ 115.274858] PGD 0 > > [ 115.274860] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN > > [ 115.274861] Modules linked in: > > [ 115.274862] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W L 4.3.0-rc1-01729-g525850e-dirty #59 > > [ 115.274863] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > > [ 115.274865] Workqueue: events work_for_cpu_fn > > [ 115.274865] task: ffff88017d2a8000 ti: ffff88017d2b0000 task.ti: ffff88017d2b0000 > > [ 115.274868] RIP: 0010:[<ffffffff81b88285>] [<ffffffff81b88285>] drm_mode_config_cleanup+0x1f/0x1cc > > [ 115.274868] RSP: 0000:ffff88017d2b7bd8 EFLAGS: 00010246 > > [ 115.274869] RAX: 0000000000000000 RBX: ffff8800ba0a4520 RCX: ffffffff81186ff1 > > [ 115.274870] RDX: ffff88017d2b7a90 RSI: ffffffff83d73579 RDI: ffff8800ba0a4520 > > [ 115.274870] RBP: ffff88017d2b7bf0 R08: 0000000000000001 R09: 0000000000000000 > > [ 115.274871] R10: 0000000000075000 R11: ffffffff85147a82 R12: ffff8800ba0a4520 > > [ 115.274872] R13: ffff8800ba0a4da8 R14: 00000000fffffffe R15: ffff8800ba0a3400 > > [ 115.274873] FS: 0000000000000000(0000) GS:ffff880420e00000(0000) knlGS:0000000000000000 > > [ 115.274874] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > [ 115.274875] CR2: 0000000000000000 CR3: 0000000005e2d000 CR4: 00000000001406f0 > > [ 115.274876] Stack: > > [ 115.274877] ffff8800ba0a3400 ffff8800ba0a4520 00000000fffffffe ffff88017d2b7c10 > > [ 115.274879] ffffffff81cb6a3e ffff8800ba0a4520 ffff8800ba0a3400 ffff88017d2b7c78 > > [ 115.274881] ffffffff81cb6efe 0000072001000000 000000000000aa55 0000075b00000000 > > [ 115.274881] Call Trace: > > [ 115.274883] [<ffffffff81cb6a3e>] mgag200_driver_unload+0x30/0x48 > > [ 115.274884] [<ffffffff81cb6efe>] mgag200_driver_load+0x4a8/0x4ba > > [ 115.274886] [<ffffffff81b80055>] drm_dev_register+0x6f/0xb0 > > [ 115.274887] [<ffffffff81b82865>] drm_get_pci_dev+0xff/0x1c2 > > [ 115.274889] [<ffffffff81cbaaed>] mga_pci_probe+0xa6/0xad > > [ 115.274890] [<ffffffff8190e877>] local_pci_probe+0x3d/0x82 > > [ 115.274891] [<ffffffff81158451>] work_for_cpu_fn+0x14/0x1b > > [ 115.274893] [<ffffffff8115bf66>] process_one_work+0x28e/0x4ef > > [ 115.274895] [<ffffffff8115be48>] ? process_one_work+0x170/0x4ef > > [ 115.274897] [<ffffffff8115c1e8>] process_scheduled_works+0x21/0x2f > > > > Full log is below, config attached as well. > > > > Thanks, > > > > Ingo > > > > ========================> > > [ 115.243547] mgag200 0000:0b:00.0: no default pinctrl state > > [ 115.243732] devices_kset: Moving 0000:0b:00.0 to end of list > > [ 115.247078] device: 'controlD64': device_add > > [ 115.247494] PM: Adding info for No Bus:controlD64 > > [ 115.247979] device: 'card0': device_add > > [ 115.248315] PM: Adding info for No Bus:card0 > > [ 115.274511] ------------[ cut here ]------------ > > [ 115.274518] WARNING: CPU: 0 PID: 4 at lib/kobject.c:582 kobject_get+0x33/0x6a() > > [ 115.274519] kobject: 'ttm' (ffffffff86c28700): is not initialized, yet kobject_get() is being called. > > [ 115.274521] Modules linked in: > > [ 115.274524] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W L 4.3.0-rc1-01729-g525850e-dirty #59 > > [ 115.274525] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > > [ 115.274529] Workqueue: events work_for_cpu_fn > > [ 115.274532] 0000000000000000 ffff88017d2b79a8 ffffffff8188f38b ffff88017d2b79f0 > > [ 115.274534] ffff88017d2b79e0 ffffffff81144593 ffffffff8189129f ffffffff86c28700 > > [ 115.274536] 0000000000000000 ffffffff86c28700 00000000007f4000 ffff88017d2b7a40 > > [ 115.274537] Call Trace: > > [ 115.274540] [<ffffffff8188f38b>] dump_stack+0x4b/0x64 > > [ 115.274543] [<ffffffff81144593>] warn_slowpath_common+0x9f/0xb8 > > [ 115.274545] [<ffffffff8189129f>] ? kobject_get+0x33/0x6a > > [ 115.274547] [<ffffffff811445f8>] warn_slowpath_fmt+0x4c/0x4e > > [ 115.274551] [<ffffffff811892de>] ? lock_is_held+0x55/0x66 > > [ 115.274553] [<ffffffff8189129f>] kobject_get+0x33/0x6a > > [ 115.274554] [<ffffffff81891963>] kobject_add_internal+0x58/0x2c4 > > [ 115.274556] [<ffffffff81891c42>] kobject_init_and_add+0x73/0x7e > > [ 115.274559] [<ffffffff81b981cf>] ttm_mem_global_init+0xc6/0x2cd > > [ 115.274563] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274564] [<ffffffff81290029>] ? kasan_unpoison_shadow+0x14/0x35 > > [ 115.274566] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274567] [<ffffffff81290095>] ? kasan_kmalloc+0x4b/0x50 > > [ 115.274569] [<ffffffff8128ccdc>] ? __kmalloc+0x13e/0x180 > > [ 115.274571] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274573] [<ffffffff81b910fc>] ? drm_global_item_ref+0x67/0xad > > [ 115.274577] [<ffffffff81cbb766>] mgag200_ttm_mem_global_init+0x12/0x14 > > [ 115.274579] [<ffffffff81b91113>] drm_global_item_ref+0x7e/0xad > > [ 115.274581] [<ffffffff81cbb82d>] mgag200_mm_init+0x50/0x199 > > [ 115.274583] [<ffffffff81cb6da0>] mgag200_driver_load+0x34a/0x4ba > > [ 115.274587] [<ffffffff81b80055>] drm_dev_register+0x6f/0xb0 > > [ 115.274589] [<ffffffff81b82865>] drm_get_pci_dev+0xff/0x1c2 > > [ 115.274590] [<ffffffff81cbaaed>] mga_pci_probe+0xa6/0xad > > [ 115.274593] [<ffffffff8190e877>] local_pci_probe+0x3d/0x82 > > [ 115.274595] [<ffffffff81158451>] work_for_cpu_fn+0x14/0x1b > > [ 115.274597] [<ffffffff8115bf66>] process_one_work+0x28e/0x4ef > > [ 115.274599] [<ffffffff8115be48>] ? process_one_work+0x170/0x4ef > > [ 115.274601] [<ffffffff8115c1e8>] process_scheduled_works+0x21/0x2f > > [ 115.274603] [<ffffffff8115c3f1>] worker_thread+0x1fb/0x2bd > > [ 115.274605] [<ffffffff8115c1f6>] ? process_scheduled_works+0x2f/0x2f > > [ 115.274607] [<ffffffff8116185b>] kthread+0xc5/0xcd > > [ 115.274609] [<ffffffff8118992e>] ? lock_release+0x3a5/0x3f8 > > [ 115.274611] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274615] [<ffffffff83d741af>] ret_from_fork+0x3f/0x70 > > [ 115.274616] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274618] ---[ end trace 3d275ea9d9277b89 ]--- > > [ 115.274619] ------------[ cut here ]------------ > > [ 115.274621] WARNING: CPU: 0 PID: 4 at include/linux/kref.h:47 kobject_get+0x5d/0x6a() > > [ 115.274622] Modules linked in: > > [ 115.274623] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W L 4.3.0-rc1-01729-g525850e-dirty #59 > > [ 115.274624] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > > [ 115.274626] Workqueue: events work_for_cpu_fn > > [ 115.274628] 0000000000000000 ffff88017d2b79f8 ffffffff8188f38b 0000000000000000 > > [ 115.274630] ffff88017d2b7a30 ffffffff81144593 ffffffff818912c9 ffffffff86c28700 > > [ 115.274632] 0000000000000000 ffffffff86c28700 00000000007f4000 ffff88017d2b7a40 > > [ 115.274632] Call Trace: > > [ 115.274634] [<ffffffff8188f38b>] dump_stack+0x4b/0x64 > > [ 115.274635] [<ffffffff81144593>] warn_slowpath_common+0x9f/0xb8 > > [ 115.274637] [<ffffffff818912c9>] ? kobject_get+0x5d/0x6a > > [ 115.274638] [<ffffffff8114465a>] warn_slowpath_null+0x1a/0x1c > > [ 115.274640] [<ffffffff818912c9>] kobject_get+0x5d/0x6a > > [ 115.274641] [<ffffffff81891963>] kobject_add_internal+0x58/0x2c4 > > [ 115.274642] [<ffffffff81891c42>] kobject_init_and_add+0x73/0x7e > > [ 115.274644] [<ffffffff81b981cf>] ttm_mem_global_init+0xc6/0x2cd > > [ 115.274645] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274647] [<ffffffff81290029>] ? kasan_unpoison_shadow+0x14/0x35 > > [ 115.274648] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274650] [<ffffffff81290095>] ? kasan_kmalloc+0x4b/0x50 > > [ 115.274651] [<ffffffff8128ccdc>] ? __kmalloc+0x13e/0x180 > > [ 115.274652] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274654] [<ffffffff81b910fc>] ? drm_global_item_ref+0x67/0xad > > [ 115.274655] [<ffffffff81cbb766>] mgag200_ttm_mem_global_init+0x12/0x14 > > [ 115.274657] [<ffffffff81b91113>] drm_global_item_ref+0x7e/0xad > > [ 115.274658] [<ffffffff81cbb82d>] mgag200_mm_init+0x50/0x199 > > [ 115.274660] [<ffffffff81cb6da0>] mgag200_driver_load+0x34a/0x4ba > > [ 115.274662] [<ffffffff81b80055>] drm_dev_register+0x6f/0xb0 > > [ 115.274663] [<ffffffff81b82865>] drm_get_pci_dev+0xff/0x1c2 > > [ 115.274665] [<ffffffff81cbaaed>] mga_pci_probe+0xa6/0xad > > [ 115.274666] [<ffffffff8190e877>] local_pci_probe+0x3d/0x82 > > [ 115.274668] [<ffffffff81158451>] work_for_cpu_fn+0x14/0x1b > > [ 115.274669] [<ffffffff8115bf66>] process_one_work+0x28e/0x4ef > > [ 115.274671] [<ffffffff8115be48>] ? process_one_work+0x170/0x4ef > > [ 115.274673] [<ffffffff8115c1e8>] process_scheduled_works+0x21/0x2f > > [ 115.274675] [<ffffffff8115c3f1>] worker_thread+0x1fb/0x2bd > > [ 115.274676] [<ffffffff8115c1f6>] ? process_scheduled_works+0x2f/0x2f > > [ 115.274678] [<ffffffff8116185b>] kthread+0xc5/0xcd > > [ 115.274679] [<ffffffff8118992e>] ? lock_release+0x3a5/0x3f8 > > [ 115.274681] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274683] [<ffffffff83d741af>] ret_from_fork+0x3f/0x70 > > [ 115.274684] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274685] ---[ end trace 3d275ea9d9277b8a ]--- > > [ 115.274686] ------------[ cut here ]------------ > > [ 115.274688] WARNING: CPU: 0 PID: 4 at lib/kobject.c:674 kobject_put+0x33/0x47() > > [ 115.274689] kobject: 'ttm' (ffffffff86c28700): is not initialized, yet kobject_put() is being called. > > [ 115.274690] Modules linked in: > > [ 115.274691] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W L 4.3.0-rc1-01729-g525850e-dirty #59 > > [ 115.274691] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > > [ 115.274693] Workqueue: events work_for_cpu_fn > > [ 115.274695] 0000000000000000 ffff88017d2b79a8 ffffffff8188f38b ffff88017d2b79f0 > > [ 115.274697] ffff88017d2b79e0 ffffffff81144593 ffffffff81891309 ffffffff86c28700 > > [ 115.274699] ffffffff86c28700 00000000fffffffe 00000000007f4000 ffff88017d2b7a40 > > [ 115.274700] Call Trace: > > [ 115.274701] [<ffffffff8188f38b>] dump_stack+0x4b/0x64 > > [ 115.274703] [<ffffffff81144593>] warn_slowpath_common+0x9f/0xb8 > > [ 115.274705] [<ffffffff81891309>] ? kobject_put+0x33/0x47 > > [ 115.274706] [<ffffffff811445f8>] warn_slowpath_fmt+0x4c/0x4e > > [ 115.274708] [<ffffffff81891309>] kobject_put+0x33/0x47 > > [ 115.274710] [<ffffffff81891ba6>] kobject_add_internal+0x29b/0x2c4 > > [ 115.274711] [<ffffffff81891c42>] kobject_init_and_add+0x73/0x7e > > [ 115.274712] [<ffffffff81b981cf>] ttm_mem_global_init+0xc6/0x2cd > > [ 115.274714] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274715] [<ffffffff81290029>] ? kasan_unpoison_shadow+0x14/0x35 > > [ 115.274717] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274718] [<ffffffff81290095>] ? kasan_kmalloc+0x4b/0x50 > > [ 115.274719] [<ffffffff8128ccdc>] ? __kmalloc+0x13e/0x180 > > [ 115.274721] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274722] [<ffffffff81b910fc>] ? drm_global_item_ref+0x67/0xad > > [ 115.274724] [<ffffffff81cbb766>] mgag200_ttm_mem_global_init+0x12/0x14 > > [ 115.274725] [<ffffffff81b91113>] drm_global_item_ref+0x7e/0xad > > [ 115.274727] [<ffffffff81cbb82d>] mgag200_mm_init+0x50/0x199 > > [ 115.274728] [<ffffffff81cb6da0>] mgag200_driver_load+0x34a/0x4ba > > [ 115.274730] [<ffffffff81b80055>] drm_dev_register+0x6f/0xb0 > > [ 115.274731] [<ffffffff81b82865>] drm_get_pci_dev+0xff/0x1c2 > > [ 115.274733] [<ffffffff81cbaaed>] mga_pci_probe+0xa6/0xad > > [ 115.274734] [<ffffffff8190e877>] local_pci_probe+0x3d/0x82 > > [ 115.274736] [<ffffffff81158451>] work_for_cpu_fn+0x14/0x1b > > [ 115.274737] [<ffffffff8115bf66>] process_one_work+0x28e/0x4ef > > [ 115.274739] [<ffffffff8115be48>] ? process_one_work+0x170/0x4ef > > [ 115.274741] [<ffffffff8115c1e8>] process_scheduled_works+0x21/0x2f > > [ 115.274743] [<ffffffff8115c3f1>] worker_thread+0x1fb/0x2bd > > [ 115.274745] [<ffffffff8115c1f6>] ? process_scheduled_works+0x2f/0x2f > > [ 115.274746] [<ffffffff8116185b>] kthread+0xc5/0xcd > > [ 115.274747] [<ffffffff8118992e>] ? lock_release+0x3a5/0x3f8 > > [ 115.274749] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274751] [<ffffffff83d741af>] ret_from_fork+0x3f/0x70 > > [ 115.274752] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274753] ---[ end trace 3d275ea9d9277b8b ]--- > > [ 115.274763] ------------[ cut here ]------------ > > [ 115.274764] WARNING: CPU: 0 PID: 4 at lib/kobject.c:244 kobject_add_internal+0x281/0x2c4() > > [ 115.274765] kobject_add_internal failed for memory_accounting (error: -2 parent: kkkkkkk���������� > > [ 115.274765] �����������V�(�����b�(������ȉ��������������ہ����V�R������!) > > [ 115.274766] Modules linked in: > > [ 115.274767] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W L 4.3.0-rc1-01729-g525850e-dirty #59 > > [ 115.274768] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > > [ 115.274769] Workqueue: events work_for_cpu_fn > > [ 115.274771] 0000000000000000 ffff88017d2b79c0 ffffffff8188f38b ffff88017d2b7a08 > > [ 115.274773] ffff88017d2b79f8 ffffffff81144593 ffffffff81891b8c ffff88041821e270 > > [ 115.274775] ffffffff86c28700 00000000fffffffe 00000000007f4000 ffff88017d2b7a58 > > [ 115.274776] Call Trace: > > [ 115.274777] [<ffffffff8188f38b>] dump_stack+0x4b/0x64 > > [ 115.274779] [<ffffffff81144593>] warn_slowpath_common+0x9f/0xb8 > > [ 115.274780] [<ffffffff81891b8c>] ? kobject_add_internal+0x281/0x2c4 > > [ 115.274781] [<ffffffff811445f8>] warn_slowpath_fmt+0x4c/0x4e > > [ 115.274782] [<ffffffff81891b8c>] kobject_add_internal+0x281/0x2c4 > > [ 115.274784] [<ffffffff81891c42>] kobject_init_and_add+0x73/0x7e > > [ 115.274785] [<ffffffff81b981cf>] ttm_mem_global_init+0xc6/0x2cd > > [ 115.274787] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274788] [<ffffffff81290029>] ? kasan_unpoison_shadow+0x14/0x35 > > [ 115.274790] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274792] [<ffffffff81290095>] ? kasan_kmalloc+0x4b/0x50 > > [ 115.274793] [<ffffffff8128ccdc>] ? __kmalloc+0x13e/0x180 > > [ 115.274795] [<ffffffff8128f809>] ? kasan_poison_shadow+0x2f/0x31 > > [ 115.274796] [<ffffffff81b910fc>] ? drm_global_item_ref+0x67/0xad > > [ 115.274798] [<ffffffff81cbb766>] mgag200_ttm_mem_global_init+0x12/0x14 > > [ 115.274799] [<ffffffff81b91113>] drm_global_item_ref+0x7e/0xad > > [ 115.274801] [<ffffffff81cbb82d>] mgag200_mm_init+0x50/0x199 > > [ 115.274803] [<ffffffff81cb6da0>] mgag200_driver_load+0x34a/0x4ba > > [ 115.274805] [<ffffffff81b80055>] drm_dev_register+0x6f/0xb0 > > [ 115.274806] [<ffffffff81b82865>] drm_get_pci_dev+0xff/0x1c2 > > [ 115.274808] [<ffffffff81cbaaed>] mga_pci_probe+0xa6/0xad > > [ 115.274809] [<ffffffff8190e877>] local_pci_probe+0x3d/0x82 > > [ 115.274810] [<ffffffff81158451>] work_for_cpu_fn+0x14/0x1b > > [ 115.274812] [<ffffffff8115bf66>] process_one_work+0x28e/0x4ef > > [ 115.274814] [<ffffffff8115be48>] ? process_one_work+0x170/0x4ef > > [ 115.274816] [<ffffffff8115c1e8>] process_scheduled_works+0x21/0x2f > > [ 115.274817] [<ffffffff8115c3f1>] worker_thread+0x1fb/0x2bd > > [ 115.274819] [<ffffffff8115c1f6>] ? process_scheduled_works+0x2f/0x2f > > [ 115.274820] [<ffffffff8116185b>] kthread+0xc5/0xcd > > [ 115.274822] [<ffffffff8118992e>] ? lock_release+0x3a5/0x3f8 > > [ 115.274824] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274825] [<ffffffff83d741af>] ret_from_fork+0x3f/0x70 > > [ 115.274827] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274828] ---[ end trace 3d275ea9d9277b8c ]--- > > [ 115.274847] [drm:mgag200_mm_init] *ERROR* Failed setting up TTM memory accounting subsystem. > > [ 115.274853] BUG: unable to handle kernel NULL pointer dereference at (null) > > [ 115.274856] IP: [<ffffffff81b88285>] drm_mode_config_cleanup+0x1f/0x1cc > > [ 115.274858] PGD 0 > > [ 115.274860] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN > > [ 115.274861] Modules linked in: > > [ 115.274862] CPU: 0 PID: 4 Comm: kworker/0:0 Tainted: G W L 4.3.0-rc1-01729-g525850e-dirty #59 > > [ 115.274863] Hardware name: Intel Corporation S2600GZ/S2600GZ, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013 > > [ 115.274865] Workqueue: events work_for_cpu_fn > > [ 115.274865] task: ffff88017d2a8000 ti: ffff88017d2b0000 task.ti: ffff88017d2b0000 > > [ 115.274868] RIP: 0010:[<ffffffff81b88285>] [<ffffffff81b88285>] drm_mode_config_cleanup+0x1f/0x1cc > > [ 115.274868] RSP: 0000:ffff88017d2b7bd8 EFLAGS: 00010246 > > [ 115.274869] RAX: 0000000000000000 RBX: ffff8800ba0a4520 RCX: ffffffff81186ff1 > > [ 115.274870] RDX: ffff88017d2b7a90 RSI: ffffffff83d73579 RDI: ffff8800ba0a4520 > > [ 115.274870] RBP: ffff88017d2b7bf0 R08: 0000000000000001 R09: 0000000000000000 > > [ 115.274871] R10: 0000000000075000 R11: ffffffff85147a82 R12: ffff8800ba0a4520 > > [ 115.274872] R13: ffff8800ba0a4da8 R14: 00000000fffffffe R15: ffff8800ba0a3400 > > [ 115.274873] FS: 0000000000000000(0000) GS:ffff880420e00000(0000) knlGS:0000000000000000 > > [ 115.274874] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > > [ 115.274875] CR2: 0000000000000000 CR3: 0000000005e2d000 CR4: 00000000001406f0 > > [ 115.274876] Stack: > > [ 115.274877] ffff8800ba0a3400 ffff8800ba0a4520 00000000fffffffe ffff88017d2b7c10 > > [ 115.274879] ffffffff81cb6a3e ffff8800ba0a4520 ffff8800ba0a3400 ffff88017d2b7c78 > > [ 115.274881] ffffffff81cb6efe 0000072001000000 000000000000aa55 0000075b00000000 > > [ 115.274881] Call Trace: > > [ 115.274883] [<ffffffff81cb6a3e>] mgag200_driver_unload+0x30/0x48 > > [ 115.274884] [<ffffffff81cb6efe>] mgag200_driver_load+0x4a8/0x4ba > > [ 115.274886] [<ffffffff81b80055>] drm_dev_register+0x6f/0xb0 > > [ 115.274887] [<ffffffff81b82865>] drm_get_pci_dev+0xff/0x1c2 > > [ 115.274889] [<ffffffff81cbaaed>] mga_pci_probe+0xa6/0xad > > [ 115.274890] [<ffffffff8190e877>] local_pci_probe+0x3d/0x82 > > [ 115.274891] [<ffffffff81158451>] work_for_cpu_fn+0x14/0x1b > > [ 115.274893] [<ffffffff8115bf66>] process_one_work+0x28e/0x4ef > > [ 115.274895] [<ffffffff8115be48>] ? process_one_work+0x170/0x4ef > > [ 115.274897] [<ffffffff8115c1e8>] process_scheduled_works+0x21/0x2f > > [ 115.274898] [<ffffffff8115c3f1>] worker_thread+0x1fb/0x2bd > > [ 115.274901] [<ffffffff8115c1f6>] ? process_scheduled_works+0x2f/0x2f > > [ 115.274902] [<ffffffff8116185b>] kthread+0xc5/0xcd > > [ 115.274904] [<ffffffff8118992e>] ? lock_release+0x3a5/0x3f8 > > [ 115.274906] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274908] [<ffffffff83d741af>] ret_from_fork+0x3f/0x70 > > [ 115.274910] [<ffffffff81161796>] ? kthread_parkme+0x24/0x24 > > [ 115.274928] Code: 00 49 83 c0 28 e8 c9 fd ff ff 5d c3 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 48 8b 87 88 08 00 00 48 89 fb 4c 8d ab 88 08 00 00 <4c> 8b 20 48 8d 78 f8 49 83 ec 08 eb 13 48 8b 47 50 ff 50 08 49 > > [ 115.274930] RIP [<ffffffff81b88285>] drm_mode_config_cleanup+0x1f/0x1cc > > [ 115.274931] RSP <ffff88017d2b7bd8> > > [ 115.274932] CR2: 0000000000000000 > > [ 115.274934] ---[ end trace 3d275ea9d9277b8d ]--- > > [ 115.284475] kworker/0:0 (4) used greatest stack depth: 29320 bytes left > > [ 115.284480] BUG: unable to handle kernel paging request at ffffffffffffff98 > > [ 115.284483] IP: [<ffffffff81161a7d>] kthread_data+0x10/0x16 > > [ 115.284484] PGD 5e30067 PUD 5e32067 PMD 0 > > [ 115.284486] Oops: 0000 [#2] SMP DEBUG_PAGEALLOC KASAN > -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Date | 2015-09-17 13:20 +0200 |
| Subject | Re: [PATCH] drm/mgag200: Fix calling drm_fb_helper_fini() twice |
| Message-ID | <q9Fom-1Tl-5@gated-at.bofh.it> |
| In reply to | #1226907 |
On Thu, Sep 17, 2015 at 04:24:21PM +0530, Archit Taneja wrote: > > > On 9/17/2015 2:04 PM, Ingo Molnar wrote: > > > > > >* Ingo Molnar <mingo@kernel.org> wrote: > > > > > > > >>So this patch was whitespace damaged - I applied it by hand and made the commit > > > >>below. This has solved the crash, thanks Archit! > > > > > > > >Spoke too soon - the attached (allyesconfig-ish) config still crashes, first there > > > >are a handful of kobject debug warnings, then: > > The error handling in the driver is bad. The main problem is that > the driver_load op calls mgag200_driver_unload if anything fails, > which doesn't work well if driver_load fails mid way. mgag200_driver_unload is trying to unload everything evenif that has not succeeded in initializing. Here the ttm failed to initialize but still mgag200_mm_fini was called to unload it. regards sudip -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web