From patchwork Mon Jun 4 22:51:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10447409 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 8A35C60284 for ; Mon, 4 Jun 2018 22:49:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69D3F293E9 for ; Mon, 4 Jun 2018 22:49:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48E65293F8; Mon, 4 Jun 2018 22:49:04 +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 E261B293E9 for ; Mon, 4 Jun 2018 22:49:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbeFDWtD (ORCPT ); Mon, 4 Jun 2018 18:49:03 -0400 Received: from mga14.intel.com ([192.55.52.115]:38503 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751227AbeFDWtC (ORCPT ); Mon, 4 Jun 2018 18:49:02 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jun 2018 15:49:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,477,1520924400"; d="scan'208";a="46738110" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by orsmga008.jf.intel.com with ESMTP; 04 Jun 2018 15:49:01 -0700 From: Keith Busch To: Omar Sandoval , linux-block@vger.kernel.org Cc: Johannes Thumshirn , Keith Busch Subject: [blktests PATCHv2] Fix block/011 to not use sysfs for device disabling Date: Mon, 4 Jun 2018 16:51:41 -0600 Message-Id: <20180604225141.8950-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. Signed-off-by: Keith Busch Reviewed-by: Jens Axboe --- v1 -> v2: Toggling only PCI Command Register BME bit, rather than including MEM. tests/block/011 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/block/011 b/tests/block/011 index 62e89f7..2461442 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 Bus Master Enabling while kill -0 $! 2>/dev/null; do - echo 0 > "/sys/bus/pci/devices/${pdev}/enable" + setpci -s "${pdev}" 4.w=0:4 sleep .2 - echo 1 > "/sys/bus/pci/devices/${pdev}/enable" + setpci -s "${pdev}" 4.w=4:4 sleep .2 done