Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1092278pxb; Fri, 20 Nov 2020 00:26:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiFtWQQNgsh6ZM4b4HfzNoATLSJ0uMcJVEhhU//ThQSLPzCGLRRsbGBjJO3vNEjpAL0XIK X-Received: by 2002:a17:906:f752:: with SMTP id jp18mr30180964ejb.331.1605860782848; Fri, 20 Nov 2020 00:26:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605860782; cv=none; d=google.com; s=arc-20160816; b=wapXERT/e2U2AtfMpuVwsgm5evSbf4RqsDdD+IcwUZ5Vv1fOXWjE9plt+7V8E6SM7L 3aJZtttuFR3roHnanbMF4/NgqvrCXZeyoDCPR8ZPnALR6LE+8JVQUABQL+mJCxENQ87x gmUwy84GGCrXiKnzzR5LxOJMN+RCkSJn/+rxH4bHWgNVKlSRiNDKf1pKczKABxEBkvBf Pg/65vSmbmOWz+txtPzXOsZwPaQtIFsAYbV9cG0Lr39FBZBCY0LomaHfgZEOhGstPiKs zoZ1Gi8Z+2+XAXsACt5mEH2pyGMGdzbdVJBY+diq5TNGHT71PqwB+z7dLAUh1TiiK615 eAsw== 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; bh=igNyjk3ZPx8gip3TWBwYGkCHE1bwLNjhy25vHgmoofM=; b=kRZBhX+WV3YZn+pay9FuFIF4Az96kwExyBkW+U1cfTe8dW6ClH7FxFCKjD9+Kk7dsU c1G7UfsMeRdOlQwMPbYYqydXXYNI/TlaMp7vYdPv3lTXt1xF0nrtu1YxVQBeOfLbazq+ l4JzYs+6qtpS9v3kxL5EejjZs5vPfzU7HzURRyt6Wc04HW+fezGbn6ca0qoiPm4EV7yG CABGngtzWte8LiFrFFMeHPMNbeCxh5iKkGgWXaZzBpJiSlNcnrD/TWuwjsZcbnibxeQM VRKj2hivppNLcEmRCnJWBIeaUhPCH3JxOHMcQ0JJfPQ+4vlAeXq0HNCDSCPshNDrlKRu nd4w== ARC-Authentication-Results: i=1; mx.google.com; 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 m25si1311235edp.176.2020.11.20.00.26.00; Fri, 20 Nov 2020 00:26:22 -0800 (PST) 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; 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 S1725805AbgKTIW7 (ORCPT + 99 others); Fri, 20 Nov 2020 03:22:59 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:33231 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725766AbgKTIW7 (ORCPT ); Fri, 20 Nov 2020 03:22:59 -0500 Received: by mail-lf1-f68.google.com with SMTP id l11so12297973lfg.0; Fri, 20 Nov 2020 00:22:57 -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=igNyjk3ZPx8gip3TWBwYGkCHE1bwLNjhy25vHgmoofM=; b=ntrnyXrNEEaeUfDL8GLWp4xNBCDXlR3btQrEPT2eIsp7Jtxblf+y+XahrsRcywrvHq qIoeqiQvZqj4jaL1tgw1hPqCEIfOrsWr3ZAJalr6BRhWU8jXi/hWrRp98ratIE8zgGvg b4R3INVaGF9Xx1Sic+oJgeqgqMlq9CTVpMCISFb0Pd+rrQYKkUWS6BdAm3hq75l047He WFrywV2JgZM7n28jjXpuNOCqWFq+IerLjaG3vSmobmqdvLxEscfIdlsFUEhTzcXkwzQe XDkmrtG89F8whwFWDW3ylokdnJfMLmVpa0waMsvkkBoRLgSkFY4N+/yJOntVuR3sRO0W 4Vzw== X-Gm-Message-State: AOAM530VbRBr47c8zoU2pmFqS/jwarfn2BY5BoAtFHyQ+uhwVduTbY/d dRBMFErh0myZsdz8n8afzE8mP552sZCVaA== X-Received: by 2002:a19:e01b:: with SMTP id x27mr2881996lfg.510.1605860577080; Fri, 20 Nov 2020 00:22:57 -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 v16sm220722ljj.0.2020.11.20.00.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Nov 2020 00:22:56 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1kg1h6-0006VH-Ax; Fri, 20 Nov 2020 09:23:00 +0100 Date: Fri, 20 Nov 2020 09:23:00 +0100 From: Johan Hovold To: Tian Tao Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org, afaerber@suse.de, manivannan.sadhasivam@linaro.org, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] tty: serial: replace spin_lock_irqsave by spin_lock in hard IRQ Message-ID: References: <1605776489-16283-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605776489-16283-1-git-send-email-tiantao6@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19, 2020 at 05:01:29PM +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/owl-uart.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/tty/serial/owl-uart.c b/drivers/tty/serial/owl-uart.c > index c149f8c3..472fdaf 100644 > --- a/drivers/tty/serial/owl-uart.c > +++ b/drivers/tty/serial/owl-uart.c > @@ -251,10 +251,9 @@ static void owl_uart_receive_chars(struct uart_port *port) > static irqreturn_t owl_uart_irq(int irq, void *dev_id) > { > struct uart_port *port = dev_id; > - unsigned long flags; > u32 stat; > > - spin_lock_irqsave(&port->lock, flags); > + spin_lock(&port->lock); Same thing here; this will break with forced irq threading (i.e. "threadirqs") since the console code can still end up being called from interrupt context. > stat = owl_uart_read(port, OWL_UART_STAT); > > @@ -268,7 +267,7 @@ static irqreturn_t owl_uart_irq(int irq, void *dev_id) > stat |= OWL_UART_STAT_RIP | OWL_UART_STAT_TIP; > owl_uart_write(port, stat, OWL_UART_STAT); > > - spin_unlock_irqrestore(&port->lock, flags); > + spin_unlock(&port->lock); > > return IRQ_HANDLED; > } Johan