Re: [PATCH v2 1/2 RESEND] staging: dgnc: remove dead code in dgnc_tty_write()

2015-04-11 Thread Giedrius Statkevičius
On Sat, 11 Apr 2015, Sudip Mukherjee wrote: > On Fri, Apr 10, 2015 at 05:48:54PM +0300, Giedrius Statkevičius wrote: > > Remove the dead code protected by in_user in dgnc_tty_write() because it is > > set > > to 0 and never changed to 1 thus the code in ifs never gets executed. > dgnc_tty_write()

Re: [PATCH v2 1/2 RESEND] staging: dgnc: remove dead code in dgnc_tty_write()

2015-04-11 Thread Sudip Mukherjee
On Sat, Apr 11, 2015 at 03:20:43PM +0300, Giedrius Statkevičius wrote: > On Sat, 11 Apr 2015, Sudip Mukherjee wrote: > > > On Fri, Apr 10, 2015 at 05:48:54PM +0300, Giedrius Statkevičius wrote: > Well, I think this is wrong because: yes. I looked at many of the tty drivers and all of them have us

[PATCH 10/21] Drivers: hv: vss: switch to using the hvutil_device_state state machine

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Switch to using the hvutil_device_state state machine from using kvp_transaction.active. State transitions are: -> HVUTIL_DEVICE_INIT when driver loads or on device release -> HVUTIL_READY if the handshake was successful -> HVUTIL_HOSTMSG_RECEIVED when there is a non-nego

[PATCH 21/21] Drivers: hv: utils: unify driver registration reporting

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Unify driver registration reporting and move it to debug level as normally daemons write to syslog themselves and these kernel messages are useless. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_fcopy.c|3

[PATCH 00/21] Drivers: hv: utils: re-implement the kernel/userspace communication layer

2015-04-11 Thread K. Y. Srinivasan
Changes in v3: - Removed RFC from subject, rebased on top of current char-misc-next tree. RFCv2: http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-March/066629.html Anatomy of the series: Patches 01 - 07 are cleanup with minor functional change. Patch 08 defines the state ma

[PATCH 04/21] Drivers: hv: fcopy: process deferred messages when we complete the transaction

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov In theory, the host is not supposed to issue any requests before be reply to the previous one. In KVP we, however, support the following scenarios: 1) A message was received before userspace daemon registered; 2) A message was received while the previous one is still being

[PATCH 20/21] Drivers: hv: fcopy: full handshake support

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Introduce FCOPY_VERSION_1 to support kernel replying to the negotiation message with its own version. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_fcopy.c | 16 +++- include/uapi/linux/hyperv.h

[PATCH 02/21] Drivers: hv: kvp: reset kvp_context

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov We set kvp_context when we want to postpone receiving a packet from vmbus due to the previous transaction being unfinished. We, however, never reset this state, all consequent kvp_respond_to_host() calls will result in poll_channel() calling hv_kvp_onchannelcallback(). This

[PATCH 01/21] Drivers: hv: util: move kvp/vss function declarations to hyperv_vmbus.h

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov These declarations are internal to hv_util module and hv_fcopy_* declarations already reside there. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c |1 + drivers/hv/hv_snapshot.c |2 ++ drivers/h

[PATCH 03/21] Drivers: hv: kvp: move poll_channel() to hyperv_vmbus.h

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Move poll_channel() to hyperv_vmbus.h and make it inline and rename it to hv_poll_channel() so it can be reused in other hv_util modules. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c | 17 +++---

[PATCH 18/21] Tools: hv: vss: use misc char device to communicate with kernel

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Use /dev/vmbus/hv_vss instead of netlink. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_vss_daemon.c | 139 - 1 files changed, 25 insertions(+), 114 deletions(-) diff --g

[PATCH 09/21] Drivers: hv: kvp: switch to using the hvutil_device_state state machine

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Switch to using the hvutil_device_state state machine from using 2 different state variables: kvp_transaction.active and in_hand_shake. State transitions are: -> HVUTIL_DEVICE_INIT when driver loads or on device release -> HVUTIL_READY if the handshake was successful -> H

[PATCH 07/21] Drivers: hv: fcopy: rename fcopy_work -> fcopy_timeout_work

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 'fcopy_work' (and fcopy_work_func) is a misnomer as it sounds like we expect this useful work to happen and in reality it is just an emergency escape when timeout happens. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv

[PATCH 12/21] Drivers: hv: fcopy: set .owner reference for file operations

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Get an additional reference otherwise a crash is observed when hv_utils module is being unloaded while fcopy daemon is still running. .owner gives us an additional reference when someone holds a descriptor for the device. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex N

[PATCH 13/21] Drivers: hv: util: introduce hv_utils_transport abstraction

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov The intention is to make KVP/VSS drivers work through misc char devices. Introduce an abstraction for kernel/userspace communication to make the migration smoother. Transport operational mode (netlink or char device) is determined by the first received message. To support d

[PATCH 14/21] Drivers: hv: vss: convert to hv_utils_transport

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Convert to hv_utils_transport to support both netlink and /dev/vmbus/hv_vss communication methods. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c | 52 +++-- 1 f

[PATCH 11/21] Drivers: hv: fcopy: switch to using the hvutil_device_state state machine

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Switch to using the hvutil_device_state state machine from using 3 different state variables: fcopy_transaction.active, opened, and in_hand_shake. State transitions are: -> HVUTIL_DEVICE_INIT when driver loads or on device release -> HVUTIL_READY if the handshake was succ

[PATCH 17/21] Tools: hv: kvp: use misc char device to communicate with kernel

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Use /dev/vmbus/hv_kvp instead of netlink. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- tools/hv/hv_kvp_daemon.c | 166 +- 1 files changed, 31 insertions(+), 135 deletions(-) diff --

[PATCH 16/21] Drivers: hv: kvp: convert to hv_utils_transport

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Convert to hv_utils_transport to support both netlink and /dev/vmbus/hv_kvp communication methods. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_kvp.c | 91 +++--- 1 f

[PATCH 05/21] Drivers: hv: vss: process deferred messages when we complete the transaction

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov In theory, the host is not supposed to issue any requests before be reply to the previous one. In KVP we, however, support the following scenarios: 1) A message was received before userspace daemon registered; 2) A message was received while the previous one is still being

[PATCH 06/21] Drivers: hv: kvp: rename kvp_work -> kvp_timeout_work

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov 'kvp_work' (and kvp_work_func) is a misnomer as it sounds like we expect this useful work to happen and in reality it is just an emergency escape when timeout happens. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_

[PATCH 19/21] Drivers: hv: vss: full handshake support

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Introduce VSS_OP_REGISTER1 to support kernel replying to the negotiation message with its own version. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_snapshot.c| 49 --

[PATCH 08/21] Drivers: hv: util: introduce state machine for util drivers

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov KVP/VSS/FCOPY drivers work in fully serialized mode: we wait till userspace daemon registers, wait for a message from the host, send this message to the daemon, get the reply, send it back to host, wait for another message. Introduce enum hvutil_device_state to represend th

[PATCH 15/21] Drivers: hv: fcopy: convert to hv_utils_transport

2015-04-11 Thread K. Y. Srinivasan
From: Vitaly Kuznetsov Unify the code with the recently introduced hv_utils_transport. Netlink communication is disabled for fcopy. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_fcopy.c | 194