Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4303528pxj; Wed, 12 May 2021 02:35:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzlM6h2V1Cft+zR+WAIGv7f5erh3k2Puv/XiLVOMO46mTed82Pp7SAUly9qPslN9771/Bx X-Received: by 2002:a17:906:6801:: with SMTP id k1mr35885579ejr.137.1620812107246; Wed, 12 May 2021 02:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620812107; cv=none; d=google.com; s=arc-20160816; b=1B09/gJuDst4gEr4T7n9AugSA6BsuXVIu53P13f9eOb1luAqZq9RM2XXEP3Vzmx/VT CGsqP7TYUzHzrUKHlK0jdpMx6/z/0PteDUpCpQP20nu5Or+h854rHF8zJUal+WgST34+ ItSU2ggv481OkB1t+TUCi1PWLuuleUyxbFPVnPdVjtLSVB9921Cz1d8+WgCuv5ZyeZL/ Qk34Tl6P0l65Mu5VJiC3519TZ9zFhf4oe2Q2T6h55hsprlDSeQTwvFaQ8FO8+gajKiME 7vK79+jnelloEu3lY2OqgKhaghKkQ4VXSArjuQ5t0He8bPUeKSPwWikmsHudaeV7znkR UoHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7w4IKLLWGrK4vnZyM1MtVo1v8bh6Z4Y+8pWc2Ct3fck=; b=jOBHp2lNy+255s4asBQbzv9KeUiucw+NeHQBGZ0ekFJdQzcnOqmaFE3q0P8Ktk/4u8 yhYp2kfkyhrlO/USGyVFdaCElDtYNXi6lbcLbqI9aQF3bszfLV0/0tnR8li54xfFvTqT zFoDTJq4SKz5bJhtb/FVQgBBsOdonaz5qbsqvKab3LQHIBszpWWsgfITXLowaKyRPRjF LPNt26YDf+znjbFpc97M/q+acQH3LW0xn6qIeRM7a/G8zZvdvMKYVNr4NkFDuepJhaHe n6bZOr7j3S1jPGN1c5SD0BwXaNGTUtyAvvR4cCLqFtvAuqWOE7nKHTHCBY0+69Hi2yOc l64Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZzsduvy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f22si18191641edx.581.2021.05.12.02.34.43; Wed, 12 May 2021 02:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rZzsduvy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbhELJcH (ORCPT + 99 others); Wed, 12 May 2021 05:32:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:48634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbhELJb4 (ORCPT ); Wed, 12 May 2021 05:31:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E337661370; Wed, 12 May 2021 09:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620811848; bh=7w4IKLLWGrK4vnZyM1MtVo1v8bh6Z4Y+8pWc2Ct3fck=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rZzsduvyu6cjDO678fCA3PqfLWqjiUFVtBfG0zP5zxk7I74y4bLp8156WqVoZRmas dEdjie4brnFnzLmdSpVG+YpT3QJD54gQHB3p62B1o9wKOWD2t8LrIdtDlCRhPMujaG U2MMXcj0ETFV2yjEc4jg++jIlzOUc/KyOi7F/leByoDF7V3StqvGh506Q4NNZqXsEK Y4foRRgzB+70/lcDVlnc4eLbEobSRAdTzCeejLii+ZKbM2SXvWMk3GTp2v7tiyxj3r pOFyYsPaCfk+A3PG2wtHNiNcWOURWLywQzG8ItvzBtp7GIP8He31HU/rD47h8cGWh0 gepVc36LRLpIw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1lglCd-00048t-BC; Wed, 12 May 2021 11:30:52 +0200 Date: Wed, 12 May 2021 11:30:51 +0200 From: Johan Hovold To: Michael Walle Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Fugang Duan , Philippe Schenker Subject: Re: [PATCH 4/8] serial: fsl_lpuart: handle break and make sysrq work Message-ID: References: <20210511200148.11934-1-michael@walle.cc> <20210511200148.11934-5-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511200148.11934-5-michael@walle.cc> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 10:01:44PM +0200, Michael Walle wrote: > Although there is already (broken) sysrq characters handling, a break > condition was never detected. There is also a possible deadlock because > we might call handle_sysrq() while still holding the port lock. Where's the possible deadlock? First, as you point out above the driver currently doesn't detect breaks so the sysrq handler is never called and there's no risk for deadlocks in the console code. Second, the driver's console implementation explicitly handles being called recursively so would not deadlock after you start detecting breaks either. > Add support for break detection and use the proper > uart_unlock_and_check_sysrq() to defer calling handle_sysrq(). Johan