Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3029629imj; Mon, 11 Feb 2019 12:35:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IZtqRn3fy8gKIBoM0Aot22yZpiQo5NlNzTU9v+jDhebqy2EuCJcoGrKt+etSv9KN9799Zpn X-Received: by 2002:a62:1b03:: with SMTP id b3mr94324pfb.218.1549917319784; Mon, 11 Feb 2019 12:35:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917319; cv=none; d=google.com; s=arc-20160816; b=wkgZRgyNug6ZDZsRBNdxAg4GsFCx+Fpr3LgHQAbGJo7tUW9jC1rh4StQZnIl7iZUO2 gDatDO3j/GOko9jP3H38pVDfRlM3C/cFCKUTBfg9+cQc5+9vJxlGseWQe7fQ5AMO6oST mTUR9YH7WM1DA+cSfY/8c75IK982kmFLGe1SHxx4HKjQavMofpQ3wWc8qpwZeobqlPol IS2+vmycrvoQkp9/gWMJs4ibT1QxOS0cCX+9aeKQkk9MjK5+JE3zfdy34rPvkw6J+pcE +j90wDuPBMBdtXF57/y95ZVBtk0AiXv9LbuTT61NFn4RDW59B746hIW1M2vGCPkTYEvv mDYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=f8lgXyDyzxDO6suoziSGaXJWyasyFHhhuq7mQMbnoJY=; b=tNz2sBMOe62gpeY9pBMu3TfpV5WuX9nGZ5ZKQCcKMnRSHby3+3D0sJHUjYp+c4j1rl tiauqre5X2X6BA0NyamGTMG0BCIShT7a1aExgMLgG8+0gIooclPFOZH8D3pE1IHdtv48 nypJOv2XIWC7viO73RX7k7cA1/rivnVeCyD3toQRzlg2iNVxAW/zj2saPsOAlS4IXcwg S12JSvMT4Tz8GWPsYaqJ8rnd//YH3/wC6BFW+yUzSAobUdhUwGDZQJP+Xbg/w6s59Dge r6CEqRudigX13BvsSkxRuDcmTcwiXKBp9G7RZAds4A5UcfXqVsZUumAAHWBIOzUb7AKT lcyg== 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 n24si10183637pgv.119.2019.02.11.12.35.02; Mon, 11 Feb 2019 12:35:19 -0800 (PST) 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 S1730975AbfBKRpw (ORCPT + 99 others); Mon, 11 Feb 2019 12:45:52 -0500 Received: from foss.arm.com ([217.140.101.70]:54876 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730177AbfBKRpw (ORCPT ); Mon, 11 Feb 2019 12:45:52 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C63F15AD; Mon, 11 Feb 2019 09:45:51 -0800 (PST) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 684783F675; Mon, 11 Feb 2019 09:45:50 -0800 (PST) From: Will Deacon To: linux-arch@vger.kernel.org Cc: linux-kernel@vger.kernel.org, andrew.murray@arm.com, arnd@arndb.de, catalin.marinas@arm.com, Will Deacon Subject: [PATCH 1/2] asm-generic/io: Pass result on inX() accessor to __io_par() Date: Mon, 11 Feb 2019 17:45:43 +0000 Message-Id: <20190211174544.4302-2-will.deacon@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190211174544.4302-1-will.deacon@arm.com> References: <20190211174544.4302-1-will.deacon@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The inX() I/O accessors must enforce ordering against subsequent calls to the delay() routines, so that a read-back from a device can be used to postpone a subsequent write to the same device. On some architectures, including arm64, this ordering can only be achieved by creating a dependency on the value returned by the inX() operation, so we need to pass the value we read to the __io_par() macro in this case. Reported-by: Andrew Murray Signed-off-by: Will Deacon --- include/asm-generic/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index d356f802945a..b5737c0d8316 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -65,7 +65,7 @@ #endif #ifndef __io_par -#define __io_par() __io_ar() +#define __io_par(v) __io_ar() #endif @@ -471,7 +471,7 @@ static inline u8 inb(unsigned long addr) __io_pbr(); val = __raw_readb(PCI_IOBASE + addr); - __io_par(); + __io_par(val); return val; } #endif @@ -484,7 +484,7 @@ static inline u16 inw(unsigned long addr) __io_pbr(); val = __le16_to_cpu(__raw_readw(PCI_IOBASE + addr)); - __io_par(); + __io_par(val); return val; } #endif @@ -497,7 +497,7 @@ static inline u32 inl(unsigned long addr) __io_pbr(); val = __le32_to_cpu(__raw_readl(PCI_IOBASE + addr)); - __io_par(); + __io_par(val); return val; } #endif -- 2.11.0