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 279BAC433ED for ; Fri, 16 Apr 2021 14:46:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D79BF6115B for ; Fri, 16 Apr 2021 14:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244641AbhDPOq1 (ORCPT ); Fri, 16 Apr 2021 10:46:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:36180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244605AbhDPOq1 (ORCPT ); Fri, 16 Apr 2021 10:46:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 795AC610FC; Fri, 16 Apr 2021 14:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618584362; bh=qpm8MHd3hC7x4V+sHrNbEegZYfAuyfhVcaQke9j+V4w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=emeqpdgMpiXTBNBcX+7GWIkt6+uwu9f/LSuSpAsfeu5lI4+6Wx9eqv7xDr/sugXm4 9gQFCnBEFdx2WjeZstLIUwzu9C4AUvzT8jXoMKBcWxVu4NOHencpiPlj2TQVWOMZQ8 zajt5y1otU6cSmsw0wCRanjuxVJkkeQ/KmqoQWQt9tg0AhRqbOEpJw6YzivV4pnsHa G1NNIOYnOF5ehTftC/lHlWuza/TcGW0umzXHCmLSoXAwOvzo7Q9quHYQoNi6twAymg WV5bHRUXKMplB5dNaZs3q7s4s9MewkyLo9zS2y0KnKO9M8Z1Qh5HePT7EfUh3j0dlp 6CdVXgRcZM6FQ== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lXPjO-0006fq-1A; Fri, 16 Apr 2021 16:46:02 +0200 Date: Fri, 16 Apr 2021 16:46:02 +0200 From: Johan Hovold To: dillon min Cc: Alexandre TORGUE , Alexandre Torgue , Erwan Le Ray , Gerald Baeza , Greg Kroah-Hartman , Jiri Slaby , Maxime Coquelin , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 2/3] serial: stm32: fix threaded interrupt handling Message-ID: References: <20210416140557.25177-1-johan@kernel.org> <20210416140557.25177-3-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Fri, Apr 16, 2021 at 10:35:25PM +0800, dillon min wrote: > Hi Johan > > Thanks for share your patch. > > Johan Hovold 于2021年4月16日 周五22:11写道: > > > When DMA is enabled the receive handler runs in a threaded handler, but > > the primary handler up until very recently neither disabled interrupts > > in the device or used IRQF_ONESHOT. This would lead to a deadlock if an > > interrupt comes in while the threaded receive handler is running under > > the port lock. > > > Greg told me there was a patch fixed this case. In case hard irq & > threaded_fn both offered. The local_irq_save() will be executed before call > driver’s threaded handler. > > Post the original mail from Greg > > Please see 81e2073c175b ("genirq: Disable interrupts for force threaded > handlers") for when threaded irq handlers have irqs disabled, isn't that > the case you are trying to "protect" from here? > > Why is the "threaded" flag used at all? The driver should not care. > > Also see 9baedb7baeda ("serial: imx: drop workaround for forced irq > threading") in linux-next for an example of how this was fixed up in a > serial driver. Neither of these commits are (directly) related to the problem this patch addresses (they are about force-threaded handlers, this is about a normal threaded handler which run with interrupts enabled). Johan