Re: [PATCH] media: uvcvideo: Fix menu count handling for userspace XU mappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 24.06.23 02:25, Laurent Pinchart wrote:
> 
> On Wed, Jun 21, 2023 at 05:26:39PM +0200, Poncho wrote:
>> Hi Laurent
>>
>> Friendly ping. I think this patch was forgotten.
> Thanks for the reminder. I'll send a pull request for v6.6.

Why 6.6? If this would be a feature I'd fully understand. But this
afaics fixes a regression and thus should be handled as one, even if
it's a regression from a earlier release. For details see this recent
mail from Linus:

https://lore.kernel.org/all/CAHk-=wis_qQy4oDNynNKi5b7Qhosmxtoj1jxo5wmB6SRUwQUBQ@xxxxxxxxxxxxxx/

Side note: as it's a regression it would be good if this commit had a
"CC: <stable..." tag as well.

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
If I did something stupid, please tell me, as explained on that page.

>> On 06.06.23 19:11, Laurent Pinchart wrote:
>>> When commit 716c330433e3 ("media: uvcvideo: Use standard names for
>>> menus") reworked the handling of menu controls, it inadvertently
>>> replaced a GENMASK(n - 1, 0) with a BIT_MASK(n). The latter isn't
>>> equivalent to the former, which broke adding XU mappings from userspace.
>>> Fix it.
>>>
>>> Reported-by: Poncho <poncho@xxxxxxxxx>
>>> Link: https://lore.kernel.org/linux-media/468a36ec-c3ac-cb47-e12f-5906239ae3cd@xxxxxxxxx/
>>> Fixes: 716c330433e3 ("media: uvcvideo: Use standard names for menus")
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
>>> ---
>>> This is untested. Poncho, would you be able to test this patch to see if
>>> it fixes your issue ?
>>> ---
>>>   drivers/media/usb/uvc/uvc_v4l2.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
>>> index 5ac2a424b13d..f4988f03640a 100644
>>> --- a/drivers/media/usb/uvc/uvc_v4l2.c
>>> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
>>> @@ -45,7 +45,7 @@ static int uvc_control_add_xu_mapping(struct uvc_video_chain *chain,
>>>   	map->menu_names = NULL;
>>>   	map->menu_mapping = NULL;
>>>   
>>> -	map->menu_mask = BIT_MASK(xmap->menu_count);
>>> +	map->menu_mask = GENMASK(xmap->menu_count - 1, 0);
>>>   
>>>   	size = xmap->menu_count * sizeof(*map->menu_mapping);
>>>   	map->menu_mapping = kzalloc(size, GFP_KERNEL);
> 



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux