From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760012AbdACR2L (ORCPT ); Tue, 3 Jan 2017 12:28:11 -0500 Received: from smtp.domeneshop.no ([194.63.252.55]:37547 "EHLO smtp.domeneshop.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752975AbdACR1V (ORCPT ); Tue, 3 Jan 2017 12:27:21 -0500 Subject: Re: [PATCH v2 3/6] staging: fbtft: fallback to usual allocation when DMA fails To: Andy Shevchenko , Greg Kroah-Hartman , devel@driverdev.osuosl.org, Thomas Petazzoni , linux-kernel@vger.kernel.org References: <20170102113534.127692-1-andriy.shevchenko@linux.intel.com> <20170102113534.127692-4-andriy.shevchenko@linux.intel.com> <1483459942.9552.215.camel@linux.intel.com> From: =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= Message-ID: Date: Tue, 3 Jan 2017 18:23:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1483459942.9552.215.camel@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Den 03.01.2017 17:12, skrev Andy Shevchenko: > On Mon, 2017-01-02 at 13:35 +0200, Andy Shevchenko wrote: >> Fall back to usual allocation method if DMA coherent allocation fails. >> >> SPI framework will map and use DMA mapped memory when possible. > Locally I have re-done DMA approach and thus this patch became optional. > > Should I leave or remove it? Opinions? If we use kmalloc always, then this goes away. >> Signed-off-by: Andy Shevchenko >> --- >> drivers/staging/fbtft/fbtft-core.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/staging/fbtft/fbtft-core.c >> b/drivers/staging/fbtft/fbtft-core.c >> index 226be8c09768..9f024986aff4 100644 >> --- a/drivers/staging/fbtft/fbtft-core.c >> +++ b/drivers/staging/fbtft/fbtft-core.c >> @@ -843,7 +843,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct >> fbtft_display *display, >> if (dma) { >> txbuf = dmam_alloc_coherent(dev, txbuflen, >> &par->txbuf.dma, >> GFP_DMA); >> - } else >> + } >> + if (!txbuf) >> #endif >> { >> txbuf = devm_kzalloc(par->info->device,