Received: by 10.223.164.202 with SMTP id h10csp210397wrb; Mon, 13 Nov 2017 05:19:48 -0800 (PST) X-Google-Smtp-Source: AGs4zMafwe/M10HMjWM6nwveWi4ZzzDrdBI0rqHdG52eBTVycGsiLNucYeNR4xBDiQu6ppOU3UhV X-Received: by 10.101.98.72 with SMTP id q8mr8445206pgv.71.1510579188040; Mon, 13 Nov 2017 05:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510579187; cv=none; d=google.com; s=arc-20160816; b=cN436v4Aw5bcumXGIY0zlAE1Fg7o48WCL/vI3rV0xAfX7HvJbqTZEkXpY+F673g+Wt l5nKZBYVICxp8G8uL2RwvuESmxiD0TGUAmFri3q6PU4nNe4Kj74ToFBWiAvi3vsF1ZMt AWK+9ti82I7NxZ5FmDNTWAaE3cxl3w4LStSCDuAWUiZmMzAw2CGCwquQJxQqSoTXgwx2 654nxugTW/byaTi7rnMAPGVu3yamfNKT37sIwk/pyPoWv/gEVRWfZcoDorUiFkinix01 VSm7/8WjARCtayJTWqX8rO8a9HVjAlE1QtFCZLkJfC4klgshmUhubGTS8YBU6GgWgnCD 164Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=LgUI6AX9oMoyHw6uYSRNfTOhUSwm44gVI1cYaFUDjKw=; b=I/GgCe1J9ogPW8sfcgtD/nz+iTYQr3ioFetfVfFiGIHC6fXSKVgYkuNRuJBgeOVI4C ilQIIPUrOYlqRJjAkZTOkBDmhwA45JJ+K7LzXMLjI2YXIyt7ysbUWVZEu73s8RXplA1P v8etbbs42rN5C8rrOugoSlD33OcJF7nLTassBSpnrHO9BvfS94PBi29DFxQKcnfcjgTv JS6HIz5KVRpEEw8FWjATzmrx0xaEzE+RiKOa9vfxqgfOi1rvHMOMDcgcda5qEJRY9usN Pi+i/QtSmQvmIY/eSzB2Nz8GVi9rLzGRI+rYK0/Z11wEG++Mj2+nwEyfe3U/c+G3wq4l 9LnA== 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 g68si13635503pgc.304.2017.11.13.05.19.34; Mon, 13 Nov 2017 05:19:47 -0800 (PST) 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 S1752523AbdKMNS5 (ORCPT + 95 others); Mon, 13 Nov 2017 08:18:57 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50790 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754806AbdKMNCN (ORCPT ); Mon, 13 Nov 2017 08:02:13 -0500 Received: from localhost (LFbn-1-12253-150.w90-92.abo.wanadoo.fr [90.92.67.150]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9128BAB6; Mon, 13 Nov 2017 13:02:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Luis R. Rodriguez" , Amit Pundir Subject: [PATCH 4.9 71/87] tools: firmware: check for distro fallback udev cancel rule Date: Mon, 13 Nov 2017 13:56:28 +0100 Message-Id: <20171113125621.698733555@linuxfoundation.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171113125615.304035578@linuxfoundation.org> References: <20171113125615.304035578@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luis R. Rodriguez commit afb999cdef69148f366839e74470d8f5375ba5f1 upstream. Some distributions (Debian, OpenSUSE) have a udev rule in place to cancel all fallback mechanism uevents immediately. This would obviously make it hard to test against the fallback mechanism test interface, so we need to check for this. Signed-off-by: Luis R. Rodriguez Signed-off-by: Amit Pundir Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/firmware/fw_userhelper.sh | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/firmware/fw_userhelper.sh +++ b/tools/testing/selftests/firmware/fw_userhelper.sh @@ -64,9 +64,33 @@ trap "test_finish" EXIT echo "ABCD0123" >"$FW" NAME=$(basename "$FW") +DEVPATH="$DIR"/"nope-$NAME"/loading + # Test failure when doing nothing (timeout works). -echo 1 >/sys/class/firmware/timeout -echo -n "$NAME" >"$DIR"/trigger_request +echo -n 2 >/sys/class/firmware/timeout +echo -n "nope-$NAME" >"$DIR"/trigger_request 2>/dev/null & + +# Give the kernel some time to load the loading file, must be less +# than the timeout above. +sleep 1 +if [ ! -f $DEVPATH ]; then + echo "$0: fallback mechanism immediately cancelled" + echo "" + echo "The file never appeared: $DEVPATH" + echo "" + echo "This might be a distribution udev rule setup by your distribution" + echo "to immediately cancel all fallback requests, this must be" + echo "removed before running these tests. To confirm look for" + echo "a firmware rule like /lib/udev/rules.d/50-firmware.rules" + echo "and see if you have something like this:" + echo "" + echo "SUBSYSTEM==\"firmware\", ACTION==\"add\", ATTR{loading}=\"-1\"" + echo "" + echo "If you do remove this file or comment out this line before" + echo "proceeding with these tests." + exit 1 +fi + if diff -q "$FW" /dev/test_firmware >/dev/null ; then echo "$0: firmware was not expected to match" >&2 exit 1 From 1583612816398798018@xxx Thu Nov 09 18:07:50 +0000 2017 X-GM-THRID: 1583547301745475983 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread