RE: [PATCH v2 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock

From: Camelia Alexandra Groza
Date: Tue Apr 04 2023 - 05:36:08 EST


> -----Original Message-----
> From: Sean Anderson <sean.anderson@xxxxxxxx>
> Sent: Friday, March 31, 2023 18:14
> To: Leo Li <leoyang.li@xxxxxxx>; linuxppc-dev@xxxxxxxxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx
> Cc: Scott Wood <oss@xxxxxxxxxxxx>; Camelia Alexandra Groza
> <camelia.groza@xxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx; Roy Pledge
> <roy.pledge@xxxxxxx>; David S . Miller <davem@xxxxxxxxxxxxx>; Claudiu
> Manoil <claudiu.manoil@xxxxxxx>; Vladimir Oltean
> <vladimir.oltean@xxxxxxx>; Sean Anderson <sean.anderson@xxxxxxxx>
> Subject: [PATCH v2 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock
>
> cgr_lock may be locked with interrupts already disabled by
> smp_call_function_single. As such, we must use a raw spinlock to avoid
> problems on PREEMPT_RT kernels. Although this bug has existed for a
> while, it was not apparent until commit ef2a8d5478b9 ("net: dpaa: Adjust
> queue depth on rate change") which invokes smp_call_function_single via
> qman_update_cgr_safe every time a link goes up or down.
>
> Fixes: c535e923bb97 ("soc/fsl: Introduce DPAA 1.x QMan device driver")
> Reported-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
> Link: https://lore.kernel.org/all/20230323153935.nofnjucqjqnz34ej@skbuf/
> Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxx>

Reviewed-by: Camelia Groza <camelia.groza@xxxxxxx>