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


Groups > linux.kernel > #1711858

Re: [PATCH] tpm_tis: fix stall after iowrite*()s

From Alexander Stein <alexander.stein@systec-electronic.com>
Newsgroups linux.kernel
Subject Re: [PATCH] tpm_tis: fix stall after iowrite*()s
Date 2017-08-15 08:20 +0200
Message-ID <ueDmN-68s-7@gated-at.bofh.it> (permalink)
References <uaSNr-47E-9@gated-at.bofh.it> <uewuZ-1zq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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?

> +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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] tpm_tis: fix stall after iowrite*()s Haris Okanovic <haris.okanovic@ni.com> - 2017-08-15 01:00 +0200
  Re: [PATCH] tpm_tis: fix stall after iowrite*()s Alexander Stein <alexander.stein@systec-electronic.com> - 2017-08-15 08:20 +0200

csiph-web