Skip to contentSkip to conversation

tpm/tpm_crb: Fix error message in __crb_relinquish_locality()

PATCH Applied Michael Kelley 3 participants 7 messages Nov 11, 2022 – Dec 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm/tpm_crb: Fix error message in __crb_relinquish_locality()

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality")
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
index 1860665..65f8f17 100644
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n");
 		return -ETIME;
 	}
 
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Michael Kelley <[email protected]>
Sent: Friday, November 11, 2022 21:39
To: [email protected]; [email protected]; [email protected]; Winkler, Tomas <[email protected]>; [email protected]; linux- [email protected]
Cc: [email protected]
Subject: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()

Quoted 6 lines

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after

granting locality")

Quoted 21 lines
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c index renamed from drivers/char/tpm/tpm_crb.c +0 -0

1860665..65f8f17 100644

drivers/char/tpm/tpm_crb.c +1 -1
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed
 out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed
 out\n");
 		return -ETIME;

}

--
1.8.3.1

#2 lore raw

From: Winkler, Tomas <[email protected]> Sent: Saturday, November 12, 2022 11:33 AM

Quoted 10 lines
Quoted 10 lines

-----Original Message-----
From: Michael Kelley <[email protected]>
Sent: Friday, November 11, 2022 21:39
To: [email protected]; [email protected]; [email protected]; Winkler, Tomas <[email protected]>; [email protected]; linux- [email protected]
Cc: [email protected]
Subject: [PATCH 1/1] tpm/tpm_crb: Fix error message in __crb_relinquish_locality()

Quoted 7 lines
Quoted 6 lines

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after

granting locality")

Is there a maintainer who can pick up this fix? It's not time critical; I'm just trying to make sure it doesn't get lost.

Thanks,

Michael

Quoted 22 lines
Quoted 22 lines
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c index renamed from drivers/char/tpm/tpm_crb.c +0 -0

1860665..65f8f17 100644

drivers/char/tpm/tpm_crb.c +1 -1
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed
 out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed
 out\n");
 		return -ETIME;

}

--
1.8.3.1

maintainer
#3 lore raw
In reply to Michael Kelley
Quoted 25 lines · Michael Kelley

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality")
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
index 1860665..65f8f17 100644
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n");
 		return -ETIME;
 	}
 
Signature · 1 line
1.8.3.1

Please explain.

BR, Jarkko

#4 lore raw

From: Jarkko Sakkinen <[email protected]> Sent: Sunday, November 27, 2022 8:39 AM

Quoted 24 lines · Michael Kelley
Quoted 22 lines

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality")
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
index 1860665..65f8f17 100644
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n");
 		return -ETIME;
 	}
 
Quoted 6 lines
Quoted 3 lines

--
1.8.3.1

Please explain.

There are two parallel functions: __crb_request_locality() and __crb_relinquish_locality(). In the current code, both return the same text in the error message if a timeout occurs. That error message seems appropriate for __crb_request_locality() since it is setting the "requestAccess" bit.

But the error message seems inappropriate for __crb_relinquish_locality(), which is setting the "Relinquish" bit. So the patch changes the error message to indicate that the timeout occurred in setting the Relinquish bit.

I'm looking at Section 6.5.3.2.2.1 in the TCG PC Client Platform TPM Profile Specification for TPM 2.0, Version 1.05 Revision 14. This is where the "requestAccess" and "Relinquish" bits are defined.

Or maybe I am not understanding what you are getting at with "Please explain."

Michael

maintainer Reviewed-by
#5 lore raw
Quoted 43 lines · Michael Kelley (LINUX)

From: Jarkko Sakkinen <[email protected]> Sent: Sunday, November 27, 2022 8:39 AM

Quoted 24 lines · Michael Kelley
Quoted 22 lines

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality")
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
index 1860665..65f8f17 100644
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n");
 		return -ETIME;
 	}
 
Quoted 6 lines
Quoted 3 lines

--
1.8.3.1

Please explain.

There are two parallel functions: __crb_request_locality() and __crb_relinquish_locality(). In the current code, both return the same text in the error message if a timeout occurs. That error message seems appropriate for __crb_request_locality() since it is setting the "requestAccess" bit.

But the error message seems inappropriate for __crb_relinquish_locality(), which is setting the "Relinquish" bit. So the patch changes the error message to indicate that the timeout occurred in setting the Relinquish bit.

Quoted 6 lines

I'm looking at Section 6.5.3.2.2.1 in the TCG PC Client Platform TPM Profile Specification for TPM 2.0, Version 1.05 Revision 14. This is where the "requestAccess" and "Relinquish" bits are defined.

Or maybe I am not understanding what you are getting at with "Please explain."

I misread the callback name, when I first looked into this (in too much rush). You're absolutely correct.

BR, Jarkko

maintainer Applied
#6 lore raw
Quoted 48 lines · Jarkko Sakkinen
Quoted 47 lines · Michael Kelley (LINUX)

From: Jarkko Sakkinen <[email protected]> Sent: Sunday, November 27, 2022 8:39 AM

Quoted 24 lines · Michael Kelley
Quoted 22 lines

The error message in __crb_relinquish_locality() mentions requestAccess instead of Relinquish. Fix it.

Fixes 888d867df441 ("tpm: cmd_ready command can be issued only after granting locality")
---
 drivers/char/tpm/tpm_crb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_crb.c +1 -1
index 1860665..65f8f17 100644
@@ -252,7 +252,7 @@ static int __crb_relinquish_locality(struct device *dev,
 	iowrite32(CRB_LOC_CTRL_RELINQUISH, &priv->regs_h->loc_ctrl);
 	if (!crb_wait_for_reg_32(&priv->regs_h->loc_state, mask, value,
 				 TPM2_TIMEOUT_C)) {
-		dev_warn(dev, "TPM_LOC_STATE_x.requestAccess timed out\n");
+		dev_warn(dev, "TPM_LOC_STATE_x.Relinquish timed out\n");
 		return -ETIME;
 	}
 
Quoted 6 lines
Quoted 3 lines

--
1.8.3.1

Please explain.

There are two parallel functions: __crb_request_locality() and __crb_relinquish_locality(). In the current code, both return the same text in the error message if a timeout occurs. That error message seems appropriate for __crb_request_locality() since it is setting the "requestAccess" bit.

But the error message seems inappropriate for __crb_relinquish_locality(), which is setting the "Relinquish" bit. So the patch changes the error message to indicate that the timeout occurred in setting the Relinquish bit.

I'm looking at Section 6.5.3.2.2.1 in the TCG PC Client Platform TPM Profile Specification for TPM 2.0, Version 1.05 Revision 14. This is where the "requestAccess" and "Relinquish" bits are defined.

Quoted 7 lines
Quoted 2 lines

Or maybe I am not understanding what you are getting at with "Please explain."

I misread the callback name, when I first looked into this (in too much rush). You're absolutely correct.

Applied to git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git

BR, Jarkko