From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753678AbcFOVy1 (ORCPT ); Wed, 15 Jun 2016 17:54:27 -0400 Received: from ale.deltatee.com ([207.54.116.67]:42954 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161028AbcFOVyY (ORCPT ); Wed, 15 Jun 2016 17:54:24 -0400 To: Allen Hubbe , "'Jon Mason'" , "'Dave Jiang'" References: <007901d1c74f$dcdab6c0$96902440$@emc.com> Cc: "'Shuah Khan'" , "'Sudip Mukherjee'" , "'Arnd Bergmann'" , linux-kernel@vger.kernel.org, linux-ntb@googlegroups.com, linux-kselftest@vger.kernel.org From: Logan Gunthorpe Message-ID: <5761CE79.8090703@deltatee.com> Date: Wed, 15 Jun 2016 15:54:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 MIME-Version: 1.0 In-Reply-To: <007901d1c74f$dcdab6c0$96902440$@emc.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.111 X-SA-Exim-Rcpt-To: linux-kselftest@vger.kernel.org, linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, shuahkh@osg.samsung.com, dave.jiang@intel.com, jdmason@kudzu.us, Allen.Hubbe@emc.com X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH v3 09/10] ntb_test: Add a selftest script for the NTB subsystem X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/06/16 03:49 PM, Allen Hubbe wrote: >> +function link_test() >> +{ >> + LOC=$1 >> + REM=$2 >> + EXP=0 >> + >> + echo "Running link tests on: $(basename $LOC) / $(basename $REM)" >> + >> + write_file "N" "$LOC/link" >> + write_file "N" "$LOC/link_event" > > If it fails to bring down the link, won't it just block waiting on link_event and never make it to the next step of the test? > >> + if [[ $(read_file "$REM/link") != "N" ]]; then >> + echo "Expected remote link to be down in $REM/link" >&2 >> + exit -1 >> + fi >> + >> + write_file "Y" "$LOC/link" >> + write_file "Y" "$LOC/link_event" >> + >> + echo " Passed" >> +} Well, the test is really intended to ensure both sides of the link see changes to the link status. If the driver is somehow buggy and the link never goes down/up when requested there's little I can do here except block forever. Unless we want to add a timeout to the link_event file (which I'd rather not). You'd have the same issue if, when bringing the link up for the first time, the link does not come back. Logan