]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
tpm_crb: fix mapping of the buffers
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Mon, 27 Jun 2016 13:10:51 +0000 (07:10 -0600)
committerKamal Mostafa <kamal@canonical.com>
Tue, 28 Jun 2016 17:45:00 +0000 (10:45 -0700)
commit87bd13c6f9776e18ab9a5192325c54621db8a2af
treec60f7d1b630e2d30b8e4d7ff3b08f973af5fb14c
parent465a7e95502dd08f44d0c01e5dccf142bc75e1f2
tpm_crb: fix mapping of the buffers

BugLink: http://bugs.launchpad.net/bugs/1596469
On my Lenovo x250 the following situation occurs:

[18697.813871] tpm_crb MSFT0101:00: can't request region for resource
[mem 0xacdff080-0xacdfffff]

The mapping of the control area overlaps the mapping of the command
buffer. The control area is mapped over page, which is not right. It
should mapped over sizeof(struct crb_control_area).

Fixing this issue unmasks another issue. Command and response buffers
can overlap and they do interleave on this machine. According to the PTP
specification the overlapping means that they are mapped to the same
buffer.

The commit has been also on a Haswell NUC where things worked before
applying this fix so that the both code paths for response buffer
initialization are tested.

Cc: stable@vger.kernel.org
Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
(cherry picked from linux-next commit 0af6e0a2da2e4fedaa2743333da438d3b879192b)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/char/tpm/tpm_crb.c