From: Enric Balletbo Serra <eballetbo@gmail.com> To: Wolfram Sang <wsa@the-dreams.de> Cc: Andrew Lunn <andrew@lunn.ch>, Enric Balletbo i Serra <enric.balletbo@collabora.com>, Peter Huewe <peterhuewe@gmx.de>, Marcel Selhorst <tpmdd@selhorst.net>, Andrey Pronin <apronin@google.com>, tpmdd-devel@lists.sourceforge.net, linux-kernel <linux-kernel@vger.kernel.org> Subject: Re: [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission. Date: Mon, 27 Feb 2017 22:30:32 +0100 [thread overview] Message-ID: <CAFqH_52TFBWLCXY00pTNdhDKJJ=R3uhY6kpp7Sgx2-fHnq-_iw@mail.gmail.com> (raw) In-Reply-To: <20170227191245.ecord2i7o6jwec5k@ninjato> 2017-02-27 20:12 GMT+01:00 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. > Sounds a good solution for me, I'll test and send a new version of the patches. > BTW I noted that the original patch checks for -EINVAL. The core returns > -EOPNOTSUPP, though. So, a) the patch needs to be adapted Yes I already detected this, In this series I forget to fixup the patch that fixed this when I did the git rebase. It's is fixed in the second version. > and b) it > looks the i2c host driver returning -EINVAL could be converted to use > the quirk infrastructure? Which driver is it? > > Regards, > > Wolfram > Regards, Enric
WARNING: multiple messages have this Message-ID (diff)
From: Enric Balletbo Serra <eballetbo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org> Cc: linux-kernel <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Andrey Pronin <apronin-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> Subject: Re: [PATCH 1/2] tpm: Apply an adapterlimit for retransmission. Date: Mon, 27 Feb 2017 22:30:32 +0100 [thread overview] Message-ID: <CAFqH_52TFBWLCXY00pTNdhDKJJ=R3uhY6kpp7Sgx2-fHnq-_iw@mail.gmail.com> (raw) In-Reply-To: <20170227191245.ecord2i7o6jwec5k@ninjato> 2017-02-27 20:12 GMT+01:00 Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>: > 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-z923LK4zBo2bacvFa/9K2g@public.gmane.org>, 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. > Sounds a good solution for me, I'll test and send a new version of the patches. > BTW I noted that the original patch checks for -EINVAL. The core returns > -EOPNOTSUPP, though. So, a) the patch needs to be adapted Yes I already detected this, In this series I forget to fixup the patch that fixed this when I did the git rebase. It's is fixed in the second version. > and b) it > looks the i2c host driver returning -EINVAL could be converted to use > the quirk infrastructure? Which driver is it? > > Regards, > > Wolfram > Regards, Enric ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot
next prev parent reply other threads:[~2017-02-27 22:39 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-02-21 14:44 [PATCH 1/2] tpm: Apply an adapterlimit for retransmission Enric Balletbo i Serra 2017-02-21 14:45 ` [PATCH 2/2] tpm: Do not assume an i2c adapter preserves the msg len Enric Balletbo i Serra 2017-02-21 16:29 ` [tpmdd-devel] [PATCH 1/2] tpm: Apply an adapterlimit for retransmission Andrew Lunn 2017-02-22 11:16 ` Enric Balletbo i Serra 2017-02-22 14:01 ` Andrew Lunn 2017-02-27 18:48 ` Enric Balletbo Serra 2017-02-27 19:12 ` Wolfram Sang 2017-02-27 19:12 ` Wolfram Sang 2017-02-27 21:30 ` Enric Balletbo Serra [this message] 2017-02-27 21:30 ` Enric Balletbo Serra 2017-03-02 13:15 ` [tpmdd-devel] " Peter Huewe 2017-03-02 13:15 ` Peter Huewe 2017-03-02 14:05 ` [tpmdd-devel] " Wolfram Sang 2017-03-02 14:10 ` Wolfram Sang 2017-02-22 12:39 ` Peter Huewe 2017-02-22 12:39 ` Peter Huewe
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='CAFqH_52TFBWLCXY00pTNdhDKJJ=R3uhY6kpp7Sgx2-fHnq-_iw@mail.gmail.com' \ --to=eballetbo@gmail.com \ --cc=andrew@lunn.ch \ --cc=apronin@google.com \ --cc=enric.balletbo@collabora.com \ --cc=linux-kernel@vger.kernel.org \ --cc=peterhuewe@gmx.de \ --cc=tpmdd-devel@lists.sourceforge.net \ --cc=tpmdd@selhorst.net \ --cc=wsa@the-dreams.de \ /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: linkBe 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.