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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 504EBC5519F for ; Fri, 20 Nov 2020 08:16:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 BD72B22227 for ; Fri, 20 Nov 2020 08:16:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XedC0DZW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD72B22227 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=KSTYnzWg4nXpvGOJxXzL38ClN1gS89ZdIkLrA4tMJhY=; b=XedC0DZWDXdM8U5DsMbj/q8ht E8Cw2tjU0/J4Kmkyk+AmUpvFZaQeePsEdCjOrO3euJM+qh8Q1CjzeclisDVKFY++7Q17bf2F9XfLO Pu3+cECl+OgISBHc069v8KOmZXPq/2SJO/CBzMgQJcKXRvipOMNKXJE+zpicBu9BYhRcSM+Z48xGZ gBZ8QgP+Pa+bDTSGFdqWGVIpIyX9cbPHaaj2fxL7Cp1cF2f+G8oC7X+WpMv1F+KvRKhgqOcbJVGnh aUfWr3I7bdV7WTSZfaTY63IZQ1ApASSkkLadLVOHGEGZqagwmWYnNegOytyYaqKqwa0Md5/YCGoWR 1KS68I3kA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg1Zp-0005Lf-9S; Fri, 20 Nov 2020 08:15:29 +0000 Received: from mail-lj1-f193.google.com ([209.85.208.193]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kg1Zm-0005Kz-Si; Fri, 20 Nov 2020 08:15:27 +0000 Received: by mail-lj1-f193.google.com with SMTP id y16so9177357ljk.1; Fri, 20 Nov 2020 00:15:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WDs6obGTLR1+wdJ6BVB6dndSCVFd0as/yCTkI8gYmPU=; b=bOQrwAOPbumtG1To5B1cx6voNdNjmAmJi22vOU/eToGVK1PJU6VEcJxyx6Thqry1ow yV3lHkpcIKygIe10bVc8yD4/7ZxVu9QVlE15uag0UFA/m0/m2/YS3mOE02KJKQrWh0dI R13RQKVeQeQ1w42uXcgWAKX2LgOrtrB6jRPBpcjdLYoVspG/lPeGLe2De3cRM9FiWfp3 QQXTZNVHyLehey2DZ6SV5UHJwHC2rD/5XIanBp8XJiMV+9gQtsUtpfN2QsECesNOGwCU e3c+fuIIqO+9jDIf2kYR8yrrPfx7QnG9purdFqtQxp2TJFLn97vwG5NNvJb51hwx1CF9 H6Bg== X-Gm-Message-State: AOAM5304D49vt+cN9Uy7SkXknbeHAX6P2D0ObJMEU4H67jJforZ1JOlG j2ZqHbthrvoy3x8wZ04JTfcSV7REEaHNjQ== X-Google-Smtp-Source: ABdhPJxmm2fXT+CqTHKLbKnoL9h2nvyj3DpRahFss6PyhtuoOWUmAs/POQ+0B/EFEX06/htv9hKBVw== X-Received: by 2002:a2e:9005:: with SMTP id h5mr6752085ljg.59.1605860122921; Fri, 20 Nov 2020 00:15:22 -0800 (PST) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id p25sm261261lfc.125.2020.11.20.00.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 00:15:21 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1kg1Zl-0006KK-9f; Fri, 20 Nov 2020 09:15:26 +0100 Date: Fri, 20 Nov 2020 09:15:25 +0100 From: Johan Hovold To: Tian Tao Subject: Re: [PATCH] tty: serial: rad-uart: replace spin_lock_irqsave by spin_lock in hard IRQ Message-ID: References: <1605835613-28359-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1605835613-28359-1-git-send-email-tiantao6@hisilicon.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201120_031526_945400_42765224 X-CRM114-Status: GOOD ( 19.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-unisoc@lists.infradead.org, linux-serial@vger.kernel.org, jirislaby@kernel.org, linux-arm-kernel@lists.infradead.org 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 On Fri, Nov 20, 2020 at 09:26:53AM +0800, Tian Tao wrote: > The code has been in a irq-disabled context since it is hard IRQ. There > is no necessity to do it again. > > Signed-off-by: Tian Tao > --- > drivers/tty/serial/rda-uart.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/tty/serial/rda-uart.c b/drivers/tty/serial/rda-uart.c > index 85366e0..d6705a0 100644 > --- a/drivers/tty/serial/rda-uart.c > +++ b/drivers/tty/serial/rda-uart.c > @@ -406,10 +406,9 @@ static void rda_uart_receive_chars(struct uart_port *port) > static irqreturn_t rda_interrupt(int irq, void *dev_id) > { > struct uart_port *port = dev_id; > - unsigned long flags; > u32 val, irq_mask; > > - spin_lock_irqsave(&port->lock, flags); > + spin_lock(&port->lock); This will break with forced irq threading (i.e. "threadirqs") since the console code can still end up being called from interrupt context (which can result in a deadlock). > > /* Clear IRQ cause */ > val = rda_uart_read(port, RDA_UART_IRQ_CAUSE); > @@ -426,7 +425,7 @@ static irqreturn_t rda_interrupt(int irq, void *dev_id) > rda_uart_send_chars(port); > } > > - spin_unlock_irqrestore(&port->lock, flags); > + spin_unlock(&port->lock); > > return IRQ_HANDLED; > } Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel