Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1616164ybf; Thu, 27 Feb 2020 14:35:02 -0800 (PST) X-Google-Smtp-Source: APXvYqzoyf0LQgqGW5UfeeEMs3nCzPS1apNp5tRfIHcaGlxkg+o1/CkJXQqwb+WSGuOQzzsKkFHK X-Received: by 2002:aca:d903:: with SMTP id q3mr1030548oig.12.1582842902019; Thu, 27 Feb 2020 14:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582842902; cv=none; d=google.com; s=arc-20160816; b=sb69CyZfoTN4TR0nnoa/YAiEME2mhDtYt2/PArEK9LOQPae4FWkMEMN9vqjLqc8o50 yMFc0P+MkZMoQPwj3i6ZySgUB/Y8IWdEmKkLgShYoB24NAdSFOkn9l9eE+koi3/Zpmu3 U7vbNhnEZxTLSsO7w+VeyEEBWltbsdJGE1PXDk4JI3EWfvNTey1IDHPJ9vLAPuzJvFYU UQaXRSRELKdQXjBTH8W12krymfOCEeZvbryUmfm9Pm3XsAOht7HZHXgQ4iyBKQsnkGDu 8JUHKIugVeuNfBQCa8Wd5vXBASi9wGICC+gW27k9kxzI4BxiWtHVm2LOPxuMrDWPSL+z j0mA== 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=YaGh6D1HzZ7fNKCmGcqwfIeREmWsHw1fRwfnKYtFmzE=; b=YbwcQ86AHpGaMGKOnkduoTrh9B3BJYG+X7r5ZiPX8gbI6Jltgx4nwYEvLSWqXciAgl qgBxhS/kpgHn2W7MnLhia7hdVd3ly7xYzqorCDv10EH0zjUp0bS7UrR9SsRACnzGy1O/ 9VCI33D0tWfUueo/Pq5uOKvFHCeFeyjafKhBuEwqjtWulG8qHxawkzjVwgjoa7VmoKBv hD4ue5pacNUWn0DtvEd+V/lPtYWpdUHnQ0+nZzK1uUanSPCiRZPXW+n0t3bUOP0mZkmf eWSKczo64U8pHgqSlfDJUCPckTDP9ehlMOn+qKfTKGjx0EiP3f5glE7Vwz3aKUVUtlWL n34Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vtupj6DZ; 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 v126si716939oia.106.2020.02.27.14.34.50; Thu, 27 Feb 2020 14:35:02 -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=Vtupj6DZ; 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 S1730239AbgB0Weq (ORCPT + 99 others); Thu, 27 Feb 2020 17:34:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:38252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729926AbgB0Weq (ORCPT ); Thu, 27 Feb 2020 17:34:46 -0500 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 9CD4F246AC; Thu, 27 Feb 2020 22:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582842885; bh=YaGh6D1HzZ7fNKCmGcqwfIeREmWsHw1fRwfnKYtFmzE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Vtupj6DZECBmVkSIhKs//W0XwsQmOxTt4UepDYJwQEuOg4vEvKHMYW6U5MI3XG6rF ECX0OqVBvXgDCczjDg9okCAU/kyqNMdfNI7pwFpFCaT7/sxNNRbX5mhW9rSHId5kS8 HrdfBSFLZoIotsMniP2g4di6KEv10U2Gl95hVKVo= Received: by mail-qk1-f181.google.com with SMTP id 145so1189173qkl.2; Thu, 27 Feb 2020 14:34:45 -0800 (PST) X-Gm-Message-State: APjAAAW3FMK72SVt5oKr0aY8cGkl1ZXbrDb70sFgWJT6Gk9kJCisMSi1 ydGGePFVxtIy1LtKgcTlVo0K8NJkSLUFZZSfqA== X-Received: by 2002:ae9:f205:: with SMTP id m5mr1905154qkg.152.1582842884742; Thu, 27 Feb 2020 14:34:44 -0800 (PST) MIME-Version: 1.0 References: <20200221174754.5295-1-michael@walle.cc> <20200221174754.5295-4-michael@walle.cc> In-Reply-To: <20200221174754.5295-4-michael@walle.cc> From: Rob Herring Date: Thu, 27 Feb 2020 16:34:33 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/9] tty: serial: fsl_lpuart: handle EPROBE_DEFER for DMA To: Michael Walle Cc: "open list:SERIAL DRIVERS" , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Greg Kroah-Hartman , Mark Rutland , Shawn Guo , Li Yang , 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 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. Rob