Re: Q: weird hidraw behaviour

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

 



Hi

On Tue, Sep 24, 2013 at 10:56 AM, Mika Westerberg
<mika.westerberg@xxxxxxxxxxxxxxx> wrote:
> Hi,
>
> I noticed that after commit 212a871a393 (HID: hidraw: correctly deallocate
> memory on device disconnect) hidraw doesn't close the underlying hid device
> when the device node is closed last time.
>
> For example I have a touch panel (HID over I2C) device with added debug
> prints in i2c_hid_open()/i2c_hid_close():
>
>         # od -x /dev/hidraw0
>         [   41.363813] i2c_hid 1-004c: i2c_hid_power lvl:32
>         [   41.368464] i2c_hid 1-004c: i2c_hid_set_power
>         [   41.372831] i2c_hid 1-004c: __i2c_hid_command: cmd=54 01 00 08
>         [   41.451455] i2c_hid 1-004c: i2c_hid_open
>         ^C
>
>         # od -x /dev/hidraw0
>         [   58.420928] i2c_hid 1-004c: i2c_hid_power lvl:32
>         [   58.425577] i2c_hid 1-004c: i2c_hid_set_power
>         [   58.429945] i2c_hid 1-004c: __i2c_hid_command: cmd=54 01 00 08
>         [   58.525276] i2c_hid 1-004c: i2c_hid_open
>         ^C
>
> i2c_hid_close() is never called. Is this intended or am I missing
> something?

I don't know whether it's intentional, but it is hardcoded this way
now. Logic is, ->close() is called on hidraw_disconnect() that is,
when hidraw is unloaded on a device. It no longer depends on
user-space processes.

Any reason to change it back? It's no bug, so if no-one cares I'd
leave it as it is now. Otherwise, we can try to change it again.

Regards
David
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux