Skip to contentSkip to conversation

tpm: MAINTAINERS: Add myself as tpm maintainer

PATCH In review Peter Huewe 4 participants 8 messages Oct 22, 2013

Subsystems (3)
lore
Share & tools
lore

Peter Huewe

author maintainer
#0 lore raw

PATCH 1/15 tpm: MAINTAINERS: Add myself as tpm maintainer

Since I'm actively maintaining the tpm subsystem for a few months now, it's time to step up and be an official maintainer for the tpm subsystem, atleast until I hear something different from my company.

The maintaining is done solely in my private time, out of private interest. Speaking only on behalf of myself, trying to be as vendor neutral as possible.

---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
MAINTAINERS +1 -0
index 4fde706..936adb4 100644
@@ -8475,6 +8475,7 @@ F:	drivers/media/usb/tm6000/
 TPM DEVICE DRIVER
 M:	Leonidas Da Silva Barbosa <[email protected]>
 M:	Ashley Lai <[email protected]>
+M:	Peter Huewe <[email protected]>
 M:	Rajiv Andrade <[email protected]>
 W:	http://tpmdd.sourceforge.net
 M:	Marcel Selhorst <[email protected]>
Signature · 1 line
1.7.5.4
author maintainer
#1 lore raw

PATCH 2/15 tpm: ibmvtpm: Use %zd formatting for size_t format arguments

From: Jason Gunthorpe <[email protected]>

This suppresses compile warnings on 32 bit builds.

---
 drivers/char/tpm/tpm_ibmvtpm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_ibmvtpm.c +2 -2
index 56b07c3..838f043 100644
@@ -98,7 +98,7 @@ static int tpm_ibmvtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count)
 
 	if (count < len) {
 		dev_err(ibmvtpm->dev,
-			"Invalid size in recv: count=%ld, crq_size=%d\n",
+			"Invalid size in recv: count=%zd, crq_size=%d\n",
 			count, len);
 		return -EIO;
 	}
@@ -136,7 +136,7 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)
 
 	if (count > ibmvtpm->rtce_size) {
 		dev_err(ibmvtpm->dev,
-			"Invalid size in send: count=%ld, rtce_size=%d\n",
+			"Invalid size in send: count=%zd, rtce_size=%d\n",
 			count, ibmvtpm->rtce_size);
 		return -EIO;
 	}
Signature · 1 line
1.7.5.4
author maintainer
#2 lore raw

PATCH 3/15 tpm atmel: Call request_region with the correct base

In reply to Peter Huewe

From: Jason Gunthorpe <[email protected]>

Commit e0dd03caf20d040a0a86 ("tpm: return chip from tpm_register_hardware") changed the code path here so that ateml_get_base_addr no longer directly altered the tpm_vendor_specific structure, and instead placed the base address on the stack.

The commit missed updating the request_region call, which would have resulted in request_region being called with 0 as the base address.

I don't know if request_region(0, ..) will fail, if so the driver has been broken since 2006 and we should remove it from the tree as it has no users.

---
 drivers/char/tpm/tpm_atmel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/tpm/tpm_atmel.c +1 -1
index 99d6820..c9a528d 100644
@@ -202,7 +202,7 @@ static int __init init_atmel(void)
 
 	have_region =
 	    (atmel_request_region
-	     (tpm_atmel.base, region_size, "tpm_atmel0") == NULL) ? 0 : 1;
+	     (base, region_size, "tpm_atmel0") == NULL) ? 0 : 1;
 
 	pdev = platform_device_register_simple("tpm_atmel", -1, NULL, 0);
 	if (IS_ERR(pdev)) {
Signature · 1 line
1.7.5.4
author maintainer
#3 lore raw

PATCH 4/15 tpm: Store devname in the tpm_chip

In reply to Peter Huewe

From: Jason Gunthorpe <[email protected]>

Just put the memory directly in the chip structure, rather than in a 2nd dedicated kmalloc.

---
 drivers/char/tpm/tpm.c |   17 ++++++-----------
 drivers/char/tpm/tpm.h |    1 +
 2 files changed, 7 insertions(+), 11 deletions(-)
drivers/char/tpm/tpm.c +6 -11
index e3c974a..71eb8c7 100644
@@ -1463,7 +1463,6 @@ void tpm_dev_vendor_release(struct tpm_chip *chip)
 		chip->vendor.release(chip->dev);
 
 	clear_bit(chip->dev_num, dev_mask);
-	kfree(chip->vendor.miscdev.name);
 }
 EXPORT_SYMBOL_GPL(tpm_dev_vendor_release);
 
@@ -1496,17 +1495,13 @@ EXPORT_SYMBOL_GPL(tpm_dev_release);
 struct tpm_chip *tpm_register_hardware(struct device *dev,
 					const struct tpm_vendor_specific *entry)
 {
-#define DEVNAME_SIZE 7
-
-	char *devname;
 	struct tpm_chip *chip;
 
 	/* Driver specific per-device data */
 	chip = kzalloc(sizeof(*chip), GFP_KERNEL);
-	devname = kmalloc(DEVNAME_SIZE, GFP_KERNEL);
 
-	if (chip == NULL || devname == NULL)
-		goto out_free;
+	if (chip == NULL)
+		return NULL;
 
 	mutex_init(&chip->buffer_mutex);
 	mutex_init(&chip->tpm_mutex);
@@ -1531,8 +1526,9 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
 
 	set_bit(chip->dev_num, dev_mask);
 
-	scnprintf(devname, DEVNAME_SIZE, "%s%d", "tpm", chip->dev_num);
-	chip->vendor.miscdev.name = devname;
+	scnprintf(chip->devname, sizeof(chip->devname), "%s%d", "tpm",
+		  chip->dev_num);
+	chip->vendor.miscdev.name = chip->devname;
 
 	chip->vendor.miscdev.parent = dev;
 	chip->dev = get_device(dev);
@@ -1558,7 +1554,7 @@ struct tpm_chip *tpm_register_hardware(struct device *dev,
 		goto put_device;
 	}
 
-	chip->bios_dir = tpm_bios_log_setup(devname);
+	chip->bios_dir = tpm_bios_log_setup(chip->devname);
 
 	/* Make chip available */
 	spin_lock(&driver_lock);
@@ -1571,7 +1567,6 @@ put_device:
 	put_device(chip->dev);
 out_free:
 	kfree(chip);
-	kfree(devname);
 	return NULL;
 }
 EXPORT_SYMBOL_GPL(tpm_register_hardware);
drivers/char/tpm/tpm.h +1 -0
index a7bfc17..0df18b5 100644
@@ -122,6 +122,7 @@ struct tpm_chip {
 	struct device *dev;	/* Device stuff */
 
 	int dev_num;		/* /dev/tpm# */
+	char devname[7];
 	unsigned long is_open;	/* only one allowed */
 	int time_expired;
 
Signature · 1 line
1.7.5.4
author maintainer
#4 lore raw

PATCH 5/15 tpm: Use container_of to locate the tpm_chip in tpm_open

In reply to Peter Huewe

From: Jason Gunthorpe <[email protected]>

misc_open sets the file->private_date to the misc_dev when calling open. We can use container_of to go from the misc_dev back to the tpm_chip.

Future clean ups will move tpm_open into a new file and this change means we do not have to export the tpm_chip list.

---
 drivers/char/tpm/tpm.c |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)
drivers/char/tpm/tpm.c +4 -17
index 71eb8c7..c3ab508 100644
@@ -1170,38 +1170,25 @@ EXPORT_SYMBOL_GPL(wait_for_tpm_stat);
  */
 int tpm_open(struct inode *inode, struct file *file)
 {
-	int minor = iminor(inode);
-	struct tpm_chip *chip = NULL, *pos;
-
-	rcu_read_lock();
-	list_for_each_entry_rcu(pos, &tpm_chip_list, list) {
-		if (pos->vendor.miscdev.minor == minor) {
-			chip = pos;
-			get_device(chip->dev);
-			break;
-		}
-	}
-	rcu_read_unlock();
-
-	if (!chip)
-		return -ENODEV;
+	struct miscdevice *misc = file->private_data;
+	struct tpm_chip *chip = container_of(misc, struct tpm_chip,
+					     vendor.miscdev);
 
 	if (test_and_set_bit(0, &chip->is_open)) {
 		dev_dbg(chip->dev, "Another process owns this TPM\n");
-		put_device(chip->dev);
 		return -EBUSY;
 	}
 
 	chip->data_buffer = kzalloc(TPM_BUFSIZE, GFP_KERNEL);
 	if (chip->data_buffer == NULL) {
 		clear_bit(0, &chip->is_open);
-		put_device(chip->dev);
 		return -ENOMEM;
 	}
 
 	atomic_set(&chip->data_pending, 0);
 
 	file->private_data = chip;
+	get_device(chip->dev);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(tpm_open);
Signature · 1 line
1.7.5.4
#5 lore raw
In reply to Peter Huewe

I completely support Peter's request, and many thanks to Peter for volunteering.

Quoted 38 lines · Peter Huewe

Since I'm actively maintaining the tpm subsystem for a few months now, it's time to step up and be an official maintainer for the tpm subsystem, atleast until I hear something different from my company.

The maintaining is done solely in my private time, out of private interest. Speaking only on behalf of myself, trying to be as vendor neutral as possible.

---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
MAINTAINERS +1 -1
index 4fde706..936adb4 100644
@@ -8475,6 +8475,7 @@ F:        drivers/media/usb/tm6000/
 TPM DEVICE DRIVER
 M:     Leonidas Da Silva Barbosa <[email protected]>
 M:     Ashley Lai <[email protected]>
+M:     Peter Huewe <[email protected]>
 M:     Rajiv Andrade <[email protected]>
 W:     http://tpmdd.sourceforge.net
 M:     Marcel Selhorst <[email protected]>
--

1.7.5.4

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel

#6 lore raw
In reply to Peter Huewe
Quoted 17 lines · Peter Huewe

Since I'm actively maintaining the tpm subsystem for a few months now, it's time to step up and be an official maintainer for the tpm subsystem, atleast until I hear something different from my company.

The maintaining is done solely in my private time, out of private interest. Speaking only on behalf of myself, trying to be as vendor neutral as possible.

---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
MAINTAINERS +0 -0
index 4fde706..936adb4 100644

MAINTAINERS F: drivers/media/usb/tm6000/ · line 8481

Quoted 7 lines
MAINTAINERS +1 -0
@@ -8475,6 +8475,7 @@ F:	drivers/media/usb/tm6000/
 TPM DEVICE DRIVER
 M:	Leonidas Da Silva Barbosa <[email protected]>
 M:	Ashley Lai <[email protected]>
+M:	Peter Huewe <[email protected]>
 M:	Rajiv Andrade <[email protected]>
 W:	http://tpmdd.sourceforge.net
 M:	Marcel Selhorst <[email protected]>

Peter has been a great help on maintaining the tpm driver. Thanks for volunteering, you have my support on this.

--Ashley Lai

#7 lore raw
Quoted 13 lines · Ashley D Lai
Quoted 12 lines · Peter Huewe

Since I'm actively maintaining the tpm subsystem for a few months now, it's time to step up and be an official maintainer for the tpm subsystem, atleast until I hear something different from my company.

The maintaining is done solely in my private time, out of private interest. Speaking only on behalf of myself, trying to be as vendor neutral as possible.

---
 MAINTAINERS |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 15 lines

MAINTAINERS F: drivers/media/usb/tm6000/ · line 8481

Quoted 12 lines
MAINTAINERS +1 -0
index 4fde706..936adb4 100644
@@ -8475,6 +8475,7 @@ F:	drivers/media/usb/tm6000/
 TPM DEVICE DRIVER
 M:	Leonidas Da Silva Barbosa <[email protected]>
 M:	Ashley Lai <[email protected]>
+M:	Peter Huewe <[email protected]>
 M:	Rajiv Andrade <[email protected]>
 W:	http://tpmdd.sourceforge.net
 M:	Marcel Selhorst <[email protected]>

Peter has been a great help on maintaining the tpm driver. Thanks for volunteering, you have my support on this.

It'd be nice if all the M entries were clustered together and probably nice too if the
W: http://www.sirrix.com
entry removed. I didn't notice anything useful there about the driver.
Maybe there's a specific page about the driver buried on the corporate website. If so, that specific page should be linked instead.