lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120802230653.GB31058@nautilus.holoscopio.com>
Date:	Thu, 2 Aug 2012 20:06:54 -0300
From:	Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>
To:	Carlos Alberto Lopez Perez <clopez@...lia.com>
Cc:	Daniel Oliveira Nascimento <don@...t.com.br>,
	Matthew Garrett <mjg@...hat.com>,
	platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] classmate-laptop: always call input_sync() after
 input_report_switch()

On Thu, Aug 02, 2012 at 07:50:21PM +0200, Carlos Alberto Lopez Perez wrote:
> Due to commit cdda911c34006f1089f3c87b1a1f31ab3a4722f2 evdev only
> becomes readable when the buffer contains an EV_SYN/SYN_REPORT event.
> 
> So in order to read the tablet sensor data as it happens we need to
> ensure that we always call input_sync() after input_report_switch()
> 
> Signed-off-by: Carlos Alberto Lopez Perez <clopez@...lia.com>

Thanks, Carlos.

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@...oscopio.com>

> ---
>  drivers/platform/x86/classmate-laptop.c |   12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
> index 2ca7dd1..0667aa9 100644
> --- a/drivers/platform/x86/classmate-laptop.c
> +++ b/drivers/platform/x86/classmate-laptop.c
> @@ -723,8 +723,10 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event)
>  	struct input_dev *inputdev = dev_get_drvdata(&dev->dev);
>  
>  	if (event == 0x81) {
> -		if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val)))
> +		if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) {
>  			input_report_switch(inputdev, SW_TABLET_MODE, !val);
> +			input_sync(inputdev);
> +		}
>  	}
>  }
>  
> @@ -737,8 +739,10 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev)
>  	set_bit(SW_TABLET_MODE, inputdev->swbit);
>  
>  	acpi = to_acpi_device(inputdev->dev.parent);
> -	if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val)))
> +	if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) {
>  		input_report_switch(inputdev, SW_TABLET_MODE, !val);
> +		input_sync(inputdev);
> +	}
>  }
>  
>  static int cmpc_tablet_add(struct acpi_device *acpi)
> @@ -757,8 +761,10 @@ static int cmpc_tablet_resume(struct device *dev)
>  	struct input_dev *inputdev = dev_get_drvdata(dev);
>  
>  	unsigned long long val = 0;
> -	if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val)))
> +	if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val))) {
>  		input_report_switch(inputdev, SW_TABLET_MODE, !val);
> +		input_sync(inputdev);
> +	}
>  	return 0;
>  }
>  
> -- 
> 1.7.10.4
> 

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ