From: Haris Okanovic <haris.okanovic@ni.com>
To: Alexander Stein <alexander.stein@systec-electronic.com>
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org,
tpmdd-devel@lists.sourceforge.net, harisokn@gmail.com,
julia.cartwright@ni.com, gratian.crisan@ni.com,
scott.hartman@ni.com, chris.graf@ni.com, brad.mouring@ni.com,
jonathan.david@ni.com, peterhuewe@gmx.de, tpmdd@selhorst.net,
jarkko.sakkinen@linux.intel.com, jgunthorpe@obsidianresearch.com,
eric.gardiner@ni.com
Subject: Re: [PATCH] tpm_tis: fix stall after iowrite*()s
Date: Tue, 15 Aug 2017 15:10:33 -0500 [thread overview]
Message-ID: <64235ce1-f554-ba54-12ab-a91dd77db2db@ni.com> (raw)
In-Reply-To: <1619753.FtnHesjV4E@ws-stein>
On 08/15/2017 01:11 AM, Alexander Stein wrote:
> On Monday 14 August 2017 17:53:47, Haris Okanovic wrote:
>> --- a/drivers/char/tpm/tpm_tis.c
>> +++ b/drivers/char/tpm/tpm_tis.c
>> @@ -52,6 +52,22 @@ static inline struct tpm_tis_tcg_phy
>> *to_tpm_tis_tcg_phy(struct tpm_tis_data *da return container_of(data,
>> struct tpm_tis_tcg_phy, priv);
>> }
>>
>> +static inline void tpm_tis_iowrite8(u8 b, void __iomem *iobase, u32 addr)
>> +{
>> + iowrite8(b, iobase + addr);
>> +#ifdef CONFIG_PREEMPT_RT_FULL
>> + ioread8(iobase + TPM_ACCESS(0));
>> +#endif
>> +}
>
> Maybe add some comment why an iorad8 is actually requried after each write on
> RT. Currently it is rather obvious why this additional read is necessary. But
> is this still the case in a year?
>
Sure. I re-added the tpm_tis_flush() function with comments to explain
what's going. Calling it from tpm_tis_iowrite8() and tpm_tis_iowrite32().
Will post a PATCH v2 shortly.
>> +static inline void tpm_tis_iowrite32(u32 b, void __iomem *iobase, u32 addr)
>> +{
>> + iowrite32(b, iobase + addr);
>> +#ifdef CONFIG_PREEMPT_RT_FULL
>> + ioread8(iobase + TPM_ACCESS(0));
>> +#endif
>> +}
>
> Same applies here. Or add a comment above both functions describing their
> purpose.
>
> Just my 2 cents
>
> Best regards,
> Alexander
>
next prev parent reply other threads:[~2017-08-15 20:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170804215651.29247-1-haris.okanovic@ni.com>
2017-08-14 22:53 ` [PATCH] tpm_tis: fix stall after iowrite*()s Haris Okanovic
2017-08-15 6:11 ` Alexander Stein
2017-08-15 20:10 ` Haris Okanovic [this message]
[not found] ` <20170804215651.29247-1-haris.okanovic-acOepvfBmUk@public.gmane.org>
2017-08-15 20:13 ` [PATCH v2] " Haris Okanovic
2017-08-16 21:15 ` [tpmdd-devel] " Ken Goldman
2017-08-17 5:57 ` Alexander Stein
2017-08-17 10:38 ` Sebastian Andrzej Siewior
[not found] ` <20170817103807.ubrbylnud6wxod3s-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2017-08-17 17:17 ` Jason Gunthorpe
[not found] ` <20170817171732.GA22792-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2017-08-17 20:12 ` Haris Okanovic
2017-08-19 17:03 ` [tpmdd-devel] " 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=64235ce1-f554-ba54-12ab-a91dd77db2db@ni.com \
--to=haris.okanovic@ni.com \
--cc=alexander.stein@systec-electronic.com \
--cc=brad.mouring@ni.com \
--cc=chris.graf@ni.com \
--cc=eric.gardiner@ni.com \
--cc=gratian.crisan@ni.com \
--cc=harisokn@gmail.com \
--cc=jarkko.sakkinen@linux.intel.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=jonathan.david@ni.com \
--cc=julia.cartwright@ni.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=scott.hartman@ni.com \
--cc=tpmdd-devel@lists.sourceforge.net \
--cc=tpmdd@selhorst.net \
/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).