Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp16052ybf; Thu, 27 Feb 2020 15:04:31 -0800 (PST) X-Google-Smtp-Source: APXvYqy1iYxz2/rlvGwYFN2UjPtT8NyUHm+oOKGyg3Zfvq75+1oWhHQYMHcJGgBv9mQWz97Gjgu/ X-Received: by 2002:a05:6830:147:: with SMTP id j7mr1024197otp.12.1582844671695; Thu, 27 Feb 2020 15:04:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582844671; cv=none; d=google.com; s=arc-20160816; b=iBun2DU/dIvB9AmzxqsaQHRI7qCIpaZnF71VUVXdKrNvKEnnf01/rKh5mOo5/6C2cQ xnzwAcGDytA+meTF9Q60r8G69EyyoH2hXAA9dE+bRRY9RVkqpyr6dFf5goJ0HxYItsih gi61avCi3IbPJKwzQB4nlQ0uUhsUHMD5UY/t+wew6Xs9nokZlfxrv8yOoKXXKnS/t8ZG pwjVZWGkkxlGLGBwNBQJYtj7CN6CFzDSNxbk9C0sYEET0JNS4wFzsqXY/mw824AeEN0r G9ENGFLWAyu5T/OrkcNSZjE1oJ67T+DFwbkqfTV0WbDwr5H+LCH5z8Bqa2wwM5N+jCsz tV8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XdkD6/d8pqm2vfaDfaecrX1JA7jWnT9TazvvG5zEyVs=; b=dhMl4r45jAwUP1ogkEK1z8k+OnfH4FIy+hpswjkXz5tbWoVaXer7zQdgQWp03OIIkj P/V2hsrBC+dtMyAxb7UrfxxAQF9wbV/TszH19vM7b3VQoliu0MfmRdVo+820MV4A/mLm CyLBU3cKp7pfjQUhp0Es9azme51qHKD1+xyl6xbxSXklOz2gqAQzME9ByRUFl0IukNqu +4dXBbwgwj9OLQAjT3VuG37pLXnUgPp8dDoXpXBO934lWtocfFGxUmJfvOMcLsIgF4oG 581Qagjxy4bxW5YspBWZD4SjhzEuvpL5vcUAI71N93ISG8CTExfE/7doOWf+Cvta7GVq UrYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oEH/uiuZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si361062otp.258.2020.02.27.15.04.03; Thu, 27 Feb 2020 15:04:31 -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=@kernel.org header.s=default header.b="oEH/uiuZ"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729812AbgB0XDz (ORCPT + 99 others); Thu, 27 Feb 2020 18:03:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:55674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729738AbgB0XDz (ORCPT ); Thu, 27 Feb 2020 18:03:55 -0500 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E5212469F; Thu, 27 Feb 2020 23:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582844634; bh=ujUq05vTwgp4zfCZVaURWqd3tAcJ6/JW0KDXhNHLdnM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oEH/uiuZrTAbwGQzcL4TRZqtyLXCPzURXZ7AHmOcxlmfYjQxq8rjuEdMVllcYhdBA r7vHN9Gx+mjeyXpcJvnCi/j/XpUPPTDYDDhBIhlPMPTNLSwWLfJpKrxBmJMnUuslRN E9StyYr4S9lGrNRtvAcH59YGWPIVrmUjaPMsrTaM= Received: by mail-qk1-f176.google.com with SMTP id e16so1232157qkl.6; Thu, 27 Feb 2020 15:03:54 -0800 (PST) X-Gm-Message-State: APjAAAXCRJrWYKKXHXKqmcqE0vZ6ANB+mUlRpcinZqSAvLp879oV+p5q ArJEtsOC1WWAEwr9m94WSnVeLbslAeHF2PKsaQ== X-Received: by 2002:a05:620a:12a3:: with SMTP id x3mr1989416qki.254.1582844633702; Thu, 27 Feb 2020 15:03:53 -0800 (PST) MIME-Version: 1.0 References: <20200221174754.5295-1-michael@walle.cc> <20200221174754.5295-4-michael@walle.cc> In-Reply-To: From: Rob Herring Date: Thu, 27 Feb 2020 17:03:42 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/9] tty: serial: fsl_lpuart: handle EPROBE_DEFER for DMA To: Li Yang Cc: Michael Walle , "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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > We got this exact issue previously with another driver. When the > 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. Rob