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 A140DC433F5 for ; Mon, 23 May 2022 15:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237972AbiEWP26 (ORCPT ); Mon, 23 May 2022 11:28:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237968AbiEWP2z (ORCPT ); Mon, 23 May 2022 11:28:55 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8EDF5EDF7 for ; Mon, 23 May 2022 08:28:49 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id y13so28862580eje.2 for ; Mon, 23 May 2022 08:28:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=malat-biz.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XPtsde4gyVo6IJJ2lowRrIJoC9Wl+ngKLvBmCGRosYU=; b=he+tcNDA7ndcB7CTw1/DbteaPV0BHHiyChBmUWVYsesTwE4FheIylI/Ktcls1XAOlf c3S5t0KEqwBQX9JX4xwIfmleuXXuktbt4EvMIBFVITv7lFRQo4UOVcfh4sYWfMSwx9Pi U2Dez6pyB/M7lY0SPdYD6E202dPvVrynR4EtREr2cRXWjYjShDZHRqFQwkQ451aIjm1g Yj5vbsF95Iiz1OewX+nUFxpPzlIUW6/66w8OnTPgzJ5PEuG+8FETwydWbBNjSzQ3FzWM QBmel4mAnWj99UCYFVXz3muSbptC2IMAtsA0FLB+90gYv5Oqsq65HubkW3/YlLk27+Tn Wvog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XPtsde4gyVo6IJJ2lowRrIJoC9Wl+ngKLvBmCGRosYU=; b=EJpQOshhBFCUp9Ul2DQtazGD9avWOk05SQOu3dmq7RPVdmsmj683GFmUtAK3Sul+CW uxyfbGUWg5oObIXPLxdghphQYe9vLwjLwCkaXB+32tiNPO+qfLQ2J1Z8HfehKUMwXsyb K5xEY+t0qsvFHXY7vuPk7rOeVbWA8P6Ry8utymgTXsY1pwBhLxtkUr9AEJovqFvBRfEt bf3n/xNFrTKfDETH1LFdTkM3EqQkx+1adVRKkrX8hzb1CFstGdSfcf9wa1tFPWklEDSE c7gwmG34/cTvSCXqjXqABCUQJ5LjicVLCt4A2GosIYObjDdJgFW7fk1FPMn5NwYpWB68 oNtQ== X-Gm-Message-State: AOAM5322HwqAZtyzQgNPHWF5HJ4TvyBN9WDI4Nt/BZ0CwRpkSbFu9gfw 66hzG7V4KAKrMbew0zPGShFP6Q== X-Google-Smtp-Source: ABdhPJwrxiEWnwMCc46nqTyw8Rb4U7FGGn9Q/ughz/Boi6eJRPID9+ui33r690dogZXwncyyksQf1g== X-Received: by 2002:a17:907:6d97:b0:6fe:f9e0:c03f with SMTP id sb23-20020a1709076d9700b006fef9e0c03fmr1908505ejc.219.1653319728245; Mon, 23 May 2022 08:28:48 -0700 (PDT) Received: from ntb.petris.klfree.czf ([2a02:8070:d483:ed00:4bcc:154f:5c11:5870]) by smtp.gmail.com with ESMTPSA id b18-20020a056402139200b0042ab87ea713sm8285753edv.22.2022.05.23.08.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 08:28:47 -0700 (PDT) Date: Mon, 23 May 2022 17:27:48 +0200 From: Petr Malat To: David Laight Cc: "linux-mtd@lists.infradead.org" , Joern Engel , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH] mtd: phram: Map RAM using memremap instead of ioremap Message-ID: References: <20220523142825.3144904-1-oss@malat.biz> <3cab9a7f4ed34ca0b742a62c2bdc3bce@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3cab9a7f4ed34ca0b742a62c2bdc3bce@AcuMS.aculab.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Mon, May 23, 2022 at 02:51:41PM +0000, David Laight wrote: > From: Petr Malat > > Sent: 23 May 2022 15:28 > > > > One can't use memcpy on memory obtained by ioremap, because IO memory > > may have different alignment and size access restriction than the system > > memory. Use memremap as phram driver operates on RAM. > > Does that actually help? > The memcpy() is still likely to issue unaligned accesses > that the hardware can't handle. Yes, it solves the issue. Memcpy can cause unaligned access only on platforms, which can handle it. And on ARM64 it's handled only for RAM and not for a device memory (__pgprot(PROT_DEVICE_*)). Petr