Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1088642ybf; Fri, 28 Feb 2020 13:54:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxEIFwOG/FYYt/EGWbXHcYtEV++Uk8T1fdBICnp4gUyK8WdXQq4tmkLCcunBAgyG0gtvFpC X-Received: by 2002:a54:4895:: with SMTP id r21mr4674775oic.107.1582926863665; Fri, 28 Feb 2020 13:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582926863; cv=none; d=google.com; s=arc-20160816; b=GivBw/ACusb9M8PekAthYfa16Zg9TrC9GhDvxlaFIGbjzSo6ZHWX6GWgY5DK3gTajb CZ9DCWstrSxEQCNcUK3dBgpjrjCb+l0ZhXuhLaiYgEFzILhtRKHtKfHJoXZFjv0G4J73 pOItA71fe/1gbjIOVxm20PSq7RfQ5ykepGBD+yAJq3IkMEnSJdkTom0LsBBKQGJXJI73 CYQbBjrLmp1m9bkMx8AVppkxKztndTPvBeEGY/6p6Sr17+ETvUzOz42zDRomo/re2lrD AIIwDtd3HBxO1QqU5Abf6t642uUoddfomFfXQBrFdfUtbCkti2pOQDzk3MGuTTvG7dQF rXSw== 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=pDVNEc+emqEYhHMEI0BkQh8VuJ0zUAhAe+A2963SxX0=; b=exUpXndCBerSAgPGUHSbxkjB0FOHk2MVhY7GqgUOo82TwGslLC5qwg2Fljj1cOai9L nCwuLXbFjyUj/oWlQdlV/bzhbSi9KRwz3xeMJyb1gSVQHawFAe2gDc2k+eOC/tjS6dqc iaxdDZp393tDZg+RcY8lnfmsS+EWCUnDF6wf3AvMChhEVdNGiYHc+MuJxIvBTA/qkcYW 6hm6uUIIHKVHUU6yHSV41oRegXmT4KoCifitY2cDThq6TM+e5keLqHq1dGRqDPXyGgLq gCJJsoqya8Q7c+7kkEOzO/k2RrkA+5PXPi1T6hV0qsFgXYRm7EaUwEjHLStRABzdArau NH0g== 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 24si2335017oij.155.2020.02.28.13.54.10; Fri, 28 Feb 2020 13:54:23 -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 S1726527AbgB1VyB (ORCPT + 99 others); Fri, 28 Feb 2020 16:54:01 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:39130 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725957AbgB1VyB (ORCPT ); Fri, 28 Feb 2020 16:54:01 -0500 Received: by mail-ot1-f67.google.com with SMTP id x97so4013725ota.6; Fri, 28 Feb 2020 13:54:00 -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=pDVNEc+emqEYhHMEI0BkQh8VuJ0zUAhAe+A2963SxX0=; b=BhqHVZ2BqQuaGPgq01e0uENA0LzH4IW4LbLEg18hF44ZhNSsjptFlWRf7mdSTrv2B5 nyhE4QjOIO0Zi3bv7qvmF1y2mXU94UT2CkNn34mDw92FK1xO2hMc0OZYcrY/AvbuHF3O ytYJh3L3r4Zi+tADmEkHsCAJLiJ3+t3FHLMACuv45BEgMNUqPJ84ELsgwcprDfbgw+BF ZAjZFig4VPTAMbZf6PIp9O5gEYbnLHxo1iaxVJg7SbLxcGegBHLwE6PtwtxzMnRe9Goj 0edfYjMIOe9+FRJVdnER342QK7GU0SbCekf1vxlYsLn6GvpJuJe35hz9jr4pGS+/2iNl gKdw== X-Gm-Message-State: APjAAAXsFRSHRklY3pV+F9u7njfYAh/ObPNHX+JG6RZffDRJ4yRx9BTn N9cTgAT49QolC9W0Wbe82iUYtiYXITA= X-Received: by 2002:a9d:7593:: with SMTP id s19mr4713096otk.219.1582926840159; Fri, 28 Feb 2020 13:54:00 -0800 (PST) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com. [209.85.210.51]) by smtp.gmail.com with ESMTPSA id 17sm2358741oth.7.2020.02.28.13.53.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Feb 2020 13:53:59 -0800 (PST) Received: by mail-ot1-f51.google.com with SMTP id x97so4013634ota.6; Fri, 28 Feb 2020 13:53:59 -0800 (PST) X-Received: by 2002:a05:6830:1c8:: with SMTP id r8mr5033412ota.63.1582926839216; Fri, 28 Feb 2020 13:53:59 -0800 (PST) MIME-Version: 1.0 References: <20200221174754.5295-1-michael@walle.cc> <20200221174754.5295-4-michael@walle.cc> <639a1df72fbeda77436b282a99f17995@walle.cc> <24b9a657a65f75a4f4f10baa17561451@walle.cc> In-Reply-To: <24b9a657a65f75a4f4f10baa17561451@walle.cc> From: Li Yang Date: Fri, 28 Feb 2020 15:53:47 -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: Rob Herring , "open list:SERIAL DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , lkml , "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 Fri, Feb 28, 2020 at 3:51 PM Michael Walle wrote: > > 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 Ya. Same one. I have added CONFIG_FSL_EDMA into the arm64/defconfig as a workaround. Regards, Leo