From patchwork Thu May 7 10:53:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 1285118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-rtc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=anZNqEsO; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Hr1N0WsBz9sSG for ; Thu, 7 May 2020 20:54:00 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725969AbgEGKx4 (ORCPT ); Thu, 7 May 2020 06:53:56 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:20202 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbgEGKxz (ORCPT ); Thu, 7 May 2020 06:53:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588848834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=34zgbFJkoC2oaoVh2WD7e5/FT5aa6aZRg4OtM6t+uxY=; b=anZNqEsOJl//vsdomy5zRgwZ7g3e6L5MkH2yBvhLB4wRDKvosc0ZWnuDtC5KpCAL17PTIC QkbkNx1+ef6fi/jHcjaPa+ofj8//dm/UJ1A18vwV/6yI++UIG+jYA1z0qsXMcDS/fPitPG P8mZYXcwVO4ELmzlck20wUbRR7K+j7E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-487-HZKKHflJPdCyQKWPtil7qw-1; Thu, 07 May 2020 06:53:51 -0400 X-MC-Unique: HZKKHflJPdCyQKWPtil7qw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9E5A1EC1A7; Thu, 7 May 2020 10:53:49 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74532707BD; Thu, 7 May 2020 10:53:49 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 047Arnm7018869; Thu, 7 May 2020 06:53:49 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 047ArmHU018860; Thu, 7 May 2020 06:53:48 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Thu, 7 May 2020 06:53:48 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Greg Kroah-Hartman cc: Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , alpha , linux-serial@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH 1/2 v3] alpha: add a delay to inb_p, inb_w and inb_l In-Reply-To: <20200507082007.GD1024567@kroah.com> Message-ID: References: <20200507082007.GD1024567@kroah.com> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org alpha: add a delay to inb_p, inb_w and inb_l The patch 92d7223a74235054f2aa7227d207d9c57f84dca0 ("alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering #2") broke boot on the Alpha Avanti platform. The patch changes timing between accesses to the ISA bus, in particular, it reduces the time between "write" access and a subsequent "read" access. This causes lock-up when accessing the real time clock and serial ports. This patch fixes the real time clock by adding a small delay to the inb_p, inw_p and inl_p macros. Note that we don't have to add a delay before outb_p, outw_p and outl_p, because there is already a "mb()" instruction before them and this instruction slows down access sufficiently. Signed-off-by: Mikulas Patocka Fixes: 92d7223a7423 ("alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering #2") Cc: stable@vger.kernel.org # v4.17+ --- arch/alpha/include/asm/io.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) Index: linux-stable/arch/alpha/include/asm/io.h =================================================================== --- linux-stable.orig/arch/alpha/include/asm/io.h 2020-05-07 09:54:52.000000000 +0200 +++ linux-stable/arch/alpha/include/asm/io.h 2020-05-07 09:54:52.000000000 +0200 @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -481,9 +482,9 @@ extern inline void writeq(u64 b, volatil #define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p)) #define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p)) -#define inb_p inb -#define inw_p inw -#define inl_p inl +#define inb_p(x) (ndelay(1400), inb(x)) +#define inw_p(x) (ndelay(1400), inw(x)) +#define inl_p(x) (ndelay(1400), inl(x)) #define outb_p outb #define outw_p outw #define outl_p outl