[PATCH 1/3] kernel: vrx518_tc: fix RX desc phys to virt mapping

Sergey Ryazanov ryazanov.s.a at gmail.com
Sat Jan 11 16:40:15 PST 2025


Hi Jan,

On 12.01.2025 02:20, Jan Hoffmann wrote:
> On 11.01.25 at 23:50, Sergey Ryazanov wrote:
>> It looks like VRX518 returns phys addr of data buffer in the 'data_ptr'
>> field of the RX descriptor and an actual data offset within the buffer
>> in the 'byte_off' field. In order to map the phys address back to
>> virtual we need the original phys address of the allocated buffer.
>>
>> In the same driver applies offset to phys address before the mapping,
>> what leads to WARN_ON triggering in plat_mem_virt() function with
>> subsequent kernel panic:
>>
>>    WARNING: CPU: 0 PID: 0 at .../sw_plat.c:764 0xbf306cd0 
>> [vrx518_tc at 8af9f5d0+0x25000]
>>    ...
>>    Unable to handle kernel NULL pointer dereference at virtual address 
>> 00000000
>>    pgd = aff5701e
>>    [00000000] *pgd=00000000
>>    Internal error: Oops: 5 [#1] SMP ARM
>>
>> Noticed in ATM mode, when chip always returns byte_off = 4.
>>
>> In order to fix the issue, pass the phys address to plat_mem_virt() as
>> is and apply byte_off later on mapped virtual address when copying RXed
>> data into the skb.
> 
> VDSL still works with this patch.
> 
> Tested-by: Jan Hoffmann <jan at 3e8.eu>

Thanks a lot! This patch with VDSL link worried me most of all.

> Maybe the PKG_RELEASE should be increased? (Although it looks like it 
> also wasn't done for the last few changes to the package.)

Nice catch! Going to send V2 with one more dedicated patch updating 
PKG_RELEASE.

--
Sergey



More information about the openwrt-devel mailing list