History log of /drivers/misc/mei/wd.c
Revision Date Author Comments
a8605ea2c20c2b97a54d7746c16ebef5ba29632a 29-Sep-2014 Alexander Usyskin <alexander.usyskin@intel.com> mei: fix KDoc documentation formatting

Fix Kdoc documentation formatting warnings
genertaed by ./scripts/kernel-doc

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1f180359f42fc6fda4600175c63f2a84f444cc92 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com> mei: remove include to pci header from mei module files

Remove inclusion of linux/pci.h in mei layer
however we need to include the headers that before
got included implicitly from linux/pci.h.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2bf94cabb199f73402a5ddefa4a7bf1a82aaeda5 29-Sep-2014 Tomas Winkler <tomas.winkler@intel.com> mei: get rid of most of the pci dependencies in mei

For purpose of adding testing HW we would like
to get rid of pci dependency in generic mei code
This patch provides only straight forward changes
FW status and prob quirks need to be handled separately

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d880f3294d0576e79dfab4e2cd5a2eb62fe188f0 21-Aug-2014 Tomas Winkler <tomas.winkler@intel.com> mei: add mei_me_cl_by_uuid_id function

When handling dynamic clients there might be a race
scenario in which two me clients with the same me
address would be linked in the me clients list,
therefore we need to search by both uuid and me address.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d320832f64666089a06778782e42fac29abd7bf7 23-Aug-2014 Tomas Winkler <tomas.winkler@intel.com> mei: me_client lookup function to return me_client object

For support of dynamic addition and removal of me clients
it is more convenient to use a list instead of static array
as is use now.
As the first step of the transition to the new data structure
we change the lookup function so it returns me client address
instead of an index.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
e4d8270e604c3202131bac607969605ac397b893 27-Apr-2014 Alexander Usyskin <alexander.usyskin@intel.com> mei: set connecting state just upon connection request is sent to the fw

Adding power gating introduced new waiting state for client also during
connection attempt, a connection request can be queued for later either due
device is power gated or due to other on going connection.
We setting client connection state before start of full connect procedure so
in both cased the client state will be MEI_FILE_CONNECTING
which create interlock between the two connection attempts, both
detecting that another connection is in progress.

The interlock is resolved by moving client to connecting state
only upon connection request transmission, so the first
cb in queue can be processed.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6e4cd27a35622cddbe6c0d6fbeb9da8c232029d1 11-Mar-2014 Tomas Winkler <tomas.winkler@intel.com> mei: make me hw headers private to me hw.

Remove includes of me-hw.h and me-hw-regs.h headers from
the mei generic code.
The mei layer should not depend on hw specific headers

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5877255dc57403f49b4961070b206b832c931201 19-Feb-2014 Tomas Winkler <tomas.winkler@intel.com> mei: wd: fix stop completion failure

While running Documentation/watchdog/src/watchdog-simple.c
and quiting by Ctrl-C, fallowing error is displayed:
mei_me 0000:00:16.0: wd: stop failed to complete ret=-512.

The whatchdog core framework is not able to propagate
-ESYSRESTART or -EINTR. Also There is no much sense in
restarting the close system call so instead of using
wait_event_interruptible_timeout we can use wait_event_timeout
with reasonable 10 msecs timeout.

Reported-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b6d81fd66155fb6d0965502e146b136047e428b3 19-Feb-2014 Tomas Winkler <tomas.winkler@intel.com> mei: wd: simplify wd_send command

Add reduce credits to wd_send to remove code
repetition and simplify error handling

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7ca96aa278f8b9983184e318b06a0ed9ad0297b8 19-Feb-2014 Alexander Usyskin <alexander.usyskin@intel.com> mei: make return values consistent across the driver

1. Propagate ENOTTY to user space if the client is not present
in the system
2. Use ETIME consistently on timeouts
3. Return EIO on write failures
4. Return ENODEV on recoverable device failures such as resets

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
6aae48ff18f2fcfb533d2b448ecae16d1de006c1 19-Feb-2014 Tomas Winkler <tomas.winkler@intel.com> mei: add mei_hbuf_acquire wrapper

A client has to acquire host buffer
before writing, we add lock like wrapper
to replace the code snippet

if (dev->hbuf_is_ready)
dev->hbuf_is_ready = false;

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
64092858acfd995fae0def466126692423c30828 17-Feb-2014 Tomas Winkler <tomas.winkler@intel.com> mei: wd and amthif use mei_cl_ api for dis/connection

Connect wd and amthif through regular mei_cl_connect API
as there is no reason to connect in asynchronous mode.
Also use mei_cl_is_connected in order to protect flows
instead of depending on wd_pending and amthif_timer

Now we can remove all the special handling in hbm layer

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
479327fc42737234a1f76f20010334c99110d256 17-Dec-2013 Tomas Winkler <tomas.winkler@intel.com> mei: enable marking internal commands

Set hbm header bit 30 for internal commands
This mark commands that are generated by
the device driver

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50f67a06713599e18cd9141e413d0e2653bb242b 21-Oct-2013 Tomas Winkler <tomas.winkler@intel.com> mei: wd: host_init propagate error codes from called functions

Propagate error codes from called functions, they are correct.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7131799b145aa67984cc57e52d6379862c78afa3 23-May-2013 Tomas Winkler <tomas.winkler@intel.com> mei: deprecate the mei_wd_state_independence_msg

wd independence is deprecated, remove it.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5f1e54e8c12219aa49a8fb3eb1503eefb5294ea3 13-Apr-2013 Tomas Winkler <tomas.winkler@intel.com> mei: wd: fix line over 80 characters

Fix checkpatch warning:
WARNING: line over 80 characters

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
393b148f9d0e70cfcb0096985bb0f0742802929e 04-Apr-2013 Masanari Iida <standby24x7@gmail.com> mei: Fix comments in drivers/misc/mei

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>
330dd7da5ec80e2c49c66bf353d8b4fa4fb8f5a9 06-Feb-2013 Tomas Winkler <tomas.winkler@intel.com> mei: rename to mei_host_buffer_is_empty to hbuf_is_ready

we rename the mei_host_buffer_is_empty to keep naming
convention of hbuf and also make the query more generic
to be correct also for other under laying hardware

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
781d0d89224bbbc438c2c0360cfd4822bb35d280 08-Jan-2013 Tomas Winkler <tomas.winkler@intel.com> mei: normalize me host client linking routines

In order we can use the same code pattern for in-kernel
and user space host clients we replace mei_cl_link_to_me
with mei_cl_link function.
We then have to keep me client lookupout of the new link function.

The unlinking cannot be yet symetric due to amthif connection
handling

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
9dc64d6a26b016df52d222abe9279a92d9f7cc4c 08-Jan-2013 Tomas Winkler <tomas.winkler@intel.com> mei: rename interface to hw-me

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>
90e0b5f18569bdd03c5ddd1d8c99946f42af77b8 08-Jan-2013 Tomas Winkler <tomas.winkler@intel.com> mei: fix client functions names

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>
0edb23fc3451c84350edcc999c023d225a49530d 08-Jan-2013 Tomas Winkler <tomas.winkler@intel.com> mei: add new hbm.h header to export hbm protocol

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>
8120e7201cf9795bc98ffb2e3064b657c0f34c05 25-Dec-2012 Tomas Winkler <tomas.winkler@intel.com> mei: add common prefix to hbm function

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>
e46f187487a8c28e64417e51ba628746a5397838 25-Dec-2012 Tomas Winkler <tomas.winkler@intel.com> mei: use structured buffer for the write buffer

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>
47a73801f498883ea3acccb8f6ff1b5c7a3553de 25-Dec-2012 Tomas Winkler <tomas.winkler@intel.com> mei: include local headers after the system ones

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>
438763f37eb9664b6372bdfee990f8c33acdc63c 25-Dec-2012 Tomas Winkler <tomas.winkler@intel.com> mei: drop redundant length parameter from mei_write_message function

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>
d692170037c0338b31dac5ac4722c1360a4b5257 16-Dec-2012 Tomas Winkler <tomas.winkler@intel.com> watchdog: mei: avoid oops in watchdog unregister code path

With commit c7d3df3 "mei: use internal watchdog device registration
tracking" will crash the kernel on shutdown path on systems
where ME watchdog is not present.
Since the watchdog was never initialized in such case
the WDOG_UNREGISTERED bit is never set and the system
crashes on access to uninitialized variables down the path.

To solve the issue we query for NULL on watchdog driver driver_data
to check whether the device is registered. This is handled in the
driver and doesn't depend on watchdog core internals.

Cc: Borislav Petkov <bp@alien8.de>
Cc: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
ff8b2f4e424a489222d3c7d55fb2d04c9639ef98 11-Nov-2012 Tomas Winkler <tomas.winkler@intel.com> mei: use link and unlink terms for connecting ME and HOST client

1. rename mei_me_cl_update_filext to mei_me_cl_link
2. rename mei_remove_client_from_file_list to mei_me_cl_unlink

Code style, documenation, and usage of both function is updated

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c7d3df354dcb7477900b29a1200744a8c976c03a 01-Nov-2012 Tomas Winkler <tomas.winkler@intel.com> mei: use internal watchdog device registration tracking

remove bool wd_interface_reg as watchdog device already
keeps track of its registration

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3870c3206b96c900ce29c8068bd5ad46fae71f5b 01-Nov-2012 Tomas Winkler <tomas.winkler@intel.com> mei: normalize timeouts definitions

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>
09649a85adfedde99b47b6ccef3fea696fad72be 16-Aug-2012 Tomas Winkler <tomas.winkler@intel.com> mei: wd: use watchdog_set/get_drvdata for passing mei_device

use watchdog_set/get_drvdata for passing mei_device
to watchdog_ops handlers instead of using global mei_device

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c216fdeb2e7371554c56ba457c374cce9c77f91a 16-Aug-2012 Tomas Winkler <tomas.winkler@intel.com> mei: wd: decouple and revamp watchdog state machine

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>
248ffdf7c95726a8dae76e25fdb037899c5b77fa 16-Aug-2012 Tomas Winkler <tomas.winkler@intel.com> mei: wd: rename watchdog constants to be more descriptive

1. rename defines to more be descriptive
2. remove duplicated defines from interface.h
3. add common prefix MEI_

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
c8df72920c9cd8e43899a5660ee54a46ac2588a6 16-Aug-2012 Tomas Winkler <tomas.winkler@intel.com> mei: wd: add option WDIOF_SETTIMEOUT

According watchdog-kernel-api.txt WDIOF_SETTIMEOUT
should be set if the driver supplies set_timeout function

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
b210d7506f416e7250eb52c314e5ed08928639dd 06-Aug-2012 Tomas Winkler <tomas.winkler@intel.com> mei: name space for mei device state

1. add MEI_DEV_ prefix for mei device state enums
2. rename mei_state to dev_state
3. add constant to string translation for debug purposes

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
07b509b7943e5594f3f228e5b62a49cf6a033709 23-Jul-2012 Tomas Winkler <tomas.winkler@intel.com> mei: revamp me client search function

me client search functions returns index
into me_client array according me client id
or me client uuid.

1. Add common prefix for the functions mei_me_cl_<>
2. create new function mei_me_cl_by_id that wraps open
coded loops scattered over the code
3. rename mei_find_me_client_index to mei_me_cl_by_uuid
4. rename mei_find_me_client_update_filext to
mei_me_cl_update_filext and updates its parameter names

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
7cb1ba9b679afe5fc335205fd6fb25fd3e51e33a 04-Jul-2012 Tomas Winkler <tomas.winkler@intel.com> mei: mei_wd_host_init: update the comment

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
d242a0afb2e5bf1db83c6a0504e55addef425e61 04-Jul-2012 Tomas Winkler <tomas.winkler@intel.com> mei: remove write only wariable wd_due_counter

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
49fbd3f1c3a67b99c053600a1cd7e5d0be48bed6 10-Jun-2012 Tomas Winkler <tomas.winkler@intel.com> misc: mei: set WDIOF_ALARMONLY on mei watchdog

mei watchdog doesn't reboot the system it only produces event
therefore mark it as WDIOF_ALARMONLY.

This patch depends on:
commit 2bbeed016dd96045ec82c3a309afddcc3a0db1d2
Author: Alan Cox <alan@linux.intel.com>
watchdog: Add a flag to indicate the watchdog doesn't reboot things

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
4f3afe1d8c8e5dc41bb5820c01b4f3cfc2dc1205 09-May-2012 Tomas Winkler <tomas.winkler@intel.com> mei: export mei.h for the user space

The header exports API for application layer

1. move under include/linux and add to the export list
2. update include path n the sources
3. update TODO

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
ffc2825c2942b57c5dbfbcb3ad798696438aed62 02-May-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org> Staging: mei: move the mei code out of staging

It's been cleaned up, and there's nothing else left to do, so move it
out of staging into drivers/misc/ where all can use it now.

Cc: Tomas Winkler <tomas.winkler@intel.com>
Cc: Oren Weil <oren.jer.weil@intel.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>