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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 10 Oct 2016 14:39:04 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Benjamin Tissoires <benjamin.tissoires@...hat.com>
Cc:     Wolfram Sang <wsa@...-dreams.de>, Jean Delvare <jdelvare@...e.com>,
        Jonathan Corbet <corbet@....net>, KT Liao <kt.liao@....com.tw>,
        Linux I2C <linux-i2c@...r.kernel.org>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4 8/8] Input: elan_i2c - add Host Notify support

Hi Benjamin,

On Mon, Oct 10, 2016 at 9:42 AM, Benjamin Tissoires
<benjamin.tissoires@...hat.com> wrote:
> The Thinkpad series 13 uses Host Notify to report the interrupt.
> Add elan_smb_alert() to handle those interrupts and disable the irq
> handling on this case.
>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>
>

Why do we have to do this in the driver instead of having I2C core set
it up for us? I expect we'd be repeating this block of code for every
driver that has an option of using SMbus notify.

Thanks!

> ---
>
> new in v4 (was submitted on linux-input with the .alert callback)
> ---
>  drivers/input/mouse/elan_i2c_core.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
> index 6f16eb4..4aaac5d 100644
> --- a/drivers/input/mouse/elan_i2c_core.c
> +++ b/drivers/input/mouse/elan_i2c_core.c
> @@ -1040,6 +1040,21 @@ static int elan_probe(struct i2c_client *client,
>                                                 I2C_FUNC_SMBUS_BLOCK_DATA |
>                                                 I2C_FUNC_SMBUS_I2C_BLOCK)) {
>                 transport_ops = &elan_smbus_ops;
> +
> +               if (!irq) {
> +                       if (!i2c_check_functionality(client->adapter,
> +                                       I2C_FUNC_SMBUS_HOST_NOTIFY)) {
> +                               dev_err(dev, "no Host Notify support\n");
> +                               return -ENODEV;
> +                       }
> +
> +                       irq = i2c_smbus_host_notify_to_irq(client);
> +                       if (irq < 0) {
> +                               dev_err(dev,
> +                                       "Unable to request a Host Notify IRQ.\n");
> +                               return irq;
> +                       }
> +               }
>         } else {
>                 dev_err(dev, "not a supported I2C/SMBus adapter\n");
>                 return -EIO;
> --
> 2.7.4
>



-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ