Re: [PATCH] Staging: comedi: add timeouts to while loops in s626.c

2014-02-28 Thread Chase Southwood
>On Friday, February 28, 2014 11:26 AM, Ian Abbott wrote: >>On 2014-02-28 07:35, Chase Southwood wrote: >> Smatch located a handful of while loops testing readl calls in s626.c. >> Since these while loops depend on readl succeeding, it's safer to make >> sure they time out eventually. >> >> Signe

Re: [PATCH 1/2 v2] Staging: comedi: fix lines that are over 80 characters

2014-02-28 Thread Chase Southwood
>On Friday, February 28, 2014 4:31 PM, Greg KH >wrote: >>On Fri, Feb 28, 2014 at 03:15:45AM -0600, Chase Southwood wrote: >> >> This patch introduces a simple helper function, outl_1564_timer(), to >> allow several lines which violate the character limit to be shortened. >> A handful of other

Re: [PATCH] Staging:tidspbridge: Fixing coding style

2014-02-28 Thread Greg Kroah-Hartman
On Fri, Feb 28, 2014 at 12:30:04AM -0800, Masood Mehmood wrote: > > On Fri, Feb 28, 2014 at 07:01:56PM -0800, Greg Kroah-Hartman wrote: > > On Fri, Feb 28, 2014 at 06:15:52PM -0800, Masood Mehmood wrote: > > > > > > > > > > > Fixing some basic coding style issues. > > > > Which issues did you

Re: [PATCH] Staging:tidspbridge: Fixing coding style

2014-02-28 Thread Masood Mehmood
On Fri, Feb 28, 2014 at 07:01:56PM -0800, Greg Kroah-Hartman wrote: > On Fri, Feb 28, 2014 at 06:15:52PM -0800, Masood Mehmood wrote: > > > > > > > Fixing some basic coding style issues. > > Which issues did you fix? Please be more specific. Did you fix them > for the whole driver, or just a

Re: [PATCH] Staging:tidspbridge: Fixing coding style

2014-02-28 Thread Greg Kroah-Hartman
On Fri, Feb 28, 2014 at 06:15:52PM -0800, Masood Mehmood wrote: > > > Fixing some basic coding style issues. Which issues did you fix? Please be more specific. Did you fix them for the whole driver, or just a specific file? And what's with the odd multiple attachments? thanks, greg k-h ___

[PATCH 13/17] lustre/ptlrpc: fix 'data race condition' issues

2014-02-28 Thread Oleg Drokin
From: Sebastien Buisson Fix 'data race condition' defects found by Coverity version 6.5.0: Data race condition (MISSING_LOCK) Accessing variable without holding lock. Elsewhere, this variable is accessed with lock held. Signed-off-by: Sebastien Buisson Reviewed-on: http://review.whamcloud.com/6

[PATCH 09/17] lustre/llite: simplify dentry revalidate

2014-02-28 Thread Oleg Drokin
From: Lai Siyao Lustre client dentry validation is protected by LDLM lock, so any time a dentry is found, it's valid and no need to revalidate from MDS, and even it does, there is race that it may be invalidated after revalidation is finished. Signed-off-by: Lai Siyao Reviewed-on: http://review

[PATCH 16/17] lustre/quota: improper assert in osc_quota_chkdq()

2014-02-28 Thread Oleg Drokin
From: Niu Yawei In osc_quota_chkdq(), we should never try to access oqi found from hash, since it could have been freed by osc_quota_setdq(). Signed-off-by: Niu Yawei Reviewed-on: http://review.whamcloud.com/8460 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4336 Reviewed-by: Johann Lomba

[PATCH 15/17] lustre/osc: Don't flush active extents.

2014-02-28 Thread Oleg Drokin
From: Ann Koehler The extent is active so we need to abort and let the caller re-dirty the page. If we continued on here, and we were the one making the extent active, we could deadlock waiting for the page writeback to clear but it won't because the extent is active and won't be written out. Si

[PATCH 17/17] lustre/libcfs: warn if all HTs in a core are gone

2014-02-28 Thread Oleg Drokin
libcfs cpu partition can't support CPU hotplug, but it is safe when plug-in new CPU or enabling/disabling hyper-threading. It has potential risk only if plug-out CPU because it may break CPU affinity of Lustre threads. Current libcfs will print warning for all CPU notification, this patch changed

[PATCH 12/17] lustre/ptlrpc: skip rpcs that fail ptl_send_rpc

2014-02-28 Thread Oleg Drokin
From: Peng Tao ptl_send_rpc is not dealing with -ENOMEM in some situations. When the ptl_send_rpc fails we need set error and skip further processing or trigger and LBUG Signed-off-by: Keith Mannthey Signed-off-by: Peng Tao Reviewed-on: http://review.whamcloud.com/7411 Intel-bug-id: https://j

[PATCH 11/17] lustre/ptlrpc: rq_commit_cb is called for twice

2014-02-28 Thread Oleg Drokin
From: Liang Zhen If a ptlrpc_request is already on imp::imp_replay_list, when it's replayed and replied, after_reply() will call req::rq_commit_cb for the request, then call it again in ptlrpc_free_committed. Signed-off-by: Liang Zhen Reviewed-on: http://review.whamcloud.com/8815 Intel-bug-id:

[PATCH 14/17] lustre/ptlrpc: re-enqueue ptlrpcd worker

2014-02-28 Thread Oleg Drokin
From: Liang Zhen osc_extent_wait can be stuck in scenario like this: 1) thread-1 held an active extent 2) thread-2 called flush cache, and marked this extent as "urgent" and "sync_wait" 3) thread-3 wants to write to the same extent, osc_extent_find will get "conflict" because this extent i

[PATCH 08/17] lustre/recovery: free open/close request promptly

2014-02-28 Thread Oleg Drokin
From: Hongchao Zhang - For the non-create open or committed open, the open request should be freed along with the close request as soon as the close done, despite that the transno of open/close is greater than the last committed transno known by client or not. - Move the committed open req

[PATCH 02/17] lustre/mdc: Check for all attributes validity in revalidate

2014-02-28 Thread Oleg Drokin
GETATTR needs to return attributes protected by different bits, so we need to ensure all we have locks with all of those bits, not just UPDATE bit Signed-off-by: Alexey Lyashkov Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/6460 Xyratex-bug-id: MRP-1052 Intel-bug-id: https:

[PATCH 06/17] lustre/clio: honor O_NOATIME

2014-02-28 Thread Oleg Drokin
From: "John L. Hammond" Add a ci_noatime bit to struct cl_io. In ll_io_init() set this bit if O_NOATIME is set in f_flags. Ensure that this bit is propagated down to lower layers. In osc_io_read_start() don't update atime if this bit is set. Add sanity test 39n to check that passing O_NOATIME to

[PATCH 04/17] lustre/mdc: comments on LOOKUP and PERM lock

2014-02-28 Thread Oleg Drokin
From: wang di Add more comments for MDS_INODELOCK_PERM and MDS_INODELOCK_LOOKUP Signed-off-by: wang di Reviewed-on: http://review.whamcloud.com/7937 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3240 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: Oleg Drokin --- .

[PATCH 07/17] lustre/mdc: fix bad ERR_PTR usage in mdc_locks.c

2014-02-28 Thread Oleg Drokin
From: "John L. Hammond" In mdc_intent_open_pack() return an ERR_PTR() rather than NULL when ldlm_prep_enqueue_req() fails. In mdc_intent_getattr_async() check the return value of mdc_intent_getattr_pack() using IS_ERR(). Clean up the includes in mdc_locks.c. Signed-off-by: John L. Hammond Revie

[PATCH 01/17] staging/lustre/llite: fix open lock matching in ll_md_blocking_ast()

2014-02-28 Thread Oleg Drokin
From: "John L. Hammond" In ll_md_blocking_ast() match open locks before all others, ensuring that MDS_INODELOCK_OPEN is not cleared from bits by another open lock with a different mode. Change the int flags parameter of ll_md_real_close() to fmode_t fmode. Clean up verious style issues in both fu

[PATCH 00/17] Lustre stability patches

2014-02-28 Thread Oleg Drokin
This series of patches fixes most of the issues I hit during Lustre regression test suite. All observed crashes are gone too. Please consider for inclusion. Alexey Lyashkov (1): lustre/mdc: use ibits_known mask for lock match Ann Koehler (1): lustre/osc: Don't flush active extents. Bruno Fa

[PATCH 05/17] lustre/mdc: use ibits_known mask for lock match

2014-02-28 Thread Oleg Drokin
From: Alexey Lyashkov Before revalidating a lock on the client, mask the lock bits against the lock bits supported by the server (ibits_known), so newer clients will find valid locks given by older server versions. Signed-off-by: Patrick Farrell Signed-off-by: Alexey Lyashkov Reviewed-on: http

[PATCH 10/17] lustre/ldlm: set l_lvb_type coherent when layout is returned

2014-02-28 Thread Oleg Drokin
From: Bruno Faccini In case layout has been packed into server reply when not requested, lock l_lvb_type must be set accordingly. Signed-off-by: Bruno Faccini Reviewed-on: http://review.whamcloud.com/8270 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4194 Reviewed-by: Jinshan Xiong Revie

[PATCH 03/17] lustre/llite: Do not send parent dir fid in getattr by fid

2014-02-28 Thread Oleg Drokin
Sending getattr by fid in this case is pointless, as the parent might havelong changed and we have no control over it, but it's irrelevant anyway, since we already have the child fid. Signed-off-by: Oleg Drokin Reviewed-on: http://review.whamcloud.com/7910 Intel-bug-id: https://jira.hpdd.intel.co

[PATCH] Staging:tidspbridge: Fixing coding style

2014-02-28 Thread Masood Mehmood
Fixing some basic coding style issues. Signed-off-by: Masood Mehmood --- drivers/staging/tidspbridge/rmgr/node.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/staging/tidspbridge/rmgr/node.c b/drivers/staging/tidspbridge/rmgr/node.c inde

[PATCH 13/66] staging: comedi: pcl816: interrupt handlers should not busywait

2014-02-28 Thread H Hartley Sweeten
The interrupt is only generated by the hardware at the completion of an A/D conversion. Because of this the sanity check to make sure that the A/D conversion is complete and data is available is probably unnecessary but it doesn't hurt anything. The busywait loop is a different issue. Interrupt ro

[PATCH 53/66] staging: comedi: pcl812: define the status register bits

2014-02-28 Thread H Hartley Sweeten
Define the bits in the status register. Writing any value to the status register clears any pending interrupt. For aesthetics, rename the status register and remove the "clrint" register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers

[PATCH 35/66] staging: comedi: pcl818: tidy up the digital subdevices

2014-02-28 Thread H Hartley Sweeten
For aesthetics, tidy up the digtial subdevice code. Rename the register map defines for the digital input and output ports. Move the two digital subdevice (*insn_bits) functions out of the analog support functions. Tidy them up a bit during the move. Signed-off-by: H Hartley Sweeten Cc: Ian Abb

[PATCH 61/66] staging: comedi: pcl818: cleanup ai_cmd()

2014-02-28 Thread H Hartley Sweeten
Rename this function so it has namespace associated with the driver. The cmd->scan_begin_src is always TRIG_FOLLOW and the only valid cmd->convert_src is TRIG_TIMER or TRIG_EXT so pcl818_ai_cmd_mode() is always called with a 'mode' of 1 or 3. The 'mode' actually indicates the trigger source. Abso

[PATCH 55/66] staging: comedi: pcl816: cleanup setup_channel_list()

2014-02-28 Thread H Hartley Sweeten
Move this function to remove the need for the forward declaration. Rename it so it has namespace associated with the driver. Remove the unnecessary comedi_subdevice parameter from the function. The hardware has per-channel programmable gain. This function first sets the range for each channel then

[PATCH 64/66] staging: comedi: pcl818: tidy up the remaining register defines

2014-02-28 Thread H Hartley Sweeten
For aesthetics, rename the timer/counter enable request register and define its bits. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl818.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/

[PATCH 65/66] staging: comedi: pcl812: clarify pcl812_reset()

2014-02-28 Thread H Hartley Sweeten
Instead of using the 'board_type' and the switch, use the boardinfo to determine what should be reset. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 42 ++--- 1 file changed, 18 insertions(+), 24

[PATCH 15/66] staging: comedi: pcl812: factor out the common "next ai chan" code

2014-02-28 Thread H Hartley Sweeten
The DMA and EOC interrupt handlers all have common code that bumps the counters in the private data that keep track of what channel is being sampled next and when all the data has been sampled. Factor this common code into a helper function. Don't clear the events in the driver. The comedi core w

[PATCH 63/66] staging: comedi: pcl816: tidy up the remaining register defines

2014-02-28 Thread H Hartley Sweeten
For aesthetics, rename the clear INT request register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl816.c b/dr

[PATCH 02/66] staging: comedi: pcl818: remove pcl818_check()

2014-02-28 Thread H Hartley Sweeten
This function is a _very_ simplified probe that tried to verify that the driver is being attached to a PCL-818 compatible board. The function simply writes some values to specific registers then reads back the values to see if they are the same. It's possible that the user could try to attach this

[PATCH 58/66] staging: comedi: pcl816: define the mode register bits

2014-02-28 Thread H Hartley Sweeten
Define the bits in the register to remove the magic values. Fix pcl816_ai_cancel(). The 0x73 mask of the value read from the control register will not stop the A/D as indicated by the comment. This would just clear the DS1, POE, and EXT bits which would only disable the external trigger. Setting t

[PATCH 52/66] staging: comedi: pcl816: define the status register bits

2014-02-28 Thread H Hartley Sweeten
Define the bits in the status register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl816.c b/driver

[PATCH 66/66] staging: comedi: pcl818: clarify pcl818_reset()

2014-02-28 Thread H Hartley Sweeten
Like done in the pcl812 driver, use the boardinfo to determine what should be reset. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl818.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff

[PATCH 42/66] staging: comedi: pcl812: introduce pcl812_ai_clear_eoc()

2014-02-28 Thread H Hartley Sweeten
Introduce a helper function to clear the end-of-conversion flag. This flag is set when an analog input conversion is finished and the hardware generates an interrupt request. Writing any value to the register resets the flag and re-enables the interrupt. Remove a redundant call in pcl812_ai_cance

[PATCH 33/66] staging: comedi: pcl812: tidy up the digital subdevices

2014-02-28 Thread H Hartley Sweeten
For aesthetics, tidy up the digtial subdevice code. rename the register map defines for the digital input and output ports. Move the two digital subdevice (*insn_bits) functions out of the analog support functions. Tidy them up a bit during the move. Add some whitespace to the subdevice init. S

[PATCH 56/66] staging: comedi: pcl818: cleanup setup_channel_list()

2014-02-28 Thread H Hartley Sweeten
Move this function to remove the need for the forward declaration. Rename it so it has namespace associated with the driver. Remove the unnecessary comedi_subdevice parameter from the function. The hardware has per-channel programmable gain. This function first sets the range for each channel then

[PATCH 47/66] staging: comedi: pcl812: introduce pcl812_ai_soft_trig()

2014-02-28 Thread H Hartley Sweeten
Introduce a helper function to start a software triggered analog input conversion. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/com

[PATCH 23/66] staging: comedi: pcl816: clarify 'irq_was_now_closed' flag in private data

2014-02-28 Thread H Hartley Sweeten
This flag in the private data is set when an async command is canceled with the ai (*cancel) operation. Rename the flag to 'ai_cmd_canceled' to clarify its use. Move the check for the flag in the interrupt handler. If the async command was canceled there is no reason to handle the interrupt. Just

[PATCH 30/66] staging: comedi: pcl812: consolidate the common interrupt code

2014-02-28 Thread H Hartley Sweeten
The DMA and EOC interrupt handler functions, that are called by the _real_ interrupt function, always return IRQ_HANDLED. Change the return type for these functions to void and move the final return to the real interrupt function. Change the parameters to the handler functions to the comedi_device

[PATCH 50/66] staging: comedi: pcl818: tidy up analog input registers

2014-02-28 Thread H Hartley Sweeten
For aesthetics, rename the analog input register defines and convert the offsets to hex. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl818.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/

[PATCH 60/66] staging: comedi: pcl818: absorb pcl818_ai_mode13dma_int()

2014-02-28 Thread H Hartley Sweeten
Absorb this function into pcl818_ai_cmd_mode() and simplify the code. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl818.c | 53 ++--- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/drive

[PATCH 62/66] staging: comedi: pcl812: tidy up the remaining register defines

2014-02-28 Thread H Hartley Sweeten
The PCL812_CNTENABLE define is not used in this driver. Remove it. For aesthetics, rename the software trigger register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletion

[PATCH 38/66] staging: comedi: pcl818: tidy up the analog output subdevice

2014-02-28 Thread H Hartley Sweeten
For aesthetics, tidy up the analog output subdevice code. Change the regsiter map defines to simplify the code. Move the analog subdevice support functions out of the analog input support functions. Tidy them up a bit during the move. Reverse the logic of the subdevice init and add some whitespa

[PATCH 59/66] staging: comedi: pcl818: define the mode register bits

2014-02-28 Thread H Hartley Sweeten
Define the bits in the register to remove the magic values. Tidy up pcl818_ai_cancel(). The 0x73 mask of the value read from the control register will disable dma and interrupts but it does not change the trigger mode. So the software trigger following it might not work. Just disable the trigger

[PATCH 49/66] staging: comedi: pcl816: tidy up analog input registers

2014-02-28 Thread H Hartley Sweeten
For aesthetics, rename the analog input register defines and convert the offsets to hex. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/

[PATCH 20/66] staging: comedi: pcl818: factor out the common "dropout" detect code

2014-02-28 Thread H Hartley Sweeten
The DMA, FIFO, and EOC interrupt handlers all have common code that checks for channel dropout when running an async command. Factor this common code into a helper function. Only return the sample if the channel is valid. The EOC handler was previously returning the value then checking for channe

[PATCH 07/66] staging: comedi: pcl812: factor out dma setup to helper functions

2014-02-28 Thread H Hartley Sweeten
To assist in cleaning up the the rest of the driver, factor the initial dma setup and the next dma buffer setup into helper functions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 170 ++-- 1 fi

[PATCH 24/66] staging: comedi: pcl818: fix (*cancel) when cmd->stop_src == TRIG_NONE

2014-02-28 Thread H Hartley Sweeten
When using DMA, the async command (*cancel) operation is delayed until the current DMA transfer is complete. When the DMA transfer finishes the interrupt routine detects this and calls the (*cancel) again which should then cancel the async command. The current logic does not work when cmd->stop_sr

[PATCH 03/66] staging: comedi: pcl818: fix board resource region request

2014-02-28 Thread H Hartley Sweeten
Some of the PCL-818 compatible boards have a FIFO that can be used when running analog input async commands. This FIFO increased the resource range used by the driver. Request the correct resources used by the board even if the FIFO is not used. This prevents another driver from trying to use the

[PATCH 57/66] staging: comedi: pcl812: define the mode register bits

2014-02-28 Thread H Hartley Sweeten
For aesthetics, rename this register. Define the bits in the register to remove the magic values. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deleti

[PATCH 31/66] staging: comedi: pcl816: consolidate the common interrupt code

2014-02-28 Thread H Hartley Sweeten
The DMA and EOC interrupt handler functions, that are called by the _real_ interrupt function, always return IRQ_HANDLED. Change the return type for these functions to void and move the final return to the real interrupt function. Change the parameters to the handler functions to the comedi_device

[PATCH 09/66] staging: comedi: pcl818: factor out dma setup to helper functions

2014-02-28 Thread H Hartley Sweeten
To assist in cleaning up the the rest of the driver, factor the initial dma setup and the next dma buffer setup into helper functions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl818.c | 96 +++-- 1 fi

[PATCH 44/66] staging: comedi: pcl818: introduce pcl818_ai_clear_eoc()

2014-02-28 Thread H Hartley Sweeten
Introduce a helper function to clear the end-of-conversion flag. This flag is set when an analog input conversion is finished and the hardware generates an interrupt request. Writing any value to the register resets the flag and re-enables the interrupt. Remove the clearing of the flag in pcl818_

[PATCH 34/66] staging: comedi: pcl816: add support for digital subdevices

2014-02-28 Thread H Hartley Sweeten
The PCL-816 boards have 16 digital inputs and 16 digtial outputs. Add the subdevice support for these channels. Allocate additional subdevice space to the analog outputs. This code is not currently in the driver so mark the subdevice as COMEDI_SUBD_UNUSED. Signed-off-by: H Hartley Sweeten Cc: Ia

[PATCH 51/66] staging: comedi: pcl818: define the status register bits

2014-02-28 Thread H Hartley Sweeten
Define the bits in the status register and remove the magic values. Writing any value to the status register clears any pending interrupt. For aesthetics, rename the status register and remove the "clrint" register. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- dr

[PATCH 40/66] staging: comedi: pcl816: tidy up the analog input (*insn_read)

2014-02-28 Thread H Hartley Sweeten
For aesthetics, move this function out of the async command support code. For safety, the INT request (end-of-conversion flag) should be cleared before doing each conversion and after the final data sample is read. This driver does that but it's a bit awkward with the initial clear being outside t

[PATCH 45/66] staging: comedi: pcl818: introduce pcl818_ai_soft_trig()

2014-02-28 Thread H Hartley Sweeten
Introduce a helper function to start a software triggered analog input conversion. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl818.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/staging/c

[PATCH 12/66] staging: comedi: pcl812: interrupt handlers should not busywait

2014-02-28 Thread H Hartley Sweeten
The interrupt is only generated by the hardware at the completion of an A/D conversion. Because of this the sanity check to make sure that the A/D conversion is complete and data is available is probably unnecessary but it doesn't hurt anything. The busywait loop is a different issue. Interrupt ro

[PATCH 36/66] staging: comedi: pcl816: move pcl816_reset()

2014-02-28 Thread H Hartley Sweeten
For aesthetics, move this function to follow the pcl812 and pcl818 drivers better. Remove the commented out cut-and-paste code from the pcl818 driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 43 +++---

[PATCH 41/66] staging: comedi: pcl812: tidy up the analog input (*insn_read)

2014-02-28 Thread H Hartley Sweeten
For aesthetics, move this function out of the async command support code. For safety, the INT request (end-of-conversion flag) should be cleared before doing each conversion and after the final data sample is read. The driver currently does not do this. Refactor the function a bit so it's more li

[PATCH 17/66] staging: comedi: pcl818: factor out the common "next ai chan" code

2014-02-28 Thread H Hartley Sweeten
The DMA, FIFO, and EOC interrupt handlers all have common code that bumps the counters in the private data that keep track of what channel is being sampled next and when all the data has been sampled. Factor this common code into a helper function. Make sure the COMEDI_CB_BLOCK event is set when

[PATCH 54/66] staging: comedi: pcl812: cleanup setup_range_channel()

2014-02-28 Thread H Hartley Sweeten
Move this function to remove the need for the forward declaration. Rename it so it has namespace associated with the driver. Remove the unnecessary comedi_subdevice parameter from the function. The hardware does not support analog input channel scanning so the mux and range need to be set before e

[PATCH 32/66] staging: comedi: pcl818: consolidate the common interrupt code

2014-02-28 Thread H Hartley Sweeten
The DMA, FIFO, and EOC interrupt handler functions, that are called by the _real_ interrupt function, always return IRQ_HANDLED. Change the return type for these functions to void and move the final return to the real interrupt function. Change the parameters to the handler functions to the comedi

[PATCH 43/66] staging: comedi: pcl816: introduce pcl816_ai_clear_eoc()

2014-02-28 Thread H Hartley Sweeten
Introduce a helper function to clear the end-of-conversion flag. This flag is set when an analog input conversion is finished and the hardware generates an interrupt request. Writing any value to the register resets the flag and re-enables the interrupt. Move the call in pcl816_ai_cancel() so tha

[PATCH 06/66] staging: comedi: pcl818: remove 'neverending_ai' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is not needed. We can check the stop_src to determine this information: neverending_ai -> cmd->stop_src == TRIG_NONE !neverending_ai -> cmd->stop_src == TRIG_COUNT Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/co

[PATCH 46/66] staging: comedi: pcl816: introduce pcl816_ai_soft_trig()

2014-02-28 Thread H Hartley Sweeten
Introduce a helper function to start a software triggered analog input conversion. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/staging/

[PATCH 39/66] staging: comedi: pcl818: tidy up the analog input (*insn_read)

2014-02-28 Thread H Hartley Sweeten
For aesthetics, move this function out of the async command support code. For safety, the INT request (end-of-conversion flag) should be cleared before doing each conversion and after the final data sample is read. This driver already clears the flag before starting a conversion but it does not cl

[PATCH 28/66] staging: comedi: pcl816: remove 'int816_mode' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is not needed. We can determine the inerrupt 'mode' based on the 'dma' member. Refactor the interrupt handler and the (*cancel) function to not use the 'int816_mode' and remove the setting of this member in the (*do_cmd) heler function. Signed-off-by: H Hartley Swe

[PATCH 48/66] staging: comedi: pcl812: tidy up analog input registers

2014-02-28 Thread H Hartley Sweeten
For aesthetics, rename the analog input register defines and convert the offsets to hex. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/driver

[PATCH 21/66] staging: comedi: pcl816: reduce indent level in pcl816_ai_cancel()

2014-02-28 Thread H Hartley Sweeten
If an async command is not running the (*cancel) function doesn't do anything. Exit the function early if this is the case. This allows reducing the indent level in the rest of the function. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/driv

[PATCH 05/66] staging: comedi: pcl816: remove 'ai_neverending' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is not needed. We can check the stop_src to determine this information: ai_neverending -> cmd->stop_src == TRIG_NONE !ai_neverending -> cmd->stop_src == TRIG_COUNT Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/co

[PATCH 27/66] staging: comedi: pcl818: exit interrupt quick when there is nothing to do

2014-02-28 Thread H Hartley Sweeten
If an async ai command is not running or the ai_mode is 0 the interrupt routine doesn't do anything other than spew some noise and clear the interrupt request in the hardware. Because this driver is manually attached, the "premature interrupt" check in the interrupt handler should never happen. Th

[PATCH 04/66] staging: comedi: pcl812: remove 'ai_neverending' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is not needed. We can check the stop_src to determine this information: ai_neverending -> cmd->stop_src == TRIG_NONE !ai_neverending -> cmd->stop_src == TRIG_COUNT Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/co

[PATCH 22/66] staging: comedi: pcl818: reduce indent level in pcl818_ai_cancel()

2014-02-28 Thread H Hartley Sweeten
If an async command is not running the (*cancel) function doesn't do anything. Exit the function early if this is the case. This allows reducing the indent level in the rest of the function. Also, move the setting of the 'irq_was_now_closed' to the only place wher it actually gets left set to 1 a

[PATCH 26/66] staging: comedi: pcl816: exit interrupt quick when there is nothing to do

2014-02-28 Thread H Hartley Sweeten
If an async ai command is not running or the int816_mode is 0 the interrupt routine doesn't do anything other than spew some noise and clear the interrupt request in the hardware. Because this driver is manually attached, the "premature interrupt" check in the interrupt handler should never happen

[PATCH 19/66] staging: comedi: pcl818: introduce pcl818_ai_get_fifo_sample()

2014-02-28 Thread H Hartley Sweeten
To clarify the code, introduce a helper function to read the analog input data sample from the FIFO and optionally return the channel that the sample was for. The channel is used to check for dropped samples. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/st

[PATCH 11/66] staging: comedi: pcl816: remove 'dmasamplesize' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is not used. Remove it. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/driver

[PATCH 29/66] staging: comedi: pcl818: remove 'ai_mode' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is not needed. We can determine the interrupt mode based on the 'dma' and 'usefifo' members. Refactor the interrupt handler and the (*cancel) function to not use the 'ai_mode' and remove the setting of this member in the (*do_cmd) heler functions. Signed-off-by: H

[PATCH 00/66] staging: comedi: clenaup pcl812/816/818 drivers part 2

2014-02-28 Thread H Hartley Sweeten
This series continues the cleanup of the pcl812/816/818 drivers. H Hartley Sweeten (66): staging: comedi: pcl816: remove pcl816_check() staging: comedi: pcl818: remove pcl818_check() staging: comedi: pcl818: fix board resource region request staging: comedi: pcl812: remove 'ai_neverending

[PATCH 10/66] staging: comedi: pcl812: remove 'ai_data_len' from private data

2014-02-28 Thread H Hartley Sweeten
This member of the private data is only used in the initial dma setup. Refactor that code to not need it and remove the member. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl812.c | 8 +++- 1 file changed, 3 insertions(+), 5 de

[PATCH 37/66] staging: comedi: pcl812: tidy up the analog output subdevice

2014-02-28 Thread H Hartley Sweeten
For aesthetics, tidy up the analog output subdevice code. Change the regsiter map defines to simplify the code. Move the analog subdevice support functions out of the analog input support functions. Tidy them up a bit during the move. Add some whitespace to the subdevice init. Signed-off-by: H

[PATCH 01/66] staging: comedi: pcl816: remove pcl816_check()

2014-02-28 Thread H Hartley Sweeten
This function is a _very_ simplified probe that tried to verify that the driver is being attached to a PCL-816 compatible board. The function simply writes some values to specific registers then reads back the values to see if they are the same. It's possible that the user could try to attach this

[PATCH 08/66] staging: comedi: pcl816: factor out dma setup to helper functions

2014-02-28 Thread H Hartley Sweeten
To assist in cleaning up the the rest of the driver, factor the initial dma setup and the next dma buffer setup into helper functions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 114 ++-- 1 fi

[PATCH 14/66] staging: comedi: pcl818: interrupt handlers should not busywait

2014-02-28 Thread H Hartley Sweeten
The interrupt is only generated by the hardware at the completion of an A/D conversion. Because of this the sanity check to make sure that the A/D conversion is complete and data is available is probably unnecessary but it doesn't hurt anything. The busywait loop is a different issue. Interrupt ro

[PATCH 16/66] staging: comedi: pcl816: factor out the common "next ai chan" code

2014-02-28 Thread H Hartley Sweeten
The DMA and EOC interrupt handlers all have common code that bumps the counters in the private data that keep track of what channel is being sampled next and when all the data has been sampled. Factor this common code into a helper function. Don't clear the events in the driver. The comedi core w

[PATCH 25/66] staging: comedi: pcl812: remove "spurious interrupt" noise

2014-02-28 Thread H Hartley Sweeten
Because this driver is manually attached, the "spurious interrupt" check in the interrupt handler should never happen. The interrupt is only hooked up during the attach and it's released during the detach. Leave the check but remove the noise. Also make sure to clear the interrupt request in the h

[PATCH 18/66] staging: comedi: pcl818: fix PCL818_FI_DATAHI

2014-02-28 Thread H Hartley Sweeten
The A/D FIFO uses two registers to get each analog data sample. PCL818_FI_DATALO is the LSB of the data and PCL818_FI_DATAHI is the MSB of the data. The current define for PCL818_FI_DATAHI is incorrect and results in the LSB getting read twice. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc:

Re: [PATCH 07/08] staging:dgap: Fix externs should be avoided in .c files as reported by checkpatch

2014-02-28 Thread Greg KH
On Fri, Feb 28, 2014 at 12:42:14PM -0500, Mark Hounschell wrote: > This patch fixes "externs should be avoided in .c files" > in dgap.c as reported by checkpatch > > Signed-off-by: Mark Hounschell > --- > drivers/staging/dgap/dgap.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-)

Re: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces

2014-02-28 Thread Shuah Khan
On 02/28/2014 03:15 PM, Greg KH wrote: On Thu, Feb 27, 2014 at 05:27:25PM -0700, Shuah Khan wrote: usbip userspace has duplicated enum definition to report usbip device status maintained by the kernel. Adding an usbip uapi header file will define the kernel - userspace interface for this device

Re: [PATCH] staging: sb105x: b_pci_mp.c: fix for non-member access

2014-02-28 Thread Greg KH
On Fri, Feb 28, 2014 at 02:20:40PM -0800, Greg KH wrote: > On Fri, Feb 28, 2014 at 04:21:03AM +0200, Kumar Amit Mehta wrote: > > 'struct tty_struct’ has no member named ‘low_latency’ > > This driver is marked BROKEN, and can't even compile, how did you test > this patch? Don't worry about it anym

Re: [PATCH 11/11] staging: dgap: Fix various previously missed checkpatch errors

2014-02-28 Thread Dan Carpenter
Please redo this one. On Fri, Feb 28, 2014 at 03:49:09PM -0500, Mark Hounschell wrote: > This patch fixes various small checkpatch errors > I missed in patches 01-10. > > Signed-off-by: Mark Hounschell > Cc: Greg Kroah-Hartman > --- > drivers/staging/dgap/dgap.c | 16 ++-- > 1 fil

Re: [PATCH 1/2 v2] Staging: comedi: fix lines that are over 80 characters

2014-02-28 Thread Greg KH
On Fri, Feb 28, 2014 at 03:15:45AM -0600, Chase Southwood wrote: > This patch introduces a simple helper function, outl_1564_timer(), to > allow several lines which violate the character limit to be shortened. > A handful of other lines that are too long are appropriately split as > well. > > Cc:

Re: [PATCH 10/11] staging: dgap: Fix printk related errors as reported by checkpatch

2014-02-28 Thread Dan Carpenter
Please redo this one. On Fri, Feb 28, 2014 at 03:48:58PM -0500, Mark Hounschell wrote: > This patch fixes some printk related errors report by checkpatch. > It also removes more Digi debug/trace code left behind from patch #1. > These are two separate patches. The debug code is dead code yes?

Re: [PATCH] staging: sb105x: b_pci_mp.c: fix for non-member access

2014-02-28 Thread Greg KH
On Fri, Feb 28, 2014 at 04:21:03AM +0200, Kumar Amit Mehta wrote: > 'struct tty_struct’ has no member named ‘low_latency’ This driver is marked BROKEN, and can't even compile, how did you test this patch? ___ devel mailing list de...@linuxdriverproject.

Re: [PATCH 3/5] Staging: cxt1e1: Fix line length over 80 characters in hwprobe.c

2014-02-28 Thread Greg KH
On Fri, Feb 28, 2014 at 04:33:49PM +0900, DaeSeok Youn wrote: > OK. sorry. > I will send again. Please resend all 3 of these, I've applied the first 2. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverpro

Re: [PATCH 1/3] staging/usbip: add uapi header to export usbip kernel interfaces

2014-02-28 Thread Greg KH
On Thu, Feb 27, 2014 at 05:27:25PM -0700, Shuah Khan wrote: > usbip userspace has duplicated enum definition to report usbip device > status maintained by the kernel. Adding an usbip uapi header file will > define the kernel - userspace interface for this device status. > > Signed-off-by: Shuah Kh

  1   2   >