-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Fix DMA channel and memory leak in vc4 #3012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for trying to improve this code, but I think your general approach is the wrong one. If you follow the pattern I outline in the line comments you will probably find that it doesn't leak and doesn't crash.
If you have changes to submit you have two options:
- Append a followup patch to your forked branch and it will appear here. The commits can be squashed into one at merge time. This is helpful if the patch is extensive, the changes are small and the end result will be a single commit.
- Fix up your commits locally to look how you want them to, then force push (
git push -f
) to your forked branch and the whole PR will be rewritten.
I have reworked the patch on the basis of releasing any required resources if it is necessary to error out of the bind. For most memory allocs that had already been ensured by using managed variants, but there was a one which wasn't. |
That's looking much better from a functionality point of view. The remaining changes I would like are essentially cosmetic/stylistic:
|
Thanks for the helpful feedback, which I believe I've reflected in this new P/R. |
@pelwell I wonder if you had a chance to review the changes I made following your feedback? (I may not quite have the hang of the pull request process - I'm hoping my most recent 'commit' would have 'refreshed' the pull request for you, but I'm not totally sure...) |
Sorry for the delayed response - I'm temporarily reassigned and unable to test the latest patch, but it looks OK so will probably get merged early next week. |
[ Sorry for the abnormally slow responses - the normally slow responses should be in effect now. ] That looks good (with a minor whitespace change). Do you have a "Signed-off-by: " line to add? If you reply with one I can add it when squashing down to a single commit. |
|
Would be nice to get this upstream |
kernel: drm: vc4_dsi: Fix DMA channel and memory leak in vc4 See: raspberrypi/linux#3012 firmware: hvs: Emulate the EOLn interrupt with a timer reset from VSTART See: #1154 firmware: Add support for Rec2020 colour space in vc_image, IL, and MMAL
kernel: drm: vc4_dsi: Fix DMA channel and memory leak in vc4 See: raspberrypi/linux#3012 firmware: hvs: Emulate the EOLn interrupt with a timer reset from VSTART See: raspberrypi/firmware#1154 firmware: Add support for Rec2020 colour space in vc_image, IL, and MMAL
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
This reverts commit 3ea0acb.
…rypi#3012)" This reverts commit 3ea0acb.
…rypi#3012)" This reverts commit 3ea0acb.
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Signed-off-by: Chris G Miller <chris@creative-electronics.net>
Adding a non-Raspberry DSI display. Even with panel driver and DTB apparently correct, startup was frequently failling with a dmesg entry:
[ 4.690030] [drm:vc4_dsi_bind [vc4]] ERROR Failed to get DMA channel: mask:0001 chan:-19
The vc4/panel startup 'pas a doble' means vc4 requests EPROBE_DEFER before the panel is ready, sometimes several times.
It was found that each iteration was requesting a new DMA channel, and the system was running out.
It was also noticed that small amounts of memory were being allocated each time.
The attached patch seems to fix the second memory leak and the DMA leak.
The patch file contains a proposal for a third patch to fix the first memory leak, but when applied, breaks something, resulting in a kernel oops.
The patch as offered also includes additional debugging messages which could be removed for production.
I have tested this patch in conjunction with the very recent fixes from pelwell which also address a DMA leak.
PS: this is the first time I've done a pull request, so please forgive me if the etiquette isn't quite right...