[char-misc-next 2/5] mei: keep the device awake during reads in chunks

2015-10-13 Thread Tomas Winkler
. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/interrupt.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index c418d7888994..64b568a0268d 100644 --- a/drivers/misc/mei/interrupt.c +++ b

[char-misc-next V3] mei: Fix debugfs filename in error output

2015-10-25 Thread Tomas Winkler
From: Alexander Kuleshov Signed-off-by: Alexander Kuleshov Signed-off-by: Tomas Winkler --- V2: fixed author address V3: resend drivers/misc/mei/debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c index

[char-misc-next] mei: ignore not found client in the enumeration

2018-08-06 Thread Tomas Winkler
0010 Cc: Reported-by: Heiner Kallweit Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/hbm.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index f15d44bda28e

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

2018-06-24 Thread Tomas Winkler
spend/resume. This patch cannot be really separated from the locality fix. Fixes: 888d867df441 (tpm: cmd_ready command can be issued 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:

[char-misc-next 1/2] mei: add optional timeout to internal bus recv

2018-06-24 Thread Tomas Winkler
From: Alexander Usyskin Add optional timeout to internal bus recv function to enable break out of internal flows in case of no answer from FW. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus-fixup.c | 2 +- drivers/misc/mei/bus.c | 36

[char-misc-next 2/2] mei: expose fw version to sysfs

2018-06-24 Thread Tomas Winkler
different FW components. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- Documentation/ABI/testing/sysfs-class-mei | 11 drivers/misc/mei/bus-fixup.c | 86 --- drivers/misc/mei/main.c | 30 ++- drivers/misc/mei

[char-misc for 4.9 2/2] mei: bus: need to unlink client before freeing

2018-08-27 Thread Tomas Winkler
/0x80 pci_device_shutdown+0x34/0x60 kernel_restart+0x0e/0x30 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200455 Fixes: 'c110cdb17148 ("mei: bus: make a client pointer always available")' Cc: 4.10+ Tested-by: Georg Müller Signed-off-by: Tomas Winkler --- drivers/misc/m

[char-misc for 4.19 0/2] mei: fix suspend/hibernation regression

2018-08-27 Thread Tomas Winkler
currently only happens on platforms with AMT watchdog enabled that systemd holds. Both patches bellow should be applied. Tomas Winkler (2): mei: bus: fix hw module get/put balance mei: bus: need to unlink client before freeing drivers/misc/mei/bus.c | 12 +--- 1 file changed, 5

[char-misc for 4.9 1/2] mei: bus: fix hw module get/put balance

2018-08-27 Thread Tomas Winkler
200455 Tested-by: Georg Müller Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 7bba62a72921..13c6c9a2248a 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bu

Re: Fwd: PROBLEM: tpm_cpg can't request region with AMD/Dell fTPM

2018-08-11 Thread Tomas Winkler
On Sat, Aug 11, 2018 at 12:45 AM Jarkko Sakkinen wrote: > > On Fri, Aug 10, 2018 at 07:57:35PM +0300, Jarkko Sakkinen wrote: > > On Tue, Aug 07, 2018 at 02:43:10PM -0400, Harlan Lieberman-Berg wrote: > > > (Resending as it seems to have been spamfiltered out from the ml; > > > sorry Peter, Jarkko

[char-misc for 4.19] mei: fix use-after-free in mei_cl_write

2018-08-22 Thread Tomas Winkler
ire re-reading buf->size either), so the fix is to simply revert the change, and return len, as before. Fixes: 98e70866aacb ("mei: add support for variable length mei headers.") CC: Arnd Bergmann CC: Greg Kroah-Hartman Signed-off-by: John Hubbard Signed-off-by: Tomas Winkler --- V2

[char-misc-next 00/12] mei: Add DMA ring

2018-07-30 Thread Tomas Winkler
that fits into the HW ring while a packet that would require fragmentation is faster to send via the DMA ring. Alexander Usyskin (3): mei: define dma ring buffer sizes for PCH12 HW and newer mei: bump hbm version to 2.1 mei: me: mark CNP devices as having dma support Tomas Winkler (9): mei

[char-misc-next 03/12] mei: hbm: introduce dma bit in the message header

2018-07-30 Thread Tomas Winkler
Add dma_ring bit in the mei message header for conveying that the message data itself are on the dma ring. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/client.c | 1 + drivers/misc/mei/hbm.c | 1 + drivers/misc/mei/hw.h | 16

[char-misc-next 06/12] mei: dma ring buffers allocation

2018-07-30 Thread Tomas Winkler
Allocate DMA ring buffers from managed coherent memory. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/Makefile | 1 + drivers/misc/mei/dma-ring.c | 103 drivers/misc/mei/hw-me.c| 6 +++ drivers/misc/mei

[char-misc-next 01/12] mei: add support for variable length mei headers.

2018-07-30 Thread Tomas Winkler
mei_data2slots() converts data length directly to the slots. Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c| 31 ++- drivers/misc/mei/hbm.c | 30 ++ drivers/misc/mei/hw-me.c | 34

[char-misc-next 02/12] mei: hbm: define dma ring setup protocol

2018-07-30 Thread Tomas Winkler
finally a Control block where the pointers for the both circular buffers are managed. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/hw.h | 49 + 1 file changed, 49 insertions(+) diff --git a/drivers/misc/mei

[char-misc-next 09/12] mei: dma ring: implement rx circular buffer logic

2018-07-30 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 | 63

[char-misc-next 04/12] mei: restrict dma ring support to hbm version 2.1

2018-07-30 Thread Tomas Winkler
Only a firmware with version 2.1 and above supports dma ring feature. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/debugfs.c | 2 ++ drivers/misc/mei/hbm.c | 6 ++ drivers/misc/mei/hw.h | 6 ++ drivers/misc/mei/mei_dev.h | 2 ++ 4 files

[char-misc-next 10/12] mei: dma ring: implement transmit flow

2018-07-30 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 | 56 ++-- drivers/misc/mei/dma-ring.c | 91

[char-misc-next 07/12] mei: hbm: setup dma ring

2018-07-30 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 08/12] mei: hw: add dma ring control block

2018-07-30 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 | 21 + drivers/misc/mei/hbm.c | 2 ++ drivers/misc/mei/hw.h | 23

[char-misc-next 11/12] mei: bump hbm version to 2.1

2018-07-30 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 12/12] mei: me: mark CNP devices as having dma support

2018-07-30 Thread Tomas Winkler
From: Alexander Usyskin Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/pci-me.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index ea4e152270a3..73ace2d59dea 100644 --- a

[char-misc-next 05/12] mei: define dma ring buffer sizes for PCH12 HW and newer

2018-07-30 Thread Tomas Winkler
From: Alexander Usyskin Define dma ring buffer sizes for PCH12 (CLN HW and newer) Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/hw-me.c | 13 + drivers/misc/mei/hw-me.h | 4 2 files changed, 17 insertions(+) diff --git a/drivers/misc

[char-misc-next 2/3] mei: move hbuf_depth from the mei device to the hw modules

2018-07-23 Thread Tomas Winkler
The host buffer depth is hardware specific so it's better to handle it inside the me and txe hw modules. In me the depth is read from register in txe it's a constant number. The value is now retrieved via mei_hbuf_depth accessor, while it replaces mei_hbuf_max_len. Signed-off-by: Tom

[char-misc-next 1/3] mei: cleanup slots to data conversions

2018-07-23 Thread Tomas Winkler
Cleanup conversions between slots and data. Define MEI_SLOT_SIZE instead of using 4 or sizeof(u32) across the source code. Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 2 +- drivers/misc/mei/hw-me.c | 8 drivers/misc/mei/hw-txe.c | 8 drivers/misc/mei

[char-misc-next 3/3] mei: add mei_msg_hdr_init wrapper.

2018-07-23 Thread Tomas Winkler
Wrap the mei header boilerplate initialization code in mei_msg_hdr_init function. On the way remove 'completed' field from mei_cl_cb structure as this information is already included in the header and is local to particular fragment. Signed-off-by: Tomas Winkler --- drivers/misc/me

[char-misc-next 3/3] mei: fix ssize_t to int assignment in read and write ops.

2018-07-12 Thread Tomas Winkler
: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 22 +++--- drivers/misc/mei/client.h | 2 +- drivers/misc/mei/main.c | 10 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff

[char-misc-next 2/3] mei: use correct type for counter variable in for loops

2018-07-12 Thread Tomas Winkler
expressions [-Wsign-compare] drivers/misc/mei/hw-txe.c:744:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus-fixup.c | 2 +- drivers/misc/mei/hw-me.c | 2 +- drivers/misc/mei/hw-txe.c| 2 +- 3 files

[char-misc-next 1/3] mei: check for error returned from mei_hbuf_empty_slots()

2018-07-12 Thread Tomas Winkler
st in comparison to suppress singn-compare warning. Reported-by: Dan Carpenter Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c| 22 -- drivers/misc/mei/hw-me.c | 5 - drivers/misc/mei/hw-txe.c| 2 +- drivers/misc/mei/interrupt.c | 15 +++ 4

[char-misc-next 0/3] mei: more type conversion issues.

2018-07-12 Thread Tomas Winkler
Add more type conversion issues. The first one in also address the type promotion bug, as reported by Dan Carpenter. The particular error should not really happen unless something is completely wrong, so no urge to merging them into stable. Tomas Winkler (3): mei: check for error returned from

[char-misc-next] mei: bus: suppress sign-compare warnings

2018-07-15 Thread Tomas Winkler
("mei: bus: type promotion bug in mei_fwver()") Now it is possible to suppress the warning, by adding proper casting to move out of radar. Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus-fixup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mi

[PATCH 2/3] tpm: separate cmd_ready/go_idle from runtime_pm

2018-01-23 Thread Tomas Winkler
citly. This patch exposes cmd_read/go_idle via tpm class ops and removes runtime pm support as it is not used by any driver. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 15 ++--- drivers/char/tpm/tpm_crb.c | 69 +--- include/

[PATCH 1/3] tpm: cmd_ready command can be issued only after granting locality

2018-01-23 Thread Tomas Winkler
idle handshake has completed, this requires that go_idle has to poll for the completion. The issue is only visible on devices that support multiple localities. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 12 ++--- drivers/char/tpm/tpm_crb.c

[PATCH 3/3] tpm: add longer timeouts for creation commands.

2018-01-23 Thread Tomas Winkler
TPM2_CC_Create(0x153) and TPM2_CC_CreatePrimary (0x131) involve generation of crypto keys which can be a computationally intensive task. The timeout is set to 3min. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 4 drivers/char/tpm/tpm.h | 27

[PATCH 0/2] tpm: fix locality and power saving handling

2018-01-27 Thread Tomas Winkler
goIdle and locality relinquish. The second patch removes cmdRead/goIdle handshake from runtime_pm as it's rather a part of TPM2 protocol then true device power management, and on device it's no longer optional. Tomas Winkler (2): tpm: cmd_ready command can be issued only after grantin

[PATCH 1/2 v2] tpm: cmd_ready command can be issued only after granting locality

2018-01-27 Thread Tomas Winkler
idle handshake has completed, this requires that go_idle has to poll for the completion and as well locality relinquish has to poll for completion so it is not overrriden in back to back commands flow. The issue is only visible on devices that support multiple localities. Signed-off-by: Tomas Wi

[PATCH 2/2 v2] tpm: separate cmd_ready/go_idle from runtime_pm

2018-01-27 Thread Tomas Winkler
citly. This patch exposes cmd_read/go_idle via tpm class ops and removes runtime pm support as it is not used by any driver. Signed-off-by: Tomas Winkler --- V2: resent drivers/char/tpm/tpm-interface.c | 15 ++--- drivers/char/tpm/tpm_crb.c

[PATCH v2] tpm: add longer timeouts for creation commands.

2018-01-28 Thread Tomas Winkler
TPM2_CC_Create(0x153) and TPM2_CC_CreatePrimary (0x131) involve generation of crypto keys which can be a computationally intensive task. The timeout is set to 3min. Signed-off-by: Tomas Winkler --- V2: resent drivers/char/tpm/tpm-interface.c | 4 drivers/char/tpm/tpm.h | 27

[5/5 V3] tpm: factor out tpm_get_timeouts

2018-03-09 Thread Tomas Winkler
Factor out tpm_get_timeouts into tpm2_get_timeouts and tpm1_get_timeouts. Signed-off-by: Tomas Winkler --- V2: Rebase V3: 1. Fix typo tmp->tpm 2. Fix sparse WARNING: line over 80 characters drivers/char/tpm/tpm-interface.c | 127 ++- drivers/char/

[PATCH v2 8/8] tpm: move tpm2 code validation to tpm2-space.c

2018-03-10 Thread Tomas Winkler
Add new function tpm2_validate_command to tpm2-space.c that wraps up open coded functionality from tpm_validate_command. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 31 ++- drivers/char/tpm/tpm.h | 1 + drivers/char/tpm/tpm2-cmd.c

[PATCH v2 6/8] tpm: factor out tpm_startup function

2018-03-10 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 --- drivers/char/tpm/tpm

[PATCH v2 1/8] tpm: move tpm1_pcr_extend to tpm1-cmd.c

2018-03-10 Thread Tomas Winkler
Move tpm1_pcr_extend to tpm1-cmd.c and remove unused pcrextend_header structure. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 28 drivers/char/tpm/tpm.h | 2 ++ drivers/char/tpm/tpm1-cmd.c | 23 +++ 3 files

[PATCH v2 4/8] tpm: move tpm1 selftest code from tpm-interface tpm1-cmd.c

2018-03-10 Thread Tomas Winkler
Move the tmp1 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 --- drivers/char/tpm/st33zp24

[PATCH v2 5/8] tpm: factor out tpm1 pm suspend flow into tpm1-cmd.c

2018-03-10 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 --- drivers/char/tpm/tpm-interface.c | 55 drivers/char/tpm/tpm.h | 1 + drivers/char/tpm/tpm1-cmd.c | 54

[PATCH v2 2/8] tpm: move tpm_getcap to tpm1-cmd.c

2018-03-10 Thread Tomas Winkler
1. Move tpm_getcap to tpm1-cmd. Rename the function to tpm1_getcap. 2. Remove unused tpm_getcap_header with unused constant as this functionality is already implemented using tpm_buf construct. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 47

[PATCH v2 7/8] tpm: Move pcr extend to tpm2-cmd.c

2018-03-10 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 --- drivers/char

[PATCH v2 0/8] tpm: factor out tpm1 code into tpm1-cmd.c

2018-03-10 Thread Tomas Winkler
pletely 2. Fix notorious typo tmp -> tpm, in some patches Tomas Winkler (8): tpm: move tpm1_pcr_extend to tpm1-cmd.c tpm: move tpm_getcap to tpm1-cmd.c tpm: factor out tpm1_get_random into tpm1-cmd.c tpm: move tpm1 selftest code from tpm-interface tpm1-cmd.c tpm: factor out tpm1

[PATCH v2 3/8] tpm: factor out tpm1_get_random into tpm1-cmd.c

2018-03-10 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 --- drivers/char/tpm/tpm-interface.c | 56 drivers/char/tpm/tpm.h | 2 ++ drivers/char

[PATCH 3/5 V3] tpm2: add longer timeouts for creation commands.

2018-03-10 Thread Tomas Winkler
-by: Tomas Winkler --- V2: Add more explanation to the commit message. V3: Rename TPM_DURATION_MAX to TPM_NUM_DURATIONS. drivers/char/tpm/tpm-interface.c | 3 +++ drivers/char/tpm/tpm.h | 28 ++-- drivers/char/tpm/tpm2-cmd.c | 8 +--- 3 files changed, 26

[PATCH] tpm: add tpm_calc_ordinal_duration wrapper

2018-03-12 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 1/6] tpm: sort objects in the Makefile

2018-03-05 Thread Tomas Winkler
Make the tpm Makefile a bit more in order by putting objects in one column and group together tpm2 modules Prefer tpm-objs += instead of tpm-y += notation. Signed-off-by: Tomas Winkler --- drivers/char/tpm/Makefile | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff

[PATCH 6/6] tpm: tpm-interface: drop unused tpm_input_header headers.

2018-03-05 Thread Tomas Winkler
PRC extend and get capability were reimplemented using tpm_buf_ interface and the dangling tpm_input_headers can be dropped. together with now unused constants. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions

[PATCH 4/6] tpm2: add new tpm2 commands according to TCG 1.36

2018-03-05 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 --- drivers/char/tpm/tpm.h | 41

[PATCH 5/6] tmp: factor out tpm_get_timeouts

2018-03-05 Thread Tomas Winkler
Factor out tpm_get_timeouts into tpm2_get_timeouts and tpm1_get_timeouts. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 127 ++- drivers/char/tpm/tpm.h | 5 +- drivers/char/tpm/tpm1-cmd.c | 107

[PATCH 3/6] tpm2: add longer timeouts for creation commands.

2018-03-05 Thread Tomas Winkler
TPM2_CC_Create(0x153) and TPM2_CC_CreatePrimary (0x131) involve generation of crypto keys which can be a computationally intensive task. The timeout is set to 3min. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 3 +++ drivers/char/tpm/tpm.h | 28

[PATCH 2/6] tpm: factor out tpm 1.2 duration calculation to tpm1-cmd.c

2018-03-05 Thread Tomas Winkler
Factor out tpm1.2 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 --- drivers/char/tpm/Makefile| 1 + drivers/char/tpm/st33zp24/st33zp24.c | 2 +- drivers/char/tpm/tpm

[PATCH 0/6] tpm: timeouts revamp

2018-03-05 Thread Tomas Winkler
added, to not stall too long on regular commands failures. Second is to define timeouts for new tpm2 commands defined in TCG 1.36 spec. Last, is to factor out tpm1.2 commands out of tpm-interface.c Tomas Winkler (6): tpm: sort objects in the Makefile tpm: factor out tpm 1.2 duration calculation

[PATCH 5/5 V2] tmp: factor out tpm_get_timeouts

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

[PATCH 4/5 V2] tpm2: add new tpm2 commands according to TCG 1.36

2018-03-06 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: Rebase. drivers/char/tpm/tpm.h

[PATCH 2/5 V2] tpm: factor out tpm 1.2 duration calculation to tpm1-cmd.c

2018-03-06 Thread Tomas Winkler
Factor out tpm1.2 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: Rebase. drivers/char/tpm/Makefile| 1 + drivers/char/tpm/st33zp24/st33zp24.c | 2 +- drivers/char/tpm

[PATCH 0/5 V2] tpm: timeouts revamp

2018-03-06 Thread Tomas Winkler
added, to not stall too long on regular commands failures. Second is to define timeouts for new tpm2 commands defined in TCG 1.36 spec. Tomas Winkler (5): tpm: sort objects in the Makefile tpm: factor out tpm 1.2 duration calculation to tpm1-cmd.c tpm2: add longer timeouts for creation commands

[PATCH 3/5 V2] tpm2: add longer timeouts for creation commands.

2018-03-06 Thread Tomas Winkler
-by: Tomas Winkler --- V2: add more explanation to the commit message. drivers/char/tpm/tpm-interface.c | 3 +++ drivers/char/tpm/tpm.h | 28 ++-- drivers/char/tpm/tpm2-cmd.c | 8 +--- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a

[PATCH 1/5 V2] tpm: sort objects in the Makefile

2018-03-06 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. drivers/char/tpm/Makefile | 15 --- 1 file changed, 12 insertions

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

2018-03-06 Thread Tomas Winkler
Move the tmp1 selftest code functions to tpm1-cmd.c tpm_pcr_read_dev to tpm1_pcr_read_dev tpm_continue_selftest to tpm1_continue_selftest tpm_do_selftest to tpm1_do_selftest Signed-off-by: Tomas Winkler --- drivers/char/tpm/st33zp24/st33zp24.c | 2 +- drivers/char/tpm/tpm-interface.c

[PATCH 2/4] tmp: move tpm_getcap to tpm1-cmd.c

2018-03-06 Thread Tomas Winkler
1. Move tpm_getcap to tpm1-cmd. Rename the function to tpm1_getcap. 2. Remove unsed tpm_getcap_header with unused constant as the functionality is implemented using tpm_buf construct. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 47

[PATCH 3/4] tmp: factor out tpm1_get_random into tpm1-cmd.c

2018-03-06 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 --- drivers/char/tpm/tpm-interface.c | 56 drivers/char/tpm/tpm.h | 2 ++ drivers/char

[PATCH 0/4] tpm: factor out tpm1 code into tpm1-cmd.c

2018-03-06 Thread Tomas Winkler
Move tpm 1.x implementation to tpm1-cmd.c similarly to tpm2-cmd.c This is work in progress of possible dropping compiling out one tpm 1.x or tpm 2.x in case not needed on a target platform. Tomas Winkler (4): tmp: move tpm1_pcr_extend to tpm1-cmd.c tmp: move tpm_getcap to tpm1-cmd.c tmp

[PATCH 1/4] tmp: move tpm1_pcr_extend to tpm1-cmd.c

2018-03-06 Thread Tomas Winkler
Move tpm1_pcr_extend to tpm1-cmd.c and remove unused pcrextend_header structure. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 28 drivers/char/tpm/tpm.h | 2 ++ drivers/char/tpm/tpm1-cmd.c | 23 +++ 3 files

[PATCH V2] tpm_crb: use __le64 annotated variable for response buffer address

2018-03-06 Thread Tomas Winkler
use __le64 annotated variable for response buffer address as this is read in little endian format form the register. This suppresses sparse warning drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted __le64 Signed-off-by: Tomas Winkler --- V2: Add more info into the commit message

[PATCH] scsi: ufs: ufshcd_dump_regs to use memcpy_fromio

2018-03-06 Thread Tomas Winkler
/ufshcd.c:356:9:expected void const *buf drivers/scsi/ufs/ufshcd.c:356:9:got void [noderef] *mmio_base Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufs-qcom.c | 21 ++--- drivers/scsi/ufs/ufshcd.c | 35 --- drivers/scsi/ufs/ufshcd.h

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

2018-03-24 Thread Tomas Winkler
M2 protocol and should be called explicitly. This patch exposes cmd_read/go_idle via tpm class ops and removes runtime pm support as it is not used by any driver. tpm_crb no longer needs own power saving functions and can drop using tpm_pm_suspend/resume. Signed-off-by: Tomas Winkler --- V2-3:re

[PATCH] tpm: tpm_crb: relinquish locality on error path.

2018-04-07 Thread Tomas Winkler
: cmd_ready command can be issued only after granting locality) Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 7f78482cd157..34fbc6cb097b 100644

[char-misc] mei: replace POLL* with EPOLL* for write queues.

2018-09-28 Thread Tomas Winkler
05:30: warning: invalid assignment: |= drivers/misc/mei/main.c:605:30:left side has type restricted __poll_t drivers/misc/mei/main.c:605:30:right side has type int Cc: #v4.17+ Fixes: 'commit af336cabe083 ("mei: limit the number of queued writes")' Signed-off-by: Toma

[PATCH v5 06/21] tpm: move tpm1_pcr_extend to tpm1-cmd.c

2018-09-28 Thread Tomas Winkler
struct tpm_input_header pcrextend_header = { ^~~~ Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen --- V2-V3: Rebase V4: Remove defines. V5: Resend. drivers/char/tpm/tpm-interface.c | 28 drivers/char/tpm

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

2018-09-28 Thread Tomas Winkler
x27;s platforms. 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 calculation to tpm1-cmd.c tpm: add tpm_calc_ordinal_duration() wrapper tpm: factor out tpm_get_timeouts() tpm: move tpm1_pcr_exte

[PATCH v5 07/21] tpm: move tpm_getcap to tpm1-cmd.c

2018-09-28 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 v5 16/21] tpm: tpm1: rewrite tpm1_get_random() using tpm_buf structure

2018-09-28 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 v5 10/21] tpm: factor out tpm 1.x pm suspend flow into tpm1-cmd.c

2018-09-28 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. drivers/char/tpm/tpm-interface.c

[PATCH v5 01/21] tpm2: add new tpm2 commands according to TCG 1.36

2018-09-28 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 v5 15/21] tpm: tpm-space.c remove unneeded semicolon

2018-09-28 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-V5: 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

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

2018-09-28 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: Jarkko

[PATCH v5 02/21] tpm: sort objects in the Makefile

2018-09-28 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 v5 11/21] tpm: factor out tpm_startup function

2018-09-28 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 v5 20/21] tpm1: reimplement tpm1_continue_selftest() using tpm_buf

2018-09-28 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 v5 17/21] tpm1: implement tpm1_pcr_read_dev() using tpm_buf structure

2018-09-28 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-V5: Resend. drivers/char/tpm/tpm.h | 18 ++ drivers/char/tpm/tpm1

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

2018-09-28 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. drivers/char/tpm/tpm-interface.c| 6 +++--- drivers/char/tpm/tpm-sysfs.c| 2 +- drivers/char/tpm

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

2018-09-28 Thread Tomas Winkler
in __tpm2_pcr_extend() tpm2-cmd.c:251:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] tpm2-cmd.c:252:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Tomas Winkler --- V3: Fix the commit message. V4: 1

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

2018-09-28 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-V5: Resend drivers/char/tpm/tpm1-cmd.c | 22 -- 1 file changed, 12

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

2018-09-28 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: Resend. drivers/char/tpm/tpm-chip.c | 11

[PATCH v5 18/21] tmp1: rename tpm1_pcr_read_dev to tpm1_pcr_read().

2018-09-28 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. drivers/char/tpm/tpm-interface.c | 2 +- drivers/char/tpm/tpm-sysfs.c | 2 +- drivers/char/tpm/tpm.h

[PATCH v5 05/21] tpm: factor out tpm_get_timeouts()

2018-09-28 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. drivers/char/tpm/tpm-interface.c | 127

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

2018-09-28 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 v5 08/21] tpm: factor out tpm1_get_random into tpm1-cmd.c

2018-09-28 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-V5: Resend drivers/char/tpm/tpm-interface.c | 58

[PATCH v5 04/21] tpm: add tpm_calc_ordinal_duration() wrapper

2018-09-28 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 v5 03/21] tpm: factor out tpm 1.x duration calculation to tpm1-cmd.c

2018-09-28 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] scsi: ufs: add fall through annotation

2018-11-26 Thread Tomas Winkler
Add /* fallthrough */ annotation, to eliminate compilation warning: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[char-misc-next v2 0/7] mei: Add DMA ring

2018-11-22 Thread Tomas Winkler
://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html Alexander Usyskin (2): mei: bump hbm version to 2.1 mei: me: mark CNP devices as having dma support Tomas Winkler (5): mei: dma ring buffers allocation mei: hbm: setup dma ring mei: hw: add dma ring control block mei: dma ring

[char-misc-next v2 7/7] mei: me: mark CNP devices as having dma support

2018-11-22 Thread Tomas Winkler
From: Alexander Usyskin Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/pci-me.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mei/pci-me.c b/drivers/misc/mei/pci-me.c index ea4e152270a3..73ace2d59dea 100644 --- a

[char-misc-next v2 1/7] mei: dma ring buffers allocation

2018-11-22 Thread Tomas Winkler
Allocate DMA ring buffers from managed coherent memory. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/Makefile | 1 + drivers/misc/mei/dma-ring.c | 99 + drivers/misc/mei/hw-me.c| 6 +++ drivers/misc/mei/mei_dev.h

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