mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Kylene Jo Hall <kjhall@us.ibm.com>
Cc: linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net
Subject: Re: [PATCH] tpm: Add force device probe option
Date: Wed, 12 Jul 2006 18:43:53 -0700	[thread overview]
Message-ID: <20060712184353.48cbf49c.akpm@osdl.org> (raw)
In-Reply-To: <1152738273.5347.37.camel@localhost.localdomain>

On Wed, 12 Jul 2006 14:04:33 -0700
Kylene Jo Hall <kjhall@us.ibm.com> wrote:

> Some machine manufacturers are not sticking to the TCG specifications
> and including an ACPI DSDT entry for the TPM which allows PNP discovery
> of the device.

Well that sucks.

>  This patch adds a force option that will allow users to
> load the driver if they know there machine has a chip but it is not
> being discovered by the normal processes.
> 

>  
> +static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev,
> +				      const struct pnp_device_id *pnp_id)
> +{
> +	unsigned long start, len;
> +	start = pnp_mem_start(pnp_dev, 0);
> +	len = pnp_mem_len(pnp_dev, 0);

All these starts, ends and lens are now wrong - they should be changed to
resource_size_t.  But there's no rush on that - please add it to the todo
list.

> +static int force = 0;

The `= 0' here is unneeded.  It's also undesirable, since it adds to the size
of vmlinux on-disk.

> +module_param(force, bool, 0444);
> +MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
>  static int __init init_tis(void)
>  {
> +	int rc;
> +
> +	if (force) {
> +		driver_register(&tis_drv);

driver_register() can fail and the driver should check for and handle the
failure.

This mistake happens literally thousands of times and we're trying to fix
it up at present.  An updated patch would be appreciated, please.

> -	pnp_unregister_driver(&tis_pnp_driver);
> +	if (force) {
> +		platform_device_unregister(pdev);
> +		driver_unregister(&tis_drv);
> +	}
> +	else 

	} else



  reply	other threads:[~2006-07-13  1:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-12 21:04 Kylene Jo Hall
2006-07-13  1:43 ` Andrew Morton [this message]
2006-07-13 19:24   ` Kylene Jo Hall

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=20060712184353.48cbf49c.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=kjhall@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --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®