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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 41DCFECAAA1 for ; Fri, 2 Sep 2022 06:47:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pNiPxcHPCDP21kYLjjD70ZMZwRfB4ltKfX3SoGgwkYY=; b=nUGBQyGkkDhiyd beum39b7sRIJpPAWk5DFK51oEMMIUPi5JA8VihsizB4x7vzDau487+cdQSCQ80GHMYgx4dz+j57U1 UgYE3ao4gM5H0pevTWn/yy3ZWoyamQTpbRAA5Giqivn77PXawTi3zCJX8qwmSocx9/SoFzqWpMylp 9/yyyZ38bm9eBQj6I/nJ1S9nT6yeP3OGaBC/QjsvFoMAADkI5Q2lp+2QyG1+29SYAs76XUjGyUaG/ KZSFMCcFDP4Pp6gYFoXZNqzmw9Sue+A96QcGiAJhunTJXUW9+bfHeX320t0OjhbQxF5sLt++gil5K coaQZCRK4PJfxbCft0qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU0R3-000xZt-6d; Fri, 02 Sep 2022 06:45:49 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oU0Qz-000xVR-ID for linux-arm-kernel@lists.infradead.org; Fri, 02 Sep 2022 06:45:47 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id BF88B3200AA1; Fri, 2 Sep 2022 02:45:38 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute2.internal (MEProxy); Fri, 02 Sep 2022 02:45:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1662101138; x=1662187538; bh=bY LZ913Dp4ZRTutrVUDsylQfP4PyGybvm0JPexpAVjU=; b=KhcAMIs2YHep2jlRRO QbkSmQM712fJB4yt/bzEHrtuoD11z0u5pulVP6dXilNhfZnSuN0yn21up9xoFJeA oNNU7CPFVjsx4YCV/ZrmWFfK7UV5XbCxMXbh5wKvhXXzIYYH19SbZjDmx7CkAmBO 5ECaiT0Icm8u3vOuIfTQDi0V2ZPPpQpdkaqOVUteaVX9OBPE0l137igKR5Rv1YbO yadSnbBE0EJG2ExUSE2+J6FLIQfUTqNHyp9QX8QDz84ydDBn3PAHF+lC7JCnLryV PWuj0uk1+A1jJzIwseNkgwrDUDIxpSX8eQTdkL6M5+GoJzbqkI/zr9tpEBdNiM2h oqtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1662101138; x=1662187538; bh=bYLZ913Dp4ZRTutrVUDsylQfP4Py Gybvm0JPexpAVjU=; b=svfbX1bqsJVGSY5/Bt/8cV8k7ubPHmmNcb/gZ+B3BLZp qEjMNoQC2zDfu3h5PLW2Q+SC0XkDu3tuYO/NDdzabemMS4Jz5yBdyXag0o4QhN1N 8pKikiekWrkOTBHZcDKBHfCe3OIcABgAjUbNp+SiL/17EMD4T1opa+y+vr8/XMtR 94JWZsCf1ktYqdtP1+KdsH2oeiwaUNFM+OzxA4WTTmZjlUAx65yvORoy+JW6FlX1 wFpZboyp6bSgI5h8JJHJ8UplFtNFDnD2EPJlIhblWn1Z/yn7vs4lAaTKsLo+6mZa Mar9OwTBv4SekHC+VxeDJTFKn2Q5hl57Jc5jALGdjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdekledgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdfu vhgvnhcurfgvthgvrhdfuceoshhvvghnsehsvhgvnhhpvghtvghrrdguvghvqeenucggtf frrghtthgvrhhnpeelvefggeffheevtdeivefhkeehfeettdejteduveeiheevveeilefg hfeiveeiueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 38E0DA60082; Fri, 2 Sep 2022 02:45:37 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-841-g7899e99a45-fm-20220811.002-g7899e99a Mime-Version: 1.0 Message-Id: <20d82d72-ed8a-458f-bb84-37906bd41bcc@www.fastmail.com> In-Reply-To: References: Date: Fri, 02 Sep 2022 08:45:16 +0200 From: "Sven Peter" To: "Andy Shevchenko" , "Russell King" Cc: "Arnd Bergmann" , "Lee Jones" , "Linus Walleij" , "Alyssa Rosenzweig" , asahi@lists.linux.dev, "Bartosz Golaszewski" , "Hector Martin" , "linux-arm Mailing List" , "open list:GPIO SUBSYSTEM" Subject: Re: [PATCH 4/6] platform/apple: Add new Apple Mac SMC driver X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220901_234545_837977_CE4A337A X-CRM114-Status: GOOD ( 10.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Sep 1, 2022, at 21:26, Andy Shevchenko wrote: > On Thu, Sep 1, 2022 at 5:18 PM Russell King wrote: [...] > > ... > >> + if (size <= 4) >> + memcpy(buf, &rdata, size); >> + else >> + memcpy_fromio(buf, smc->shmem.iomem, size); > > This is unclear why plain memcpy() for the small size and what are the > side effects of the memory. Maybe you wanted memremap() instead of > ioremap() to begin with? rdata is used for small buffers, comes directly as part of a message sent on the underlying hardware FIFO and is on the stack (and thus mapped as as Normal memory) while smc->shmem.iomem has to be Device-nGnRnE. Mapping it with any other attributes will generate SErrors for each access. Sven _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel