From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965503AbdACS2J (ORCPT ); Tue, 3 Jan 2017 13:28:09 -0500 Received: from mga04.intel.com ([192.55.52.120]:27562 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760270AbdACS2E (ORCPT ); Tue, 3 Jan 2017 13:28:04 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,456,1477983600"; d="scan'208";a="1078791156" Date: Tue, 3 Jan 2017 20:27:12 +0200 From: Jarkko Sakkinen To: Jiandi An Cc: peterhuewe@gmx.de, tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com, tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tpm, tpm_crb: Handle 64-bit resource in crb_check_resource() Message-ID: <20170103182712.gd5ik7rbia5jt7o7@intel.com> References: <1482121253-924-1-git-send-email-anjiandi@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1482121253-924-1-git-send-email-anjiandi@codeaurora.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.6.2-neo (2016-08-21) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 18, 2016 at 10:20:53PM -0600, Jiandi An wrote: > crb_check_resource() in TPM CRB driver calls > acpi_dev_resource_memory() which only handles 32-bit resources. > Adding a call to acpi_dev_resource_address_space() in TPM CRB > driver which handles 64-bit resources. > > Signed-off-by: Jiandi An Reviewed-by: Jarkko Sakkinen /Jarkko > --- > drivers/char/tpm/tpm_crb.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/drivers/char/tpm/tpm_crb.c b/drivers/char/tpm/tpm_crb.c > index 717b6b4..86f355b 100644 > --- a/drivers/char/tpm/tpm_crb.c > +++ b/drivers/char/tpm/tpm_crb.c > @@ -264,10 +264,12 @@ static bool crb_req_canceled(struct tpm_chip *chip, u8 status) > static int crb_check_resource(struct acpi_resource *ares, void *data) > { > struct resource *io_res = data; > - struct resource res; > + struct resource_win win; > + struct resource *res = &(win.res); > > - if (acpi_dev_resource_memory(ares, &res)) { > - *io_res = res; > + if (acpi_dev_resource_memory(ares, res) || > + acpi_dev_resource_address_space(ares, &win)) { > + *io_res = *res; > io_res->name = NULL; > } > > -- > Jiandi An > Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. > Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project. >