Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755350AbdIGLo0 (ORCPT ); Thu, 7 Sep 2017 07:44:26 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33407 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754796AbdIGLoY (ORCPT ); Thu, 7 Sep 2017 07:44:24 -0400 X-Google-Smtp-Source: ADKCNb6TjazCqjEzkY7wtygo4HmDO0XVUBOCdRtJ2EJFJ/27H1J5WsL2RksIBYUDhwrh2Q3/sX5OcfMkV6+oYy4RXDw= MIME-Version: 1.0 In-Reply-To: <20170907133756.6c1f02f6@bbrezillon> References: <20170906214502.26748-1-cyrille.pitchen@wedev4u.fr> <20170907133756.6c1f02f6@bbrezillon> From: Geert Uytterhoeven Date: Thu, 7 Sep 2017 13:44:22 +0200 X-Google-Sender-Auth: arSl0EteUyoqArwozea9ptn0_hE Message-ID: Subject: Re: [PATCH] mtd: spi-nor: fix DMA unsafe buffer issue in spi_nor_read_sfdp() To: Boris Brezillon Cc: Cyrille Pitchen , Marek Vasut , MTD Maling List , Brian Norris , David Woodhouse , Richard Weinberger , "linux-kernel@vger.kernel.org" , Linux-Renesas , Mark Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1072 Lines: 31 Hi Boris, On Thu, Sep 7, 2017 at 1:37 PM, Boris Brezillon wrote: > On Thu, 7 Sep 2017 10:00:50 +0200 > Geert Uytterhoeven wrote: >> Instead of having buffers on the stack, passing them around through multiple >> call levels, and then kmalloc()ing a buffer, what about using the helpers in >> instead, which take care of the issue through the >> static bounce >> buffer or kmalloc() themselves? > > Are you referring to spi_write_then_read()? If this is the case, I'm not For example. There are more of them. > sure we can use this because m25p80_read/write() can have more than 2 > transfers. OK.More than two transfers may need special handling. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds