Commit Graph

12 Commits (997d3eaf02cad6fdb54bd6085c9a7c48ddd68a2d)

Author SHA1 Message Date
Oren Weil abc51b6de5 staging: mei: Organize the initialization state machine.
moving the final state, clearing of the client maps and
updating of mei state out from mei_host_client_properties function.

Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-26 17:26:03 -07:00
Oren Weil a61c6530a6 staging: mei: renaming delayed work field and function to a meaningful name.
the wd_work and mei_wd_timer() function was not just for watchdog.
mei managing the AMT watchdog going to be replace by the kernel watchdog
interface.

the mei_timer() will still manage the mei driver timeouts.

Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09 13:28:21 -07:00
Oren Weil 8c4a59a789 staging: mei: adding watchdog ping
adding watchdog ping to send ping/heartbeat to the the AMT watchdog client.
in addition removing the heartbeat sending from the driver timers function.

Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09 13:28:20 -07:00
Oren Weil 9ce178e539 staging: mei: registering the MEI driver with the kernel watchdog core interface
Adding kernel watchdog interface (/dev/watchdog) to the MEI Driver to support AMT Watchdog feature.
This patch and the following one will replace MEI Driver self management of the AMT watchdog
with the standard kernel watchdog interface.

Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09 13:28:20 -07:00
Tomas Winkler 4f61a7ad93 staging: mei: enable msi when supported
enable msi when supported
also in that case we can drop the quick handler
from the threaded interrupt that protected us from
handling USB interrupts

Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 12:56:44 -07:00
Tomas Winkler 479bc59d88 staging: mei: fix possible usage of uninitialized variable
Fix warning: reported in http://marc.info/?l=linux-kernel&m=130812960402606&w=2

drivers/staging/mei/interrupt.c: warning: 'buffer' may be used uninitialized in this function:  => 198

It is a real issue and wrong path in execution is taken when
list is empty or (cl && _mei_irq_thread_state_ok(cl, mei_hdr))
evaluates to false

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:21:33 -07:00
Tomas Winkler 0288c7c975 staging: mei: io_list functions revamp
1. remove list used for loop. There were only 2 loops used in non
   time critical places so we can safely unroll them
2. normalize functions names operating on io_list to mei_io_list_<op>
3. rename mei_fe_same_id to mei_cl_cmp_id  used for comparing list
   elements containing struct mei_cl
4. group together  io_list functions in the header file

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:21:33 -07:00
Tomas Winkler cf9673dad4 staging: mei: rename num_mei_me_clients to me_clients_num
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:21:32 -07:00
Tomas Winkler a93218e14c staging: mei: mei_dev - kill unused members
remove write only/unsed variables
mei_dev.write_hang and mei_io_lis.tdevice_extension

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:20:33 -07:00
Tomas Winkler eb9af0acec staging: mei: mei_dev - use type bool instead of int
use type bool for boolean variables in struct mei_dev
this should save some space providing boolean is 8 bits

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:20:33 -07:00
Tomas Winkler c95efb741f staging: mei: fix mei driver namespace
All global functions must start with mei_ to reduce the risk of name colisions

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 13:20:32 -07:00
Oren Weil fb7d879f3b staging/mei: Interrupt handling.
ISR and interrupt thread for handling incoming data.
e.g. read bus message, read client message, handle reset requests.

quick handler:
	As MEI may share interrupt with GFX and/or USB
	the HW register need to be checked and acknowledged.

thread handler:
	Check if HW has data for read.
	Write data to HW if possible.
	May init reset flow on error

there can be two types of messages:
1) bus messages:
	Management messages between MEI Driver and ME e.g.
		Connect request/response,
		Disconnect request/response
		Enum clients request/response
		Flow control request/response
	those message are indicated by
	ME Address/ID == 0 && Host Address/ID == 0

2) feature/client messages:
	message that are sends between ME Feature/Client and
	an application, the struct of the message is defined
	by the ME Feature Protocol (e.g. APF Protocol, AMTHI Protocol)
	those message are indicated by
	ME Address/ID != 0 && Host Address/ID != 0

MEI Initialization state machine is also managed by this patch.
After MEI Reset is preform:
	Send Start request
		wait for answer
	Send Enumerate Clients request
		wait for answer
	Send Get Client property for each client request
		wait for answers
	Init Done.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Itzhak Tzeel-Krupp <itzhak.tzeel-krupp@intel.com>
Signed-off-by: Oren Weil <oren.jer.weil@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-18 08:30:56 -07:00