Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp148548pxb; Fri, 16 Apr 2021 01:54:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuCAS/kJZB9L0h5tc0SAZOVkb1+IVRemWfyYlsn1XFMr8gnY9oP+yFfY5OCOOrjIsBx8vE X-Received: by 2002:a17:907:20f0:: with SMTP id rh16mr7733704ejb.320.1618563261205; Fri, 16 Apr 2021 01:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618563261; cv=none; d=google.com; s=arc-20160816; b=VmYWQvfq7LC24rXqU4wWvteD3YBKBaJKPBEIIf9r4FHuEqnPnAya+CCac6W5Hsqf2z se7oAGzzpD7XJuMy9uemND4c9/4T55hHGCgj6+bNnGkIzmNpNFxODnnY9d34AKIh8jG3 11GEjCfBv3o/bvzd5KCbUZfZrg20FoB/OwlgL6jeJDtap5ADn1/a6PZIqNDRg+60PQxr gIhBQCoyRzqLXVwYXQagkSqjnB2HQS4XIL8AydawWdcbx2QOrdbH1TRg9e0+AltMy2JU WMoq/UvD60B71h8Hx75hLCOhsHmNO//cloTFLrPf1jaU1PvX8woX8eQFPEKKVpILdHaP hjRw== 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=HDcs9N8rK4Jgfg1ARkJXfoy7TxIgpGEJ868Oi00DY1k=; b=AsyyW+4ePBRgQ0+onF7P8N76tCASs1SntEhkC485bgo8zXMphABc16mow6B1cNsQos H8Czeh3d3OnUfjNEsDPNy4Ce6vSgw1m9EtK6HUzLAWUqdI9z5go+ZEUzCV+P+mfAxE8W aE8zshNYNm88MJxW8duUaqRIb9DSA8sKfwqimIW572xXNQ+sF1oYcrw+ZsLwvDyEbvQ1 GteObBUL8BK4POFaG8XgWmBA37iDTCjdQ1PNjqFZBzmp4pnNUmXbMcpEJCjTbm+GR8Lq mJbxfyVeigHiCMtHbb3YWjwjseu58CCuSYq+RE7dA1wz3JPKf4dfmtzihJa0R4jk/IxM hT+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GnF3XUS3; 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 d17si4318644edj.284.2021.04.16.01.53.58; Fri, 16 Apr 2021 01:54:21 -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=GnF3XUS3; 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 S240562AbhDPIvi (ORCPT + 99 others); Fri, 16 Apr 2021 04:51:38 -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