From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58DBAC00140 for ; Sun, 31 Jul 2022 15:57:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237396AbiGaP5h (ORCPT ); Sun, 31 Jul 2022 11:57:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237055AbiGaP5f (ORCPT ); Sun, 31 Jul 2022 11:57:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 912E6F5BA; Sun, 31 Jul 2022 08:57:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3E24FB80D11; Sun, 31 Jul 2022 15:57:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFD80C433D6; Sun, 31 Jul 2022 15:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659283052; bh=2Tx7WBqhR2Aw42eMMqAo9G23wcNrK9di5KicstE97W4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tu2gRR8nkLaFIIEVG8liBcMmpIp3NlfGh2b8dbTQyYAWqoMse+dXCSPHZHr18zBiQ K0QabxkX02DYH6WKACwm2S/jd69B4F/AUv3CtMeiNf9+w+1csTKmSHqZDd+4fSSpuV Lk2PD+cwfN3Bfm8oOpBITASE337s+P8810LEWKAlpi66ttHAGETrdufnl/xxMh7cHd 9iSZ4Fjy/6Knest+GnFCr5MMiPs2hIahquQSsRW2USroVc6+gO1cgKR4bnHvz2pHwZ dLdiWw2z3Dshq5FFMFRws5ScI432UTYhstKIAPutTliVcFxMnXcpmql5Qg4q9PgCLb 7sLC3a0QhYbIQ== Date: Sun, 31 Jul 2022 17:07:43 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: Angel Iglesias , linux-iio , Lars-Peter Clausen , Paul Cercueil , Ulf Hansson , "Rafael J. Wysocki" , Linux Kernel Mailing List Subject: Re: [PATCH v4 3/5] iio: pressure: bmp280: Fix alignment for DMA safety Message-ID: <20220731170743.238e0e8c@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Mon, 25 Jul 2022 23:08:47 +0200 Andy Shevchenko wrote: > On Sat, Jul 23, 2022 at 7:40 PM Angel Iglesias wrote: > > > > Adds a DMA-safe buffer to driver data struct to store raw data from sensor > > > > Updated calibration read functions to use DMA-safe buffers as well. > > In this case, as calibration data is only read at sensor initialization, > > the buffers are allocated with kmalloc and freed after being processed. > > > Suggested-by: Jonathan Cameron > > Jonathan, maybe it's easier to fix in regmap once for all (something > like a new flag there dma_safe)? Also a side note: i2c doesn't need > that, since it has its own implementation. Possibly... Not something I want to tie up with an individual driver though as it might take a while and be (somewhat) controversial. Nice idea though as, if a bounce buffer is needed for a particular regmap operation it can implement one and when not, it can elide that step and just use the provided buffer directly. Jonathan > > P.S. Use sizeof() in regmap calls where it's appropriate. >