All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yi Zhang <yi.zhang@redhat.com>
To: Keith Busch <keith.busch@intel.com>
Cc: Omar Sandoval <osandov@osandov.com>,
	linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	Johannes Thumshirn <jthumshirn@suse.de>,
	Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Ming Lei <ming.lei@redhat.com>
Subject: Re: [PATCH blktests] Fix block/011 to not use sysfs for device disabling
Date: Mon, 21 May 2018 02:37:56 -0400 (EDT)	[thread overview]
Message-ID: <1352065975.3088816.1526884676038.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180518174247.31098-1-keith.busch@intel.com>

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" <keith.busch@intel.com>
To: "Omar Sandoval" <osandov@osandov.com>, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org
Cc: "Johannes Thumshirn" <jthumshirn@suse.de>, "Christoph Hellwig" <hch@lst.de>, "Jens Axboe" <axboe@kernel.dk>, "Ming Lei" <ming.lei@redhat.com>, "Keith Busch" <keith.busch@intel.com>
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 <keith.busch@intel.com>
---
 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
 
-- 
2.14.3

WARNING: multiple messages have this Message-ID (diff)
From: yi.zhang@redhat.com (Yi Zhang)
Subject: [PATCH blktests] Fix block/011 to not use sysfs for device disabling
Date: Mon, 21 May 2018 02:37:56 -0400 (EDT)	[thread overview]
Message-ID: <1352065975.3088816.1526884676038.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20180518174247.31098-1-keith.busch@intel.com>

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" <keith.busch@intel.com>
To: "Omar Sandoval" <osandov at osandov.com>, linux-block at vger.kernel.org, linux-nvme at lists.infradead.org
Cc: "Johannes Thumshirn" <jthumshirn at suse.de>, "Christoph Hellwig" <hch at lst.de>, "Jens Axboe" <axboe at kernel.dk>, "Ming Lei" <ming.lei at redhat.com>, "Keith Busch" <keith.busch at intel.com>
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 <keith.busch at intel.com>
---
 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
 
-- 
2.14.3

  parent reply	other threads:[~2018-05-21  6:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 17:42 [PATCH blktests] Fix block/011 to not use sysfs for device disabling Keith Busch
2018-05-18 17:42 ` Keith Busch
2018-05-19 11:58 ` Ming Lei
2018-05-19 11:58   ` Ming Lei
2018-05-21  6:37 ` Yi Zhang [this message]
2018-05-21  6:37   ` Yi Zhang
2018-05-21 14:08   ` Keith Busch
2018-05-21 14:08     ` Keith Busch
2018-05-29 19:54     ` Omar Sandoval
2018-05-29 19:54       ` Omar Sandoval
2018-06-04 19:38       ` Keith Busch
2018-06-04 19:38         ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1352065975.3088816.1526884676038.JavaMail.zimbra@redhat.com \
    --to=yi.zhang@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=jthumshirn@suse.de \
    --cc=keith.busch@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=ming.lei@redhat.com \
    --cc=osandov@osandov.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.