Spencer E. Olson [Wed, 27 Jan 2016 21:28:28 +0000 (14:28 -0700)]
staging: comedi: ni_mio_common: adds finite regeneration to AO output
This patch implements for analog output the reinterpretation of stop_arg
when stop_src == TRIG_NONE to allow the user to specify the length of the
buffer that should be repeated. The intent is to allow a user to have a
specific buffer repeated as-is indefinitely. The contents of the DMA
buffer can be left static or changed by the user via mmap access to the DMA
buffer. If the contents are changed by the user, additional munging is not
performed by the driver and only a single call to
comedi_mark_buffer_written should be done.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch implements ni_ao_cmd much more closely organized like NI MHDDK
examples and DAQ-STC pseudo-code. Adds comments with some more specific
references to the DAQ-STC.
For stop_src==TRIG_NONE (continuous output mode of entire buffer), the
count for the UC counter was corrected to represent the maximum count
possible (0xffffff). Prior behavior for stop_src=TRIG_NONE did not
actually follow the DAQ-STC. Furthermore, stop_src==TRIG_NONE now
correctly uses code specialized for either m-series or e-series devices.
It should be noted that stop_src==TRIG_NONE does _not_ with this patch
(or with prior behavior in ni_mio_common) actually implement true
continuous output. Rather, the output is simply configured to operate as a
single buffer output, but where the buffer is as large as is possible with
NI-STC hardware.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Spencer E. Olson [Wed, 27 Jan 2016 21:28:26 +0000 (14:28 -0700)]
staging: comedi: ni_mio_common: make more bits in ao_cmd1 reg be stateful
Bits NISTC_AO_CMD1_DAC0_UPDATE_MODE and NISTC_AO_CMD1_DAC1_UPDATE_MODE are
now saved in the local copy of the AO_CMD1 register. This is more
appropriate than prior methods of setting these bits specifically _both_
in the ni_ao_cmd configuration function _and_ the ni_ao_inttrig trigger
function. With this patch, the bits are only specifically called out now
in the ni_ao_cmd configuration function. In the ni_ao_inttrig trigger
function, only the UI_ARM, UC_ARM, BC_ARM bits of the ao_cmd1 register are
specifically called out. Each of these bits is a strobe bit, while the
DAC[0-1]_UPDATE_MODE bits are simple write bits.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch implements ni_ao_reset much more closely organized like NI MHDDK
examples and DAQ-STC pseudo-code. Adds comments with some more specific
references to the DAQ-STC.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Spencer E. Olson [Wed, 27 Jan 2016 21:28:24 +0000 (14:28 -0700)]
staging: comedi: mite: enable continuous regeneration of finite samples
This change enables the mite DMA controller to only transfer the amount of
data needed by a command. By default, the old behavior of transferring the
entire comedi DMA data buffer is still in effect. These changes allow a
command to only transmit a limited portion of that data buffer as needed.
This patch begins to reinterprets stop_arg when stop_src == TRIG_NONE to
allow the user to specify the length of the buffer that should be repeated.
The intent is to allow a user to have a specific buffer repeated as-is
indefinitely. The contents of the DMA buffer can be left static or changed
by the user via mmap access to the DMA buffer. If the contents are changed
by the user, additional munging is not performed by the driver and only a
single call to comedi_mark_buffer_written should be done.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Spencer E. Olson [Tue, 12 Jan 2016 18:05:10 +0000 (11:05 -0700)]
staging: comedi: ni_mio_common: use CR_CHAN more consistently
Generally, the CR_CHAN macro is/should be used to access the relevant bits
for channel identification in cmd->*_arg when the corresponding
cmd->*_src==TRIG_EXT, including cmd->convert_arg in this case.
This patch does not fix a bug per se, as NISTC_AI_MODE1_CONVERT_SRC() already
masks the value sufficiently, but using CR_CHAN() here makes the code clearer as
it avoids passing some irrelevant bits to NISTC_AI_MODE1_CONVERT_SRC() in the
first place.
Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rohit kumar [Tue, 12 Jan 2016 04:01:46 +0000 (09:31 +0530)]
staging/ion: Add support to get ion handle from dma buf
Currently we can only import dma buf fd's to get ion_handle.
Adding support to import dma buf handles to support kernel
specific use cases.
An example use case is in linux platforms such as Tizen, in which
DRM-GEM is used for buffer management for graphics. It has gem_handle
corresponding to a buffer and uses gem_name for sharing the buffer
with other processes. However,it also uses dma_buf fd for 3d operations.
For wayland, there are multiple calls for gem_handle to dma_buf fd
conversion. So, we store dma_buf associated with buffer. But, there is
no api for getting ion_handle from dma_buf. This patch exposes api to
retrieve the ion handle from dma_buf for similar use cases. With this
patch, we can integrate ION within DRM-GEM for buffer management and
dma_buf sharing.
Gustavo Padovan [Wed, 3 Feb 2016 13:25:33 +0000 (11:25 -0200)]
staging/android: remove driver_data from struct sync_fence_info
It is unclear in what situations driver_data should be used thus better do
not upstream it for now. If a need arises in the future a discussion can
be started to re-add it.
Gustavo Padovan [Wed, 3 Feb 2016 13:25:31 +0000 (11:25 -0200)]
staging/android: rename sync_pt_info to sync_fence_info
As struct sync_pt doesn't exist anymore it is a good idea remove any
reference to it in the sync_framework. sync_pts were replaced directly by
fences and here we rename it to sync_fence_info to let the fence namespace
clean.
v2: rename fence_info to sync_fence_info (Maarten)
Gustavo Padovan [Wed, 3 Feb 2016 13:25:30 +0000 (11:25 -0200)]
staging/android: remove SYNC_WAIT ioctl
This ioctl is replicating the work of poll() syscall so let's take the
opportunity that this is still on staging tree and remove the duplication
and force new users to use the poll() standard interface.
Gustavo Padovan [Thu, 21 Jan 2016 12:49:23 +0000 (10:49 -0200)]
staging/android: remove pointless sync_timeline_signal at destroy phase
All changes to timeline value come through the user via
sync_timeline_signal() calls. When sync_timeline_destroy() is called no
changes on timeline->value happens hence call sync_timeline_signal() with
no increment is pointless.
Gustavo Padovan [Thu, 21 Jan 2016 12:49:21 +0000 (10:49 -0200)]
staging/android: remove struct sync_pt
struct sync_pt was just wrapping around struct fence and creating an
extra abstraction layer. The only two members of struct sync_pt, child_list
and active_list, were moved to struct fence in an earlier commit. After
removing those two members struct sync_pt is nothing more than struct
fence, so remove it all and use struct fence directly.
Gustavo Padovan [Thu, 21 Jan 2016 12:49:19 +0000 (10:49 -0200)]
staging/android: rename sync_fence to sync_file
sync_file has a more close meaning to what a sync_fence really, a struct
that represent a file that can be used by userspace to get information on
a fence, or wait for it to be signaled.
Chen Feng [Fri, 15 Jan 2016 02:38:19 +0000 (10:38 +0800)]
staging: ion : Donnot wakeup kswapd in ion system alloc
Since ion alloc can be called by userspace,eg gralloc.
When it is called frequently, the efficiency of kswapd is
to low. And the reclaimed memory is too lower. In this way,
the kswapd can use to much cpu resources.
Rajmal Menariya [Sat, 30 Jan 2016 06:07:35 +0000 (22:07 -0800)]
staging: ion: Set minimum carveout heap allocation order to PAGE_SHIFT
In carveout heap, change minimum allocation order from 12 to
PAGE_SHIFT. After this change each bit in bitmap (genalloc -
General purpose special memory pool) represents one page size
memory.
Colin Cross [Sat, 30 Jan 2016 06:07:33 +0000 (22:07 -0800)]
staging: lowmemorykiller: Make default lowmemorykiller debug message useful
lowmemorykiller debug messages are inscrutable and mostly useful
for debugging the lowmemorykiller, not explaining why a process
was killed. Make the messages more useful by prefixing them
with "lowmemorykiller: " and explaining in more readable terms
what was killed, who it was killed for, and why it was killed.
The messages now look like:
[ 76.997631] lowmemorykiller: Killing 'droid.gallery3d' (2172), adj 1000,
[ 76.997635] to free 27436kB on behalf of 'kswapd0' (29) because
[ 76.997638] cache 122624kB is below limit 122880kB for oom_score_adj 1000
[ 76.997641] Free memory is -53356kB above reserved
A negative number for free memory above reserved means some of the
reserved memory has been used and is being regenerated by kswapd,
which is likely what called the shrinkers.
Cc: Android Kernel Team <kernel-team@android.com> Cc: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Colin Cross <ccross@android.com>
[jstultz: Minor checkpatch tweaks] Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Tue, 22 Dec 2015 09:53:05 +0000 (10:53 +0100)]
staging: most: change type of access_ref
This patch changes the type of the access reference from atomit_t to int.
It is needed, because the reference variable is secured by synchronization
locks and does not need to be atomic anymore.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Tue, 22 Dec 2015 09:53:04 +0000 (10:53 +0100)]
staging: most: fix race conditions
This patch fixes race conditions that might emerge from functions
aim_open, aim_close, aim_read, aim_write and aim_disconnect_channel
within module cdev.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Tue, 22 Dec 2015 09:53:00 +0000 (10:53 +0100)]
staging: most: remove redundant call to wake_up_interruptible
This patch prevents the cdev module from rousing the channel wait queue in
case the channel is about to be closed. It is safe to do so, because the
application can not be waiting within read or write and at the same time
be calling close.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Tue, 22 Dec 2015 09:52:58 +0000 (10:52 +0100)]
staging: most: remove code to destroy channel
This patch removes unnecessary code to destroy channel objects. It is
needed, because function most_stop_channel, which is indirectly
triggered by function most_deregister_interface, already destroys the
channels.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Tue, 22 Dec 2015 09:52:53 +0000 (10:52 +0100)]
staging: most: move initialization of pointer
This patch makes function store_add_link initialize the pointer to an AIM
right before the channel is probed. It is needed, the AIM may already call
most_start_channel while probe_channel is still running. At this point the
pointer to the AIM must not be NULL.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Gromm [Tue, 22 Dec 2015 09:52:47 +0000 (10:52 +0100)]
staging: most: fix mbo leak
This patch fixes a potential MBO leak in case function aim_read()
exits right after the MBO has been fetched from kfifo and before
it has been saved to the variable stacked_mbo.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The MBO pointer stacked_mbo and the boolean variable keep_mbo are
always changed together and therefore provide the same information.
This patch removes keep_mbo and uses stacked_mbo instead.
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Thu, 7 Jan 2016 09:34:13 +0000 (12:34 +0300)]
staging: unisys: remove some dead code
queue_delayed_work() returns bool, not negative error codes. It returns
false if the work has already been queued or true otherwise. Since
we don't care about that, we can just remove the test.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Acked-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chaehyun Lim [Fri, 5 Feb 2016 01:35:13 +0000 (10:35 +0900)]
staging: wilc1000: fix return type of wilc_deinit
This patch changes return type of wilc_deinit from s32 to int.
The result variable gets return value from wilc_mq_send that has return
type of int. It should be changed return type of this function as well
as data type of result variable.
Chaehyun Lim [Fri, 5 Feb 2016 01:35:11 +0000 (10:35 +0900)]
staging: wilc1000: fix return type of wilc_hif_set_cfg
This patch changes return type of wilc_hif_set_cfg from s32 to int.
The result variable gets return value from wilc_mq_send that has data
type of int. It should be changed return type of this function as well
as data type of result variable.
Chris Park [Thu, 4 Feb 2016 09:24:30 +0000 (18:24 +0900)]
staging: wilc1000: remove unnecessary log message using GENERIC_DBG tag
This patch remove unnecessary log message using GENERIC_DBG tag.
Needed log messages has changed netdev_dbg from PRINT_D.
And removes variables that were used to log message.
Signed-off-by: Chris Park <chris.park@atmel.com> Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chris Park [Thu, 4 Feb 2016 09:24:29 +0000 (18:24 +0900)]
staging: wilc1000: remove unused debug tag
This patch remove unused debug tag INT_DBG, LOCK_DBG, BUS_DBG,
MEM_DBG and FIRM_DBG
Signed-off-by: Chris Park <chris.park@atmel.com> Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chris Park [Thu, 4 Feb 2016 09:24:28 +0000 (18:24 +0900)]
staging: wilc1000: remove unused log message using the RX_DBG tag
This patch remove unused log message using the RX_DBG tag
Signed-off-by: Chris Park <chris.park@atmel.com> Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chris Park [Thu, 4 Feb 2016 09:24:27 +0000 (18:24 +0900)]
staging: wilc1000: remove unnecessary wilc_rx_complete function
This patch remove unnecessary wilc_rx_complete function
because this function only print unused log message.
remove unused has_packet variable nomore.
Signed-off-by: Chris Park <chris.park@atmel.com> Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch renames to avoid camelcase and remove prefix names,
changes follow are:
- u16capability to capability
- u16ConnectStatus to status
- u16AssocID to assoc_id
- pu8RespIEs to ies
- u16RespIEsLen to ies_len
Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>