Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4742353imb; Wed, 6 Mar 2019 22:44:20 -0800 (PST) X-Google-Smtp-Source: APXvYqxiza09uOUa0PoydMiZxFUt9pyeK9wY5kQn+02go1y9mkXTg0WJH538ZTHBWkMbqnUrg591 X-Received: by 2002:a17:902:ba84:: with SMTP id k4mr11418798pls.103.1551941060696; Wed, 06 Mar 2019 22:44:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551941060; cv=none; d=google.com; s=arc-20160816; b=LqtBipSslxzildTMRTWXo9KLACctDNNl8iPfMQYrYxwrWmSh5GmS46bNd1F2T3EzPs itNfFSZmVBzjPHntQ/atnhMLxvt0ei9m+RIrrrLKJBqMfP9BwvzWa7i6lJodPS9fMeqd FYXqxP33l7Trib+Q4TLsn0t1/SKAnPns2lmX106Zo3i5V3wo2Bh8XwxgOtl5Eld+aus0 v4jEVPRFMjoI2evTQLJxnbJco1hw78XfqBIas0boyTIX0nZpw/3WpTGnGiphZB5qq2Ph /hmdixLk0RmEuOO/2erd+u9a3gJpXPmOW7HgyN3FYkO3nR7rVxYw1hCq/qIRbizyvqPQ aZfw== 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:mime-version :user-agent:message-id:in-reply-to:date:references:organization :subject:cc:to:from; bh=q5PAKCt3uvlo3aZCAenqecF0yaFuP9WkfBfFWV1n5GA=; b=SoFB9/PnH6i4wH0lvTPJYZ8Tff0POdRlGJ6ISOXwuj5vWwvaWczCdmEg/DA5FAFTpq 3CAojMZiejJb12FBG+CSXR+N868EAsaqFbrFP2eItH83+EkE8wD7IPh7CqK3fmyzZ2Nd O95bAapnvfcvQ+PwtjIKvNsQm3dUWPLu7/FAh7ie9UG0h9gzFuHiwJyjalb7Gt/rsQbq cj26HDPxqRoVS52q8GVid9df4MJ80Rhgo52eQ7O+W2MJZj1sK0Fy104xyBaZsKS9c/Ps c7x6YlUiEI1P8cN3LcHTgtoRe5N3ob7pSWCjrb/Ma84o6ZM9zqMGyFWUc36qbjpqQGYg LsXg== 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 s14si3531640plq.284.2019.03.06.22.44.05; Wed, 06 Mar 2019 22:44:20 -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 S1726565AbfCGGl5 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Mar 2019 01:41:57 -0500 Received: from linux-libre.fsfla.org ([209.51.188.54]:37030 "EHLO linux-libre.fsfla.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726342AbfCGGl4 (ORCPT ); Thu, 7 Mar 2019 01:41:56 -0500 Received: from free.home (home.lxoliva.fsfla.org [172.31.160.164]) by linux-libre.fsfla.org (8.15.2/8.15.2/Debian-3) with ESMTP id x276fNH6015146; Thu, 7 Mar 2019 06:41:26 GMT Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTP id x276f1IA321398; Thu, 7 Mar 2019 03:41:04 -0300 From: Alexandre Oliva To: "Maciej W. Rozycki" Cc: Aaro Koskinen , Tom Li , James Hogan , Jiaxun Yang , Huacai Chen , Ralf Baechle , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] On the Current Troubles of Mainlining Loongson Platform Drivers Organization: Free thinker, not speaking for FSF Latin America References: <20190208083038.GA1433@localhost.localdomain> <20190211125506.GA21280@localhost.localdomain> <20190211230614.GB22242@darkstar.musicnaut.iki.fi> <20190217235951.GA20700@darkstar.musicnaut.iki.fi> Date: Thu, 07 Mar 2019 03:41:01 -0300 In-Reply-To: (Maciej W. Rozycki's message of "Mon, 18 Feb 2019 02:41:11 +0000 (GMT)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.84 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Feb 17, 2019, "Maciej W. Rozycki" wrote: > Is there an MMIO completion barrier missing there somewhere by any chance > causing an IRQ that has been handled already to be redelivered because an > MMIO write meant to clear the IRQ at its origin at handler's completion > has not reached its destination before interrupts have been reenabled in > the issuing CPU? Just a thought. I've finally got a chance to bisect the IRQ14 (nobody cared) regression on my yeeloong. It took me to MIPS: Enforce strong ordering for MMIO accessors (commit 3d474dacae72ac0f28228b328cfa953b05484b7f). I've only just started trying to figure out what exactly in the change leads to problems. So far, I've determined that changing both uses of __BUILD_IOPORT_SINGLE so that barrier is passed as 0 rather than 1 removes the undesirable effects, both on top of that patch, and on top of v5.0: #define __BUILD_IOPORT_PFX(bus, bwlq, type) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0,) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0, _p) + __BUILD_IOPORT_SINGLE(bus, bwlq, type, 0, 0,) \ + __BUILD_IOPORT_SINGLE(bus, bwlq, type, 0, 0, _p) Since the barriers didn't seem to be a problem for __BUILD_MEMORY_PFX, I figured I'd try to enable barriers in the __mem_ variants, but leave them alone for io, and that worked (without hitting the IRQ14 issue) at least on the yeeloong: diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 845fbbc7a2e34..0a3a327d4e764 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -467,13 +467,13 @@ BUILDIO_MEM(w, u16) BUILDIO_MEM(l, u32) BUILDIO_MEM(q, u64) -#define __BUILD_IOPORT_PFX(bus, bwlq, type) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0,) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0, _p) +#define __BUILD_IOPORT_PFX(bus, bwlq, type, barrier) \ + __BUILD_IOPORT_SINGLE(bus, bwlq, type, barrier, 0,) \ + __BUILD_IOPORT_SINGLE(bus, bwlq, type, barrier, 0, _p) #define BUILDIO_IOPORT(bwlq, type) \ - __BUILD_IOPORT_PFX(, bwlq, type) \ - __BUILD_IOPORT_PFX(__mem_, bwlq, type) + __BUILD_IOPORT_PFX(, bwlq, type, 0) \ + __BUILD_IOPORT_PFX(__mem_, bwlq, type, 1) BUILDIO_IOPORT(b, u8) BUILDIO_IOPORT(w, u16) -- Alexandre Oliva, freedom fighter https://FSFLA.org/blogs/lxo Be the change, be Free! FSF Latin America board member GNU Toolchain Engineer Free Software Evangelist Hay que enGNUrecerse, pero sin perder la terGNUra jamás-GNUChe