linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Baptiste Maneyrol <JManeyrol@invensense.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: regmap issue with ranges and noinc read
Date: Fri, 3 Apr 2020 07:46:13 +0000	[thread overview]
Message-ID: <MN2PR12MB44229A91FD24E5020C202177C4C70@MN2PR12MB4422.namprd12.prod.outlook.com> (raw)

Hello,

I have an issue using regmap noinc read when using ranges.

My device is 8-bits registers and 8-bits values and uses several register banks that you can switch using a bank register available on all banks.
I am configuring regmap with 1 range with window len of 0x100 and using virtual register addresses like 0x0aRR, where a is the bank number and RR register address (0x0032 for register 0x32 in bank 0, and 0x0123 for register 0x23 in bank 1). This is working pretty well so far.

The device has in bank 0 a virtual register for reading a data FIFO, which is larger than a bank (0x800, 2048). When using the regmap_noinc_read API for reading my FIFO, I am limited in size to not overflow the range window len. regmap is checking that and returns EINVAL in this case (check is done inside _regmap_select_page called in _regmap_raw_read). It certainly makes sense when using the standard remap_bulk_read API, but for the noinc_read where we are not reading continuous register this doesn't seem to be relevant. And this prevent the read of the entire FIFO data in this case.

Is there any reason to check the range window len bounds for the noinc_read API or is this a bug?

Thanks for your help.

Best regards,
JB

                 reply	other threads:[~2020-04-03  7:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=MN2PR12MB44229A91FD24E5020C202177C4C70@MN2PR12MB4422.namprd12.prod.outlook.com \
    --to=jmaneyrol@invensense.com \
    --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;
as well as URLs for NNTP newsgroup(s).