Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp5350ybf; Thu, 27 Feb 2020 14:50:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzNZcNVDgQ6H/363luaBwEFEA2Pu8ILoOf+yQsW8xHk5gSHfK5qXDz0bsLOtag9+hE9173Q X-Received: by 2002:a05:6830:4a4:: with SMTP id l4mr962377otd.91.1582843800404; Thu, 27 Feb 2020 14:50:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582843800; cv=none; d=google.com; s=arc-20160816; b=XF/tIAJurgFKdGentxrKj8yB2YteMOT1YyOCplq+wOL+20IaF6tTG446+S8dU2O75n yFy021whKA4eslqn4gWFynB1MUVzD5S6++k/qC9E9hLtNq+PRP7ilHt+EyWSOa7CJAU3 /QsklI3S33OWeS2iUcPCHE528rQH+LkdRF1VB4OFxMcEDEgYg8/KY3BQ/6Gz9gsq6qb5 Nl6it52wXFAEn/AnRUU9nNY42OVn05xaAfg7GYcmtbdJ9r4hxMAaPLANAuTarWZQAK9d 9L5Se61M3ZM7kGgZCVDd7zu8g0xfmI9XGIZmYCx1vfdFA93KOmHwJpP1Tyibfc1feA46 rp8A== 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; bh=qrt5LAslHCMpZZk+1bFnZB1hkmKt9afE9QUzznOIIn4=; b=1G1I1te28nMdL+mHw9bT8t/BWsM8iz/BZVxnAKiUY25nf8FfVmQ4bjq2YwEKwXkEkW d3QGFC+M8DbctJpTaXeG+XcXr19cHxJuL2l5G0+jBQfJD+3jFyKZLFNKQ5I98e7sPout GjCLu8TuQ1sygcKjSeO49uCyHUKgYQXEasZmvVgWwAQnkN7kYub4TGguj+Z1n7hZ//wd +LZobxoC0aVwwFp6PPtDKljHM1xnac1HjgpoZnT8E+TW+uNqNxm4OZ4P6I/j12c916TZ pBr2Hwoqgzg263e6JmdWuADz1iWPAX5bmyMRmGEeB9YMyEyXUngqV9xvuAIr0XEPht+1 sd0g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 110si371524otj.303.2020.02.27.14.49.10; Thu, 27 Feb 2020 14:50:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730143AbgB0WtH (ORCPT + 99 others); Thu, 27 Feb 2020 17:49:07 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:39296 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbgB0WtH (ORCPT ); Thu, 27 Feb 2020 17:49:07 -0500 Received: by mail-oi1-f196.google.com with SMTP id r16so953578oie.6; Thu, 27 Feb 2020 14:49:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qrt5LAslHCMpZZk+1bFnZB1hkmKt9afE9QUzznOIIn4=; b=kkk5YPWWktEuu8H0UZD1PlKmpLPT1sBXpdkYPvE68ooL/mYn6bRUmkPCVuIcetMOjX qKgiUVbx8acQMRBrgABTPGK/rm9oiU9pgEVhny0ozfbcDIEPF6PSiTw/gnaMDifNMSxg QPqgiLPel/dMlCxGdecXStBIxkUUbLceXJLcwZfxTJQGCkwDurJ9YR4AVnwCBpALYHEV CJJoueBjkekD+dyOmEwnNXFLCg7EM/0FS7hZFFEc2SKMjIp9XaMkaoExY/B/Z3yZcbp2 KLdE4oABAWA6K4ePyyoR6QU5swhUl4vXrmUfjKkd+BA9PuZtva9tZ686W4dWBPT7gPTP wc+A== X-Gm-Message-State: APjAAAWyRaABHf3OYY8cuKaVwtKGu1wjpjQMnkXz8VhZ3IUwoNIb/Acp nT5JxjUOX+t7uyP9PwF+Q5FdWDeo X-Received: by 2002:aca:d0a:: with SMTP id 10mr1009456oin.50.1582843745837; Thu, 27 Feb 2020 14:49:05 -0800 (PST) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com. [209.85.210.42]) by smtp.gmail.com with ESMTPSA id g8sm2431795otq.19.2020.02.27.14.49.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Feb 2020 14:49:05 -0800 (PST) Received: by mail-ot1-f42.google.com with SMTP id r16so844674otd.2; Thu, 27 Feb 2020 14:49:05 -0800 (PST) X-Received: by 2002:a05:6830:1184:: with SMTP id u4mr892613otq.221.1582843745073; Thu, 27 Feb 2020 14:49:05 -0800 (PST) MIME-Version: 1.0 References: <20200221174754.5295-1-michael@walle.cc> <20200221174754.5295-4-michael@walle.cc> In-Reply-To: From: Li Yang Date: Thu, 27 Feb 2020 16:48:54 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/9] tty: serial: fsl_lpuart: handle EPROBE_DEFER for DMA To: Rob Herring 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: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? Regards, Leo