Re: [PATCH 01/10] tpm, tpm_crb: fix unaligned read of the command buffer address

2015-10-18 Thread Jarkko Sakkinen
On Sun, Oct 18, 2015 at 05:02:55AM +0200, Peter Hüwe wrote: > Am Freitag, 16. Oktober 2015, 20:40:20 schrieb Jarkko Sakkinen: > > + pa = ((u64) le32_to_cpu(ioread32(&priv->cca->cmd_pa_high)) << 32) + > > + (u64) le32_to_cpu(ioread32(&priv->cca->cmd_pa_low)); > > The canonical f

Re: [PATCH 01/10] tpm, tpm_crb: fix unaligned read of the command buffer address

2015-10-17 Thread Peter Hüwe
Am Freitag, 16. Oktober 2015, 20:40:20 schrieb Jarkko Sakkinen: > + pa = ((u64) le32_to_cpu(ioread32(&priv->cca->cmd_pa_high)) << 32) + > + (u64) le32_to_cpu(ioread32(&priv->cca->cmd_pa_low)); The canonical form would be > + pa = ((u64) le32_to_cpu(ioread32(&priv->cca->c

[PATCH 01/10] tpm, tpm_crb: fix unaligned read of the command buffer address

2015-10-16 Thread Jarkko Sakkinen
The command buffer address must be read with exactly two 32-bit reads. Otherwise, on some HW platforms, it seems that HW will abort the read operation, which causes CPU to fill the read bytes with 1's. Therefore, we cannot rely on memcpy_fromio() but must call ioread32() two times instead. Also, t