tpm: Fix suspend regression
PATCH v2 1/1 tpm: Fix suspend regression
Fix the suspend regression due to the wrong way of retrieving the chip structure. The suspend functions are attached to the hardware device, not the chip and thus must rely on drvdata.
--- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm-interface.c +2 -2
@@ -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
Hi Stefan,
Quoted 39 lines · Stefan Berger
Fix the suspend regression due to the wrong way of retrieving the chip structure. The suspend functions are attached to the hardware device, not the chip and thus must rely on drvdata.
Fixes e89f8b1ade9cc1a ("tpm: Remove all uses of drvdata from the TPM Core")Reported-by Jeremiah Mahler <[email protected]>Signed-off-by Stefan Berger <[email protected]>Tested-by Stefan Berger <[email protected]>Tested-by Jeremiah Mahler <[email protected]>--- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/char/tpm/tpm-interface.c +2
-2@@ -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 · 1 line
2.4.3
The patch looks good, thanks :-)
Signature · 8 lines
- Jeremiah Mahler ------------------------------------------------------------------------------ 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
Quoted 10 lines · Stefan Berger
Fix the suspend regression due to the wrong way of retrieving the chip structure. The suspend functions are attached to the hardware device, not the chip and thus must rely on drvdata.
Fixes e89f8b1ade9cc1a ("tpm: Remove all uses of drvdata from the TPM Core")Reported-by Jeremiah Mahler <[email protected]>Signed-off-by Stefan Berger <[email protected]>Tested-by Stefan Berger <[email protected]>Tested-by Jeremiah Mahler <[email protected]>
/Jarkko
Quoted 29 lines
--- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/char/tpm/tpm-interface.c +2
-2@@ -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 · 1 line
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
Jarkko Sakkinen
AppliedQuoted 5 lines · Jarkko Sakkinen
Quoted 4 lines · Stefan Berger
Fix the suspend regression due to the wrong way of retrieving the chip structure. The suspend functions are attached to the hardware device, not the chip and thus must rely on drvdata.
Quoted 8 lines
Quoted 6 lines
Fixes e89f8b1ade9cc1a ("tpm: Remove all uses of drvdata from the TPM Core")Reported-by Jeremiah Mahler <[email protected]>Signed-off-by Stefan Berger <[email protected]>Tested-by Stefan Berger <[email protected]>Tested-by Jeremiah Mahler <[email protected]>
Merged to next.
/Jarkko
Quoted 26 lines
/Jarkko
Quoted 24 lines
--- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/char/tpm/tpm-interface.c +2
-2@@ -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);
Quoted 5 lines
Quoted 5 lines
drivers/char/tpm/tpm-interface.c +0
-0if (chip ==NULL )return -ENODEV ;Signature · 1 line
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