From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7222CC433ED for ; Fri, 16 Apr 2021 08:51:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 462F961153 for ; Fri, 16 Apr 2021 08:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240699AbhDPIvj (ORCPT ); Fri, 16 Apr 2021 04:51:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:40918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240223AbhDPIve (ORCPT ); Fri, 16 Apr 2021 04:51:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B17B061107; Fri, 16 Apr 2021 08:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618563069; bh=G20fHV8vaPYOZuC6bTk72/oUnsXRu84bnbsf13JZmRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GnF3XUS3RhH9h9JHdtddbI5eZLxqQMnxkdnEvZx6UGHHsi8TJ81OQojgjmBIzQCEu 1TQZmcXPt4V1rax7BxmPJVQDGB/9QtUQIxk8BhOgNfPs1SGCrIhTjnU9Oix9A7OWZO 6Y06OecRcy1jyn3/DKFbxzbsxt6Cd/SijD1TCEFm2qkBplV+y1q+F6VGz7XXnF8gYE bbyMEk0Je6cYdc7z7G+jUZzIZgjFB4vqX8IoO2MAaRXOjSWJnQI7mm7rCF3yXdwknV Mg7zeIl0Ly6oVKzAP1FT3JNE7XBb7NXJCyCORqVds3wXizvG4IXpZtmHXbR9ORpTnF 7Wc84BwRSOCTA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lXKBx-0001M3-Dk; Fri, 16 Apr 2021 10:51:09 +0200 Date: Fri, 16 Apr 2021 10:51:09 +0200 From: Johan Hovold To: Erwan LE RAY Cc: dillon min , Greg KH , jirislaby@kernel.org, Maxime Coquelin , Alexandre TORGUE , kernel test robot , linux-serial@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Linux ARM , Linux Kernel Mailing List , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Gerald Baeza Subject: Re: [PATCH v2] serial: stm32: optimize spin lock usage Message-ID: References: <1618219898-4600-1-git-send-email-dillon.minfei@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Please avoid top-posting. ] On Thu, Apr 15, 2021 at 07:09:14PM +0200, Erwan LE RAY wrote: > Hi Dillon, > > STM32MP151 is mono-core, but both STM32MP153 and STM32MP157 are > dual-core (see > https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-arm-cortex-mpus.html). > So your point is fully relevant, thanks. > > ST already fixed the same issue in st-asc.c driver in the past (see > ef49ffd8), because a systematic deadlock was detected with RT kernel. That's not the same issue. The above mentioned commit fixed an issue on *RT* where local_irq_save() should be avoided. > You proposed a first implementation in your patch, and a second one in > the discussion. It seems that your initial proposal (ie your V2 patch) > is the most standard one (implemented in 6 drivers). The second > implementation is implemented by only 1 company. > > It looks that the solution is to avoid locking in the sysrq case and > trylock in the oops_in_progress case (see detailed analysis in > 677fe555cbfb1). > > So your initial patch looks to the right proposal, but it would be safer > if Greg could confirm it. That would only fix the RT issue (and by making the sysrq one slightly worse). Using uart_unlock_and_check_sysrq() would address both issues. Johan From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63E62C433B4 for ; Fri, 16 Apr 2021 09:17:06 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B786261006 for ; Fri, 16 Apr 2021 09:17:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B786261006 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wQwLHlMqnBqeOEWA1jDJmhqLPCKI25RXJfXlZVATxYg=; b=R2H08x0UVY0qaw9uUwS+jpYjY kE5JjR6UIxQ45H2xrpAX4qyEcKvmMEo9nkg3qnUAF5u0WpXrDsKqhDE8PkzpZYEOhec8MkTQgvEtl 4bNIC/BZeDRjalOBxDUsklZvi3YreB0cSnPGsrYZMOWeqqxn7MMggdrY6AMX85EywVdsQ7DAldAL1 CW6S2FedNT/GrCqdWVJu2M8ihxLsGvXj0M7iyHJ+VXAFHXymAt3bsCXd1jymssbkJC3NxzSIPvFc0 18CONVx+oqEha96Yl5sxu/lw2KpCGmVWAg/cXpHhvV7H2HkJxfl92VpVbdRuSsO5Rymk2V7vx4XWK E2kQzMtmA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lXKYU-001VNa-3a; Fri, 16 Apr 2021 09:14:26 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXKC1-001RNU-7E for linux-arm-kernel@desiato.infradead.org; Fri, 16 Apr 2021 08:51:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HDcs9N8rK4Jgfg1ARkJXfoy7TxIgpGEJ868Oi00DY1k=; b=ENK82rkbzvQx8iOfg2GmuDATKO h5P2H9q3cV+uG6Jd7j8JewKvstoQ92+ZfmBGVGA0rG8xfVvFHuJyEpD8MaKZqYWnBlgC12FimQXCc /DaUx3Aj9ALjl7KeOAq7vQZbt9YhNO1qSMNeOMkYn2OAX6D1mwsQhlyZNhKV9JbAdUxtShTgxKvd/ PWR/pFDKDVOB18JZPLhSexvxRiC50wWUlfMUaEYCip6Uos4/oitirqm7US0eOkXgawqepbFZyFKrS 4TiJ4JtajjPz3fkS1QStngjL+HPUVi82Pw1ZcERf9v4iPn/dQR66yfOx1T+7OcV6c3b0bvIU9wRnn VSZtTHEQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lXKBy-009DL3-Hb for linux-arm-kernel@lists.infradead.org; Fri, 16 Apr 2021 08:51:11 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id B17B061107; Fri, 16 Apr 2021 08:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618563069; bh=G20fHV8vaPYOZuC6bTk72/oUnsXRu84bnbsf13JZmRI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GnF3XUS3RhH9h9JHdtddbI5eZLxqQMnxkdnEvZx6UGHHsi8TJ81OQojgjmBIzQCEu 1TQZmcXPt4V1rax7BxmPJVQDGB/9QtUQIxk8BhOgNfPs1SGCrIhTjnU9Oix9A7OWZO 6Y06OecRcy1jyn3/DKFbxzbsxt6Cd/SijD1TCEFm2qkBplV+y1q+F6VGz7XXnF8gYE bbyMEk0Je6cYdc7z7G+jUZzIZgjFB4vqX8IoO2MAaRXOjSWJnQI7mm7rCF3yXdwknV Mg7zeIl0Ly6oVKzAP1FT3JNE7XBb7NXJCyCORqVds3wXizvG4IXpZtmHXbR9ORpTnF 7Wc84BwRSOCTA== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lXKBx-0001M3-Dk; Fri, 16 Apr 2021 10:51:09 +0200 Date: Fri, 16 Apr 2021 10:51:09 +0200 From: Johan Hovold To: Erwan LE RAY Cc: dillon min , Greg KH , jirislaby@kernel.org, Maxime Coquelin , Alexandre TORGUE , kernel test robot , linux-serial@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Linux ARM , Linux Kernel Mailing List , kbuild-all@lists.01.org, clang-built-linux@googlegroups.com, Gerald Baeza Subject: Re: [PATCH v2] serial: stm32: optimize spin lock usage Message-ID: References: <1618219898-4600-1-git-send-email-dillon.minfei@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210416_015110_634021_41E0A2FC X-CRM114-Status: GOOD ( 16.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org [ Please avoid top-posting. ] On Thu, Apr 15, 2021 at 07:09:14PM +0200, Erwan LE RAY wrote: > Hi Dillon, > > STM32MP151 is mono-core, but both STM32MP153 and STM32MP157 are > dual-core (see > https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-arm-cortex-mpus.html). > So your point is fully relevant, thanks. > > ST already fixed the same issue in st-asc.c driver in the past (see > ef49ffd8), because a systematic deadlock was detected with RT kernel. That's not the same issue. The above mentioned commit fixed an issue on *RT* where local_irq_save() should be avoided. > You proposed a first implementation in your patch, and a second one in > the discussion. It seems that your initial proposal (ie your V2 patch) > is the most standard one (implemented in 6 drivers). The second > implementation is implemented by only 1 company. > > It looks that the solution is to avoid locking in the sysrq case and > trylock in the oops_in_progress case (see detailed analysis in > 677fe555cbfb1). > > So your initial patch looks to the right proposal, but it would be safer > if Greg could confirm it. That would only fix the RT issue (and by making the sysrq one slightly worse). Using uart_unlock_and_check_sysrq() would address both issues. Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1131466797528997049==" MIME-Version: 1.0 From: Johan Hovold To: kbuild-all@lists.01.org Subject: Re: [PATCH v2] serial: stm32: optimize spin lock usage Date: Fri, 16 Apr 2021 10:51:09 +0200 Message-ID: In-Reply-To: List-Id: --===============1131466797528997049== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable [ Please avoid top-posting. ] On Thu, Apr 15, 2021 at 07:09:14PM +0200, Erwan LE RAY wrote: > Hi Dillon, > = > STM32MP151 is mono-core, but both STM32MP153 and STM32MP157 are = > dual-core (see = > https://www.st.com/content/st_com/en/products/microcontrollers-microproce= ssors/stm32-arm-cortex-mpus.html). > So your point is fully relevant, thanks. > = > ST already fixed the same issue in st-asc.c driver in the past (see = > ef49ffd8), because a systematic deadlock was detected with RT kernel. That's not the same issue. The above mentioned commit fixed an issue on *RT* where local_irq_save() should be avoided. > You proposed a first implementation in your patch, and a second one in = > the discussion. It seems that your initial proposal (ie your V2 patch) = > is the most standard one (implemented in 6 drivers). The second = > implementation is implemented by only 1 company. > = > It looks that the solution is to avoid locking in the sysrq case and = > trylock in the oops_in_progress case (see detailed analysis in = > 677fe555cbfb1). > > So your initial patch looks to the right proposal, but it would be safer = > if Greg could confirm it. That would only fix the RT issue (and by making the sysrq one slightly worse). Using uart_unlock_and_check_sysrq() would address both issues. Johan --===============1131466797528997049==--