Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3109420yba; Sat, 11 May 2019 04:04:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3hfrF0jamoLjB7nNKT25o3PGzb1/fjgS4UkuH3toZEnr5Ui8zhDfbbC8re4EJTF44cRUR X-Received: by 2002:a17:902:2a2b:: with SMTP id i40mr19224631plb.170.1557572653801; Sat, 11 May 2019 04:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557572653; cv=none; d=google.com; s=arc-20160816; b=IlCpPtDmxVd86Alu5M7qSLDVhDh9ghfWWTfV9w9mC//kxvQ3/5bQ6OwjYye4YrWOu3 6F1bbqfkBgpG6q/KggClvBqCsB2syC1ogi0wX+I4JcKRE0yMBt+ESJuYBtBgYs3gStri 2AbM0xMY1SFZjmH/zGkK0ruqm16tuUO29hz6PN/h2NS2CcbcZ9/tTCtQfBEDbRdwEU+c ZsyZAbsVP89xd0UGgO+x+XOzIAACo1DwZIN8+Hn4Mb/i31eNa2KDPz6OH2jIr+wVomx3 H45N0RtIuNkoUWtQ1LT9WnQoSxebAHoAGzan8Qt2zdlD/RQ0mEw8nSYMHHHRoY7DXigg QKpg== 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=eDqgTE+C0Z12iQyCQNb0dufeI4FOxVJjHy+aq4BHqWk=; b=ByTQ3L6v7jh1kuYK4yeSBgC9SbKm9A8jgATUh3hhnxbYuQkSTCDGbdpt1eY3ko8M2+ cmXbz2+JdI6J/5fj3phwteaxqGQhMsr8ZalkM1eGzZqFsriC0pKG1MjB7NQZ8Xx83tBk URlsFL3RE0YkrcYwwaJcdXsdxLD7CVppOhSyv2eLLfxvndRWwIeqMmI2JzKtbVw0XklF 9bPSu+WrtwXO9R3ZsvWF4Z6+BCW7MVoX4XJqaKD/cSlG3SzAoP2RxaiT/0++4FL0EcHv LJ/qub1FBLApsUWVxSeOtMRpXcwXLKBWES3SeOLGQqAjYnPZBSLEEHazV6hFyfgRxvrU 6dlg== 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 t10si10931048pgv.533.2019.05.11.04.03.56; Sat, 11 May 2019 04:04: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 S1728541AbfEKLBk (ORCPT + 99 others); Sat, 11 May 2019 07:01:40 -0400 Received: from static.187.34.201.195.clients.your-server.de ([195.201.34.187]:34684 "EHLO sysam.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728512AbfEKLBj (ORCPT ); Sat, 11 May 2019 07:01:39 -0400 Received: from localhost (localhost [127.0.0.1]) by sysam.it (Postfix) with ESMTP id 0821B3FE9A; Sat, 11 May 2019 12:55:41 +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 Jqyj6kYSd3xh; Sat, 11 May 2019 12:55:40 +0200 (CEST) Received: from jerusalem (host87-8-dynamic.4-87-r.retail.telecomitalia.it [87.4.8.87]) by sysam.it (Postfix) with ESMTPSA id 6C8FF3FBE6; Sat, 11 May 2019 12:55:40 +0200 (CEST) Date: Sat, 11 May 2019 12:55:39 +0200 From: Angelo Dureghello To: Arnd Bergmann Cc: Geert Uytterhoeven , Greg Ungerer , Logan Gunthorpe , linux-m68k , Linux Kernel Mailing List Subject: Re: [PATCH] m68k: io: Fix io{read,write}{16,32}be() for Coldfire peripherals Message-ID: <20190511105539.GA20920@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: 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, On Mon, Apr 29, 2019 at 02:39:47PM +0200, Arnd Bergmann wrote: > On Mon, Apr 29, 2019 at 10:19 AM 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 > > This looks correct to me, but there are two points that stick out to me: > > - why do you only do this for mmio and not for pio? > - why do you even use the generic_iomap wrappers rather than > the trivial asm-generic versions of those functions? > > Arnd At least i applied it and it works properly, dspi / dma drivers are back working. Thanks, Regards Angelo