--- linux-2.6.23-rc1-mm1/drivers/char/tpm/tpm_tis.c.tis-pim1 2007-07-08 19:32:17.000000000 -0400 +++ linux-2.6.23-rc1-mm1/drivers/char/tpm/tpm_tis.c 2007-07-26 17:51:35.000000000 -0400 @@ -16,6 +16,7 @@ * published by the Free Software Foundation, version 2 of the * License. */ +#define DEBUG #include #include #include @@ -266,20 +267,25 @@ static int tpm_tis_send(struct tpm_chip size_t count = 0; u32 ordinal; +printk(KERN_DEBUG "in tpm_tis_send buffer=%llu len=%d\n",buf,len); if (request_locality(chip, 0) < 0) return -EBUSY; status = tpm_tis_status(chip); if ((status & TPM_STS_COMMAND_READY) == 0) { +printk(KERN_DEBUG "tis_send ready_for_command\n"); tpm_tis_ready(chip); +printk(KERN_DEBUG "tis_send wait for tis_ready\n"); if (wait_for_stat (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b, &chip->vendor.int_queue) < 0) { +printk(KERN_DEBUG "tis_send timed out waiting for command_ready\n"); rc = -ETIME; goto out_err; } } +printk(KERN_DEBUG "tis_send ready to go\n"); while (count < len - 1) { burstcnt = get_burstcount(chip); for (; burstcnt > 0 && count < len - 1; burstcnt--) { @@ -288,9 +294,12 @@ static int tpm_tis_send(struct tpm_chip count++; } +printk(KERN_DEBUG "tis_send after iowrite8 loop\n"); wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &chip->vendor.int_queue); +printk(KERN_DEBUG "tis_send after second wait_for_stat\n"); status = tpm_tis_status(chip); +printk(KERN_DEBUG "tis_send after second tis_status\n"); if ((status & TPM_STS_DATA_EXPECT) == 0) { rc = -EIO; goto out_err; @@ -301,9 +310,12 @@ static int tpm_tis_send(struct tpm_chip iowrite8(buf[count], chip->vendor.iobase + TPM_DATA_FIFO(chip->vendor.locality)); +printk(KERN_DEBUG "tis_send after last iowrite8\n"); wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &chip->vendor.int_queue); +printk(KERN_DEBUG "tis_send after 3rd wait_for_stat\n"); status = tpm_tis_status(chip); +printk(KERN_DEBUG "tis_send after 3rd tis_status\n"); if ((status & TPM_STS_DATA_EXPECT) != 0) { rc = -EIO; goto out_err; @@ -313,20 +325,26 @@ static int tpm_tis_send(struct tpm_chip iowrite8(TPM_STS_GO, chip->vendor.iobase + TPM_STS(chip->vendor.locality)); +printk(KERN_DEBUG "tis_send after STS_GO\n"); if (chip->vendor.irq) { ordinal = be32_to_cpu(*((__be32 *) (buf + 6))); +printk(KERN_DEBUG "tis_send before last wait_for_stat\n"); if (wait_for_stat (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID, tpm_calc_ordinal_duration(chip, ordinal), &chip->vendor.read_queue) < 0) { +printk(KERN_DEBUG "tis_send after last wait_for_stat\n"); rc = -ETIME; goto out_err; } } return len; out_err: +printk(KERN_DEBUG "tis_send before last tis_ready\n"); tpm_tis_ready(chip); +printk(KERN_DEBUG "tis_send after last tis_ready\n"); release_locality(chip, chip->vendor.locality, 0); +printk(KERN_DEBUG "tis_send after release_locality\n"); return rc; } @@ -595,9 +613,11 @@ static int __devinit tpm_tis_pnp_init(st const struct pnp_device_id *pnp_id) { resource_size_t start, len; + start = pnp_mem_start(pnp_dev, 0); len = pnp_mem_len(pnp_dev, 0); - + printk(KERN_DEBUG "tpm_tis_pnp_init: start=%llu, len=%llu\n", + (unsigned long long)start, (unsigned long long)len); return tpm_tis_init(&pnp_dev->dev, start, len); }