[PATCH] drm/udl: Refactor edid retreiving in UDL driver

Jani Nikula jani.nikula at linux.intel.com
Thu Mar 14 10:00:47 UTC 2019


On Wed, 13 Mar 2019, Robert Tarasov <tutankhamen at chromium.org> wrote:
> On Wed, Mar 13, 2019 at 2:26 AM Jani Nikula <jani.nikula at linux.intel.com>
> wrote:
>  read_buff = kmalloc(2, GFP_KERNEL);
>>
>> A follow-up cleanup might be to switch to using "u8 read_buff[2];"
>> instead of kmallocing it.
>>
>> I don't claim to understand how the usb stuff works, but otherwise the
>> patch looks good to me. Nice refactoring!
>>
>>
> "The buffer passed to usb_control_msg may end up in scatter-gather list,
> and may thus not be on the stack. Having it on the stack usually works on
> x86,   but not on other archs. "

Apparently you're referring to commit 242187b36255 ("udldrmfb:
udl_get_edid: usb_control_msg buffer must not be on the stack"). Cc:
Hans.

Mind blows. Not a word on this anywhere in usb_control_msg()
documentation. Nothing. I found this patch [1] that never go applied,
which doesn't actually say anything about stack, only alignment and
padding. Cc: Mauro.

I think with this usb_control_msg() goes to negative levels in Rusty's
API design manifesto.


BR,
Jani.



[1] http://mid.mail-archive.com/ee3ea6944e095fa3b2383697a967f4bc9e2d9631.1490813422.git.mchehab@s-opensource.com


-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the dri-devel mailing list