From patchwork Tue May 3 21:01:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hurley X-Patchwork-Id: 9008461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EF5E9BF29F for ; Tue, 3 May 2016 21:04:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1F4402035D for ; Tue, 3 May 2016 21:04:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27EDA201C7 for ; Tue, 3 May 2016 21:04:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1axhST-0005Qx-7V; Tue, 03 May 2016 21:02:17 +0000 Received: from mail-pf0-x22b.google.com ([2607:f8b0:400e:c00::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1axhSQ-0005O7-2p for linux-arm-kernel@lists.infradead.org; Tue, 03 May 2016 21:02:15 +0000 Received: by mail-pf0-x22b.google.com with SMTP id y69so15523659pfb.1 for ; Tue, 03 May 2016 14:01:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hurleysoftware-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=bZYisozRO2pGWLE1a5fIjuuQ/UxLE158NPle5IWL/QQ=; b=FDWH63Ds3v43f4Pwr1qhI7rmfotXAXPZve42knFOZFZemGwE8uIwBaVb7rkTqxTC30 jus//TsOZSyU3gNvKQHm8D6GBU+k4fhYT5I0QZPOcSwHFsSWiHmg/utA2jCJtBKsifrM huz8ZFOROOY8hsPyRFRrX5X5jBqWCz2cVZFRrV6MEuBVGgqgSf9StP0LHjOcxm1KnK29 ecQBtdG6jMTSQHahUc7aQI3rCI7NFayD3GoEWXNe63A+9cSSlvPHhsF/MoByaZBPhWDv IDHHeTJ/2PQvpfQr8sXAjNA81mUqaSu8a/Qv+g4Yj7INU9eNL3E9ZBdQ3nU+q6z73Mab kATQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=bZYisozRO2pGWLE1a5fIjuuQ/UxLE158NPle5IWL/QQ=; b=fl+K+5+G5tvWVUXh6TRY4c6qauWe63X7llz5Q+3m2gXMBLJ+vf3oaupVXUrh/V+auJ 4xVqFmuVVNJUYvY07t9z0F7NN7PMsWCw2eCdfHWVSXJHU8E39xJK66lLUtkYzLByUEJ2 ZrRsoX5idR4nr5cUY1/kWS2bWqTpOeAH3wyLKAGl2VukCAWz2XN0AYde2l5zZqzcw2SQ SHTknD0yHfgpHPFMRfMOBKk+GyrmY4HC9AxSlHAIQMmXsyTPa4E1R99IPW0ifjeoYbeG xoHnDFJzVrXmYXnS0FelY0O+RNvmf8qufUtVjV8ZqIomQD9eWgPSV/vLFbmSt1o1VXV2 iJ4Q== X-Gm-Message-State: AOPr4FU0BS2ERSIvPyEDVGzBstF/Nxg5XBx2vYO5R7NM2Np5q6YGFG8fsktaAvfgrsRTKA== X-Received: by 10.98.10.202 with SMTP id 71mr6571266pfk.143.1462309312838; Tue, 03 May 2016 14:01:52 -0700 (PDT) Received: from [192.168.1.20] (50-0-163-49.dsl.dynamic.fusionbroadband.com. [50.0.163.49]) by smtp.gmail.com with ESMTPSA id 63sm273564pff.43.2016.05.03.14.01.51 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 May 2016 14:01:52 -0700 (PDT) Subject: Re: Bunch of serial warnings in next at least with omap-serial To: Tony Lindgren References: <20160503203930.GQ5995@atomide.com> From: Peter Hurley Message-ID: <572911BF.8000803@hurleysoftware.com> Date: Tue, 3 May 2016 14:01:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20160503203930.GQ5995@atomide.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160503_140214_374726_D7856C39 X-CRM114-Status: GOOD ( 14.37 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Tony, On 05/03/2016 01:39 PM, Tony Lindgren wrote: > Hi Peter, > > Looks like probably commit 4047b37122d1 ("serial: core: Prevent unsafe > uart port access, part 1") in Linux next causes tons of warnings with at > least omap-serial. It does not revert cleanly I have not tested with that > reverted. Any ideas? Dmesg output of the errors below. Thanks for the report. Patch below should fix that. --- >% --- Subject: [PATCH] serial: core: Fix port mutex assert if lockdep disabled commit 4047b37122d1 ("serial: core: Prevent unsafe uart port access, part 1") added lockdep assertion for port mutex but fails to check if debug_locks has disabled lockdep (so lock state is no longer reliable). Use lockdep_assert_held() instead, which properly checks lockdep state as well. Reported-by: Tony Lindgren Signed-off-by: Peter Hurley Tested-by: Tony Lindgren --- drivers/tty/serial/serial_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 0e66923..b88a054 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -95,9 +95,7 @@ static inline void uart_port_deref(struct uart_port *uport) static inline struct uart_port *uart_port_check(struct uart_state *state) { -#ifdef CONFIG_LOCKDEP - WARN_ON(!lockdep_is_held(&state->port.mutex)); -#endif + lockdep_assert_held(&state->port.mutex); return state->uart_port; }