aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/interrupt.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-06-24mei: move mei_cl_irq_write_complete to client.cTomas Winkler1-59/+0
mei_cl_irq_write_complete operates on a client so move it to client.c Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-21mei: revamp interrupt thread handlersTomas Winkler1-67/+63
1. Use common prefix mei_cl_irq_ and common parameter list for client handlers. 2. Update function kdocs Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-21mei: move mei_cl_complete to client.cTomas Winkler1-27/+1
1. rename mei_cl_complete_handler to mei_cl_complete 2. move the function client.c where it belongs Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-30Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivialLinus Torvalds1-2/+2
Pull trivial tree updates from Jiri Kosina: "Usual stuff, mostly comment fixes, typo fixes, printk fixes and small code cleanups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (45 commits) mm: Convert print_symbol to %pSR gfs2: Convert print_symbol to %pSR m32r: Convert print_symbol to %pSR iostats.txt: add easy-to-find description for field 6 x86 cmpxchg.h: fix wrong comment treewide: Fix typo in printk and comments doc: devicetree: Fix various typos docbook: fix 8250 naming in device-drivers pata_pdc2027x: Fix compiler warning treewide: Fix typo in printks mei: Fix comments in drivers/misc/mei treewide: Fix typos in kernel messages pm44xx: Fix comment for "CONFIG_CPU_IDLE" doc: Fix typo "CONFIG_CGROUP_CGROUP_MEMCG_SWAP" mmzone: correct "pags" to "pages" in comment. kernel-parameters: remove outdated 'noresidual' parameter Remove spurious _H suffixes from ifdef comments sound: Remove stray pluses from Kconfig file radio-shark: Fix printk "CONFIG_LED_CLASS" doc: put proper reference to CONFIG_MODULE_SIG_ENFORCE ...
2013-04-23mei: fix krealloc() misuse in in mei_cl_irq_read_msg()Wei Yongjun1-5/+5
If krealloc() returns NULL, it doesn't free the original. So any code of the form 'foo = krealloc(foo, ...);' is almost certainly a bug. Introduced by commit fcb136e1ac5774909e0d85189f721b8dfa800e0f(mei: fix reading large reposnes) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-23mei: reduce flow control only for completed messagesTomas Winkler1-3/+4
This fixes bug when only first chunk of a large message split by hbuf_max_len is written to the hardware. All the consequent chunks will not get a new credit. A regression introduced by the commit 0ef319c93cebff9f82bdd0cdbb298f2dd00acda8 mei: streamline write complete flow function Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-19mei: fix reading large reposnesTomas Winkler1-3/+15
While writting to device is limitted to max_msg_length advertized in client properites the read can be much longer delivered consequiting chunks. We use krealloc to enlarge the buffer when needed. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-19mei: revamp mei_irq_read_client_message functionTomas Winkler1-58/+66
1. Rename the function and change parameters order, so that first parameter is mei_device 2. Simplify the function code flow 3. Rename helper functions to more self descriptive names 4. Use helpers common functions where possible Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-19mei: revamp mei_amthif_irq_read_messageTomas Winkler1-1/+1
Rename the function to mei_amthif_irq_read_msg and change parameters order Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-19mei: revamp hbm state machineTomas Winkler1-2/+2
1. Rename init_clients_state to hbm_state and use MEI_HBM_ prefix for HBM states 2. Remove recvd_msg and use hbm state for synchronizing hbm protocol has successful start. We can wake up the hbm event from start response handler and remove the hack from the interrupt thread 3. mei_hbm_start_wait function encapsulate start completion waiting Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08mei: notify about the reset in error levelTomas Winkler1-3/+3
Display errors causing device reset using dev_err and not dev_dbg also change messages text to something more concise Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05mei: Fix comments in drivers/misc/meiMasanari Iida1-3/+3
Correct typos and fix stray comments. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Winkler, Tomas <tomas.winkler@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2013-03-29mei: bus: Call bus routines from the core codeSamuel Ortiz1-0/+2
Register the MEI bus type against the kernel core bus APIs and call the bus Rx handler from interrupt.c Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-29mei: move mei-me to separate moduleTomas Winkler1-0/+4
mei layer provides host bus message layer, client management, and os interface mei-me - provides access to ME hardware through the pci bus Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-25mei: add mei_irq_compl_handler functionTomas Winkler1-7/+32
similar to read/write add also irq completion handler that is called for the irq thread rename missnamed mei_irq_complete_handler to mei_cl_complete_handler as it operates on a single client Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-15mei: revamp mei_data2slotsTomas Winkler1-22/+28
1. Move the mei_data2slots to mei_dev.h as it will be used by the all supported HW. 2. Change return value from u8 to u32 to catch possible overflows 3. Eliminate computing the slots number twice in the same function Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-06mei: move interrupt handlers to be me hw specificTomas Winkler1-118/+8
interrupt handler are platform specifics so we move them to hw-mei.c. For sake of that we need to export write, read, and complete handlers from the interrupt.c Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-06mei: separate compilation of the ME hardware specificsTomas Winkler1-5/+5
We add struct mei_hw_ops to virtualize access to hw specific configurations. This allows us to separate the compilation of the ME interface from the ME hardware specifics Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08mei: make host csr and me csr internal to hw-meTomas Winkler1-4/+0
Move csr reading into me hardware functional calls. Since we gave up on registers caching we remove some of the unnecessary queries in mei_hw_init ane mei_reset functions. We add mei_hw_config function to wrap up host buffer depth configuration. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08mei: abstract host and device readienessTomas Winkler1-9/+10
Add mei_host_set_ready function to enable the device and is_ready function to query the host and me readiness Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08mei: use non cached hcsr for interrupt enablementTomas Winkler1-1/+1
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08mei: rename interface to hw-meTomas Winkler1-1/+1
Rename hw-me.h to hw-me-regs.h as this file contains only register definitions. Files hw-me.[ch] now contains ME hw dependant functionality Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08mei: fix client functions namesTomas Winkler1-5/+6
Use common prefix for function names: mei_cl_ - for host clients mei_me_ - for me clients mei_io_ - for io callback functions Because mei_cl holds mei_device back pointer we can also drop the dev argument from the client functions add client.h header to export the clients API Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-08mei: add new hbm.h header to export hbm protocolTomas Winkler1-0/+1
hbm.h provides access host bus messaging functionality for other MEI layers Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: move hbm responses from interrupt.c to hbm.cTomas Winkler1-208/+0
1. Add common prefix mei_hbm_ to all handlers and made them static 2. Drop now useless function same_flow_addr Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: add common prefix to hbm functionTomas Winkler1-5/+5
1. use mei_hbm_ for basic host bus message function 2. use mei_hbm_cl prefix for host bus messages that operation on behalf of a client Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: use structured buffer for the write bufferTomas Winkler1-13/+12
We can drop useless castings and use proper types. We remove the casting in mei_hbm_hdr function and add new function mei_hbm_stop_request_prepare that utilize the new structure Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: move host bus message handling to hbm.cTomas Winkler1-230/+5
for sake of more layered design we move host bus message handling to the new hbm.c file Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: move hw dependent functions to interface.cTomas Winkler1-23/+1
1. move direct register handling to interface.c and make them static 2. add new function mei_clear_interrupts that wraps direct register access 3. export other functions in mei_dev.h Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: include local headers after the system onesTomas Winkler1-2/+2
first include linux/mei.h then only local headers to avoid possible false dependencies Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: use unified format for printing mei message headerTomas Winkler1-8/+6
Introduce MEI_HDR_FMT and MEI_HDR_PRM macros. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07mei: drop redundant length parameter from mei_write_message functionTomas Winkler1-9/+8
The length is already part of the message header and it is validated before the function call Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: Simplify the ME client enumeration codeSamuel Ortiz1-52/+23
After enumerating all ME clients we call the client init functions for all matching UUIDs from a separate context. This remove the hackish cascading client initialisation process that was interleaving properties and connection command replies. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: simplify write complete loop in irq handlerTomas Winkler1-25/+12
extract the common, hence non conditional code from the if-else statment Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: don't mix read and write slotsTomas Winkler1-16/+19
Do not pass read slots pointer into function mei_irq_thread_write_handler, the write slots management is handled internally in the write handler Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: streamline amthif write complete functionTomas Winkler1-2/+2
Rename the function mei_amthif_irq_process_completed to mei_amthif_irq_write_complete Remove cl from the parameter list as it can be extracted from cb block. Extract the common flow from if statements and document the logic properly Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: streamline write complete flow functionTomas Winkler1-70/+43
Rename the function _mei_irq_thread_cmpl to mei_irq_thread_write_complete to make clear it deals with writing. Remove cl from the parameter list as it can be extracted from cb block. Extract the common flow from if statements and document the logic properly Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: use structured buffer for extra write bufferTomas Winkler1-22/+14
The structure of the message is static so we don't have to use and cast the buffer. We can also drop extra_write_index variable as this information can be extracted directly from the message header Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21mei: compact code for mei bus message creationTomas Winkler1-58/+38
1. replace boilerplate code for filling up the bus message header with a common wrapper function 2. shorten variable names and use temporal variables to save some screen space Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15mei: use the same bus msg for connect and disconnect requestTomas Winkler1-9/+8
structs hbm_client_connect_request and hbm_client_disconnect_request have the same layout so we can drop the later Add kdoc for the request and response structure so it is clear they can be used for both purposes Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15mei: rename enum mei_cb_major_types to enum mei_cb_file_opsTomas Winkler1-9/+9
1. Rename mei_cb_major_types to more understandable mei_cb_file_ops 2. Rename member struct mei_cl_cb of this type to simple 'fop_type' 3. Add kernel doc for the type Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15mei: use type struct mei_cl *cl instead of void in struct mei_cbTomas Winkler1-7/+7
We can use correct type 'struct mei_cl' instead of 'void *' for file_private in the struct mei_cb as there is no other type assigned to this member of the structure We rename the member from file_private to cl Remove about 10 lines of declarations of temporary variables used for type casting Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15mei: amthif: prefix cb list with amthifTomas Winkler1-4/+2
amthif cb list were prefixed with amthi_ instead if amthif. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01mei: extract AMTHI functions into the amthif.c fileTomas Winkler1-208/+10
Move AMT Host Interface functions into the new amthif.c file. All functions has now common prefix: mei_amthif_ Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01mei: normalize timeouts definitionsTomas Winkler1-2/+2
1. The hardware book defines timeouts in seconds so we stick to this and define the wrapper function mei_secs_to_jiffies around msecs_to_jiffies to use be used instead multiplying by HZ 2. We add name space prefix MEI_ to all timer defines Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24mei: rename mei_free_cb_private to mei_io_cb_freeTomas Winkler1-7/+5
1. cb_private was an old name that we depriacated in earlier cleanups 2. we also group the funcion declaration with other _io_ functions 3. Don't check cb for NULL as mei_io_cb_free is NULL safe Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24mei: kill usless struct mei_io_listTomas Winkler1-76/+58
kill useless mei_io_list list wrapper and use directly struct mei_cl_cb mei_cb which was its only member for managing io queues Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-24mei: rename mei_cl_cb.information to mei_cl_cb.buf_idxTomas Winkler1-22/+21
rename 'information' member of the struct mei_cl_cb to more self-descriptive 'buf_idx' Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10mei: don't print buffer as a stringTomas Winkler1-8/+1
non readable junk was printed to the logs we will add proper buffer dumping mechanism later if needed Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-16mei: wd: decouple and revamp watchdog state machineTomas Winkler1-6/+3
Before ME watchdog was exported through standard watchdog interface it was closed and started together with the mei device. The major issue is that closing ME watchdog disabled also MEI device, to fix this the watchdog state machine has to be independent from MEI state machine. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>