Re: [PATCH v2] regmap: fix alignment issues

From: Jens Thoms Toerring
Date: Tue May 26 2020 - 03:20:18 EST


On Tue, May 26, 2020 at 01:42:36AM +0300, Andy Shevchenko wrote:
> On Tuesday, May 26, 2020, Jens Thoms Toerring <jt@xxxxxxxxxxx> wrote:
>
> > The assembly and disassembly of data to be sent to or received from a
> > device invoke functions (regmap_format_XXX() and regmap_parse_XXX())
> > that extract or insert data items into a buffer. In some cases these
> > functions are invoked with buffer pointers with odd addresses but try
> > to directly assign from or to those address. On architectures with
> > strict alignment requirements this leads to kernel crashes for u16 and
> > u32 values. The assignments have are replaced by memcpy() calls.
> >
> >
> Don't we have put_/get_unaligned_b/leXX() for this?

Nice, didn't know about them, thank you. Will amend the patch.

--
\ Jens Thoms Toerring ________ jt@xxxxxxxxxxx
\_______________________________ http://toerring.de