mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Peter Hüwe" <PeterHuewe@gmx.de>
To: tpmdd-devel@lists.sourceforge.net
Cc: Kent Yoder <key@linux.vnet.ibm.com>,
	Peter Huewe <peter.huewe@infineon.com>,
	linux-security-module@vger.kernel.org, shpedoikal@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [tpmdd-devel] [PATCH v2] tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C)
Date: Mon, 4 Mar 2013 20:54:16 +0100	[thread overview]
Message-ID: <201303042054.16849.PeterHuewe@gmx.de> (raw)
In-Reply-To: <20130304174104.GA10811@ennui.austin.ibm.com>

Hi Kent,

short reply from my private account - so only talking on behalf of myself.

Am Montag, 4. März 2013, 18:41:04 schrieb Kent Yoder:
> Hi Peter,
> 
>   Sorry for the long delay in getting this reviewed...
No problem.

> 
> > -	for (count = 0; count < MAX_COUNT; count++) {
> > -		usleep_range(SLEEP_DURATION_LOW, SLEEP_DURATION_HI);
> > -		rc = __i2c_transfer(tpm_dev.client->adapter, &msg2, 1);
> > -		if (rc > 0)
> > -			break;
> > +	if (tpm_dev.chip_type == SLB9645) {
> > +		/* use a combined read for newer chips
> > +		 * unfortunately the smbus functions are not suitable due to
> > +		 * the 32 byte limit of the smbus.
> > +		 * retries should usually not be needed, but are kept just to
> > +		 * be on the safe side.
> > +		*/
> 
>   Bump out that last line of comment by a column.

You mean I should add 1 space - okay, no problem.
(and I'm nitty picky.... ;) *g*


> > 
> >  	if (rc <= 0)
> >  	
> >  		return -EIO;
> 
>  This confused me for a second, but I see __i2c_transfer returns the number
> of messages transferred. Maybe worth adding a comment.

Maybe I can add one - I'll think about it.


> > 
> > +
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id tpm_tis_i2c_of_match[] = {
> > +	{ .compatible = "infineon,tpm_i2c_infineon", .data = (void *)0 },
> > +	{ .compatible = "infineon,slb9635tt", .data = (void *)0 },
> > +	{ .compatible = "infineon,slb9645tt", .data = (void *)1 },
> 
>   Here "name" and "type" are left empty in of_device_id. Will there be
> times when those are needed? Like informational messages from the OF
> subsystem?

Hmm, what do you propose?
name = chip type ? or name = tpm_i2c_infineon?
type = tpm ?



> > 
> > +		   .of_match_table = of_match_ptr(tpm_tis_i2c_of_match),
> 
>   Please put this line inside an ifdef CONFIG_OF, since of_match_ptr
> lives in there.
NACK.
of.h has already the ifdef CONFIG_OF for of_match_ptr and defines it either as 

#define of_match_ptr(_ptr)      (_ptr)
or
#define of_match_ptr(_ptr)      NULL
depending on CONFIG_OF is set.



>   Won't you also need to add OF to Kconfig?
Not really, as the only stuff we're using is the compatible id - the driver can 
live without it and can be probed from userspace or plain old platform data.
I probably have compile tested it with and without CONFIG_OF.


Is it worth a v3?
 or a small update patch which adds the of name/type and the space? (I can 
create this patch immediately)


Thanks,
Peter




  parent reply	other threads:[~2013-03-04 19:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 14:41 Peter Huewe
     [not found] ` <20130304174104.GA10811@ennui.austin.ibm.com>
2013-03-04 18:59   ` [tpmdd-devel] " Jason Gunthorpe
2013-03-04 19:54   ` Peter Hüwe [this message]
2013-03-04 20:08     ` Kent Yoder
2013-03-04 20:16       ` Kent Yoder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201303042054.16849.PeterHuewe@gmx.de \
    --to=peterhuewe@gmx.de \
    --cc=key@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=peter.huewe@infineon.com \
    --cc=shpedoikal@gmail.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®