All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yixun Lan <dlan@gentoo.org>
To: Alex Elder <elder@riscstar.com>
Cc: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, paul.walmsley@sifive.com,
	palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
	p.zabel@pengutronix.de, spacemit@lists.linux.dev,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] spi: spacemit: introduce SpacemiT K1 SPI controller driver
Date: Thu, 18 Sep 2025 22:56:44 +0800	[thread overview]
Message-ID: <20250918145644-GYC1274501@gentoo.org> (raw)
In-Reply-To: <cedaad98-1eba-431f-af4a-b84e106e5f65@riscstar.com>

Hi Alex,

On 09:47 Thu 18 Sep     , Alex Elder wrote:
> On 9/18/25 9:39 AM, Yixun Lan wrote:
> >>>> +	u32 data_reg_addr;		/* DMA address of the data register */
> >>> s/data_reg_addr/ssp_data/? I just feel uncomfortable with redundant 'reg_addr'
> >> My convention is normally "virt" or maybe "base" to represent
> >> a virtual address, and "addr" to represent I/O addresses.
> >>
> >> This symbol represents the physical address that underlies the
> >> "SSP Data Register", which fills the TX FIFO when written and
> >> drains the RX FIFO when read.
> >>
> >> How about "data_addr"?  I know you wouldn't like "reg_addr".
> >>
> > another idea here, instead of introducing a variable here,
> > how about simply using plain iores->start + SSP_DATAR?
> > 
> > so you can cache "iores" instead..
> 
> This code has gone through a huge amount of refactoring.
> 
> I hadn't looked, but now I see this field is used exactly one
> place in the code, in k1_spi_prepare_dma_io().  It's still
> needed though.
> 
> Here's what I plan to do.  Rather than saving data_reg_addr,
> I will simply save base_addr, which is the I/O resource start
> address that corresponds to the mapped virtual pointer, "base".
> 
> Then in k1_spi_prepare_dma_io() I'll use base_addr + SSP_DATAR.
> 
> OK?
> 
Yes, this is what I'm suggesting
-- 
Yixun Lan (dlan)

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Yixun Lan <dlan@gentoo.org>
To: Alex Elder <elder@riscstar.com>
Cc: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, paul.walmsley@sifive.com,
	palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
	p.zabel@pengutronix.de, spacemit@lists.linux.dev,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] spi: spacemit: introduce SpacemiT K1 SPI controller driver
Date: Thu, 18 Sep 2025 22:56:44 +0800	[thread overview]
Message-ID: <20250918145644-GYC1274501@gentoo.org> (raw)
In-Reply-To: <cedaad98-1eba-431f-af4a-b84e106e5f65@riscstar.com>

Hi Alex,

On 09:47 Thu 18 Sep     , Alex Elder wrote:
> On 9/18/25 9:39 AM, Yixun Lan wrote:
> >>>> +	u32 data_reg_addr;		/* DMA address of the data register */
> >>> s/data_reg_addr/ssp_data/? I just feel uncomfortable with redundant 'reg_addr'
> >> My convention is normally "virt" or maybe "base" to represent
> >> a virtual address, and "addr" to represent I/O addresses.
> >>
> >> This symbol represents the physical address that underlies the
> >> "SSP Data Register", which fills the TX FIFO when written and
> >> drains the RX FIFO when read.
> >>
> >> How about "data_addr"?  I know you wouldn't like "reg_addr".
> >>
> > another idea here, instead of introducing a variable here,
> > how about simply using plain iores->start + SSP_DATAR?
> > 
> > so you can cache "iores" instead..
> 
> This code has gone through a huge amount of refactoring.
> 
> I hadn't looked, but now I see this field is used exactly one
> place in the code, in k1_spi_prepare_dma_io().  It's still
> needed though.
> 
> Here's what I plan to do.  Rather than saving data_reg_addr,
> I will simply save base_addr, which is the I/O resource start
> address that corresponds to the mapped virtual pointer, "base".
> 
> Then in k1_spi_prepare_dma_io() I'll use base_addr + SSP_DATAR.
> 
> OK?
> 
Yes, this is what I'm suggesting
-- 
Yixun Lan (dlan)

  reply	other threads:[~2025-09-18 14:57 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 22:07 [PATCH 0/3] spi: support the SpacemiT K1 SPI controller Alex Elder
2025-09-17 22:07 ` Alex Elder
2025-09-17 22:07 ` [PATCH 1/3] dt-bindings: spi: add SpacemiT K1 SPI support Alex Elder
2025-09-17 22:07   ` Alex Elder
2025-09-17 23:15   ` Yixun Lan
2025-09-17 23:15     ` Yixun Lan
2025-09-17 23:40     ` Alex Elder
2025-09-17 23:40       ` Alex Elder
2025-09-18  0:16       ` Yixun Lan
2025-09-18  0:16         ` Yixun Lan
2025-09-18  2:59         ` Alex Elder
2025-09-18  2:59           ` Alex Elder
2025-09-18  7:43           ` Troy Mitchell
2025-09-18  7:43             ` Troy Mitchell
2025-09-18 12:00             ` Alex Elder
2025-09-18 12:00               ` Alex Elder
2025-09-18 19:57       ` Rob Herring
2025-09-18 19:57         ` Rob Herring
2025-09-18 20:02         ` Alex Elder
2025-09-18 20:02           ` Alex Elder
2025-10-06  8:10   ` Krzysztof Kozlowski
2025-10-06  8:10     ` Krzysztof Kozlowski
2025-09-17 22:07 ` [PATCH 2/3] spi: spacemit: introduce SpacemiT K1 SPI controller driver Alex Elder
2025-09-17 22:07   ` Alex Elder
2025-09-18  7:47   ` Troy Mitchell
2025-09-18  7:47     ` Troy Mitchell
2025-09-18 12:00     ` Alex Elder
2025-09-18 12:00       ` Alex Elder
2025-09-18 12:41   ` Yixun Lan
2025-09-18 12:41     ` Yixun Lan
2025-09-18 13:45     ` Alex Elder
2025-09-18 13:45       ` Alex Elder
2025-09-18 14:39       ` Yixun Lan
2025-09-18 14:39         ` Yixun Lan
2025-09-18 14:47         ` Alex Elder
2025-09-18 14:47           ` Alex Elder
2025-09-18 14:56           ` Yixun Lan [this message]
2025-09-18 14:56             ` Yixun Lan
2025-09-18 15:44         ` Alex Elder
2025-09-18 15:44           ` Alex Elder
2025-09-18 15:58         ` Alex Elder
2025-09-18 15:58           ` Alex Elder
2025-09-18 16:22         ` Alex Elder
2025-09-18 16:22           ` Alex Elder
2025-09-17 22:07 ` [PATCH 3/3] riscv: dts: spacemit: define a SPI controller node Alex Elder
2025-09-17 22:07   ` Alex Elder
2025-09-18 13:32   ` Yixun Lan
2025-09-18 13:32     ` Yixun Lan
2025-09-18 13:51     ` Alex Elder
2025-09-18 13:51       ` Alex Elder
2025-09-18 14:06       ` Yixun Lan
2025-09-18 14:06         ` Yixun Lan
2025-09-18 14:20         ` Alex Elder
2025-09-18 14:20           ` Alex Elder
2025-09-18 15:04           ` Yixun Lan
2025-09-18 15:04             ` Yixun Lan
2025-09-18 14:33     ` Yao Zi
2025-09-18 14:33       ` Yao Zi
2025-09-18 16:22       ` Alex Elder
2025-09-18 16:22         ` Alex Elder
2025-09-19 15:25         ` Alex Elder
2025-09-19 15:25           ` Alex Elder

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=20250918145644-GYC1274501@gentoo.org \
    --to=dlan@gentoo.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=elder@riscstar.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.