From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Jiandi An <anjiandi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] tpm, tpm_crb: Handle 64-bit resource in crb_check_resource()
Date: Mon, 19 Dec 2016 15:56:24 +0200 [thread overview]
Message-ID: <20161219135624.2e7okpswnbqbvic7@intel.com> (raw)
In-Reply-To: <1482121253-924-1-git-send-email-anjiandi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.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 <anjiandi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
1. Is there a platform in existence where this change fixes a problem?
2. What is difference between "memory" and "address space" conceptually?
Just wondering why 32-bit stuff is "memory" and 64-bit stuff is
"address space". Could there be a one function that would work both
for 32-bit and 64-bit cases?
Yeah, I do not know this API too well. That's why I'm asking.
/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.
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Jiandi An <anjiandi@codeaurora.org>
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()
Date: Mon, 19 Dec 2016 15:56:24 +0200 [thread overview]
Message-ID: <20161219135624.2e7okpswnbqbvic7@intel.com> (raw)
In-Reply-To: <1482121253-924-1-git-send-email-anjiandi@codeaurora.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 <anjiandi@codeaurora.org>
1. Is there a platform in existence where this change fixes a problem?
2. What is difference between "memory" and "address space" conceptually?
Just wondering why 32-bit stuff is "memory" and 64-bit stuff is
"address space". Could there be a one function that would work both
for 32-bit and 64-bit cases?
Yeah, I do not know this API too well. That's why I'm asking.
/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.
>
next prev parent reply other threads:[~2016-12-19 13:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 4:20 [PATCH] tpm, tpm_crb: Handle 64-bit resource in crb_check_resource() Jiandi An
[not found] ` <1482121253-924-1-git-send-email-anjiandi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2016-12-19 13:56 ` Jarkko Sakkinen [this message]
2016-12-19 13:56 ` Jarkko Sakkinen
[not found] ` <20161219135624.2e7okpswnbqbvic7-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-19 16:22 ` Jason Gunthorpe
2016-12-19 16:22 ` Jason Gunthorpe
2016-12-20 6:19 ` Jiandi An
2016-12-20 6:19 ` [tpmdd-devel] " Jiandi An
[not found] ` <5858CD6F.5000909-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-01-03 17:11 ` Jarkko Sakkinen
2017-01-03 17:11 ` [tpmdd-devel] " Jarkko Sakkinen
2017-01-03 18:27 ` Jarkko Sakkinen
2017-01-03 18:27 ` Jarkko Sakkinen
[not found] ` <20170103182712.gd5ik7rbia5jt7o7-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-01-09 18:43 ` Jarkko Sakkinen
2017-01-09 18:43 ` Jarkko Sakkinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161219135624.2e7okpswnbqbvic7@intel.com \
--to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=anjiandi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.