From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761007Ab3DBJMp (ORCPT ); Tue, 2 Apr 2013 05:12:45 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:40539 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760247Ab3DBJMn (ORCPT ); Tue, 2 Apr 2013 05:12:43 -0400 X-AuditID: cbfee691-b7f5f6d000002fda-b2-515aa1096aa3 Date: Tue, 02 Apr 2013 09:12:41 +0000 (GMT) From: PADMAVATHI VENNA Subject: Re: Re: [PATCH 2/2] dma: pl330: Use the generic of_dma_xlate_by_chan_id To: Lars-Peter Clausen Cc: Vinod Koul , Dan Williams , Jon Hunter , "linux-kernel@vger.kernel.org" Reply-to: padma.v@samsung.com MIME-version: 1.0 X-MTR: 20130402085025468@padma.v Msgkey: 20130402085025468@padma.v X-EPLocale: en_US.windows-1252 X-Priority: 3 X-EPWebmail-Msg-Type: personal X-EPWebmail-Reply-Demand: 0 X-EPApproval-Locale: X-EPHeader: ML X-EPTrCode: X-EPTrName: X-MLAttribute: X-RootMTR: 20130402085025468@padma.v X-ParentMTR: X-ArchiveUser: X-CPGSPASS: N Content-type: text/plain; charset=windows-1252 MIME-version: 1.0 Message-id: <26789240.182151364893959039.JavaMail.weblogic@epv6ml02> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphleLIzCtJLcpLzFFi42JZI2JSpcu5MCrQ4O5zMYvLu+awOTB6fN4k F8AYxWWTkpqTWZZapG+XwJWx731qwTetin9ftrM2MD7R7GLk5BASUJI4da6dHcSWEDCRWLhm DROELSZx4d56ti5GLqCapYwSH/6tYoMp2vvtGSNEYj6jxPElR4ESHBwsAioS6+YKgtSwCehK /DvzH2yosECAxNQzl8FsEQEtiRuNbcwgNrPAGkaJv6dKII6Qlfj1bwlYnFdAUOLkzCcsELsU JKbPvcUCEVeUaL3SwQgRl5NYMvUy1KG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kji+awonqLA8h2kVhxSXoCo9wsJJlZSLpn IelGVrOAkWUVo2hqQXJBcVJ6haFecWJucWleul5yfu4mRnBierZwB+OX89aHGAU4GJV4eB3m RAYKsSaWFVfmHmKU4GBWEuHdqhsVKMSbklhZlVqUH19UmpNafIgxGRh9E5mlRJPzgUkzryTe 0NjE3NTY1MLA0NzcjDRhJXHep63WgUIC6YklqdmpqQWpRTBbmDg4pRoYOzXzXs8P23I6UPjB jKIiH54XBspLDTv49iw/wNHOM0O7l+H4g6VXRZVTMoV6bHO69v1LKff68zQkdGvyBMeHNYlM XrvmJ+y1/8GZve8KQ6jxEa4Pam8rlkTP+fh6nvEUzqU/u7wqf315/2TPv69rfx/xW/RZ3zfw rjUPi/CerE1qDzPdDi+KU2Ipzkg01GIuKk4EAHCu70SQAwAA DLP-Filter: Pass X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id r329D4Yv016490 Hi Lars, ------- Original Message ------- Sender : Lars-Peter Clausen Date : Apr 02, 2013 16:33 (GMT+09:00) Title : Re: [PATCH 2/2] dma: pl330: Use the generic of_dma_xlate_by_chan_id On 04/02/2013 08:27 AM, PADMAVATHI VENNA wrote: > > Hi, > ------- Original Message ------- > Sender : Lars-Peter Clausen > Date : Mar 25, 2013 22:16 (GMT+09:00) > Title : [PATCH 2/2] dma: pl330: Use the generic of_dma_xlate_by_chan_id > > Use the generic of_dma_xlate_by_chan_id xlate callback instead of a custom > implementation. > > There is one minor difference between the generic of_dma_xlate_by_chan_id > function and the pl330 specific one. of_dma_xlate_by_chan_id only sets the > DMA_SLAVE capability for the channel capability mask, while the pl330 driver > additionally sets the DMA_CYCLIC capability. But since all pl330 channels which > have the DMA_SLAVE capability set also have DMA_CYCLIC capability set both > functions will have the same result. > > I am not clear about the dma capabilities. Is it mentioned some where that if we set DMA_SLAVE capability > will that also set DMA_CYCLIC capability? > Well DMA_SLAVE won't automatically set DMA_CYCLIC. But the driver sets both. I tested your patches, it's woking for audio. But I need some clarification related to capabilities. As per my understanding, controller driver registers the available capabilities in the probe and client drivers requests for a particular capability. In both the cases, in the dmaengine it checks if the requested capability is satisfied. If we don't set the DMA_CYCLIC, how __dma_device_satisfies_mask works? Please correct me if I am wrong. Thanks Padma - Lars > Signed-off-by: Lars-Peter Clausen > --- > drivers/dma/pl330.c | 41 +---------------------------------------- > 1 file changed, 1 insertion(+), 40 deletions(-) > > diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > index 345e2a1..ea48de7 100644 > --- a/drivers/dma/pl330.c > +++ b/drivers/dma/pl330.c > @@ -608,11 +608,6 @@ struct dma_pl330_desc { > struct dma_pl330_chan *pchan; > }; > > -struct dma_pl330_filter_args { > - struct dma_pl330_dmac *pdmac; > - unsigned int chan_id; > -}; > - > static inline void _callback(struct pl330_req *r, enum pl330_op_err err) > { > if (r && r->xfer_cb) > @@ -2358,16 +2353,6 @@ static void dma_pl330_rqcb(void *token, enum pl330_op_err err) > tasklet_schedule(&pch->task); > } > > -static bool pl330_dt_filter(struct dma_chan *chan, void *param) > -{ > - struct dma_pl330_filter_args *fargs = param; > - > - if (chan->device != &fargs->pdmac->ddma) > - return false; > - > - return (chan->chan_id == fargs->chan_id); > -} > - > bool pl330_filter(struct dma_chan *chan, void *param) > { > u8 *peri_id; > @@ -2380,30 +2365,6 @@ bool pl330_filter(struct dma_chan *chan, void *param) > } > EXPORT_SYMBOL(pl330_filter); > > -static struct dma_chan *of_dma_pl330_xlate(struct of_phandle_args *dma_spec, > - struct of_dma *ofdma) > -{ > - int count = dma_spec->args_count; > - struct dma_pl330_dmac *pdmac = ofdma->of_dma_data; > - struct dma_pl330_filter_args fargs; > - dma_cap_mask_t cap; > - > - if (!pdmac) > - return NULL; > - > - if (count != 1) > - return NULL; > - > - fargs.pdmac = pdmac; > - fargs.chan_id = dma_spec->args[0]; > - > - dma_cap_zero(cap); > - dma_cap_set(DMA_SLAVE, cap); > - dma_cap_set(DMA_CYCLIC, cap); > - > - return dma_request_channel(cap, pl330_dt_filter, &fargs); > -} > - > static int pl330_alloc_chan_resources(struct dma_chan *chan) > { > struct dma_pl330_chan *pch = to_pchan(chan); > @@ -2996,7 +2957,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) > pi->pcfg.num_peri, pi->pcfg.num_events); > > ret = of_dma_controller_register(adev->dev.of_node, > - of_dma_pl330_xlate, pdmac); > + of_dma_xlate_by_chan_id, pd); > if (ret) { > dev_err(&adev->dev, > "unable to register DMA to the generic DT DMA helpers\n");{.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I