MLK-17447 drivers: soc: imx: Fix busfreq mutex unlock twice on imx8mq
authorBai Ping <ping.bai@nxp.com>
Mon, 8 Jan 2018 08:06:55 +0000 (16:06 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:53:35 +0000 (14:53 -0500)
A 'return' statement is missed before, So the mutex will be unlocked
twice, in some corner case, one core will unlock the mutex that locked
by anohter core wrongly. Then lead to concurrent access to the DVFS
at the same time.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
drivers/soc/imx/busfreq-imx8mq.c

index cba7970..4d2ce9d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -330,6 +330,7 @@ void release_bus_freq(enum bus_freq_mode mode)
                (audio_bus_count == 0)) {
                set_low_bus_freq();
                mutex_unlock(&bus_freq_mutex);
+               return;
        }
 
        mutex_unlock(&bus_freq_mutex);