archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <>
To: "Horia Geantă" <>
Cc: Herbert Xu <>,
	"David S. Miller" <>,
	Aymen Sghaier <>,
	Li Yang <>, Roy Pledge <>,
	Madalin Bucur <>,
	Peter Zijlstra <>,
	Thomas Gleixner <>,,
Subject: Re: [PATCH] crypto: caam/qi - simplify CGR allocation, freeing
Date: Tue, 9 Oct 2018 19:11:01 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 2018-10-08 14:09:37 [+0300], Horia Geantă wrote:
> CGRs (Congestion Groups) have to be freed by the same CPU that
> initialized them.
> This is why currently the driver takes special measures; however, using
> set_cpus_allowed_ptr() is incorrect - as reported by Sebastian.
> Instead of the generic solution of replacing set_cpus_allowed_ptr() with
> work_on_cpu_safe(), we use the qman_delete_cgr_safe() QBMan API instead
> of qman_delete_cgr() - which internally takes care of proper CGR
> deletion.
> Link:
> Reported-by: Sebastian Andrzej Siewior <>
> Signed-off-by: Horia Geantă <>

Oh. No more usage of set_cpus_allowed_ptr(). Wonderful. Thank you.
 Acked-by: Sebastian Andrzej Siewior <>
for that.

Now that you shifted my attention to qman_delete_cgr_safe().
Could you please use work_on_cpu_safe() here instead
smp_call_function_single() with preempt_disable() around it?

Now, what is the problem with the CPU limitation? Is this a HW
limitation that you can access the registers from a certain CPU?

This still fails (silently) if the CPU is missing, right? If you can't
get around it, you could block the CPU from going offline. You could
register a HP notifier
	cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, …

and the function would return -EINVAL if this is the special CPU. The
other thing would be forbid rmmod. This *could* work but if I remember
correctly, an explicit unbind can't be stopped.


  reply	other threads:[~2018-10-09 17:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 12:54 set_cpus_allowed_ptr() usage in FREESCALE CAAM Sebastian Andrzej Siewior
2018-10-08 11:09 ` [PATCH] crypto: caam/qi - simplify CGR allocation, freeing Horia Geantă
2018-10-09 17:11   ` Sebastian Andrzej Siewior [this message]
2018-10-25 14:05     ` Horia Geanta
2018-10-29  8:56       ` Sebastian Andrzej Siewior
2018-10-17  6:21   ` Herbert Xu

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] crypto: caam/qi - simplify CGR allocation, freeing' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox