mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Meng Li <Meng.Li@windriver.com>
Cc: horia.geanta@nxp.com, pankaj.gupta@nxp.com, davem@davemloft.net,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] driver: crypto: caam: replace this_cpu_ptr with raw_cpu_ptr
Date: Sat, 20 Nov 2021 12:27:43 +0800	[thread overview]
Message-ID: <20211120042743.GD25752@gondor.apana.org.au> (raw)
In-Reply-To: <20211101031353.2119-1-Meng.Li@windriver.com>

On Mon, Nov 01, 2021 at 11:13:53AM +0800, Meng Li wrote:
> When enable the kernel debug config, there is below calltrace detected:
> BUG: using smp_processor_id() in preemptible [00000000] code: cryptomgr_test/339
> caller is debug_smp_processor_id+0x20/0x30
> CPU: 9 PID: 339 Comm: cryptomgr_test 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_caam_enqueue+0x10c/0x25c
>  ......
>  cryptomgr_test+0x38/0x60
>  kthread+0x158/0x164
>  ret_from_fork+0x10/0x38
> According to the comment in commit ac5d15b4519f("crypto: caam/qi2
>  - use affine DPIOs "), because preemption is no longer disabled
> while trying to enqueue an FQID, it might be possible to run the
> enqueue on a different CPU(due to migration, when in process context),
> however this wouldn't be a functionality issue. But there will be
> above calltrace when enable kernel debug config. So, replace this_cpu_ptr
> with raw_cpu_ptr to avoid above call trace.
> 
> Fixes: ac5d15b4519f ("crypto: caam/qi2 - use affine DPIOs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Meng Li <Meng.Li@windriver.com>
> ---
> v2:
> 
> Add comment to describe why the raw_cpu_ptr is safe.
>  drivers/crypto/caam/caamalg_qi2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      parent reply	other threads:[~2021-11-20  4:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-01  3:13 Meng Li
2021-11-15  2:54 ` Li, Meng
2021-11-18  8:21 ` Horia Geantă
2021-11-20  4:27 ` Herbert Xu [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=20211120042743.GD25752@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=Meng.Li@windriver.com \
    --cc=davem@davemloft.net \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pankaj.gupta@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

all inboxes | Powered by JetHome®