Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428636

[PATCH v3 0/3] *** staging: wilc1000: Replace semaphores ***

From Binoy Jayan <binoy.jayan@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v3 0/3] *** staging: wilc1000: Replace semaphores ***
Date 2016-06-22 12:10 +0200
Message-ID <rMNgB-221-7@gated-at.bofh.it> (permalink)
References <rM4tc-6Xg-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patchset [v3] is part of the second patch series for 'wilc1000'.
The original patch series consisted 7 patches of which only the first 5
are good. The patch 6 and 7 are being worked on in this series
in a different way.

This patch series removes the semaphore 'sem' in 'wilc1000' and also
restructures the implementation of kthread / message_queue logic with
a create_singlethread_workqueue() / queue_work() setup.

These are part of a bigger effort to eliminate all semaphores
from the linux kernel.

They build correctly (individually and as a whole).

NB: The changes are untested

Discussion carried forward from previous patchset [v2]

Rework on the review comments by Arnd w.r.t. v1

struct message_queue can be removed since
 - after the workqueue conversion, mq->sem is no longer needed
 - recv_count is not needed, it just counts the number of entries in the list
 - struct wilc' pointer can be retrieved from the host_if_msg, (vif->wilc)
 - the message list is not needed because we always look only at the
   first entry, except in wilc_mq_destroy(), but it would be better
   to just call destroy_workqueue(), which also drains the remaining work.
 - the exiting flag is also handled by destroy_workqueue()   
 - with everything else gone, the spinlock is also not needed any more.

Do 'kfree' only at the end of 'host_if_work' 

wilc_initialized is always '1' so the conditional 'wilc_mq_send'
in 'hostIFthread' can be removed.

A connect command (HOST_IF_MSG_CONNECT) does not complete while scan is ongoing. 
So, the special handling of this command needs to be preserved.

Use create_singlethread_workqueue() instead of alloc_workqueue(), so that
we stay closer to the current behavior by having the thread run only
on one CPU at a time and not having a 'dedicated' thread for each.

Split the patch to seperate interface changes to 'wilc_mq_send'
    No easy way found to split the patch to change the interface
    'wilc_mq_send' and to 'wilc_enqueue_cmd' as the parameters 
    'mq' 'send_buf' and 'send_buf_size' itself are part of the message
    queue implementation.

New changes in v3

Rework on the review comments by Arnd w.r.t. v2
 - Removed forward declaration for wilc_enqueue_cmd
 - Change the interface 'wilc_mq_send' in a different patch
 - Avoid change in indentation in host_if_work and move it to
   a different patch

Cannot remove forward declaraition for 'host_if_work'
   since there is a mutual dependency.

	Binoy

Binoy Jayan (3):
  staging: wilc1000: message_queue: Move code to host interface
  staging: wilc1000: Replace kthread with workqueue for host interface
  staging: wilc1000: Change interface wilc_mq_send to wilc_enqueue_cmd

 drivers/staging/wilc1000/Makefile         |   1 -
 drivers/staging/wilc1000/TODO             |   5 +
 drivers/staging/wilc1000/host_interface.c | 395 +++++++++++++++---------------
 drivers/staging/wilc1000/wilc_msgqueue.c  | 144 -----------
 drivers/staging/wilc1000/wilc_msgqueue.h  |  28 ---
 5 files changed, 204 insertions(+), 369 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_msgqueue.c
 delete mode 100644 drivers/staging/wilc1000/wilc_msgqueue.h

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/7] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
  [PATCH 1/7] staging: wilc1000: Replace semaphore txq_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
  [PATCH 2/7] staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
    Re: [PATCH 2/7] staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex Arnd Bergmann <arnd@arndb.de> - 2016-06-13 15:20 +0200
  [PATCH 3/7] staging: wilc1000: Replace semaphore cfg_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 12:40 +0200
    Re: [PATCH 3/7] staging: wilc1000: Replace semaphore cfg_event with completion Arnd Bergmann <arnd@arndb.de> - 2016-06-13 16:30 +0200
  Re: [PATCH 0/7] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Arnd Bergmann <arnd@arndb.de> - 2016-06-13 16:30 +0200
    Re: [PATCH 0/7] *** staging: wilc1000: Replace semaphores with  mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-13 16:50 +0200
  [PATCH v2 0/5] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:30 +0200
    [PATCH v2 1/5] staging: wilc1000: Replace semaphore txq_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:30 +0200
  [PATCH v3 4/5] staging: wilc1000: Replace semaphore sync_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
  [PATCH v3 0/5] *** staging: wilc1000: Replace semaphores with mutexes or completions *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 5/5] staging: wilc1000: Remove semaphore close_exit_sync Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 3/5] staging: wilc1000: Replace semaphore cfg_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 1/5] staging: wilc1000: Replace semaphore txq_event with completion Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
    [PATCH v3 2/5] staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-15 07:40 +0200
  [PATCH v2 1/2] staging: wilc1000: message_queue: Move code to host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-20 12:20 +0200
  [PATCH v2 0/2] *** staging: wilc1000: Replace semaphores *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-20 12:20 +0200
    [PATCH v2 2/2] staging: wilc1000: Replace kthread with workqueue for host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-20 12:20 +0200
      Re: [PATCH v2 2/2] staging: wilc1000: Replace kthread with workqueue for host interface Arnd Bergmann <arnd@arndb.de> - 2016-06-21 18:10 +0200
    [PATCH v3 2/3] staging: wilc1000: Replace kthread with workqueue for host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
    [PATCH v3 0/3] *** staging: wilc1000: Replace semaphores *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
      [PATCH v3 1/3] staging: wilc1000: message_queue: Move code to host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
      [PATCH v3 3/3] staging: wilc1000: Change interface wilc_mq_send to wilc_enqueue_cmd Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-22 12:10 +0200
    [PATCH v4 2/3] staging: wilc1000: Replace kthread with workqueue for host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
    [PATCH v4 0/3] *** staging: wilc1000: Replace semaphores *** Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
      [PATCH v4 3/3] staging: wilc1000: Change interface wilc_mq_send to wilc_enqueue_cmd Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
      [PATCH v4 1/3] staging: wilc1000: message_queue: Move code to host interface Binoy Jayan <binoy.jayan@linaro.org> - 2016-06-23 07:50 +0200
      Re: [PATCH v4 0/3] *** staging: wilc1000: Replace semaphores *** Arnd Bergmann <arnd@arndb.de> - 2016-06-23 11:40 +0200

csiph-web