lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] regmap: fix alignment issues
On Tue, May 26, 2020 at 01:42:36AM +0300, Andy Shevchenko wrote:
> On Tuesday, May 26, 2020, Jens Thoms Toerring <jt@toerring.de> 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@toerring.de
\_______________________________ http://toerring.de

\
 
 \ /
  Last update: 2020-05-26 09:21    [W:0.040 / U:2.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site