All of lore.kernel.org
 help / color / mirror / Atom feed
From: Iuliana Prodan <iuliana.prodan@nxp.com>
To: Rob Herring <robh@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
	Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	"Andrew F. Davis" <afd@ti.com>,
	"Shah, Tanmay" <tanmay.shah@amd.com>,
	Saravana Kannan <saravanak@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Chen-Yu Tsai <wens@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-remoteproc@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-arm-msm@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v2 0/4] of: Common "memory-region" parsing
Date: Tue, 29 Apr 2025 00:40:42 +0300	[thread overview]
Message-ID: <89d58524-c6ac-4517-ade6-80c966c20115@nxp.com> (raw)
In-Reply-To: <CAL_JsqJemaAzx6v0kj52J=YFRGqLo5=xk8LXXk-8i=mAomTCWQ@mail.gmail.com>

On 4/28/2025 3:23 PM, Rob Herring wrote:
> On Fri, Apr 25, 2025 at 6:34 PM Iuliana Prodan <iuliana.prodan@nxp.com> wrote:
>> Hello Mathieu, Rob,
>>
>> I've tested imx_dsp_rproc and it fails with:
>>
>> [   39.743770] Unable to handle kernel paging request at virtual address
>> ffffffffffffffea
>> ...
>> [   39.805078] Hardware name: NXP i.MX8MPlus EVK board (DT)
>> [   39.810390] pstate: 00000005 (nzcv daif -PAN -UAO -TCO -DIT -SSBS
>> BTYPE=--)
>> [   39.817353] pc : __pi_memset_generic+0x50/0x188
>> [   39.821892] lr : imx_dsp_rproc_prepare+0x3a4/0xea4 [imx_dsp_rproc]
>> [   39.828079] sp : ffff8000853dbb10
>> [   39.831396] x29: ffff8000853dbb90 x28: 0000000092400000 x27:
>> ffff80007a36d3d8
>> [   39.838540] x26: ffff0000d0a5e410 x25: ffff80007a36d3f0 x24:
>> 0000000000000004
>> [   39.845685] x23: ffff0000d5414880 x22: ffff0000d5e1dce8 x21:
>> 0000000000000000
>> [   39.852827] x20: ffff0000d5e1db98 x19: ffff0000d5414b80 x18:
>> 00000000ffffffff
>> [   39.859970] x17: 202c656c69687720 x16: 3e2074756f657672 x15:
>> ffff800081f8d050
>> [   39.867114] x14: ffff0000db584680 x13: 0000000000000003 x12:
>> 00007fffa3330000
>> [   39.874257] x11: 0000000000000004 x10: 0000000000000ab0 x9 :
>> 0000000000000000
>> [   39.881400] x8 : ffffffffffffffea x7 : 0000000000000000 x6 :
>> 000000000000003f
>> [   39.888546] x5 : 0000000000000040 x4 : 0000000000000006 x3 :
>> 0000000000000004
>> [   39.895689] x2 : 0000000000008000 x1 : 0000000000000000 x0 :
>> ffffffffffffffea
>> [   39.902837] Call trace:
>> [   39.905284]  __pi_memset_generic+0x50/0x188 (P)
>> [   39.909821]  rproc_boot+0x2c0/0x524
>> [   39.913317]  state_store+0x40/0x100
>> [   39.916812]  dev_attr_store+0x18/0x2c
>> [   39.920478]  sysfs_kf_write+0x7c/0x94
>> [   39.924146]  kernfs_fop_write_iter+0x120/0x1e8
>> [   39.928598]  vfs_write+0x244/0x37c
>> [   39.932008]  ksys_write+0x70/0x110
>> [   39.935413]  __arm64_sys_write+0x1c/0x28
>> [   39.939342]  invoke_syscall+0x48/0x104
>> [   39.943094]  el0_svc_common.constprop.0+0xc0/0xe0
>> [   39.947805]  do_el0_svc+0x1c/0x28
>> [   39.951123]  el0_svc+0x30/0xcc
>> [   39.954188]  el0t_64_sync_handler+0x10c/0x138
>> [   39.958549]  el0t_64_sync+0x198/0x19c
>> [   39.962222] Code: d65f03c0 cb0803e4 f2400c84 54000080 (a9001d07)
>> [   39.968317] ---[ end trace 0000000000000000 ]---
>>
>> The problem seems to be when computing `cpu_addr =
>> devm_ioremap_resource_wc(dev, &res);`, in patch 4.
>> In `__devm_ioremap_resource` (see [1]), it's expecting the resource type
>> to be `IORESOURCE_MEM`, which is not the case here (at least the flags
>> are nowhere set for this).
> Thanks for testing and diagnosing. IORESOURCE_MEM needs to be set. Can
> you test with this change:
>
> index f87915cce961..00c93585758f 100644
> --- a/drivers/of/of_reserved_mem.c
> +++ b/drivers/of/of_reserved_mem.c
> @@ -771,6 +771,7 @@ int of_reserved_mem_region_to_resource(const
> struct device_node *np,
>                  return -EINVAL;
>
>          resource_set_range(res, rmem->base, rmem->size);
> +       res->flags = IORESOURCE_MEM;
>          res->name = rmem->name;
>          return 0;
>   }

I've tested with this change, and is all good now. Iulia


  reply	other threads:[~2025-04-28 21:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 19:42 [PATCH v2 0/4] of: Common "memory-region" parsing Rob Herring (Arm)
2025-04-23 19:42 ` [PATCH v2 1/4] of: reserved_mem: Add functions to parse "memory-region" Rob Herring (Arm)
2025-04-28  8:07   ` Arnaud POULIQUEN
2025-04-23 19:42 ` [PATCH v2 2/4] of: Simplify of_dma_set_restricted_buffer() to use of_for_each_phandle() Rob Herring (Arm)
2025-04-23 19:42 ` [PATCH v2 3/4] devres: Export devm_ioremap_resource_wc() Rob Herring (Arm)
2025-04-23 19:42 ` [PATCH v2 4/4] remoteproc: Use of_reserved_mem_region_* functions for "memory-region" Rob Herring (Arm)
2025-05-02 15:40   ` Tanmay Shah
2025-05-02 20:33     ` Rob Herring
2025-04-24 14:14 ` [PATCH v2 0/4] of: Common "memory-region" parsing Mathieu Poirier
2025-04-25 23:34   ` Iuliana Prodan
2025-04-28 12:23     ` Rob Herring
2025-04-28 21:40       ` Iuliana Prodan [this message]
2025-05-01 15:44   ` Tanmay Shah
2025-05-01 23:56     ` Tanmay Shah
2025-04-28  8:16 ` Arnaud POULIQUEN
2025-05-07  4:42 ` Peng Fan

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=89d58524-c6ac-4517-ade6-80c966c20115@nxp.com \
    --to=iuliana.prodan@nxp.com \
    --cc=afd@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andersson@kernel.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=daniel.baluta@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=saravanak@google.com \
    --cc=shawnguo@kernel.org \
    --cc=tanmay.shah@amd.com \
    --cc=wens@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 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.