Received: by 10.213.65.68 with SMTP id h4csp3930366imn; Tue, 3 Apr 2018 13:15:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+y1rqAFE/zNb420FSOH1QZW2HMs7JmpQWlV6O1ZlWmCgpx5L/fJ8zrxz0kI0gC59K19MoM X-Received: by 2002:a17:902:30a3:: with SMTP id v32-v6mr15617402plb.123.1522786558987; Tue, 03 Apr 2018 13:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522786558; cv=none; d=google.com; s=arc-20160816; b=Ys9nFczfh9rnG9KKYlIKOjK9Vr2NiKciaEKJO6qWUJj1XvuCPy+Bp9sKFmMnYeOWnJ cl/s1sMzHaZOgczi4p3DnmfqlR0MpanBMDF/cIwQFCaKXPSgTwDYwzk8ZZ/i8nwbm9vQ AJZTpQ8Eqpma6LuliTVczHg1rByD+cnLlRIucH4CYbfjJRH4PD3iZA4tjmHguXuolXCl YbEippRBDypMsukvlb0qHise3nLQw+03etWarbkB1dVtx803f/CGffUPHsPtVIH5WMLm EHWG4FSMyd5ufsrG45BTaWy38Yye06LIarJ/oQ14VoAThws5tra5eEwMbPD9RPlsXeiy KLyQ== 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=R021Zj3InW6bSvEhWKRWZYAIA9Nza5UmZ+GfLR8yiqY=; b=hNj4h4H3EJuCCbIyAzSuacmyCwD9zJsShRsIu5eFnKki/iLAnmKnS0SXpkzupQnCb9 fqPKpyDTvD7+Y2bCQozA7nIisWlfkkdHvtc5JpRRStf+uzC19IDUF/DEquIOvb441DzM 1SFF3P3Wa0IOp9TXyDTJs1V1oevw58liGlbdz9QMyMHPDggrOuY9Cc+IU8a+dlQ1vasE r21+hP/Kqg1GEJDSb2JOph/mtugUqqA/OnIs9Ep4l0xDZKpDF21xs95w5QSXMiLtBx5C GRdu/TfQZHwfH2q1h1w+zYvA4WoRj4DDwKfsaj8tV++OnVRMPbhNLFcI9KP/OQ60j0Kh N9Qg== 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 k3-v6si1278637pld.221.2018.04.03.13.15.42; Tue, 03 Apr 2018 13:15:58 -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 S1753473AbeDCUNT (ORCPT + 99 others); Tue, 3 Apr 2018 16:13:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:41910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752447AbeDCUNR (ORCPT ); Tue, 3 Apr 2018 16:13:17 -0400 Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (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 4079D20852; Tue, 3 Apr 2018 20:13:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4079D20852 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-io0-f175.google.com with SMTP id q84so23530809iod.10; Tue, 03 Apr 2018 13:13:17 -0700 (PDT) X-Gm-Message-State: AElRT7FOBmuJ/01saFTrzyQBISs7+WNL3/G4NpeeVSTC7jbW8oaSFAQr ZCTnCESTg9M8gnuh11gCjk+OnJb5TtXEV+8TcQQ= X-Received: by 10.107.17.6 with SMTP id z6mr13924401ioi.274.1522786396697; Tue, 03 Apr 2018 13:13:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.128.161 with HTTP; Tue, 3 Apr 2018 13:12:55 -0700 (PDT) In-Reply-To: <1522786230.2654.124.camel@codethink.co.uk> References: <20180403194849.csgzr3jllt4f2qb7@xylophone.i.decadent.org.uk> <1522786230.2654.124.camel@codethink.co.uk> From: "Luis R. Rodriguez" Date: Tue, 3 Apr 2018 13:12:55 -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 Cc: Greg Kroah-Hartman , 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 1:10 PM, Ben Hutchings wrote: > On Tue, 2018-04-03 at 12:54 -0700, Luis R. Rodriguez wrote: >> 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. > > OK. Oh and if you can then base it also on Greg's driver-core tree on the driver-core-next branch >> > --- >> > 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. > > Seems to work the same way for me whether I use bash (interactive) or > dash (script interpreter, /bin/sh). But there's no visual difference > between " \n" and "\n"; that's why I used od to show a hex dump in my > previous mail. So odd, I'll test again with my qemu setup to verify again. Luis