[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tpmdd-devel
Subject:    Re: [tpmdd-devel] [PATCH v3 4/7] tpm: Redefine the read_log method to check for ACPI/OF properties s
From:       Nayna <nayna () linux ! vnet ! ibm ! com>
Date:       2016-08-31 19:21:46
Message-ID: 57C72B7A.8040108 () linux ! vnet ! ibm ! com
[Download RAW message or body]



On 08/30/2016 11:24 PM, Jason Gunthorpe wrote:
> On Tue, Aug 30, 2016 at 12:50:16AM -0400, Nayna Jain wrote:
>> Currently, the difference in read_log method for ACPI/OF based platforms
>> is handled by defining respective read_log method and handing
>> them using CONFIG based #ifdef condition in Makefile which is not
>> the recommended approach.
>>
>> This patch cleans up the ifdef condition in Makefile by defining
>> single read_log method which checks for ACPI/OF event log memory in
>> sequence.
>>
>> Suggested-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
>> Signed-off-by: Nayna Jain <nayna@linux.vnet.ibm.com>
>
> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
>
> Yep, this is what I was looking to see..
>
>> +#if defined(CONFIG_ACPI)
>> +int read_log_acpi(struct tpm_chip *chip);
>> +#else
>> +static inline int read_log_acpi(struct tpm_chip *chip)
>> +{
>> +	return -1;
>> +}
>> +#endif
>> +
>> +#if defined(CONFIG_OF)
>> +int read_log_of(struct tpm_chip *chip);
>> +#else
>> +static inline int read_log_of(struct tpm_chip *chip)
>> +{
>> +	return -1;
>> +}
>> +#endif
>
> Though shouldn't these two be ERRNOs of some kind? -ENODEV?

Sure..
Was just trying to see possible errno. And here are some thoughts.


#define EPERM            1      /* Operation not permitted */
#define ENODEV          19      /* No such device */

Was thinking that since tpm device will still be present and its either 
ACPI or OF way of accessing its properties, and one of them will return 
this errno. So, assuming it is ACPI, that means no OF functions 
permitted. So, how about using EPERM ?

Please let me know if it doesn't sound correct.

Thanks & Regards,
Nayna

>
> Jason
>


------------------------------------------------------------------------------
_______________________________________________
tpmdd-devel mailing list
tpmdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic