From: Bingbu Cao <bingbu.cao@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: stanislaw.gruszka@linux.intel.com, bingbu.cao@intel.com
Subject: Re: [PATCH 1/1] media: ipu6: Fix DMA and physical address debugging messages for 32-bit
Date: Wed, 6 Nov 2024 09:55:26 +0800 [thread overview]
Message-ID: <ee8939e2-bbd8-bbab-52eb-b078ada66ff0@linux.intel.com> (raw)
In-Reply-To: <20241105080317.500735-1-sakari.ailus@linux.intel.com>
Sakari,
Thanks for the patch.
On 11/5/24 4:03 PM, Sakari Ailus wrote:
> Fix printing DMA and physical address printing on 32-bit platforms, by
> using correct types. Also cast DMA_BIT_MASK() result to dma_addr_t to make
> Clang happy.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> drivers/media/pci/intel/ipu6/ipu6-dma.c | 7 ++++---
> drivers/media/pci/intel/ipu6/ipu6-mmu.c | 25 ++++++++++++++-----------
> 2 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-dma.c b/drivers/media/pci/intel/ipu6/ipu6-dma.c
> index 92530a1cc90f..801f6bd00a89 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-dma.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-dma.c
> @@ -428,11 +428,12 @@ static int ipu6_dma_map_sg(struct device *dev, struct scatterlist *sglist,
>
> iova_addr = iova->pfn_lo;
> for_each_sg(sglist, sg, count, i) {
> + phys_addr_t iova_pa;
> int ret;
>
> - dev_dbg(dev, "mapping entry %d: iova 0x%llx phy %pad size %d\n",
> - i, PFN_PHYS(iova_addr), &sg_dma_address(sg),
> - sg_dma_len(sg));
> + iova_pa = PFN_PHYS(iova_addr);
> + dev_dbg(dev, "mapping entry %d: iova %pap phy %pap size %d\n",
> + i, &iova_pa, &sg_dma_address(sg), sg_dma_len(sg));
>
> ret = ipu6_mmu_map(mmu->dmap->mmu_info, PFN_PHYS(iova_addr),
> sg_dma_address(sg),
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c
> index c3a20507d6db..873029eb7e92 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c
> @@ -97,13 +97,15 @@ static void page_table_dump(struct ipu6_mmu_info *mmu_info)
> for (l1_idx = 0; l1_idx < ISP_L1PT_PTES; l1_idx++) {
> u32 l2_idx;
> u32 iova = (phys_addr_t)l1_idx << ISP_L1PT_SHIFT;
> + phys_addr_t l2_phys;
>
> if (mmu_info->l1_pt[l1_idx] == mmu_info->dummy_l2_pteval)
> continue;
> +
> + l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx];)
> dev_dbg(mmu_info->dev,
> - "l1 entry %u; iovas 0x%8.8x-0x%8.8x, at %pa\n",
> - l1_idx, iova, iova + ISP_PAGE_SIZE,
> - TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx]));
> + "l1 entry %u; iovas 0x%8.8x-0x%8.8x, at %pap\n",
> + l1_idx, iova, iova + ISP_PAGE_SIZE, &l2_phys);
>
> for (l2_idx = 0; l2_idx < ISP_L2PT_PTES; l2_idx++) {
> u32 *l2_pt = mmu_info->l2_pts[l1_idx];
> @@ -227,7 +229,7 @@ static u32 *alloc_l1_pt(struct ipu6_mmu_info *mmu_info)
> }
>
> mmu_info->l1_pt_dma = dma >> ISP_PADDR_SHIFT;
> - dev_dbg(mmu_info->dev, "l1 pt %p mapped at %llx\n", pt, dma);
> + dev_dbg(mmu_info->dev, "l1 pt %p mapped at %pad\n", pt, &dma);
>
> return pt;
>
> @@ -330,8 +332,8 @@ static int __ipu6_mmu_map(struct ipu6_mmu_info *mmu_info, unsigned long iova,
> u32 iova_end = ALIGN(iova + size, ISP_PAGE_SIZE);
>
> dev_dbg(mmu_info->dev,
> - "mapping iova 0x%8.8x--0x%8.8x, size %zu at paddr 0x%10.10llx\n",
> - iova_start, iova_end, size, paddr);
> + "mapping iova 0x%8.8x--0x%8.8x, size %zu at paddr %pap\n",
> + iova_start, iova_end, size, &paddr);
>
> return l2_map(mmu_info, iova_start, paddr, size);
> }
> @@ -363,8 +365,8 @@ static size_t l2_unmap(struct ipu6_mmu_info *mmu_info, unsigned long iova,
> < iova_start + size && l2_idx < ISP_L2PT_PTES; l2_idx++) {
> l2_pt = mmu_info->l2_pts[l1_idx];
> dev_dbg(mmu_info->dev,
> - "unmap l2 index %u with pteval 0x%10.10llx\n",
> - l2_idx, TBL_PHYS_ADDR(l2_pt[l2_idx]));
> + "unmap l2 index %u with pteval 0x%p\n",
> + l2_idx, &l2_pt[l2_idx]);
> l2_pt[l2_idx] = mmu_info->dummy_page_pteval;
>
> clflush_cache_range((void *)&l2_pt[l2_idx],
> @@ -525,9 +527,10 @@ static struct ipu6_mmu_info *ipu6_mmu_alloc(struct ipu6_device *isp)
> return NULL;
>
> mmu_info->aperture_start = 0;
> - mmu_info->aperture_end = DMA_BIT_MASK(isp->secure_mode ?
> - IPU6_MMU_ADDR_BITS :
> - IPU6_MMU_ADDR_BITS_NON_SECURE);
> + mmu_info->aperture_end =
> + (dma_addr_t)DMA_BIT_MASK(isp->secure_mode ?
> + IPU6_MMU_ADDR_BITS :
> + IPU6_MMU_ADDR_BITS_NON_SECURE);
> mmu_info->pgsize_bitmap = SZ_4K;
> mmu_info->dev = &isp->pdev->dev;
>
>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
--
Best regards,
Bingbu Cao
prev parent reply other threads:[~2024-11-06 1:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 8:03 [PATCH 1/1] media: ipu6: Fix DMA and physical address debugging messages for 32-bit Sakari Ailus
2024-11-06 1:55 ` Bingbu Cao [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=ee8939e2-bbd8-bbab-52eb-b078ada66ff0@linux.intel.com \
--to=bingbu.cao@linux.intel.com \
--cc=bingbu.cao@intel.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stanislaw.gruszka@linux.intel.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 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.