Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5204782imb; Thu, 7 Mar 2019 10:00:44 -0800 (PST) X-Google-Smtp-Source: APXvYqztOQJPhL6BvgMuhoiUgtudl+jw+cX2t4BeQGwRXQIk+2oCZaGMxmtZk9+dppztNMNrw+82 X-Received: by 2002:a63:c64c:: with SMTP id x12mr12562798pgg.285.1551981644179; Thu, 07 Mar 2019 10:00:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551981644; cv=none; d=google.com; s=arc-20160816; b=kggkT75hOpP5gW4Cm2yycyCce01hgAf4x8iy6Vd5v264nRGNxQOZGKCS/T+JkvUxbX Fl1zLsm4zfoHrv+/GpYnYypb5MQjeh5My9zIm57yaU1LPdZGJWVICd0+3g5GbtLFUzMe kNMEyLrvVVK2wn0brv8vViEWtj4R7SA1dx6vtGKtGWAiNTeh3YHSLJUZBmwKSiLadGbo BAyTi3ELFNqWM+OoneibJWBTWAKg0In1OT//Jy1FKszHKzxyRIPL3hQJ+2aJa/zkFQoK JVl44gF5lD5kUkvC+cG7VNm93hsMIfPGqvM3D2VHHF+6fu6jfMIqNkHPcepbKg8ttpSB 5bqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=0aMpefmPSGw7CA8eN+8MBMUMIEHV7ErRT6/NQMEbSm0=; b=YyExedICNTO/eWirW38Scld4mKvIKlzM/Y7c/zwNQdJY9r1/viZpWZCcDr8c2agIGx Elq7izzdSbqzcnksCsgx24Mt0xMoVVl3v+TaMarBmXAeresSCB5G91IUslwMnHEsyj/D 8JyK3XRtx4rdXFrHMq+j6294vXwDjHH94k4tPMa+leSZ44umH8HQhjp3HOWtHD3xSSLu egG4smUdFlUEFjOnUfuFk+RupHwvXNF9PIkru0L7aiNLn5rtL1U0qU7yvF3eE3EjCqUp fLjzJm8JzdP2i5MNBDuS/2drBHrL/ccOZ8+I8Tm1e+ER86uvIJjPf77/LEDgZmIgZD4Q qTsw== 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 e5si2703957pgk.150.2019.03.07.10.00.28; Thu, 07 Mar 2019 10:00:44 -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 S1726754AbfCGR7q (ORCPT + 99 others); Thu, 7 Mar 2019 12:59:46 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:58056 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbfCGR7p (ORCPT ); Thu, 7 Mar 2019 12:59:45 -0500 Received: (from localhost user: 'macro', uid#1010) by eddie.linux-mips.org with ESMTP id S23992362AbfCGR7mRY61K (ORCPT + 1 other); Thu, 7 Mar 2019 18:59:42 +0100 Date: Thu, 7 Mar 2019 17:59:42 +0000 (GMT) From: "Maciej W. Rozycki" To: Alexandre Oliva 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 In-Reply-To: Message-ID: References: <20190208083038.GA1433@localhost.localdomain> <20190211125506.GA21280@localhost.localdomain> <20190211230614.GB22242@darkstar.musicnaut.iki.fi> <20190217235951.GA20700@darkstar.musicnaut.iki.fi> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexandre, I'm away on holiday and also connectivity is so-so here, so just a quick reply. > > 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). Thanks for looking into it. > 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) So this seems backwards to me, port I/O is supposed to be strongly ordered, so if removing the ordering guarantee "fixes" your problem, then there must be a second bottom here. Offhand either there is a race condition somewhere which the lack of ordering here covers somehow, or there is a silicon erratum of some sort somewhere that the SYNC instruction triggers. A further investigation is required I'm afraid. Does your platform use `war_io_reorder_wmb'? Maciej