Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp413960ybb; Wed, 25 Mar 2020 02:16:02 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv/rZkQd9XBZyXwtJZvz5hMe88yXEMfltny7Hr1Uj1kpEwxjbU2TeShB1GHkXrE1ZNW09zQ X-Received: by 2002:a05:6830:d2:: with SMTP id x18mr1770976oto.273.1585127762184; Wed, 25 Mar 2020 02:16:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585127762; cv=none; d=google.com; s=arc-20160816; b=dmpMiVt4QTOueCGxiWcNgkUvRZuiNCABqw45kA0A3juXb6STrbjGopARrKzkMDgY+Z rxGuy/s7jvUCLdoS45lGTuVVK9X+qSG4eSVQtnGehApV+uEDtSAjXKjBTVNefxWcYC1M lB4g8RacBsLtu5mcDzHRqX9c9K5qQ6HIR6YSXL7tVG2ooWY8NYYGJL76mJZPG1xEqKCn gwG3XIG4lrBgLipuojfT6Q3s4RpUyI0/V/5O42znv4sJHilyoRTeN3Y29SP9aSCghIgQ 9lLnymeeUNP/FvueTcLNez82++ImfKD6SqLwHfbqOyEd6Usgu1dzOJAviLKgh1qhGIWO 0fKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=u7ZYpCu3y5VBknHHroaIr6qJRGVeDFYMf8WyXcXqn+A=; b=er7BV9w+pnv7Oh8sqVnnuRVUeXs9L4ULWN2+8WIhBeuGr33qnx154xvC+8/CyGsEU1 dxrwiI0OwiaN3sw7Vn86O4JGgrb2kLuc/s5kQOJWc4Xu0VWSYbx9Tytu6wYAUELoyE6i 20gv38JYPaovb+ND2rxzsYtOxNk8DPQ9mGW4eiljgd0s6/boZ1K9XooIqwS9uRFtzAeb pvGfWZ6pjMW7diKum9vjVYMwrT1/oCiHduVWHwXXGFMDZIK5llNbnuEsN5Y+yySuVTuH ZKuv0IL4SdLcWu5qtNfuWgCflrAQTBFFBh0BfU/pKUI77q2Yt+qGB8ZI/dWwKe4bv6s1 /csA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=qiqUR5Cu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si10306254oig.220.2020.03.25.02.15.50; Wed, 25 Mar 2020 02:16:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=qiqUR5Cu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727260AbgCYJPM (ORCPT + 99 others); Wed, 25 Mar 2020 05:15:12 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:44383 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbgCYJPL (ORCPT ); Wed, 25 Mar 2020 05:15:11 -0400 Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 07E26231D9; Wed, 25 Mar 2020 10:15:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1585127709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u7ZYpCu3y5VBknHHroaIr6qJRGVeDFYMf8WyXcXqn+A=; b=qiqUR5CuH+lfxFzhhIYXkPHKuIOfno8ydhV1xiuzBOqpnSIFvgmBU0zh/Z2mGlJISQ3Zol CmLf1fM12jxZAjldYsbQZCFG465AIyRhbqfF7F1NTu6bLt6CHOoI7/WJtCsM6mnJWOGc1F NRBE6m/MZQxW1fxTVSyOEDxHiQkbODM= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 25 Mar 2020 10:15:08 +0100 From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jiri Slaby , Greg Kroah-Hartman , Leonard Crestez Subject: Re: [PATCH 1/3] tty: serial: fsl_lpuart: move dev_info_once() In-Reply-To: <20200324184758.8204-1-michael@walle.cc> References: <20200324184758.8204-1-michael@walle.cc> Message-ID: X-Sender: michael@walle.cc User-Agent: Roundcube Webmail/1.3.10 X-Spamd-Bar: / X-Spam-Status: No, score=-0.10 X-Rspamd-Server: web X-Spam-Score: -0.10 X-Rspamd-Queue-Id: 07E26231D9 X-Spamd-Result: default: False [-0.10 / 15.00]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[5]; DKIM_SIGNED(0.00)[]; NEURAL_HAM(-0.00)[-0.708]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2020-03-24 19:47, schrieb Michael Walle: > Don't take the spinlock and use dev_info_once(). This may cause a hang > because the console takes this spinlock, too. Just print this info > after > we've released the lock. > > Fixes: 159381df1442f ("tty: serial: fsl_lpuart: fix DMA operation when > using IOMMU") > Reported-by: Leonard Crestez > Signed-off-by: Michael Walle Because the patch subject was renamed: This patch series is superseded by the v2: https://lore.kernel.org/linux-serial/20200325090658.25967-1-michael@walle.cc/ I didn't include the 3/3 RFC patch though. This is a bigger change, which should be carefully reviewed by the maintainer of the fsl_lpuart.c. -michael > --- > drivers/tty/serial/fsl_lpuart.c | 22 +++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/drivers/tty/serial/fsl_lpuart.c > b/drivers/tty/serial/fsl_lpuart.c > index 9c6a018b1390..960fc2658f19 100644 > --- a/drivers/tty/serial/fsl_lpuart.c > +++ b/drivers/tty/serial/fsl_lpuart.c > @@ -1517,9 +1517,6 @@ static void lpuart_tx_dma_startup(struct > lpuart_port *sport) > > sport->dma_tx_chan = dma_request_chan(sport->port.dev, "tx"); > if (IS_ERR(sport->dma_tx_chan)) { > - dev_info_once(sport->port.dev, > - "DMA tx channel request failed, operating without tx DMA > (%ld)\n", > - PTR_ERR(sport->dma_tx_chan)); > sport->dma_tx_chan = NULL; > goto err; > } > @@ -1551,9 +1548,6 @@ static void lpuart_rx_dma_startup(struct > lpuart_port *sport) > > sport->dma_rx_chan = dma_request_chan(sport->port.dev, "rx"); > if (IS_ERR(sport->dma_rx_chan)) { > - dev_info_once(sport->port.dev, > - "DMA rx channel request failed, operating without rx DMA > (%ld)\n", > - PTR_ERR(sport->dma_rx_chan)); > sport->dma_rx_chan = NULL; > goto err; > } > @@ -1601,6 +1595,13 @@ static int lpuart_startup(struct uart_port > *port) > > spin_unlock_irqrestore(&sport->port.lock, flags); > > + if (!sport->dma_rx_chan) > + dev_info_once(sport->port.dev, > + "DMA rx channel request failed, operating without rx DMA\n"); > + if (!sport->dma_tx_chan) > + dev_info_once(sport->port.dev, > + "DMA tx channel request failed, operating without tx DMA\n"); > + > return 0; > } > > @@ -1653,13 +1654,20 @@ static int lpuart32_startup(struct uart_port > *port) > > lpuart32_setup_watermark_enable(sport); > > - > lpuart_rx_dma_startup(sport); > lpuart_tx_dma_startup(sport); > > lpuart32_configure(sport); > > spin_unlock_irqrestore(&sport->port.lock, flags); > + > + if (!sport->dma_rx_chan) > + dev_info_once(sport->port.dev, > + "DMA rx channel request failed, operating without rx DMA\n"); > + if (!sport->dma_tx_chan) > + dev_info_once(sport->port.dev, > + "DMA tx channel request failed, operating without tx DMA\n"); > + > return 0; > }