Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1591068 > unrolled thread

Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.

Started byPeter Huewe <peterhuewe@gmx.de>
First post2017-03-02 14:20 +0100
Last post2017-03-02 15:30 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission. Peter Huewe <peterhuewe@gmx.de> - 2017-03-02 14:20 +0100
    Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for  retransmission. Wolfram Sang <wsa@the-dreams.de> - 2017-03-02 15:10 +0100
    Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for  retransmission. Wolfram Sang <wsa@the-dreams.de> - 2017-03-02 15:30 +0100

#1591068 — Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.

FromPeter Huewe <peterhuewe@gmx.de>
Date2017-03-02 14:20 +0100
SubjectRe: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.
Message-ID<tgyOd-2Mh-5@gated-at.bofh.it>

Am 27. Februar 2017 20:12:45 MEZ schrieb Wolfram Sang <wsa@the-dreams.de>:
>Hi,
>
>> >> > Rather than trying small and smaller transfers, would it not be
>better
>> >> > to get the i2c core to expose the quirk info about transfer
>limits?
>> >> >
>> >>
>> >> Sounds a good idea to me, I guess the quirk info can be accessed
>with
>> >>
>> >>   tpm_dev.client->adapter->quirks->max_read_len
>> >>
>> >> so I think we don't need to touch the i2c core. I'll propose a
>second version of the patch.
>> >
>> > Hi Enric
>> >
>> > You should probably ask Wolfram Sang <wsa@the-dreams.de>, the i2c
>> > subsystem maintainer. He may prefer adding an API call.
>
>Thanks for pointing me to this thread.
>
>I understand it looks tempting to use the quirks struct directly, but I
>don't think this is the proper solution. Quirks are complex and and to
>determine which one finally applies, you need all the logic encoded in
>i2c_check_for_quirks(). Which already gets called on every transfer.
>
>So, my suggestion would be to simply fall back to a sane minimum when
>the maximum failed. 32 (I2C_SMBUS_BLOCK_MAX) should be a good choice.

Hi,
One problem is however that e.g. in the case of the atmel tpms, there is no sane minimum, since you mustn't split the tpm apdu.

If the command is larger than the supported adapter limit the command the only viable option is to return an error.
For this the tpm layer would need the adapter limit.

If somehow possible I would seriously vote for a adapter limit field (maybe not in the quirks).

TPMs are a not the best devices when it comes to i2c :/

Peter


>
>BTW I noted that the original patch checks for -EINVAL. The core
>returns
>-EOPNOTSUPP, though. So, a) the patch needs to be adapted and b) it
>looks the i2c host driver returning -EINVAL could be converted to use
>the quirk infrastructure? Which driver is it?
>
>Regards,
>
>   Wolfram

-- 
Sent from my mobile

[toc] | [next] | [standalone]


#1591113 — Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.

FromWolfram Sang <wsa@the-dreams.de>
Date2017-03-02 15:10 +0100
SubjectRe: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.
Message-ID<tgzAB-3lq-13@gated-at.bofh.it>
In reply to#1591068

[Multipart message — attachments visible in raw view] — view raw

> If the command is larger than the supported adapter limit the command the only viable option is to return an error.
> For this the tpm layer would need the adapter limit.

There is no single value for a limit. This is why the quirks struct is
complex and we need a function to determine the limit each time for a
given transfer from it.

[toc] | [prev] | [next] | [standalone]


#1591129 — Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.

FromWolfram Sang <wsa@the-dreams.de>
Date2017-03-02 15:30 +0100
SubjectRe: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission.
Message-ID<tgzTY-3s2-9@gated-at.bofh.it>
In reply to#1591068

[Multipart message — attachments visible in raw view] — view raw

> TPMs are a not the best devices when it comes to i2c :/

BTW I blame the quirky I2C HW of the adapters, so far.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web