From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from bh-25.webhostbox.net ([208.91.199.152]:43384 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751384AbbEHBrV (ORCPT ); Thu, 7 May 2015 21:47:21 -0400 Received: from mailnull by bh-25.webhostbox.net with sa-checked (Exim 4.85) (envelope-from ) id 1YqXNo-002yO3-Ue for linux-watchdog@vger.kernel.org; Fri, 08 May 2015 01:47:21 +0000 Message-ID: <554C15A5.2040300@roeck-us.net> Date: Thu, 07 May 2015 18:47:17 -0700 From: Guenter Roeck MIME-Version: 1.0 To: Doug Anderson , wim@iguana.be CC: jszhang@marvell.com, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] watchdog: dw_wdt: Use a mutex, not a spinlock References: <1431036564-4189-1-git-send-email-dianders@chromium.org> In-Reply-To: <1431036564-4189-1-git-send-email-dianders@chromium.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org On 05/07/2015 03:09 PM, Doug Anderson wrote: > Right now the dw_wdt uses a spinlock to protect dw_wdt_open(). The > problem is that while holding the spinlock we call: > -> dw_wdt_set_top() > -> dw_wdt_top_in_seconds() > -> clk_get_rate() > -> clk_prepare_lock() > -> mutex_lock() > > Locking a mutex while holding a spinlock is not allowed and leads to > warnings like "BUG: spinlock wrong CPU on CPU#1", among other > problems. > > There's no reason to use a spinlock, so switch to a mutex. > > Signed-off-by: Doug Anderson Reviewed-by: Guenter Roeck