Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5442608imu; Wed, 26 Dec 2018 03:03:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/UGQAoXFzKx5gAjBEokSgXDhibbC8BBo1vDhxMg96gALEYoNYXHB2kTd4uvNd3JgO3++AHI X-Received: by 2002:a62:9419:: with SMTP id m25mr20627011pfe.147.1545822222948; Wed, 26 Dec 2018 03:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545822222; cv=none; d=google.com; s=arc-20160816; b=gcmc+ulDE4XvDjI7ZL1FwF1EvXzSGsUszyY3iqLKAlj+vHPlsqXCNXFtQzQrX2Qzu0 gdoqQMS5N/ImGgGoJ5O8ZaqZaR+8ceVv6vVP257YTMqaLVyo3gu5retK/fvsHi9wYFHr ByxYERMB9zb4LtJxFYOVz/d+GLHyBlk2aAsjsrFbHbbjDDLgIKhpTuGx8q4cvE9ADKGQ I5MpP36wfbvQusDm7CFSJtwob1qJhAlbRz5ynyU5SUltqSXIvqMf+I4zYwGlg+hCSXxU 0NIXFLGK2/jaTd8AtoMF/ovnk8vYGGit5+TAipB1spCiGZv2qVh6P2kITsCxLcLyQrAY supA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Qcag0Qb+7FYCUH9vL/KEFIGNJxMSwQbgiDpwA4m6ezI=; b=wYm+bUcjTswG6SJCxJYYIgkeogBKNhGFbtLAeImc/VtPJzkQ2qbMYEWQEJq2SOnBWa 6pLwP+lR2XCjiWOGiTZvqSeIRW2cpzDUIgNyk4LeYGcPPus+EB673GXZOvZ2HKKK/WqM L/E211kiQRXNYQZM3lpEQUXXfSp6IxrGf66ZX7XGdy1+N0Y87w4h7oReFj1j6m7DXlpv AmdRDNijmyDJpWHncE7kNOIPgRpMJsZndsEy+4ERkpWsCZPZghXu0M3+S5FUDvHcJfWQ tzBNLKNOkQ5WndcW10GbP/17u/kRJpOhPB8cDyPR/ZuV7wARTOri0QNQoTHiwssqUrTm SLkA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si31313853pgr.133.2018.12.26.03.03.27; Wed, 26 Dec 2018 03:03:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbeLZKTF (ORCPT + 99 others); Wed, 26 Dec 2018 05:19:05 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:61831 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726172AbeLZKTF (ORCPT ); Wed, 26 Dec 2018 05:19:05 -0500 X-UUID: 15faf0724f9f490aae9a4cd03de26b4b-20181226 X-UUID: 15faf0724f9f490aae9a4cd03de26b4b-20181226 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 454183028; Wed, 26 Dec 2018 18:18:57 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 26 Dec 2018 18:18:56 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 26 Dec 2018 18:18:54 +0800 Message-ID: <1545819534.28871.93.camel@mhfsdcap03> Subject: Re: [PATCH v7 1/2] dmaengine: 8250_mtk_dma: add MediaTek uart DMA support From: Long Cheng To: Nicolas Boichat CC: Vinod Koul , Randy Dunlap , "Rob Herring" , Mark Rutland , "Ryder Lee" , Sean Wang , "Matthias Brugger" , Dan Williams , Greg Kroah-Hartman , Jiri Slaby , Sean Wang , , , "linux-arm Mailing List" , , lkml , , , Yingjoe Chen , YT Shen , Zhenbao Liu Date: Wed, 26 Dec 2018 18:18:54 +0800 In-Reply-To: References: <1545701209-6884-1-git-send-email-long.cheng@mediatek.com> <1545701209-6884-2-git-send-email-long.cheng@mediatek.com> <1545739611.28871.77.camel@mhfsdcap03> <1545806121.28871.88.camel@mhfsdcap03> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-12-26 at 17:28 +0800, Nicolas Boichat wrote: ...... > > > > > > +static int mtk_uart_apdma_device_pause(struct dma_chan *chan) > > > > > > +{ > > > > > > + /* just for check caps pass */ > > > > > > + return 0; > > > > > > +} > > > > > > + > > > > > > +static int mtk_uart_apdma_device_resume(struct dma_chan *chan) > > > > > > +{ > > > > > > + /* just for check caps pass */ > > > > > > + return 0; > > > > > > +} > > > > > > Why do you need these? Seems wrong to advertise device_pause/resume > > > (and the caps) if we don't actually support that? > > > > > > > in serial 8250_dma.c file, when request DMA, will calll > > 'dma_get_slave_caps' to get the caps. and the will check caps.cmd_pause. > > the pause is device_pause. our device can't support the functions. but > > to check pass, need add the fake function. or you can give better > > comments. thanks. > > Well, then I guess this is a hack... I'm not too familiar with > 8250_dma.c, but I guess that if it requires pause/resume to be > implemented, then we should implement them, not just stub them out... > > Is this something that can be implemented with 8250_mtk DMA? > the HW can't support it. > Also, I don't see where you need resume, so maybe implementing pause is enough? > yes. pause is enough. for symmetry, add resume function. anyway, the pause function need to keep. > > > > > > + > > > > > > +static void mtk_uart_apdma_free(struct mtk_uart_apdmadev *mtkd) > > > > > > +{ > > > > > > + while (list_empty(&mtkd->ddev.channels) == 0) { > > > > > > + struct mtk_chan *c = list_first_entry(&mtkd->ddev.channels, > > > > > > + struct mtk_chan, vc.chan.device_node); > > > > > > + > > > > > > + list_del(&c->vc.chan.device_node); > > > > > > + tasklet_kill(&c->vc.task); > > > > > > + } > > > > > > +} > > > > > > + > > > > > > +static const struct of_device_id mtk_uart_apdma_match[] = { > > > > > > + { .compatible = "mediatek,mt6577-uart-dma", }, > > > > > > + { /* sentinel */ }, > > > > > > +}; > > > > > > +MODULE_DEVICE_TABLE(of, mtk_uart_apdma_match); > > > > > > + > > > > > > +static int mtk_uart_apdma_probe(struct platform_device *pdev) > > > > > > +{ > > > > > > + struct mtk_uart_apdmadev *mtkd; > > > > > > + struct resource *res; > > > > > > + struct mtk_chan *c; > > > > > > + unsigned int i; > > > > > > + int rc; > > > > > > + ......