From patchwork Mon May 21 06:37:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Zhang X-Patchwork-Id: 10414015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78F586032B for ; Mon, 21 May 2018 06:37:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68A1B28782 for ; Mon, 21 May 2018 06:37:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D2FA2878F; Mon, 21 May 2018 06:37:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A998428782 for ; Mon, 21 May 2018 06:37:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750948AbeEUGh5 (ORCPT ); Mon, 21 May 2018 02:37:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60178 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750944AbeEUGh5 (ORCPT ); Mon, 21 May 2018 02:37:57 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 1D8B830B9F5F; Mon, 21 May 2018 06:37:57 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 026E060930; Mon, 21 May 2018 06:37:57 +0000 (UTC) Received: from zmail25.collab.prod.int.phx2.redhat.com (zmail25.collab.prod.int.phx2.redhat.com [10.5.83.31]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A7D204BB78; Mon, 21 May 2018 06:37:56 +0000 (UTC) Date: Mon, 21 May 2018 02:37:56 -0400 (EDT) From: Yi Zhang To: Keith Busch Cc: Omar Sandoval , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, Johannes Thumshirn , Christoph Hellwig , Jens Axboe , Ming Lei Message-ID: <1352065975.3088816.1526884676038.JavaMail.zimbra@redhat.com> In-Reply-To: <20180518174247.31098-1-keith.busch@intel.com> References: <20180518174247.31098-1-keith.busch@intel.com> Subject: Re: [PATCH blktests] Fix block/011 to not use sysfs for device disabling MIME-Version: 1.0 X-Originating-IP: [10.68.5.20, 10.4.195.14] Thread-Topic: Fix block/011 to not use sysfs for device disabling Thread-Index: 27TvJov9dFQ12W2IWeDHP5GJRQl4/w== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 21 May 2018 06:37:57 +0000 (UTC) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Keith I tried this patch on my R730 Server, but it lead to system hang after setpci, could you help check it, thanks. Console log: storageqe-62 login: Kernel 4.17.0-rc5 on an x86_64 storageqe-62 login: [ 1058.118258] {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 3 [ 1058.118261] {1}[Hardware Error]: event severity: fatal [ 1058.118262] {1}[Hardware Error]: Error 0, type: fatal [ 1058.118265] {1}[Hardware Error]: section_type: PCIe error [ 1058.118266] {1}[Hardware Error]: port_type: 0, PCIe end point [ 1058.118267] {1}[Hardware Error]: version: 1.16 [ 1058.118269] {1}[Hardware Error]: command: 0x0400, status: 0x0010 [ 1058.118270] {1}[Hardware Error]: device_id: 0000:85:00.0 [ 1058.118271] {1}[Hardware Error]: slot: 0 [ 1058.118271] {1}[Hardware Error]: secondary_bus: 0x00 [ 1058.118273] {1}[Hardware Error]: vendor_id: 0x144d, device_id: 0xa821 [ 1058.118274] {1}[Hardware Error]: class_code: 020801 [ 1058.118275] Kernel panic - not syncing: Fatal hardware error! [ 1058.118301] Kernel Offset: 0x14800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) Best Regards, Yi Zhang ----- Original Message ----- From: "Keith Busch" To: "Omar Sandoval" , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org Cc: "Johannes Thumshirn" , "Christoph Hellwig" , "Jens Axboe" , "Ming Lei" , "Keith Busch" Sent: Saturday, May 19, 2018 1:42:47 AM Subject: [PATCH blktests] Fix block/011 to not use sysfs for device disabling The PCI sysfs interface may not be a dependable method for toggling the PCI device state to trigger the timeouts. This patch goes directly to the config space to make device failure occur. The success of this test is still senstive to timing, as it may disable IO memory when a driver is trying to bring it online. This can look like a permanent device failure from the driver's perspective. Signed-off-by: Keith Busch --- tests/block/011 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/block/011 b/tests/block/011 index 62e89f7..2fc0ffb 100755 --- a/tests/block/011 +++ b/tests/block/011 @@ -21,7 +21,7 @@ DESCRIPTION="disable PCI device while doing I/O" TIMED=1 requires() { - _have_fio + _have_fio && _have_program setpci } device_requires() { @@ -43,10 +43,11 @@ test_device() { _run_fio_rand_io --filename="$TEST_DEV" --size="$size" \ --ignore_error=EIO,ENXIO,ENODEV & + # toggle PCI Command Register's Memory and Bus Master enabling while kill -0 $! 2>/dev/null; do - echo 0 > "/sys/bus/pci/devices/${pdev}/enable" + setpci -s "${pdev}" 4.w=0:6 sleep .2 - echo 1 > "/sys/bus/pci/devices/${pdev}/enable" + setpci -s "${pdev}" 4.w=6:6 sleep .2 done