aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/mostcore (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-11-29staging: most: Eliminate usage of symbolic permissionsJason Litzinger1-10/+8
Fix checkpatch warnings regarding the use of symbolic permissions. Where the MOST_CHANNEL_ATTR macro is used, convert to octal permissions over symbolic. Where _ATTR is used directly, replace with _ATTR_RW/_ATTR_WO and update the show/store function names appropriately. Signed-off-by: Jason Litzinger <jlitzingerdev@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: most: core: update examples on how to link channelsAndrey Shvetsov1-3/+3
This patch updates the comments with examples on how to use the "add_link" and "remove_link" properties. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: most: core: remove processing of deprecated namesAndrey Shvetsov1-14/+11
The USB HDM does not use the "@" character for channel names anymore. This patch cleans up the code processing such names and adapts the corresponding examples on how to use the properties "add_link" and "remove_link". Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: most: core: remove read option from remove_linkAndrey Shvetsov1-11/+1
The attribute "remove_link" returns the latest link that has been removed of a certain channel. Since this piece information isn't particulary useful this patch is going to remove it. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: most: core: remove member add_linkAndrey Shvetsov1-2/+0
This patch removes the unused field add_link of struct most_aim_obj. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22staging: most: replace MOST_CH_ISOC_AVP with MOST_CH_ISOCAndrey Shvetsov2-4/+4
This patch replaces the enum value MOST_CH_ISOC_AVP with the more appropriate MOST_CH_ISOC. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22staging: most: clean up configuration stringsChristian Gromm1-7/+14
This patch adds the strings 'rx', 'tx' and 'isoc' to the list of accepted identifiers when setting up a channel configuration. To keep consistency it removes the prefix "dir_" from strings returned by the attributes set_direction and available_directions and it removes the suffix "_avp" from the string "isoc_avp" returned by the attributes set_datatype and available_datatypes. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22staging: most: core: remove trailing zero from text propertyAndrey Shvetsov1-2/+2
This patch removes trailing zeros from the strings returned by the attributes available_datatypes and available_directions. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-22staging: most: make function most_submit_mbo return voidChristian Gromm2-8/+5
Function most_submit_mbo() causes an exception only if either the pointer mbo or mbo->context equals NULL. From the underlying architecture's point of view both cases must _not_ come true and would happen only, if something has tampered with the pointers. This would render runtime code unable to recover anyway. So, instead trying to hide that things are already critically out of control we're better off with a WARN_ON() assertion. This patch replaces the return type of the function most_submit_mbo() with 'void' and adds a WARN_ONCE() assertion. Additionally, code calling the function is adapted accordingly. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: most: core: constify structure memberAndrey Shvetsov1-1/+1
This patch adds the const qualifier to the declaration of the member name_suffix of structure most_channel_capability. It is needed since it points to string literals. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: most: core: show all linked channelsChristian Gromm1-1/+17
This patch is needed to have all linked channels being reported by the show() function of the attribute file add_link. Currently user space can only read back the latest link that has been established to a certain channel. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: most: hdm-usb: fix race between enqueue and most_stop_enqueueChristian Gromm1-16/+37
The "broken in pipe" handler of the USB-HDM calls most_stop_enqueue() to stop the MBO traffic before returning all MBOs back to the Mostcore. As the enqueue() call from the Mostcore may run in parallel with the most_stop_enqueue(), the HDM may run into the inconsistent state and crash the kernel. This patch synchronizes enqueue(), most_stop_enqueue() and most_resume_enqueue() with a mutex, hence avoiding the race condition. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: most: core: rename device struct of core moduleChristian Gromm1-9/+6
This patch gives the struct device variable of the core a more meaningful name. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: most: core: remove debug printChristian Gromm1-3/+1
This patch removes the debug print in case an HDM ran out of rx buffers. This is not needed since the status is reflected in the sysfs channel_starving flag. Additionally, it prevents the system form slowing down. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25Staging: most: Do not print message if kzalloc() failed.Sandhya Bankar1-1/+0
Do not print message if kzalloc() failed. kzalloc() has its own messages. So no need to add extra one. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11staging: most: return proper errorSudip Mukherjee1-8/+19
We were returning ENOMEM on all types of errors. Lets return the actual error code. At the same time remove the label which became unused as a result of this patch. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: replace multiple if..else with table lookupHari Prasath Gujulan Elango1-17/+24
Replace multiple if..else if..statements with simple table lookup in two functions. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: fix error comparisonSudip Mukherjee1-1/+1
device_create() returns ERR_PTR on error, it does not return NULL. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: fix retrieval of buffer availabilityChristian Gromm2-2/+8
This patch fixes the function channel_has_mbo that delivers the false information in case two AIMs are using the same tx channel. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: remove redundant mutexesChristian Gromm1-9/+0
This patch removes the mutexes stop_task_mutex and deregister mutex, since they can safely be left out. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: remove code to destroy channelChristian Gromm1-13/+0
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>
2016-02-07staging: most: remove reference counterChristian Gromm1-12/+1
This patch removes the unnecessary reference conter mod_ref. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: remove tainted flagChristian Gromm1-32/+1
This patch removes the atomic tainted flag. It is needed to get rid of logical overhead. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: move channel disconnect to function most_deregister_interfaceChristian Gromm1-13/+11
This patch moves the code that disconnects linked channels. It is needed to have cleaning things up done right. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: move mutexChristian Gromm1-2/+1
This patch removes mutex from code that doesn't need any locking. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: move initialization of pointerChristian Gromm1-2/+5
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>
2016-02-07staging: most: move call to disconnect_channel callbackChristian Gromm1-2/+2
This patch invokes AIM's disconnect_channel callback before the corresponding pointers are re-initialized to NULL. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: add missing call to ida_simple_removeChristian Gromm1-0/+2
This patch adds two missing calls to function ida_simpel_remove. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: most: remove function destroy_most_c_objChristian Gromm1-24/+14
This patch removes the function destroy_most_c_obj and executes its code within function destroy_most_inst_obj. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15staging: most: Delete an unnecessary check before the function call "module_put"Markus Elfring1-2/+1
The module_put() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15staging: most: remove multiple blank linesChaehyun Lim1-2/+0
This patch removes multiple blank lines found by checkpatch. CHECK: Please don't use multiple blank lines Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: use preferred kernel typesChristian Gromm1-1/+1
This patch makes use of the preferred kernel types such as u16, u32. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: fix logical operator positionChristian Gromm1-2/+2
This patch puts logical continuations on the previous line to meet coding style. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: use blank line after declarationsChristian Gromm1-0/+6
This patch fixes style violation regarding blank lines after function/struct/union/enum declarations. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: use braces on all arms of statementChristian Gromm1-8/+8
This patch fixes style issues regarding braces on all arms of a statement. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: make alignment match open parenthesisChristian Gromm1-2/+2
This patch fixes coding style violations by making alignments match open parenthesis. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: remove multiple blank linesChristian Gromm1-6/+0
This patch removes the usage of multiple blank lines from driver modules. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16staging: most: fix line-over-80-characters violationsChristian Gromm1-2/+4
This patch prevents code from crossing the 80 character margin. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16staging: most: change parameter descriptionChristian Gromm1-1/+1
This patch changes the description of a function parameter for a better understanding. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16staging: most: fix misplaced constants in comparisonsChristian Gromm1-2/+2
This patch removes and fixes constants being misplaced in comparisons. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13Staging: most: Remove exceptional & on function nameShraddha Barke1-1/+2
In this file, function names are otherwise used as pointers without &. A simplified version of the Coccinelle semantic patch that makes this change is as follows: // <smpl> @r@ identifier f; @@ f(...) { ... } @@ identifier r.f; @@ - &f + f // </smpl> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: add poll syscall to AIM cdevChristian Gromm2-0/+17
This patch adds the implementation of the poll syscall to the AIM cdev. To have the full functionality, a helper function is needed in the core module to retrieve the instantaneous availability of tx buffers. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: refactor channel structureChristian Gromm1-53/+55
The struct most_c_obj has the same set of attributes for each of two AIMs. This patch cleans up the code by introducing the new struct most_c_aim_obj hat contains those fields. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: add fair buffer distributionChristian Gromm2-2/+29
This patch ensures a fair distribution of buffers, when two AIMs share a single channel. The AIMs then won't be able to use more than half of all pre-allocated buffers of the linked channel. However, in case the channel is not shared, the AIM can exclusively use all available buffers. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: fix channel operation in multi-aim contextChristian Gromm2-26/+53
This patch fixes the opening and closing process of a physical channel when used by different AIMs. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: remove aim resetChristian Gromm1-5/+0
This patch partly reverts a modification of function most_stop_channel() that is trying to reset an established link between an AIM and an HDM in all suitable places. But since the function most_stop_channel() is stopping the data transfer it is the wrong place to do so. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29Merge 4.3-rc3 into staging-nextGreg Kroah-Hartman1-0/+1
We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13Staging: most: MOST and MOSTCORE should depend on HAS_DMAGeert Uytterhoeven1-0/+1
If NO_DMA=y: ERROR: "dma_free_coherent" [drivers/staging/most/mostcore/mostcore.ko] undefined! ERROR: "dma_alloc_coherent" [drivers/staging/most/mostcore/mostcore.ko] undefined! As all MOST sub drivers use DMA functionality, add a dependency on HAS_DMA to MOSTCORE, and to MOST, which selects MOSTCORE. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: most: style of bool comparisonSudip Mukherjee1-2/+2
BOOLEAN tests do not need any comparison to TRUE or FALSE. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: most: remove unneeded NULL checkSudip Mukherjee1-4/+2
The loop cursor of list_for_each_entry_safe() can never be NULL. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>