From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755189AbcAVUpu (ORCPT ); Fri, 22 Jan 2016 15:45:50 -0500 Received: from smtprelay0143.hostedemail.com ([216.40.44.143]:48880 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754010AbcAVUpq (ORCPT ); Fri, 22 Jan 2016 15:45:46 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3872:3873:3874:4250:4321:5007:6261:10004:10400:10848:11026:11232:11473:11658:11783:11914:12043:12048:12296:12438:12517:12519:12740:13069:13138:13231:13255:13311:13357:13894:14659:21080:30003:30054:30064:30083:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: cake94_4f4517e924b5e X-Filterd-Recvd-Size: 2341 Message-ID: <1453495543.13870.39.camel@perches.com> Subject: Re: [PATCH v2] Platform: goldfish: goldfish_pipe.c: Add DMA support using managed version From: Joe Perches To: Shraddha Barke , Greg Kroah-Hartman , Dan Carpenter , linux-kernel@vger.kernel.org Cc: Peter Senna Tschudin , Julia Lawall Date: Fri, 22 Jan 2016 12:45:43 -0800 In-Reply-To: <1453495090-20994-1-git-send-email-shraddha.6596@gmail.com> References: <1453495090-20994-1-git-send-email-shraddha.6596@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.3-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2016-01-23 at 02:08 +0530, Shraddha Barke wrote: > setup_access_params_addr has 2 goals- > > -Initialize the access_params field so that it can be used to send and read > commands from the device in access_with_param > -Get a bus address for the allocated memory to transfer to the device. > > Replace the combination of devm_kzalloc and _pa() with dmam_alloc_coherent. > Coherent mapping guarantees that the device and CPU are in sync. [] > diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c [] > @@ -217,17 +218,17 @@ static int valid_batchbuffer_addr(struct goldfish_pipe_dev *dev, [] > - /* FIXME */ > - paddr = __pa(aps); > - writel((u32)(paddr >> 32), dev->base + PIPE_REG_PARAMS_ADDR_HIGH); > - writel((u32)paddr, dev->base + PIPE_REG_PARAMS_ADDR_LOW); > + writel(upper_32_bits(dma_handle), dev->base + > +        PIPE_REG_PARAMS_ADDR_HIGH); > + writel(lower_32_bits(dma_handle), dev->base + PIPE_REG_PARAMS_ADDR_LOW); If you were going for style points, it would have been nicer to use the same style for each writel writel(upper_32_bits(dma_handle),        dev->base + PIPE_REG_PARAMS_ADDR_HIGH); writel(lower_32_bits(dma_handle),        dev->base + PIPE_REG_PARAMS_ADDR_LOW); or just ignore 80 column limits and use single lines.