Commit Graph

10 Commits (5dae92a718570e6a942e0b882e53d25cab03b40f)

Author SHA1 Message Date
Alexey Khoroshilov e6028db014 mei: fix mismatch in mutex unlock-lock in mei_amthif_read()
Users of mei_amthif_read() expect it leaves dev->device_lock held,
while there is a path where mei_amthif_read() unlocks device_lock
and returns -ERESTARTSYS.

The patch move code locking device_lock back before the return.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 10:28:03 -08:00
Tomas Winkler 24c656e55f mei: streamline amthif write complete function
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-21 12:43:58 -08:00
Tomas Winkler ff8b2f4e42 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>
2012-11-15 15:34:19 -08:00
Tomas Winkler 744f0f2f42 mei: extract amthif specific code from mei_poll to mei_amthif_poll
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 15:34:18 -08:00
Tomas Winkler a562d5c25a mei: move amthif specific release code to amithif
Move amthif code part into separate function
mei_amthif_release.
Also helper functions mei_clear_list and mei_clear_lists
are moved along

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-15 15:34:18 -08:00
Tomas Winkler 4b8960b492 mei: rename enum mei_cb_major_types to enum mei_cb_file_ops
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-15 15:34:18 -08:00
Tomas Winkler db3ed43185 mei: use type struct mei_cl *cl instead of void in struct mei_cb
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-15 15:34:18 -08:00
Tomas Winkler e773efc405 mei: amthif: prefix cb list with amthif
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-15 15:34:18 -08:00
Tomas Winkler ab5c4a56d4 mei: move amthif specific code from mei_write to mei_amthif_write
For sake of amthif consolidation move amthif specific code from
mei_write to mei_amthif_write

The original mei_amthif_write to mei_amthif_send_cmd
as this function deals with sending single command
while mei_amthif_write is interface function called from
the main driver which in turns calls mei_amthif_send_cmd

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-01 12:31:19 -07:00
Tomas Winkler 19838fb853 mei: extract AMTHI functions into the amthif.c file
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-01 12:31:19 -07:00