Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2954350ybi; Mon, 17 Jun 2019 13:26:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOI0zEJzXfvVA/WstRcOPo9pb4ZCV4m8+SDMGtPpMCYGLKJFd/3tsyRiiWlPKB38zc+PYh X-Received: by 2002:a17:902:4501:: with SMTP id m1mr24203810pld.111.1560803162313; Mon, 17 Jun 2019 13:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560803162; cv=none; d=google.com; s=arc-20160816; b=giFzAfeF1/Cnb7zS1hmsIGy58CMI/O548tP8/pD0zha8KV3oX+kileH5+9dVO/ZxV3 IAptZmwcCW5IkbCap9J4j7XonquK6zhKKeZvYUNQ6OqxpOHUrtJzwtBI6jT+jyJgCOci YuzbPcroEDkqV2atzqDJXPds1Lf4LKPwm0HqXNkrjGXaQ6zFdMF5Zqfy53J3HuuB+hbe 4V/skWbOMP1MtE4fRxM4w5IsY9LHETWnfEmdkAaY4/1JO0bvVEIBxx4tpN6hpT0GX91t G/JdBXiI2qQ9HNnSbX77CuzFc9a6r9BGM6wJ7mFykEvXUS5mv8ydMUcjHUxk8DfSzohV y8ZQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=OTnKI6AONp2M6nYNHFX4V8oCj6lrhQxYE54Q15KoFro=; b=BaSlW7ZXPq2hbEe8P74eq9ncch01o3FuxaRj6iLcyltEUbv/aFTcBe2Pr+3osStuff /55t+9GS71CLB833DLym7itXgvyWQtfutBGH+HpnCI2EPI2ZRFFo4/UDF/w+Fj4aaNSG AApWSBTMgXGtBQWXvGdbB1pQP27SpkLuxy+gwBoAuBPgZrvnsWU89/nM8CK0UD9PbrQd ap+YjFIjNPq9tj6DmZKBTgG4YzTdYAct9kdmXUicrvCa+Jh5FCgTGD3+GrvdSZMB2xaN fgnxM8mKLyB49rG0bgv5VHNDcusfv2uKDl8Cc56Ew4ufAfhcevF0SpMOEZCxZ5nMS2pM zS2Q== 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 1si11026846pli.151.2019.06.17.13.25.47; Mon, 17 Jun 2019 13:26:02 -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 S1728282AbfFQUYE convert rfc822-to-8bit (ORCPT + 99 others); Mon, 17 Jun 2019 16:24:04 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39264 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728281AbfFQUYD (ORCPT ); Mon, 17 Jun 2019 16:24:03 -0400 Received: by mail-qt1-f195.google.com with SMTP id i34so7160447qta.6 for ; Mon, 17 Jun 2019 13:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=4pItfmIF9BXCq+5fMpkHMPOAjCwD9tKzbQC2ATbU3XA=; b=NNmMi9dYNpbgAUl/sXeJ5oaRAJfcToxpwvJT3AltTCAwbY4b6TMX1M5GGqlRQbpFmc 4UmosDyW8DCdZyUJakhKT35s6SFNOQtlCvDko/VVG/5r1UxsM9F/1waefNlNxDfuoi4R A/eAVcH5/5aCmezqDJW3UZRwNBtpeUXHMfkwVTO3p0HEoKbio1DxulnRI8228Euo44Vf OVirOymxBx7URTvXltn4t1wtIFK8XPzhj99bW4MFppFdJct4Y2WudhodGYJSgxtqhqHw HZ//DFZwUWGrvtuNqTffN7gQc5PfoR+aLR5Kd0+l/Mv5wg1TagRH9+l4bPinipSuAmdo ASgA== X-Gm-Message-State: APjAAAU5GCMeXve6NgYYwbBY5a+yKTc4oq5Bw8uzIE2lOY6ph/xf92wc wMxVOLRdRKVbtSWiTkQfYHYIFFWnLRV2djbpaMMnXZ2x3+U= X-Received: by 2002:ac8:3485:: with SMTP id w5mr18860691qtb.142.1560803042716; Mon, 17 Jun 2019 13:24:02 -0700 (PDT) MIME-Version: 1.0 References: <20190429081937.7544-1-geert@linux-m68k.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 17 Jun 2019 22:23:45 +0200 Message-ID: Subject: Re: [PATCH] m68k: io: Fix io{read,write}{16,32}be() for Coldfire peripherals To: Geert Uytterhoeven Cc: Greg Ungerer , Angelo Dureghello , Logan Gunthorpe , linux-m68k , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 14, 2019 at 4:52 PM Geert Uytterhoeven wrote: > On Mon, Apr 29, 2019 at 2:40 PM Arnd Bergmann wrote: > > On Mon, Apr 29, 2019 at 10:19 AM Geert Uytterhoeven > > 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? > > Because no one had a need for it? ;-) > > Now seriously, m68k only has MMIO, no PIO. Any PIO, if used, is for ISA or > PCMCIA I/O accesses, which are little endian. I suppose the majority of PIO operations are single-byte only, so endianess doesn't apply at all ;-). You are certainly right that big-endian PIO access has close to zero uses in the kernel (I could not find any either). If you don't have ISA or PCMCIA devices, then using the trivial readl/writel based wrappers is clearly the easiest way. If you do have PIO based devices, then defining pio_read16be etc would save a few bytes in lib/iomap.c. > > - why do you even use the generic_iomap wrappers rather than > > the trivial asm-generic versions of those functions? > > Looking at git history, that was done to fix some link errors, which no > longer seem to happen with the more mature asm-generic infrastructure we > have now. > > So probably we can drop the selection of GENERIC_IOMAP and inclusion > of , after fixing a few compiler warnings like: > > include/asm-generic/io.h: In function ‘ioread8_rep’ > arch/m68k/include/asm/io_mm.h:371:44: warning: passing argument 1 > of ‘raw_insb’ discard ‘const’ qualifier from pointer target type > [-Wdiscarded-qualifiers] > #define readsb(port, buf, nr) raw_insb((port), (u8 *)(buf), (nr)) > arch/m68k/include/asm/raw_io.h:101:50: note: expected ‘volatile u8 > *’ {aka ‘volatile unsigned char *’} but argument is of type ‘const > volatile void *’ > static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, > unsigned int len) Those should just be missing 'volatile' and 'const' modifiers on the arguments. Arnd