* [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
@ 2025-10-24 6:31 Devyn Liu
2025-10-31 15:32 ` Jonathan Cameron
2025-11-03 11:09 ` Yang Shen
0 siblings, 2 replies; 7+ messages in thread
From: Devyn Liu @ 2025-10-24 6:31 UTC (permalink / raw)
To: shenyang39, broonie
Cc: linux-spi, linux-kernel, jonathan.cameron, kangfenglong,
liuyonglong, lujunhua7, yubowen8, liudingyuan
In hisi_spi_debugfs_init, spi controller pointer is calculated by
container_of macro, and the member is hs->dev. But the host pointer cannot
be calculated offset directly by this, because hs->dev points to the
device in platform device(pdev->dev), and it is the host->dev.parent
points to the pdev->dev, which is set in __spi_alloc_controller.
In this patch, this issues is fixed by getting the spi_controller data
from pdev->dev->driver_data directly, driver_data points to the spi
controller data in the probe stage.
Signed-off-by: Devyn Liu <liudingyuan@h-partners.com>
---
drivers/spi/spi-hisi-kunpeng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index dadf558dd9c0..7458a4bc0856 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -164,7 +164,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
struct spi_controller *host;
- host = container_of(hs->dev, struct spi_controller, dev);
+ host = hs->dev->driver_data;
snprintf(name, 32, "hisi_spi%d", host->bus_num);
hs->debugfs = debugfs_create_dir(name, NULL);
if (IS_ERR(hs->debugfs))
--
2.33.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
2025-10-24 6:31 [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization Devyn Liu
@ 2025-10-31 15:32 ` Jonathan Cameron
2025-11-03 11:09 ` Yang Shen
1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2025-10-31 15:32 UTC (permalink / raw)
To: Devyn Liu
Cc: shenyang39, broonie, linux-spi, linux-kernel, kangfenglong,
liuyonglong, lujunhua7, yubowen8, liudingyuan
On Fri, 24 Oct 2025 14:31:33 +0800
Devyn Liu <liudingyuan@h-partners.com> wrote:
> In hisi_spi_debugfs_init, spi controller pointer is calculated by
> container_of macro, and the member is hs->dev. But the host pointer cannot
> be calculated offset directly by this, because hs->dev points to the
> device in platform device(pdev->dev), and it is the host->dev.parent
> points to the pdev->dev, which is set in __spi_alloc_controller.
>
> In this patch, this issues is fixed by getting the spi_controller data
> from pdev->dev->driver_data directly, driver_data points to the spi
> controller data in the probe stage.
>
> Signed-off-by: Devyn Liu <liudingyuan@h-partners.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> ---
> drivers/spi/spi-hisi-kunpeng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
> index dadf558dd9c0..7458a4bc0856 100644
> --- a/drivers/spi/spi-hisi-kunpeng.c
> +++ b/drivers/spi/spi-hisi-kunpeng.c
> @@ -164,7 +164,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
>
> struct spi_controller *host;
>
> - host = container_of(hs->dev, struct spi_controller, dev);
> + host = hs->dev->driver_data;
> snprintf(name, 32, "hisi_spi%d", host->bus_num);
> hs->debugfs = debugfs_create_dir(name, NULL);
> if (IS_ERR(hs->debugfs))
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
2025-10-24 6:31 [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization Devyn Liu
2025-10-31 15:32 ` Jonathan Cameron
@ 2025-11-03 11:09 ` Yang Shen
1 sibling, 0 replies; 7+ messages in thread
From: Yang Shen @ 2025-11-03 11:09 UTC (permalink / raw)
To: Devyn Liu, broonie
Cc: linux-spi, linux-kernel, jonathan.cameron, kangfenglong,
liuyonglong, lujunhua7, yubowen8, liudingyuan
在 2025/10/24 14:31, Devyn Liu 写道:
> In hisi_spi_debugfs_init, spi controller pointer is calculated by
> container_of macro, and the member is hs->dev. But the host pointer cannot
> be calculated offset directly by this, because hs->dev points to the
> device in platform device(pdev->dev), and it is the host->dev.parent
> points to the pdev->dev, which is set in __spi_alloc_controller.
>
> In this patch, this issues is fixed by getting the spi_controller data
> from pdev->dev->driver_data directly, driver_data points to the spi
> controller data in the probe stage.
>
> Signed-off-by: Devyn Liu <liudingyuan@h-partners.com>
> ---
> drivers/spi/spi-hisi-kunpeng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Yang Shen <shenyang39@huawei.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* re: [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
@ 2025-11-11 2:01 liudingyuan
2025-11-11 12:19 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: liudingyuan @ 2025-11-11 2:01 UTC (permalink / raw)
To: shenyang (M), broonie@kernel.org
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Jonathan Cameron, Kangfenglong, liuyonglong, lujunhua (E),
yubowen (H)
> In hisi_spi_debugfs_init, spi controller pointer is calculated by container_of macro, and the member is hs->dev. But the host pointer cannot be calculated offset directly by this, because hs->dev points to the device in platform device(pdev->dev), and it is > the host->dev.parent points to the pdev->dev, which is set in __spi_alloc_controller.
>
>In this patch, this issues is fixed by getting the spi_controller data from pdev->dev->driver_data directly, driver_data points to the spi controller data in the probe stage.
>
> Signed-off-by: Devyn Liu <liudingyuan@h-partners.com>
> ---
> drivers/spi/spi-hisi-kunpeng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index dadf558dd9c0..7458a4bc0856 100644
>--- a/drivers/spi/spi-hisi-kunpeng.c
> +++ b/drivers/spi/spi-hisi-kunpeng.c
> @@ -164,7 +164,7 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
>
> struct spi_controller *host;
>
> - host = container_of(hs->dev, struct spi_controller, dev);
> + host = hs->dev->driver_data;
> snprintf(name, 32, "hisi_spi%d", host->bus_num);
> hs->debugfs = debugfs_create_dir(name, NULL);
> if (IS_ERR(hs->debugfs))
> --
> 2.33.0
Gentle ping on this patch.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
2025-11-11 2:01 liudingyuan
@ 2025-11-11 12:19 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2025-11-11 12:19 UTC (permalink / raw)
To: liudingyuan
Cc: shenyang (M), linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, Jonathan Cameron, Kangfenglong,
liuyonglong, lujunhua (E), yubowen (H)
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]
On Tue, Nov 11, 2025 at 02:01:03AM +0000, liudingyuan wrote:
> Gentle ping on this patch.
Please don't send content free pings and please allow a reasonable time
for review. People get busy, go on holiday, attend conferences and so
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review. If there have been
review comments then people may be waiting for those to be addressed.
Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
@ 2026-01-08 7:53 Devyn Liu
2026-01-13 11:42 ` Mark Brown
0 siblings, 1 reply; 7+ messages in thread
From: Devyn Liu @ 2026-01-08 7:53 UTC (permalink / raw)
To: shenyang39, broonie
Cc: linux-spi, linuxarm, jonathan.cameron, yubowen8, zhanjie9,
liuyonglong, kangfenglong, alireza.sanaee, salil.mehta,
shiju.jose, kong.kongxinwei, liudingyuan, lujunhua7
In hisi_spi_debugfs_init, spi controller pointer is calculated
by container_of macro, and the member is hs->dev. But the host
cannot be calculated offset directly by this. (hs->dev) points
to (pdev->dev), and it is the (host->dev.parent) rather than
(host->dev) points to the (pdev->dev), which is set in
__spi_alloc_controller.
In this patch, this issues is fixed by getting the spi_controller
data from pdev->dev by dev_get_drvdata() directly. (dev->driver_data)
points to the spi controller data in the probe stage.
Signed-off-by: Devyn Liu <liudingyuan@h-partners.com>
Reviewed-by: Yang Shen <shenyang39@huawei.com>
---
drivers/spi/spi-hisi-kunpeng.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index dadf558dd9c0..80a1a15de0bc 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -161,10 +161,8 @@ static const struct debugfs_reg32 hisi_spi_regs[] = {
static int hisi_spi_debugfs_init(struct hisi_spi *hs)
{
char name[32];
+ struct spi_controller *host = dev_get_drvdata(hs->dev);
- struct spi_controller *host;
-
- host = container_of(hs->dev, struct spi_controller, dev);
snprintf(name, 32, "hisi_spi%d", host->bus_num);
hs->debugfs = debugfs_create_dir(name, NULL);
if (IS_ERR(hs->debugfs))
--
2.33.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
2026-01-08 7:53 Devyn Liu
@ 2026-01-13 11:42 ` Mark Brown
0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2026-01-13 11:42 UTC (permalink / raw)
To: shenyang39, Devyn Liu
Cc: linux-spi, linuxarm, jonathan.cameron, yubowen8, zhanjie9,
liuyonglong, kangfenglong, alireza.sanaee, salil.mehta,
shiju.jose, kong.kongxinwei, lujunhua7
On Thu, 08 Jan 2026 15:53:23 +0800, Devyn Liu wrote:
> In hisi_spi_debugfs_init, spi controller pointer is calculated
> by container_of macro, and the member is hs->dev. But the host
> cannot be calculated offset directly by this. (hs->dev) points
> to (pdev->dev), and it is the (host->dev.parent) rather than
> (host->dev) points to the (pdev->dev), which is set in
> __spi_alloc_controller.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization
commit: b062a899c997df7b9ce29c62164888baa7a85833
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-13 11:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 6:31 [PATCH] spi: hisi-kunpeng: Fixed the wrong debugfs node name in hisi_spi debugfs initialization Devyn Liu
2025-10-31 15:32 ` Jonathan Cameron
2025-11-03 11:09 ` Yang Shen
-- strict thread matches above, loose matches on Subject: below --
2025-11-11 2:01 liudingyuan
2025-11-11 12:19 ` Mark Brown
2026-01-08 7:53 Devyn Liu
2026-01-13 11:42 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox