| From 60842ef8128e7bf58c024814cd0dc14319232b6c Mon Sep 17 00:00:00 2001 |
| From: Sinclair Yeh <syeh@vmware.com> |
| Date: Thu, 23 Jun 2016 17:37:34 -0700 |
| Subject: Input: vmmouse - remove port reservation |
| |
| From: Sinclair Yeh <syeh@vmware.com> |
| |
| commit 60842ef8128e7bf58c024814cd0dc14319232b6c upstream. |
| |
| The VMWare EFI BIOS will expose port 0x5658 as an ACPI resource. This |
| causes the port to be reserved by the APCI module as the system comes up, |
| making it unavailable to be reserved again by other drivers, thus |
| preserving this VMWare port for special use in a VMWare guest. |
| |
| This port is designed to be shared among multiple VMWare services, such as |
| the VMMOUSE. Because of this, VMMOUSE should not try to reserve this port |
| on its own. |
| |
| The VMWare non-EFI BIOS does not do this to preserve compatibility with |
| existing/legacy VMs. It is known that there is small chance a VM may be |
| configured such that these ports get reserved by other non-VMWare devices, |
| and if this ever happens, the result is undefined. |
| |
| Signed-off-by: Sinclair Yeh <syeh@vmware.com> |
| Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> |
| Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| |
| --- |
| drivers/input/mouse/vmmouse.c | 22 ++-------------------- |
| 1 file changed, 2 insertions(+), 20 deletions(-) |
| |
| --- a/drivers/input/mouse/vmmouse.c |
| +++ b/drivers/input/mouse/vmmouse.c |
| @@ -355,18 +355,11 @@ int vmmouse_detect(struct psmouse *psmou |
| return -ENXIO; |
| } |
| |
| - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { |
| - psmouse_dbg(psmouse, "VMMouse port in use.\n"); |
| - return -EBUSY; |
| - } |
| - |
| /* Check if the device is present */ |
| response = ~VMMOUSE_PROTO_MAGIC; |
| VMMOUSE_CMD(GETVERSION, 0, version, response, dummy1, dummy2); |
| - if (response != VMMOUSE_PROTO_MAGIC || version == 0xffffffffU) { |
| - release_region(VMMOUSE_PROTO_PORT, 4); |
| + if (response != VMMOUSE_PROTO_MAGIC || version == 0xffffffffU) |
| return -ENXIO; |
| - } |
| |
| if (set_properties) { |
| psmouse->vendor = VMMOUSE_VENDOR; |
| @@ -374,8 +367,6 @@ int vmmouse_detect(struct psmouse *psmou |
| psmouse->model = version; |
| } |
| |
| - release_region(VMMOUSE_PROTO_PORT, 4); |
| - |
| return 0; |
| } |
| |
| @@ -394,7 +385,6 @@ static void vmmouse_disconnect(struct ps |
| psmouse_reset(psmouse); |
| input_unregister_device(priv->abs_dev); |
| kfree(priv); |
| - release_region(VMMOUSE_PROTO_PORT, 4); |
| } |
| |
| /** |
| @@ -438,15 +428,10 @@ int vmmouse_init(struct psmouse *psmouse |
| struct input_dev *rel_dev = psmouse->dev, *abs_dev; |
| int error; |
| |
| - if (!request_region(VMMOUSE_PROTO_PORT, 4, "vmmouse")) { |
| - psmouse_dbg(psmouse, "VMMouse port in use.\n"); |
| - return -EBUSY; |
| - } |
| - |
| psmouse_reset(psmouse); |
| error = vmmouse_enable(psmouse); |
| if (error) |
| - goto release_region; |
| + return error; |
| |
| priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
| abs_dev = input_allocate_device(); |
| @@ -502,8 +487,5 @@ init_fail: |
| kfree(priv); |
| psmouse->private = NULL; |
| |
| -release_region: |
| - release_region(VMMOUSE_PROTO_PORT, 4); |
| - |
| return error; |
| } |