Commit 0c7415c3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 0dce8845 e918e570
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ static int st33zp24_i2c_request_resources(struct i2c_client *client)

/*
 * st33zp24_i2c_probe initialize the TPM device
 * @param: client, the i2c_client drescription (TPM I2C description).
 * @param: client, the i2c_client description (TPM I2C description).
 * @param: id, the i2c_device_id struct.
 * @return: 0 in case of success.
 *	 -1 in other case.
+2 −2
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ static int st33zp24_spi_request_resources(struct spi_device *dev)

/*
 * st33zp24_spi_probe initialize the TPM device
 * @param: dev, the spi_device drescription (TPM SPI description).
 * @param: dev, the spi_device description (TPM SPI description).
 * @return: 0 in case of success.
 *	 or a negative value describing the error.
 */
@@ -378,7 +378,7 @@ static int st33zp24_spi_probe(struct spi_device *dev)

/*
 * st33zp24_spi_remove remove the TPM device
 * @param: client, the spi_device drescription (TPM SPI description).
 * @param: client, the spi_device description (TPM SPI description).
 * @return: 0 in case of success.
 */
static int st33zp24_spi_remove(struct spi_device *dev)
+1 −1
Original line number Diff line number Diff line
@@ -502,7 +502,7 @@ static const struct tpm_class_ops st33zp24_tpm = {

/*
 * st33zp24_probe initialize the TPM device
 * @param: client, the i2c_client drescription (TPM I2C description).
 * @param: client, the i2c_client description (TPM I2C description).
 * @param: id, the i2c_device_id struct.
 * @return: 0 in case of success.
 *	 -1 in other case.
+9 −10
Original line number Diff line number Diff line
@@ -189,15 +189,6 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf,
		goto out;
	}

	/* atomic tpm command send and result receive. We only hold the ops
	 * lock during this period so that the tpm can be unregistered even if
	 * the char dev is held open.
	 */
	if (tpm_try_get_ops(priv->chip)) {
		ret = -EPIPE;
		goto out;
	}

	priv->response_length = 0;
	priv->response_read = false;
	*off = 0;
@@ -211,11 +202,19 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf,
	if (file->f_flags & O_NONBLOCK) {
		priv->command_enqueued = true;
		queue_work(tpm_dev_wq, &priv->async_work);
		tpm_put_ops(priv->chip);
		mutex_unlock(&priv->buffer_mutex);
		return size;
	}

	/* atomic tpm command send and result receive. We only hold the ops
	 * lock during this period so that the tpm can be unregistered even if
	 * the char dev is held open.
	 */
	if (tpm_try_get_ops(priv->chip)) {
		ret = -EPIPE;
		goto out;
	}

	ret = tpm_dev_transmit(priv->chip, priv->space, priv->data_buffer,
			       sizeof(priv->data_buffer));
	tpm_put_ops(priv->chip);
+7 −7
Original line number Diff line number Diff line
@@ -683,13 +683,6 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
	if (rc)
		goto init_irq_cleanup;

	if (!strcmp(id->compat, "IBM,vtpm20")) {
		chip->flags |= TPM_CHIP_FLAG_TPM2;
		rc = tpm2_get_cc_attrs_tbl(chip);
		if (rc)
			goto init_irq_cleanup;
	}

	if (!wait_event_timeout(ibmvtpm->crq_queue.wq,
				ibmvtpm->rtce_buf != NULL,
				HZ)) {
@@ -697,6 +690,13 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
		goto init_irq_cleanup;
	}

	if (!strcmp(id->compat, "IBM,vtpm20")) {
		chip->flags |= TPM_CHIP_FLAG_TPM2;
		rc = tpm2_get_cc_attrs_tbl(chip);
		if (rc)
			goto init_irq_cleanup;
	}

	return tpm_chip_register(chip);
init_irq_cleanup:
	do {
Loading