[tpmdd-devel] [PATCH v5 2/7] tpm: replace dynamically allocated bios_dir with a static array

2016-10-18 Thread Nayna Jain
From: Jarkko Sakkinen This commit is based on a commit by Nayna Jain. Replaced dynamically allocated bios_dir with a static array as the size is always constant. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain

[tpmdd-devel] [PATCH v5 5/7] tpm: redefine read_log() to handle ACPI/OF at runtime

2016-10-18 Thread Nayna Jain
Currently, read_log() has two implementations: one for ACPI platforms and the other for device tree(OF) based platforms. The proper one is selected at compile time using Kconfig and #ifdef in the Makefile, which is not the recommended approach. This patch removes the #ifdef in the Makefile by

[tpmdd-devel] [PATCH v5 6/7] tpm: replace of_find_node_by_name() with dev of_node property

2016-10-18 Thread Nayna Jain
Using the device of_node property is a better way to refer to the device tree node rather than of_find_node_by_name(). Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain Reviewed-by: Jarkko Sakkinen

[tpmdd-devel] [PATCH v5 1/7] tpm: define a generic open() method for ascii & bios measurements

2016-10-18 Thread Nayna Jain
open() method for event log ascii and binary bios measurements file operations are very similar. This patch refactors the code into a single open() call by passing seq_operations as i_node->private data. Suggested-by: Jason Gunthorpe Signed-off-by: Nayna Jain

[tpmdd-devel] [PATCH v5 3/7] tpm: drop tpm1_chip_register(/unregister)

2016-10-18 Thread Nayna Jain
From: Jarkko Sakkinen Check for TPM2 chip in tpm_sysfs_add_device, tpm_bios_log_setup and tpm_bios_log_teardown in order to make code flow cleaner and to enable to implement TPM 2.0 support later on. This is partially derived from the commit by Nayna Jain with

[tpmdd-devel] [PATCH v5 4/7] tpm: fix the race condition between event log access and chip getting unregistered

2016-10-18 Thread Nayna Jain
Currently, the event log file operations are not serialized with tpm_chip_unregister(), which can possibly cause a race condition. This patch fixes the race condition by: - moving read_log() from fops to chip register. - disallowing event log file operations when chip unregister is in

[tpmdd-devel] [PATCH v5 0/7] tpm: cleanup/fixes in existing event log support

2016-10-18 Thread Nayna Jain
This patch set includes the cleanup and bug fixes patches, previously part of the "tpm: add the securityfs pseudo files support for TPM 2.0 firmware event log" patch set, in order to upstream them more quickly. Changelog History v5: - Moved cleanup/fixes patches into this patch set. - Patch

Re: [tpmdd-devel] [PATCH v4 3/8] tpm: validate event log access before tpm_bios_log_setup

2016-10-18 Thread Nayna
On 10/14/2016 12:21 AM, Nayna wrote: > > > On 10/01/2016 05:31 PM, Jarkko Sakkinen wrote: >> On Wed, Sep 28, 2016 at 04:34:37AM -0400, Nayna Jain wrote: >>> Currently, the securityfs pseudo files for obtaining the firmware >>> event log are created whether the event log properties exist or not.