From 964c3d395812a7e5f5f133588c36d3b91d58fef6 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 7 May 2020 14:17:39 +0100 Subject: Update RPi4 USB quirks patch to latest --- USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch | 417 ++++++++++++++------------ 1 file changed, 230 insertions(+), 187 deletions(-) diff --git a/USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch b/USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch index fb7c1afaf..b1f4e7942 100644 --- a/USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch +++ b/USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch @@ -1,27 +1,27 @@ -From patchwork Tue Mar 24 18:28:09 2020 +From patchwork Tue May 5 16:13:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne -X-Patchwork-Id: 11456187 +X-Patchwork-Id: 11529601 Return-Path: - + Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 884BD1667 + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1BF82139A for ; - Tue, 24 Mar 2020 18:29:06 +0000 (UTC) + Tue, 5 May 2020 16:13:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 64FF0206F6 + by mail.kernel.org (Postfix) with ESMTPS id ED4E0206A4 for ; - Tue, 24 Mar 2020 18:29:06 +0000 (UTC) + Tue, 5 May 2020 16:13:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="G3ed3Qzw" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64FF0206F6 + header.i=@lists.infradead.org header.b="u/J7plS1" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED4E0206A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; @@ -33,50 +33,50 @@ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=ZW8pFtwlUj3q7GZJotB4Rgjtfp9gMy+l74jJQcTab0w=; b=G3ed3QzwnvX3MD - lHn7XDGcdKtGCuuX/Xhmoz/5j7Rgw1hOz3+8tGJaH+BigLM7Kfms9kB2c3chHrDwTH5SW0LzlU8el - hxpbcJnVFy3VLdCMUrvQUXY0SmOcoSSN3NK032HxlqAKSa5HPE3dTBWheiUGKlZ6c3A9dGItYzD6I - M4WO+9b0wHM1KMMrsyVo51ysdAFEXtSym1xNN+pW/tE9ak+/bFHxMW1XcMNrVwo9R43U5JSvmcC0M - OKBYNAYFpFWx3n3wvAaFQkBEkmH3QmPBd0aiE8UTGk6CY0VHwjbVcE7u7daksOPLrZgsRgqmLRatE - 98WbgEKpzDu7mgvLn5zw==; + List-Owner; bh=bGQLzaoeWIDpTINYetpnA2L/vb7OmdXvhp2NJuW0F3A=; b=u/J7plS1Bwu25p + 31YlPyAxNHzkNz73OdF7ft5uhn9vS8dF3TEBhhmSu83IWYwAhsjyqTB+Hn8104w1KT17o0ihuNG++ + UIf6ftYyM8/v9W57OPJcwcWqPpKyFVB7fs9hgR9IE1/Qm8Ur/aUjmD1HK272ZJYsgrFqyFO4PP7DD + 1LwVH20tWs3UvX317QDIn5VIq8EAX5ImabSfeYHw1LlyhQUYF10UPX5zw4I2TlLRd2hFvfyUy7s8b + 1uMZFqLeqfTHrauQ43p5IBZs/wNGKGJbQlZvuENJxPcbBharqHBVDZrFvtV2MLnvrDOnv6A2QSfpt + vv++WCa+crrbmyL2v/pw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoIP-0002bD-LX; Tue, 24 Mar 2020 18:29:01 +0000 + id 1jW0CU-00035T-KT; Tue, 05 May 2020 16:13:42 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoHq-00024O-PS; Tue, 24 Mar 2020 18:28:29 +0000 + id 1jW0CF-0002rM-7U; Tue, 05 May 2020 16:13:28 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) - by mx2.suse.de (Postfix) with ESMTP id 4A537ABD1; - Tue, 24 Mar 2020 18:28:22 +0000 (UTC) + by mx2.suse.de (Postfix) with ESMTP id 0992CAF4F; + Tue, 5 May 2020 16:13:28 +0000 (UTC) From: Nicolas Saenz Julienne -To: linux-kernel@vger.kernel.org, Florian Fainelli , +To: f.fainelli@gmail.com, gregkh@linuxfoundation.org, wahrenst@gmx.net, + helgaas@kernel.org, linux-kernel@vger.kernel.org, Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Nicolas Saenz Julienne -Subject: [PATCH v6 1/4] soc: bcm2835: Sync xHCI reset firmware property with - downstream -Date: Tue, 24 Mar 2020 19:28:09 +0100 -Message-Id: <20200324182812.20420-2-nsaenzjulienne@suse.de> -X-Mailer: git-send-email 2.25.1 -In-Reply-To: <20200324182812.20420-1-nsaenzjulienne@suse.de> -References: <20200324182812.20420-1-nsaenzjulienne@suse.de> +Subject: [PATCH v8 1/4] soc: bcm2835: Add notify xHCI reset property +Date: Tue, 5 May 2020 18:13:14 +0200 +Message-Id: <20200505161318.26200-2-nsaenzjulienne@suse.de> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200505161318.26200-1-nsaenzjulienne@suse.de> +References: <20200505161318.26200-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20200324_112826_965603_11D899C2 -X-CRM114-Status: GOOD ( 13.71 ) +X-CRM114-CacheID: sfid-20200505_091327_410061_22E5BD39 +X-CRM114-Status: GOOD ( 13.67 ) X-Spam-Score: -2.3 (--) -X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- - 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) - [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] - -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) + [195.135.220.15 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 @@ -91,17 +91,16 @@ List-Help: List-Subscribe: , -Cc: tim.gover@raspberrypi.org, sergei.shtylyov@cogentembedded.com, - gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, - linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, wahrenst@gmx.net +Cc: linux-pci@vger.kernel.org, tim.gover@raspberrypi.org, + linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, + linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The property is needed in order to trigger VL805's firmware load. Note -that there is a gap between the property introduced and the previous -one. This is also the case downstream. +that gap between the property introduced and the previous one is due to +the properties not being defined. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Florian Fainelli @@ -123,30 +122,30 @@ index 7800e12ee042..cc9cdbc66403 100644 /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From patchwork Tue Mar 24 18:28:10 2020 +From patchwork Tue May 5 16:13:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne -X-Patchwork-Id: 11456191 +X-Patchwork-Id: 11529609 Return-Path: - + Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4D571731 + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 337F6139A for ; - Tue, 24 Mar 2020 18:29:30 +0000 (UTC) + Tue, 5 May 2020 16:14:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 9A787206F6 + by mail.kernel.org (Postfix) with ESMTPS id 062432084D for ; - Tue, 24 Mar 2020 18:29:30 +0000 (UTC) + Tue, 5 May 2020 16:14:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="Z5B/3JRW" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9A787206F6 + header.i=@lists.infradead.org header.b="SDl3WXtu" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 062432084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; @@ -158,50 +157,50 @@ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=kAIknZ2RVw6gB9CaOcG4KQjgkdNyrtcLcfH5XAGtITo=; b=Z5B/3JRWWCVYHI - AsxnYFEFit0NnrRvZDbi0ktp8wUbVrztmKRPQWvfaWSlelJEKdEpJhHItnpicKfR5JhfHFsPt3V3X - i29DtdYSOr/cjW/qeoakzXY0b1ApjrrK3MWjX/k0k9SVqGwkq6KT3T3qok969KInPAe0ERZ9bYkP1 - P2Jj1QT0QtCfcd0PsSjn4riMP09KNZVuviLm2bcg3Cr78qfIq6gDHHoS1nqPzdEt4gG+i/s66lTFY - Dd3vPgItuRBvzgAjWdT4Bvx41u82KONuYDshYftzUZX7pxh76o4PwtPoPt/A4hJT0pZZe9MB6pQlM - JwbBVC2fhM1afv00diOw==; + List-Owner; bh=Zr8RX4pUFuT9LYq/WsMx8aWZosDB52n4Q59lcyexfbE=; b=SDl3WXtuTc/nTE + liOc14IJBVmzylTRvqtl7RNlIur09j/+2VWz/L9i6UGqjG6N3L8XsQ0hQjdunHpod9jj3p3Az+4sq + FgwzoSdghy8rfnfxhcqJSbvMvX34yzGnoQBS46jClcjky9iNoijO+nBo3SE9wC8vSKKIafCzmVqHw + P7p44IgFrwgnBKbAgdUWCjUVQqolk2pLJr7jw/TG8pvfv0R6XJGmz3Lbl8gP14FyWfkkqsKqC+0g1 + Jq6JPtdl+W0AfEWVrFr6/74LhLTpnhsPqXGEPJjrLqtkbZ2c9pulOQ3f85qAed9slCbkVxe5fHetC + bwaYOp++AlOj7kNN25Qw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoIm-00032a-5v; Tue, 24 Mar 2020 18:29:24 +0000 + id 1jW0Ch-0003KV-Mk; Tue, 05 May 2020 16:13:55 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoHq-00024W-PL; Tue, 24 Mar 2020 18:28:29 +0000 + id 1jW0CG-0002rw-Mm; Tue, 05 May 2020 16:13:30 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) - by mx2.suse.de (Postfix) with ESMTP id 3F0CFABE7; - Tue, 24 Mar 2020 18:28:23 +0000 (UTC) + by mx2.suse.de (Postfix) with ESMTP id 4B6EDAF5D; + Tue, 5 May 2020 16:13:29 +0000 (UTC) From: Nicolas Saenz Julienne -To: linux-kernel@vger.kernel.org, +To: f.fainelli@gmail.com, gregkh@linuxfoundation.org, wahrenst@gmx.net, + helgaas@kernel.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , - Florian Fainelli , Ray Jui , - Scott Branden , + Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com -Subject: [PATCH v6 2/4] firmware: raspberrypi: Introduce vl805 init routine -Date: Tue, 24 Mar 2020 19:28:10 +0100 -Message-Id: <20200324182812.20420-3-nsaenzjulienne@suse.de> -X-Mailer: git-send-email 2.25.1 -In-Reply-To: <20200324182812.20420-1-nsaenzjulienne@suse.de> -References: <20200324182812.20420-1-nsaenzjulienne@suse.de> +Subject: [PATCH v8 2/4] firmware: raspberrypi: Introduce vl805 init routine +Date: Tue, 5 May 2020 18:13:15 +0200 +Message-Id: <20200505161318.26200-3-nsaenzjulienne@suse.de> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200505161318.26200-1-nsaenzjulienne@suse.de> +References: <20200505161318.26200-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20200324_112827_110873_06144E1C -X-CRM114-Status: GOOD ( 15.67 ) +X-CRM114-CacheID: sfid-20200505_091329_063893_301DE39B +X-CRM114-Status: GOOD ( 18.76 ) X-Spam-Score: -2.3 (--) -X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- - 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) - [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] - -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) + [195.135.220.15 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 @@ -216,61 +215,85 @@ List-Help: List-Subscribe: , -Cc: tim.gover@raspberrypi.org, sergei.shtylyov@cogentembedded.com, - gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, - linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, wahrenst@gmx.net +Cc: linux-pci@vger.kernel.org, tim.gover@raspberrypi.org, + linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, + linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org -On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be +The Raspberry Pi 4 gets its USB functionality from VL805, a PCIe chip +that implements xHCI. After a PCI reset, VL805's firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's -VideCore. The function informs VideCore that VL805 was just reset, or -requests for a probe defer. - -Based on Tim Gover's downstream implementation. +co-processor, VideoCore. RPi4's VideoCore OS contains both the non public +firmware load logic and the VL805 firmware blob. The function this patch +introduces triggers the aforementioned process. Signed-off-by: Nicolas Saenz Julienne -Reviewed-by: Florian Fainelli --- + +Change since v7: +- Use usleep_delay() +- Add comment about PCI errors +- Don't wait on error +- Typos + +Change since v6: +- Add test to avoid loading the firmware when not needed +- Since we have it around, print VL805's firmware version, it'll make +debugging easier in the future +- Correct typos +- Add a clearer view of HW topology in patch description + Changes since v4: - - Inline function definition when RASPBERRYPI_FIRMWARE is not defined +- Inline function definition when RASPBERRYPI_FIRMWARE is not defined Changes since v1: - - Move include into .c file and add forward declaration to .h +- Move include into .c file and add forward declaration to .h - drivers/firmware/raspberrypi.c | 38 ++++++++++++++++++++++ - include/soc/bcm2835/raspberrypi-firmware.h | 7 ++++ - 2 files changed, 45 insertions(+) + drivers/firmware/raspberrypi.c | 61 ++++++++++++++++++++++ + include/soc/bcm2835/raspberrypi-firmware.h | 7 +++ + 2 files changed, 68 insertions(+) diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index da26a584dca0..cbb495aff6a0 100644 +index da26a584dca0..a166ad0cec2c 100644 --- a/drivers/firmware/raspberrypi.c +++ b/drivers/firmware/raspberrypi.c -@@ -12,6 +12,7 @@ +@@ -12,6 +12,8 @@ #include #include #include +#include ++#include #include #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf)) -@@ -286,6 +287,43 @@ struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node) +@@ -19,6 +21,8 @@ + #define MBOX_DATA28(msg) ((msg) & ~0xf) + #define MBOX_CHAN_PROPERTY 8 + ++#define VL805_PCI_CONFIG_VERSION_OFFSET 0x50 ++ + static struct platform_device *rpi_hwmon; + static struct platform_device *rpi_clk; + +@@ -286,6 +290,63 @@ struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node) } EXPORT_SYMBOL_GPL(rpi_firmware_get); +/* -+ * On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be -+ * loaded directly from an EEPROM or, if not present, by the SoC's VideCore. -+ * Inform VideCore that VL805 was just reset, or defer xhci's probe if not yet -+ * joinable trough the mailbox interface. ++ * The Raspberry Pi 4 gets its USB functionality from VL805, a PCIe chip that ++ * implements xHCI. After a PCI reset, VL805's firmware may either be loaded ++ * directly from an EEPROM or, if not present, by the SoC's co-processor, ++ * VideoCore. RPi4's VideoCore OS contains both the non public firmware load ++ * logic and the VL805 firmware blob. This function triggers the aforementioned ++ * process. + */ +int rpi_firmware_init_vl805(struct pci_dev *pdev) +{ + struct device_node *fw_np; + struct rpi_firmware *fw; -+ u32 dev_addr; ++ u32 dev_addr, version; + int ret; + + fw_np = of_find_compatible_node(NULL, NULL, @@ -281,7 +304,19 @@ index da26a584dca0..cbb495aff6a0 100644 + fw = rpi_firmware_get(fw_np); + of_node_put(fw_np); + if (!fw) -+ return -EPROBE_DEFER; ++ return -ENODEV; ++ ++ /* ++ * Make sure we don't trigger a firmware load unnecessarily. ++ * ++ * If something went wrong with PCI, this whole exercise would be ++ * futile as VideoCore expects from us a configured PCI bus. Just take ++ * the faulty version (likely ~0) and let xHCI's registration fail ++ * further down the line. ++ */ ++ pci_read_config_dword(pdev, VL805_PCI_CONFIG_VERSION_OFFSET, &version); ++ if (version) ++ goto exit; + + dev_addr = pdev->bus->number << 20 | PCI_SLOT(pdev->devfn) << 15 | + PCI_FUNC(pdev->devfn) << 12; @@ -291,7 +326,13 @@ index da26a584dca0..cbb495aff6a0 100644 + if (ret) + return ret; + -+ dev_dbg(&pdev->dev, "loaded Raspberry Pi's VL805 firmware\n"); ++ /* Wait for vl805 to startup */ ++ usleep_range(200, 1000); ++ ++ pci_read_config_dword(pdev, VL805_PCI_CONFIG_VERSION_OFFSET, ++ &version); ++exit: ++ pci_info(pdev, "VL805 firmware version %08x\n", version); + + return 0; +} @@ -333,30 +374,30 @@ index cc9cdbc66403..3025aca3c358 100644 #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From patchwork Tue Mar 24 18:28:11 2020 +From patchwork Tue May 5 16:13:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne -X-Patchwork-Id: 11456189 +X-Patchwork-Id: 11529613 Return-Path: - + Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 168CB1667 + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09B41139A for ; - Tue, 24 Mar 2020 18:29:15 +0000 (UTC) + Tue, 5 May 2020 16:14:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id EAB942076E + by mail.kernel.org (Postfix) with ESMTPS id D0DF22078D for ; - Tue, 24 Mar 2020 18:29:14 +0000 (UTC) + Tue, 5 May 2020 16:14:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="BOwwgdOE" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAB942076E + header.i=@lists.infradead.org header.b="SAMPLJUW" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0DF22078D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; @@ -368,52 +409,51 @@ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=CLmK04T+baw5jWu/lH2cJ3fygso/fqFgoMOSigkpvRw=; b=BOwwgdOEAmbVoa - /8AtILxDfcKBVhbig0LKPFd94roUQzY/SylcBG5jWceT90PE3BxYgomfaBA6U41LW9Xe5LZsfylId - /IP3RNq34yRDWPXo3WWkLFYEtwJB60SWZlD8BG+ApGeUJ9z6vXTL9h3K9ThLwhFycZOkSxtDMicCG - vkP4ErkYnvASxQ021+lq/VxFgdnvtKcw2OE+ghhRHgOn8dc+/dJHCp8vi33Qrk9DFhKSGnSX/A5vz - E84/rlt964N9kXLE2npw9hNrj6DdrQozcB9YTAEL9S/krTUmOLI/iWS/DZEUA50xy9wVBqD9Bm78x - TS0oeyfH49HaUmd10Y6w==; + List-Owner; bh=KaAXr2YFGUN9aHABYMGoI6lDCplKLkueaLach3EcLIQ=; b=SAMPLJUWqAiuYn + Ols6qNQTSsb2o1pxY1yuF4MaX8dUzqsSCkylXQf5SkLRki0hXDsY/eVzwcypdH60m5jdk31wU1MJD + O88oZLgP0rvsSmG//a4xMHn/EpxntBmXZvNxlvZ9RuDATHjuA2w1+GKUOEvREG9jBi1M4+r5QZXrY + nRQqxUi1CldsZHzGt3IJi1mXzlNIhZq+fi48xOWUdgCSXYfpJO4qsr3b3QhwJklPSO0c4jMAHKYTQ + z3kKMMszvYgug/JraC4fZD2qDKGic3IxeOSxP2c8dLYBfxMxfBz7gya5rpBpjvFelYZMN2qXaQInv + gND7kQ/fU/heR7N6g6Dg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoIa-0002oW-NS; Tue, 24 Mar 2020 18:29:12 +0000 + id 1jW0Cv-0003b2-3s; Tue, 05 May 2020 16:14:09 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoHr-00024Z-2w; Tue, 24 Mar 2020 18:28:29 +0000 + id 1jW0CI-0002tA-MY; Tue, 05 May 2020 16:13:32 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) - by mx2.suse.de (Postfix) with ESMTP id 1A1A0ABF4; - Tue, 24 Mar 2020 18:28:24 +0000 (UTC) + by mx2.suse.de (Postfix) with ESMTP id 3372DAF7A; + Tue, 5 May 2020 16:13:31 +0000 (UTC) From: Nicolas Saenz Julienne -To: linux-kernel@vger.kernel.org, +To: f.fainelli@gmail.com, gregkh@linuxfoundation.org, wahrenst@gmx.net, + helgaas@kernel.org, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , - Florian Fainelli , - bcm-kernel-feedback-list@broadcom.com, Lorenzo Pieralisi , - Andrew Murray -Subject: [PATCH v6 3/4] PCI: brcmstb: Wait for Raspberry Pi's firmware when + Rob Herring , bcm-kernel-feedback-list@broadcom.com +Subject: [PATCH v8 3/4] PCI: brcmstb: Wait for Raspberry Pi's firmware when present -Date: Tue, 24 Mar 2020 19:28:11 +0100 -Message-Id: <20200324182812.20420-4-nsaenzjulienne@suse.de> -X-Mailer: git-send-email 2.25.1 -In-Reply-To: <20200324182812.20420-1-nsaenzjulienne@suse.de> -References: <20200324182812.20420-1-nsaenzjulienne@suse.de> +Date: Tue, 5 May 2020 18:13:16 +0200 +Message-Id: <20200505161318.26200-4-nsaenzjulienne@suse.de> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200505161318.26200-1-nsaenzjulienne@suse.de> +References: <20200505161318.26200-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20200324_112827_267470_0540B982 -X-CRM114-Status: GOOD ( 12.13 ) +X-CRM114-CacheID: sfid-20200505_091330_993258_A3A56727 +X-CRM114-Status: GOOD ( 11.90 ) X-Spam-Score: -2.3 (--) -X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- - 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) - [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] - -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) + [195.135.220.15 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 @@ -428,11 +468,9 @@ List-Help: List-Subscribe: , -Cc: tim.gover@raspberrypi.org, sergei.shtylyov@cogentembedded.com, - gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, - linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org, - Bjorn Helgaas , linux-arm-kernel@lists.infradead.org, - wahrenst@gmx.net +Cc: tim.gover@raspberrypi.org, linux-pci@vger.kernel.org, + linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, + Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org @@ -445,11 +483,15 @@ starting. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Florian Fainelli --- - drivers/pci/controller/pcie-brcmstb.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + +Changes since v6: +- Add more complete comment + + drivers/pci/controller/pcie-brcmstb.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c -index 3a10e678c7f4..a3d3070a5832 100644 +index 6d79d14527a6..0b97b94c4a9a 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -28,6 +28,8 @@ @@ -461,7 +503,7 @@ index 3a10e678c7f4..a3d3070a5832 100644 #include "../pci.h" /* BRCM_PCIE_CAP_REGS - Offset for the mandatory capability config regs */ -@@ -917,11 +919,24 @@ static int brcm_pcie_probe(struct platform_device *pdev) +@@ -917,11 +919,26 @@ static int brcm_pcie_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node, *msi_np; struct pci_host_bridge *bridge; @@ -472,8 +514,10 @@ index 3a10e678c7f4..a3d3070a5832 100644 int ret; + /* -+ * We have to wait for the Raspberry Pi's firmware interface to be up -+ * as some PCI fixups depend on it. ++ * We have to wait for Raspberry Pi's firmware interface to be up as a ++ * PCI fixup, rpi_firmware_init_vl805(), depends on it. This driver's ++ * probe can race with the firmware interface's (see ++ * drivers/firmware/raspberrypi.c) and potentially break the PCI fixup. + */ + fw_np = of_find_compatible_node(NULL, NULL, + "raspberrypi,bcm2835-firmware"); @@ -487,30 +531,30 @@ index 3a10e678c7f4..a3d3070a5832 100644 if (!bridge) return -ENOMEM; -From patchwork Tue Mar 24 18:28:12 2020 +From patchwork Tue May 5 16:13:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne -X-Patchwork-Id: 11456185 +X-Patchwork-Id: 11529615 Return-Path: - + Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) - by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD453174A + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C85E1392 for ; - Tue, 24 Mar 2020 18:28:41 +0000 (UTC) + Tue, 5 May 2020 16:14:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by mail.kernel.org (Postfix) with ESMTPS id 8690720789 + by mail.kernel.org (Postfix) with ESMTPS id 75AD8206FA for ; - Tue, 24 Mar 2020 18:28:41 +0000 (UTC) + Tue, 5 May 2020 16:14:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org - header.i=@lists.infradead.org header.b="BSDoMdbd" -DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8690720789 + header.i=@lists.infradead.org header.b="pXZpPhrT" +DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75AD8206FA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; @@ -522,47 +566,48 @@ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: - List-Owner; bh=YaBoM78lqEEmZOW4u4cO0fQ+Qpc7vocOU6aRT/EpQsk=; b=BSDoMdbdXfJNCB - Ccoti2K8Qk9NgAlOnVt60cLhw66HCbJPwZn1v08f/rr05ZIoPMToFkJt5krqew7Vd+jlZnzMxf8MC - lBfOqOev9hIjbyu19c646LbpbqVrtrtm9vmy6Lvd2GGuQuvybpM0RHDvc2wzv8a3fejGMgKStaQ/3 - Efne01FoiZvWBedWpTdsoGJbFzfSb4ua/8JT2Ki04i9itY4oTZs9itKK1Taqe3WfNDphluuFcmdGx - nNxQK/PkA6XCdpJHxaCz3DtyZj/2NhAqd8roXn+PUt5SG00Tfc6auERZQPLtTinW6m9ZaUkBhjJQ0 - GHUMyyLHvQ583h1ty9ow==; + List-Owner; bh=/GYWkYF77JxYJ9PRLu3wczjjHT+GnXqD2IyzZ0uR8KY=; b=pXZpPhrTtgd1O0 + sy/khBh4MMWq9sIqFwH9HgDbPFDzQ5eCkfiS/YZoDGJPFFwsUcitnTfFX9VGMnYzLf7eCCLfm1hta + f3X7UNpk1SvaeJKc59x7OvHTLVAwByuEPTqm4bmcqw+aRWdaYShUiv+105SG6JShQF5gjuBpEn3w0 + vzQNYGEl4BeHnlREFZU+Wi1qQ8sa1BwpU6Rx/NmGk8qLv1GOO4+UNf/ABycGTH6jZU101ck7/nvKL + Da7jehxCo1CCUiqM69fvoKabrfI76uVP4OdJcCihqzOWzmkiVwhQAWB0qFa9LR2h4CObuPthIqmW7 + oaRbCgJg+N26f/dtw1mg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoI3-0002Hl-Jz; Tue, 24 Mar 2020 18:28:39 +0000 + id 1jW0D6-0003ov-Og; Tue, 05 May 2020 16:14:20 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) - id 1jGoHq-00024d-Jc; Tue, 24 Mar 2020 18:28:28 +0000 + id 1jW0CJ-0002ui-S6; Tue, 05 May 2020 16:13:33 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) - by mx2.suse.de (Postfix) with ESMTP id EE53FABF6; - Tue, 24 Mar 2020 18:28:24 +0000 (UTC) + by mx2.suse.de (Postfix) with ESMTP id 80D21AF4F; + Tue, 5 May 2020 16:13:32 +0000 (UTC) From: Nicolas Saenz Julienne -To: linux-kernel@vger.kernel.org, - Mathias Nyman -Subject: [PATCH v6 4/4] USB: pci-quirks: Add Raspberry Pi 4 quirk -Date: Tue, 24 Mar 2020 19:28:12 +0100 -Message-Id: <20200324182812.20420-5-nsaenzjulienne@suse.de> -X-Mailer: git-send-email 2.25.1 -In-Reply-To: <20200324182812.20420-1-nsaenzjulienne@suse.de> -References: <20200324182812.20420-1-nsaenzjulienne@suse.de> +To: f.fainelli@gmail.com, gregkh@linuxfoundation.org, wahrenst@gmx.net, + helgaas@kernel.org, linux-kernel@vger.kernel.org, + Mathias Nyman +Subject: [PATCH v8 4/4] USB: pci-quirks: Add Raspberry Pi 4 quirk +Date: Tue, 5 May 2020 18:13:17 +0200 +Message-Id: <20200505161318.26200-5-nsaenzjulienne@suse.de> +X-Mailer: git-send-email 2.26.2 +In-Reply-To: <20200505161318.26200-1-nsaenzjulienne@suse.de> +References: <20200505161318.26200-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 -X-CRM114-CacheID: sfid-20200324_112826_791336_2ABB38D1 -X-CRM114-Status: GOOD ( 16.34 ) +X-CRM114-CacheID: sfid-20200505_091332_068613_1A981780 +X-CRM114-Status: GOOD ( 16.37 ) X-Spam-Score: -2.3 (--) -X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: +X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- - 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) - [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] - -0.0 SPF_PASS SPF: sender matches SPF record + 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) + [195.135.220.15 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record + -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 @@ -577,23 +622,21 @@ List-Help: List-Subscribe: , -Cc: f.fainelli@gmail.com, sergei.shtylyov@cogentembedded.com, - gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, - Nicolas Saenz Julienne , tim.gover@raspberrypi.org, +Cc: tim.gover@raspberrypi.org, linux-pci@vger.kernel.org, + linux-usb@vger.kernel.org, Nicolas Saenz Julienne , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, - linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, - wahrenst@gmx.net + linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On the Raspberry Pi 4, after a PCI reset, VL805's firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's -VideCore. Inform VideCore that VL805 was just reset. +VideoCore. Inform VideoCore that VL805 was just reset. Also, as this creates a dependency between USB_PCI and VideoCore's -firmware interface. Since USB_PCI can't be set as a module neither this -should. +firmware interface, and since USB_PCI can't be set as a module neither +this can. Reflect that on the firmware interface Kconfg. Signed-off-by: Nicolas Saenz Julienne --- @@ -616,7 +659,7 @@ Changes since v1: 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig -index ea869addc89b..78ab2ad6d3f0 100644 +index 8007d4aa76dc..b42140cff8ac 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -178,8 +178,9 @@ config ISCSI_IBFT @@ -631,7 +674,7 @@ index ea869addc89b..78ab2ad6d3f0 100644 This option enables support for communicating with the firmware on the Raspberry Pi. diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c -index beb2efa71341..0dc34668bb2a 100644 +index 92150ecdb036..0b949acfa258 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -16,6 +16,9 @@ -- cgit From 4ebe92e7fba08b83aee9900c455ecfaa1573dbc1 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 10 May 2020 12:17:56 +0100 Subject: add usb fix for user space libusb zero copy on some arches --- kernel.spec | 3 + ...rrect-kernel-user-page-attribute-mismatch.patch | 104 +++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 usb-usbfs-correct-kernel-user-page-attribute-mismatch.patch diff --git a/kernel.spec b/kernel.spec index 546109342..f0503d450 100644 --- a/kernel.spec +++ b/kernel.spec @@ -819,6 +819,9 @@ Patch303: ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m400.patch Patch304: ARM-tegra-usb-no-reset.patch +# https://patchwork.kernel.org/patch/11527525/ +Patch305: usb-usbfs-correct-kernel-user-page-attribute-mismatch.patch + # Raspberry Pi # https://patchwork.kernel.org/cover/11353083/ Patch310: arm64-pinctrl-bcm2835-Add-support-for-all-BCM2711-GPIOs.patch diff --git a/usb-usbfs-correct-kernel-user-page-attribute-mismatch.patch b/usb-usbfs-correct-kernel-user-page-attribute-mismatch.patch new file mode 100644 index 000000000..ad65b8db6 --- /dev/null +++ b/usb-usbfs-correct-kernel-user-page-attribute-mismatch.patch @@ -0,0 +1,104 @@ +From patchwork Mon May 4 20:13:48 2020 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Jeremy Linton +X-Patchwork-Id: 11527525 +Return-Path: +Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org + [172.30.200.123]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F74F92A + for ; + Mon, 4 May 2020 20:14:04 +0000 (UTC) +Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) + by mail.kernel.org (Postfix) with ESMTP id 11A4B20746 + for ; + Mon, 4 May 2020 20:14:04 +0000 (UTC) +Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand + id S1726756AbgEDUOB (ORCPT + ); + Mon, 4 May 2020 16:14:01 -0400 +Received: from foss.arm.com ([217.140.110.172]:52874 "EHLO foss.arm.com" + rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP + id S1726111AbgEDUOA (ORCPT ); + Mon, 4 May 2020 16:14:00 -0400 +Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) + by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5BD30101E; + Mon, 4 May 2020 13:14:00 -0700 (PDT) +Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com + [10.118.28.62]) + by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id + 52CCC3F71F; + Mon, 4 May 2020 13:14:00 -0700 (PDT) +From: Jeremy Linton +To: linux-usb@vger.kernel.org +Cc: gregkh@linuxfoundation.org, stern@rowland.harvard.edu, + git@thegavinli.com, jarkko.sakkinen@linux.intel.com, + linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, + mark.rutland@arm.com, maz@kernel.org, robin.murphy@arm.com, + Jeremy Linton +Subject: [PATCH v2] usb: usbfs: correct kernel->user page attribute mismatch +Date: Mon, 4 May 2020 15:13:48 -0500 +Message-Id: <20200504201348.1183246-1-jeremy.linton@arm.com> +X-Mailer: git-send-email 2.24.1 +MIME-Version: 1.0 +Sender: linux-usb-owner@vger.kernel.org +Precedence: bulk +List-ID: +X-Mailing-List: linux-usb@vger.kernel.org + +On some architectures (e.g. arm64) requests for +IO coherent memory may use non-cachable attributes if +the relevant device isn't cache coherent. If these +pages are then remapped into userspace as cacheable, +they may not be coherent with the non-cacheable mappings. + +In particular this happens with libusb, when it attempts +to create zero-copy buffers for use by rtl-sdr +(https://github.com/osmocom/rtl-sdr/). On low end arm +devices with non-coherent USB ports, the application will +be unexpectedly killed, while continuing to work fine on +arm machines with coherent USB controllers. + +This bug has been discovered/reported a few times over +the last few years. In the case of rtl-sdr a compile time +option to enable/disable zero copy was implemented to +work around it. + +Rather than relaying on application specific workarounds, +dma_mmap_coherent() can be used instead of remap_pfn_range(). +The page cache/etc attributes will then be correctly set in +userspace to match the kernel mapping. + +Signed-off-by: Jeremy Linton +--- +v1->v2: + Update commit message and change to dma_mmap_coherent() + from dma_mmap_attr(,,,0) which are the same. + + drivers/usb/core/devio.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c +index 6833c918abce..b9db9812d6c5 100644 +--- a/drivers/usb/core/devio.c ++++ b/drivers/usb/core/devio.c +@@ -217,6 +217,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) + { + struct usb_memory *usbm = NULL; + struct usb_dev_state *ps = file->private_data; ++ struct usb_hcd *hcd = bus_to_hcd(ps->dev->bus); + size_t size = vma->vm_end - vma->vm_start; + void *mem; + unsigned long flags; +@@ -250,9 +251,7 @@ static int usbdev_mmap(struct file *file, struct vm_area_struct *vma) + usbm->vma_use_count = 1; + INIT_LIST_HEAD(&usbm->memlist); + +- if (remap_pfn_range(vma, vma->vm_start, +- virt_to_phys(usbm->mem) >> PAGE_SHIFT, +- size, vma->vm_page_prot) < 0) { ++ if (dma_mmap_coherent(hcd->self.sysdev, vma, mem, dma_handle, size)) { + dec_usb_memory_use_count(usbm, &usbm->vma_use_count); + return -EAGAIN; + } -- cgit From f7dd9b1fa94493688095850c569b2aa02feb61b5 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Mon, 11 May 2020 11:11:22 -0500 Subject: Linux v5.6.12 --- kernel.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel.spec b/kernel.spec index f0503d450..a987805c2 100644 --- a/kernel.spec +++ b/kernel.spec @@ -92,7 +92,7 @@ Summary: The Linux kernel %if 0%{?released_kernel} # Do we have a -stable update to apply? -%define stable_update 11 +%define stable_update 12 # Set rpm version accordingly %if 0%{?stable_update} %define stablerev %{stable_update} @@ -3002,6 +3002,9 @@ fi # # %changelog +* Mon May 11 2020 Justin M. Forbes - 5.6.12-300 +- Linux v5.6.12 + * Wed May 06 2020 Justin M. Forbes - 5.6.11-300 - Linux v5.6.11 diff --git a/sources b/sources index 3244f95a5..ebd905da4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (linux-5.6.tar.xz) = 80846fe2b4e4a7ff471d2dde28a8216ae807a3209f959e93d39ea4fc9a189ea28ec3db9d303b3fe15a28c2cb90e7446876678e93e23353c2d6f262e364a06bc9 -SHA512 (patch-5.6.11.xz) = 0e9bda5aea7617e1d1ec6aa906a7845dd498a30a0e1018583561f3af64d7e67afee3bfffdea2e7eab81d100054aa49b8cfaa0fbfc4e308e7f8b70f21dfdb7908 +SHA512 (patch-5.6.12.xz) = e057961567d8482482ce8e27467b4fc47ddff604a3fd47f5e4f4092a29cc9ef5d180dd739f3edff91ab373108b699c04e55131722e8d4f153f4dd7e7833b48cd -- cgit From 5cd9a1b23bbbec24f24fc08fb3d84de6846db72b Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 12 May 2020 17:29:14 -0500 Subject: Fix CVE-2020-10711 (rhbz 1825116 1834778) Signed-off-by: Justin M. Forbes --- kernel.spec | 6 ++ net-netlabel-cope-with-NULL-catmap.patch | 95 ++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 net-netlabel-cope-with-NULL-catmap.patch diff --git a/kernel.spec b/kernel.spec index a987805c2..a89cbc5ab 100644 --- a/kernel.spec +++ b/kernel.spec @@ -906,6 +906,9 @@ Patch511: e1000e-bump-up-timeout-to-wait-when-ME-un-configure-ULP-mode.patch Patch512: drm-dp_mst-Fix-drm_dp_send_dpcd_write-return-code.patch +# CVE-2020-10711 rhbz 1825116 1834778 +Patch513: net-netlabel-cope-with-NULL-catmap.patch + # END OF PATCH DEFINITIONS %endif @@ -3002,6 +3005,9 @@ fi # # %changelog +* Tue May 12 2020 Justin M. Forbes +- Fix CVE-2020-10711 (rhbz 1825116 1834778) + * Mon May 11 2020 Justin M. Forbes - 5.6.12-300 - Linux v5.6.12 diff --git a/net-netlabel-cope-with-NULL-catmap.patch b/net-netlabel-cope-with-NULL-catmap.patch new file mode 100644 index 000000000..06a915121 --- /dev/null +++ b/net-netlabel-cope-with-NULL-catmap.patch @@ -0,0 +1,95 @@ +From MAILER-DAEMON Tue May 12 19:31:23 2020 +From: Paolo Abeni +To: netdev@vger.kernel.org +Cc: "David S. Miller" , Jakub Kicinski , linux-security-module@vger.kernel.org, Paul Moore , ppandit@redhat.com, Matthew Sheets +Subject: [PATCH net] netlabel: cope with NULL catmap +Date: Tue, 12 May 2020 14:43:14 +0200 +Message-Id: <07d99ae197bfdb2964931201db67b6cd0b38db5b.1589276729.git.pabeni@redhat.com> +Sender: owner-linux-security-module@vger.kernel.org +List-ID: +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 7bit + +The cipso and calipso code can set the MLS_CAT attribute on +successful parsing, even if the corresponding catmap has +not been allocated, as per current configuration and external +input. + +Later, selinux code tries to access the catmap if the MLS_CAT flag +is present via netlbl_catmap_getlong(). That may cause null ptr +dereference while processing incoming network traffic. + +Address the issue setting the MLS_CAT flag only if the catmap is +really allocated. Additionally let netlbl_catmap_getlong() cope +with NULL catmap. + +Fixes: ceba1832b1b2 ("calipso: Set the calipso socket label to match the secattr.") +Fixes: 4b8feff251da ("netlabel: fix the horribly broken catmap functions") +Reported-by: Matthew Sheets +Signed-off-by: Paolo Abeni +--- + net/ipv4/cipso_ipv4.c | 6 ++++-- + net/ipv6/calipso.c | 3 ++- + net/netlabel/netlabel_kapi.c | 6 ++++++ + 3 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c +index 0bd10a1f477f..a23094b050f8 100644 +--- a/net/ipv4/cipso_ipv4.c ++++ b/net/ipv4/cipso_ipv4.c +@@ -1258,7 +1258,8 @@ static int cipso_v4_parsetag_rbm(const struct cipso_v4_doi *doi_def, + return ret_val; + } + +- secattr->flags |= NETLBL_SECATTR_MLS_CAT; ++ if (secattr->attr.mls.cat) ++ secattr->flags |= NETLBL_SECATTR_MLS_CAT; + } + + return 0; +@@ -1439,7 +1440,8 @@ static int cipso_v4_parsetag_rng(const struct cipso_v4_doi *doi_def, + return ret_val; + } + +- secattr->flags |= NETLBL_SECATTR_MLS_CAT; ++ if (secattr->attr.mls.cat) ++ secattr->flags |= NETLBL_SECATTR_MLS_CAT; + } + + return 0; +diff --git a/net/ipv6/calipso.c b/net/ipv6/calipso.c +index 221c81f85cbf..8d3f66c310db 100644 +--- a/net/ipv6/calipso.c ++++ b/net/ipv6/calipso.c +@@ -1047,7 +1047,8 @@ static int calipso_opt_getattr(const unsigned char *calipso, + goto getattr_return; + } + +- secattr->flags |= NETLBL_SECATTR_MLS_CAT; ++ if (secattr->attr.mls.cat) ++ secattr->flags |= NETLBL_SECATTR_MLS_CAT; + } + + secattr->type = NETLBL_NLTYPE_CALIPSO; +diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c +index 409a3ae47ce2..5e1239cef000 100644 +--- a/net/netlabel/netlabel_kapi.c ++++ b/net/netlabel/netlabel_kapi.c +@@ -734,6 +734,12 @@ int netlbl_catmap_getlong(struct netlbl_lsm_catmap *catmap, + if ((off & (BITS_PER_LONG - 1)) != 0) + return -EINVAL; + ++ /* a null catmap is equivalent to an empty one */ ++ if (!catmap) { ++ *offset = (u32)-1; ++ return 0; ++ } ++ + if (off < catmap->startbit) { + off = catmap->startbit; + *offset = off; +-- +2.21.3 + + -- cgit