Skip to contentSkip to conversation

tpm: Fix suspend regression

PATCH Superseded Stefan Berger 3 participants 3 messages May 10, 2016 2 messages not in the archive TPM device driver

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: Fix suspend regression

Fix the suspend regression due to wrong way of retrieving the chip from the parent device.

---
 drivers/char/tpm/tpm-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm-interface.c +2 -2
index 080dade..5e3c1b6 100644
@@ -934,7 +934,7 @@ static struct tpm_input_header savestate_header = {
  */
 int tpm_pm_suspend(struct device *dev)
 {
-	struct tpm_chip *chip = to_tpm_chip(dev);
+	struct tpm_chip *chip = dev_get_drvdata(dev);
 	struct tpm_cmd_t cmd;
 	int rc, try;
 
@@ -995,7 +995,7 @@ EXPORT_SYMBOL_GPL(tpm_pm_suspend);
  */
 int tpm_pm_resume(struct device *dev)
 {
-	struct tpm_chip *chip = to_tpm_chip(dev);
+	struct tpm_chip *chip = dev_get_drvdata(dev);
 
 	if (chip == NULL)
 		return -ENODEV;
Signature · 9 lines
2.4.3


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j

A message that is not in the archive (sent off-list or not yet received): 1462892834-5631-1-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 2 lines · Stefan Berger

Fix the suspend regression due to wrong way of retrieving the chip from the parent device.

Yep, that is it, commentary needs a tweak though:

Fix the susped regression due to the wrong way of retrieving the chip. The suspend functions are attached to the hardware device, not the chip and thus must rely on drvdata.

Quoted 3 lines
Fixes e89f8b1ade9cc1a ("tpm: Remove all uses of drvdata from the TPM Core")

Jason

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j

A message that is not in the archive (sent off-list or not yet received): 20160510165251.GB29825-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org

#4 lore raw

Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org> wrote on 05/10/2016 12:52:51 PM:

Quoted 11 lines · Stefan Berger
Quoted 2 lines

Fix the suspend regression due to wrong way of retrieving the chip from the parent device.

Yep, that is it, commentary needs a tweak though:

Fix the susped regression due to the wrong way of retrieving the chip. The suspend functions are attached to the hardware device, not the chip and thus must rely on drvdata.

Quoted 5 lines
Quoted 3 lines
Fixes e89f8b1ade9cc1a ("tpm: Remove all uses of drvdata from the TPM

Core")

Quoted 1 line

Thanks. I'll post v2 tomorrow in case I can collect some more Tested-by's.

Stefan

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j

_______________________________________________
tpmdd-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel