Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4082029ybi; Mon, 3 Jun 2019 05:30:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjE2LoNWDzYRhGWA1DRTnIAz7+bGQizS2PKK4pDhHvQMfPiagEevEFFePbP66eRKicIC24 X-Received: by 2002:a17:902:9a46:: with SMTP id x6mr11236362plv.283.1559565030525; Mon, 03 Jun 2019 05:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559565030; cv=none; d=google.com; s=arc-20160816; b=fixZ5Y4Cuy16d0t92lH7EoZE1rnnge2dktF0AFMQ1TOGH9vVjPk4UySJgXBHnKqDR9 eMtXMc95MGyKy+GPNPgHEWQ0w/wU6S/9ugL80wZw1RjOQ8Tb+aE0+C79eQn+Ai0UrP9V QMIUk0STHjGPv7x5gc7Po2q53APZdMrpA2v59j8voWHKmHrEwdruWAg/pGKkhdecndIY vsjLNsroO7QytFE9ZQ0HTJSX6ou89sPQXd1f+xbYFG2gN33P2WAC/HF2/oAjQj7XKJEy jyVMcqdnRQqjd9vOrYrsRpZv5Yqg0Q5GatUoKVwXcvtHA6o/2SAGp5qArss81uEwDygL k4HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yXflYNFMzfrbOLe6pahxtIn31MuDtfAleNwCi2Cjdmw=; b=HRUmvqB5PpUbzsM/It25fFe9Fa4XO3QfSs/sqoY5a5soOciNle8U40O+sgM2bahHcc j3ARnqYEqBRtp6oL6g4iDzked83HvjifmpIe31Vd9PvzR0zulUVEfhl1EVXhNHiStOlJ rh2imhPEmPKIhPne/3wACYLTM74n4Z0WSrnq8E/k3HxVAs0sLbBvsrcHqtHEwZAzb6ub g9O0pXUYjt7xr51s3O5lry8WxUj4ZEtuu8Y6dmiBGpKS9aP8sxSxvjT3vSwLIDGudHho adg9go1aXP8F5M/+N6Bxf3w5o0I8CDcTwlvSYcqMF6tGcxqN9hpFL9gsKKdmoCQRLto2 D5Cg== 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 l6si1492404pgq.332.2019.06.03.05.30.11; Mon, 03 Jun 2019 05:30:30 -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 S1727110AbfFCM0M (ORCPT + 99 others); Mon, 3 Jun 2019 08:26:12 -0400 Received: from static.187.34.201.195.clients.your-server.de ([195.201.34.187]:51190 "EHLO sysam.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727008AbfFCM0L (ORCPT ); Mon, 3 Jun 2019 08:26:11 -0400 Received: from localhost (localhost [127.0.0.1]) by sysam.it (Postfix) with ESMTP id EAFA53FE8A; Mon, 3 Jun 2019 14:26:09 +0200 (CEST) Received: from sysam.it ([127.0.0.1]) by localhost (mail.sysam.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4GK9oelX-c2g; Mon, 3 Jun 2019 14:26:09 +0200 (CEST) Received: from jerusalem (host64-211-dynamic.48-82-r.retail.telecomitalia.it [82.48.211.64]) by sysam.it (Postfix) with ESMTPSA id 708F83ED96; Mon, 3 Jun 2019 14:26:09 +0200 (CEST) Date: Mon, 3 Jun 2019 14:26:08 +0200 From: Angelo Dureghello To: Geert Uytterhoeven Cc: Greg Ungerer , Logan Gunthorpe , Arnd Bergmann , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] m68k: io: Fix io{read,write}{16,32}be() for Coldfire peripherals Message-ID: <20190603122608.GA21347@jerusalem> References: <20190429081937.7544-1-geert@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190429081937.7544-1-geert@linux-m68k.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Greg (and all), 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 ? Regards, Angelo 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 >