Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'tpmdd-next-v5.8-rc4' of git://git.infradead.org/users/jjs/linux-tpmdd

Pull tpm fixes from Jarkko Sakkinen:
"These are just fixes for bugs found lately.

All of them are small scale things here and there, and all of them are
for previous kernel releases (the oldest appeared in v2.6.17)"

* tag 'tpmdd-next-v5.8-rc4' of git://git.infradead.org/users/jjs/linux-tpmdd:
tpm_tis: Remove the HID IFX0102
tpm_tis_spi: Prefer async probe
tpm: ibmvtpm: Wait for ready buffer before probing for TPM2 attributes
tpm/st33zp24: fix spelling mistake "drescription" -> "description"
tpm_tis: extra chip->ops check on error path in tpm_tis_core_init
tpm_tis_spi: Don't send anything during flow control
tpm: Fix TIS locality timeout problems

+26 -28
+1 -1
drivers/char/tpm/st33zp24/i2c.c
··· 210 210 211 211 /* 212 212 * st33zp24_i2c_probe initialize the TPM device 213 - * @param: client, the i2c_client drescription (TPM I2C description). 213 + * @param: client, the i2c_client description (TPM I2C description). 214 214 * @param: id, the i2c_device_id struct. 215 215 * @return: 0 in case of success. 216 216 * -1 in other case.
+2 -2
drivers/char/tpm/st33zp24/spi.c
··· 329 329 330 330 /* 331 331 * st33zp24_spi_probe initialize the TPM device 332 - * @param: dev, the spi_device drescription (TPM SPI description). 332 + * @param: dev, the spi_device description (TPM SPI description). 333 333 * @return: 0 in case of success. 334 334 * or a negative value describing the error. 335 335 */ ··· 378 378 379 379 /* 380 380 * st33zp24_spi_remove remove the TPM device 381 - * @param: client, the spi_device drescription (TPM SPI description). 381 + * @param: client, the spi_device description (TPM SPI description). 382 382 * @return: 0 in case of success. 383 383 */ 384 384 static int st33zp24_spi_remove(struct spi_device *dev)
+1 -1
drivers/char/tpm/st33zp24/st33zp24.c
··· 502 502 503 503 /* 504 504 * st33zp24_probe initialize the TPM device 505 - * @param: client, the i2c_client drescription (TPM I2C description). 505 + * @param: client, the i2c_client description (TPM I2C description). 506 506 * @param: id, the i2c_device_id struct. 507 507 * @return: 0 in case of success. 508 508 * -1 in other case.
+9 -10
drivers/char/tpm/tpm-dev-common.c
··· 189 189 goto out; 190 190 } 191 191 192 - /* atomic tpm command send and result receive. We only hold the ops 193 - * lock during this period so that the tpm can be unregistered even if 194 - * the char dev is held open. 195 - */ 196 - if (tpm_try_get_ops(priv->chip)) { 197 - ret = -EPIPE; 198 - goto out; 199 - } 200 - 201 192 priv->response_length = 0; 202 193 priv->response_read = false; 203 194 *off = 0; ··· 202 211 if (file->f_flags & O_NONBLOCK) { 203 212 priv->command_enqueued = true; 204 213 queue_work(tpm_dev_wq, &priv->async_work); 205 - tpm_put_ops(priv->chip); 206 214 mutex_unlock(&priv->buffer_mutex); 207 215 return size; 216 + } 217 + 218 + /* atomic tpm command send and result receive. We only hold the ops 219 + * lock during this period so that the tpm can be unregistered even if 220 + * the char dev is held open. 221 + */ 222 + if (tpm_try_get_ops(priv->chip)) { 223 + ret = -EPIPE; 224 + goto out; 208 225 } 209 226 210 227 ret = tpm_dev_transmit(priv->chip, priv->space, priv->data_buffer,
+7 -7
drivers/char/tpm/tpm_ibmvtpm.c
··· 683 683 if (rc) 684 684 goto init_irq_cleanup; 685 685 686 - if (!strcmp(id->compat, "IBM,vtpm20")) { 687 - chip->flags |= TPM_CHIP_FLAG_TPM2; 688 - rc = tpm2_get_cc_attrs_tbl(chip); 689 - if (rc) 690 - goto init_irq_cleanup; 691 - } 692 - 693 686 if (!wait_event_timeout(ibmvtpm->crq_queue.wq, 694 687 ibmvtpm->rtce_buf != NULL, 695 688 HZ)) { 696 689 dev_err(dev, "CRQ response timed out\n"); 697 690 goto init_irq_cleanup; 691 + } 692 + 693 + if (!strcmp(id->compat, "IBM,vtpm20")) { 694 + chip->flags |= TPM_CHIP_FLAG_TPM2; 695 + rc = tpm2_get_cc_attrs_tbl(chip); 696 + if (rc) 697 + goto init_irq_cleanup; 698 698 } 699 699 700 700 return tpm_chip_register(chip);
-1
drivers/char/tpm/tpm_tis.c
··· 238 238 static struct pnp_device_id tpm_pnp_tbl[] = { 239 239 {"PNP0C31", 0}, /* TPM */ 240 240 {"ATM1200", 0}, /* Atmel */ 241 - {"IFX0102", 0}, /* Infineon */ 242 241 {"BCM0101", 0}, /* Broadcom */ 243 242 {"BCM0102", 0}, /* Broadcom */ 244 243 {"NSC1200", 0}, /* National */
+1 -1
drivers/char/tpm/tpm_tis_core.c
··· 1085 1085 1086 1086 return 0; 1087 1087 out_err: 1088 - if ((chip->ops != NULL) && (chip->ops->clk_enable != NULL)) 1088 + if (chip->ops->clk_enable != NULL) 1089 1089 chip->ops->clk_enable(chip, false); 1090 1090 1091 1091 tpm_tis_remove(chip);
+5 -5
drivers/char/tpm/tpm_tis_spi_main.c
··· 53 53 54 54 if ((phy->iobuf[3] & 0x01) == 0) { 55 55 // handle SPI wait states 56 - phy->iobuf[0] = 0; 57 - 58 56 for (i = 0; i < TPM_RETRY; i++) { 59 57 spi_xfer->len = 1; 60 58 spi_message_init(&m); ··· 102 104 if (ret < 0) 103 105 goto exit; 104 106 107 + /* Flow control transfers are receive only */ 108 + spi_xfer.tx_buf = NULL; 105 109 ret = phy->flow_control(phy, &spi_xfer); 106 110 if (ret < 0) 107 111 goto exit; ··· 113 113 spi_xfer.delay.value = 5; 114 114 spi_xfer.delay.unit = SPI_DELAY_UNIT_USECS; 115 115 116 - if (in) { 117 - spi_xfer.tx_buf = NULL; 118 - } else if (out) { 116 + if (out) { 117 + spi_xfer.tx_buf = phy->iobuf; 119 118 spi_xfer.rx_buf = NULL; 120 119 memcpy(phy->iobuf, out, transfer_len); 121 120 out += transfer_len; ··· 287 288 .pm = &tpm_tis_pm, 288 289 .of_match_table = of_match_ptr(of_tis_spi_match), 289 290 .acpi_match_table = ACPI_PTR(acpi_tis_spi_match), 291 + .probe_type = PROBE_PREFER_ASYNCHRONOUS, 290 292 }, 291 293 .probe = tpm_tis_spi_driver_probe, 292 294 .remove = tpm_tis_spi_remove,