From patchwork Thu Feb 26 02:27:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 45157 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f200.google.com (mail-we0-f200.google.com [74.125.82.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9A75920502 for ; Thu, 26 Feb 2015 02:29:36 +0000 (UTC) Received: by wesq59 with SMTP id q59sf5599243wes.2 for ; Wed, 25 Feb 2015 18:29:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:cc:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:content-type:content-transfer-encoding:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list; bh=au3gItIjWpK8IZgGbDLArMUYtpQDH0SAgV1Y0oXt+wU=; b=NTd9xyGqa+ZC9rn/Pw7X58RgNL7buM9DqaZ3TRSY4s+VXt0ZSNR6JeTLXFtPFXm/NZ nammyuOXH4uI9ys3HZn1tSnWajA4Q38q9zWjyVNlohWMjPE3KyUJL5yafJiPy3Rn9slb IenkLGkHVcHwsATAdFzMeE8itIWjBtEExznaGYB6bqbz2/jLrNAbFbRqUThhbL9/AzYs pBQamL2S7l6rV97RHZ3lp/9Ko/MTJ1BE80fwu4jHf/2pCZ13GFFibJyAtL0WdUujXPiU K1cRy03h+7y8W27k8j07MJpApDxopk15lJQo+NpPKW3gDs7YSwt6UKnOMNmjDVpWqwgo Qu4A== X-Gm-Message-State: ALoCoQlHu6gMQBEfRvaKZAzskeX+7pDIqub/IfQoCXz0DqQhZS4LjoRjfWnbfTe1fzIiZaGz6MtO X-Received: by 10.194.221.65 with SMTP id qc1mr917753wjc.7.1424917775954; Wed, 25 Feb 2015 18:29:35 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.104 with SMTP id ln8ls817110lac.94.gmail; Wed, 25 Feb 2015 18:29:35 -0800 (PST) X-Received: by 10.112.36.69 with SMTP id o5mr5483314lbj.59.1424917775717; Wed, 25 Feb 2015 18:29:35 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id mj4si16539700lbb.174.2015.02.25.18.29.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 18:29:35 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbdu14 with SMTP id u14so7987891lbd.1 for ; Wed, 25 Feb 2015 18:29:35 -0800 (PST) X-Received: by 10.112.162.167 with SMTP id yb7mr5306060lbb.76.1424917775406; Wed, 25 Feb 2015 18:29:35 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3016285lbj; Wed, 25 Feb 2015 18:29:34 -0800 (PST) X-Received: by 10.70.42.47 with SMTP id k15mr10849356pdl.134.1424917773705; Wed, 25 Feb 2015 18:29:33 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id h10si3450969pat.194.2015.02.25.18.29.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 18:29:33 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQoBD-0007fg-LF; Thu, 26 Feb 2015 02:27:59 +0000 Received: from mail-qa0-f43.google.com ([209.85.216.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YQoB5-0007ZR-TU for linux-arm-kernel@lists.infradead.org; Thu, 26 Feb 2015 02:27:52 +0000 Received: by mail-qa0-f43.google.com with SMTP id bm13so5853679qab.2 for ; Wed, 25 Feb 2015 18:27:29 -0800 (PST) X-Received: by 10.140.91.131 with SMTP id z3mr13037557qgd.1.1424917649850; Wed, 25 Feb 2015 18:27:29 -0800 (PST) Received: from [192.168.1.167] (cpe-67-247-86-207.rochester.res.rr.com. [67.247.86.207]) by mx.google.com with ESMTPSA id q5sm15217943qai.47.2015.02.25.18.27.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 18:27:29 -0800 (PST) Message-ID: <54EE848F.5060009@linaro.org> Date: Wed, 25 Feb 2015 21:27:27 -0500 From: Jorge Ramirez-Ortiz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Russell King - ARM Linux Subject: Re: [PATCH v3] drivers/tty: amba: defer probing DMA availability until hw_init References: <1424910661-26474-1-git-send-email-jorge.ramirez-ortiz@linaro.org> <20150226005601.GJ8656@n2100.arm.linux.org.uk> In-Reply-To: <20150226005601.GJ8656@n2100.arm.linux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150225_182752_049896_EFDD48CB X-CRM114-Status: GOOD ( 21.33 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.43 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.216.43 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: robh@kernel.org, linux-arm-kernel@lists.infradead.org, arnd@arndb.de, viresh.kumar@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jorge.ramirez-ortiz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 On 02/25/2015 07:56 PM, Russell King - ARM Linux wrote: > On Wed, Feb 25, 2015 at 07:31:01PM -0500, Jorge Ramirez-Ortiz wrote: >> @@ -275,9 +277,16 @@ static void pl011_dma_probe_initcall(struct device *dev, struct uart_amba_port * >> struct dma_chan *chan; >> dma_cap_mask_t mask; >> >> - chan = dma_request_slave_channel(dev, "tx"); >> + uap->dma_probed = true; >> + >> + chan = dma_request_slave_channel_reason(dev, "tx"); >> + if (IS_ERR(chan)) { >> + if (PTR_ERR(chan) == -EPROBE_DEFER) { >> + dev_warn(uap->port.dev, "DMA driver not ready\n"); >> + return; >> + } >> + dev_info(uap->port.dev, "no OF or ACPI DMA data\n"); > So if we get an -EPROBE_DEFER, we never try again, because uap->dma_probed > is left true? Yes that is the idea: the DMA is expected to be ready at that time (when user requires access to the uart for the first time) We wont see any degradation with respect to the previous version of the driver (the previous version was a single attempt to probe the DMA on a device_initcall - before even deferred probing had a chance to begin). hw_init also gets called during resume and allowing that probe would have been unnecessary. As well as removing the comment you mentioned I realized that the following is needed. if (!plat || !plat->dma_filter) { @@ -2208,7 +2207,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id) if (ret) { amba_ports[i] = NULL; uart_unregister_driver(&amba_reg); - pl011_dma_remove(uap); } return ret; > > Should we even emit a message here? What if userspace opens and closes > the device multiple times before the DMA driver is ready? If the DMA is not ready when the user wants to use the UART for the first time then we give up on attempting to associate a DMA to that uart. I dont think the tty is available to userland before deferred probes have been handled anyway? And open/closing the tty will not cause further attempts to probe and therefore the message will not be displayed. > > Please get rid of that "no OF or ACPI DMA data" message. There are > situations where we have a DMA engine, but there is quite legally no > DMA available on the port. Such a message would be an annoyance. > DMA is optional. yes since the DMA is optional I left it as an info message (not an error) I put it there in case there was a problem in the device tree strings that define the DMA to use. But I guess it can become annoying even if it is only shown once. OK I'll take it out. > diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 3501ccc..486d510 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -285,7 +285,6 @@ static void pl011_dma_probe(struct device *dev, struct uart_amba_port *uap) dev_warn(uap->port.dev, "DMA driver not ready\n"); return; } - dev_info(uap->port.dev, "no OF or ACPI DMA data\n"); /* We need platform data */