linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Li Yang <leoyang.li@nxp.com>
To: Meng.Li@windriver.com
Cc: Roy Pledge <Roy.Pledge@nxp.com>,
	Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>,
	 Horia Geanta <horia.geanta@nxp.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	 lkml <linux-kernel@vger.kernel.org>,
	 "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] soc: fsl: dpio: instead smp_processor_id with raw_smp_processor_id
Date: Tue, 19 Oct 2021 20:35:06 -0500	[thread overview]
Message-ID: <CADRPPNRVAqptuD_cf+vtcD4UBbL+2uT0fjnw14QS=8_tpt1bjQ@mail.gmail.com> (raw)
In-Reply-To: <20211019023241.17466-1-Meng.Li@windriver.com>

On Mon, Oct 18, 2021 at 9:46 PM <Meng.Li@windriver.com> wrote:
>
> From: Meng Li <Meng.Li@windriver.com>
>
> When enable debug kernel configs,there will be calltrace as below:
>
> BUG: using smp_processor_id() in preemptible [00000000] code: swapper/0/1
> caller is debug_smp_processor_id+0x20/0x30
> CPU: 6 PID: 1 Comm: swapper/0 Not tainted 5.10.63-yocto-standard #1
> Hardware name: NXP Layerscape LX2160ARDB (DT)
> Call trace:
>  dump_backtrace+0x0/0x1a0
>  show_stack+0x24/0x30
>  dump_stack+0xf0/0x13c
>  check_preemption_disabled+0x100/0x110
>  debug_smp_processor_id+0x20/0x30
>  dpaa2_io_query_fq_count+0xdc/0x154
>  dpaa2_eth_stop+0x144/0x314
>  __dev_close_many+0xdc/0x160
>  __dev_change_flags+0xe8/0x220
>  dev_change_flags+0x30/0x70
>  ic_close_devs+0x50/0x78
>  ip_auto_config+0xed0/0xf10
>  do_one_initcall+0xac/0x460
>  kernel_init_freeable+0x30c/0x378
>  kernel_init+0x20/0x128
>  ret_from_fork+0x10/0x38
>
> Based on comment in the context, it doesn't matter whether
> preemption is disable or not. So, instead smp_processor_id()

s/instead/replace/g

> with raw_smp_processor_id() to avoid above call trace.
>
> v2:
> Remove the preempt_disable/enable() protection, instead smp_processor_id
> with raw_smp_processor_id.

The revision history information should go after the "---" below.

>
> Fixes: c89105c9b390 ("staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl")
> Cc: stable@vger.kernel.org
> Signed-off-by: Meng Li <Meng.Li@windriver.com>

I helped to fix the issues I mentioned.  Applied for fix.  Thanks.

> ---
>  drivers/soc/fsl/dpio/dpio-service.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c
> index 19f47ea9dab0..3050a534d42c 100644
> --- a/drivers/soc/fsl/dpio/dpio-service.c
> +++ b/drivers/soc/fsl/dpio/dpio-service.c
> @@ -59,7 +59,7 @@ static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d,
>          * potentially being migrated away.
>          */
>         if (cpu < 0)
> -               cpu = smp_processor_id();
> +               cpu = raw_smp_processor_id();
>
>         /* If a specific cpu was requested, pick it up immediately */
>         return dpio_by_cpu[cpu];
> --
> 2.17.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2021-10-20  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  2:32 [PATCH v2] soc: fsl: dpio: instead smp_processor_id with raw_smp_processor_id Meng.Li
2021-10-20  1:35 ` Li Yang [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='CADRPPNRVAqptuD_cf+vtcD4UBbL+2uT0fjnw14QS=8_tpt1bjQ@mail.gmail.com' \
    --to=leoyang.li@nxp.com \
    --cc=Meng.Li@windriver.com \
    --cc=Roy.Pledge@nxp.com \
    --cc=horia.geanta@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=ruxandra.radulescu@nxp.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).