From: Vitaly Kuznetsov <vkuznets@redhat.com> To: "K. Y. Srinivasan" <kys@microsoft.com>, devel@linuxdriverproject.org Cc: Haiyang Zhang <haiyangz@microsoft.com>, linux-kernel@vger.kernel.org, Dexuan Cui <decui@microsoft.com>, Radim Krcmar <rkrcmar@redhat.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, linux-api@vger.kernel.org Subject: [PATCH v3 06/21] Drivers: hv: kvp: rename kvp_work -> kvp_timeout_work Date: Thu, 9 Apr 2015 10:38:35 +0200 [thread overview] Message-ID: <1428568730-6030-7-git-send-email-vkuznets@redhat.com> (raw) In-Reply-To: <1428568730-6030-1-git-send-email-vkuznets@redhat.com> '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 <vkuznets@redhat.com> --- drivers/hv/hv_kvp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 939c3e7..14c62e2 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -79,10 +79,10 @@ static void kvp_send_key(struct work_struct *dummy); static void kvp_respond_to_host(struct hv_kvp_msg *msg, int error); -static void kvp_work_func(struct work_struct *dummy); +static void kvp_timeout_func(struct work_struct *dummy); static void kvp_register(int); -static DECLARE_DELAYED_WORK(kvp_work, kvp_work_func); +static DECLARE_DELAYED_WORK(kvp_timeout_work, kvp_timeout_func); static DECLARE_WORK(kvp_sendkey_work, kvp_send_key); static struct cb_id kvp_id = { CN_KVP_IDX, CN_KVP_VAL }; @@ -118,8 +118,8 @@ kvp_register(int reg_value) kfree(msg); } } -static void -kvp_work_func(struct work_struct *dummy) + +static void kvp_timeout_func(struct work_struct *dummy) { /* * If the timer fires, the user-mode component has not responded; @@ -215,7 +215,7 @@ kvp_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) * Complete the transaction by forwarding the key value * to the host. But first, cancel the timeout. */ - if (cancel_delayed_work_sync(&kvp_work)) + if (cancel_delayed_work_sync(&kvp_timeout_work)) kvp_respond_to_host(message, error); } @@ -440,7 +440,7 @@ kvp_send_key(struct work_struct *dummy) rc = cn_netlink_send(msg, 0, 0, GFP_ATOMIC); if (rc) { pr_debug("KVP: failed to communicate to the daemon: %d\n", rc); - if (cancel_delayed_work_sync(&kvp_work)) + if (cancel_delayed_work_sync(&kvp_timeout_work)) kvp_respond_to_host(message, HV_E_FAIL); } @@ -668,7 +668,7 @@ void hv_kvp_onchannelcallback(void *context) * user-mode not responding. */ schedule_work(&kvp_sendkey_work); - schedule_delayed_work(&kvp_work, 5*HZ); + schedule_delayed_work(&kvp_timeout_work, 5*HZ); return; @@ -708,6 +708,6 @@ hv_kvp_init(struct hv_util_service *srv) void hv_kvp_deinit(void) { cn_del_callback(&kvp_id); - cancel_delayed_work_sync(&kvp_work); + cancel_delayed_work_sync(&kvp_timeout_work); cancel_work_sync(&kvp_sendkey_work); } -- 1.9.3
WARNING: multiple messages have this Message-ID (diff)
From: Vitaly Kuznetsov <vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> To: "K. Y. Srinivasan" <kys-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>, devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X@public.gmane.org Cc: Haiyang Zhang <haiyangz-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Dexuan Cui <decui-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>, Radim Krcmar <rkrcmar-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>, Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: [PATCH v3 06/21] Drivers: hv: kvp: rename kvp_work -> kvp_timeout_work Date: Thu, 9 Apr 2015 10:38:35 +0200 [thread overview] Message-ID: <1428568730-6030-7-git-send-email-vkuznets@redhat.com> (raw) In-Reply-To: <1428568730-6030-1-git-send-email-vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> '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 <vkuznets-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> --- drivers/hv/hv_kvp.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index 939c3e7..14c62e2 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -79,10 +79,10 @@ static void kvp_send_key(struct work_struct *dummy); static void kvp_respond_to_host(struct hv_kvp_msg *msg, int error); -static void kvp_work_func(struct work_struct *dummy); +static void kvp_timeout_func(struct work_struct *dummy); static void kvp_register(int); -static DECLARE_DELAYED_WORK(kvp_work, kvp_work_func); +static DECLARE_DELAYED_WORK(kvp_timeout_work, kvp_timeout_func); static DECLARE_WORK(kvp_sendkey_work, kvp_send_key); static struct cb_id kvp_id = { CN_KVP_IDX, CN_KVP_VAL }; @@ -118,8 +118,8 @@ kvp_register(int reg_value) kfree(msg); } } -static void -kvp_work_func(struct work_struct *dummy) + +static void kvp_timeout_func(struct work_struct *dummy) { /* * If the timer fires, the user-mode component has not responded; @@ -215,7 +215,7 @@ kvp_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) * Complete the transaction by forwarding the key value * to the host. But first, cancel the timeout. */ - if (cancel_delayed_work_sync(&kvp_work)) + if (cancel_delayed_work_sync(&kvp_timeout_work)) kvp_respond_to_host(message, error); } @@ -440,7 +440,7 @@ kvp_send_key(struct work_struct *dummy) rc = cn_netlink_send(msg, 0, 0, GFP_ATOMIC); if (rc) { pr_debug("KVP: failed to communicate to the daemon: %d\n", rc); - if (cancel_delayed_work_sync(&kvp_work)) + if (cancel_delayed_work_sync(&kvp_timeout_work)) kvp_respond_to_host(message, HV_E_FAIL); } @@ -668,7 +668,7 @@ void hv_kvp_onchannelcallback(void *context) * user-mode not responding. */ schedule_work(&kvp_sendkey_work); - schedule_delayed_work(&kvp_work, 5*HZ); + schedule_delayed_work(&kvp_timeout_work, 5*HZ); return; @@ -708,6 +708,6 @@ hv_kvp_init(struct hv_util_service *srv) void hv_kvp_deinit(void) { cn_del_callback(&kvp_id); - cancel_delayed_work_sync(&kvp_work); + cancel_delayed_work_sync(&kvp_timeout_work); cancel_work_sync(&kvp_sendkey_work); } -- 1.9.3
next prev parent reply other threads:[~2015-04-09 8:39 UTC|newest] Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-04-09 8:38 [PATCH v3 00/21] Drivers: hv: utils: re-implement the kernel/userspace communication layer Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 01/21] Drivers: hv: util: move kvp/vss function declarations to hyperv_vmbus.h Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 02/21] Drivers: hv: kvp: reset kvp_context Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 03/21] Drivers: hv: kvp: move poll_channel() to hyperv_vmbus.h Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-10 18:27 ` Dan Carpenter 2015-04-10 18:27 ` Dan Carpenter 2015-04-13 8:36 ` Vitaly Kuznetsov 2015-04-13 8:36 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 04/21] Drivers: hv: fcopy: process deferred messages when we complete the transaction Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 05/21] Drivers: hv: vss: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov [this message] 2015-04-09 8:38 ` [PATCH v3 06/21] Drivers: hv: kvp: rename kvp_work -> kvp_timeout_work Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 07/21] Drivers: hv: fcopy: rename fcopy_work -> fcopy_timeout_work Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 08/21] Drivers: hv: util: introduce state machine for util drivers Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 09/21] Drivers: hv: kvp: switch to using the hvutil_device_state state machine Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 10/21] Drivers: hv: vss: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 11/21] Drivers: hv: fcopy: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 12/21] Drivers: hv: fcopy: set .owner reference for file operations Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 13/21] Drivers: hv: util: introduce hv_utils_transport abstraction Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 14/21] Drivers: hv: vss: convert to hv_utils_transport Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 15/21] Drivers: hv: fcopy: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 16/21] Drivers: hv: kvp: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 17/21] Tools: hv: kvp: use misc char device to communicate with kernel Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 18/21] Tools: hv: vss: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 19/21] Drivers: hv: vss: full handshake support Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 20/21] Drivers: hv: fcopy: " Vitaly Kuznetsov 2015-04-09 8:38 ` Vitaly Kuznetsov 2015-04-09 8:38 ` [PATCH v3 21/21] Drivers: hv: utils: unify driver registration reporting Vitaly Kuznetsov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1428568730-6030-7-git-send-email-vkuznets@redhat.com \ --to=vkuznets@redhat.com \ --cc=decui@microsoft.com \ --cc=devel@linuxdriverproject.org \ --cc=gregkh@linuxfoundation.org \ --cc=haiyangz@microsoft.com \ --cc=kys@microsoft.com \ --cc=linux-api@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=rkrcmar@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.