public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: matthieu castet <castet.matthieu@free.fr>
To: Marcel Selhorst <selhorst@crypto.rub.de>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	Kylene Jo Hall <kjhall@us.ibm.com>
Subject: Re: [PATCH] Infineon TPM: move infineon driver off pci_dev
Date: Thu, 27 Oct 2005 23:42:15 +0200	[thread overview]
Message-ID: <436149B7.8080202@free.fr> (raw)
In-Reply-To: <4360B889.1010502@crypto.rub.de>

Hi,

Marcel Selhorst wrote:
 > Dear all,
 >
 > the following patch moves the Infineon TPM driver off pci device
 > and makes it a pure pnp-driver. It was tested with IFX0101 and
 > IFX0102 and is now based on the new tpm patchset (1 to 5) from Kylene
 > Hall submitted two days ago. It now also includes pnp-port validation
 > and region requesting.
 >
 > Best regards,
 >
 > Marcel Selhorst
 >
 > Signed-off-by: Marcel Selhorst <selhorst@crypto.rub.de>
 > ---
 >

 > +	/* read IO-ports through PnP */
 > +	if (pnp_port_valid(dev, 0) && pnp_port_valid(dev, 1) &&
 > +	    !(pnp_port_flags(dev, 0) & IORESOURCE_DISABLED)) {
&& !(pnp_port_flags(dev, 1) & IORESOURCE_DISABLED)

 > +		TPM_INF_ADDR = pnp_port_start(dev, 0);
 > +		TPM_INF_DATA = (TPM_INF_ADDR + 1);
 > +		TPM_INF_BASE = pnp_port_start(dev, 1);
 > +		TPM_INF_PORT_LEN = pnp_port_len(dev, 1);
 > +		if (!TPM_INF_PORT_LEN)
 > +			return -EINVAL;
When I said to check the lenght I was thinking about
if (pnp_port_len(dev, 1) < 4) return -EINVAL;
According to infineon_tpm_register, the length is at least 4.

I whould also check that pnp_port_len(dev, 0) < 2.





 > +		dev_info(&dev->dev, "Found %s with ID %s\n",
 > +			 dev->name, dev_id->id);
 > +		if (!((TPM_INF_BASE >> 8) & 0xff))
 > +			return -EINVAL;
 > +		/* publish my base address and request region */
 > +		tpm_inf.base = TPM_INF_BASE;
 > +		if (request_region
 > +		    (tpm_inf.base, TPM_INF_PORT_LEN, "tpm_infineon0") == NULL) {
 > +			release_region(tpm_inf.base, TPM_INF_PORT_LEN);
if it failed, you don't need to release the region

a request_region (TPM_INF_ADDR, 2, "tpm_infineon0") could be usefull.

 > +			return -EINVAL;
 > +		}
 >  	} else {


      parent reply	other threads:[~2005-10-27 21:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-26 17:11 [PATCH] Infineon TPM: move infineon driver off pci_dev Marcel Selhorst
2005-10-26 17:23 ` Kylene Jo Hall
2005-10-26 17:41 ` matthieu castet
2005-10-26 19:53   ` Marcel Selhorst
2005-10-27 11:22   ` Marcel Selhorst
2005-10-27 14:07     ` Kylene Jo Hall
2005-10-27 21:55       ` Andrew Morton
2005-10-27 22:03         ` Roland Dreier
2005-10-27 22:26           ` Andrew Morton
2005-10-28 14:22             ` Kylene Jo Hall
2005-11-11 20:11         ` [PATCH] TPM: cleanups Kylene Jo Hall
2005-11-11 23:08           ` Kylene Jo Hall
2005-11-12 21:48             ` Andrew Morton
2005-11-16 22:48               ` Kylene Jo Hall
2005-10-27 21:33     ` [PATCH] Infineon TPM: move infineon driver off pci_dev Andrew Morton
2005-10-28  5:23       ` Marcel Selhorst
2005-10-27 21:42     ` matthieu castet [this message]

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=436149B7.8080202@free.fr \
    --to=castet.matthieu@free.fr \
    --cc=akpm@osdl.org \
    --cc=kjhall@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=selhorst@crypto.rub.de \
    /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