Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1735067pxb; Thu, 16 Sep 2021 14:19:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxssf/QvOOZsl4ozPY5otDdzX/bvqnIaWwdy+My3vetOO3k1KXqoA6DQyckKBY4Rk2p+NY6 X-Received: by 2002:a92:de07:: with SMTP id x7mr5485640ilm.239.1631827192158; Thu, 16 Sep 2021 14:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631827192; cv=none; d=google.com; s=arc-20160816; b=i5zKD4dTZPwPQaDq+AyGTFvu7mAJtZI/Mei0ehLdmjgx5jCawy6vHDmMVD54a/ftFm lrDoEkEP+9vQdHKgUT4vlUOE/D7SEOjx+OxpBd1Xotrhxsy0QxdmZPI96iIXcY1wbnCf +vgdbNc+1Blzo1dx7QYFQwO2M1NheESmIBfbwWN1hCQTuKdpKcDeb0ByvctOXppwa8Vf V2GiVsJRN0fcTndZphgGgLOI31Sv/v7o2CVLHS7DVKnnPJ0t9jOcfVwCfT7ozmMe+MIg EL+KI8zo5unNS9jtvtM9kzllQw2Xqee5C1EjYbYa5/RRel8BKtLzUBbIDTxiDTLbsQOb 41+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p7sFw+tYrlzwG+MgOCx3k1yj1LqdNtTWSFLwam7nc98=; b=aNjsbNOhIo7NgXLybVbR0n8f12sHKCnxyjMv9vLYd9yix+MYCem0pr6jiGuN4Xu5xo +kGoundgFzNoB2oQlMGnY/P8mt0Red3UodMkeGmqn/iJkUbamKNI059kgMkKoAIODrpb RkQNngAWwQUGer+5X392/dVklEkHywGM7CR8jxZt5nGYyGfGgzoiaAebLcFj1wl4oP9V vQdzK977LlYMdXDefazdm6wJ0XhrT03stcP0HaWM29hBbX4Hxekm2sm2oQodI/k1C3/L zdFA9mvB6m0E6dlNOR63cBspbOjOaFVW2I2ZCEwTZvy2jAzDlQlfZ33daDWHZNzcVPPH byZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qx0amIbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si3510526ioh.56.2021.09.16.14.19.41; Thu, 16 Sep 2021 14:19:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qx0amIbl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245442AbhIPQk2 (ORCPT + 99 others); Thu, 16 Sep 2021 12:40:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:43876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241708AbhIPQc4 (ORCPT ); Thu, 16 Sep 2021 12:32:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 331D06138B; Thu, 16 Sep 2021 16:20:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809200; bh=4AcssDeN5I9YHKWLjv12UTy87NqFCUmNr+F8o0UQwMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qx0amIblk8dA7fxqbooV1Eoxl5tSU2dFINDhRfX+2/HTfhUkmhU/RQYMAWo9C3in3 XbHa8Dyhra+bqLuxoWSELkLKlQQonKqOZudedThkn4AtXJ7ivcNGBDp7kVMMa3VoR7 9ZxGTTawcJScwyM8/gBVwzpWUUcR1Eh/kaqicTKM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= , Lorenzo Pieralisi , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH 5.13 066/380] PCI: aardvark: Increase polling delay to 1.5s while waiting for PIO response Date: Thu, 16 Sep 2021 17:57:03 +0200 Message-Id: <20210916155806.240738748@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pali Rohár commit 02bcec3ea5591720114f586960490b04b093a09e upstream. Measurements in different conditions showed that aardvark hardware PIO response can take up to 1.44s. Increase wait timeout from 1ms to 1.5s to ensure that we do not miss responses from hardware. After 1.44s hardware returns errors (e.g. Completer abort). The previous two patches fixed checking for PIO status, so now we can use it to also catch errors which are reported by hardware after 1.44s. After applying this patch, kernel can detect and print PIO errors to dmesg: [ 6.879999] advk-pcie d0070000.pcie: Non-posted PIO Response Status: CA, 0xe00 @ 0x100004 [ 6.896436] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100004 [ 6.913049] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100010 [ 6.929663] advk-pcie d0070000.pcie: Non-posted PIO Response Status: CA, 0xe00 @ 0x100010 [ 6.953558] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100014 [ 6.970170] advk-pcie d0070000.pcie: Non-posted PIO Response Status: CA, 0xe00 @ 0x100014 [ 6.994328] advk-pcie d0070000.pcie: Posted PIO Response Status: COMP_ERR, 0x804 @ 0x100004 Without this patch kernel prints only a generic error to dmesg: [ 5.246847] advk-pcie d0070000.pcie: config read/write timed out Link: https://lore.kernel.org/r/20210722144041.12661-3-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Marek Behún Cc: stable@vger.kernel.org # 7fbcb5da811b ("PCI: aardvark: Don't rely on jiffies while holding spinlock") Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/pci-aardvark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/pci/controller/pci-aardvark.c +++ b/drivers/pci/controller/pci-aardvark.c @@ -207,7 +207,7 @@ #define PCIE_CONFIG_WR_TYPE0 0xa #define PCIE_CONFIG_WR_TYPE1 0xb -#define PIO_RETRY_CNT 500 +#define PIO_RETRY_CNT 750000 /* 1.5 s */ #define PIO_RETRY_DELAY 2 /* 2 us*/ #define LINK_WAIT_MAX_RETRIES 10