From patchwork Fri May 18 17:42:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10411741 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 8FBB7601F9 for ; Fri, 18 May 2018 17:40:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80EA2289F7 for ; Fri, 18 May 2018 17:40:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 755E8289EA; Fri, 18 May 2018 17:40:46 +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 EB4E3289EA for ; Fri, 18 May 2018 17:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752106AbeERRkp (ORCPT ); Fri, 18 May 2018 13:40:45 -0400 Received: from mga07.intel.com ([134.134.136.100]:41933 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751924AbeERRkp (ORCPT ); Fri, 18 May 2018 13:40:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 May 2018 10:40:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,415,1520924400"; d="scan'208";a="200554942" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by orsmga004.jf.intel.com with ESMTP; 18 May 2018 10:40:43 -0700 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 Subject: [PATCH blktests] Fix block/011 to not use sysfs for device disabling Date: Fri, 18 May 2018 11:42:47 -0600 Message-Id: <20180518174247.31098-1-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 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 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