From: Christophe Ricard <christophe.ricard-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: jean-luc.blanc-qxv4g6HH51o@public.gmane.org,
ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org,
tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
christophe-h.ricard-qxv4g6HH51o@public.gmane.org,
benoit.houyere-qxv4g6HH51o@public.gmane.org
Subject: Re: [PATCH v3 00/12] Rework of tpm_tis to share common logic accross phy's (lpc/spi/-i2c-)
Date: Wed, 20 Apr 2016 08:52:11 +0200 [thread overview]
Message-ID: <5717271B.7000502@gmail.com> (raw)
In-Reply-To: <20160419175906.GB26460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
On 19/04/2016 19:59, Jason Gunthorpe wrote:
> On Tue, Apr 19, 2016 at 07:11:27AM +0200, Christophe Ricard wrote:
>> Please have a look to:
>> https://github.com/cricard13/linux-tpmdd
> Okay, looking at how everything ended up..
>
> The indentation in tpm_tis_core.h should be fixed up.
I am not sure where you are seeing indentation issues in v4 ?
> These:
>
> static inline int tpm_read_bytes(struct tpm_chip *chip, u32 addr, u16 len,
> u8 *result)
>
> Should not take a 'chip' as an argument, they only work with tpm_tis
> devices, so they should take tpm_tis_data as an argument. Same with
> the ops. Typesafety for correctness..
Ok
>
> Why is release_localtity exported but request_locality is not? There
> is something really wonky looking with how that locality stuff works.
request_locality is called in tpm_tis_send_data.
The fact is that to run itpm workaround, we need to execute
tpm_tis_send_data, tpm_tis_ready and release_locality.
To answer to the remaining point i see 3 possibles options:
- implement in tpm_tis.c a tpm_tis_release that would execute the
equivalent sequence of tpm_tis_ready and release_locality.
It would avoid to export those functions.
- rename release_locality tpm_tis_release_locality as per your previous
request... Sorry for that :(.
- Implement a specific tpm_tis_release exported function in tpm_tis_core
that would execute tpm_tis_ready/release_locality.
My personal choice would go for options 2 and rename release_locality
tpm_tis_release_locality.
Another option would be to remove this workaround but i don't think it
is the solution ;).
> I wonder if the itpm detection routine should move to the core code?
> It uses so many internal functions it isn't all that nice to have them
> exported just for that. A phy could have a flag TPM_TIS_ITPM_POSSIBLE
> to turn it on.
So actually that's where "the pain" came from... How to manage the itpm
workaround in
a phy specific layer in a clean way ?
To my mind, the realistic goal was to provide a specific handle for
proprietary post probing steps.
I hope this workaround will not be required for future "itpm" running on
spi, i2c and such.
> No to stuff like this:
>
> /* Check SPI platform functionnalities */
> if (!dev) {
> pr_err("%s: dev is NULL. Device is not accessible.\n",
> __func__);
> return -ENODEV;
> }
Ok
>
> The core has a tpm_tis_remove function, but the spi driver doesn't
> call it, that looks wrong.
Yes it is wrong i got it fixed for a newer version. :)
> Use inlines functions:
> #define to_tpm_tis_spi_phy(data) container_of(data, struct tpm_tis_spi_phy,\
ok
> Review all the EXPORT'd symbols and see if they are really necessary..
> eg tpm_tis_ready(chip); is just chip->ops->cancel(chip)
Yes. I think the most discussible EXPORT'd symbols now are
tpm_tis_send_data and release_locality.
I gave some input above
> Make sure you put the new obj-XX lines in Makefile in the correct
> sorted position. Ditto for kconfig
ok
>
> Jason
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
prev parent reply other threads:[~2016-04-20 6:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-16 6:35 [PATCH v3 00/12] Rework of tpm_tis to share common logic accross phy's (lpc/spi/-i2c-) Christophe Ricard
[not found] ` <1460788542-2455-1-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-04-16 6:35 ` [PATCH v3 01/12] tpm: Add include guards in tpm.h Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 02/12] tpm: tpm_tis: Share common data between phys Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 03/12] tpm: tpm_tis: Rename priv_data structure tpm_tis_data Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 04/12] tpm_tis: Introduce intermediate layer for TPM access Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 05/12] tpm_tis: Extend low-level interface to support proper return codes Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 06/12] tpm: Use read/write_bytes for drivers without more specialized methods Christophe Ricard
[not found] ` <1460788542-2455-7-git-send-email-christophe-h.ricard-qxv4g6HH51o@public.gmane.org>
2016-04-18 17:01 ` Jason Gunthorpe
2016-04-16 6:35 ` [PATCH v3 07/12] tpm: Manage itpm workaround with tis specific data_expect bit Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 08/12] tpm: tpm_tis: Add post_probe phy handler Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 09/12] devicetree: Add infineon to vendor-prefix.txt Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 10/12] devicetree: Add Trusted Computing Group " Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 11/12] tpm/tpm_tis: Split tpm_tis driver into a core and TCG TIS compliant phy Christophe Ricard
2016-04-16 6:35 ` [PATCH v3 12/12] tpm/tpm_tis_spi: Add support for spi phy Christophe Ricard
2016-04-18 17:23 ` [PATCH v3 00/12] Rework of tpm_tis to share common logic accross phy's (lpc/spi/-i2c-) Jason Gunthorpe
[not found] ` <20160418172352.GB13979-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-04-19 5:11 ` Christophe Ricard
[not found] ` <5715BDFF.5000702-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-04-19 17:59 ` Jason Gunthorpe
[not found] ` <20160419175906.GB26460-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-04-20 6:52 ` Christophe Ricard [this message]
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=5717271B.7000502@gmail.com \
--to=christophe.ricard-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=ashley-fm2HMyfA2y6tG0bUXCXiUA@public.gmane.org \
--cc=benoit.houyere-qxv4g6HH51o@public.gmane.org \
--cc=christophe-h.ricard-qxv4g6HH51o@public.gmane.org \
--cc=jean-luc.blanc-qxv4g6HH51o@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).