[char-misc-next v2 4/7] mei: dma ring: implement rx circular buffer logic

2018-11-22 Thread Tomas Winkler
Implement circular buffer protocol over receive dma buffer. Add extension to the mei message header that holds length of the buffer on the dma buffer. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/client.c| 2 +- drivers/misc/mei/dma-ring.c | 61

[char-misc-next v2 3/7] mei: hw: add dma ring control block

2018-11-22 Thread Tomas Winkler
The DMA ring control block contains write and read indices for host and device circular buffers. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/dma-ring.c | 20 drivers/misc/mei/hbm.c | 2 ++ drivers/misc/mei/hw.h | 23

[char-misc-next v2 6/7] mei: bump hbm version to 2.1

2018-11-22 Thread Tomas Winkler
From: Alexander Usyskin Bump HBM version to 2.1 to indicate DMA transfer support. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/hw.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h index

[char-misc-next v2 2/7] mei: hbm: setup dma ring

2018-11-22 Thread Tomas Winkler
DMA ring is allocated upon HBM handshake and the ring parameters are set via dedicated HBM_DMA_SETUP request command. The firmware will perform its setup and respond with a status. On failure the DMA buffers are released. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin

[char-misc-next v2 5/7] mei: dma ring: implement transmit flow

2018-11-22 Thread Tomas Winkler
on the TX DMA circular buffer and later, returns the number of empty slots on the TX DMA circular buffer. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/client.c | 64 -- drivers/misc/mei/dma-ring.c | 89

[char-misc-next] mei: don't update offset in write

2018-07-09 Thread Tomas Winkler
From: Alexander Usyskin MEI enables writes of complete messages only while read can be performed in parts, hence write should not update the file offset to not break interleaving partial reads with writes. Cc: Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc

[char-misc-next 2/2] mei: bus: type promotion bug in mei_fwver()

2018-07-11 Thread Tomas Winkler
quot;) Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus-fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 65e28be3c8cc..4c232f0eae90 100644 --- a/drivers/misc/mei/bus-fixup.c +++ b/drivers/misc/mei/b

[char-misc-next 0/2]: mei bus fix type promotion bugs

2018-07-11 Thread Tomas Winkler
The first patch is a rebase of Dan's patch over misc-next version of the driver. It should go also to the stable. Second one fixes a same issue introduced in next cycle: "mei: expose fw version to sysfs" Dan Carpenter (1): mei: bus: type promotion bug in mei_nfc_if_version() T

[char-misc-next v2 1/2] mei: bus: type promotion bug in mei_nfc_if_version()

2018-07-11 Thread Tomas Winkler
d treated as success. Cc: Fixes: 582ab27a063a ("mei: bus: fix received data size check in NFC fixup") Signed-off-by: Dan Carpenter Signed-off-by: Tomas Winkler --- V2: rebase drivers/misc/mei/bus-fixup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/

[PATCH v8] tpm: separate cmd_ready/go_idle from runtime_pm

2018-06-28 Thread Tomas Winkler
only after granting locality) Cc: sta...@vger.kernel.org Fixes: 888d867df441 (tpm: cmd_ready command can be issued only after granting locality) Signed-off-by: Tomas Winkler --- V2-3:resent V4: 1. Use tpm_pm_suspend/resume in tpm_crb 2. Drop cmd_ready/go_idle around tpm_chip_register, as the

[PATCH] scsi: ufs: revamp string descriptor reading

2018-12-11 Thread Tomas Winkler
Define new a type: uc_string_id for easier string handling and less casting. Reduce number or string copies in price of a dynamic allocation. Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufs-sysfs.c | 20 ++--- drivers/scsi/ufs/ufs.h | 2 +- drivers/scsi/ufs/ufshcd.c| 164

[char-misc-next] mei: squash single_recv_buf into one bit in client properties

2018-12-23 Thread Tomas Winkler
From: Alexander Usyskin single_recv_buf member of struct mei_client_properties has a boolean value and can be represented in on bit, to free other 7 bits for another usage. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/hw.h | 3 ++- 1 file changed, 2

[PATCH] tpm: tpm_try_transmit() refactor error flow.

2018-10-16 Thread Tomas Winkler
command. Last, fix the wrong 'goto out', that jumped back instead of forward. Cc: sta...@vger.kernel.org Fixes: 627448e85c76 ("tpm: separate cmd_ready/go_idle from runtime_pm") Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 15 --- 1 file changed

[PATCH v6 04/20] tpm: add tpm_calc_ordinal_duration() wrapper

2018-10-16 Thread Tomas Winkler
ust the kdoc to the new standard. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- drivers/char/tpm/st33zp24/st33zp24.c | 2 +- drivers/char/tpm/tpm-interface.c | 24 drivers/char/tpm/tpm.h | 1 + drivers/c

[PATCH v6 06/20] tpm: move tpm1_pcr_extend to tpm1-cmd.c

2018-10-16 Thread Tomas Winkler
struct tpm_input_header pcrextend_header = { ^~~~ Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Reviewed-by: Nayna Jain Tested-by: Nayna Jain --- V2-V3: Rebase V4: Remove defines. V5: Resend V6: Add Tested-by: drivers/char/tpm/tpm

[PATCH v6 02/20] tpm: sort objects in the Makefile

2018-10-16 Thread Tomas Winkler
Make the tpm Makefile a bit more in order by putting objects in one column. Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen --- V2: 1. back to tpm-y notation 2. Partially sort files alphanumerically. V3: Rebase V4: Remove redunant sentence in commit

[PATCH v6 01/20] tpm2: add new tpm2 commands according to TCG 1.36

2018-10-16 Thread Tomas Winkler
kdoc comments for tpm2_calc_ordinal_duration(). Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen --- V2-V3: Rebase. V4: 1. Fix kdoc 2. Rename tpm2_ordinal_duration() to tpm2_ordinal_duration_index() 3. Move the two functions close to each other in the file. V5: Adjust the kdoc to

[PATCH v6 00/21] tpm: separate tpm 1.x and tpm 2.x commands

2018-10-16 Thread Tomas Winkler
x27;s platforms. V6: 1. Dropping tpm: move pcr extend code to tpm2-cmd.c and rebasing code over that change 2. Trivial fixes in kdoc and header Tomas Winkler (21): tpm2: add new tpm2 commands according to TCG 1.36 tpm: sort objects in the Makefile tpm: factor out tpm 1.x duration calcul

[PATCH v6 03/20] tpm: factor out tpm 1.x duration calculation to tpm1-cmd.c

2018-10-16 Thread Tomas Winkler
Factor out TPM 1.x commands calculation into tpm1-cmd.c file. and change the prefix from tpm_ to tpm1_. No functional change is done here. Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen --- V2-V3: Rebase V4: 1. Remove the licence statement it's already covered by SPDX. 2. Add

[PATCH v6 12/20] tpm: add tpm_auto_startup() into tpm-interface.c

2018-10-16 Thread Tomas Winkler
Add wrapper tpm_auto_startup() to tpm-interface.c instead of open coded decision between TPM 1.x and TPM 2.x in tpm-chip.c Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen --- V3: New in the series. V4: Fix the commit message. V5-V6: Resend. drivers/char/tpm/tpm-chip.c | 11

[PATCH v6 05/20] tpm: factor out tpm_get_timeouts()

2018-10-16 Thread Tomas Winkler
Factor out tpm_get_timeouts() into tpm2_get_timeouts() and tpm1_get_timeouts() V2-V3: Rebase V4: Fix the commit message. V5: Resend. V6: Remove tpm1_auto_startup() declaration. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- drivers/char/tpm/tpm

[PATCH v6 13/20] tpm: tpm-interface.c drop unused macros

2018-10-16 Thread Tomas Winkler
t;TSC_MAX_ORDINAL" is not used [-Wunused-macros] tpm-interface.c:38:0: warning: macro "TPM_CONNECTION_COMMAND" is not used [-Wunused-macros] Fixes: f72864300139 ("tpm_tis: further simplify calculation of ordinal duration") Signed-off-by: Tomas Winkler Reviewed-by: Jarkk

[PATCH v6 15/20] tpm: tpm1: rewrite tpm1_get_random() using tpm_buf structure

2018-10-16 Thread Tomas Winkler
1. Use tpm_buf in tpm1_get_random() 2. Fix comment in tpm_get_random() so it is clear that the function is expected to return number of random bytes. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4: Resend. V5: A small

[PATCH v6 08/20] tpm: factor out tpm1_get_random into tpm1-cmd.c

2018-10-16 Thread Tomas Winkler
Factor out get random implementation from tpm-interface.c into tpm1_get_random function in tpm1-cmd.c. No functional changes. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkine --- V2-V3: Rebase V4-V8: Resend drivers/char/tpm/tpm-interface.c | 58

[PATCH v6 09/20] tpm: move tpm 1.x selftest code from tpm-interface.c tpm1-cmd.c

2018-10-16 Thread Tomas Winkler
Move the tpm1 selftest code functions to tpm1-cmd.c and adjust callers to use the new function names. 1. tpm_pcr_read_dev() to tpm1_pcr_read_dev(). 2. tpm_continue_selftest() to tpm1_continue_selftest(). 3. tpm_do_selftest() to tpm1_do_selftest() Signed-off-by: Tomas Winkler Tested-by: Jarkko

[PATCH v6 14/20] tpm: tpm-space.c remove unneeded semicolon

2018-10-16 Thread Tomas Winkler
Remove unneeded semicolon in tpm2_map_response_header() Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V3: New in the series. V4-V6: Resend. drivers/char/tpm/tpm2-space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-space.c b/drivers

[PATCH v6 17/20] tmp1: rename tpm1_pcr_read_dev to tpm1_pcr_read()

2018-10-16 Thread Tomas Winkler
Rename tpm1_pcr_read_dev to tpm1_pcr_read() to match the counterpart tpm2_pcr_read(). Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V4: New in the series V5-V6: Resend. drivers/char/tpm/tpm-interface.c | 2 +- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm.h

[PATCH v6 16/20] tpm1: implement tpm1_pcr_read_dev() using tpm_buf structure

2018-10-16 Thread Tomas Winkler
Implement tpm1_pcr_read_dev() using tpm_buf and remove now unneeded structures from tpm.h Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4-V6: Resend. drivers/char/tpm/tpm.h | 18 ++ drivers/char/tpm/tpm1

[PATCH v6 10/20] tpm: factor out tpm 1.x pm suspend flow into tpm1-cmd.c

2018-10-16 Thread Tomas Winkler
Factor out TPM 1.x suspend flow from tpm-interface.c into a new function tpm1_pm_suspend() in tpm1-cmd.c Signed-off-by: Tomas Winkler --- V2-V3: Rebase V4: 1. Add kdoc for tpm1_pm_suspend(). 2. Fix commit message. V5: Adjust the kdoc to the new standard. V6: Rebase drivers/char/tpm/tpm

[PATCH v6 11/20] tpm: factor out tpm_startup function

2018-10-16 Thread Tomas Winkler
TPM manual startup is used only from within TPM 1.x or TPM 2.x code, hence remove tpm_startup() function from tpm-interface.c and add two static functions implementations tpm1_startup() and tpm2_startup() into to tpm1-cmd.c and tpm2-cmd.c respectively. Signed-off-by: Tomas Winkler Tested-by

[PATCH v6 19/20] tpm1: reimplement tpm1_continue_selftest() using tpm_buf

2018-10-16 Thread Tomas Winkler
Reimplement tpm1_continue_selftest() using tpm_buf structure. This is the last command using the old tpm_cmd_t structure and now the structure can be removed. Cc: Nayna Jain Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4

[PATCH v6 20/20] tpm: use u32 instead of int for PCR index

2018-10-16 Thread Tomas Winkler
PCR related functions. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V3: New in the series. V4: Separate unrelated change to another patches. V5: Fix the commit message. V6: Rebased. drivers/char/tpm/tpm-interface.c| 6 +++--- drivers/char/tpm/tpm-sysfs.c| 2

[PATCH v6 18/20] tpm1: reimplement SAVESTATE using tpm_buf

2018-10-16 Thread Tomas Winkler
In tpm1_pm_suspend() function reimplement, TPM_ORD_SAVESTATE comamnd using tpm_buf. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4-V6: Resend drivers/char/tpm/tpm1-cmd.c | 22 -- 1 file changed, 12

[PATCH v6 07/20] tpm: move tpm_getcap to tpm1-cmd.c

2018-10-16 Thread Tomas Winkler
used [-Wunused-const-variable=] static const struct tpm_input_header tpm_getcap_header = { ^ 3. Drop unused TPM_DIGEST_SIZE. It's already defined in include/linux/tpm.h Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Test

[PATCH] tpm: tpm_i2c_nuvoton: use correct command duration for TPM 2.x

2018-10-17 Thread Tomas Winkler
tpm_i2c_nuvoton calculated commands duration using TPM 1.x values via tpm_calc_ordinal_duration() also for TPM 2.x chips. Call tpm2_calc_ordinal_duration() for retrieving ordinal duration for TPM 2.X chips. Cc: Nayna Jain Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_i2c_nuvoton.c | 11

[PATCH] tpm: fix kdoc for tpm2_flush_context_cmd()

2018-10-17 Thread Tomas Winkler
kdoc for tpm2_flush_context_cmd() was off. Fixes: commit 9aa36b399a50 ("tpm: export tpm2_flush_context_cmd")' Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm2-cmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/driver

[char-misc-next 1/3] mei: hbm: drop BUG() from the hbm handler

2018-11-06 Thread Tomas Winkler
Drop BUG() from the hbm handler in order not to crash the whole kernel on faulty firmware implementation. Instead of it, just return an error resulting into link reset. There is no any known issue of faulty firmware in this matter, the change is just to ease the development. Signed-off-by: Tomas

[char-misc-next 3/3] mei: expedite ioctl return on the notify set operation error

2018-11-06 Thread Tomas Winkler
: Tomas Winkler --- drivers/misc/mei/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index ee58561ceb08..1fe9426ce48b 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -1357,7 +1357,9

[char-misc-next 2/3] mei: flush queues by the host client only

2018-11-06 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index ebdcf0b450e2..ee58561ceb08 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei

[PATCH] tpm: tpm_try_transmit() ignore value of go_to_idle()

2018-10-15 Thread Tomas Winkler
t;tpm: separate cmd_ready/go_idle from runtime_pm") Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index 129f640424b7..f69c711bf74a 10

[PATCH v2] tpm: fix kdoc for tpm2_flush_context_cmd()

2018-10-26 Thread Tomas Winkler
kdoc for tpm2_flush_context_cmd() was off. Fixes: 9aa36b399a50 ("tpm: export tpm2_flush_context_cmd")' Signed-off-by: Tomas Winkler --- V2: drop 'commit' from Fixes: drivers/char/tpm/tpm2-cmd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dr

[PATCH v3] tpm: fix kdoc for tpm2_flush_context_cmd()

2018-10-26 Thread Tomas Winkler
kdoc for tpm2_flush_context_cmd() was off. Fixes: 9aa36b399a50 ("tpm: export tpm2_flush_context_cmd")' Signed-off-by: Tomas Winkler --- V2: drop 'commit' from Fixes: V3: Align arguments with tab. drivers/char/tpm/tpm2-cmd.c | 7 +++ 1 file changed, 3 insertions

[PATCH] tpm: tpm_ibmvtpm: fix kdoc warnings

2018-10-26 Thread Tomas Winkler
Remove redundant lines in the kdoc: Fixes kdoc warnings: drivers/char/tpm/tpm_ibmvtpm.c:42: warning: Cannot understand * on line 42 - I thought it was a doc line drivers/char/tpm/tpm_ibmvtpm.c:57: warning: Cannot understand * on line 57 - I thought it was a doc line Signed-off-by: Tomas

[PATCH v7 05/21] tpm: add tpm_calc_ordinal_duration() wrapper

2018-10-19 Thread Tomas Winkler
Add convenient wrapper for ordinal duration computation to remove boiler plate if else statement over TPM2. if (chip->flags & TPM_CHIP_FLAG_TPM2) tpm2_calc_ordinal_duration(chip, ordinal); else tpm1_calc_ordinal_duration(chip, ordinal); Signed-off-by: Tomas Winkler Revi

[PATCH v7 00/21] tpm: separate tpm 1.x and tpm 2.x commands

2018-10-19 Thread Tomas Winkler
x27;s platforms. V6: 1. Dropping tpm: move pcr extend code to tpm2-cmd.c and rebasing code over that change 2. Trivial fixes in kdoc and header V7: 1. Add backportable patch for nuvoton duration calculation 2. Rebase durations patches over it. 3. Fix notorious typo tmp->tpm Tomas

[PATCH v7 04/21] tpm: factor out tpm 1.x duration calculation to tpm1-cmd.c

2018-10-19 Thread Tomas Winkler
Factor out TPM 1.x commands calculation into tpm1-cmd.c file. and change the prefix from tpm_ to tpm1_. No functional change is done here. Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen --- V2-V3: Rebase V4: 1. Remove the licence statement it's already covered by SPDX. 2. Add

[PATCH v7 06/21] tpm: factor out tpm_get_timeouts()

2018-10-19 Thread Tomas Winkler
Factor out tpm_get_timeouts() into tpm2_get_timeouts() and tpm1_get_timeouts() Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V2-V3: Rebase V4: Fix the commit message. V5: Resend. V6: Remove tpm1_auto_startup() declaration. V7: Resend. drivers/char

[PATCH v7 09/21] tpm: factor out tpm1_get_random into tpm1-cmd.c

2018-10-19 Thread Tomas Winkler
Factor out get random implementation from tpm-interface.c into tpm1_get_random function in tpm1-cmd.c. No functional changes. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkine --- V2-V3: Rebase V4-V7: Resend drivers/char/tpm/tpm-interface.c | 58

[PATCH v7 10/21] tpm: move tpm 1.x selftest code from tpm-interface.c tpm1-cmd.c

2018-10-19 Thread Tomas Winkler
Move the tpm1 selftest code functions to tpm1-cmd.c and adjust callers to use the new function names. 1. tpm_pcr_read_dev() to tpm1_pcr_read_dev(). 2. tpm_continue_selftest() to tpm1_continue_selftest(). 3. tpm_do_selftest() to tpm1_do_selftest() Signed-off-by: Tomas Winkler Tested-by: Jarkko

[PATCH v7 08/21] tpm: move tpm_getcap to tpm1-cmd.c

2018-10-19 Thread Tomas Winkler
used [-Wunused-const-variable=] static const struct tpm_input_header tpm_getcap_header = { ^ 3. Drop unused TPM_DIGEST_SIZE. It's already defined in include/linux/tpm.h Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Test

[PATCH v7 07/21] tpm: move tpm1_pcr_extend to tpm1-cmd.c

2018-10-19 Thread Tomas Winkler
struct tpm_input_header pcrextend_header = { ^~~~ Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Reviewed-by: Nayna Jain Tested-by: Nayna Jain --- V2-V3: Rebase V4: Remove defines. V5: Resend V6: Add Tested-by: V7: Resend. drivers

[PATCH v7 01/21] tpm: tpm_i2c_nuvoton: use correct command duration for TPM 2.x

2018-10-19 Thread Tomas Winkler
tpm_i2c_nuvoton calculated commands duration using TPM 1.x values via tpm_calc_ordinal_duration() also for TPM 2.x chips. Call tpm2_calc_ordinal_duration() for retrieving ordinal duration for TPM 2.X chips. Cc: sta...@vger.kernel.org Cc: Nayna Jain Signed-off-by: Tomas Winkler Reviewed-by

[PATCH v7 15/21] tpm: tpm-space.c remove unneeded semicolon

2018-10-19 Thread Tomas Winkler
Remove unneeded semicolon in tpm2_map_response_header() Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V3: New in the series. V4-V7: Resend. drivers/char/tpm/tpm2-space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-space.c b/drivers

[PATCH v7 19/21] tpm1: reimplement SAVESTATE using tpm_buf

2018-10-19 Thread Tomas Winkler
In tpm1_pm_suspend() function reimplement, TPM_ORD_SAVESTATE comamnd using tpm_buf. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4-V7: Resend drivers/char/tpm/tpm1-cmd.c | 22 -- 1 file changed, 12

[PATCH v7 18/21] tpm1: rename tpm1_pcr_read_dev to tpm1_pcr_read()

2018-10-19 Thread Tomas Winkler
Rename tpm1_pcr_read_dev to tpm1_pcr_read() to match the counterpart tpm2_pcr_read(). Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V4: New in the series V5: Resend. V6: Resend. V7: Fix typo tmp->tpm drivers/char/tpm/tpm-interface.c | 2 +- drivers/char/tpm/tpm-sysfs.c

[PATCH v7 16/21] tpm: tpm1: rewrite tpm1_get_random() using tpm_buf structure

2018-10-19 Thread Tomas Winkler
1. Use tpm_buf in tpm1_get_random() 2. Fix comment in tpm_get_random() so it is clear that the function is expected to return number of random bytes. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4: Resend. V5: A small

[PATCH v7 12/21] tpm: factor out tpm_startup function

2018-10-19 Thread Tomas Winkler
TPM manual startup is used only from within TPM 1.x or TPM 2.x code, hence remove tpm_startup() function from tpm-interface.c and add two static functions implementations tpm1_startup() and tpm2_startup() into to tpm1-cmd.c and tpm2-cmd.c respectively. Signed-off-by: Tomas Winkler Tested-by

[PATCH v7 14/21] tpm: tpm-interface.c drop unused macros

2018-10-19 Thread Tomas Winkler
t;TSC_MAX_ORDINAL" is not used [-Wunused-macros] tpm-interface.c:38:0: warning: macro "TPM_CONNECTION_COMMAND" is not used [-Wunused-macros] Fixes: f72864300139 ("tpm_tis: further simplify calculation of ordinal duration") Signed-off-by: Tomas Winkler Reviewed-by: Jarkk

[PATCH v7 17/21] tpm1: implement tpm1_pcr_read_dev() using tpm_buf structure

2018-10-19 Thread Tomas Winkler
Implement tpm1_pcr_read_dev() using tpm_buf and remove now unneeded structures from tpm.h Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4-V7: Resend. drivers/char/tpm/tpm.h | 18 ++ drivers/char/tpm/tpm1

[PATCH v7 11/21] tpm: factor out tpm 1.x pm suspend flow into tpm1-cmd.c

2018-10-19 Thread Tomas Winkler
Factor out TPM 1.x suspend flow from tpm-interface.c into a new function tpm1_pm_suspend() in tpm1-cmd.c Signed-off-by: Tomas Winkler --- V2-V3: Rebase. V4: 1. Add kdoc for tpm1_pm_suspend(). 2. Fix commit message. V5: Adjust the kdoc to the new standard. V6: Rebase. V7: Resend. drivers

[PATCH v7 13/21] tpm: add tpm_auto_startup() into tpm-interface.c

2018-10-19 Thread Tomas Winkler
Add wrapper tpm_auto_startup() to tpm-interface.c instead of open coded decision between TPM 1.x and TPM 2.x in tpm-chip.c Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen --- V3: New in the series. V4: Fix the commit message. V5-7: Resend. drivers/char/tpm/tpm-chip.c | 11

[PATCH v7 21/21] tpm: use u32 instead of int for PCR index

2018-10-19 Thread Tomas Winkler
PCR related functions. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V3: New in the series. V4: Separate unrelated change to another patches. V5: Fix the commit message. V6: Rebased. V7: Resend. drivers/char/tpm/tpm-interface.c| 6 +++--- drivers/char/tpm/tpm-sysfs.c

[PATCH v7 20/21] tpm1: reimplement tpm1_continue_selftest() using tpm_buf

2018-10-19 Thread Tomas Winkler
Reimplement tpm1_continue_selftest() using tpm_buf structure. This is the last command using the old tpm_cmd_t structure and now the structure can be removed. Cc: Nayna Jain Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V3: New in the series. V4

[PATCH v7 02/21] tpm2: add new tpm2 commands according to TCG 1.36

2018-10-19 Thread Tomas Winkler
kdoc comments for tpm2_calc_ordinal_duration(). Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen --- V2-V3: Rebase. V4: 1. Fix kdoc 2. Rename tpm2_ordinal_duration() to tpm2_ordinal_duration_index() 3. Move the two functions close to each other in the file. V5: Adjust the kdoc to

[PATCH v7 03/21] tpm: sort objects in the Makefile

2018-10-19 Thread Tomas Winkler
Make the tpm Makefile a bit more in order by putting objects in one column. Signed-off-by: Tomas Winkler Tested-by: Jarkko Sakkinen Reviewed-by: Jarkko Sakkinen --- V2: 1. back to tpm-y notation 2. Partially sort files alphanumerically. V3: Rebase V4: Remove redunant sentence in commit

[PATCH v3 00/20] tpm: separate tpm 1.x and tpm 2.x commands

2018-09-18 Thread Tomas Winkler
x27;s platforms. Tomas Winkler (20): tpm2: add new tpm2 commands according to TCG 1.36 tpm: sort objects in the Makefile tpm: factor out tpm 1.x duration calculation to tpm1-cmd.c tpm: add tpm_calc_ordinal_duration wrapper tpm: factor out tpm_get_timeouts tpm: move tpm1_pcr_extend to

[PATCH v3 18/20] tpm: use u32 instead of int for pcr index

2018-09-18 Thread Tomas Winkler
tpm1_pcr_extend() function. Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm-interface.c| 4 ++-- drivers/char/tpm/tpm-sysfs.c| 4 ++-- drivers/char/tpm/tpm.h | 10 +- drivers/char/tpm/tpm1-cmd.c | 14 ++ drivers/char/tpm

[PATCH v3 05/20] tpm: factor out tpm_get_timeouts

2018-09-18 Thread Tomas Winkler
Factor out tpm_get_timeouts into tpm2_get_timeouts and tpm1_get_timeouts. Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers/char/tpm/tpm-interface.c | 127 ++- drivers/char/tpm/tpm.h | 5 +- drivers/char/tpm/tpm1-cmd.c | 106

[PATCH v3 20/20] tpm1: reimplement tpm1_continue_selftest() using tpm_buf

2018-09-18 Thread Tomas Winkler
Reimplement tpm1_continue_selftest() using tpm_buf structure. This is the last command using the old tpm_cmd_t structure and now the structure can be removed. Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm.h | 9 - drivers/char/tpm/tpm1-cmd.c | 16

[PATCH v3 09/20] tpm: move tpm1 selftest code from tpm-interface tpm1-cmd.c

2018-09-18 Thread Tomas Winkler
Move the tpm1 selftest code functions to tpm1-cmd.c and adjust callers to use the new function names. 1. tpm_pcr_read_dev to tpm1_pcr_read_dev 2. tpm_continue_selftest to tpm1_continue_selftest 3. tpm_do_selftest to tpm1_do_selftest Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers

[PATCH v3 03/20] tpm: factor out tpm 1.x duration calculation to tpm1-cmd.c

2018-09-18 Thread Tomas Winkler
Factor out tpm 1.x commands calculation into tpm1-cmd.c file. and change the prefix from tpm_ to tpm1_. No functional change is done here. Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers/char/tpm/Makefile| 1 + drivers/char/tpm/st33zp24/st33zp24.c | 2 +- drivers/char/tpm

[PATCH v3 02/20] tpm: sort objects in the Makefile

2018-09-18 Thread Tomas Winkler
Make the tpm Makefile a bit more in order by putting objects in one column and group together tpm2 modules Signed-off-by: Tomas Winkler --- V2: 1. back to tpm-y notation 2. Partially sort files alphanumerically. V3: Rebase drivers/char/tpm/Makefile | 15 --- 1 file changed, 12

[PATCH v3 16/20] tpm: tpm1: rewrite tpm1_get_random() using tpm_buf structure

2018-09-18 Thread Tomas Winkler
1. Use tpm_buf in tpm1_get_random() 2. Fix comment in tpm_get_random() so it is clear that the function is expected to return number of random bytes. Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm-interface.c | 2 +- drivers/char/tpm/tpm.h | 11

[PATCH v3 15/20] tpm: tpm-space.c remove unneeded semicolon

2018-09-18 Thread Tomas Winkler
Remove unneeded semicolon in tpm2_map_response_header() Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm2-space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm2-space.c b/drivers/char/tpm/tpm2-space.c index d2e101b32482

[PATCH v3 01/20] tpm2: add new tpm2 commands according to TCG 1.36

2018-09-18 Thread Tomas Winkler
1. TPM2_CC_LAST has moved from 182 to 193 2. Convert tpm2_ordinal_duration from an array into a switch statement, as there are not so many commands that require special duration relative to a number of commands. Signed-off-by: Tomas Winkler --- V2-V3: Rebase. drivers/char/tpm/tpm.h

[PATCH v3 19/20] tpm1: reimplement SAVESTATE using tpm_buf

2018-09-18 Thread Tomas Winkler
In tpm1_pm_suspend() function reimplement, TPM_ORD_SAVESTATE comamnd using tpm_buf. Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm1-cmd.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/char/tpm/tpm1-cmd.c b

[PATCH v3 17/20] tpm1: implement tpm1_pcr_read_dev() using tpm_buf structure

2018-09-18 Thread Tomas Winkler
Implement tpm1_pcr_read_dev() using tpm_buf and remove now unneeded structures from tpm.h Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm.h | 18 ++ drivers/char/tpm/tpm1-cmd.c | 38 +- 2 files changed, 23

[PATCH v3 04/20] tpm: add tpm_calc_ordinal_duration wrapper

2018-09-18 Thread Tomas Winkler
Add convenient wrapper for ordinal duration computation to remove boiler plate if else statement over TPM2. if (chip->flags & TPM_CHIP_FLAG_TPM2) tpm2_calc_ordinal_duration(chip, ordinal); else tpm1_calc_ordinal_duration(chip, ordinal); Signed-off-by: Tomas Winkler --

[PATCH v3 14/20] tpm: tpm-interface.c drop unused macros

2018-09-18 Thread Tomas Winkler
The code movement left some macros unused. Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm-interface.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index a8f8e0bcb434..358ef5bd601e 100644

[PATCH v3 07/20] tpm: move tpm_getcap to tpm1-cmd.c

2018-09-18 Thread Tomas Winkler
used [-Wunused-const-variable=] static const struct tpm_input_header tpm_getcap_header = { ^ 3. Drop unused TPM_DIGEST_SIZE. It's already defined in include/linux/tpm.h Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers/char/tp

[PATCH v3 12/20] tpm: move pcr extend code to tpm2-cmd.c

2018-09-18 Thread Tomas Winkler
Add tpm2_pcr_extend() function to tpm2-cmd.c with signature required by tpm-interface.c. It wraps the original open code implementation. The original original tpm2_pcr_extend() function is renamed and made static, called only from new tpm2_pcr_extend() Signed-off-by: Tomas Winkler --- V3: fix

[PATCH v3 10/20] tpm: factor out tpm1 pm suspend flow into tpm1-cmd.c

2018-09-18 Thread Tomas Winkler
Factor out tpm1 suspend flow from tpm-interface.c into a new function tpm1_pm_suspend in tpm1-cmd.c Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers/char/tpm/tpm-interface.c | 55 drivers/char/tpm/tpm.h | 1 + drivers/char/tpm/tpm1-cmd.c

[PATCH v3 06/20] tpm: move tpm1_pcr_extend to tpm1-cmd.c

2018-09-18 Thread Tomas Winkler
= { ^~~~ Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers/char/tpm/tpm-interface.c | 28 drivers/char/tpm/tpm.h | 2 ++ drivers/char/tpm/tpm1-cmd.c | 22 ++ 3 files changed, 24 insertions(+), 28 deletions

[PATCH v3 11/20] tpm: factor out tpm_startup function

2018-09-18 Thread Tomas Winkler
tpm manual startup is used only from within tpm1 or tpm2 code, hence remove tpm_startup function from tpm-interface.c and add two static functions implementations tpm1_startup and tpm2_startup into to tpm1-cmd.c and tpm2-cmd.c respectively. Signed-off-by: Tomas Winkler --- V2-V3: Rebase

[PATCH v3 08/20] tpm: factor out tpm1_get_random into tpm1-cmd.c

2018-09-18 Thread Tomas Winkler
Factor out get random implementation from tpm-interface.c into tpm1_get_random function in tpm1-cmd.c. No functional changes. Signed-off-by: Tomas Winkler --- V2-V3: Rebase drivers/char/tpm/tpm-interface.c | 58 +--- drivers/char/tpm/tpm.h | 1

[PATCH v3 13/20] tpm: add tpm_auto_startup into tpm-interface

2018-09-18 Thread Tomas Winkler
Add wrapper tpm_auto_startup() to tpm-interface.c instead of open coded decision between tpm 1.2 and tpm 2.0 in tpm-chip.c Signed-off-by: Tomas Winkler --- V3: new in the series drivers/char/tpm/tpm-chip.c | 11 +++ drivers/char/tpm/tpm-interface.c | 15 +++ drivers

[char-misc-next] mei: use uuid, me_addr tuple addressing also for flow control credits

2014-12-07 Thread Tomas Winkler
to address the clients Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index fb04bfbef9fe..9541218c10eb 100644 --- a/drivers/misc/mei/client.c +++ b/drivers

[char-misc 3.19] mei: clean reset bit before reset

2014-12-24 Thread Tomas Winkler
ff-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/hw-me.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index ff2755062b44..06ff0a2ec960 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw

[char-misc 1/2 3.19] mei: mask interrupt set bit on clean reset bit

2015-01-25 Thread Tomas Winkler
From: Alexander Usyskin We should mask interrupt set bit when writing back hcsr value in reset bit clean-up. This is refinement for mei: clean reset bit before reset commit b13a65ef190e488e2761d65bdd2e1fe8a3a125f5 Cc: #3.10+ Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler

[char-misc 2/2 3.19] mei: me: release hw from reset only during the reset flow

2015-01-25 Thread Tomas Winkler
: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/hw-me.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/mei/hw-me.c b/drivers/misc/mei/hw-me.c index ccc1b405ca21..f8fd503dfbd6 100644 --- a/drivers/misc/mei/hw-me.c +++ b/drivers/misc/mei/hw

[char-misc-next V3] mei: add reference counting for me clients

2015-01-10 Thread Tomas Winkler
To support dynamic addition and removal of me clients we add reference counter. Update kdoc with locking requirements. Signed-off-by: Tomas Winkler --- V2: add locking requirements to kdoc V3: fix warning: 'cb/me_cl' may be used uninitialized in this function drivers/misc/mei/amthi

[char-misc-next 04/11 V2] mei: revamp client disconnection flow

2015-04-05 Thread Tomas Winkler
mei_cl_set_disconneted() function. Add mei_cl_send_disconnect to reduce code duplication. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: fix the conflict drivers/misc/mei/bus.c | 2 - drivers/misc/mei/client.c| 158 +-- drivers

[char-misc-next 7/8 RESEND] mei: drop iamthif_mtu from device structure

2015-04-05 Thread Tomas Winkler
From: Alexander Usyskin We can receive mtu with one call now, no need to store it. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/amthif.c | 9 + drivers/misc/mei/mei_dev.h | 2 -- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a

[char-misc-next 8/8 RESEND] mei: txe: fix incorrect indentation

2015-04-05 Thread Tomas Winkler
Remove spurious blank Signed-off-by: Tomas Winkler --- drivers/misc/mei/pci-txe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mei/pci-txe.c b/drivers/misc/mei/pci-txe.c index dcfcba44b6f7..0882c0201907 100644 --- a/drivers/misc/mei/pci-txe.c +++ b/drivers

[char-misc-next 5/8 RESEND] mei: support for fixed address clients

2015-04-05 Thread Tomas Winkler
Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c| 69 ++-- drivers/misc/mei/client.h| 12 drivers/misc/mei/hbm.c | 4 +-- drivers/misc/mei/interrupt.c | 2 +- 4 files changed, 68 inserti

[char-misc-next 2/8 RESEND] mei: revamp client connection

2015-04-05 Thread Tomas Winkler
Simplify connect state machine by changing the logic around Connection request in progress - only check if we have a callback in relevant queue. Extract common code into mei_cl_send_connect() function Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/bus.c

[char-misc-next 6/8 RESEND] mei: connection to fixed address clients from user-space

2015-04-05 Thread Tomas Winkler
From: Alexander Usyskin This should be used for debug only. The feaure is gated by "allow_fixed_address" control exposed in debugfs. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/debugfs.c | 6 ++ drivers/misc/mei/main.c| 8 +++- dr

[char-misc-next 4/8 RESEND] mei: fix flow control for single buffer clients

2015-04-05 Thread Tomas Winkler
-by: Tomas Winkler --- drivers/misc/mei/client.c | 29 +++-- drivers/misc/mei/mei_dev.h | 4 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index a8a3b9d15231..3475200c3850 100644 --- a/drivers

[char-misc-next 1/8 RESEND] mei: revamp client disconnection flow

2015-04-05 Thread Tomas Winkler
mei_cl_set_disconneted() function. Add mei_cl_send_disconnect to reduce code duplication. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/bus.c | 2 - drivers/misc/mei/client.c| 158 +-- drivers/misc/mei/client.h

[char-misc-next 3/8 RESEND] mei: add a reference from the host client to the me client

2015-04-05 Thread Tomas Winkler
-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/amthif.c| 19 ++- drivers/misc/mei/bus.c | 27 +++--- drivers/misc/mei/client.c| 118 +++ drivers/misc/mei/client.h| 84

<    1   2   3   4   5   6   7   8   9   10   >