All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Cleanup struct tpm_vendor_specific
@ 2016-03-23 20:17 Christophe Ricard
       [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Christophe Ricard @ 2016-03-23 20:17 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

Hi Jarkko, Jason,

Please find in this serie a complete removal of tpm_vendor_specific structure.
It applies on top Jarkko current master branch:
tpm: drop the field 'time_expired' from struct tpm_chip beff92fd1051c234a374ee4a268b1338da7c1d3a

Overall, irq dedicated fields are seen as a dedicated set of chip properties managed by all the
drivers.

priv is a dedicated tpm driver specific data field allowing to store specific driver informations.
dev->driver_data is already set with a chip description.

Finaly, i have renamed tpm_vendor_specific to tpm_protocol_infos as the remaining data are common
to both crb and tis protocols.

Best Regards
Christophe

Christophe Ricard (5):
  tpm: drop 'iobase' from struct tpm_vendor_specific
  tpm: drop list from struct tpm_vendor_specific
  tpm: Move priv field from tpm_vendor_specific to tpm_chip
  tpm: Move irqs field from tpm_vendor_specific to tpm_chip structure
  tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos

 drivers/char/tpm/st33zp24/st33zp24.c |  54 ++++-----
 drivers/char/tpm/tpm-interface.c     |  52 ++++----
 drivers/char/tpm/tpm-sysfs.c         |  20 ++--
 drivers/char/tpm/tpm.h               |  18 ++-
 drivers/char/tpm/tpm2-cmd.c          |   2 +-
 drivers/char/tpm/tpm_atmel.c         |  33 ++++--
 drivers/char/tpm/tpm_atmel.h         |   2 +-
 drivers/char/tpm/tpm_crb.c           |  12 +-
 drivers/char/tpm/tpm_i2c_atmel.c     |  22 ++--
 drivers/char/tpm/tpm_i2c_infineon.c  |  47 ++++----
 drivers/char/tpm/tpm_i2c_nuvoton.c   |  58 ++++-----
 drivers/char/tpm/tpm_nsc.c           |   4 +-
 drivers/char/tpm/tpm_tis.c           | 222 +++++++++++++++++++----------------
 drivers/char/tpm/xen-tpmfront.c      |  10 +-
 14 files changed, 287 insertions(+), 269 deletions(-)

-- 
2.5.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/5] tpm: drop 'iobase' from struct tpm_vendor_specific
       [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
@ 2016-03-23 20:17   ` Christophe Ricard
       [not found]     ` <1458764240-24185-2-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 20:17   ` [PATCH 2/5] tpm: drop list " Christophe Ricard
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Christophe Ricard @ 2016-03-23 20:17 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

Dropped the field 'iobase' from struct tpm_vendor_specific and migrated
it to the private structures of tpm_atmel and tpm_tis.

Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
---
 drivers/char/tpm/tpm.h       |   2 -
 drivers/char/tpm/tpm_atmel.c |  29 +++++++-----
 drivers/char/tpm/tpm_tis.c   | 104 +++++++++++++++++++++++++------------------
 3 files changed, 78 insertions(+), 57 deletions(-)

diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 7317bec..0d1b7e6 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -131,8 +131,6 @@ enum tpm2_startup_types {
 struct tpm_chip;
 
 struct tpm_vendor_specific {
-	void __iomem *iobase;		/* ioremapped address */
-
 	int irq;
 
 	struct list_head list;
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
index c6daf6c..242d6c6 100644
--- a/drivers/char/tpm/tpm_atmel.c
+++ b/drivers/char/tpm/tpm_atmel.c
@@ -36,6 +36,7 @@ enum tpm_atmel_read_status {
 };
 
 struct tpm_atmel_priv {
+	void __iomem *iobase;
 	unsigned long base;
 	int region_size;
 	int have_region;
@@ -43,6 +44,7 @@ struct tpm_atmel_priv {
 
 static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 {
+	struct tpm_atmel_priv *priv = chip->vendor.priv;
 	u8 status, *hdr = buf;
 	u32 size;
 	int i;
@@ -53,12 +55,12 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		return -EIO;
 
 	for (i = 0; i < 6; i++) {
-		status = ioread8(chip->vendor.iobase + 1);
+		status = ioread8(priv->iobase + 1);
 		if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
 			dev_err(&chip->dev, "error reading header\n");
 			return -EIO;
 		}
-		*buf++ = ioread8(chip->vendor.iobase);
+		*buf++ = ioread8(priv->iobase);
 	}
 
 	/* size of the data received */
@@ -69,7 +71,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		dev_err(&chip->dev,
 			"Recv size(%d) less than available space\n", size);
 		for (; i < size; i++) {	/* clear the waiting data anyway */
-			status = ioread8(chip->vendor.iobase + 1);
+			status = ioread8(priv->iobase + 1);
 			if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
 				dev_err(&chip->dev, "error reading data\n");
 				return -EIO;
@@ -80,16 +82,16 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 
 	/* read all the data available */
 	for (; i < size; i++) {
-		status = ioread8(chip->vendor.iobase + 1);
+		status = ioread8(priv->iobase + 1);
 		if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
 			dev_err(&chip->dev, "error reading data\n");
 			return -EIO;
 		}
-		*buf++ = ioread8(chip->vendor.iobase);
+		*buf++ = ioread8(priv->iobase);
 	}
 
 	/* make sure data available is gone */
-	status = ioread8(chip->vendor.iobase + 1);
+	status = ioread8(priv->iobase + 1);
 
 	if (status & ATML_STATUS_DATA_AVAIL) {
 		dev_err(&chip->dev, "data available is stuck\n");
@@ -101,12 +103,13 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 
 static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
 {
+	struct tpm_atmel_priv *priv = chip->vendor.priv;
 	int i;
 
 	dev_dbg(&chip->dev, "tpm_atml_send:\n");
 	for (i = 0; i < count; i++) {
 		dev_dbg(&chip->dev, "%d 0x%x(%d)\n",  i, buf[i], buf[i]);
- 		iowrite8(buf[i], chip->vendor.iobase);
+		iowrite8(buf[i], priv->iobase);
 	}
 
 	return count;
@@ -114,12 +117,16 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
 
 static void tpm_atml_cancel(struct tpm_chip *chip)
 {
-	iowrite8(ATML_STATUS_ABORT, chip->vendor.iobase + 1);
+	struct tpm_atmel_priv *priv = chip->vendor.priv;
+
+	iowrite8(ATML_STATUS_ABORT, priv->iobase + 1);
 }
 
 static u8 tpm_atml_status(struct tpm_chip *chip)
 {
-	return ioread8(chip->vendor.iobase + 1);
+	struct tpm_atmel_priv *priv = chip->vendor.priv;
+
+	return ioread8(priv->iobase + 1);
 }
 
 static bool tpm_atml_req_canceled(struct tpm_chip *chip, u8 status)
@@ -148,7 +155,7 @@ static void atml_plat_remove(void)
 		tpm_chip_unregister(chip);
 		if (priv->have_region)
 			atmel_release_region(priv->base, priv->region_size);
-		atmel_put_base_addr(chip->vendor.iobase);
+		atmel_put_base_addr(priv->iobase);
 		platform_device_unregister(pdev);
 	}
 }
@@ -196,6 +203,7 @@ static int __init init_atmel(void)
 		goto err_unreg_dev;
 	}
 
+	priv->iobase = iobase;
 	priv->base = base;
 	priv->have_region = have_region;
 	priv->region_size = region_size;
@@ -206,7 +214,6 @@ static int __init init_atmel(void)
 		goto err_unreg_dev;
 	}
 
-	chip->vendor.iobase = iobase;
 	chip->vendor.priv = priv;
 
 	rc = tpm_chip_register(chip);
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 068f021..19dac62 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -94,6 +94,7 @@ struct tpm_info {
 #define	TPM_RID(l)			(0x0F04 | ((l) << 12))
 
 struct priv_data {
+	void __iomem *iobase;
 	u16 manufacturer_id;
 	bool irq_tested;
 	wait_queue_head_t int_queue;
@@ -128,9 +129,10 @@ static inline int is_itpm(struct acpi_device *dev)
  * correct values in the other bits.' */
 static int wait_startup(struct tpm_chip *chip, int l)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	unsigned long stop = jiffies + chip->vendor.timeout_a;
 	do {
-		if (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
+		if (ioread8(priv->iobase + TPM_ACCESS(l)) &
 		    TPM_ACCESS_VALID)
 			return 0;
 		msleep(TPM_TIMEOUT);
@@ -140,7 +142,9 @@ static int wait_startup(struct tpm_chip *chip, int l)
 
 static int check_locality(struct tpm_chip *chip, int l)
 {
-	if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
+	struct priv_data *priv = chip->vendor.priv;
+
+	if ((ioread8(priv->iobase + TPM_ACCESS(l)) &
 	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
 	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
 		return chip->vendor.locality = l;
@@ -150,11 +154,13 @@ static int check_locality(struct tpm_chip *chip, int l)
 
 static void release_locality(struct tpm_chip *chip, int l, int force)
 {
-	if (force || (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
+	struct priv_data *priv = chip->vendor.priv;
+
+	if (force || (ioread8(priv->iobase + TPM_ACCESS(l)) &
 		      (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
 	    (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))
 		iowrite8(TPM_ACCESS_ACTIVE_LOCALITY,
-			 chip->vendor.iobase + TPM_ACCESS(l));
+			 priv->iobase + TPM_ACCESS(l));
 }
 
 static int request_locality(struct tpm_chip *chip, int l)
@@ -167,7 +173,7 @@ static int request_locality(struct tpm_chip *chip, int l)
 		return l;
 
 	iowrite8(TPM_ACCESS_REQUEST_USE,
-		 chip->vendor.iobase + TPM_ACCESS(l));
+		 priv->iobase + TPM_ACCESS(l));
 
 	stop = jiffies + chip->vendor.timeout_a;
 
@@ -200,19 +206,24 @@ again:
 
 static u8 tpm_tis_status(struct tpm_chip *chip)
 {
-	return ioread8(chip->vendor.iobase +
+	struct priv_data *priv = chip->vendor.priv;
+
+	return ioread8(priv->iobase +
 		       TPM_STS(chip->vendor.locality));
 }
 
 static void tpm_tis_ready(struct tpm_chip *chip)
 {
+	struct priv_data *priv = chip->vendor.priv;
+
 	/* this causes the current command to be aborted */
 	iowrite8(TPM_STS_COMMAND_READY,
-		 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
+		 priv->iobase + TPM_STS(chip->vendor.locality));
 }
 
 static int get_burstcount(struct tpm_chip *chip)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	unsigned long stop;
 	int burstcnt;
 
@@ -220,9 +231,9 @@ static int get_burstcount(struct tpm_chip *chip)
 	/* which timeout value, spec has 2 answers (c & d) */
 	stop = jiffies + chip->vendor.timeout_d;
 	do {
-		burstcnt = ioread8(chip->vendor.iobase +
+		burstcnt = ioread8(priv->iobase +
 				   TPM_STS(chip->vendor.locality) + 1);
-		burstcnt += ioread8(chip->vendor.iobase +
+		burstcnt += ioread8(priv->iobase +
 				    TPM_STS(chip->vendor.locality) +
 				    2) << 8;
 		if (burstcnt)
@@ -234,6 +245,7 @@ static int get_burstcount(struct tpm_chip *chip)
 
 static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	int size = 0, burstcnt;
 	while (size < count &&
 	       wait_for_tpm_stat(chip,
@@ -243,7 +255,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 	       == 0) {
 		burstcnt = get_burstcount(chip);
 		for (; burstcnt > 0 && size < count; burstcnt--)
-			buf[size++] = ioread8(chip->vendor.iobase +
+			buf[size++] = ioread8(priv->iobase +
 					      TPM_DATA_FIFO(chip->vendor.
 							    locality));
 	}
@@ -329,7 +341,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 	while (count < len - 1) {
 		burstcnt = get_burstcount(chip);
 		for (; burstcnt > 0 && count < len - 1; burstcnt--) {
-			iowrite8(buf[count], chip->vendor.iobase +
+			iowrite8(buf[count], priv->iobase +
 				 TPM_DATA_FIFO(chip->vendor.locality));
 			count++;
 		}
@@ -345,7 +357,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 
 	/* write last byte */
 	iowrite8(buf[count],
-		 chip->vendor.iobase + TPM_DATA_FIFO(chip->vendor.locality));
+		 priv->iobase + TPM_DATA_FIFO(chip->vendor.locality));
 	wait_for_tpm_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
 			  &priv->int_queue, false);
 	status = tpm_tis_status(chip);
@@ -364,15 +376,15 @@ out_err:
 
 static void disable_interrupts(struct tpm_chip *chip)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	u32 intmask;
 
 	intmask =
-	    ioread32(chip->vendor.iobase +
+	    ioread32(priv->iobase +
 		     TPM_INT_ENABLE(chip->vendor.locality));
 	intmask &= ~TPM_GLOBAL_INT_ENABLE;
 	iowrite32(intmask,
-		  chip->vendor.iobase +
-		  TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
 	devm_free_irq(&chip->dev, chip->vendor.irq, chip);
 	chip->vendor.irq = 0;
 }
@@ -384,6 +396,7 @@ static void disable_interrupts(struct tpm_chip *chip)
  */
 static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	int rc;
 	u32 ordinal;
 	unsigned long dur;
@@ -394,7 +407,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
 
 	/* go and do it */
 	iowrite8(TPM_STS_GO,
-		 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
+		 priv->iobase + TPM_STS(chip->vendor.locality));
 
 	if (chip->vendor.irq) {
 		ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
@@ -453,10 +466,11 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = {
 static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
 				    unsigned long *timeout_cap)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	int i;
 	u32 did_vid;
 
-	did_vid = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
+	did_vid = ioread32(priv->iobase + TPM_DID_VID(0));
 
 	for (i = 0; i != ARRAY_SIZE(vendor_timeout_overrides); i++) {
 		if (vendor_timeout_overrides[i].did_vid != did_vid)
@@ -476,6 +490,7 @@ static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
  */
 static int probe_itpm(struct tpm_chip *chip)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	int rc = 0;
 	u8 cmd_getticks[] = {
 		0x00, 0xc1, 0x00, 0x00, 0x00, 0x0a,
@@ -483,7 +498,7 @@ static int probe_itpm(struct tpm_chip *chip)
 	};
 	size_t len = sizeof(cmd_getticks);
 	bool rem_itpm = itpm;
-	u16 vendor = ioread16(chip->vendor.iobase + TPM_DID_VID(0));
+	u16 vendor = ioread16(priv->iobase + TPM_DID_VID(0));
 
 	/* probe only iTPMS */
 	if (vendor != TPM_VID_INTEL)
@@ -548,7 +563,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 	u32 interrupt;
 	int i;
 
-	interrupt = ioread32(chip->vendor.iobase +
+	interrupt = ioread32(priv->iobase +
 			     TPM_INT_STATUS(chip->vendor.locality));
 
 	if (interrupt == 0)
@@ -568,9 +583,9 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 
 	/* Clear interrupts handled with TPM_EOI */
 	iowrite32(interrupt,
-		  chip->vendor.iobase +
+		  priv->iobase +
 		  TPM_INT_STATUS(chip->vendor.locality));
-	ioread32(chip->vendor.iobase + TPM_INT_STATUS(chip->vendor.locality));
+	ioread32(priv->iobase + TPM_INT_STATUS(chip->vendor.locality));
 	return IRQ_HANDLED;
 }
 
@@ -592,19 +607,19 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 	}
 	chip->vendor.irq = irq;
 
-	original_int_vec = ioread8(chip->vendor.iobase +
+	original_int_vec = ioread8(priv->iobase +
 				   TPM_INT_VECTOR(chip->vendor.locality));
 	iowrite8(irq,
-		 chip->vendor.iobase + TPM_INT_VECTOR(chip->vendor.locality));
+		 priv->iobase + TPM_INT_VECTOR(chip->vendor.locality));
 
 	/* Clear all existing */
-	iowrite32(ioread32(chip->vendor.iobase +
+	iowrite32(ioread32(priv->iobase +
 			   TPM_INT_STATUS(chip->vendor.locality)),
-		  chip->vendor.iobase + TPM_INT_STATUS(chip->vendor.locality));
+		  priv->iobase + TPM_INT_STATUS(chip->vendor.locality));
 
 	/* Turn on */
 	iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
-		  chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
 
 	priv->irq_tested = false;
 
@@ -621,8 +636,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 	 */
 	if (!chip->vendor.irq) {
 		iowrite8(original_int_vec,
-			 chip->vendor.iobase +
-			     TPM_INT_VECTOR(chip->vendor.locality));
+			 priv->iobase + TPM_INT_VECTOR(chip->vendor.locality));
 		return 1;
 	}
 
@@ -635,10 +649,11 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
  */
 static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	u8 original_int_vec;
 	int i;
 
-	original_int_vec = ioread8(chip->vendor.iobase +
+	original_int_vec = ioread8(priv->iobase +
 				   TPM_INT_VECTOR(chip->vendor.locality));
 
 	if (!original_int_vec) {
@@ -658,15 +673,16 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
 
 static void tpm_tis_remove(struct tpm_chip *chip)
 {
+	struct priv_data *priv = chip->vendor.priv;
+
 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
 		tpm2_shutdown(chip, TPM2_SU_CLEAR);
 
 	iowrite32(~TPM_GLOBAL_INT_ENABLE &
-		  ioread32(chip->vendor.iobase +
+		  ioread32(priv->iobase +
 			   TPM_INT_ENABLE(chip->vendor.
 					  locality)),
-		  chip->vendor.iobase +
-		  TPM_INT_ENABLE(chip->vendor.locality));
+			   priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
 	release_locality(chip, chip->vendor.locality, 1);
 }
 
@@ -691,9 +707,9 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 	chip->acpi_dev_handle = acpi_dev_handle;
 #endif
 
-	chip->vendor.iobase = devm_ioremap_resource(dev, &tpm_info->res);
-	if (IS_ERR(chip->vendor.iobase))
-		return PTR_ERR(chip->vendor.iobase);
+	priv->iobase = devm_ioremap_resource(dev, &tpm_info->res);
+	if (IS_ERR(priv->iobase))
+		return PTR_ERR(priv->iobase);
 
 	/* Maximum timeouts */
 	chip->vendor.timeout_a = TIS_TIMEOUT_A_MAX;
@@ -707,13 +723,13 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 	}
 
 	/* Take control of the TPM's interrupt hardware and shut it off */
-	intmask = ioread32(chip->vendor.iobase +
+	intmask = ioread32(priv->iobase +
 			   TPM_INT_ENABLE(chip->vendor.locality));
 	intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
 		   TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
 	intmask &= ~TPM_GLOBAL_INT_ENABLE;
 	iowrite32(intmask,
-		  chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
 
 	if (request_locality(chip, 0) != 0) {
 		rc = -ENODEV;
@@ -724,12 +740,12 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 	if (rc)
 		goto out_err;
 
-	vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
+	vendor = ioread32(priv->iobase + TPM_DID_VID(0));
 	priv->manufacturer_id = vendor;
 
 	dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
 		 (chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",
-		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
+		 vendor >> 16, ioread8(priv->iobase + TPM_RID(0)));
 
 	if (!itpm) {
 		probe = probe_itpm(chip);
@@ -746,7 +762,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 
 	/* Figure out the capabilities */
 	intfcaps =
-	    ioread32(chip->vendor.iobase +
+	    ioread32(priv->iobase +
 		     TPM_INTF_CAPS(chip->vendor.locality));
 	dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
 		intfcaps);
@@ -825,23 +841,23 @@ out_err:
 #ifdef CONFIG_PM_SLEEP
 static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
 {
+	struct priv_data *priv = chip->vendor.priv;
 	u32 intmask;
 
 	/* reenable interrupts that device may have lost or
 	   BIOS/firmware may have disabled */
-	iowrite8(chip->vendor.irq, chip->vendor.iobase +
+	iowrite8(chip->vendor.irq, priv->iobase +
 		 TPM_INT_VECTOR(chip->vendor.locality));
 
 	intmask =
-	    ioread32(chip->vendor.iobase +
-		     TPM_INT_ENABLE(chip->vendor.locality));
+	    ioread32(priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
 
 	intmask |= TPM_INTF_CMD_READY_INT
 	    | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
 	    | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
 
 	iowrite32(intmask,
-		  chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
 }
 
 static int tpm_tis_resume(struct device *dev)
-- 
2.5.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/5] tpm: drop list from struct tpm_vendor_specific
       [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 20:17   ` [PATCH 1/5] tpm: drop 'iobase' from " Christophe Ricard
@ 2016-03-23 20:17   ` Christophe Ricard
       [not found]     ` <1458764240-24185-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 20:17   ` [PATCH 3/5] tpm: Move priv field from tpm_vendor_specific to tpm_chip Christophe Ricard
                     ` (2 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Christophe Ricard @ 2016-03-23 20:17 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

Dropped list from struct tpm_vendor_specific as it is not used in any
place.

It is initialized in tpm_i2c_infineon but not used at all in the code.

Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
---
 drivers/char/tpm/tpm.h              | 1 -
 drivers/char/tpm/tpm_i2c_infineon.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 0d1b7e6..357ac14 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -133,7 +133,6 @@ struct tpm_chip;
 struct tpm_vendor_specific {
 	int irq;
 
-	struct list_head list;
 	int locality;
 	unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
 	bool timeout_adjusted;
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index f2aa99e..e74f1c1 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -619,7 +619,6 @@ static int tpm_tis_i2c_init(struct device *dev)
 
 	dev_info(dev, "1.2 TPM (device-id 0x%X)\n", vendor >> 16);
 
-	INIT_LIST_HEAD(&chip->vendor.list);
 	tpm_dev.chip = chip;
 
 	tpm_get_timeouts(chip);
-- 
2.5.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/5] tpm: Move priv field from tpm_vendor_specific to tpm_chip
       [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 20:17   ` [PATCH 1/5] tpm: drop 'iobase' from " Christophe Ricard
  2016-03-23 20:17   ` [PATCH 2/5] tpm: drop list " Christophe Ricard
@ 2016-03-23 20:17   ` Christophe Ricard
       [not found]     ` <1458764240-24185-4-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 20:17   ` [PATCH 4/5] tpm: Move irqs field from tpm_vendor_specific to tpm_chip structure Christophe Ricard
  2016-03-23 20:17   ` [PATCH 5/5] tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos Christophe Ricard
  4 siblings, 1 reply; 16+ messages in thread
From: Christophe Ricard @ 2016-03-23 20:17 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

Move from tpm_vendor_specific priv field to tpm_chip as this is going to
be used for additional tpm_chip description.

Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
---
 drivers/char/tpm/tpm.h             |  4 ++--
 drivers/char/tpm/tpm_atmel.c       | 12 +++++-----
 drivers/char/tpm/tpm_atmel.h       |  2 +-
 drivers/char/tpm/tpm_crb.c         | 12 +++++-----
 drivers/char/tpm/tpm_i2c_atmel.c   | 12 +++++-----
 drivers/char/tpm/tpm_i2c_nuvoton.c |  8 +++----
 drivers/char/tpm/tpm_nsc.c         |  4 ++--
 drivers/char/tpm/tpm_tis.c         | 46 +++++++++++++++++++-------------------
 8 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 357ac14..06d5c2a 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -138,12 +138,11 @@ struct tpm_vendor_specific {
 	bool timeout_adjusted;
 	unsigned long duration[3]; /* jiffies */
 	bool duration_adjusted;
-	void *priv;
 
 	wait_queue_head_t read_queue;
 };
 
-#define TPM_VPRIV(c)     ((c)->vendor.priv)
+#define TPM_VPRIV(c)     ((c)->priv)
 
 #define TPM_VID_INTEL    0x8086
 #define TPM_VID_WINBOND  0x1050
@@ -159,6 +158,7 @@ enum tpm_chip_flags {
 struct tpm_chip {
 	struct device dev;
 	struct cdev cdev;
+	void *priv;
 
 	/* A driver callback under ops cannot be run unless ops_sem is held
 	 * (sometimes implicitly, eg for the sysfs code). ops becomes null
diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
index 242d6c6..56845bf 100644
--- a/drivers/char/tpm/tpm_atmel.c
+++ b/drivers/char/tpm/tpm_atmel.c
@@ -44,7 +44,7 @@ struct tpm_atmel_priv {
 
 static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 {
-	struct tpm_atmel_priv *priv = chip->vendor.priv;
+	struct tpm_atmel_priv *priv = chip->priv;
 	u8 status, *hdr = buf;
 	u32 size;
 	int i;
@@ -103,7 +103,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 
 static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
 {
-	struct tpm_atmel_priv *priv = chip->vendor.priv;
+	struct tpm_atmel_priv *priv = chip->priv;
 	int i;
 
 	dev_dbg(&chip->dev, "tpm_atml_send:\n");
@@ -117,14 +117,14 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
 
 static void tpm_atml_cancel(struct tpm_chip *chip)
 {
-	struct tpm_atmel_priv *priv = chip->vendor.priv;
+	struct tpm_atmel_priv *priv = chip->priv;
 
 	iowrite8(ATML_STATUS_ABORT, priv->iobase + 1);
 }
 
 static u8 tpm_atml_status(struct tpm_chip *chip)
 {
-	struct tpm_atmel_priv *priv = chip->vendor.priv;
+	struct tpm_atmel_priv *priv = chip->priv;
 
 	return ioread8(priv->iobase + 1);
 }
@@ -149,7 +149,7 @@ static struct platform_device *pdev;
 static void atml_plat_remove(void)
 {
 	struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
-	struct tpm_atmel_priv *priv = chip->vendor.priv;
+	struct tpm_atmel_priv *priv = chip->priv;
 
 	if (chip) {
 		tpm_chip_unregister(chip);
@@ -214,7 +214,7 @@ static int __init init_atmel(void)
 		goto err_unreg_dev;
 	}
 
-	chip->vendor.priv = priv;
+	chip->priv = priv;
 
 	rc = tpm_chip_register(chip);
 	if (rc)
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
index 08607a6..dedc5dc 100644
--- a/drivers/char/tpm/tpm_atmel.h
+++ b/drivers/char/tpm/tpm_atmel.h
@@ -22,7 +22,7 @@
  *
  */
 
-#define atmel_get_priv(chip) ((struct tpm_atmel_priv *) chip->vendor.priv)
+#define atmel_get_priv(chip) ((struct tpm_atmel_priv *) chip->priv)
 
 #ifdef CONFIG_PPC64
 
diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
index 8767da6..0e81a36 100644
--- a/drivers/char/tpm/tpm_crb.c
+++ b/drivers/char/tpm/tpm_crb.c
@@ -87,7 +87,7 @@ static SIMPLE_DEV_PM_OPS(crb_pm, tpm_pm_suspend, tpm_pm_resume);
 
 static u8 crb_status(struct tpm_chip *chip)
 {
-	struct crb_priv *priv = chip->vendor.priv;
+	struct crb_priv *priv = chip->priv;
 	u8 sts = 0;
 
 	if ((ioread32(&priv->cca->start) & CRB_START_INVOKE) !=
@@ -99,7 +99,7 @@ static u8 crb_status(struct tpm_chip *chip)
 
 static int crb_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 {
-	struct crb_priv *priv = chip->vendor.priv;
+	struct crb_priv *priv = chip->priv;
 	unsigned int expected;
 
 	/* sanity check */
@@ -139,7 +139,7 @@ static int crb_do_acpi_start(struct tpm_chip *chip)
 
 static int crb_send(struct tpm_chip *chip, u8 *buf, size_t len)
 {
-	struct crb_priv *priv = chip->vendor.priv;
+	struct crb_priv *priv = chip->priv;
 	int rc = 0;
 
 	if (len > ioread32(&priv->cca->cmd_size)) {
@@ -163,7 +163,7 @@ static int crb_send(struct tpm_chip *chip, u8 *buf, size_t len)
 
 static void crb_cancel(struct tpm_chip *chip)
 {
-	struct crb_priv *priv = chip->vendor.priv;
+	struct crb_priv *priv = chip->priv;
 
 	iowrite32(cpu_to_le32(CRB_CANCEL_INVOKE), &priv->cca->cancel);
 
@@ -175,7 +175,7 @@ static void crb_cancel(struct tpm_chip *chip)
 
 static bool crb_req_canceled(struct tpm_chip *chip, u8 status)
 {
-	struct crb_priv *priv = chip->vendor.priv;
+	struct crb_priv *priv = chip->priv;
 	u32 cancel = ioread32(&priv->cca->cancel);
 
 	return (cancel & CRB_CANCEL_INVOKE) == CRB_CANCEL_INVOKE;
@@ -200,7 +200,7 @@ static int crb_init(struct acpi_device *device, struct crb_priv *priv)
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
-	chip->vendor.priv = priv;
+	chip->priv = priv;
 	chip->acpi_dev_handle = device->handle;
 	chip->flags = TPM_CHIP_FLAG_TPM2;
 
diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
index dd8f0eb..92cd080 100644
--- a/drivers/char/tpm/tpm_i2c_atmel.c
+++ b/drivers/char/tpm/tpm_i2c_atmel.c
@@ -51,7 +51,7 @@ struct priv_data {
 
 static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	struct i2c_client *client = to_i2c_client(chip->dev.parent);
 	s32 status;
 
@@ -70,7 +70,7 @@ static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)
 
 static int i2c_atmel_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	struct i2c_client *client = to_i2c_client(chip->dev.parent);
 	struct tpm_output_header *hdr =
 		(struct tpm_output_header *)priv->buffer;
@@ -111,7 +111,7 @@ static void i2c_atmel_cancel(struct tpm_chip *chip)
 
 static u8 i2c_atmel_read_status(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	struct i2c_client *client = to_i2c_client(chip->dev.parent);
 	int rc;
 
@@ -163,9 +163,9 @@ static int i2c_atmel_probe(struct i2c_client *client,
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
-	chip->vendor.priv = devm_kzalloc(dev, sizeof(struct priv_data),
-					 GFP_KERNEL);
-	if (!chip->vendor.priv)
+	chip->priv = devm_kzalloc(dev, sizeof(struct priv_data),
+				  GFP_KERNEL);
+	if (!chip->priv)
 		return -ENOMEM;
 
 	/* Default timeouts */
diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
index a43b5f3..a9c6b2d 100644
--- a/drivers/char/tpm/tpm_i2c_nuvoton.c
+++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
@@ -178,7 +178,7 @@ static int i2c_nuvoton_wait_for_stat(struct tpm_chip *chip, u8 mask, u8 value,
 {
 	if (chip->vendor.irq && queue) {
 		s32 rc;
-		struct priv_data *priv = chip->vendor.priv;
+		struct priv_data *priv = chip->priv;
 		unsigned int cur_intrs = priv->intrs;
 
 		enable_irq(chip->vendor.irq);
@@ -473,7 +473,7 @@ static const struct tpm_class_ops tpm_i2c = {
 static irqreturn_t i2c_nuvoton_int_handler(int dummy, void *dev_id)
 {
 	struct tpm_chip *chip = dev_id;
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	priv->intrs++;
 	wake_up(&chip->vendor.read_queue);
@@ -534,9 +534,9 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
-	chip->vendor.priv = devm_kzalloc(dev, sizeof(struct priv_data),
+	chip->priv = devm_kzalloc(dev, sizeof(struct priv_data),
 					 GFP_KERNEL);
-	if (!chip->vendor.priv)
+	if (!chip->priv)
 		return -ENOMEM;
 
 	init_waitqueue_head(&chip->vendor.read_queue);
diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
index 8ccb1d5..48cc7ff 100644
--- a/drivers/char/tpm/tpm_nsc.c
+++ b/drivers/char/tpm/tpm_nsc.c
@@ -69,7 +69,7 @@ struct tpm_nsc_priv {
 	unsigned long base;
 };
 
-#define tpm_nsc_get_priv(chip) ((struct tpm_nsc_priv *) chip->vendor.priv)
+#define tpm_nsc_get_priv(chip) ((struct tpm_nsc_priv *) chip->priv)
 
 /*
  * Wait for a certain status to appear
@@ -331,7 +331,7 @@ static int __init init_nsc(void)
 		goto err_rel_reg;
 	}
 
-	chip->vendor.priv = priv;
+	chip->priv = priv;
 
 	rc = tpm_chip_register(chip);
 	if (rc)
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 19dac62..96cb824 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -129,7 +129,7 @@ static inline int is_itpm(struct acpi_device *dev)
  * correct values in the other bits.' */
 static int wait_startup(struct tpm_chip *chip, int l)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	unsigned long stop = jiffies + chip->vendor.timeout_a;
 	do {
 		if (ioread8(priv->iobase + TPM_ACCESS(l)) &
@@ -142,7 +142,7 @@ static int wait_startup(struct tpm_chip *chip, int l)
 
 static int check_locality(struct tpm_chip *chip, int l)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	if ((ioread8(priv->iobase + TPM_ACCESS(l)) &
 	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
@@ -154,7 +154,7 @@ static int check_locality(struct tpm_chip *chip, int l)
 
 static void release_locality(struct tpm_chip *chip, int l, int force)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	if (force || (ioread8(priv->iobase + TPM_ACCESS(l)) &
 		      (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
@@ -165,7 +165,7 @@ static void release_locality(struct tpm_chip *chip, int l, int force)
 
 static int request_locality(struct tpm_chip *chip, int l)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	unsigned long stop, timeout;
 	long rc;
 
@@ -206,7 +206,7 @@ again:
 
 static u8 tpm_tis_status(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	return ioread8(priv->iobase +
 		       TPM_STS(chip->vendor.locality));
@@ -214,7 +214,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip)
 
 static void tpm_tis_ready(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	/* this causes the current command to be aborted */
 	iowrite8(TPM_STS_COMMAND_READY,
@@ -223,7 +223,7 @@ static void tpm_tis_ready(struct tpm_chip *chip)
 
 static int get_burstcount(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	unsigned long stop;
 	int burstcnt;
 
@@ -245,7 +245,7 @@ static int get_burstcount(struct tpm_chip *chip)
 
 static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	int size = 0, burstcnt;
 	while (size < count &&
 	       wait_for_tpm_stat(chip,
@@ -264,7 +264,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 
 static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	int size = 0;
 	int expected, status;
 
@@ -320,7 +320,7 @@ MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
  */
 static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	int rc, status, burstcnt;
 	size_t count = 0;
 
@@ -376,7 +376,7 @@ out_err:
 
 static void disable_interrupts(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	u32 intmask;
 
 	intmask =
@@ -396,7 +396,7 @@ static void disable_interrupts(struct tpm_chip *chip)
  */
 static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	int rc;
 	u32 ordinal;
 	unsigned long dur;
@@ -434,7 +434,7 @@ out_err:
 static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
 {
 	int rc, irq;
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	if (!chip->vendor.irq || priv->irq_tested)
 		return tpm_tis_send_main(chip, buf, len);
@@ -466,7 +466,7 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = {
 static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
 				    unsigned long *timeout_cap)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	int i;
 	u32 did_vid;
 
@@ -490,7 +490,7 @@ static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
  */
 static int probe_itpm(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	int rc = 0;
 	u8 cmd_getticks[] = {
 		0x00, 0xc1, 0x00, 0x00, 0x00, 0x0a,
@@ -532,7 +532,7 @@ out:
 
 static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	switch (priv->manufacturer_id) {
 	case TPM_VID_WINBOND:
@@ -559,7 +559,7 @@ static const struct tpm_class_ops tpm_tis = {
 static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 {
 	struct tpm_chip *chip = dev_id;
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	u32 interrupt;
 	int i;
 
@@ -569,7 +569,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 	if (interrupt == 0)
 		return IRQ_NONE;
 
-	((struct priv_data *)chip->vendor.priv)->irq_tested = true;
+	((struct priv_data *)chip->priv)->irq_tested = true;
 	if (interrupt & TPM_INTF_DATA_AVAIL_INT)
 		wake_up_interruptible(&chip->vendor.read_queue);
 	if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
@@ -596,7 +596,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 				    int flags, int irq)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	u8 original_int_vec;
 
 	if (devm_request_irq(&chip->dev, irq, tis_int_handler, flags,
@@ -649,7 +649,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
  */
 static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	u8 original_int_vec;
 	int i;
 
@@ -673,7 +673,7 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
 
 static void tpm_tis_remove(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 
 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
 		tpm2_shutdown(chip, TPM2_SU_CLEAR);
@@ -702,7 +702,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
-	chip->vendor.priv = priv;
+	chip->priv = priv;
 #ifdef CONFIG_ACPI
 	chip->acpi_dev_handle = acpi_dev_handle;
 #endif
@@ -841,7 +841,7 @@ out_err:
 #ifdef CONFIG_PM_SLEEP
 static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
 {
-	struct priv_data *priv = chip->vendor.priv;
+	struct priv_data *priv = chip->priv;
 	u32 intmask;
 
 	/* reenable interrupts that device may have lost or
-- 
2.5.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/5] tpm: Move irqs field from tpm_vendor_specific to tpm_chip structure
       [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
                     ` (2 preceding siblings ...)
  2016-03-23 20:17   ` [PATCH 3/5] tpm: Move priv field from tpm_vendor_specific to tpm_chip Christophe Ricard
@ 2016-03-23 20:17   ` Christophe Ricard
       [not found]     ` <1458764240-24185-5-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 20:17   ` [PATCH 5/5] tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos Christophe Ricard
  4 siblings, 1 reply; 16+ messages in thread
From: Christophe Ricard @ 2016-03-23 20:17 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

In order to complete the tpm_vendor_specific cleanup structure move irqs
specific fields to tpm_chip. It make sense to be in this place as those
fields are part of the tpm properties.

Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
---
 drivers/char/tpm/st33zp24/st33zp24.c | 26 +++++++++++++-------------
 drivers/char/tpm/tpm-interface.c     |  4 ++--
 drivers/char/tpm/tpm.h               |  7 +++----
 drivers/char/tpm/tpm_i2c_atmel.c     |  2 +-
 drivers/char/tpm/tpm_i2c_infineon.c  |  2 +-
 drivers/char/tpm/tpm_i2c_nuvoton.c   | 28 ++++++++++++++--------------
 drivers/char/tpm/tpm_tis.c           |  8 ++++----
 drivers/char/tpm/xen-tpmfront.c      | 10 +++++-----
 8 files changed, 43 insertions(+), 44 deletions(-)

diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
index 9e91ca7..82dc4d11 100644
--- a/drivers/char/tpm/st33zp24/st33zp24.c
+++ b/drivers/char/tpm/st33zp24/st33zp24.c
@@ -288,10 +288,10 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
 
 	stop = jiffies + timeout;
 
-	if (chip->vendor.irq) {
+	if (chip->irq) {
 		cur_intrs = tpm_dev->intrs;
 		clear_interruption(tpm_dev);
-		enable_irq(chip->vendor.irq);
+		enable_irq(chip->irq);
 
 		do {
 			if (ret == -ERESTARTSYS && freezing(current))
@@ -314,7 +314,7 @@ static int wait_for_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
 			}
 		} while (ret == -ERESTARTSYS && freezing(current));
 
-		disable_irq_nosync(chip->vendor.irq);
+		disable_irq_nosync(chip->irq);
 
 	} else {
 		do {
@@ -346,7 +346,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 	       wait_for_stat(chip,
 			     TPM_STS_DATA_AVAIL | TPM_STS_VALID,
 			     chip->vendor.timeout_c,
-			     &chip->vendor.read_queue, true) == 0) {
+			     &chip->read_queue, true) == 0) {
 		burstcnt = get_burstcount(chip);
 		if (burstcnt < 0)
 			return burstcnt;
@@ -375,8 +375,8 @@ static irqreturn_t tpm_ioserirq_handler(int irq, void *dev_id)
 	tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip);
 
 	tpm_dev->intrs++;
-	wake_up_interruptible(&chip->vendor.read_queue);
-	disable_irq_nosync(chip->vendor.irq);
+	wake_up_interruptible(&chip->read_queue);
+	disable_irq_nosync(chip->irq);
 
 	return IRQ_HANDLED;
 } /* tpm_ioserirq_handler() */
@@ -415,7 +415,7 @@ static int st33zp24_send(struct tpm_chip *chip, unsigned char *buf,
 		st33zp24_cancel(chip);
 		if (wait_for_stat
 		    (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,
-		     &chip->vendor.read_queue, false) < 0) {
+		     &chip->read_queue, false) < 0) {
 			ret = -ETIME;
 			goto out_err;
 		}
@@ -456,12 +456,12 @@ static int st33zp24_send(struct tpm_chip *chip, unsigned char *buf,
 	if (ret < 0)
 		goto out_err;
 
-	if (chip->vendor.irq) {
+	if (chip->irq) {
 		ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
 
 		ret = wait_for_stat(chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID,
 				tpm_calc_ordinal_duration(chip, ordinal),
-				&chip->vendor.read_queue, false);
+				&chip->read_queue, false);
 		if (ret < 0)
 			goto out_err;
 	}
@@ -578,7 +578,7 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
 
 	if (irq) {
 		/* INTERRUPT Setup */
-		init_waitqueue_head(&chip->vendor.read_queue);
+		init_waitqueue_head(&chip->read_queue);
 		tpm_dev->intrs = 0;
 
 		if (request_locality(chip) != LOCALITY0) {
@@ -611,9 +611,9 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
 		if (ret < 0)
 			goto _tpm_clean_answer;
 
-		chip->vendor.irq = irq;
+		chip->irq = irq;
 
-		disable_irq_nosync(chip->vendor.irq);
+		disable_irq_nosync(chip->irq);
 
 		tpm_gen_interrupt(chip);
 	}
@@ -681,7 +681,7 @@ int st33zp24_pm_resume(struct device *dev)
 		gpio_set_value(tpm_dev->io_lpcpd, 1);
 		ret = wait_for_stat(chip,
 				TPM_STS_VALID, chip->vendor.timeout_b,
-				&chip->vendor.read_queue, false);
+				&chip->read_queue, false);
 	} else {
 		ret = tpm_pm_resume(dev);
 		if (!ret)
diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 5397b64..158ddee 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -359,7 +359,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
 		goto out;
 	}
 
-	if (chip->vendor.irq)
+	if (chip->irq)
 		goto out_recv;
 
 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
@@ -890,7 +890,7 @@ int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
 
 	stop = jiffies + timeout;
 
-	if (chip->vendor.irq) {
+	if (chip->irq) {
 again:
 		timeout = stop - jiffies;
 		if ((long)timeout <= 0)
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 06d5c2a..ed837c1 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -131,15 +131,11 @@ enum tpm2_startup_types {
 struct tpm_chip;
 
 struct tpm_vendor_specific {
-	int irq;
-
 	int locality;
 	unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
 	bool timeout_adjusted;
 	unsigned long duration[3]; /* jiffies */
 	bool duration_adjusted;
-
-	wait_queue_head_t read_queue;
 };
 
 #define TPM_VPRIV(c)     ((c)->priv)
@@ -159,6 +155,9 @@ struct tpm_chip {
 	struct device dev;
 	struct cdev cdev;
 	void *priv;
+	int irq;
+
+	wait_queue_head_t read_queue;
 
 	/* A driver callback under ops cannot be run unless ops_sem is held
 	 * (sometimes implicitly, eg for the sysfs code). ops becomes null
diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
index 92cd080..e76004f 100644
--- a/drivers/char/tpm/tpm_i2c_atmel.c
+++ b/drivers/char/tpm/tpm_i2c_atmel.c
@@ -173,7 +173,7 @@ static int i2c_atmel_probe(struct i2c_client *client,
 	chip->vendor.timeout_b = msecs_to_jiffies(TPM_I2C_LONG_TIMEOUT);
 	chip->vendor.timeout_c = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
 	chip->vendor.timeout_d = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
-	chip->vendor.irq = 0;
+	chip->irq = 0;
 
 	/* There is no known way to probe for this device, and all version
 	 * information seems to be read via TPM commands. Thus we rely on the
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index e74f1c1..959a025 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -586,7 +586,7 @@ static int tpm_tis_i2c_init(struct device *dev)
 		return PTR_ERR(chip);
 
 	/* Disable interrupts */
-	chip->vendor.irq = 0;
+	chip->irq = 0;
 
 	/* Default timeouts */
 	chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
index a9c6b2d..88c1a7e 100644
--- a/drivers/char/tpm/tpm_i2c_nuvoton.c
+++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
@@ -176,12 +176,12 @@ static bool i2c_nuvoton_check_status(struct tpm_chip *chip, u8 mask, u8 value)
 static int i2c_nuvoton_wait_for_stat(struct tpm_chip *chip, u8 mask, u8 value,
 				     u32 timeout, wait_queue_head_t *queue)
 {
-	if (chip->vendor.irq && queue) {
+	if (chip->irq && queue) {
 		s32 rc;
 		struct priv_data *priv = chip->priv;
 		unsigned int cur_intrs = priv->intrs;
 
-		enable_irq(chip->vendor.irq);
+		enable_irq(chip->irq);
 		rc = wait_event_interruptible_timeout(*queue,
 						      cur_intrs != priv->intrs,
 						      timeout);
@@ -237,7 +237,7 @@ static int i2c_nuvoton_recv_data(struct i2c_client *client,
 	while (size < count &&
 	       i2c_nuvoton_wait_for_data_avail(chip,
 					       chip->vendor.timeout_c,
-					       &chip->vendor.read_queue) == 0) {
+					       &chip->read_queue) == 0) {
 		burst_count = i2c_nuvoton_get_burstcount(client, chip);
 		if (burst_count < 0) {
 			dev_err(&chip->dev,
@@ -285,7 +285,7 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		 * tag, paramsize, and result
 		 */
 		status = i2c_nuvoton_wait_for_data_avail(
-			chip, chip->vendor.timeout_c, &chip->vendor.read_queue);
+			chip, chip->vendor.timeout_c, &chip->read_queue);
 		if (status != 0) {
 			dev_err(dev, "%s() timeout on dataAvail\n", __func__);
 			size = -ETIMEDOUT;
@@ -439,7 +439,7 @@ static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len)
 	rc = i2c_nuvoton_wait_for_data_avail(chip,
 					     tpm_calc_ordinal_duration(chip,
 								       ordinal),
-					     &chip->vendor.read_queue);
+					     &chip->read_queue);
 	if (rc) {
 		dev_err(dev, "%s() timeout command duration\n", __func__);
 		i2c_nuvoton_ready(chip);
@@ -476,8 +476,8 @@ static irqreturn_t i2c_nuvoton_int_handler(int dummy, void *dev_id)
 	struct priv_data *priv = chip->priv;
 
 	priv->intrs++;
-	wake_up(&chip->vendor.read_queue);
-	disable_irq_nosync(chip->vendor.irq);
+	wake_up(&chip->read_queue);
+	disable_irq_nosync(chip->irq);
 	return IRQ_HANDLED;
 }
 
@@ -539,7 +539,7 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
 	if (!chip->priv)
 		return -ENOMEM;
 
-	init_waitqueue_head(&chip->vendor.read_queue);
+	init_waitqueue_head(&chip->read_queue);
 
 	/* Default timeouts */
 	chip->vendor.timeout_a = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
@@ -552,19 +552,19 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
 	 *   TPM_INTF_INT_LEVEL_LOW | TPM_INTF_DATA_AVAIL_INT
 	 * The IRQ should be set in the i2c_board_info (which is done
 	 * automatically in of_i2c_register_devices, for device tree users */
-	chip->vendor.irq = client->irq;
+	chip->irq = client->irq;
 
-	if (chip->vendor.irq) {
-		dev_dbg(dev, "%s() chip-vendor.irq\n", __func__);
-		rc = devm_request_irq(dev, chip->vendor.irq,
+	if (chip->irq) {
+		dev_dbg(dev, "%s() chip-irq\n", __func__);
+		rc = devm_request_irq(dev, chip->irq,
 				      i2c_nuvoton_int_handler,
 				      IRQF_TRIGGER_LOW,
 				      dev_name(&chip->dev),
 				      chip);
 		if (rc) {
 			dev_err(dev, "%s() Unable to request irq: %d for use\n",
-				__func__, chip->vendor.irq);
-			chip->vendor.irq = 0;
+				__func__, chip->irq);
+			chip->irq = 0;
 		} else {
 			/* Clear any pending interrupt */
 			i2c_nuvoton_ready(chip);
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 96cb824..ba00499 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -251,7 +251,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 	       wait_for_tpm_stat(chip,
 				 TPM_STS_DATA_AVAIL | TPM_STS_VALID,
 				 chip->vendor.timeout_c,
-				 &chip->vendor.read_queue, true)
+				 &chip->read_queue, true)
 	       == 0) {
 		burstcnt = get_burstcount(chip);
 		for (; burstcnt > 0 && size < count; burstcnt--)
@@ -419,7 +419,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
 
 		if (wait_for_tpm_stat
 		    (chip, TPM_STS_DATA_AVAIL | TPM_STS_VALID, dur,
-		     &chip->vendor.read_queue, false) < 0) {
+		     &chip->read_queue, false) < 0) {
 			rc = -ETIME;
 			goto out_err;
 		}
@@ -571,7 +571,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 
 	((struct priv_data *)chip->priv)->irq_tested = true;
 	if (interrupt & TPM_INTF_DATA_AVAIL_INT)
-		wake_up_interruptible(&chip->vendor.read_queue);
+		wake_up_interruptible(&chip->read_queue);
 	if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
 		for (i = 0; i < 5; i++)
 			if (check_locality(chip, i) >= 0)
@@ -796,7 +796,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 	}
 
 	/* INTERRUPT Setup */
-	init_waitqueue_head(&chip->vendor.read_queue);
+	init_waitqueue_head(&chip->read_queue);
 	init_waitqueue_head(&priv->int_queue);
 	if (interrupts && tpm_info->irq != -1) {
 		if (tpm_info->irq) {
diff --git a/drivers/char/tpm/xen-tpmfront.c b/drivers/char/tpm/xen-tpmfront.c
index 3111f27..0af9809 100644
--- a/drivers/char/tpm/xen-tpmfront.c
+++ b/drivers/char/tpm/xen-tpmfront.c
@@ -88,7 +88,7 @@ static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
 
 	/* Wait for completion of any existing command or cancellation */
 	if (wait_for_tpm_stat(chip, VTPM_STATUS_IDLE, chip->vendor.timeout_c,
-			&chip->vendor.read_queue, true) < 0) {
+			&chip->read_queue, true) < 0) {
 		vtpm_cancel(chip);
 		return -ETIME;
 	}
@@ -104,7 +104,7 @@ static int vtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
 	duration = tpm_calc_ordinal_duration(chip, ordinal);
 
 	if (wait_for_tpm_stat(chip, VTPM_STATUS_IDLE, duration,
-			&chip->vendor.read_queue, true) < 0) {
+			&chip->read_queue, true) < 0) {
 		/* got a signal or timeout, try to cancel */
 		vtpm_cancel(chip);
 		return -ETIME;
@@ -125,7 +125,7 @@ static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 
 	/* In theory the wait at the end of _send makes this one unnecessary */
 	if (wait_for_tpm_stat(chip, VTPM_STATUS_RESULT, chip->vendor.timeout_c,
-			&chip->vendor.read_queue, true) < 0) {
+			&chip->read_queue, true) < 0) {
 		vtpm_cancel(chip);
 		return -ETIME;
 	}
@@ -161,7 +161,7 @@ static irqreturn_t tpmif_interrupt(int dummy, void *dev_id)
 	switch (priv->shr->state) {
 	case VTPM_STATE_IDLE:
 	case VTPM_STATE_FINISH:
-		wake_up_interruptible(&priv->chip->vendor.read_queue);
+		wake_up_interruptible(&priv->chip->read_queue);
 		break;
 	case VTPM_STATE_SUBMIT:
 	case VTPM_STATE_CANCEL:
@@ -179,7 +179,7 @@ static int setup_chip(struct device *dev, struct tpm_private *priv)
 	if (IS_ERR(chip))
 		return PTR_ERR(chip);
 
-	init_waitqueue_head(&chip->vendor.read_queue);
+	init_waitqueue_head(&chip->read_queue);
 
 	priv->chip = chip;
 	TPM_VPRIV(chip) = priv;
-- 
2.5.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/5] tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos
       [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
                     ` (3 preceding siblings ...)
  2016-03-23 20:17   ` [PATCH 4/5] tpm: Move irqs field from tpm_vendor_specific to tpm_chip structure Christophe Ricard
@ 2016-03-23 20:17   ` Christophe Ricard
       [not found]     ` <1458764240-24185-6-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  4 siblings, 1 reply; 16+ messages in thread
From: Christophe Ricard @ 2016-03-23 20:17 UTC (permalink / raw)
  To: jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

As no more information available in tpm_vendor_specific structure are
available in tpm_vendor_specific structure rename it tpm_protocol_infos.

Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
---
 drivers/char/tpm/st33zp24/st33zp24.c |  28 ++++----
 drivers/char/tpm/tpm-interface.c     |  48 +++++++-------
 drivers/char/tpm/tpm-sysfs.c         |  20 +++---
 drivers/char/tpm/tpm.h               |   4 +-
 drivers/char/tpm/tpm2-cmd.c          |   2 +-
 drivers/char/tpm/tpm_i2c_atmel.c     |   8 +--
 drivers/char/tpm/tpm_i2c_infineon.c  |  44 ++++++-------
 drivers/char/tpm/tpm_i2c_nuvoton.c   |  24 +++----
 drivers/char/tpm/tpm_tis.c           | 120 +++++++++++++++++------------------
 9 files changed, 149 insertions(+), 149 deletions(-)

diff --git a/drivers/char/tpm/st33zp24/st33zp24.c b/drivers/char/tpm/st33zp24/st33zp24.c
index 82dc4d11..305396e 100644
--- a/drivers/char/tpm/st33zp24/st33zp24.c
+++ b/drivers/char/tpm/st33zp24/st33zp24.c
@@ -144,7 +144,7 @@ static int check_locality(struct tpm_chip *chip)
 	if (status && (data &
 		(TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
 		(TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
-		return chip->vendor.locality;
+		return chip->protocol_infos.locality;
 
 	return -EACCES;
 } /* check_locality() */
@@ -161,8 +161,8 @@ static int request_locality(struct tpm_chip *chip)
 	struct st33zp24_dev *tpm_dev;
 	u8 data;
 
-	if (check_locality(chip) == chip->vendor.locality)
-		return chip->vendor.locality;
+	if (check_locality(chip) == chip->protocol_infos.locality)
+		return chip->protocol_infos.locality;
 
 	tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip);
 
@@ -171,12 +171,12 @@ static int request_locality(struct tpm_chip *chip)
 	if (ret < 0)
 		return ret;
 
-	stop = jiffies + chip->vendor.timeout_a;
+	stop = jiffies + chip->protocol_infos.timeout_a;
 
 	/* Request locality is usually effective after the request */
 	do {
 		if (check_locality(chip) >= 0)
-			return chip->vendor.locality;
+			return chip->protocol_infos.locality;
 		msleep(TPM_TIMEOUT);
 	} while (time_before(jiffies, stop));
 
@@ -213,7 +213,7 @@ static int get_burstcount(struct tpm_chip *chip)
 
 	tpm_dev = (struct st33zp24_dev *)TPM_VPRIV(chip);
 
-	stop = jiffies + chip->vendor.timeout_d;
+	stop = jiffies + chip->protocol_infos.timeout_d;
 	do {
 		status = tpm_dev->ops->recv(tpm_dev->phy_id, TPM_STS + 1,
 					    &temp, 1);
@@ -345,7 +345,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 	while (size < count &&
 	       wait_for_stat(chip,
 			     TPM_STS_DATA_AVAIL | TPM_STS_VALID,
-			     chip->vendor.timeout_c,
+			     chip->protocol_infos.timeout_c,
 			     &chip->read_queue, true) == 0) {
 		burstcnt = get_burstcount(chip);
 		if (burstcnt < 0)
@@ -414,7 +414,7 @@ static int st33zp24_send(struct tpm_chip *chip, unsigned char *buf,
 	if ((status & TPM_STS_COMMAND_READY) == 0) {
 		st33zp24_cancel(chip);
 		if (wait_for_stat
-		    (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,
+		    (chip, TPM_STS_COMMAND_READY, chip->protocol_infos.timeout_b,
 		     &chip->read_queue, false) < 0) {
 			ret = -ETIME;
 			goto out_err;
@@ -569,12 +569,12 @@ int st33zp24_probe(void *phy_id, const struct st33zp24_phy_ops *ops,
 	tpm_dev->phy_id = phy_id;
 	tpm_dev->ops = ops;
 
-	chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
-	chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
-	chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
-	chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
+	chip->protocol_infos.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
 
-	chip->vendor.locality = LOCALITY0;
+	chip->protocol_infos.locality = LOCALITY0;
 
 	if (irq) {
 		/* INTERRUPT Setup */
@@ -680,7 +680,7 @@ int st33zp24_pm_resume(struct device *dev)
 	if (gpio_is_valid(tpm_dev->io_lpcpd)) {
 		gpio_set_value(tpm_dev->io_lpcpd, 1);
 		ret = wait_for_stat(chip,
-				TPM_STS_VALID, chip->vendor.timeout_b,
+				TPM_STS_VALID, chip->protocol_infos.timeout_b,
 				&chip->read_queue, false);
 	} else {
 		ret = tpm_pm_resume(dev);
diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
index 158ddee..8ee335e 100644
--- a/drivers/char/tpm/tpm-interface.c
+++ b/drivers/char/tpm/tpm-interface.c
@@ -319,7 +319,7 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
 		duration_idx = tpm_ordinal_duration[ordinal];
 
 	if (duration_idx != TPM_UNDEFINED)
-		duration = chip->vendor.duration[duration_idx];
+		duration = chip->protocol_infos.duration[duration_idx];
 	if (duration <= 0)
 		return 2 * 60 * HZ;
 	else
@@ -505,15 +505,15 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 
 	if (chip->flags & TPM_CHIP_FLAG_TPM2) {
 		/* Fixed timeouts for TPM2 */
-		chip->vendor.timeout_a = msecs_to_jiffies(TPM2_TIMEOUT_A);
-		chip->vendor.timeout_b = msecs_to_jiffies(TPM2_TIMEOUT_B);
-		chip->vendor.timeout_c = msecs_to_jiffies(TPM2_TIMEOUT_C);
-		chip->vendor.timeout_d = msecs_to_jiffies(TPM2_TIMEOUT_D);
-		chip->vendor.duration[TPM_SHORT] =
+		chip->protocol_infos.timeout_a = msecs_to_jiffies(TPM2_TIMEOUT_A);
+		chip->protocol_infos.timeout_b = msecs_to_jiffies(TPM2_TIMEOUT_B);
+		chip->protocol_infos.timeout_c = msecs_to_jiffies(TPM2_TIMEOUT_C);
+		chip->protocol_infos.timeout_d = msecs_to_jiffies(TPM2_TIMEOUT_D);
+		chip->protocol_infos.duration[TPM_SHORT] =
 		    msecs_to_jiffies(TPM2_DURATION_SHORT);
-		chip->vendor.duration[TPM_MEDIUM] =
+		chip->protocol_infos.duration[TPM_MEDIUM] =
 		    msecs_to_jiffies(TPM2_DURATION_MEDIUM);
-		chip->vendor.duration[TPM_LONG] =
+		chip->protocol_infos.duration[TPM_LONG] =
 		    msecs_to_jiffies(TPM2_DURATION_LONG);
 		return 0;
 	}
@@ -561,10 +561,10 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 	 * of misreporting.
 	 */
 	if (chip->ops->update_timeouts != NULL)
-		chip->vendor.timeout_adjusted =
+		chip->protocol_infos.timeout_adjusted =
 			chip->ops->update_timeouts(chip, new_timeout);
 
-	if (!chip->vendor.timeout_adjusted) {
+	if (!chip->protocol_infos.timeout_adjusted) {
 		/* Don't overwrite default if value is 0 */
 		if (new_timeout[0] != 0 && new_timeout[0] < 1000) {
 			int i;
@@ -572,12 +572,12 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 			/* timeouts in msec rather usec */
 			for (i = 0; i != ARRAY_SIZE(new_timeout); i++)
 				new_timeout[i] *= 1000;
-			chip->vendor.timeout_adjusted = true;
+			chip->protocol_infos.timeout_adjusted = true;
 		}
 	}
 
 	/* Report adjusted timeouts */
-	if (chip->vendor.timeout_adjusted) {
+	if (chip->protocol_infos.timeout_adjusted) {
 		dev_info(&chip->dev,
 			 HW_ERR "Adjusting reported timeouts: A %lu->%luus B %lu->%luus C %lu->%luus D %lu->%luus\n",
 			 old_timeout[0], new_timeout[0],
@@ -586,10 +586,10 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 			 old_timeout[3], new_timeout[3]);
 	}
 
-	chip->vendor.timeout_a = usecs_to_jiffies(new_timeout[0]);
-	chip->vendor.timeout_b = usecs_to_jiffies(new_timeout[1]);
-	chip->vendor.timeout_c = usecs_to_jiffies(new_timeout[2]);
-	chip->vendor.timeout_d = usecs_to_jiffies(new_timeout[3]);
+	chip->protocol_infos.timeout_a = usecs_to_jiffies(new_timeout[0]);
+	chip->protocol_infos.timeout_b = usecs_to_jiffies(new_timeout[1]);
+	chip->protocol_infos.timeout_c = usecs_to_jiffies(new_timeout[2]);
+	chip->protocol_infos.timeout_d = usecs_to_jiffies(new_timeout[3]);
 
 duration:
 	tpm_cmd.header.in = tpm_getcap_header;
@@ -608,11 +608,11 @@ duration:
 		return -EINVAL;
 
 	duration_cap = &tpm_cmd.params.getcap_out.cap.duration;
-	chip->vendor.duration[TPM_SHORT] =
+	chip->protocol_infos.duration[TPM_SHORT] =
 	    usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short));
-	chip->vendor.duration[TPM_MEDIUM] =
+	chip->protocol_infos.duration[TPM_MEDIUM] =
 	    usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_medium));
-	chip->vendor.duration[TPM_LONG] =
+	chip->protocol_infos.duration[TPM_LONG] =
 	    usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_long));
 
 	/* The Broadcom BCM0102 chipset in a Dell Latitude D820 gets the above
@@ -620,11 +620,11 @@ duration:
 	 * fix up the resulting too-small TPM_SHORT value to make things work.
 	 * We also scale the TPM_MEDIUM and -_LONG values by 1000.
 	 */
-	if (chip->vendor.duration[TPM_SHORT] < (HZ / 100)) {
-		chip->vendor.duration[TPM_SHORT] = HZ;
-		chip->vendor.duration[TPM_MEDIUM] *= 1000;
-		chip->vendor.duration[TPM_LONG] *= 1000;
-		chip->vendor.duration_adjusted = true;
+	if (chip->protocol_infos.duration[TPM_SHORT] < (HZ / 100)) {
+		chip->protocol_infos.duration[TPM_SHORT] = HZ;
+		chip->protocol_infos.duration[TPM_MEDIUM] *= 1000;
+		chip->protocol_infos.duration[TPM_LONG] *= 1000;
+		chip->protocol_infos.duration_adjusted = true;
 		dev_info(&chip->dev, "Adjusting TPM timeout parameters.");
 	}
 	return 0;
diff --git a/drivers/char/tpm/tpm-sysfs.c b/drivers/char/tpm/tpm-sysfs.c
index 34e7fc7..cf45d08 100644
--- a/drivers/char/tpm/tpm-sysfs.c
+++ b/drivers/char/tpm/tpm-sysfs.c
@@ -236,14 +236,14 @@ static ssize_t durations_show(struct device *dev, struct device_attribute *attr,
 {
 	struct tpm_chip *chip = dev_get_drvdata(dev);
 
-	if (chip->vendor.duration[TPM_LONG] == 0)
+	if (chip->protocol_infos.duration[TPM_LONG] == 0)
 		return 0;
 
 	return sprintf(buf, "%d %d %d [%s]\n",
-		       jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
-		       jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),
-		       jiffies_to_usecs(chip->vendor.duration[TPM_LONG]),
-		       chip->vendor.duration_adjusted
+		       jiffies_to_usecs(chip->protocol_infos.duration[TPM_SHORT]),
+		       jiffies_to_usecs(chip->protocol_infos.duration[TPM_MEDIUM]),
+		       jiffies_to_usecs(chip->protocol_infos.duration[TPM_LONG]),
+		       chip->protocol_infos.duration_adjusted
 		       ? "adjusted" : "original");
 }
 static DEVICE_ATTR_RO(durations);
@@ -254,11 +254,11 @@ static ssize_t timeouts_show(struct device *dev, struct device_attribute *attr,
 	struct tpm_chip *chip = dev_get_drvdata(dev);
 
 	return sprintf(buf, "%d %d %d %d [%s]\n",
-		       jiffies_to_usecs(chip->vendor.timeout_a),
-		       jiffies_to_usecs(chip->vendor.timeout_b),
-		       jiffies_to_usecs(chip->vendor.timeout_c),
-		       jiffies_to_usecs(chip->vendor.timeout_d),
-		       chip->vendor.timeout_adjusted
+		       jiffies_to_usecs(chip->protocol_infos.timeout_a),
+		       jiffies_to_usecs(chip->protocol_infos.timeout_b),
+		       jiffies_to_usecs(chip->protocol_infos.timeout_c),
+		       jiffies_to_usecs(chip->protocol_infos.timeout_d),
+		       chip->protocol_infos.timeout_adjusted
 		       ? "adjusted" : "original");
 }
 static DEVICE_ATTR_RO(timeouts);
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index ed837c1..1744f9b 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -130,7 +130,7 @@ enum tpm2_startup_types {
 
 struct tpm_chip;
 
-struct tpm_vendor_specific {
+struct tpm_protocol_infos {
 	int locality;
 	unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
 	bool timeout_adjusted;
@@ -173,7 +173,7 @@ struct tpm_chip {
 
 	struct mutex tpm_mutex;	/* tpm is processing */
 
-	struct tpm_vendor_specific vendor;
+	struct tpm_protocol_infos protocol_infos;
 
 	struct dentry **bios_dir;
 
diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
index 5fc0e7c..6f0b1f1 100644
--- a/drivers/char/tpm/tpm2-cmd.c
+++ b/drivers/char/tpm/tpm2-cmd.c
@@ -793,7 +793,7 @@ unsigned long tpm2_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal)
 		index = tpm2_ordinal_duration[ordinal - TPM2_CC_FIRST];
 
 	if (index != TPM_UNDEFINED)
-		duration = chip->vendor.duration[index];
+		duration = chip->protocol_infos.duration[index];
 
 	if (duration <= 0)
 		duration = 2 * 60 * HZ;
diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
index e76004f..3d31abf 100644
--- a/drivers/char/tpm/tpm_i2c_atmel.c
+++ b/drivers/char/tpm/tpm_i2c_atmel.c
@@ -169,10 +169,10 @@ static int i2c_atmel_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	/* Default timeouts */
-	chip->vendor.timeout_a = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
-	chip->vendor.timeout_b = msecs_to_jiffies(TPM_I2C_LONG_TIMEOUT);
-	chip->vendor.timeout_c = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
-	chip->vendor.timeout_d = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_a = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_b = msecs_to_jiffies(TPM_I2C_LONG_TIMEOUT);
+	chip->protocol_infos.timeout_c = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_d = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
 	chip->irq = 0;
 
 	/* There is no known way to probe for this device, and all version
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index 959a025..5ce4e89 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -288,7 +288,7 @@ static int check_locality(struct tpm_chip *chip, int loc)
 
 	if ((buf & (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
 	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) {
-		chip->vendor.locality = loc;
+		chip->protocol_infos.locality = loc;
 		return loc;
 	}
 
@@ -320,7 +320,7 @@ static int request_locality(struct tpm_chip *chip, int loc)
 	iic_tpm_write(TPM_ACCESS(loc), &buf, 1);
 
 	/* wait for burstcount */
-	stop = jiffies + chip->vendor.timeout_a;
+	stop = jiffies + chip->protocol_infos.timeout_a;
 	do {
 		if (check_locality(chip, loc) >= 0)
 			return loc;
@@ -337,7 +337,7 @@ static u8 tpm_tis_i2c_status(struct tpm_chip *chip)
 	u8 i = 0;
 
 	do {
-		if (iic_tpm_read(TPM_STS(chip->vendor.locality), &buf, 1) < 0)
+		if (iic_tpm_read(TPM_STS(chip->protocol_infos.locality), &buf, 1) < 0)
 			return 0;
 
 		i++;
@@ -351,7 +351,7 @@ static void tpm_tis_i2c_ready(struct tpm_chip *chip)
 {
 	/* this causes the current command to be aborted */
 	u8 buf = TPM_STS_COMMAND_READY;
-	iic_tpm_write_long(TPM_STS(chip->vendor.locality), &buf, 1);
+	iic_tpm_write_long(TPM_STS(chip->protocol_infos.locality), &buf, 1);
 }
 
 static ssize_t get_burstcount(struct tpm_chip *chip)
@@ -362,10 +362,10 @@ static ssize_t get_burstcount(struct tpm_chip *chip)
 
 	/* wait for burstcount */
 	/* which timeout value, spec has 2 answers (c & d) */
-	stop = jiffies + chip->vendor.timeout_d;
+	stop = jiffies + chip->protocol_infos.timeout_d;
 	do {
 		/* Note: STS is little endian */
-		if (iic_tpm_read(TPM_STS(chip->vendor.locality)+1, buf, 3) < 0)
+		if (iic_tpm_read(TPM_STS(chip->protocol_infos.locality)+1, buf, 3) < 0)
 			burstcnt = 0;
 		else
 			burstcnt = (buf[2] << 16) + (buf[1] << 8) + buf[0];
@@ -419,7 +419,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 		if (burstcnt > (count - size))
 			burstcnt = count - size;
 
-		rc = iic_tpm_read(TPM_DATA_FIFO(chip->vendor.locality),
+		rc = iic_tpm_read(TPM_DATA_FIFO(chip->protocol_infos.locality),
 				  &(buf[size]), burstcnt);
 		if (rc == 0)
 			size += burstcnt;
@@ -464,7 +464,7 @@ static int tpm_tis_i2c_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		goto out;
 	}
 
-	wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &status);
+	wait_for_stat(chip, TPM_STS_VALID, chip->protocol_infos.timeout_c, &status);
 	if (status & TPM_STS_DATA_AVAIL) {	/* retry? */
 		dev_err(&chip->dev, "Error left over data\n");
 		size = -EIO;
@@ -477,7 +477,7 @@ out:
 	 * so we sleep rather than keeping the bus busy
 	 */
 	usleep_range(SLEEP_DURATION_RESET_LOW, SLEEP_DURATION_RESET_HI);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 	return size;
 }
 
@@ -500,7 +500,7 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len)
 		tpm_tis_i2c_ready(chip);
 		if (wait_for_stat
 		    (chip, TPM_STS_COMMAND_READY,
-		     chip->vendor.timeout_b, &status) < 0) {
+		     chip->protocol_infos.timeout_b, &status) < 0) {
 			rc = -ETIME;
 			goto out_err;
 		}
@@ -516,7 +516,7 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len)
 		if (burstcnt > (len - 1 - count))
 			burstcnt = len - 1 - count;
 
-		rc = iic_tpm_write(TPM_DATA_FIFO(chip->vendor.locality),
+		rc = iic_tpm_write(TPM_DATA_FIFO(chip->protocol_infos.locality),
 				   &(buf[count]), burstcnt);
 		if (rc == 0)
 			count += burstcnt;
@@ -530,7 +530,7 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len)
 		}
 
 		wait_for_stat(chip, TPM_STS_VALID,
-			      chip->vendor.timeout_c, &status);
+			      chip->protocol_infos.timeout_c, &status);
 
 		if ((status & TPM_STS_DATA_EXPECT) == 0) {
 			rc = -EIO;
@@ -539,15 +539,15 @@ static int tpm_tis_i2c_send(struct tpm_chip *chip, u8 *buf, size_t len)
 	}
 
 	/* write last byte */
-	iic_tpm_write(TPM_DATA_FIFO(chip->vendor.locality), &(buf[count]), 1);
-	wait_for_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c, &status);
+	iic_tpm_write(TPM_DATA_FIFO(chip->protocol_infos.locality), &(buf[count]), 1);
+	wait_for_stat(chip, TPM_STS_VALID, chip->protocol_infos.timeout_c, &status);
 	if ((status & TPM_STS_DATA_EXPECT) != 0) {
 		rc = -EIO;
 		goto out_err;
 	}
 
 	/* go and do it */
-	iic_tpm_write(TPM_STS(chip->vendor.locality), &sts, 1);
+	iic_tpm_write(TPM_STS(chip->protocol_infos.locality), &sts, 1);
 
 	return len;
 out_err:
@@ -556,7 +556,7 @@ out_err:
 	 * so we sleep rather than keeping the bus busy
 	 */
 	usleep_range(SLEEP_DURATION_RESET_LOW, SLEEP_DURATION_RESET_HI);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 	return rc;
 }
 
@@ -589,10 +589,10 @@ static int tpm_tis_i2c_init(struct device *dev)
 	chip->irq = 0;
 
 	/* Default timeouts */
-	chip->vendor.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
-	chip->vendor.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
-	chip->vendor.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
-	chip->vendor.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_a = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_b = msecs_to_jiffies(TIS_LONG_TIMEOUT);
+	chip->protocol_infos.timeout_c = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_d = msecs_to_jiffies(TIS_SHORT_TIMEOUT);
 
 	if (request_locality(chip, 0) != 0) {
 		dev_err(dev, "could not request locality\n");
@@ -626,7 +626,7 @@ static int tpm_tis_i2c_init(struct device *dev)
 
 	return tpm_chip_register(chip);
 out_release:
-	release_locality(chip, chip->vendor.locality, 1);
+	release_locality(chip, chip->protocol_infos.locality, 1);
 	tpm_dev.client = NULL;
 out_err:
 	return rc;
@@ -698,7 +698,7 @@ static int tpm_tis_i2c_remove(struct i2c_client *client)
 	struct tpm_chip *chip = tpm_dev.chip;
 
 	tpm_chip_unregister(chip);
-	release_locality(chip, chip->vendor.locality, 1);
+	release_locality(chip, chip->protocol_infos.locality, 1);
 	tpm_dev.client = NULL;
 
 	return 0;
diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
index 88c1a7e..cbe7bb1 100644
--- a/drivers/char/tpm/tpm_i2c_nuvoton.c
+++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
@@ -142,7 +142,7 @@ static void i2c_nuvoton_ready(struct tpm_chip *chip)
 static int i2c_nuvoton_get_burstcount(struct i2c_client *client,
 				      struct tpm_chip *chip)
 {
-	unsigned long stop = jiffies + chip->vendor.timeout_d;
+	unsigned long stop = jiffies + chip->protocol_infos.timeout_d;
 	s32 status;
 	int burst_count = -1;
 	u8 data;
@@ -236,7 +236,7 @@ static int i2c_nuvoton_recv_data(struct i2c_client *client,
 
 	while (size < count &&
 	       i2c_nuvoton_wait_for_data_avail(chip,
-					       chip->vendor.timeout_c,
+					       chip->protocol_infos.timeout_c,
 					       &chip->read_queue) == 0) {
 		burst_count = i2c_nuvoton_get_burstcount(client, chip);
 		if (burst_count < 0) {
@@ -285,7 +285,7 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		 * tag, paramsize, and result
 		 */
 		status = i2c_nuvoton_wait_for_data_avail(
-			chip, chip->vendor.timeout_c, &chip->read_queue);
+			chip, chip->protocol_infos.timeout_c, &chip->read_queue);
 		if (status != 0) {
 			dev_err(dev, "%s() timeout on dataAvail\n", __func__);
 			size = -ETIMEDOUT;
@@ -325,7 +325,7 @@ static int i2c_nuvoton_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		}
 		if (i2c_nuvoton_wait_for_stat(
 			    chip, TPM_STS_VALID | TPM_STS_DATA_AVAIL,
-			    TPM_STS_VALID, chip->vendor.timeout_c,
+			    TPM_STS_VALID, chip->protocol_infos.timeout_c,
 			    NULL)) {
 			dev_err(dev, "%s() error left over data\n", __func__);
 			size = -ETIMEDOUT;
@@ -357,7 +357,7 @@ static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len)
 		i2c_nuvoton_ready(chip);
 		if (i2c_nuvoton_wait_for_stat(chip, TPM_STS_COMMAND_READY,
 					      TPM_STS_COMMAND_READY,
-					      chip->vendor.timeout_b, NULL)) {
+					      chip->protocol_infos.timeout_b, NULL)) {
 			dev_err(dev, "%s() timeout on commandReady\n",
 				__func__);
 			rc = -EIO;
@@ -389,7 +389,7 @@ static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len)
 						       TPM_STS_EXPECT,
 						       TPM_STS_VALID |
 						       TPM_STS_EXPECT,
-						       chip->vendor.timeout_c,
+						       chip->protocol_infos.timeout_c,
 						       NULL);
 			if (rc < 0) {
 				dev_err(dev, "%s() timeout on Expect\n",
@@ -414,7 +414,7 @@ static int i2c_nuvoton_send(struct tpm_chip *chip, u8 *buf, size_t len)
 		rc = i2c_nuvoton_wait_for_stat(chip,
 					       TPM_STS_VALID | TPM_STS_EXPECT,
 					       TPM_STS_VALID,
-					       chip->vendor.timeout_c, NULL);
+					       chip->protocol_infos.timeout_c, NULL);
 		if (rc) {
 			dev_err(dev, "%s() timeout on Expect to clear\n",
 				__func__);
@@ -542,10 +542,10 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
 	init_waitqueue_head(&chip->read_queue);
 
 	/* Default timeouts */
-	chip->vendor.timeout_a = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
-	chip->vendor.timeout_b = msecs_to_jiffies(TPM_I2C_LONG_TIMEOUT);
-	chip->vendor.timeout_c = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
-	chip->vendor.timeout_d = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_a = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_b = msecs_to_jiffies(TPM_I2C_LONG_TIMEOUT);
+	chip->protocol_infos.timeout_c = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
+	chip->protocol_infos.timeout_d = msecs_to_jiffies(TPM_I2C_SHORT_TIMEOUT);
 
 	/*
 	 * I2C intfcaps (interrupt capabilitieis) in the chip are hard coded to:
@@ -572,7 +572,7 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
 			rc = i2c_nuvoton_wait_for_stat(chip,
 						       TPM_STS_COMMAND_READY,
 						       TPM_STS_COMMAND_READY,
-						       chip->vendor.timeout_b,
+						       chip->protocol_infos.timeout_b,
 						       NULL);
 			if (rc == 0) {
 				/*
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index ba00499..4f626b9 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -130,7 +130,7 @@ static inline int is_itpm(struct acpi_device *dev)
 static int wait_startup(struct tpm_chip *chip, int l)
 {
 	struct priv_data *priv = chip->priv;
-	unsigned long stop = jiffies + chip->vendor.timeout_a;
+	unsigned long stop = jiffies + chip->protocol_infos.timeout_a;
 	do {
 		if (ioread8(priv->iobase + TPM_ACCESS(l)) &
 		    TPM_ACCESS_VALID)
@@ -147,7 +147,7 @@ static int check_locality(struct tpm_chip *chip, int l)
 	if ((ioread8(priv->iobase + TPM_ACCESS(l)) &
 	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
 	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
-		return chip->vendor.locality = l;
+		return chip->protocol_infos.locality = l;
 
 	return -1;
 }
@@ -175,9 +175,9 @@ static int request_locality(struct tpm_chip *chip, int l)
 	iowrite8(TPM_ACCESS_REQUEST_USE,
 		 priv->iobase + TPM_ACCESS(l));
 
-	stop = jiffies + chip->vendor.timeout_a;
+	stop = jiffies + chip->protocol_infos.timeout_a;
 
-	if (chip->vendor.irq) {
+	if (chip->irq) {
 again:
 		timeout = stop - jiffies;
 		if ((long)timeout <= 0)
@@ -209,7 +209,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip)
 	struct priv_data *priv = chip->priv;
 
 	return ioread8(priv->iobase +
-		       TPM_STS(chip->vendor.locality));
+		       TPM_STS(chip->protocol_infos.locality));
 }
 
 static void tpm_tis_ready(struct tpm_chip *chip)
@@ -218,7 +218,7 @@ static void tpm_tis_ready(struct tpm_chip *chip)
 
 	/* this causes the current command to be aborted */
 	iowrite8(TPM_STS_COMMAND_READY,
-		 priv->iobase + TPM_STS(chip->vendor.locality));
+		 priv->iobase + TPM_STS(chip->protocol_infos.locality));
 }
 
 static int get_burstcount(struct tpm_chip *chip)
@@ -229,12 +229,12 @@ static int get_burstcount(struct tpm_chip *chip)
 
 	/* wait for burstcount */
 	/* which timeout value, spec has 2 answers (c & d) */
-	stop = jiffies + chip->vendor.timeout_d;
+	stop = jiffies + chip->protocol_infos.timeout_d;
 	do {
 		burstcnt = ioread8(priv->iobase +
-				   TPM_STS(chip->vendor.locality) + 1);
+				   TPM_STS(chip->protocol_infos.locality) + 1);
 		burstcnt += ioread8(priv->iobase +
-				    TPM_STS(chip->vendor.locality) +
+				    TPM_STS(chip->protocol_infos.locality) +
 				    2) << 8;
 		if (burstcnt)
 			return burstcnt;
@@ -250,13 +250,13 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
 	while (size < count &&
 	       wait_for_tpm_stat(chip,
 				 TPM_STS_DATA_AVAIL | TPM_STS_VALID,
-				 chip->vendor.timeout_c,
+				 chip->protocol_infos.timeout_c,
 				 &chip->read_queue, true)
 	       == 0) {
 		burstcnt = get_burstcount(chip);
 		for (; burstcnt > 0 && size < count; burstcnt--)
 			buf[size++] = ioread8(priv->iobase +
-					      TPM_DATA_FIFO(chip->vendor.
+					      TPM_DATA_FIFO(chip->protocol_infos.
 							    locality));
 	}
 	return size;
@@ -294,7 +294,7 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 		goto out;
 	}
 
-	wait_for_tpm_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+	wait_for_tpm_stat(chip, TPM_STS_VALID, chip->protocol_infos.timeout_c,
 			  &priv->int_queue, false);
 	status = tpm_tis_status(chip);
 	if (status & TPM_STS_DATA_AVAIL) {	/* retry? */
@@ -305,7 +305,7 @@ static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 
 out:
 	tpm_tis_ready(chip);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 	return size;
 }
 
@@ -331,7 +331,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 	if ((status & TPM_STS_COMMAND_READY) == 0) {
 		tpm_tis_ready(chip);
 		if (wait_for_tpm_stat
-		    (chip, TPM_STS_COMMAND_READY, chip->vendor.timeout_b,
+		    (chip, TPM_STS_COMMAND_READY, chip->protocol_infos.timeout_b,
 		     &priv->int_queue, false) < 0) {
 			rc = -ETIME;
 			goto out_err;
@@ -342,11 +342,11 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 		burstcnt = get_burstcount(chip);
 		for (; burstcnt > 0 && count < len - 1; burstcnt--) {
 			iowrite8(buf[count], priv->iobase +
-				 TPM_DATA_FIFO(chip->vendor.locality));
+				 TPM_DATA_FIFO(chip->protocol_infos.locality));
 			count++;
 		}
 
-		wait_for_tpm_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+		wait_for_tpm_stat(chip, TPM_STS_VALID, chip->protocol_infos.timeout_c,
 				  &priv->int_queue, false);
 		status = tpm_tis_status(chip);
 		if (!itpm && (status & TPM_STS_DATA_EXPECT) == 0) {
@@ -357,8 +357,8 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 
 	/* write last byte */
 	iowrite8(buf[count],
-		 priv->iobase + TPM_DATA_FIFO(chip->vendor.locality));
-	wait_for_tpm_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
+		 priv->iobase + TPM_DATA_FIFO(chip->protocol_infos.locality));
+	wait_for_tpm_stat(chip, TPM_STS_VALID, chip->protocol_infos.timeout_c,
 			  &priv->int_queue, false);
 	status = tpm_tis_status(chip);
 	if ((status & TPM_STS_DATA_EXPECT) != 0) {
@@ -370,7 +370,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
 
 out_err:
 	tpm_tis_ready(chip);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 	return rc;
 }
 
@@ -381,12 +381,12 @@ static void disable_interrupts(struct tpm_chip *chip)
 
 	intmask =
 	    ioread32(priv->iobase +
-		     TPM_INT_ENABLE(chip->vendor.locality));
+		     TPM_INT_ENABLE(chip->protocol_infos.locality));
 	intmask &= ~TPM_GLOBAL_INT_ENABLE;
 	iowrite32(intmask,
-		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
-	devm_free_irq(&chip->dev, chip->vendor.irq, chip);
-	chip->vendor.irq = 0;
+		  priv->iobase + TPM_INT_ENABLE(chip->protocol_infos.locality));
+	devm_free_irq(&chip->dev, chip->irq, chip);
+	chip->irq = 0;
 }
 
 /*
@@ -407,9 +407,9 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
 
 	/* go and do it */
 	iowrite8(TPM_STS_GO,
-		 priv->iobase + TPM_STS(chip->vendor.locality));
+		 priv->iobase + TPM_STS(chip->protocol_infos.locality));
 
-	if (chip->vendor.irq) {
+	if (chip->irq) {
 		ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
 
 		if (chip->flags & TPM_CHIP_FLAG_TPM2)
@@ -427,7 +427,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
 	return len;
 out_err:
 	tpm_tis_ready(chip);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 	return rc;
 }
 
@@ -436,14 +436,14 @@ static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
 	int rc, irq;
 	struct priv_data *priv = chip->priv;
 
-	if (!chip->vendor.irq || priv->irq_tested)
+	if (!chip->irq || priv->irq_tested)
 		return tpm_tis_send_main(chip, buf, len);
 
 	/* Verify receipt of the expected IRQ */
-	irq = chip->vendor.irq;
-	chip->vendor.irq = 0;
+	irq = chip->irq;
+	chip->irq = 0;
 	rc = tpm_tis_send_main(chip, buf, len);
-	chip->vendor.irq = irq;
+	chip->irq = irq;
 	if (!priv->irq_tested)
 		msleep(1);
 	if (!priv->irq_tested)
@@ -511,7 +511,7 @@ static int probe_itpm(struct tpm_chip *chip)
 		goto out;
 
 	tpm_tis_ready(chip);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 
 	itpm = true;
 
@@ -525,7 +525,7 @@ static int probe_itpm(struct tpm_chip *chip)
 out:
 	itpm = rem_itpm;
 	tpm_tis_ready(chip);
-	release_locality(chip, chip->vendor.locality, 0);
+	release_locality(chip, chip->protocol_infos.locality, 0);
 
 	return rc;
 }
@@ -564,7 +564,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 	int i;
 
 	interrupt = ioread32(priv->iobase +
-			     TPM_INT_STATUS(chip->vendor.locality));
+			     TPM_INT_STATUS(chip->protocol_infos.locality));
 
 	if (interrupt == 0)
 		return IRQ_NONE;
@@ -584,8 +584,8 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
 	/* Clear interrupts handled with TPM_EOI */
 	iowrite32(interrupt,
 		  priv->iobase +
-		  TPM_INT_STATUS(chip->vendor.locality));
-	ioread32(priv->iobase + TPM_INT_STATUS(chip->vendor.locality));
+		  TPM_INT_STATUS(chip->protocol_infos.locality));
+	ioread32(priv->iobase + TPM_INT_STATUS(chip->protocol_infos.locality));
 	return IRQ_HANDLED;
 }
 
@@ -605,21 +605,21 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 			 irq);
 		return -1;
 	}
-	chip->vendor.irq = irq;
+	chip->irq = irq;
 
 	original_int_vec = ioread8(priv->iobase +
-				   TPM_INT_VECTOR(chip->vendor.locality));
+				   TPM_INT_VECTOR(chip->protocol_infos.locality));
 	iowrite8(irq,
-		 priv->iobase + TPM_INT_VECTOR(chip->vendor.locality));
+		 priv->iobase + TPM_INT_VECTOR(chip->protocol_infos.locality));
 
 	/* Clear all existing */
 	iowrite32(ioread32(priv->iobase +
-			   TPM_INT_STATUS(chip->vendor.locality)),
-		  priv->iobase + TPM_INT_STATUS(chip->vendor.locality));
+			   TPM_INT_STATUS(chip->protocol_infos.locality)),
+		  priv->iobase + TPM_INT_STATUS(chip->protocol_infos.locality));
 
 	/* Turn on */
 	iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
-		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->protocol_infos.locality));
 
 	priv->irq_tested = false;
 
@@ -634,9 +634,9 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
 	/* tpm_tis_send will either confirm the interrupt is working or it
 	 * will call disable_irq which undoes all of the above.
 	 */
-	if (!chip->vendor.irq) {
+	if (!chip->irq) {
 		iowrite8(original_int_vec,
-			 priv->iobase + TPM_INT_VECTOR(chip->vendor.locality));
+			 priv->iobase + TPM_INT_VECTOR(chip->protocol_infos.locality));
 		return 1;
 	}
 
@@ -654,7 +654,7 @@ static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
 	int i;
 
 	original_int_vec = ioread8(priv->iobase +
-				   TPM_INT_VECTOR(chip->vendor.locality));
+				   TPM_INT_VECTOR(chip->protocol_infos.locality));
 
 	if (!original_int_vec) {
 		if (IS_ENABLED(CONFIG_X86))
@@ -680,10 +680,10 @@ static void tpm_tis_remove(struct tpm_chip *chip)
 
 	iowrite32(~TPM_GLOBAL_INT_ENABLE &
 		  ioread32(priv->iobase +
-			   TPM_INT_ENABLE(chip->vendor.
+			   TPM_INT_ENABLE(chip->protocol_infos.
 					  locality)),
-			   priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
-	release_locality(chip, chip->vendor.locality, 1);
+			   priv->iobase + TPM_INT_ENABLE(chip->protocol_infos.locality));
+	release_locality(chip, chip->protocol_infos.locality, 1);
 }
 
 static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
@@ -712,10 +712,10 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 		return PTR_ERR(priv->iobase);
 
 	/* Maximum timeouts */
-	chip->vendor.timeout_a = TIS_TIMEOUT_A_MAX;
-	chip->vendor.timeout_b = TIS_TIMEOUT_B_MAX;
-	chip->vendor.timeout_c = TIS_TIMEOUT_C_MAX;
-	chip->vendor.timeout_d = TIS_TIMEOUT_D_MAX;
+	chip->protocol_infos.timeout_a = TIS_TIMEOUT_A_MAX;
+	chip->protocol_infos.timeout_b = TIS_TIMEOUT_B_MAX;
+	chip->protocol_infos.timeout_c = TIS_TIMEOUT_C_MAX;
+	chip->protocol_infos.timeout_d = TIS_TIMEOUT_D_MAX;
 
 	if (wait_startup(chip, 0) != 0) {
 		rc = -ENODEV;
@@ -724,12 +724,12 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 
 	/* Take control of the TPM's interrupt hardware and shut it off */
 	intmask = ioread32(priv->iobase +
-			   TPM_INT_ENABLE(chip->vendor.locality));
+			   TPM_INT_ENABLE(chip->protocol_infos.locality));
 	intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
 		   TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
 	intmask &= ~TPM_GLOBAL_INT_ENABLE;
 	iowrite32(intmask,
-		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->protocol_infos.locality));
 
 	if (request_locality(chip, 0) != 0) {
 		rc = -ENODEV;
@@ -763,7 +763,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 	/* Figure out the capabilities */
 	intfcaps =
 	    ioread32(priv->iobase +
-		     TPM_INTF_CAPS(chip->vendor.locality));
+		     TPM_INTF_CAPS(chip->protocol_infos.locality));
 	dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
 		intfcaps);
 	if (intfcaps & TPM_INTF_BURST_COUNT_STATIC)
@@ -802,7 +802,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
 		if (tpm_info->irq) {
 			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
 						 tpm_info->irq);
-			if (!chip->vendor.irq)
+			if (!chip->irq)
 				dev_err(&chip->dev, FW_BUG
 					"TPM interrupt not working, polling instead\n");
 		} else
@@ -846,18 +846,18 @@ static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
 
 	/* reenable interrupts that device may have lost or
 	   BIOS/firmware may have disabled */
-	iowrite8(chip->vendor.irq, priv->iobase +
-		 TPM_INT_VECTOR(chip->vendor.locality));
+	iowrite8(chip->irq, priv->iobase +
+		 TPM_INT_VECTOR(chip->protocol_infos.locality));
 
 	intmask =
-	    ioread32(priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
+	    ioread32(priv->iobase + TPM_INT_ENABLE(chip->protocol_infos.locality));
 
 	intmask |= TPM_INTF_CMD_READY_INT
 	    | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
 	    | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
 
 	iowrite32(intmask,
-		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
+		  priv->iobase + TPM_INT_ENABLE(chip->protocol_infos.locality));
 }
 
 static int tpm_tis_resume(struct device *dev)
@@ -865,7 +865,7 @@ static int tpm_tis_resume(struct device *dev)
 	struct tpm_chip *chip = dev_get_drvdata(dev);
 	int ret;
 
-	if (chip->vendor.irq)
+	if (chip->irq)
 		tpm_tis_reenable_interrupts(chip);
 
 	ret = tpm_pm_resume(dev);
-- 
2.5.0


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 4/5] tpm: Move irqs field from tpm_vendor_specific to tpm_chip structure
       [not found]     ` <1458764240-24185-5-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
@ 2016-03-23 22:52       ` Jason Gunthorpe
  0 siblings, 0 replies; 16+ messages in thread
From: Jason Gunthorpe @ 2016-03-23 22:52 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:19PM +0100, Christophe Ricard wrote:
> In order to complete the tpm_vendor_specific cleanup structure move irqs
> specific fields to tpm_chip. It make sense to be in this place as those
> fields are part of the tpm properties.

No, sprinkle these two fields into the drivers.

> @@ -359,7 +359,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
>  		goto out;
>  	}
>  
> -	if (chip->vendor.irq)
> +	if (chip->irq)
>  		goto out_recv;
>  
>  	if (chip->flags & TPM_CHIP_FLAG_TPM2)
> @@ -890,7 +890,7 @@ int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, unsigned long timeout,
>  
>  	stop = jiffies + timeout;
>  
> -	if (chip->vendor.irq) {
> +	if (chip->irq) {

This should be something smarter, a chip->flags or something is a
little better than this.

Ideally, the driver facing API would be fixed and this behavior would
be in a utility function the driver can call in the standard recv
path, not weird like this.

Jason

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/5] tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos
       [not found]     ` <1458764240-24185-6-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
@ 2016-03-23 22:54       ` Jason Gunthorpe
       [not found]         ` <20160323225454.GD17397-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Jason Gunthorpe @ 2016-03-23 22:54 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:20PM +0100, Christophe Ricard wrote:
> As no more information available in tpm_vendor_specific structure are
> available in tpm_vendor_specific structure rename it tpm_protocol_infos.

Just get rid of it. Either the info rightly belongs in the chip or it
should be pushed to a priv. Either way, we don't need this structure.

>  		if (tpm_info->irq) {
>  			tpm_tis_probe_irq_single(chip, intmask, IRQF_SHARED,
>  						 tpm_info->irq);
> -			if (!chip->vendor.irq)
> +			if (!chip->irq)
>  				dev_err(&chip->dev, FW_BUG
>  					"TPM interrupt not working, polling instead\n");

Read your diffs, these doesn't belong in this patch.

Jason

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/5] tpm: drop list from struct tpm_vendor_specific
       [not found]     ` <1458764240-24185-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
@ 2016-03-23 22:57       ` Jason Gunthorpe
  2016-03-24 14:08       ` Jarkko Sakkinen
  1 sibling, 0 replies; 16+ messages in thread
From: Jason Gunthorpe @ 2016-03-23 22:57 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:17PM +0100, Christophe Ricard wrote:
> Dropped list from struct tpm_vendor_specific as it is not used in any
> place.
> 
> It is initialized in tpm_i2c_infineon but not used at all in the code.
> 
> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>

Reviewed-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Jason

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/5] tpm: drop 'iobase' from struct tpm_vendor_specific
       [not found]     ` <1458764240-24185-2-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
@ 2016-03-23 22:58       ` Jason Gunthorpe
  2016-03-24 14:06       ` Jarkko Sakkinen
  1 sibling, 0 replies; 16+ messages in thread
From: Jason Gunthorpe @ 2016-03-23 22:58 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:16PM +0100, Christophe Ricard wrote:
> Dropped the field 'iobase' from struct tpm_vendor_specific and migrated
> it to the private structures of tpm_atmel and tpm_tis.
> 
> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>

Reviewed-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Jason

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 5/5] tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos
       [not found]         ` <20160323225454.GD17397-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2016-03-24  6:14           ` Christophe Ricard
  0 siblings, 0 replies; 16+ messages in thread
From: Christophe Ricard @ 2016-03-24  6:14 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

This is a mistake. Will fix sorry.

On 23/03/2016 23:54, Jason Gunthorpe wrote:
> -			if (!chip->vendor.irq)
> >+			if (!chip->irq)


------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/5] tpm: drop 'iobase' from struct tpm_vendor_specific
       [not found]     ` <1458764240-24185-2-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 22:58       ` Jason Gunthorpe
@ 2016-03-24 14:06       ` Jarkko Sakkinen
  1 sibling, 0 replies; 16+ messages in thread
From: Jarkko Sakkinen @ 2016-03-24 14:06 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:16PM +0100, Christophe Ricard wrote:
> Dropped the field 'iobase' from struct tpm_vendor_specific and migrated
> it to the private structures of tpm_atmel and tpm_tis.
> 
> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

/Jarkko

> ---
>  drivers/char/tpm/tpm.h       |   2 -
>  drivers/char/tpm/tpm_atmel.c |  29 +++++++-----
>  drivers/char/tpm/tpm_tis.c   | 104 +++++++++++++++++++++++++------------------
>  3 files changed, 78 insertions(+), 57 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 7317bec..0d1b7e6 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -131,8 +131,6 @@ enum tpm2_startup_types {
>  struct tpm_chip;
>  
>  struct tpm_vendor_specific {
> -	void __iomem *iobase;		/* ioremapped address */
> -
>  	int irq;
>  
>  	struct list_head list;
> diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
> index c6daf6c..242d6c6 100644
> --- a/drivers/char/tpm/tpm_atmel.c
> +++ b/drivers/char/tpm/tpm_atmel.c
> @@ -36,6 +36,7 @@ enum tpm_atmel_read_status {
>  };
>  
>  struct tpm_atmel_priv {
> +	void __iomem *iobase;
>  	unsigned long base;
>  	int region_size;
>  	int have_region;
> @@ -43,6 +44,7 @@ struct tpm_atmel_priv {
>  
>  static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> +	struct tpm_atmel_priv *priv = chip->vendor.priv;
>  	u8 status, *hdr = buf;
>  	u32 size;
>  	int i;
> @@ -53,12 +55,12 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  		return -EIO;
>  
>  	for (i = 0; i < 6; i++) {
> -		status = ioread8(chip->vendor.iobase + 1);
> +		status = ioread8(priv->iobase + 1);
>  		if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
>  			dev_err(&chip->dev, "error reading header\n");
>  			return -EIO;
>  		}
> -		*buf++ = ioread8(chip->vendor.iobase);
> +		*buf++ = ioread8(priv->iobase);
>  	}
>  
>  	/* size of the data received */
> @@ -69,7 +71,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  		dev_err(&chip->dev,
>  			"Recv size(%d) less than available space\n", size);
>  		for (; i < size; i++) {	/* clear the waiting data anyway */
> -			status = ioread8(chip->vendor.iobase + 1);
> +			status = ioread8(priv->iobase + 1);
>  			if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
>  				dev_err(&chip->dev, "error reading data\n");
>  				return -EIO;
> @@ -80,16 +82,16 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  
>  	/* read all the data available */
>  	for (; i < size; i++) {
> -		status = ioread8(chip->vendor.iobase + 1);
> +		status = ioread8(priv->iobase + 1);
>  		if ((status & ATML_STATUS_DATA_AVAIL) == 0) {
>  			dev_err(&chip->dev, "error reading data\n");
>  			return -EIO;
>  		}
> -		*buf++ = ioread8(chip->vendor.iobase);
> +		*buf++ = ioread8(priv->iobase);
>  	}
>  
>  	/* make sure data available is gone */
> -	status = ioread8(chip->vendor.iobase + 1);
> +	status = ioread8(priv->iobase + 1);
>  
>  	if (status & ATML_STATUS_DATA_AVAIL) {
>  		dev_err(&chip->dev, "data available is stuck\n");
> @@ -101,12 +103,13 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  
>  static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> +	struct tpm_atmel_priv *priv = chip->vendor.priv;
>  	int i;
>  
>  	dev_dbg(&chip->dev, "tpm_atml_send:\n");
>  	for (i = 0; i < count; i++) {
>  		dev_dbg(&chip->dev, "%d 0x%x(%d)\n",  i, buf[i], buf[i]);
> - 		iowrite8(buf[i], chip->vendor.iobase);
> +		iowrite8(buf[i], priv->iobase);
>  	}
>  
>  	return count;
> @@ -114,12 +117,16 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
>  
>  static void tpm_atml_cancel(struct tpm_chip *chip)
>  {
> -	iowrite8(ATML_STATUS_ABORT, chip->vendor.iobase + 1);
> +	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +
> +	iowrite8(ATML_STATUS_ABORT, priv->iobase + 1);
>  }
>  
>  static u8 tpm_atml_status(struct tpm_chip *chip)
>  {
> -	return ioread8(chip->vendor.iobase + 1);
> +	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +
> +	return ioread8(priv->iobase + 1);
>  }
>  
>  static bool tpm_atml_req_canceled(struct tpm_chip *chip, u8 status)
> @@ -148,7 +155,7 @@ static void atml_plat_remove(void)
>  		tpm_chip_unregister(chip);
>  		if (priv->have_region)
>  			atmel_release_region(priv->base, priv->region_size);
> -		atmel_put_base_addr(chip->vendor.iobase);
> +		atmel_put_base_addr(priv->iobase);
>  		platform_device_unregister(pdev);
>  	}
>  }
> @@ -196,6 +203,7 @@ static int __init init_atmel(void)
>  		goto err_unreg_dev;
>  	}
>  
> +	priv->iobase = iobase;
>  	priv->base = base;
>  	priv->have_region = have_region;
>  	priv->region_size = region_size;
> @@ -206,7 +214,6 @@ static int __init init_atmel(void)
>  		goto err_unreg_dev;
>  	}
>  
> -	chip->vendor.iobase = iobase;
>  	chip->vendor.priv = priv;
>  
>  	rc = tpm_chip_register(chip);
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 068f021..19dac62 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -94,6 +94,7 @@ struct tpm_info {
>  #define	TPM_RID(l)			(0x0F04 | ((l) << 12))
>  
>  struct priv_data {
> +	void __iomem *iobase;
>  	u16 manufacturer_id;
>  	bool irq_tested;
>  	wait_queue_head_t int_queue;
> @@ -128,9 +129,10 @@ static inline int is_itpm(struct acpi_device *dev)
>   * correct values in the other bits.' */
>  static int wait_startup(struct tpm_chip *chip, int l)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	unsigned long stop = jiffies + chip->vendor.timeout_a;
>  	do {
> -		if (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
> +		if (ioread8(priv->iobase + TPM_ACCESS(l)) &
>  		    TPM_ACCESS_VALID)
>  			return 0;
>  		msleep(TPM_TIMEOUT);
> @@ -140,7 +142,9 @@ static int wait_startup(struct tpm_chip *chip, int l)
>  
>  static int check_locality(struct tpm_chip *chip, int l)
>  {
> -	if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
> +	struct priv_data *priv = chip->vendor.priv;
> +
> +	if ((ioread8(priv->iobase + TPM_ACCESS(l)) &
>  	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
>  	    (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID))
>  		return chip->vendor.locality = l;
> @@ -150,11 +154,13 @@ static int check_locality(struct tpm_chip *chip, int l)
>  
>  static void release_locality(struct tpm_chip *chip, int l, int force)
>  {
> -	if (force || (ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
> +	struct priv_data *priv = chip->vendor.priv;
> +
> +	if (force || (ioread8(priv->iobase + TPM_ACCESS(l)) &
>  		      (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
>  	    (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID))
>  		iowrite8(TPM_ACCESS_ACTIVE_LOCALITY,
> -			 chip->vendor.iobase + TPM_ACCESS(l));
> +			 priv->iobase + TPM_ACCESS(l));
>  }
>  
>  static int request_locality(struct tpm_chip *chip, int l)
> @@ -167,7 +173,7 @@ static int request_locality(struct tpm_chip *chip, int l)
>  		return l;
>  
>  	iowrite8(TPM_ACCESS_REQUEST_USE,
> -		 chip->vendor.iobase + TPM_ACCESS(l));
> +		 priv->iobase + TPM_ACCESS(l));
>  
>  	stop = jiffies + chip->vendor.timeout_a;
>  
> @@ -200,19 +206,24 @@ again:
>  
>  static u8 tpm_tis_status(struct tpm_chip *chip)
>  {
> -	return ioread8(chip->vendor.iobase +
> +	struct priv_data *priv = chip->vendor.priv;
> +
> +	return ioread8(priv->iobase +
>  		       TPM_STS(chip->vendor.locality));
>  }
>  
>  static void tpm_tis_ready(struct tpm_chip *chip)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
> +
>  	/* this causes the current command to be aborted */
>  	iowrite8(TPM_STS_COMMAND_READY,
> -		 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
> +		 priv->iobase + TPM_STS(chip->vendor.locality));
>  }
>  
>  static int get_burstcount(struct tpm_chip *chip)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	unsigned long stop;
>  	int burstcnt;
>  
> @@ -220,9 +231,9 @@ static int get_burstcount(struct tpm_chip *chip)
>  	/* which timeout value, spec has 2 answers (c & d) */
>  	stop = jiffies + chip->vendor.timeout_d;
>  	do {
> -		burstcnt = ioread8(chip->vendor.iobase +
> +		burstcnt = ioread8(priv->iobase +
>  				   TPM_STS(chip->vendor.locality) + 1);
> -		burstcnt += ioread8(chip->vendor.iobase +
> +		burstcnt += ioread8(priv->iobase +
>  				    TPM_STS(chip->vendor.locality) +
>  				    2) << 8;
>  		if (burstcnt)
> @@ -234,6 +245,7 @@ static int get_burstcount(struct tpm_chip *chip)
>  
>  static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	int size = 0, burstcnt;
>  	while (size < count &&
>  	       wait_for_tpm_stat(chip,
> @@ -243,7 +255,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
>  	       == 0) {
>  		burstcnt = get_burstcount(chip);
>  		for (; burstcnt > 0 && size < count; burstcnt--)
> -			buf[size++] = ioread8(chip->vendor.iobase +
> +			buf[size++] = ioread8(priv->iobase +
>  					      TPM_DATA_FIFO(chip->vendor.
>  							    locality));
>  	}
> @@ -329,7 +341,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
>  	while (count < len - 1) {
>  		burstcnt = get_burstcount(chip);
>  		for (; burstcnt > 0 && count < len - 1; burstcnt--) {
> -			iowrite8(buf[count], chip->vendor.iobase +
> +			iowrite8(buf[count], priv->iobase +
>  				 TPM_DATA_FIFO(chip->vendor.locality));
>  			count++;
>  		}
> @@ -345,7 +357,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
>  
>  	/* write last byte */
>  	iowrite8(buf[count],
> -		 chip->vendor.iobase + TPM_DATA_FIFO(chip->vendor.locality));
> +		 priv->iobase + TPM_DATA_FIFO(chip->vendor.locality));
>  	wait_for_tpm_stat(chip, TPM_STS_VALID, chip->vendor.timeout_c,
>  			  &priv->int_queue, false);
>  	status = tpm_tis_status(chip);
> @@ -364,15 +376,15 @@ out_err:
>  
>  static void disable_interrupts(struct tpm_chip *chip)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	u32 intmask;
>  
>  	intmask =
> -	    ioread32(chip->vendor.iobase +
> +	    ioread32(priv->iobase +
>  		     TPM_INT_ENABLE(chip->vendor.locality));
>  	intmask &= ~TPM_GLOBAL_INT_ENABLE;
>  	iowrite32(intmask,
> -		  chip->vendor.iobase +
> -		  TPM_INT_ENABLE(chip->vendor.locality));
> +		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
>  	devm_free_irq(&chip->dev, chip->vendor.irq, chip);
>  	chip->vendor.irq = 0;
>  }
> @@ -384,6 +396,7 @@ static void disable_interrupts(struct tpm_chip *chip)
>   */
>  static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	int rc;
>  	u32 ordinal;
>  	unsigned long dur;
> @@ -394,7 +407,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
>  
>  	/* go and do it */
>  	iowrite8(TPM_STS_GO,
> -		 chip->vendor.iobase + TPM_STS(chip->vendor.locality));
> +		 priv->iobase + TPM_STS(chip->vendor.locality));
>  
>  	if (chip->vendor.irq) {
>  		ordinal = be32_to_cpu(*((__be32 *) (buf + 6)));
> @@ -453,10 +466,11 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = {
>  static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
>  				    unsigned long *timeout_cap)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	int i;
>  	u32 did_vid;
>  
> -	did_vid = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
> +	did_vid = ioread32(priv->iobase + TPM_DID_VID(0));
>  
>  	for (i = 0; i != ARRAY_SIZE(vendor_timeout_overrides); i++) {
>  		if (vendor_timeout_overrides[i].did_vid != did_vid)
> @@ -476,6 +490,7 @@ static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
>   */
>  static int probe_itpm(struct tpm_chip *chip)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	int rc = 0;
>  	u8 cmd_getticks[] = {
>  		0x00, 0xc1, 0x00, 0x00, 0x00, 0x0a,
> @@ -483,7 +498,7 @@ static int probe_itpm(struct tpm_chip *chip)
>  	};
>  	size_t len = sizeof(cmd_getticks);
>  	bool rem_itpm = itpm;
> -	u16 vendor = ioread16(chip->vendor.iobase + TPM_DID_VID(0));
> +	u16 vendor = ioread16(priv->iobase + TPM_DID_VID(0));
>  
>  	/* probe only iTPMS */
>  	if (vendor != TPM_VID_INTEL)
> @@ -548,7 +563,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
>  	u32 interrupt;
>  	int i;
>  
> -	interrupt = ioread32(chip->vendor.iobase +
> +	interrupt = ioread32(priv->iobase +
>  			     TPM_INT_STATUS(chip->vendor.locality));
>  
>  	if (interrupt == 0)
> @@ -568,9 +583,9 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
>  
>  	/* Clear interrupts handled with TPM_EOI */
>  	iowrite32(interrupt,
> -		  chip->vendor.iobase +
> +		  priv->iobase +
>  		  TPM_INT_STATUS(chip->vendor.locality));
> -	ioread32(chip->vendor.iobase + TPM_INT_STATUS(chip->vendor.locality));
> +	ioread32(priv->iobase + TPM_INT_STATUS(chip->vendor.locality));
>  	return IRQ_HANDLED;
>  }
>  
> @@ -592,19 +607,19 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
>  	}
>  	chip->vendor.irq = irq;
>  
> -	original_int_vec = ioread8(chip->vendor.iobase +
> +	original_int_vec = ioread8(priv->iobase +
>  				   TPM_INT_VECTOR(chip->vendor.locality));
>  	iowrite8(irq,
> -		 chip->vendor.iobase + TPM_INT_VECTOR(chip->vendor.locality));
> +		 priv->iobase + TPM_INT_VECTOR(chip->vendor.locality));
>  
>  	/* Clear all existing */
> -	iowrite32(ioread32(chip->vendor.iobase +
> +	iowrite32(ioread32(priv->iobase +
>  			   TPM_INT_STATUS(chip->vendor.locality)),
> -		  chip->vendor.iobase + TPM_INT_STATUS(chip->vendor.locality));
> +		  priv->iobase + TPM_INT_STATUS(chip->vendor.locality));
>  
>  	/* Turn on */
>  	iowrite32(intmask | TPM_GLOBAL_INT_ENABLE,
> -		  chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
> +		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
>  
>  	priv->irq_tested = false;
>  
> @@ -621,8 +636,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
>  	 */
>  	if (!chip->vendor.irq) {
>  		iowrite8(original_int_vec,
> -			 chip->vendor.iobase +
> -			     TPM_INT_VECTOR(chip->vendor.locality));
> +			 priv->iobase + TPM_INT_VECTOR(chip->vendor.locality));
>  		return 1;
>  	}
>  
> @@ -635,10 +649,11 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
>   */
>  static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	u8 original_int_vec;
>  	int i;
>  
> -	original_int_vec = ioread8(chip->vendor.iobase +
> +	original_int_vec = ioread8(priv->iobase +
>  				   TPM_INT_VECTOR(chip->vendor.locality));
>  
>  	if (!original_int_vec) {
> @@ -658,15 +673,16 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
>  
>  static void tpm_tis_remove(struct tpm_chip *chip)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
> +
>  	if (chip->flags & TPM_CHIP_FLAG_TPM2)
>  		tpm2_shutdown(chip, TPM2_SU_CLEAR);
>  
>  	iowrite32(~TPM_GLOBAL_INT_ENABLE &
> -		  ioread32(chip->vendor.iobase +
> +		  ioread32(priv->iobase +
>  			   TPM_INT_ENABLE(chip->vendor.
>  					  locality)),
> -		  chip->vendor.iobase +
> -		  TPM_INT_ENABLE(chip->vendor.locality));
> +			   priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
>  	release_locality(chip, chip->vendor.locality, 1);
>  }
>  
> @@ -691,9 +707,9 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
>  	chip->acpi_dev_handle = acpi_dev_handle;
>  #endif
>  
> -	chip->vendor.iobase = devm_ioremap_resource(dev, &tpm_info->res);
> -	if (IS_ERR(chip->vendor.iobase))
> -		return PTR_ERR(chip->vendor.iobase);
> +	priv->iobase = devm_ioremap_resource(dev, &tpm_info->res);
> +	if (IS_ERR(priv->iobase))
> +		return PTR_ERR(priv->iobase);
>  
>  	/* Maximum timeouts */
>  	chip->vendor.timeout_a = TIS_TIMEOUT_A_MAX;
> @@ -707,13 +723,13 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
>  	}
>  
>  	/* Take control of the TPM's interrupt hardware and shut it off */
> -	intmask = ioread32(chip->vendor.iobase +
> +	intmask = ioread32(priv->iobase +
>  			   TPM_INT_ENABLE(chip->vendor.locality));
>  	intmask |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT |
>  		   TPM_INTF_DATA_AVAIL_INT | TPM_INTF_STS_VALID_INT;
>  	intmask &= ~TPM_GLOBAL_INT_ENABLE;
>  	iowrite32(intmask,
> -		  chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
> +		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
>  
>  	if (request_locality(chip, 0) != 0) {
>  		rc = -ENODEV;
> @@ -724,12 +740,12 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
>  	if (rc)
>  		goto out_err;
>  
> -	vendor = ioread32(chip->vendor.iobase + TPM_DID_VID(0));
> +	vendor = ioread32(priv->iobase + TPM_DID_VID(0));
>  	priv->manufacturer_id = vendor;
>  
>  	dev_info(dev, "%s TPM (device-id 0x%X, rev-id %d)\n",
>  		 (chip->flags & TPM_CHIP_FLAG_TPM2) ? "2.0" : "1.2",
> -		 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
> +		 vendor >> 16, ioread8(priv->iobase + TPM_RID(0)));
>  
>  	if (!itpm) {
>  		probe = probe_itpm(chip);
> @@ -746,7 +762,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
>  
>  	/* Figure out the capabilities */
>  	intfcaps =
> -	    ioread32(chip->vendor.iobase +
> +	    ioread32(priv->iobase +
>  		     TPM_INTF_CAPS(chip->vendor.locality));
>  	dev_dbg(dev, "TPM interface capabilities (0x%x):\n",
>  		intfcaps);
> @@ -825,23 +841,23 @@ out_err:
>  #ifdef CONFIG_PM_SLEEP
>  static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
>  {
> +	struct priv_data *priv = chip->vendor.priv;
>  	u32 intmask;
>  
>  	/* reenable interrupts that device may have lost or
>  	   BIOS/firmware may have disabled */
> -	iowrite8(chip->vendor.irq, chip->vendor.iobase +
> +	iowrite8(chip->vendor.irq, priv->iobase +
>  		 TPM_INT_VECTOR(chip->vendor.locality));
>  
>  	intmask =
> -	    ioread32(chip->vendor.iobase +
> -		     TPM_INT_ENABLE(chip->vendor.locality));
> +	    ioread32(priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
>  
>  	intmask |= TPM_INTF_CMD_READY_INT
>  	    | TPM_INTF_LOCALITY_CHANGE_INT | TPM_INTF_DATA_AVAIL_INT
>  	    | TPM_INTF_STS_VALID_INT | TPM_GLOBAL_INT_ENABLE;
>  
>  	iowrite32(intmask,
> -		  chip->vendor.iobase + TPM_INT_ENABLE(chip->vendor.locality));
> +		  priv->iobase + TPM_INT_ENABLE(chip->vendor.locality));
>  }
>  
>  static int tpm_tis_resume(struct device *dev)
> -- 
> 2.5.0
> 

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/5] tpm: drop list from struct tpm_vendor_specific
       [not found]     ` <1458764240-24185-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
  2016-03-23 22:57       ` Jason Gunthorpe
@ 2016-03-24 14:08       ` Jarkko Sakkinen
       [not found]         ` <20160324140835.GA21170-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 16+ messages in thread
From: Jarkko Sakkinen @ 2016-03-24 14:08 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:17PM +0100, Christophe Ricard wrote:
> Dropped list from struct tpm_vendor_specific as it is not used in any
> place.
> 
> It is initialized in tpm_i2c_infineon but not used at all in the code.
> 
> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

/Jarkko

> ---
>  drivers/char/tpm/tpm.h              | 1 -
>  drivers/char/tpm/tpm_i2c_infineon.c | 1 -
>  2 files changed, 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 0d1b7e6..357ac14 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -133,7 +133,6 @@ struct tpm_chip;
>  struct tpm_vendor_specific {
>  	int irq;
>  
> -	struct list_head list;
>  	int locality;
>  	unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
>  	bool timeout_adjusted;
> diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
> index f2aa99e..e74f1c1 100644
> --- a/drivers/char/tpm/tpm_i2c_infineon.c
> +++ b/drivers/char/tpm/tpm_i2c_infineon.c
> @@ -619,7 +619,6 @@ static int tpm_tis_i2c_init(struct device *dev)
>  
>  	dev_info(dev, "1.2 TPM (device-id 0x%X)\n", vendor >> 16);
>  
> -	INIT_LIST_HEAD(&chip->vendor.list);
>  	tpm_dev.chip = chip;
>  
>  	tpm_get_timeouts(chip);
> -- 
> 2.5.0
> 

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/5] tpm: Move priv field from tpm_vendor_specific to tpm_chip
       [not found]     ` <1458764240-24185-4-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
@ 2016-03-24 14:12       ` Jarkko Sakkinen
       [not found]         ` <20160324141208.GA21689-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Jarkko Sakkinen @ 2016-03-24 14:12 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Wed, Mar 23, 2016 at 09:17:18PM +0100, Christophe Ricard wrote:
> Move from tpm_vendor_specific priv field to tpm_chip as this is going to
> be used for additional tpm_chip description.

NAK. The remaining fields should be moved to tpm_chip.

/Jarkko

> Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
> ---
>  drivers/char/tpm/tpm.h             |  4 ++--
>  drivers/char/tpm/tpm_atmel.c       | 12 +++++-----
>  drivers/char/tpm/tpm_atmel.h       |  2 +-
>  drivers/char/tpm/tpm_crb.c         | 12 +++++-----
>  drivers/char/tpm/tpm_i2c_atmel.c   | 12 +++++-----
>  drivers/char/tpm/tpm_i2c_nuvoton.c |  8 +++----
>  drivers/char/tpm/tpm_nsc.c         |  4 ++--
>  drivers/char/tpm/tpm_tis.c         | 46 +++++++++++++++++++-------------------
>  8 files changed, 50 insertions(+), 50 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> index 357ac14..06d5c2a 100644
> --- a/drivers/char/tpm/tpm.h
> +++ b/drivers/char/tpm/tpm.h
> @@ -138,12 +138,11 @@ struct tpm_vendor_specific {
>  	bool timeout_adjusted;
>  	unsigned long duration[3]; /* jiffies */
>  	bool duration_adjusted;
> -	void *priv;
>  
>  	wait_queue_head_t read_queue;
>  };
>  
> -#define TPM_VPRIV(c)     ((c)->vendor.priv)
> +#define TPM_VPRIV(c)     ((c)->priv)
>  
>  #define TPM_VID_INTEL    0x8086
>  #define TPM_VID_WINBOND  0x1050
> @@ -159,6 +158,7 @@ enum tpm_chip_flags {
>  struct tpm_chip {
>  	struct device dev;
>  	struct cdev cdev;
> +	void *priv;
>  
>  	/* A driver callback under ops cannot be run unless ops_sem is held
>  	 * (sometimes implicitly, eg for the sysfs code). ops becomes null
> diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
> index 242d6c6..56845bf 100644
> --- a/drivers/char/tpm/tpm_atmel.c
> +++ b/drivers/char/tpm/tpm_atmel.c
> @@ -44,7 +44,7 @@ struct tpm_atmel_priv {
>  
>  static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +	struct tpm_atmel_priv *priv = chip->priv;
>  	u8 status, *hdr = buf;
>  	u32 size;
>  	int i;
> @@ -103,7 +103,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  
>  static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +	struct tpm_atmel_priv *priv = chip->priv;
>  	int i;
>  
>  	dev_dbg(&chip->dev, "tpm_atml_send:\n");
> @@ -117,14 +117,14 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
>  
>  static void tpm_atml_cancel(struct tpm_chip *chip)
>  {
> -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +	struct tpm_atmel_priv *priv = chip->priv;
>  
>  	iowrite8(ATML_STATUS_ABORT, priv->iobase + 1);
>  }
>  
>  static u8 tpm_atml_status(struct tpm_chip *chip)
>  {
> -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +	struct tpm_atmel_priv *priv = chip->priv;
>  
>  	return ioread8(priv->iobase + 1);
>  }
> @@ -149,7 +149,7 @@ static struct platform_device *pdev;
>  static void atml_plat_remove(void)
>  {
>  	struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
> -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> +	struct tpm_atmel_priv *priv = chip->priv;
>  
>  	if (chip) {
>  		tpm_chip_unregister(chip);
> @@ -214,7 +214,7 @@ static int __init init_atmel(void)
>  		goto err_unreg_dev;
>  	}
>  
> -	chip->vendor.priv = priv;
> +	chip->priv = priv;
>  
>  	rc = tpm_chip_register(chip);
>  	if (rc)
> diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
> index 08607a6..dedc5dc 100644
> --- a/drivers/char/tpm/tpm_atmel.h
> +++ b/drivers/char/tpm/tpm_atmel.h
> @@ -22,7 +22,7 @@
>   *
>   */
>  
> -#define atmel_get_priv(chip) ((struct tpm_atmel_priv *) chip->vendor.priv)
> +#define atmel_get_priv(chip) ((struct tpm_atmel_priv *) chip->priv)
>  
>  #ifdef CONFIG_PPC64
>  
> diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> index 8767da6..0e81a36 100644
> --- a/drivers/char/tpm/tpm_crb.c
> +++ b/drivers/char/tpm/tpm_crb.c
> @@ -87,7 +87,7 @@ static SIMPLE_DEV_PM_OPS(crb_pm, tpm_pm_suspend, tpm_pm_resume);
>  
>  static u8 crb_status(struct tpm_chip *chip)
>  {
> -	struct crb_priv *priv = chip->vendor.priv;
> +	struct crb_priv *priv = chip->priv;
>  	u8 sts = 0;
>  
>  	if ((ioread32(&priv->cca->start) & CRB_START_INVOKE) !=
> @@ -99,7 +99,7 @@ static u8 crb_status(struct tpm_chip *chip)
>  
>  static int crb_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> -	struct crb_priv *priv = chip->vendor.priv;
> +	struct crb_priv *priv = chip->priv;
>  	unsigned int expected;
>  
>  	/* sanity check */
> @@ -139,7 +139,7 @@ static int crb_do_acpi_start(struct tpm_chip *chip)
>  
>  static int crb_send(struct tpm_chip *chip, u8 *buf, size_t len)
>  {
> -	struct crb_priv *priv = chip->vendor.priv;
> +	struct crb_priv *priv = chip->priv;
>  	int rc = 0;
>  
>  	if (len > ioread32(&priv->cca->cmd_size)) {
> @@ -163,7 +163,7 @@ static int crb_send(struct tpm_chip *chip, u8 *buf, size_t len)
>  
>  static void crb_cancel(struct tpm_chip *chip)
>  {
> -	struct crb_priv *priv = chip->vendor.priv;
> +	struct crb_priv *priv = chip->priv;
>  
>  	iowrite32(cpu_to_le32(CRB_CANCEL_INVOKE), &priv->cca->cancel);
>  
> @@ -175,7 +175,7 @@ static void crb_cancel(struct tpm_chip *chip)
>  
>  static bool crb_req_canceled(struct tpm_chip *chip, u8 status)
>  {
> -	struct crb_priv *priv = chip->vendor.priv;
> +	struct crb_priv *priv = chip->priv;
>  	u32 cancel = ioread32(&priv->cca->cancel);
>  
>  	return (cancel & CRB_CANCEL_INVOKE) == CRB_CANCEL_INVOKE;
> @@ -200,7 +200,7 @@ static int crb_init(struct acpi_device *device, struct crb_priv *priv)
>  	if (IS_ERR(chip))
>  		return PTR_ERR(chip);
>  
> -	chip->vendor.priv = priv;
> +	chip->priv = priv;
>  	chip->acpi_dev_handle = device->handle;
>  	chip->flags = TPM_CHIP_FLAG_TPM2;
>  
> diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
> index dd8f0eb..92cd080 100644
> --- a/drivers/char/tpm/tpm_i2c_atmel.c
> +++ b/drivers/char/tpm/tpm_i2c_atmel.c
> @@ -51,7 +51,7 @@ struct priv_data {
>  
>  static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	struct i2c_client *client = to_i2c_client(chip->dev.parent);
>  	s32 status;
>  
> @@ -70,7 +70,7 @@ static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)
>  
>  static int i2c_atmel_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	struct i2c_client *client = to_i2c_client(chip->dev.parent);
>  	struct tpm_output_header *hdr =
>  		(struct tpm_output_header *)priv->buffer;
> @@ -111,7 +111,7 @@ static void i2c_atmel_cancel(struct tpm_chip *chip)
>  
>  static u8 i2c_atmel_read_status(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	struct i2c_client *client = to_i2c_client(chip->dev.parent);
>  	int rc;
>  
> @@ -163,9 +163,9 @@ static int i2c_atmel_probe(struct i2c_client *client,
>  	if (IS_ERR(chip))
>  		return PTR_ERR(chip);
>  
> -	chip->vendor.priv = devm_kzalloc(dev, sizeof(struct priv_data),
> -					 GFP_KERNEL);
> -	if (!chip->vendor.priv)
> +	chip->priv = devm_kzalloc(dev, sizeof(struct priv_data),
> +				  GFP_KERNEL);
> +	if (!chip->priv)
>  		return -ENOMEM;
>  
>  	/* Default timeouts */
> diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
> index a43b5f3..a9c6b2d 100644
> --- a/drivers/char/tpm/tpm_i2c_nuvoton.c
> +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
> @@ -178,7 +178,7 @@ static int i2c_nuvoton_wait_for_stat(struct tpm_chip *chip, u8 mask, u8 value,
>  {
>  	if (chip->vendor.irq && queue) {
>  		s32 rc;
> -		struct priv_data *priv = chip->vendor.priv;
> +		struct priv_data *priv = chip->priv;
>  		unsigned int cur_intrs = priv->intrs;
>  
>  		enable_irq(chip->vendor.irq);
> @@ -473,7 +473,7 @@ static const struct tpm_class_ops tpm_i2c = {
>  static irqreturn_t i2c_nuvoton_int_handler(int dummy, void *dev_id)
>  {
>  	struct tpm_chip *chip = dev_id;
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	priv->intrs++;
>  	wake_up(&chip->vendor.read_queue);
> @@ -534,9 +534,9 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
>  	if (IS_ERR(chip))
>  		return PTR_ERR(chip);
>  
> -	chip->vendor.priv = devm_kzalloc(dev, sizeof(struct priv_data),
> +	chip->priv = devm_kzalloc(dev, sizeof(struct priv_data),
>  					 GFP_KERNEL);
> -	if (!chip->vendor.priv)
> +	if (!chip->priv)
>  		return -ENOMEM;
>  
>  	init_waitqueue_head(&chip->vendor.read_queue);
> diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
> index 8ccb1d5..48cc7ff 100644
> --- a/drivers/char/tpm/tpm_nsc.c
> +++ b/drivers/char/tpm/tpm_nsc.c
> @@ -69,7 +69,7 @@ struct tpm_nsc_priv {
>  	unsigned long base;
>  };
>  
> -#define tpm_nsc_get_priv(chip) ((struct tpm_nsc_priv *) chip->vendor.priv)
> +#define tpm_nsc_get_priv(chip) ((struct tpm_nsc_priv *) chip->priv)
>  
>  /*
>   * Wait for a certain status to appear
> @@ -331,7 +331,7 @@ static int __init init_nsc(void)
>  		goto err_rel_reg;
>  	}
>  
> -	chip->vendor.priv = priv;
> +	chip->priv = priv;
>  
>  	rc = tpm_chip_register(chip);
>  	if (rc)
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 19dac62..96cb824 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -129,7 +129,7 @@ static inline int is_itpm(struct acpi_device *dev)
>   * correct values in the other bits.' */
>  static int wait_startup(struct tpm_chip *chip, int l)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	unsigned long stop = jiffies + chip->vendor.timeout_a;
>  	do {
>  		if (ioread8(priv->iobase + TPM_ACCESS(l)) &
> @@ -142,7 +142,7 @@ static int wait_startup(struct tpm_chip *chip, int l)
>  
>  static int check_locality(struct tpm_chip *chip, int l)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	if ((ioread8(priv->iobase + TPM_ACCESS(l)) &
>  	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
> @@ -154,7 +154,7 @@ static int check_locality(struct tpm_chip *chip, int l)
>  
>  static void release_locality(struct tpm_chip *chip, int l, int force)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	if (force || (ioread8(priv->iobase + TPM_ACCESS(l)) &
>  		      (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
> @@ -165,7 +165,7 @@ static void release_locality(struct tpm_chip *chip, int l, int force)
>  
>  static int request_locality(struct tpm_chip *chip, int l)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	unsigned long stop, timeout;
>  	long rc;
>  
> @@ -206,7 +206,7 @@ again:
>  
>  static u8 tpm_tis_status(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	return ioread8(priv->iobase +
>  		       TPM_STS(chip->vendor.locality));
> @@ -214,7 +214,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip)
>  
>  static void tpm_tis_ready(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	/* this causes the current command to be aborted */
>  	iowrite8(TPM_STS_COMMAND_READY,
> @@ -223,7 +223,7 @@ static void tpm_tis_ready(struct tpm_chip *chip)
>  
>  static int get_burstcount(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	unsigned long stop;
>  	int burstcnt;
>  
> @@ -245,7 +245,7 @@ static int get_burstcount(struct tpm_chip *chip)
>  
>  static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	int size = 0, burstcnt;
>  	while (size < count &&
>  	       wait_for_tpm_stat(chip,
> @@ -264,7 +264,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
>  
>  static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	int size = 0;
>  	int expected, status;
>  
> @@ -320,7 +320,7 @@ MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
>   */
>  static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	int rc, status, burstcnt;
>  	size_t count = 0;
>  
> @@ -376,7 +376,7 @@ out_err:
>  
>  static void disable_interrupts(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	u32 intmask;
>  
>  	intmask =
> @@ -396,7 +396,7 @@ static void disable_interrupts(struct tpm_chip *chip)
>   */
>  static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	int rc;
>  	u32 ordinal;
>  	unsigned long dur;
> @@ -434,7 +434,7 @@ out_err:
>  static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
>  {
>  	int rc, irq;
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	if (!chip->vendor.irq || priv->irq_tested)
>  		return tpm_tis_send_main(chip, buf, len);
> @@ -466,7 +466,7 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = {
>  static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
>  				    unsigned long *timeout_cap)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	int i;
>  	u32 did_vid;
>  
> @@ -490,7 +490,7 @@ static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
>   */
>  static int probe_itpm(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	int rc = 0;
>  	u8 cmd_getticks[] = {
>  		0x00, 0xc1, 0x00, 0x00, 0x00, 0x0a,
> @@ -532,7 +532,7 @@ out:
>  
>  static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	switch (priv->manufacturer_id) {
>  	case TPM_VID_WINBOND:
> @@ -559,7 +559,7 @@ static const struct tpm_class_ops tpm_tis = {
>  static irqreturn_t tis_int_handler(int dummy, void *dev_id)
>  {
>  	struct tpm_chip *chip = dev_id;
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	u32 interrupt;
>  	int i;
>  
> @@ -569,7 +569,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
>  	if (interrupt == 0)
>  		return IRQ_NONE;
>  
> -	((struct priv_data *)chip->vendor.priv)->irq_tested = true;
> +	((struct priv_data *)chip->priv)->irq_tested = true;
>  	if (interrupt & TPM_INTF_DATA_AVAIL_INT)
>  		wake_up_interruptible(&chip->vendor.read_queue);
>  	if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
> @@ -596,7 +596,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
>  static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
>  				    int flags, int irq)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	u8 original_int_vec;
>  
>  	if (devm_request_irq(&chip->dev, irq, tis_int_handler, flags,
> @@ -649,7 +649,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
>   */
>  static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	u8 original_int_vec;
>  	int i;
>  
> @@ -673,7 +673,7 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
>  
>  static void tpm_tis_remove(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  
>  	if (chip->flags & TPM_CHIP_FLAG_TPM2)
>  		tpm2_shutdown(chip, TPM2_SU_CLEAR);
> @@ -702,7 +702,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
>  	if (IS_ERR(chip))
>  		return PTR_ERR(chip);
>  
> -	chip->vendor.priv = priv;
> +	chip->priv = priv;
>  #ifdef CONFIG_ACPI
>  	chip->acpi_dev_handle = acpi_dev_handle;
>  #endif
> @@ -841,7 +841,7 @@ out_err:
>  #ifdef CONFIG_PM_SLEEP
>  static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
>  {
> -	struct priv_data *priv = chip->vendor.priv;
> +	struct priv_data *priv = chip->priv;
>  	u32 intmask;
>  
>  	/* reenable interrupts that device may have lost or
> -- 
> 2.5.0
> 

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 3/5] tpm: Move priv field from tpm_vendor_specific to tpm_chip
       [not found]         ` <20160324141208.GA21689-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-03-24 14:13           ` Jarkko Sakkinen
  0 siblings, 0 replies; 16+ messages in thread
From: Jarkko Sakkinen @ 2016-03-24 14:13 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Thu, Mar 24, 2016 at 04:12:08PM +0200, Jarkko Sakkinen wrote:
> On Wed, Mar 23, 2016 at 09:17:18PM +0100, Christophe Ricard wrote:
> > Move from tpm_vendor_specific priv field to tpm_chip as this is going to
> > be used for additional tpm_chip description.
> 
> NAK. The remaining fields should be moved to tpm_chip.

This was generic comment for the three remaining patches, not only
for this. I've applied the first two patches so you can drop them
from the series. Thanks.

/Jarkko

> /Jarkko
> 
> > Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
> > ---
> >  drivers/char/tpm/tpm.h             |  4 ++--
> >  drivers/char/tpm/tpm_atmel.c       | 12 +++++-----
> >  drivers/char/tpm/tpm_atmel.h       |  2 +-
> >  drivers/char/tpm/tpm_crb.c         | 12 +++++-----
> >  drivers/char/tpm/tpm_i2c_atmel.c   | 12 +++++-----
> >  drivers/char/tpm/tpm_i2c_nuvoton.c |  8 +++----
> >  drivers/char/tpm/tpm_nsc.c         |  4 ++--
> >  drivers/char/tpm/tpm_tis.c         | 46 +++++++++++++++++++-------------------
> >  8 files changed, 50 insertions(+), 50 deletions(-)
> > 
> > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> > index 357ac14..06d5c2a 100644
> > --- a/drivers/char/tpm/tpm.h
> > +++ b/drivers/char/tpm/tpm.h
> > @@ -138,12 +138,11 @@ struct tpm_vendor_specific {
> >  	bool timeout_adjusted;
> >  	unsigned long duration[3]; /* jiffies */
> >  	bool duration_adjusted;
> > -	void *priv;
> >  
> >  	wait_queue_head_t read_queue;
> >  };
> >  
> > -#define TPM_VPRIV(c)     ((c)->vendor.priv)
> > +#define TPM_VPRIV(c)     ((c)->priv)
> >  
> >  #define TPM_VID_INTEL    0x8086
> >  #define TPM_VID_WINBOND  0x1050
> > @@ -159,6 +158,7 @@ enum tpm_chip_flags {
> >  struct tpm_chip {
> >  	struct device dev;
> >  	struct cdev cdev;
> > +	void *priv;
> >  
> >  	/* A driver callback under ops cannot be run unless ops_sem is held
> >  	 * (sometimes implicitly, eg for the sysfs code). ops becomes null
> > diff --git a/drivers/char/tpm/tpm_atmel.c b/drivers/char/tpm/tpm_atmel.c
> > index 242d6c6..56845bf 100644
> > --- a/drivers/char/tpm/tpm_atmel.c
> > +++ b/drivers/char/tpm/tpm_atmel.c
> > @@ -44,7 +44,7 @@ struct tpm_atmel_priv {
> >  
> >  static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> >  {
> > -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> > +	struct tpm_atmel_priv *priv = chip->priv;
> >  	u8 status, *hdr = buf;
> >  	u32 size;
> >  	int i;
> > @@ -103,7 +103,7 @@ static int tpm_atml_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> >  
> >  static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
> >  {
> > -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> > +	struct tpm_atmel_priv *priv = chip->priv;
> >  	int i;
> >  
> >  	dev_dbg(&chip->dev, "tpm_atml_send:\n");
> > @@ -117,14 +117,14 @@ static int tpm_atml_send(struct tpm_chip *chip, u8 *buf, size_t count)
> >  
> >  static void tpm_atml_cancel(struct tpm_chip *chip)
> >  {
> > -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> > +	struct tpm_atmel_priv *priv = chip->priv;
> >  
> >  	iowrite8(ATML_STATUS_ABORT, priv->iobase + 1);
> >  }
> >  
> >  static u8 tpm_atml_status(struct tpm_chip *chip)
> >  {
> > -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> > +	struct tpm_atmel_priv *priv = chip->priv;
> >  
> >  	return ioread8(priv->iobase + 1);
> >  }
> > @@ -149,7 +149,7 @@ static struct platform_device *pdev;
> >  static void atml_plat_remove(void)
> >  {
> >  	struct tpm_chip *chip = dev_get_drvdata(&pdev->dev);
> > -	struct tpm_atmel_priv *priv = chip->vendor.priv;
> > +	struct tpm_atmel_priv *priv = chip->priv;
> >  
> >  	if (chip) {
> >  		tpm_chip_unregister(chip);
> > @@ -214,7 +214,7 @@ static int __init init_atmel(void)
> >  		goto err_unreg_dev;
> >  	}
> >  
> > -	chip->vendor.priv = priv;
> > +	chip->priv = priv;
> >  
> >  	rc = tpm_chip_register(chip);
> >  	if (rc)
> > diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h
> > index 08607a6..dedc5dc 100644
> > --- a/drivers/char/tpm/tpm_atmel.h
> > +++ b/drivers/char/tpm/tpm_atmel.h
> > @@ -22,7 +22,7 @@
> >   *
> >   */
> >  
> > -#define atmel_get_priv(chip) ((struct tpm_atmel_priv *) chip->vendor.priv)
> > +#define atmel_get_priv(chip) ((struct tpm_atmel_priv *) chip->priv)
> >  
> >  #ifdef CONFIG_PPC64
> >  
> > diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c
> > index 8767da6..0e81a36 100644
> > --- a/drivers/char/tpm/tpm_crb.c
> > +++ b/drivers/char/tpm/tpm_crb.c
> > @@ -87,7 +87,7 @@ static SIMPLE_DEV_PM_OPS(crb_pm, tpm_pm_suspend, tpm_pm_resume);
> >  
> >  static u8 crb_status(struct tpm_chip *chip)
> >  {
> > -	struct crb_priv *priv = chip->vendor.priv;
> > +	struct crb_priv *priv = chip->priv;
> >  	u8 sts = 0;
> >  
> >  	if ((ioread32(&priv->cca->start) & CRB_START_INVOKE) !=
> > @@ -99,7 +99,7 @@ static u8 crb_status(struct tpm_chip *chip)
> >  
> >  static int crb_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> >  {
> > -	struct crb_priv *priv = chip->vendor.priv;
> > +	struct crb_priv *priv = chip->priv;
> >  	unsigned int expected;
> >  
> >  	/* sanity check */
> > @@ -139,7 +139,7 @@ static int crb_do_acpi_start(struct tpm_chip *chip)
> >  
> >  static int crb_send(struct tpm_chip *chip, u8 *buf, size_t len)
> >  {
> > -	struct crb_priv *priv = chip->vendor.priv;
> > +	struct crb_priv *priv = chip->priv;
> >  	int rc = 0;
> >  
> >  	if (len > ioread32(&priv->cca->cmd_size)) {
> > @@ -163,7 +163,7 @@ static int crb_send(struct tpm_chip *chip, u8 *buf, size_t len)
> >  
> >  static void crb_cancel(struct tpm_chip *chip)
> >  {
> > -	struct crb_priv *priv = chip->vendor.priv;
> > +	struct crb_priv *priv = chip->priv;
> >  
> >  	iowrite32(cpu_to_le32(CRB_CANCEL_INVOKE), &priv->cca->cancel);
> >  
> > @@ -175,7 +175,7 @@ static void crb_cancel(struct tpm_chip *chip)
> >  
> >  static bool crb_req_canceled(struct tpm_chip *chip, u8 status)
> >  {
> > -	struct crb_priv *priv = chip->vendor.priv;
> > +	struct crb_priv *priv = chip->priv;
> >  	u32 cancel = ioread32(&priv->cca->cancel);
> >  
> >  	return (cancel & CRB_CANCEL_INVOKE) == CRB_CANCEL_INVOKE;
> > @@ -200,7 +200,7 @@ static int crb_init(struct acpi_device *device, struct crb_priv *priv)
> >  	if (IS_ERR(chip))
> >  		return PTR_ERR(chip);
> >  
> > -	chip->vendor.priv = priv;
> > +	chip->priv = priv;
> >  	chip->acpi_dev_handle = device->handle;
> >  	chip->flags = TPM_CHIP_FLAG_TPM2;
> >  
> > diff --git a/drivers/char/tpm/tpm_i2c_atmel.c b/drivers/char/tpm/tpm_i2c_atmel.c
> > index dd8f0eb..92cd080 100644
> > --- a/drivers/char/tpm/tpm_i2c_atmel.c
> > +++ b/drivers/char/tpm/tpm_i2c_atmel.c
> > @@ -51,7 +51,7 @@ struct priv_data {
> >  
> >  static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	struct i2c_client *client = to_i2c_client(chip->dev.parent);
> >  	s32 status;
> >  
> > @@ -70,7 +70,7 @@ static int i2c_atmel_send(struct tpm_chip *chip, u8 *buf, size_t len)
> >  
> >  static int i2c_atmel_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	struct i2c_client *client = to_i2c_client(chip->dev.parent);
> >  	struct tpm_output_header *hdr =
> >  		(struct tpm_output_header *)priv->buffer;
> > @@ -111,7 +111,7 @@ static void i2c_atmel_cancel(struct tpm_chip *chip)
> >  
> >  static u8 i2c_atmel_read_status(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	struct i2c_client *client = to_i2c_client(chip->dev.parent);
> >  	int rc;
> >  
> > @@ -163,9 +163,9 @@ static int i2c_atmel_probe(struct i2c_client *client,
> >  	if (IS_ERR(chip))
> >  		return PTR_ERR(chip);
> >  
> > -	chip->vendor.priv = devm_kzalloc(dev, sizeof(struct priv_data),
> > -					 GFP_KERNEL);
> > -	if (!chip->vendor.priv)
> > +	chip->priv = devm_kzalloc(dev, sizeof(struct priv_data),
> > +				  GFP_KERNEL);
> > +	if (!chip->priv)
> >  		return -ENOMEM;
> >  
> >  	/* Default timeouts */
> > diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c
> > index a43b5f3..a9c6b2d 100644
> > --- a/drivers/char/tpm/tpm_i2c_nuvoton.c
> > +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c
> > @@ -178,7 +178,7 @@ static int i2c_nuvoton_wait_for_stat(struct tpm_chip *chip, u8 mask, u8 value,
> >  {
> >  	if (chip->vendor.irq && queue) {
> >  		s32 rc;
> > -		struct priv_data *priv = chip->vendor.priv;
> > +		struct priv_data *priv = chip->priv;
> >  		unsigned int cur_intrs = priv->intrs;
> >  
> >  		enable_irq(chip->vendor.irq);
> > @@ -473,7 +473,7 @@ static const struct tpm_class_ops tpm_i2c = {
> >  static irqreturn_t i2c_nuvoton_int_handler(int dummy, void *dev_id)
> >  {
> >  	struct tpm_chip *chip = dev_id;
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	priv->intrs++;
> >  	wake_up(&chip->vendor.read_queue);
> > @@ -534,9 +534,9 @@ static int i2c_nuvoton_probe(struct i2c_client *client,
> >  	if (IS_ERR(chip))
> >  		return PTR_ERR(chip);
> >  
> > -	chip->vendor.priv = devm_kzalloc(dev, sizeof(struct priv_data),
> > +	chip->priv = devm_kzalloc(dev, sizeof(struct priv_data),
> >  					 GFP_KERNEL);
> > -	if (!chip->vendor.priv)
> > +	if (!chip->priv)
> >  		return -ENOMEM;
> >  
> >  	init_waitqueue_head(&chip->vendor.read_queue);
> > diff --git a/drivers/char/tpm/tpm_nsc.c b/drivers/char/tpm/tpm_nsc.c
> > index 8ccb1d5..48cc7ff 100644
> > --- a/drivers/char/tpm/tpm_nsc.c
> > +++ b/drivers/char/tpm/tpm_nsc.c
> > @@ -69,7 +69,7 @@ struct tpm_nsc_priv {
> >  	unsigned long base;
> >  };
> >  
> > -#define tpm_nsc_get_priv(chip) ((struct tpm_nsc_priv *) chip->vendor.priv)
> > +#define tpm_nsc_get_priv(chip) ((struct tpm_nsc_priv *) chip->priv)
> >  
> >  /*
> >   * Wait for a certain status to appear
> > @@ -331,7 +331,7 @@ static int __init init_nsc(void)
> >  		goto err_rel_reg;
> >  	}
> >  
> > -	chip->vendor.priv = priv;
> > +	chip->priv = priv;
> >  
> >  	rc = tpm_chip_register(chip);
> >  	if (rc)
> > diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> > index 19dac62..96cb824 100644
> > --- a/drivers/char/tpm/tpm_tis.c
> > +++ b/drivers/char/tpm/tpm_tis.c
> > @@ -129,7 +129,7 @@ static inline int is_itpm(struct acpi_device *dev)
> >   * correct values in the other bits.' */
> >  static int wait_startup(struct tpm_chip *chip, int l)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	unsigned long stop = jiffies + chip->vendor.timeout_a;
> >  	do {
> >  		if (ioread8(priv->iobase + TPM_ACCESS(l)) &
> > @@ -142,7 +142,7 @@ static int wait_startup(struct tpm_chip *chip, int l)
> >  
> >  static int check_locality(struct tpm_chip *chip, int l)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	if ((ioread8(priv->iobase + TPM_ACCESS(l)) &
> >  	     (TPM_ACCESS_ACTIVE_LOCALITY | TPM_ACCESS_VALID)) ==
> > @@ -154,7 +154,7 @@ static int check_locality(struct tpm_chip *chip, int l)
> >  
> >  static void release_locality(struct tpm_chip *chip, int l, int force)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	if (force || (ioread8(priv->iobase + TPM_ACCESS(l)) &
> >  		      (TPM_ACCESS_REQUEST_PENDING | TPM_ACCESS_VALID)) ==
> > @@ -165,7 +165,7 @@ static void release_locality(struct tpm_chip *chip, int l, int force)
> >  
> >  static int request_locality(struct tpm_chip *chip, int l)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	unsigned long stop, timeout;
> >  	long rc;
> >  
> > @@ -206,7 +206,7 @@ again:
> >  
> >  static u8 tpm_tis_status(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	return ioread8(priv->iobase +
> >  		       TPM_STS(chip->vendor.locality));
> > @@ -214,7 +214,7 @@ static u8 tpm_tis_status(struct tpm_chip *chip)
> >  
> >  static void tpm_tis_ready(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	/* this causes the current command to be aborted */
> >  	iowrite8(TPM_STS_COMMAND_READY,
> > @@ -223,7 +223,7 @@ static void tpm_tis_ready(struct tpm_chip *chip)
> >  
> >  static int get_burstcount(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	unsigned long stop;
> >  	int burstcnt;
> >  
> > @@ -245,7 +245,7 @@ static int get_burstcount(struct tpm_chip *chip)
> >  
> >  static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	int size = 0, burstcnt;
> >  	while (size < count &&
> >  	       wait_for_tpm_stat(chip,
> > @@ -264,7 +264,7 @@ static int recv_data(struct tpm_chip *chip, u8 *buf, size_t count)
> >  
> >  static int tpm_tis_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	int size = 0;
> >  	int expected, status;
> >  
> > @@ -320,7 +320,7 @@ MODULE_PARM_DESC(itpm, "Force iTPM workarounds (found on some Lenovo laptops)");
> >   */
> >  static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	int rc, status, burstcnt;
> >  	size_t count = 0;
> >  
> > @@ -376,7 +376,7 @@ out_err:
> >  
> >  static void disable_interrupts(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	u32 intmask;
> >  
> >  	intmask =
> > @@ -396,7 +396,7 @@ static void disable_interrupts(struct tpm_chip *chip)
> >   */
> >  static int tpm_tis_send_main(struct tpm_chip *chip, u8 *buf, size_t len)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	int rc;
> >  	u32 ordinal;
> >  	unsigned long dur;
> > @@ -434,7 +434,7 @@ out_err:
> >  static int tpm_tis_send(struct tpm_chip *chip, u8 *buf, size_t len)
> >  {
> >  	int rc, irq;
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	if (!chip->vendor.irq || priv->irq_tested)
> >  		return tpm_tis_send_main(chip, buf, len);
> > @@ -466,7 +466,7 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = {
> >  static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
> >  				    unsigned long *timeout_cap)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	int i;
> >  	u32 did_vid;
> >  
> > @@ -490,7 +490,7 @@ static bool tpm_tis_update_timeouts(struct tpm_chip *chip,
> >   */
> >  static int probe_itpm(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	int rc = 0;
> >  	u8 cmd_getticks[] = {
> >  		0x00, 0xc1, 0x00, 0x00, 0x00, 0x0a,
> > @@ -532,7 +532,7 @@ out:
> >  
> >  static bool tpm_tis_req_canceled(struct tpm_chip *chip, u8 status)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	switch (priv->manufacturer_id) {
> >  	case TPM_VID_WINBOND:
> > @@ -559,7 +559,7 @@ static const struct tpm_class_ops tpm_tis = {
> >  static irqreturn_t tis_int_handler(int dummy, void *dev_id)
> >  {
> >  	struct tpm_chip *chip = dev_id;
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	u32 interrupt;
> >  	int i;
> >  
> > @@ -569,7 +569,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
> >  	if (interrupt == 0)
> >  		return IRQ_NONE;
> >  
> > -	((struct priv_data *)chip->vendor.priv)->irq_tested = true;
> > +	((struct priv_data *)chip->priv)->irq_tested = true;
> >  	if (interrupt & TPM_INTF_DATA_AVAIL_INT)
> >  		wake_up_interruptible(&chip->vendor.read_queue);
> >  	if (interrupt & TPM_INTF_LOCALITY_CHANGE_INT)
> > @@ -596,7 +596,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)
> >  static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
> >  				    int flags, int irq)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	u8 original_int_vec;
> >  
> >  	if (devm_request_irq(&chip->dev, irq, tis_int_handler, flags,
> > @@ -649,7 +649,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,
> >   */
> >  static void tpm_tis_probe_irq(struct tpm_chip *chip, u32 intmask)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	u8 original_int_vec;
> >  	int i;
> >  
> > @@ -673,7 +673,7 @@ MODULE_PARM_DESC(interrupts, "Enable interrupts");
> >  
> >  static void tpm_tis_remove(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  
> >  	if (chip->flags & TPM_CHIP_FLAG_TPM2)
> >  		tpm2_shutdown(chip, TPM2_SU_CLEAR);
> > @@ -702,7 +702,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info,
> >  	if (IS_ERR(chip))
> >  		return PTR_ERR(chip);
> >  
> > -	chip->vendor.priv = priv;
> > +	chip->priv = priv;
> >  #ifdef CONFIG_ACPI
> >  	chip->acpi_dev_handle = acpi_dev_handle;
> >  #endif
> > @@ -841,7 +841,7 @@ out_err:
> >  #ifdef CONFIG_PM_SLEEP
> >  static void tpm_tis_reenable_interrupts(struct tpm_chip *chip)
> >  {
> > -	struct priv_data *priv = chip->vendor.priv;
> > +	struct priv_data *priv = chip->priv;
> >  	u32 intmask;
> >  
> >  	/* reenable interrupts that device may have lost or
> > -- 
> > 2.5.0
> > 

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/5] tpm: drop list from struct tpm_vendor_specific
       [not found]         ` <20160324140835.GA21170-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2016-03-29 16:25           ` Jarkko Sakkinen
  0 siblings, 0 replies; 16+ messages in thread
From: Jarkko Sakkinen @ 2016-03-29 16:25 UTC (permalink / raw)
  To: Christophe Ricard
  Cc: jean-luc.blanc-qxv4g6HH51o, ashley-fm2HMyfA2y6tG0bUXCXiUA,
	tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	christophe-h.ricard-qxv4g6HH51o, benoit.houyere-qxv4g6HH51o

On Thu, Mar 24, 2016 at 04:08:35PM +0200, Jarkko Sakkinen wrote:
> On Wed, Mar 23, 2016 at 09:17:17PM +0100, Christophe Ricard wrote:
> > Dropped list from struct tpm_vendor_specific as it is not used in any
> > place.
> > 
> > It is initialized in tpm_i2c_infineon but not used at all in the code.
> > 
> > Signed-off-by: Christophe Ricard <christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
> 
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>

You can drop this patch from next version of the series as it is
applied.

/Jarkko

> /Jarkko
> 
> > ---
> >  drivers/char/tpm/tpm.h              | 1 -
> >  drivers/char/tpm/tpm_i2c_infineon.c | 1 -
> >  2 files changed, 2 deletions(-)
> > 
> > diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
> > index 0d1b7e6..357ac14 100644
> > --- a/drivers/char/tpm/tpm.h
> > +++ b/drivers/char/tpm/tpm.h
> > @@ -133,7 +133,6 @@ struct tpm_chip;
> >  struct tpm_vendor_specific {
> >  	int irq;
> >  
> > -	struct list_head list;
> >  	int locality;
> >  	unsigned long timeout_a, timeout_b, timeout_c, timeout_d; /* jiffies */
> >  	bool timeout_adjusted;
> > diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
> > index f2aa99e..e74f1c1 100644
> > --- a/drivers/char/tpm/tpm_i2c_infineon.c
> > +++ b/drivers/char/tpm/tpm_i2c_infineon.c
> > @@ -619,7 +619,6 @@ static int tpm_tis_i2c_init(struct device *dev)
> >  
> >  	dev_info(dev, "1.2 TPM (device-id 0x%X)\n", vendor >> 16);
> >  
> > -	INIT_LIST_HEAD(&chip->vendor.list);
> >  	tpm_dev.chip = chip;
> >  
> >  	tpm_get_timeouts(chip);
> > -- 
> > 2.5.0
> > 

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-03-29 16:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 20:17 [PATCH 0/5] Cleanup struct tpm_vendor_specific Christophe Ricard
     [not found] ` <1458764240-24185-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-23 20:17   ` [PATCH 1/5] tpm: drop 'iobase' from " Christophe Ricard
     [not found]     ` <1458764240-24185-2-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-23 22:58       ` Jason Gunthorpe
2016-03-24 14:06       ` Jarkko Sakkinen
2016-03-23 20:17   ` [PATCH 2/5] tpm: drop list " Christophe Ricard
     [not found]     ` <1458764240-24185-3-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-23 22:57       ` Jason Gunthorpe
2016-03-24 14:08       ` Jarkko Sakkinen
     [not found]         ` <20160324140835.GA21170-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-29 16:25           ` Jarkko Sakkinen
2016-03-23 20:17   ` [PATCH 3/5] tpm: Move priv field from tpm_vendor_specific to tpm_chip Christophe Ricard
     [not found]     ` <1458764240-24185-4-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-24 14:12       ` Jarkko Sakkinen
     [not found]         ` <20160324141208.GA21689-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-03-24 14:13           ` Jarkko Sakkinen
2016-03-23 20:17   ` [PATCH 4/5] tpm: Move irqs field from tpm_vendor_specific to tpm_chip structure Christophe Ricard
     [not found]     ` <1458764240-24185-5-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-23 22:52       ` Jason Gunthorpe
2016-03-23 20:17   ` [PATCH 5/5] tpm: Rename tpm_vendor_specific structure to tpm_protocol_infos Christophe Ricard
     [not found]     ` <1458764240-24185-6-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-03-23 22:54       ` Jason Gunthorpe
     [not found]         ` <20160323225454.GD17397-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-03-24  6:14           ` Christophe Ricard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.