Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management

2016-06-14 Thread Tomas Winkler
On Wed, Jun 8, 2016 at 2:02 AM, Jarkko Sakkinen wrote: > The register TPM_CRB_CTRL_REQ_0 contains bits goIdle and cmdReady for > invoking the chip to suspend and resume. This commit implements runtime > PM for tpm_crb by using these bits. > > The legacy ACPI start (SMI + DMA) based devices do not

Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management

2016-06-16 Thread Tomas Winkler
On Thu, Jun 16, 2016 at 10:57 PM, Jarkko Sakkinen wrote: > Hi Thomas, > > I'm on a vacation this week but I'll give you quick answers :) > > On Tue, Jun 14, 2016 at 04:14:58PM +0300, Tomas Winkler wrote: >> On Wed, Jun 8, 2016 at 2:02 AM, Jarkko Sakkin

[tpmdd-devel] [PATCH 0/3] tpm/tpm_crb: implement power management.

2016-09-07 Thread Tomas Winkler
the series: 'Small fixes and cleanups for tpm_crb' Tomas Winkler (3): tpm/tpm_crb: implement tpm crb idle state tmp/tpm_crb: fix Intel PTT hw bug during idle state tpm/tpm_crb: cache cmd_size register value. drivers/char/tpm/tpm-interface.c | 21 +++ drivers/char/tpm

[tpmdd-devel] [PATCH 1/3] tpm/tpm_crb: implement tpm crb idle state

2016-09-07 Thread Tomas Winkler
ned-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 21 +++ drivers/char/tpm/tpm_crb.c | 77 include/linux/tpm.h | 3 +- 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-interface.c b/dr

[tpmdd-devel] [PATCH 2/3] tmp/tpm_crb: fix Intel PTT hw bug during idle state

2016-09-07 Thread Tomas Winkler
registers. The fix brings device to ready state before trying to read command and response buffer addresses in order to remap the for access. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 37 +++-- 1 file changed, 27 insertions(+), 10 deletions

[tpmdd-devel] [PATCH 3/3] tpm/tpm_crb: cache cmd_size register value.

2016-09-07 Thread Tomas Winkler
Instead of expensive register access on retrieving cmd_size on each send, save the value during initialization in the private context. The value doesn't change. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)

[tpmdd-devel] [PATCH] tpm/tpm_tis: remove unsingd itpm varaible

2016-09-07 Thread Tomas Winkler
Fixes the warning: drivers/char/tpm/tpm_tis_core.c:443:7: warning: variable ‘itpm’ set but not used [-Wunused-but-set-variable] bool itpm; ^~~~ Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_tis_core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/char/tpm

[tpmdd-devel] [PATCH v2] tpm/tpm_tis: remove unused itpm variable

2016-09-07 Thread Tomas Winkler
Fixes the warning: drivers/char/tpm/tpm_tis_core.c:443:7: warning: variable ‘itpm’ set but not used [-Wunused-but-set-variable] bool itpm; ^~~~ Signed-off-by: Tomas Winkler --- V2: fix typos in the subject drivers/char/tpm/tpm_tis_core.c | 5 - 1 file changed, 5 deletions(-) diff

[tpmdd-devel] [PATCH 1/1] tpm/tpm-dev: fix broken style in copy_from_user

2016-09-11 Thread Tomas Winkler
Straighten unneeded line brake and drop useless cast to void. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-dev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm-dev.c b/drivers/char/tpm/tpm-dev.c index 912ad30be585..9782df406345 100644 --- a

[tpmdd-devel] [PATCH 0/4] tmp/tpm_crb: cleanups

2016-09-11 Thread Tomas Winkler
A set of cleanup patches, w/o any significant functional change. Tomas Winkler (4): tmp/tpm_crb: drop include to platform_device tpm/tpm_crb: cache cmd_size register value. tpm/tpm_crb: drop useless cpu_to_le32 when writing to registers tpm/tpm_crb: fix the over 80 characters checkpatch

[tpmdd-devel] [PATCH 4/4] tpm/tpm_crb: fix the over 80 characters checkpatch warring

2016-09-11 Thread Tomas Winkler
resource\n"); Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 0c9989d0106e..6e9d1bca712f 100644 --- a/drivers/char/tpm/tpm_crb.c +++ b/drivers/char/tpm/tpm_

[tpmdd-devel] [PATCH 2/4 v2] tpm/tpm_crb: cache cmd_size register value.

2016-09-11 Thread Tomas Winkler
Instead of expensive register access on retrieving cmd_size on each send, save the value during initialization in the private context. The value doesn't change. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen --- V2: rebased drivers/char/tpm/tpm_

[tpmdd-devel] [PATCH 1/4] tmp/tpm_crb: drop include to platform_device

2016-09-11 Thread Tomas Winkler
The platform device is not used in this driver, drop the include to linux/platform_device.h Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index 82a3ccd52a3a..6a4b32599869

[tpmdd-devel] [PATCH 3/4] tpm/tpm_crb: drop useless cpu_to_le32 when writing to registers

2016-09-11 Thread Tomas Winkler
Don't apply endianity conversion when writing to the registers this is already handled by the system. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c

[tpmdd-devel] [PATCH v2 4/4] tmp/tpm_crb: implement runtime pm for tpm_crb

2016-09-12 Thread Tomas Winkler
will be in ready state. Signed-off-by: Tomas Winkler --- V2 new in the series drivers/char/tpm/tpm-interface.c | 5 + drivers/char/tpm/tpm_crb.c | 37 ++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm-interface.c b

[tpmdd-devel] [PATCH v2 3/4] tpm/tpm_crb: open code the crb_init into acpi_add

2016-09-12 Thread Tomas Winkler
This is preparation step for implementing tpm crb runtime pm. We need to have tpm chip allocated and populated before we access the runtime handlers. Signed-off-by: Tomas Winkler --- V2: new in the series drivers/char/tpm/tpm_crb.c | 26 ++ 1 file changed, 10 insertions

[tpmdd-devel] [PATCH 0/4 V2] tpm/tpm_crb: implement power management.

2016-09-12 Thread Tomas Winkler
states. Tomas Winkler (4): tpm/tpm_crb: implement tpm crb idle state tmp/tpm_crb: fix Intel PTT hw bug during idle state tpm/tpm_crb: open code the crb_init into acpi_add tmp/tpm_crb: implment runtime pm for tpm_crb drivers/char/tpm/tpm-interface.c | 5 ++ drivers/char/tpm/tpm_crb.c

[tpmdd-devel] [PATCH v2 1/4] tpm/tpm_crb: implement tpm crb idle state

2016-09-12 Thread Tomas Winkler
functionality only is enabled only for a CRB start (MMIO) based devices. Based on Jarkko Sakkinen oringal patch: 'tpm_crb: implement power tpm crb power management' Signed-off-by: Tomas Winkler --- V2: do not export the functions via tpm ops drivers/char/tpm/tpm_

[tpmdd-devel] [PATCH v2 2/4] tmp/tpm_crb: fix Intel PTT hw bug during idle state

2016-09-12 Thread Tomas Winkler
. The fix brings device to ready state before trying to read command and response buffer addresses in order to remap the for access. Signed-off-by: Tomas Winkler --- V2: cmd read need to be called also before crb_init as this will run self test. drivers/char/tpm/tpm_crb.c | 47

[tpmdd-devel] [PATCH v3 0/4] tpm/tpm_crb: implement power management.

2016-09-12 Thread Tomas Winkler
states. V3. fix lower case corruption in the first patch Tomas Winkler (4): tpm/tpm_crb: implement tpm crb idle state tmp/tpm_crb: fix Intel PTT hw bug during idle state tpm/tpm_crb: open code the crb_init into acpi_add tmp/tpm_crb: implment runtime pm for tpm_crb drivers/char/tpm/tpm

[tpmdd-devel] [PATCH v4 4/4] tmp/tpm_crb: implement runtime pm for tpm_crb

2016-09-12 Thread Tomas Winkler
will be in ready state. Signed-off-by: Tomas Winkler --- V2: new in the series V3: resend drivers/char/tpm/tpm-interface.c | 5 + drivers/char/tpm/tpm_crb.c | 37 ++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/drivers/char/tpm/tpm

[tpmdd-devel] [PATCH v3 3/4] tpm/tpm_crb: open code the crb_init into acpi_add

2016-09-12 Thread Tomas Winkler
This is preparation step for implementing tpm crb runtime pm. We need to have tpm chip allocated and populated before we access the runtime handlers. Signed-off-by: Tomas Winkler --- V2: new in the series V3: resend drivers/char/tpm/tpm_crb.c | 26 ++ 1 file changed, 10

[tpmdd-devel] [PATCH v3 2/4] tmp/tpm_crb: fix Intel PTT hw bug during idle state

2016-09-12 Thread Tomas Winkler
. The fix brings device to ready state before trying to read command and response buffer addresses in order to remap the for access. Signed-off-by: Tomas Winkler --- V2: cmd read need to be called also before crb_init as this will run self test. V3: resend. drivers/char/tpm/tpm_crb.c | 47

[tpmdd-devel] [PATCH v3 1/4] tpm/tpm_crb: implement tpm crb idle state

2016-09-12 Thread Tomas Winkler
functionality only is enabled only for a CRB start (MMIO) based devices. Based on Jarkko Sakkinen oringal patch: 'tpm_crb: implement power tpm crb power management' Signed-off-by: Tomas Winkler --- V2: do not export the functions via tpm ops V3: fix lower case corruption; adjust function doc

[tpmdd-devel] [PATCH 0/3] tpm/tpm_crb: implement power management.

2016-09-12 Thread Tomas Winkler
the series: 'Small fixes and cleanups for tpm_crb' Tomas Winkler (3): tpm/tpm_crb: implement tpm crb idle state tmp/tpm_crb: fix Intel PTT hw bug during idle state tpm/tpm_crb: cache cmd_size register value. drivers/char/tpm/tpm-interface.c | 21 +++ drivers/char/tpm

[tpmdd-devel] [PATCH 1/3] tpm/tpm_crb: implement tpm crb idle state

2016-09-12 Thread Tomas Winkler
ned-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 21 +++ drivers/char/tpm/tpm_crb.c | 77 include/linux/tpm.h | 3 +- 3 files changed, 100 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-interface.c b/dr

[tpmdd-devel] [PATCH 2/3] tmp/tpm_crb: fix Intel PTT hw bug during idle state

2016-09-12 Thread Tomas Winkler
registers. The fix brings device to ready state before trying to read command and response buffer addresses in order to remap the for access. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 37 +++-- 1 file changed, 27 insertions(+), 10 deletions

[tpmdd-devel] [PATCH 3/3] tpm/tpm_crb: cache cmd_size register value.

2016-09-12 Thread Tomas Winkler
Instead of expensive register access on retrieving cmd_size on each send, save the value during initialization in the private context. The value doesn't change. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-)

[tpmdd-devel] [PATCH v4 1/4] tpm/tpm_crb: implement tpm crb idle state

2016-09-15 Thread Tomas Winkler
functionality only is enabled only for a CRB start (MMIO) based devices. Based on Jarkko Sakkinen original patch: 'tpm_crb: implement power tpm crb power management' To keep the implementation local to the hw we don't use wait_for_tpm_stat for polling the TPM_CRB_CTRL_REQ. Signed-off-by

[tpmdd-devel] [PATCH] tpm: don't destroy chip device prematurely

2016-10-02 Thread Tomas Winkler
e parent device while it still in use. Fixes: 20e0152393b41 ("tpm: fix crash in tpm_tis deinitialization") Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-chip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tp

[tpmdd-devel] [PATCH] tpm/tpm_crb: revamp starting method setting.

2016-10-05 Thread Tomas Winkler
Encapsulate the start method parsing in a single function and add needed debug printouts. It eliminates small issue with useless double checking for ACPI_TPM2_MEMORY_MAPPED. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 65 +++--- 1 file

[tpmdd-devel] [PATCH 3/4] tpm/tpm_crb: open code the crb_init into acpi_add

2016-10-08 Thread Tomas Winkler
From: "Winkler, Tomas" This is preparation step for implementing tpm crb runtime pm. We need to have tpm chip allocated and populated before we access the runtime handlers. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- V2: new in the

[tpmdd-devel] [PATCH 2/4] tmp/tpm_crb: fix Intel PTT hw bug during idle state

2016-10-08 Thread Tomas Winkler
eady state before accessing the other registers. The fix brings device to ready state before trying to read command and response buffer addresses in order to remap the for access. Signed-off-by: Tomas Winkler --- V2: cmd read need to be called also before crb_init as this will run self test. V3: resen

[tpmdd-devel] [PATCH v4 0/4] tpm/tpm_crb: implement power management.

2016-10-08 Thread Tomas Winkler
states. V3. fix lower case corruption in the first patch V4. Fix unbalanced runtime pm get and put Tomas Winkler (4): tpm/tpm_crb: implement tpm crb idle state tmp/tpm_crb: fix Intel PTT hw bug during idle state tpm/tpm_crb: open code the crb_init into acpi_add tmp/tpm_crb: implement

[tpmdd-devel] [PATCH 4/4] tmp/tpm_crb: implement runtime pm for tpm_crb

2016-10-08 Thread Tomas Winkler
amework is not compiled in or enabled, the device will be in the permanent ready state. Signed-off-by: Tomas Winkler --- V2: new in the series V3: resend V4: fix unbalanced runtime pm put and get drivers/char/tpm/tpm-interface.c | 5 + drivers/char/tpm/tpm_crb.c

[tpmdd-devel] [PATCH v4 1/4] tpm/tpm_crb: implement tpm crb idle state

2016-10-08 Thread Tomas Winkler
TPM_CRB_CTRL_REQ. Signed-off-by: Tomas Winkler Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen --- V2: do not export the functions via tpm ops V3: fix lower case corruption; adjust function documentation V4: resend drivers/char/tpm/tpm_crb.c | 70 +

[tpmdd-devel] [PATCH] tmp: use pdev for parent device in tpm_chip_alloc

2016-10-08 Thread Tomas Winkler
The tpm stack uses pdev name convention for the parent device. Fix that also in tpm_chip_alloc(). Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")' Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-chip.c | 8 1 file changed, 4 insertions(

[tpmdd-devel] [PATCH 2/2] tpm/tpm2-chip: fix kdoc errors

2016-10-31 Thread Tomas Winkler
Use correct kdoc format, describe correct parameters and return values. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm2-cmd.c | 107 +++- 1 file changed, 66 insertions(+), 41 deletions(-) diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm

[tpmdd-devel] [PATCH 0/2] tpm: fix few kdoc error

2016-10-31 Thread Tomas Winkler
Tomas Winkler (2): tpm/tpm-interface: place kdoc just above tpm_pcr_extend tpm/tpm2-chip: fix kdoc errors drivers/char/tpm/tpm-interface.c | 16 +++--- drivers/char/tpm/tpm2-cmd.c | 107 --- 2 files changed, 74 insertions(+), 49 deletions

[tpmdd-devel] [PATCH 1/2] tpm/tpm-interface: place kdoc just above tpm_pcr_extend

2016-10-31 Thread Tomas Winkler
Place kdoc just above tpm_pcr_extend so it can be parsed correctly. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c index

[tpmdd-devel] [PATCH 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd

2016-11-16 Thread Tomas Winkler
Functions tpm_transmit and transmit_cmd are referenced from other functions kdoc hence deserve documentation. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers/char/tpm

[tpmdd-devel] [PATCH 4/4] tpm/vtpm: fix kdoc warnings

2016-11-16 Thread Tomas Winkler
Use corret kdoc format for function description and eliminate warning of type: tpm_ibmvtpm.c:66: warning: No description found for parameter 'count' Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_ibmvtpm.c| 51 +++ driver

[tpmdd-devel] [PATCH 3/4 v2] tmp: use pdev for parent device in tpm_chip_alloc

2016-11-16 Thread Tomas Winkler
The tpm stack uses pdev name convention for the parent device. Fix that also in tpm_chip_alloc(). Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")' Signed-off-by: Tomas Winkler --- Resend. drivers/char/tpm/tpm-chip.c | 8 1 file changed, 4 i

[tpmdd-devel] [PATCH 2/4 v2] tpm/tpm2-chip: fix kdoc errors

2016-11-16 Thread Tomas Winkler
Use correct kdoc format, describe correct parameters and return values. Signed-off-by: Tomas Winkler --- V2: rework and rebase of tpm_transmit_cmd kdoc fix drivers/char/tpm/tpm2-cmd.c | 104 1 file changed, 57 insertions(+), 47 deletions(-) diff

[tpmdd-devel] [PATCH v2 2/4] tpm/tpm2-chip: fix kdoc errors

2016-11-23 Thread Tomas Winkler
Use correct kdoc format, describe correct parameters and return values. Signed-off-by: Tomas Winkler --- V2: Add missing '.' drivers/char/tpm/tpm2-cmd.c | 105 1 file changed, 57 insertions(+), 48 deletions(-) diff --git a/drivers/cha

[tpmdd-devel] [PATCH v2 3/4] tmp: use pdev for parent device in tpm_chip_alloc

2016-11-23 Thread Tomas Winkler
The tpm stack uses pdev name convention for the parent device. Fix that also in tpm_chip_alloc(). Fixes: 3897cd9c8d1d ("tpm: Split out the devm stuff from tpmm_chip_alloc")' Signed-off-by: Tomas Winkler --- V2: resend drivers/char/tpm/tpm-chip.c | 8 1 file changed, 4 i

[tpmdd-devel] [PATCH v2 0/4] tpm: kdoc cleanup

2016-11-23 Thread Tomas Winkler
Cleanup tpm in-code documentation. Tomas Winkler (4): tpm: add kdoc for tpm_transmit and tpm_transmit_cmd tpm/tpm2-chip: fix kdoc errors tmp: use pdev for parent device in tpm_chip_alloc tpm/vtpm: fix kdoc warnings drivers/char/tpm/tpm-chip.c | 8 +-- drivers/char/tpm/tpm

[tpmdd-devel] [PATCH v2 4/4] tpm/vtpm: fix kdoc warnings

2016-11-23 Thread Tomas Winkler
Use corret kdoc format for function description and eliminate warning of type: tpm_ibmvtpm.c:66: warning: No description found for parameter 'count' Signed-off-by: Tomas Winkler --- V2: more fixes drivers/char/tpm/tpm_ibmvtpm.c| 106 -- driver

[tpmdd-devel] [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd

2016-11-23 Thread Tomas Winkler
Functions tpm_transmit and transmit_cmd are referenced from other functions kdoc hence deserve documentation. Signed-off-by: Tomas Winkler --- V2: Add some missing '.' drivers/char/tpm/tpm-interface.c | 33 - 1 file changed, 28 insertions(+), 5 deletion

[tpmdd-devel] [PATCH] tpm: use get_unaligned_be32 unaligned buffer access.

2016-11-23 Thread Tomas Winkler
Use get_unaligned_be32 as b32_to_cpu doesn't work correctly on all platforms for unaligned access. The fix doesn't cover all the cases as also some cast structures have members on unaligned addresses. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm-interface.c| 4 ++-- dr

[tpmdd-devel] [PATCH] tpm/tpm_crb: enter the low power state upon device suspend

2017-03-05 Thread Tomas Winkler
leave the device in low power state. Symmetrically cmdReady is called upon resume. Signed-off-by: Tomas Winkler --- drivers/char/tpm/tpm_crb.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c index