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: 9008401 Return-Path: X-Original-To: patchwork-linux-omap@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 64309BF29F for ; Tue, 3 May 2016 21:01:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80BE920377 for ; Tue, 3 May 2016 21:01:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 716B2201C7 for ; Tue, 3 May 2016 21:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756478AbcECVBz (ORCPT ); Tue, 3 May 2016 17:01:55 -0400 Received: from mail-pf0-f176.google.com ([209.85.192.176]:36851 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756504AbcECVBx (ORCPT ); Tue, 3 May 2016 17:01:53 -0400 Received: by mail-pf0-f176.google.com with SMTP id c189so16201783pfb.3 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=M4hOOV07lRgm4D2oRfNUX4LZoOmF62Ce0S66qfGFhlihZOXCRv9iDFK9LbwM5gRBQl ziL9AQFELiuzvFssA8cBvC6uAdfr4l/iNwUb78HKXV7Vt9grW5X5P9ts1C46Htx+JYcB URtjI00dHDni2GkQ4wsMBbTNuaX3zxyCizQobQQZ1hSWYrTNg+DdFPSQT58vS5isFT3I T3b9CAv/tN7qqMZBao/8676dlwsT5R6hD8INRb38Ji/TNegynAsWvWE1xongaYUYvOfq UjpUAFKdrqaWEDBDde0ou8NLsX9szVShow/ixW3oytd4TJd4FCMBgmf1fDU28NGs0MU0 c8uw== X-Gm-Message-State: AOPr4FW094q76Qy3Fz5kRGZvsRBCsh7cMqrS8lWgyoCtTs1qo1HQgfOgJu1ng+IJkZulpA== 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> Cc: Greg Kroah-Hartman , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org 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> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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; }