Re: [PATCH] input/vmmouse: Add vmmouse_reset() function to disable vmmouse before entering suspend mode

From: Zack Rusin
Date: Mon Apr 25 2022 - 22:40:58 EST


On Tue, 2022-03-22 at 10:10 +0800, Zongmin Zhou wrote:
> ⚠ External Email: This email originated from outside of the
> organization. Do not click links or open attachments unless you
> recognize the sender.
>
> Details:
> When I use VirtualPS/2 VMMouse on virtual machine,There will be an
> error message after resume from suspend mode.
> like below:
> psmouse serio1: vmmouse: Unable to re-enable mouse when reconnecting,
> err: -6
> And vmmouse will be unusable,so have to do full rescan to find a
> another driver to use for the port.
>
> This error is due to QEMU still generate PS2 events to notify kernel
> driver to read from queue,
> but kernel can't process the data in suspend mode, resulting a surge
> of s->nb_queue value,
> which ultimately led to an error getting VMMOUSE_VERSION_ID after
> resume.
>
> Test scenario:
> 1)virtual machine started with qemu command "vmport=on",it will use
> VirtualPS/2 VMMouse
> 2)click suspend botton to enter suspend mode
> 3)resume and will get the error message from dmesg
>
> Fixed by:
> Disabling the vmmouse in its reset handler,It will notify qemu to
> stop vmmouse and remove handler.

Thank you for the clarification. Looks good.

Reviewed-by: Zack Rusin <zackr@xxxxxxxxxx>