From: Maarten <maarten@rmail.be>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>,
linux-media@vger.kernel.org
Cc: Kieran Bingham <kbingham@kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Umang Jain <umang.jain@ideasonboard.com>,
Phil Elwell <phil@raspberrypi.com>
Subject: Re: [RFC PATCH 05/13] staging: vchiq_arm: Add 36-bit address support
Date: Thu, 07 Mar 2024 11:23:13 +0100 [thread overview]
Message-ID: <be14e28fe6ec078f953baccb2d5fc93c@rmail.be> (raw)
In-Reply-To: <96ae72a4-9f24-4082-b374-44ec7c036e9c@kernel.org>
Krzysztof Kozlowski schreef op 2024-03-07 11:19:
> On 03/03/2024 16:10, Maarten Vanraes wrote:
>> From: Phil Elwell <phil@raspberrypi.com>
>>
>> Conditional on a new compatible string, change the pagelist encoding
>> such that the top 24 bits are the pfn, leaving 8 bits for run length
>> (-1), giving a 36-bit address range.
>>
>> Manage the split between addresses for the VPU and addresses for the
>> 40-bit DMA controller with a dedicated DMA device pointer that on non-
>> BCM2711 platforms is the same as the main VCHIQ device. This allows
>> the VCHIQ node to stay in the usual place in the DT.
>>
>> Signed-off-by: Phil Elwell <phil@raspberrypi.com>
>> Signed-off-by: Maarten Vanraes <maarten@rmail.be>
>> ---
>
>
>>
>> /* Partial cache lines (fragments) require special measures */
>> @@ -413,7 +461,7 @@ free_pagelist(struct vchiq_instance *instance,
>> struct vchiq_pagelist_info *pagel
>> * NOTE: dma_unmap_sg must be called before the
>> * cpu can touch any of the data/pages.
>> */
>> - dma_unmap_sg(instance->state->dev, pagelistinfo->scatterlist,
>> + dma_unmap_sg(g_dma_dev, pagelistinfo->scatterlist,
>> pagelistinfo->num_pages, pagelistinfo->dma_dir);
>> pagelistinfo->scatterlist_mapped = 0;
>>
>> @@ -468,6 +516,7 @@ free_pagelist(struct vchiq_instance *instance,
>> struct vchiq_pagelist_info *pagel
>> static int vchiq_platform_init(struct platform_device *pdev, struct
>> vchiq_state *state)
>> {
>> struct device *dev = &pdev->dev;
>> + struct device *dma_dev = NULL;
>> struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev);
>> struct rpi_firmware *fw = drvdata->fw;
>> struct vchiq_slot_zero *vchiq_slot_zero;
>> @@ -489,6 +538,24 @@ static int vchiq_platform_init(struct
>> platform_device *pdev, struct vchiq_state
>> g_cache_line_size = drvdata->cache_line_size;
>> g_fragments_size = 2 * g_cache_line_size;
>>
>> + if (drvdata->use_36bit_addrs) {
>> + struct device_node *dma_node =
>> + of_find_compatible_node(NULL, NULL, "brcm,bcm2711-dma");
>
> Why do you look up nodes by compatible instead of phandle? That's
> fragile. Makes relationship undocumented, probing not ordered and is
> completely non-portable between different devices.
>
> You have basically here deferred probe issue.
>
> Best regards,
> Krzysztof
ack
Maarten
next prev parent reply other threads:[~2024-03-07 10:23 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-03 15:09 [RFC PATCH 00/13] bcm2835-codec: driver for HW codecs Maarten Vanraes
2024-03-03 15:09 ` [RFC PATCH 01/13] staging: mmal-vchiq: Avoid use of bool in structures Maarten Vanraes
2024-03-04 7:30 ` Andrzej Pietrasiewicz
2024-03-05 18:00 ` Maarten
2024-03-03 15:09 ` [RFC PATCH 02/13] staging: mmal-vchiq: Update mmal_parameters.h with recently defined params Maarten Vanraes
2024-03-03 15:09 ` [RFC PATCH 03/13] staging: mmal-vchiq: Fix memory leak in error path Maarten Vanraes
2024-03-04 7:38 ` Andrzej Pietrasiewicz
2024-03-05 18:02 ` Maarten
2024-03-03 15:09 ` [RFC PATCH 04/13] media: videodev2.h: Add a format for column YUV4:2:0 modes Maarten Vanraes
2024-03-04 18:10 ` Nicolas Dufresne
2024-03-05 18:14 ` Maarten
2024-03-06 20:46 ` Nicolas Dufresne
2024-03-05 18:53 ` Dave Stevenson
2024-03-05 19:43 ` Maarten
2024-03-10 12:42 ` Maarten
2024-03-10 12:54 ` Maarten
2024-03-03 15:10 ` [RFC PATCH 05/13] staging: vchiq_arm: Add 36-bit address support Maarten Vanraes
2024-03-07 10:19 ` Krzysztof Kozlowski
2024-03-07 10:23 ` Maarten [this message]
2024-03-03 15:10 ` [RFC PATCH 06/13] staging: vchiq_arm: Usa a DMA pool for small bulks Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 07/13] staging/vchiq-mmal: Add buffer flags for interlaced video Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 08/13] staging/vchiq-mmal: Add parameters for interlaced video support Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 09/13] staging/vchiq-mmal: Add the deinterlace image effects enums Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 10/13] staging/mmal-vchiq: Rationalise included headers Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 11/13] staging: mmal-vchiq: Reset buffers_with_vpu on port_enable Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 12/13] vc04_services: vchiq-mmal: Add defines for mmal_es_format flags Maarten Vanraes
2024-03-03 15:10 ` [RFC PATCH 13/13] staging: vc04_services: Add a V4L2 M2M codec driver Maarten Vanraes
2024-03-04 17:58 ` Nicolas Dufresne
2024-03-05 19:35 ` Maarten
2024-03-06 21:14 ` Nicolas Dufresne
2024-03-24 12:35 ` Maarten
2024-04-01 9:45 ` Maarten
2024-04-01 9:56 ` Maarten
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=be14e28fe6ec078f953baccb2d5fc93c@rmail.be \
--to=maarten@rmail.be \
--cc=kbingham@kernel.org \
--cc=kernel-list@raspberrypi.com \
--cc=krzk@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=phil@raspberrypi.com \
--cc=umang.jain@ideasonboard.com \
/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;
as well as URLs for NNTP newsgroup(s).