From: "Arnd Bergmann" <arnd@arndb.de>
To: "Frank Li" <Frank.Li@nxp.com>, "Vinod Koul" <vkoul@kernel.org>
Cc: "Baoquan He" <bhe@redhat.com>,
dmaengine@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
imx@lists.linux.dev, linux-kernel@vger.kernel.org,
"kernel test robot" <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev,
"Rafael J . Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH v5 1/3] debugfs_create_regset32() support 8/16 bit width registers
Date: Mon, 02 Oct 2023 20:55:23 +0200 [thread overview]
Message-ID: <7f39410a-72fc-463e-b41c-64674ab4f129@app.fastmail.com> (raw)
In-Reply-To: <20231002183750.552759-2-Frank.Li@nxp.com>
On Mon, Oct 2, 2023, at 20:37, Frank Li wrote:
> Enhance the flexibility of `debugfs_create_regset32()` to support registers
> of various bit widths. The key changes are as follows:
>
> 1. Renamed '*reg32' and '*regset32' to '*reg' and '*regset' in relevant
> code to reflect that the register width is not limited to 32 bits.
>
> 2. Added 'size' and 'bigendian' fields to the `struct debugfs_reg` to allow
> for specifying the size and endianness of registers. These additions
> enable `debugfs_create_regset()` to support a wider range of register
> types.
>
> 3. When 'size' is set to 0, it signifies a 32-bit register. This change
> maintains compatibility with existing code that assumes 32-bit
> registers.
>
> Improve the versatility of `debugfs_create_regset()` and enable it to
> handle registers of different sizes and endianness, offering greater
> flexibility for debugging and monitoring.
>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
This version looks correct to me, I see no fundamental problems with it.
In fact, you could list "support for ioport_map() output" to the features
above.
A few other thoughts from my side, all of which could be ignored:
- if the ioport access is not an important feature, we can instead
support 64-bit readl() as I commented in a previous email. We just
can't easily have both.
- instead of treating every value of "regs->size" other than 1 and 2
as meaning '32-bit read', I would explicitly check for 0 and 4
here
- Another more complicated but also more featureful variant would
be to use the 'regmap' infrastructure as the abstraction, this would
also provide access to big-endian, variable register width
(including 64-bit), and pio, along with additional features and
other bus types. Not sure it's worth it, but could be interesting
to try out.
Arnd
next prev parent reply other threads:[~2023-10-02 18:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-02 18:37 [PATCH v5 0/3] dmaengine: fsl_edma: add trace and debugfs support Frank Li
2023-10-02 18:37 ` [PATCH v5 1/3] debugfs_create_regset32() support 8/16 bit width registers Frank Li
2023-10-02 18:55 ` Arnd Bergmann [this message]
2023-10-02 19:07 ` Frank Li
2023-10-02 19:39 ` Arnd Bergmann
2023-10-02 18:37 ` [PATCH v5 2/3] dmaengine: fsl-emda: add debugfs support Frank Li
2023-10-02 18:37 ` [PATCH v5 3/3] dmaengine: fsl-edma: add trace event support Frank Li
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=7f39410a-72fc-463e-b41c-64674ab4f129@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Frank.Li@nxp.com \
--cc=bhe@redhat.com \
--cc=dmaengine@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rafael@kernel.org \
--cc=vkoul@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