]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: Ensure MCDI buffers, but not lengths, are dword aligned
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 14 Sep 2012 16:31:41 +0000 (17:31 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Wed, 21 Aug 2013 15:35:27 +0000 (16:35 +0100)
commit6b5e60bcb89478e77c59f9cf20de4957a2d0f8e3
treef6244c5dccb81e29aa3fb8e2a5bbfcebd20333c0
parent596b7bcd2f23f7c68e95d3256699be460b103ea2
sfc: Ensure MCDI buffers, but not lengths, are dword aligned

We currently require that MCDI request and response lengths are
multiples of 4 bytes, because we will copy dwords in and out of shared
memory and we want to be sure we won't read or write out of bounds.
But all we really need to know is that there is sufficient padding for
that.  Also, we should ensure that buffers are dword-aligned, as on
some architectures misaligned access will result in data corruption or
a crash.

Change the buffer type to array-of-efx_dword_t and remove the
requirement that the lengths are multiples of 4.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/ethernet/sfc/mcdi.c
drivers/net/ethernet/sfc/mcdi.h
drivers/net/ethernet/sfc/ptp.c