From patchwork Wed Nov 30 19:28:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9454725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B5C2F60585 for ; Wed, 30 Nov 2016 19:30:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A569A2849A for ; Wed, 30 Nov 2016 19:30:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A6FC2849D; Wed, 30 Nov 2016 19:30:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37B3B2849A for ; Wed, 30 Nov 2016 19:30:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758022AbcK3TaV (ORCPT ); Wed, 30 Nov 2016 14:30:21 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34605 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756778AbcK3T3k (ORCPT ); Wed, 30 Nov 2016 14:29:40 -0500 Received: by mail-wm0-f68.google.com with SMTP id g23so30940651wme.1 for ; Wed, 30 Nov 2016 11:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=rH6KhhxGL8AUjpdqZQPe9HPzS9GaR4/3uKhZzcir4zM=; b=rzVmoNqZJoUFWN8cms8K4kskDZMtDUDBzVOX+r5I/hbz6PdB9wbWacBhZ4/AxZySKu RxLs1j2maDYJlFEqzf1j+TeZAeMA+tkM4QzqKPgWQ9BEjP7W6+/HXesyMyibUokUnNST yaFXZDITLGrf1HX7pgc93OBwXKfNrn3LiYRzdNupb5BFLk65zoqDvp8m93F8DgXjeqHO AwXOpaZ76bXuhgFGnP4kdn4cgUtzICOdic1TdhpUPUcokWcm1ayQj0p0LssknG2oCR20 rhv38u33Q+zhG7XxWV4HcOP22grwuAwLKUygImsV7k0FEERPQoiv2DswGdgtEPvjZ0lj qBMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=rH6KhhxGL8AUjpdqZQPe9HPzS9GaR4/3uKhZzcir4zM=; b=B2X4TERC9+wb+5wz/hLL8flysGTCq8uwVanT+I89hWZAV38i3XH3EGNxHtS7+nMup9 cIKEKNM7aTdLwa3S8lXoGfBxMn93e7rZKAcxFAiimovfmTpNOmsG9C8cwwrStmMSXDe+ WKHRhmTFUGyNs5g4iilQjAh6bBdsGyeh6JXbicZZ97nRK4OReZ+wV/2lH+xwE5HycZbs MnhkVPAhXvhV9C6/LDwv7mzjOr3tZOCH6hhHxQ1RIPyRFu08iOgWfQ60r/mDR8+EuXgF 24MaOjBxOx3GIztc36K+oMoHyxFubs4GXyJFuUCTRajAnW1Lzst/xtAgaT8en7AT5lbf pcPA== X-Gm-Message-State: AKaTC03LXadUjmW9NMO0JwG0rQ0A+tLtE7AETeuGRSLyRrhGGerIX0r1HFuQm8LewjU8HA== X-Received: by 10.28.149.135 with SMTP id x129mr31604099wmd.71.1480534178830; Wed, 30 Nov 2016 11:29:38 -0800 (PST) Received: from ?IPv6:2003:62:5f0a:4a00:99f1:4509:4837:fc30? (p200300625F0A4A0099F145094837FC30.dip0.t-ipconnect.de. [2003:62:5f0a:4a00:99f1:4509:4837:fc30]) by smtp.googlemail.com with ESMTPSA id dj5sm74529092wjb.34.2016.11.30.11.29.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 11:29:38 -0800 (PST) To: Mark Brown Cc: "linux-spi@vger.kernel.org" From: Heiner Kallweit Subject: [PATCH] spi: fsl-espi: fix ioread16/iowrite16 endianness Message-ID: <39487a5a-e899-5998-431b-ee21e5f3fe6c@gmail.com> Date: Wed, 30 Nov 2016 20:28:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP fsl_espi_read_reg16 / fsl_espi_write_reg16 are supposed to read / write big endian values. Therefore ioread16be / iowrite16be have to be used. Fixes: 058234328445 ("eliminate need for linearization when writing to hardware") Signed-off-by: Heiner Kallweit --- drivers/spi/spi-fsl-espi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index cd28329..1d332e2 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -124,7 +124,7 @@ static inline u32 fsl_espi_read_reg(struct fsl_espi *espi, int offset) static inline u16 fsl_espi_read_reg16(struct fsl_espi *espi, int offset) { - return ioread16(espi->reg_base + offset); + return ioread16be(espi->reg_base + offset); } static inline u8 fsl_espi_read_reg8(struct fsl_espi *espi, int offset) @@ -141,7 +141,7 @@ static inline void fsl_espi_write_reg(struct fsl_espi *espi, int offset, static inline void fsl_espi_write_reg16(struct fsl_espi *espi, int offset, u16 val) { - iowrite16(val, espi->reg_base + offset); + iowrite16be(val, espi->reg_base + offset); } static inline void fsl_espi_write_reg8(struct fsl_espi *espi, int offset,