]> 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)
commit615d729e405f4ca867e5c904273a94ecdd645ef5
treef6244c5dccb81e29aa3fb8e2a5bbfcebd20333c0
parentca58a34c8bc9f9dd33a2c032d2549dcd3f3318b5
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