From: Kevin Hao <haokexin@gmail.com>
To: linux-spi@vger.kernel.org
Cc: Han Xu <han.xu@nxp.com>, Mark Brown <broonie@kernel.org>,
Volker Haspel <volker.haspel@linutronix.de>,
John Ogness <john.ogness@linutronix.de>,
imx@lists.linux.dev, Kevin Hao <haokexin@gmail.com>
Subject: [PATCH 1/2] spi: fsl-qsi: Optimize fsl_qspi struct
Date: Fri, 21 Mar 2025 20:40:21 +0800 [thread overview]
Message-ID: <20250321-spi-v1-1-b9939baa64b6@gmail.com> (raw)
In-Reply-To: <20250321-spi-v1-0-b9939baa64b6@gmail.com>
Reorgize the members of the fsl_qspi struct to:
- Reduce a hole in the struct.
- Group members required by each op (e.g., iobase, ahb_addr,
devtype_data and lock) into the same cacheline.
Before:
struct fsl_qspi {
[...]
/* size: 176, cachelines: 3, members: 11 */
/* sum members: 168, holes: 1, sum holes: 4 */
/* padding: 4 */
/* member types with holes: 1, total: 1 */
/* last cacheline: 48 bytes */
};
after:
struct fsl_qspi {
void * iobase; /* 0 8 */
void * ahb_addr; /* 8 8 */
const struct fsl_qspi_devtype_data * devtype_data; /* 16 8 */
struct mutex lock; /* 24 32 */
struct completion c; /* 56 32 */
/* XXX last struct has 1 hole */
/* --- cacheline 1 boundary (64 bytes) was 24 bytes ago --- */
struct clk * clk; /* 88 8 */
struct clk * clk_en; /* 96 8 */
struct pm_qos_request pm_qos_req; /* 104 48 */
/* --- cacheline 2 boundary (128 bytes) was 24 bytes ago --- */
struct device * dev; /* 152 8 */
int selected; /* 160 4 */
u32 memmap_phy; /* 164 4 */
/* size: 168, cachelines: 3, members: 11 */
/* member types with holes: 1, total: 1 */
/* last cacheline: 40 bytes */
};
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/spi/spi-fsl-qspi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c
index 355e6a39fb41896f460e2474a90b8f0b42068ff3..efd87f44c63a5b12b76538aa459ca8eb203b9dcd 100644
--- a/drivers/spi/spi-fsl-qspi.c
+++ b/drivers/spi/spi-fsl-qspi.c
@@ -264,14 +264,14 @@ static const struct fsl_qspi_devtype_data ls2080a_data = {
struct fsl_qspi {
void __iomem *iobase;
void __iomem *ahb_addr;
- u32 memmap_phy;
- struct clk *clk, *clk_en;
- struct device *dev;
- struct completion c;
const struct fsl_qspi_devtype_data *devtype_data;
struct mutex lock;
+ struct completion c;
+ struct clk *clk, *clk_en;
struct pm_qos_request pm_qos_req;
+ struct device *dev;
int selected;
+ u32 memmap_phy;
};
static inline int needs_swap_endian(struct fsl_qspi *q)
--
2.48.1
next prev parent reply other threads:[~2025-03-21 12:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-21 12:40 [PATCH 0/2] spi: fsl-qspi: Fix kernel panic when unbinding the SPI host Kevin Hao
2025-03-21 12:40 ` Kevin Hao [this message]
2025-03-21 15:26 ` [PATCH 1/2] spi: fsl-qsi: Optimize fsl_qspi struct Han Xu
2025-03-21 12:40 ` [PATCH 2/2] spi: fsl-qspi: Explicitly unregister SPI host in remove() Kevin Hao
2025-03-21 15:23 ` Han Xu
2025-03-21 15:55 ` Mark Brown
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=20250321-spi-v1-1-b9939baa64b6@gmail.com \
--to=haokexin@gmail.com \
--cc=broonie@kernel.org \
--cc=han.xu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=john.ogness@linutronix.de \
--cc=linux-spi@vger.kernel.org \
--cc=volker.haspel@linutronix.de \
/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