Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp215152imi; Wed, 20 Jul 2022 21:53:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t66ZvgdFi/GoKdQlefXUBy/hgarrnaLO1mOYJjoDrtYBo9NsvTS00l98sTW3OsGZ7nZ8BG X-Received: by 2002:a17:906:c7c1:b0:711:d2e9:99d0 with SMTP id dc1-20020a170906c7c100b00711d2e999d0mr38721162ejb.639.1658379222687; Wed, 20 Jul 2022 21:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658379222; cv=none; d=google.com; s=arc-20160816; b=A06q1PnHJjpws67uUdMlTJjETh0nWWLRTKwf0YoKKYBM6/V+YeH8DWuN8ccgzqFaTu 3qZhmAqMtUTZM5xPefMW2yKlMJZCZ+eEKgJGIbqWFqa2HCfGooA8jhFLAflhK1Oyan+A RkHSV/AMkjP32uh8DPyhqE5XcrnwnmTG3D43ou12+wAKuNLcOj/J3PlkZ5/ptCade6GA UdHVCvwCr3SpTw9o6Jbot1aWFF8oaMEgCCrQP/2KnfEHSRkrku0hPZBMaO/4FENd59UY vjmt7H5eX2GfbZeDV/LDUl+q3ZImJDE9gQHVKaxxb5rTaIn+LuuSA8TzeOcWhb5duhbr Poew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uPL/ql1LB5ds4jH2tOhM+z2l0HqEHdneZJ9I01Jvm0A=; b=cMnLsFD2DN1+2IQWra9zREyiGnrNfnCLZKECgSnwO6YUyU6eBketW3y7kqD7AHlwMe DRMsxvXrx7yoK/Qqaj6KewBVYUBN597aSgI9Y2VA9894O9g91kxZa89X6OqDBQxKvNZ9 w9YzKldMI8jhjEJCGsH6PTUf17wr9y7LS/U6RQSu1YXIP1aBNHguuOct42ODTxiHf4KX UDDKvt9Jh42Bx/8XDxn//HsvjKSyZgHTBVgAdpiqEvDk6OLWDyL0sL5cutLU4Q5Lf04c OiABeMlNTNhSu0IooZRRn1mIKfWvCyBZd7vM+VQTOt+W64aoEpb74W8GbXq8tZUyXkao g62Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a056402036100b0043bb6a22af3si1011642edw.387.2022.07.20.21.53.17; Wed, 20 Jul 2022 21:53:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbiGUEoQ (ORCPT + 65 others); Thu, 21 Jul 2022 00:44:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiGUEoO (ORCPT ); Thu, 21 Jul 2022 00:44:14 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EEB63743D1 for ; Wed, 20 Jul 2022 21:44:13 -0700 (PDT) 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-198-wCWCKbzDPBOPH_d9xnmbWw-1; Thu, 21 Jul 2022 00:44:01 -0400 X-MC-Unique: wCWCKbzDPBOPH_d9xnmbWw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 80331811E80; Thu, 21 Jul 2022 04:44:00 +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 BEEA3909FF; Thu, 21 Jul 2022 04:43:55 +0000 (UTC) From: Dave Airlie To: torvalds@linux-foundation.org, Jonathan Corbet , linux-doc@vger.kernel.org, gregkh@linuxfoundation.org, Daniel Vetter , mcgrof@kernel.org Cc: linux-kernel@vger.kernel.org, dri-devel@lists.sf.net, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, alsa-devel@alsa-project.org, linux-media@vger.kernel.org, linux-block@vger.kernel.org, Dave Airlie , Rodrigo Vivi , Harry Wentland Subject: [PATCH] docs: driver-api: firmware: add driver firmware guidelines. (v3) Date: Thu, 21 Jul 2022 14:43:52 +1000 Message-Id: <20220721044352.3110507-1-airlied@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_SOFTFAIL,SPOOFED_FREEMAIL,SPOOF_GMAIL_MID autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Dave Airlie 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. v2: rewritten with suggestions from Thorsten Leemhuis v3: rewritten with suggestions from Mauro Acked-by: Luis Chamberlain Acked-by: Rodrigo Vivi Acked-by: Daniel Vetter Acked-by: Harry Wentland Signed-off-by: Dave Airlie --- Documentation/driver-api/firmware/core.rst | 1 + .../firmware/firmware-usage-guidelines.rst | 44 +++++++++++++++++++ 2 files changed, 45 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..fdcfce42c6d2 --- /dev/null +++ b/Documentation/driver-api/firmware/firmware-usage-guidelines.rst @@ -0,0 +1,44 @@ +=================== +Firmware Guidelines +=================== + +Users switching to a newer kernel should *not* have to install newer +firmware files to keep their hardware working. At the same time updated +firmware files must not cause any regressions for users of older kernel +releases. + +Drivers that use firmware from linux-firmware should follow the rules in +this guide. (Where there is limited control of the firmware, +i.e. company doesn't support Linux, firmwares sourced from misc places, +then of course these rules will not apply strictly.) + +* Firmware files shall be designed in a way that it allows checking for + firmware ABI version changes. It is recommended that firmware files 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 firmware version should + be stored in the firmware header, or as an exception, as part of the + firmware file name, in order to let the driver detact any non-ABI + fixes/changes. The firmware files in linux-firmware should be + overwritten with the newest compatible major version. Newer major + version firmware shall remain compatible with all kernels that load + that major number. + +* If the kernel support for the hardware is normally inactive, or the + hardware isn't available for public consumption, 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 that are required by currently supported stable/LTS kernels, + should be updated with the security fix. 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. + -- 2.36.1