public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: "Pandey, Radhey Shyam" <radhey.shyam.pandey@amd.com>,
	"anthony@amarulasolutions.com" <anthony@amarulasolutions.com>,
	"Xu, Brian" <brian.xu@amd.com>,
	"Rampelli, Raj Kumar" <raj.kumar.rampelli@amd.com>,
	Vinod Koul <vkoul@kernel.org>,
	"Simek, Michal" <michal.simek@amd.com>
Cc: "dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: xilinx: xdma: Fix regmap max_register
Date: Tue, 2 Sep 2025 09:42:07 -0700	[thread overview]
Message-ID: <c37cf0cc-e15f-4968-0a75-56481fa744e7@amd.com> (raw)
In-Reply-To: <DS7PR12MB59581DE67ECA59637F73D4F9B707A@DS7PR12MB5958.namprd12.prod.outlook.com>


On 9/1/25 09:37, Pandey, Radhey Shyam wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
>
>> -----Original Message-----
>> From: Anthony Brandon via B4 Relay
>> <devnull+anthony.amarulasolutions.com@kernel.org>
>> Sent: Monday, September 1, 2025 5:07 PM
>> To: Hou, Lizhi <lizhi.hou@amd.com>; Xu, Brian <brian.xu@amd.com>; Rampelli,
>> Raj Kumar <raj.kumar.rampelli@amd.com>; Vinod Koul <vkoul@kernel.org>; Simek,
>> Michal <michal.simek@amd.com>
>> Cc: dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
>> kernel@vger.kernel.org; Anthony Brandon <anthony@amarulasolutions.com>
>> Subject: [PATCH] dmaengine: xilinx: xdma: Fix regmap max_register
>>
>> From: Anthony Brandon <anthony@amarulasolutions.com>
>>
>> The max_register field is assigned the size of the register memory region instead of
>> the offset of the last register.
>> The result is that reading from the regmap via debugfs can cause a segmentation
>> fault:
>>
>> tail /sys/kernel/debug/regmap/xdma.1.auto/registers
>> Unable to handle kernel paging request at virtual address ffff800082f70000 Mem
>> abort info:
>>    ESR = 0x0000000096000007
>>    EC = 0x25: DABT (current EL), IL = 32 bits
>>    SET = 0, FnV = 0
>>    EA = 0, S1PTW = 0
>>    FSC = 0x07: level 3 translation fault
>> [...]
>> Call trace:
>>   regmap_mmio_read32le+0x10/0x30
>>   _regmap_bus_reg_read+0x74/0xc0
>>   _regmap_read+0x68/0x198
>>   regmap_read+0x54/0x88
>>   regmap_read_debugfs+0x140/0x380
>>   regmap_map_read_file+0x30/0x48
>>   full_proxy_read+0x68/0xc8
>>   vfs_read+0xcc/0x310
>>   ksys_read+0x7c/0x120
>>   __arm64_sys_read+0x24/0x40
>>   invoke_syscall.constprop.0+0x64/0x108
>>   do_el0_svc+0xb0/0xd8
>>   el0_svc+0x38/0x130
>>   el0t_64_sync_handler+0x120/0x138
>>   el0t_64_sync+0x194/0x198
>> Code: aa1e03e9 d503201f f9400000 8b214000 (b9400000) ---[ end trace
>> 0000000000000000 ]---
>> note: tail[1217] exited with irqs disabled
>> note: tail[1217] exited with preempt_count 1 Segmentation fault
>>
>> Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com>
>> ---
>>   drivers/dma/xilinx/xdma.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c index
>> 0d88b1a670e142dac90d09c515809faa2476a816..cb73801fd6cf91fc420d6a8ab0c97
>> 3dcdb5772f5 100644
>> --- a/drivers/dma/xilinx/xdma.c
>> +++ b/drivers/dma/xilinx/xdma.c
>> @@ -38,7 +38,7 @@ static const struct regmap_config xdma_regmap_config = {
>>        .reg_bits = 32,
>>        .val_bits = 32,
>>        .reg_stride = 4,
>> -     .max_register = XDMA_REG_SPACE_LEN,
>> +     .max_register = XDMA_REG_SPACE_LEN - 4,
> Nit - Better to change the value of #define itself and we can rename
> it to XDMA_MAX_REG_OFFSET?
>
> Will wait for Lizhi and Brain to confirm if XDMA_REG_SPACE_LEN - 4
> is highest valid register address as per IP documentation,
yes, it is.
>
>>   };
>>
>>   /**
>>
>> ---
>> base-commit: b320789d6883cc00ac78ce83bccbfe7ed58afcf0
>> change-id: 20250901-xdma-max-reg-1649c6459358
>>
>> Best regards,
>> --
>> Anthony Brandon <anthony@amarulasolutions.com>
>>
>>

      reply	other threads:[~2025-09-02 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 11:37 [PATCH] dmaengine: xilinx: xdma: Fix regmap max_register Anthony Brandon via B4 Relay
2025-09-01 16:37 ` Pandey, Radhey Shyam
2025-09-02 16:42   ` Lizhi Hou [this message]

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=c37cf0cc-e15f-4968-0a75-56481fa744e7@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=anthony@amarulasolutions.com \
    --cc=brian.xu@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=raj.kumar.rampelli@amd.com \
    --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