From patchwork Mon Jul 18 07:05:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Airlie X-Patchwork-Id: 12926719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4566CCA479 for ; Mon, 18 Jul 2022 08:36:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25D5E11AE4C; Mon, 18 Jul 2022 08:36:04 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0FD6A585D; Mon, 18 Jul 2022 08:35:40 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1oDME6-0000Z0-5j; Mon, 18 Jul 2022 08:35:37 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oDL4y-0003Lx-VF for dri-devel@lists.sourceforge.net; Mon, 18 Jul 2022 07:22:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2AXYS7uCk/tVowuSjgrZBEKhXee01EBJjWQb+hibTD4=; b=GI2y9ckVFI1Q0c4lwOAuYZB4gt Ncsx3CrQ1JNqZQsmhrAO7uMQGdDpKP6cLFMk+W97GjsXf8Ag3AreRMX6dnxwMCAs4DkUVeFSc/Ipu MO0vlNWW5gU1doX/UH8y/33QyunKRcbgG4H12ygfB3x34JedICPoQMo7CjpmhdxnuTMQ=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=2AXYS7uCk/tVowuSjgrZBEKhXee01EBJjWQb+hibTD4=; b=L +pILeGYe3zTpYl0T1i9djyOJxzr8zos34EaMbuXsXw6IkzdghR8513qLAO2R0XVJC2GdgfF2ueOYJ fCQWyfiSg1zioGiRNw9KDlgMrVqPiFzMEXpBbZJTIzvqX/ulzLrq9fod58CW41jnbR78lQBBf/KH0 lg7F9+Cowtja7Ex4=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1oDL4y-002Riq-2n for dri-devel@lists.sourceforge.net; Mon, 18 Jul 2022 07:22:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658128922; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=2AXYS7uCk/tVowuSjgrZBEKhXee01EBJjWQb+hibTD4=; b=AZQdu2ES79dihUuy24qXeaBHI3Dc1VAbzma4VKwlhnXkG5DVOFBn/2oijVuGyCnXH9RXpE OoTbWgjYY8T67gYjPVWBHSxcMf+Yzh1XLRoR1GGsqTnvkS18BBg8/LvI5Bkm4dC4nFiOaO pr6WMwnBjNVALaOpmoueV/CeKoSC9ck= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-529-eIbNc7lmMPml5dtWSslBaQ-1; Mon, 18 Jul 2022 03:05:55 -0400 X-MC-Unique: eIbNc7lmMPml5dtWSslBaQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AB28C1019C8E; Mon, 18 Jul 2022 07:05:54 +0000 (UTC) Received: from dreadlord.bne.redhat.com (fdacunha.bne.redhat.com [10.64.0.157]) by smtp.corp.redhat.com (Postfix) with ESMTP id 204F42026D64; Mon, 18 Jul 2022 07:05:51 +0000 (UTC) From: Dave Airlie To: torvalds@linux-foundation.org, Jonathan Corbet , linux-doc@vger.kernel.org, gregkh@linuxfoundation.org, Daniel Vetter Subject: [PATCH] docs: driver-api: firmware: add driver firmware guidelines. Date: Mon, 18 Jul 2022 17:05:48 +1000 Message-Id: <20220718070548.2699395-1-airlied@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Headers-End: 1oDL4y-002Riq-2n X-Mailman-Approved-At: Mon, 18 Jul 2022 08:35:14 +0000 X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list X-BeenThere: dri-devel@lists.freedesktop.org List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.sf.net Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" A recent snafu where Intel ignored upstream feedback on a firmware change, led to a late rc6 fix being required. In order to avoid this in the future we should document some expectations around linux-firmware. I was originally going to write this for drm, but it seems quite generic advice. Signed-off-by: Dave Airlie --- Documentation/driver-api/firmware/core.rst | 1 + .../firmware/firmware-usage-guidelines.rst | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Documentation/driver-api/firmware/firmware-usage-guidelines.rst diff --git a/Documentation/driver-api/firmware/core.rst b/Documentation/driver-api/firmware/core.rst index 1d1688cbc078..803cd574bbd7 100644 --- a/Documentation/driver-api/firmware/core.rst +++ b/Documentation/driver-api/firmware/core.rst @@ -13,4 +13,5 @@ documents these features. direct-fs-lookup fallback-mechanisms lookup-order + firmware-usage-guidelines diff --git a/Documentation/driver-api/firmware/firmware-usage-guidelines.rst b/Documentation/driver-api/firmware/firmware-usage-guidelines.rst new file mode 100644 index 000000000000..34d2412e78c6 --- /dev/null +++ b/Documentation/driver-api/firmware/firmware-usage-guidelines.rst @@ -0,0 +1,34 @@ +=================== +Firmware Guidelines +=================== + +Drivers that use firmware from linux-firmware should attempt to follow +the rules in this guide. + +* Firmware should be versioned with at least a major/minor version. It + is suggested that the firmware files in linux-firmware be named with + some device specific name, and just the major version. The + major/minor/patch versions should be stored in a header in the + firmware file for the driver to detect any non-ABI fixes/issues. The + firmware files in linux-firmware should be overwritten with the newest + compatible major version. Newer major version firmware should remain + compatible with all kernels that load that major number. + +* Users should *not* have to install newer firmware to use existing + hardware when they install a newer kernel. If the hardware isn't + enabled by default or under development, this can be ignored, until + the first kernel release that enables that hardware. This means no + major version bumps without the kernel retaining backwards + compatibility for the older major versions. Minor version bumps + should not introduce new features that newer kernels depend on + non-optionally. + +* If a security fix needs lockstep firmware and kernel fixes in order to + be successful, then all supported major versions in the linux-firmware + repo should be updated with the security fix, and the kernel patches + should detect if the firmware is new enough to declare if the security + issue is fixed. All communications around security fixes should point + at both the firmware and kernel fixes. If a security fix requires + deprecating old major versions, then this should only be done as a + last option, and be stated clearly in all communications. +