From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753059AbcELN73 (ORCPT ); Thu, 12 May 2016 09:59:29 -0400 Received: from mga14.intel.com ([192.55.52.115]:37395 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752615AbcELN72 (ORCPT ); Thu, 12 May 2016 09:59:28 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,610,1455004800"; d="scan'208";a="974351125" Date: Thu, 12 May 2016 16:58:57 +0300 From: Jarkko Sakkinen To: Stefan Berger Cc: tpmdd-devel@lists.sourceforge.net, jmmahler@gmail.com, jgunthorpe@obsidianresearch.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tpm: Fix suspend regression Message-ID: <20160512135857.GA16499@intel.com> References: <1462980507-21682-1-git-send-email-stefanb@linux.vnet.ibm.com> <20160512134952.GA13575@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160512134952.GA13575@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 12, 2016 at 04:49:52PM +0300, Jarkko Sakkinen wrote: > On Wed, May 11, 2016 at 11:28:27AM -0400, Stefan Berger wrote: > > 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 > > Signed-off-by: Stefan Berger > > Tested-by: Stefan Berger > > Reviewed-by: Jason Gunthorpe > > Tested-by: Jeremiah Mahler > > Acked-by: Jarkko Sakkinen Merged to next. /Jarkko > /Jarkko > > > --- > > drivers/char/tpm/tpm-interface.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c > > index 080dade..5e3c1b6 100644 > > --- a/drivers/char/tpm/tpm-interface.c > > +++ b/drivers/char/tpm/tpm-interface.c > > @@ -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; > > -- > > 2.4.3 > >