Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1086835ybf; Fri, 28 Feb 2020 13:51:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzOePe5ChYn1bJAPWXCSJZ93eGsnOpj+7wftd06yGrOjG9SgoN2I8ip4xa4tBI0oI/K1LFm X-Received: by 2002:aca:5c46:: with SMTP id q67mr4622261oib.75.1582926672973; Fri, 28 Feb 2020 13:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582926672; cv=none; d=google.com; s=arc-20160816; b=SGNMaPqSm+nTjR79cCsLYHzFMSrsPUVVLA+fEBk/Vpx/dd2Rn6Uk1CP/XJUPbF6zgI zbHEQoatOzm7URD/4Pgc2poQV8zcSiLMDLyRxsOm+uTZcG9OkdQIFucunD6DwLFr+1Fd u2kSZphCoN3l74+m3gTUdo/B/MW7wxzpNWSDVhu5aa1lUeTNhgu0OypDlLlBfDQB2RrN OuzryWRUIkFtvGCMNKKrQfQUDd5SoWjUDO/XSTiNVNXCX2ceax3IwdxfDoYoOLln2THr gIrqRhGaZgFNDeKB8UcRMDwfl8fpmN7Xs3ed/MJW94g8/hkartplFJPBnrwkb5ZzFGq+ BYgQ== 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=oYF0XupHCNrJePiMiwuR1qNRjdHRjVb4x1LouSfF1I4=; b=FDNrrvQ1LScUy4GJP4/ym3vK3RmSaWcqTZvNaY5itrJf8zRSnEVAPXQ3jy9RzD90dY Qv5zMvoViuZOKfe2Dackxk/hhL/6/0o6QdbzzaFO+jqySKpvEtwDWortpOEBGrvn4CKC QdBL4gb7DBhZZQ6xZOn6fHD9FDKncBl03MKaU8C4xuPnkFyAszNNR2MCZ+JXudmKTnUq ijms5Az5aWnqxu4F2JYGcVQCod1MXH94qyemZ09M1GLUJMvv1+uxhl0aIYk6+SHxcsFD Z0/WI4A+I7Fsknaq+JD/BpP2buHi15udi4Q5XKiv2FwLEKA8/0iN8TKZxAof4Mo4xQ+M r8vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=utAc0NN1; 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 g15si2180250otk.85.2020.02.28.13.51.01; Fri, 28 Feb 2020 13:51:12 -0800 (PST) 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=utAc0NN1; 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 S1726631AbgB1Vuz (ORCPT + 99 others); Fri, 28 Feb 2020 16:50:55 -0500 Received: from ssl.serverraum.org ([176.9.125.105]:50665 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbgB1Vuz (ORCPT ); Fri, 28 Feb 2020 16:50:55 -0500 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 D735D23E29; Fri, 28 Feb 2020 22:50:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1582926652; 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=oYF0XupHCNrJePiMiwuR1qNRjdHRjVb4x1LouSfF1I4=; b=utAc0NN1aDLhRtpGKBeNvJSNKQa5PluFyiMyy9TK6sRiqMm7D5mU0tUS4DM/gz9cLsFpTT HBKXqrPcpfqKmgF8uRHUwNAThWGigvVWE1ytVCFRRzoyUCcACkjNPcuERohmfkfNObruwS Y+XzZUVQUA6Q7xCDddtK8wJy4sWoYiQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 28 Feb 2020 22:50:51 +0100 From: Michael Walle To: Rob Herring Cc: Li Yang , "open list:SERIAL DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Greg Kroah-Hartman , Mark Rutland , Shawn Guo , Jiri Slaby , Peng Fan , Vabhav Sharma Subject: Re: [PATCH v2 3/9] tty: serial: fsl_lpuart: handle EPROBE_DEFER for DMA In-Reply-To: <639a1df72fbeda77436b282a99f17995@walle.cc> References: <20200221174754.5295-1-michael@walle.cc> <20200221174754.5295-4-michael@walle.cc> <639a1df72fbeda77436b282a99f17995@walle.cc> Message-ID: <24b9a657a65f75a4f4f10baa17561451@walle.cc> X-Sender: michael@walle.cc User-Agent: Roundcube Webmail/1.3.10 X-Spamd-Bar: + X-Spam-Level: * X-Rspamd-Server: web X-Spam-Status: No, score=1.40 X-Spam-Score: 1.40 X-Rspamd-Queue-Id: D735D23E29 X-Spamd-Result: default: False [1.40 / 15.00]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TAGGED_RCPT(0.00)[dt]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[]; RCPT_COUNT_TWELVE(0.00)[12]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; SUSPICIOUS_RECIPS(1.50)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 2020-02-28 12:46, schrieb Michael Walle: > Hi Rob, Hi Leo, > > Am 2020-02-28 00:03, schrieb Rob Herring: >> On Thu, Feb 27, 2020 at 4:49 PM Li Yang wrote: >>> >>> On Thu, Feb 27, 2020 at 4:35 PM Rob Herring >>> wrote: >>> > >>> > On Fri, Feb 21, 2020 at 11:48 AM Michael Walle wrote: >>> > > >>> > > The DMA channel might not be available at the first probe time. This is >>> > > esp. the case if the DMA controller has an IOMMU mapping. >>> > > >>> > > Use the new dma_request_chan() API and handle EPROBE_DEFER errors. Also >>> > > reorder the code a bit, so that we don't prepare the whole UART just to >>> > > determine that the DMA channel is not ready yet and we have to undo all >>> > > the stuff. Try to map the DMA channels earlier. >>> > >>> > Changing this means you never probe successfully if you boot a kernel >>> > with the DMA driver disabled (or it's IOMMU disabled). Some other >>> > drivers request DMA in open() and can work either way. > > Oh, I see. > >>> We got this exact issue previously with another driver. When the > > What driver is it? I've been working on the i2c-mxs.c driver which has whoops, i2c-imx.c, not i2c-mxs.c -michael > the same problem. Ie. its not working with DMA when the IOMMU is > enabled. > Now that I've learned that dma_request_chan() will return EPROBE_DEFER > if the actual DMA driver is not available, I don't think there is any > trick like this there. There is no function which would be called late > except you'd do something like on the first master_xfer() try to > request > the DMA channels. But I don't think that would be the way to go. > > -michael > >>> required DMA driver is disabled, the DMA framework cannot figure out >>> this situation and keeps returning EPROBE_DEFER. I'm wondering if we >>> should update the DMA framework to use your deferred probe timeout >>> mechanism. Is it still only used for debug purpose? >> >> It's undergoing some rework ATM to not just be for debug. However, >> it's not really going to help you if you care about the console >> because waiting for the timeout will be too late to register the >> console.