Received: by 10.213.65.68 with SMTP id h4csp3912418imn; Tue, 3 Apr 2018 12:56:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+zKB57Es4VkEsu4RvMx8WR0VvhEQ1JJqOBnzXtvRgHGwF13XhLR4hydHVPjm4DqaIbsTgI X-Received: by 10.101.75.12 with SMTP id r12mr9967460pgq.36.1522785390172; Tue, 03 Apr 2018 12:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522785390; cv=none; d=google.com; s=arc-20160816; b=EGDMF3Njh+h/RAxIJoOolLMnE80wFss1z/+3sdeMYVPGmUJo8vAiFLn+14w2W9PXhS 73I/HFQh1hMu//owmHnhcvU/JsqYPFD2hl6t7B9LqJKzN4hZ+Mlhefxn+277fkXXMY/4 y+D4f5QQuc73sAktOFyuFhMn1UOMFdbJ9qQaIRrUJfB4zvexwlh+AF9dfg9WLzgA3vAp 1BkHxeHlp/wY6JHRDyVqG7teAAYNpHE88BAg6HBT8XF3K2rs/9F/JBK8Gq37RNkzS739 4Ni5aDDciXUnPGwM94gKE82yChhj6yJXpsK0sGg5ZvXx7OuIycBnZkwqqfSvtXP9ZJxp vlPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dmarc-filter :arc-authentication-results; bh=DS/9oQxu7CN1pzezgm94w0nwRRmk3ZVCkDuCDjkFO/s=; b=mRKS0VYFY74uIYUUoYUcldlAebpysZmdkM9TC/Zg6sncMKWwDr3Hi/hNBMCXlw9mX9 BKtoxCyzWnpNIkLZi8JwnneJ2H1NU/Arifif5Jx28FZQgNQ3ZB/NWdEI2PQxhyGUr4EA 8DETWJWkjKvcouSkPeStHJ3paIUW8Wai7ACDShtatxGe8MX93l69CHvYzzZI+3tLUkWw EhIF63rjFIl+9ckBUM8LvWfA1gmrmHBVhWn5Ff4JTXr8phxlPKMLLJW1E6Up3DKx5dqK IAu9zwC4dKVLCgOyQKi8MgdUSUkteXy6311ddZvoyihzGIjBZPKtUbra174AXvq3CXkd 6fHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si3600014plm.671.2018.04.03.12.56.16; Tue, 03 Apr 2018 12:56:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753177AbeDCTzK (ORCPT + 99 others); Tue, 3 Apr 2018 15:55:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:40250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752495AbeDCTzJ (ORCPT ); Tue, 3 Apr 2018 15:55:09 -0400 Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 76C422178F; Tue, 3 Apr 2018 19:55:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 76C422178F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mcgrof@kernel.org Received: by mail-it0-f51.google.com with SMTP id m134-v6so24944572itb.3; Tue, 03 Apr 2018 12:55:08 -0700 (PDT) X-Gm-Message-State: ALQs6tDtffB8v1mCNdygAeQWH0lzahArKIbQh1d9NLTAvbbPZvNk466a 65fOAvtojscLGXyMGL8y2/L30MI51fAoRl/j8BE= X-Received: by 2002:a24:bcc4:: with SMTP id n187-v6mr6675570ite.26.1522785307876; Tue, 03 Apr 2018 12:55:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.128.161 with HTTP; Tue, 3 Apr 2018 12:54:46 -0700 (PDT) In-Reply-To: <20180403194849.csgzr3jllt4f2qb7@xylophone.i.decadent.org.uk> References: <20180403194849.csgzr3jllt4f2qb7@xylophone.i.decadent.org.uk> From: "Luis R. Rodriguez" Date: Tue, 3 Apr 2018 12:54:46 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] test_firmware: fix setting old custom fw path back on exit, second try To: Ben Hutchings , Greg Kroah-Hartman Cc: Shuah Khan , linux-kselftest@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 3, 2018 at 12:48 PM, Ben Hutchings wrote: > Commit 65c79230576 tried to clear the custom firmware path on exit by > writing a single space to the firmware_class.path parameter. This > doesn't work because nothing strips this space from the value stored > and fw_get_filesystem_firmware() only ignores zero-length paths. > > Instead, write a null byte. > > Fixes: 0a8adf58475 ("test: add firmware_class loader test") > Fixes: 65c79230576 ("test_firmware: fix setting old custom fw path back on exit") > Signed-off-by: Ben Hutchings Thanks for the patch! Also can you re-send and address Greg and linux-kernel ? There's significant changes to the firmware API on its way to Linus to I think if we want to merge this it should go through Greg at this point as he also merged some new changes I made to these scripts. > --- > tools/testing/selftests/firmware/fw_filesystem.sh | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh > index f9508e1a4058..6b63b6bf2661 100755 > --- a/tools/testing/selftests/firmware/fw_filesystem.sh > +++ b/tools/testing/selftests/firmware/fw_filesystem.sh > @@ -46,9 +46,11 @@ test_finish() > echo "$OLD_TIMEOUT" >/sys/class/firmware/timeout > fi > if [ "$OLD_FWPATH" = "" ]; then > - OLD_FWPATH=" " > + # A zero-length write won't work; write a null byte > + printf '\000' >/sys/module/firmware_class/parameters/path > + else > + echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path Odd I am pretty sure I tested this and it worked for me. Wonder what it could have been... What shell are you using? I used bash. Luis > fi > - echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path > rm -f "$FW" > rmdir "$FWPATH" > } > -- > 2.16.2 >