Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5070289ybi; Tue, 4 Jun 2019 00:21:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwChDqiuYz8fGVbQJw5EwN4kF/XHgb3HYbFM9LFZsBlZyJj5bYGIV4L8L/GXvjKfZ3Y9k35 X-Received: by 2002:a17:90a:aa88:: with SMTP id l8mr35110895pjq.65.1559632873062; Tue, 04 Jun 2019 00:21:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559632873; cv=none; d=google.com; s=arc-20160816; b=XrRdGUsEcMn6YpcQNOVq0/XAE0stTgXKaOWruzQc0x9CBRxIrulR9OuQ0natfFhQvF PlJ72lgLg7DHdcIxXBaNXsI4FQb4l1kVL8g2PBiHB3SdSDnFr5gLzAQXZjeaRG2BpV8P ST1LULbDpw/cPlYr2mBA1lKFXT4V9F9fjh+QMMeDoe5WVtVrdIy438a+Poo4XQgn9q19 FSpdNU81ZWxPln2XIJcILYKdbKdl/kBNw/f/CnpnRPQ6YqDZ7KftzmRPfcJVw3vzdfWK Lu1CMe5XTbE6o+MOJ4etcxNL1LmzEZ/+cuuYRAYYxb/w0HOOVha5hm3HqHV5zAga84oc HM2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MfWunC3G0zVR9PDIrO+VFKrtPiAgLKZXX4Z2QYXSfPw=; b=wQXevjShRMIny7GiiGZREICMHWGK00AOmDw9Ld83IV69kOlsWKhQwOKbW3LzmLFdsJ 88MFCQFABo6/rexek8ai7ktPM8AcCB+5ZFcJ/1kfWFVUcEscOfDZwvekhD5XfDG8379x sYTx3cC2b0i9VIAPfgJSUX78cbXZKwQ8bQyBmtw6OtfWXwDJ/u4NfG80rslrSH1VlnIJ JVohGA+iSCgQuNLVyzG/VkmEYugPGBiRrsTDvX8/G+HG3XeXYct52t16wJA3XNBdRrVt XpjUGVxNVG4yIpdlrw3lOBmwCOp+WGs834HTOxudZUIVjrRhuGnVUeZM1AFnIefDGgKN MyEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s73si24533571pfs.15.2019.06.04.00.20.56; Tue, 04 Jun 2019 00:21:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726883AbfFDHSN (ORCPT + 99 others); Tue, 4 Jun 2019 03:18:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:39648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfFDHSN (ORCPT ); Tue, 4 Jun 2019 03:18:13 -0400 Received: from [10.44.0.22] (unknown [103.48.210.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 582FF24A8F; Tue, 4 Jun 2019 07:18:11 +0000 (UTC) Subject: Re: [PATCH] m68k: io: Fix io{read,write}{16,32}be() for Coldfire peripherals To: Angelo Dureghello , Geert Uytterhoeven Cc: Logan Gunthorpe , Arnd Bergmann , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org References: <20190429081937.7544-1-geert@linux-m68k.org> <20190603122608.GA21347@jerusalem> From: Greg Ungerer Message-ID: Date: Tue, 4 Jun 2019 17:18:08 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190603122608.GA21347@jerusalem> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Angelo, On 3/6/19 10:26 pm, Angelo Dureghello wrote: > couldn't seen any follow up on this patch. I tested it and at least > for mcf5441x it works properly and solves all issues. > > Do you think it may be accepted as an initial fix ? I'll add it to the m68knommu git tree. Seeing as you wrote it Geert I assume you have no problem with that? :-) Regards Greg > On Mon, Apr 29, 2019 at 10:19:37AM +0200, Geert Uytterhoeven wrote: >> The generic definitions of mmio_{read,write}{16,32}be() in lib/iomap.c >> assume that the {read,write}[wl]() I/O accessors always use little >> endian accesses, and swap the result. >> >> However, the Coldfire versions of the {read,write}[wl]() I/O accessors are >> special, in that they use native big endian instead of little endian for >> accesses to the on-SoC peripheral block, thus violating the assumption. >> >> Fix this by providing our own variants, using the raw accessors, >> reinstating the old behavior. This is fine on m68k, as no special >> barriers are needed, and also avoids swapping data twice. >> >> Reported-by: Angelo Dureghello >> Fixes: aecc787c06f4300f ("iomap: Use non-raw io functions for io{read|write}XXbe") >> Signed-off-by: Geert Uytterhoeven >> --- >> This can be reverted later, after this oddity of the Coldfire I/O >> support has been fixed, and drivers have been updated. >> --- >> arch/m68k/include/asm/io.h | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/arch/m68k/include/asm/io.h b/arch/m68k/include/asm/io.h >> index aabe6420ead2a599..d47e7384681ab1cd 100644 >> --- a/arch/m68k/include/asm/io.h >> +++ b/arch/m68k/include/asm/io.h >> @@ -8,6 +8,12 @@ >> #include >> #endif >> >> +#define mmio_read16be(addr) __raw_readw(addr) >> +#define mmio_read32be(addr) __raw_readl(addr) >> + >> +#define mmio_write16be(val, port) __raw_writew((val), (port)) >> +#define mmio_write32be(val, port) __raw_writel((val), (port)) >> + >> #include >> >> #endif /* _M68K_IO_H */ >> -- >> 2.17.1 >> >