public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Thoms Toerring <jt@toerring.de>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Mark Brown <broonie@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] regmap: fix alignment issues
Date: Tue, 26 May 2020 09:20:07 +0200	[thread overview]
Message-ID: <20200526072007.GB29047@toerring.de> (raw)
In-Reply-To: <CAHp75VdJVdpNjiHsd+dGiAJ79q6hDgYZzy8eZ3zP5ESmv1U-4A@mail.gmail.com>

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

      parent reply	other threads:[~2020-05-26  7:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 21:47 [PATCH v2] regmap: fix alignment issues Jens Thoms Toerring
     [not found] ` <CAHp75VdJVdpNjiHsd+dGiAJ79q6hDgYZzy8eZ3zP5ESmv1U-4A@mail.gmail.com>
2020-05-26  7:20   ` Jens Thoms Toerring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200526072007.GB29047@toerring.de \
    --to=jt@toerring.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox