diff --git a/0001-PATCH-staging-rtl8822be-fix-wrong-dma-unmap-len.patch b/0001-PATCH-staging-rtl8822be-fix-wrong-dma-unmap-len.patch new file mode 100644 index 0000000..540b925 --- /dev/null +++ b/0001-PATCH-staging-rtl8822be-fix-wrong-dma-unmap-len.patch @@ -0,0 +1,46 @@ +From 37af97ef14c201b1db8dd341aabd262da23e48aa Mon Sep 17 00:00:00 2001 +From: Fedora Kernel Team +Date: Mon, 30 Oct 2017 11:38:27 -0500 +Subject: [PATCH] [PATCH] staging: rtl8822be: fix wrong dma unmap len + +Patch fixes splat: + +r8822be 0000:04:00.0: DMA-API: device driver frees DMA memory with different size +[device address=0x0000000078477000] [map size=4096 bytes] [unmap size=424 bytes] + +Call Trace: + debug_dma_unmap_page+0xa5/0xb0 + ? unmap_single+0x2f/0x40 + _rtl8822be_send_bcn_or_cmd_packet+0x2c5/0x300 [r8822be] + ? _rtl8822be_send_bcn_or_cmd_packet+0x2c5/0x300 [r8822be] + rtl8822b_halmac_cb_write_data_rsvd_page+0x51/0xc0 [r8822be] + _halmac_write_data_rsvd_page+0x22/0x30 [r8822be] + halmac_download_rsvd_page_88xx+0xee/0x1f0 [r8822be] + halmac_dlfw_to_mem_88xx+0x80/0x120 [r8822be] + halmac_download_firmware_88xx.part.47+0x477/0x600 [r8822be] + halmac_download_firmware_88xx+0x32/0x40 [r8822be] + rtl_halmac_dlfw+0x70/0x120 [r8822be] + rtl_halmac_init_hal+0x5f/0x1b0 [r8822be] + rtl8822be_hw_init+0x8a2/0x1040 [r8822be] + +Signed-off-by: Stanislaw Gruszka +--- + drivers/staging/rtlwifi/rtl8822be/fw.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/staging/rtlwifi/rtl8822be/fw.c b/drivers/staging/rtlwifi/rtl8822be/fw.c +index 8e24da1..a2cc548 100644 +--- a/drivers/staging/rtlwifi/rtl8822be/fw.c ++++ b/drivers/staging/rtlwifi/rtl8822be/fw.c +@@ -419,7 +419,7 @@ static bool _rtl8822be_send_bcn_or_cmd_packet(struct ieee80211_hw *hw, + dma_addr = rtlpriv->cfg->ops->get_desc( + hw, (u8 *)pbd_desc, true, HW_DESC_TXBUFF_ADDR); + +- pci_unmap_single(rtlpci->pdev, dma_addr, skb->len, ++ pci_unmap_single(rtlpci->pdev, dma_addr, pskb->len, + PCI_DMA_TODEVICE); + kfree_skb(pskb); + +-- +2.13.6 + diff --git a/0001-power-supply-max17042_battery-Add-support-for-ACPI-e.patch b/0001-power-supply-max17042_battery-Add-support-for-ACPI-e.patch deleted file mode 100644 index 858cd5a..0000000 --- a/0001-power-supply-max17042_battery-Add-support-for-ACPI-e.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 075bb90dbb4d894938c5859e3850987238db9cd8 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 11 Aug 2017 22:30:55 +0200 -Subject: [PATCH 1/2] power: supply: max17042_battery: Add support for ACPI - enumeration - -Some x86 devices enumerate a max17047 fuel-gauge through a MAX17047 -ACPI firmware-node, add support for this. - -Signed-off-by: Hans de Goede ---- - drivers/power/supply/max17042_battery.c | 22 +++++++++++++++++++++- - 1 file changed, 21 insertions(+), 1 deletion(-) - -diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c -index aecaaa2b0586..b2ddb7eb69c6 100644 ---- a/drivers/power/supply/max17042_battery.c -+++ b/drivers/power/supply/max17042_battery.c -@@ -22,6 +22,7 @@ - * This driver is based on max17040_battery.c - */ - -+#include - #include - #include - #include -@@ -982,6 +983,8 @@ static int max17042_probe(struct i2c_client *client, - struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - const struct power_supply_desc *max17042_desc = &max17042_psy_desc; - struct power_supply_config psy_cfg = {}; -+ const struct acpi_device_id *acpi_id; -+ struct device *dev = &client->dev; - struct max17042_chip *chip; - int ret; - int i; -@@ -995,7 +998,15 @@ static int max17042_probe(struct i2c_client *client, - return -ENOMEM; - - chip->client = client; -- chip->chip_type = id->driver_data; -+ if (id) { -+ chip->chip_type = id->driver_data; -+ } else { -+ acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); -+ if (!acpi_id) -+ return -ENODEV; -+ -+ chip->chip_type = acpi_id->driver_data; -+ } - chip->regmap = devm_regmap_init_i2c(client, &max17042_regmap_config); - if (IS_ERR(chip->regmap)) { - dev_err(&client->dev, "Failed to initialize regmap\n"); -@@ -1104,6 +1115,14 @@ static int max17042_resume(struct device *dev) - static SIMPLE_DEV_PM_OPS(max17042_pm_ops, max17042_suspend, - max17042_resume); - -+#ifdef CONFIG_ACPI -+static const struct acpi_device_id max17042_acpi_match[] = { -+ { "MAX17047", MAXIM_DEVICE_TYPE_MAX17047 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(acpi, max17042_acpi_match); -+#endif -+ - #ifdef CONFIG_OF - static const struct of_device_id max17042_dt_match[] = { - { .compatible = "maxim,max17042" }, -@@ -1125,6 +1144,7 @@ MODULE_DEVICE_TABLE(i2c, max17042_id); - static struct i2c_driver max17042_i2c_driver = { - .driver = { - .name = "max17042", -+ .acpi_match_table = ACPI_PTR(max17042_acpi_match), - .of_match_table = of_match_ptr(max17042_dt_match), - .pm = &max17042_pm_ops, - }, --- -2.13.4 - diff --git a/0001-powerpc-64s-radix-Fix-128TB-512TB-virtual-address-bo.patch b/0001-powerpc-64s-radix-Fix-128TB-512TB-virtual-address-bo.patch deleted file mode 100644 index 4d2bbfa..0000000 --- a/0001-powerpc-64s-radix-Fix-128TB-512TB-virtual-address-bo.patch +++ /dev/null @@ -1,204 +0,0 @@ -From aca20afc84cf8578e044c67c4949672ac98f064a Mon Sep 17 00:00:00 2001 -From: Nicholas Piggin -Date: Tue, 28 Nov 2017 11:26:54 +0100 -Subject: [PATCH 1/5] powerpc/64s/radix: Fix 128TB-512TB virtual address - boundary case allocation - -commit 85e3f1adcb9d49300b0a943bb93f9604be375bfb upstream. - -Radix VA space allocations test addresses against mm->task_size which -is 512TB, even in cases where the intention is to limit allocation to -below 128TB. - -This results in mmap with a hint address below 128TB but address + -length above 128TB succeeding when it should fail (as hash does after -the previous patch). - -Set the high address limit to be considered up front, and base -subsequent allocation checks on that consistently. - -Fixes: f4ea6dcb08ea ("powerpc/mm: Enable mappings above 128TB") -Signed-off-by: Nicholas Piggin -Reviewed-by: Aneesh Kumar K.V -Signed-off-by: Michael Ellerman -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/mm/hugetlbpage-radix.c | 26 ++++++++++++------ - arch/powerpc/mm/mmap.c | 55 ++++++++++++++++++++++--------------- - 2 files changed, 50 insertions(+), 31 deletions(-) - -diff --git a/arch/powerpc/mm/hugetlbpage-radix.c b/arch/powerpc/mm/hugetlbpage-radix.c -index a12e86395025..0a3d71aae175 100644 ---- a/arch/powerpc/mm/hugetlbpage-radix.c -+++ b/arch/powerpc/mm/hugetlbpage-radix.c -@@ -48,17 +48,28 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; - struct hstate *h = hstate_file(file); -+ int fixed = (flags & MAP_FIXED); -+ unsigned long high_limit; - struct vm_unmapped_area_info info; - -- if (unlikely(addr > mm->context.addr_limit && addr < TASK_SIZE)) -- mm->context.addr_limit = TASK_SIZE; -+ high_limit = DEFAULT_MAP_WINDOW; -+ if (addr >= high_limit || (fixed && (addr + len > high_limit))) -+ high_limit = TASK_SIZE; - - if (len & ~huge_page_mask(h)) - return -EINVAL; -- if (len > mm->task_size) -+ if (len > high_limit) - return -ENOMEM; -+ if (fixed) { -+ if (addr > high_limit - len) -+ return -ENOMEM; -+ } - -- if (flags & MAP_FIXED) { -+ if (unlikely(addr > mm->context.addr_limit && -+ mm->context.addr_limit != TASK_SIZE)) -+ mm->context.addr_limit = TASK_SIZE; -+ -+ if (fixed) { - if (prepare_hugepage_range(file, addr, len)) - return -EINVAL; - return addr; -@@ -67,7 +78,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - if (addr) { - addr = ALIGN(addr, huge_page_size(h)); - vma = find_vma(mm, addr); -- if (mm->task_size - len >= addr && -+ if (high_limit - len >= addr && - (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } -@@ -78,12 +89,9 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, - info.flags = VM_UNMAPPED_AREA_TOPDOWN; - info.length = len; - info.low_limit = PAGE_SIZE; -- info.high_limit = current->mm->mmap_base; -+ info.high_limit = mm->mmap_base + (high_limit - DEFAULT_MAP_WINDOW); - info.align_mask = PAGE_MASK & ~huge_page_mask(h); - info.align_offset = 0; - -- if (addr > DEFAULT_MAP_WINDOW) -- info.high_limit += mm->context.addr_limit - DEFAULT_MAP_WINDOW; -- - return vm_unmapped_area(&info); - } -diff --git a/arch/powerpc/mm/mmap.c b/arch/powerpc/mm/mmap.c -index 5d78b193fec4..6d476a7b5611 100644 ---- a/arch/powerpc/mm/mmap.c -+++ b/arch/powerpc/mm/mmap.c -@@ -106,22 +106,32 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, - { - struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; -+ int fixed = (flags & MAP_FIXED); -+ unsigned long high_limit; - struct vm_unmapped_area_info info; - -+ high_limit = DEFAULT_MAP_WINDOW; -+ if (addr >= high_limit || (fixed && (addr + len > high_limit))) -+ high_limit = TASK_SIZE; -+ -+ if (len > high_limit) -+ return -ENOMEM; -+ if (fixed) { -+ if (addr > high_limit - len) -+ return -ENOMEM; -+ } -+ - if (unlikely(addr > mm->context.addr_limit && - mm->context.addr_limit != TASK_SIZE)) - mm->context.addr_limit = TASK_SIZE; - -- if (len > mm->task_size - mmap_min_addr) -- return -ENOMEM; -- -- if (flags & MAP_FIXED) -+ if (fixed) - return addr; - - if (addr) { - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); -- if (mm->task_size - len >= addr && addr >= mmap_min_addr && -+ if (high_limit - len >= addr && addr >= mmap_min_addr && - (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } -@@ -129,13 +139,9 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, - info.flags = 0; - info.length = len; - info.low_limit = mm->mmap_base; -+ info.high_limit = high_limit; - info.align_mask = 0; - -- if (unlikely(addr > DEFAULT_MAP_WINDOW)) -- info.high_limit = mm->context.addr_limit; -- else -- info.high_limit = DEFAULT_MAP_WINDOW; -- - return vm_unmapped_area(&info); - } - -@@ -149,37 +155,42 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, - struct vm_area_struct *vma; - struct mm_struct *mm = current->mm; - unsigned long addr = addr0; -+ int fixed = (flags & MAP_FIXED); -+ unsigned long high_limit; - struct vm_unmapped_area_info info; - -+ high_limit = DEFAULT_MAP_WINDOW; -+ if (addr >= high_limit || (fixed && (addr + len > high_limit))) -+ high_limit = TASK_SIZE; -+ -+ if (len > high_limit) -+ return -ENOMEM; -+ if (fixed) { -+ if (addr > high_limit - len) -+ return -ENOMEM; -+ } -+ - if (unlikely(addr > mm->context.addr_limit && - mm->context.addr_limit != TASK_SIZE)) - mm->context.addr_limit = TASK_SIZE; - -- /* requested length too big for entire address space */ -- if (len > mm->task_size - mmap_min_addr) -- return -ENOMEM; -- -- if (flags & MAP_FIXED) -+ if (fixed) - return addr; - -- /* requesting a specific address */ - if (addr) { - addr = PAGE_ALIGN(addr); - vma = find_vma(mm, addr); -- if (mm->task_size - len >= addr && addr >= mmap_min_addr && -- (!vma || addr + len <= vm_start_gap(vma))) -+ if (high_limit - len >= addr && addr >= mmap_min_addr && -+ (!vma || addr + len <= vm_start_gap(vma))) - return addr; - } - - info.flags = VM_UNMAPPED_AREA_TOPDOWN; - info.length = len; - info.low_limit = max(PAGE_SIZE, mmap_min_addr); -- info.high_limit = mm->mmap_base; -+ info.high_limit = mm->mmap_base + (high_limit - DEFAULT_MAP_WINDOW); - info.align_mask = 0; - -- if (addr > DEFAULT_MAP_WINDOW) -- info.high_limit += mm->context.addr_limit - DEFAULT_MAP_WINDOW; -- - addr = vm_unmapped_area(&info); - if (!(addr & ~PAGE_MASK)) - return addr; --- -2.14.3 - diff --git a/0002-power-supply-max17042_battery-Fix-ACPI-interrupt-iss.patch b/0002-power-supply-max17042_battery-Fix-ACPI-interrupt-iss.patch deleted file mode 100644 index 6daecaf..0000000 --- a/0002-power-supply-max17042_battery-Fix-ACPI-interrupt-iss.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 27b9d46d25c873b351757c44ce523bf0ede1d08e Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 14 Aug 2017 11:02:59 +0200 -Subject: [PATCH 2/2] power: supply: max17042_battery: Fix ACPI interrupt - issues - -On some x86/ACPI boards the DSDT defines an ACPI event handler for -the max17047 IRQ, this causes several problems: - -1) We need to share the IRQ to avoid an error getting it - -2) Even of we are willing to share, we may fail to share because some - DSDTs claim it exclusivly - -3) If we are unable to share the IRQ, or the IRQ is only listed as an - ACPI event source and not in the max1704 firmware node, then the - charge threshold IRQ (which is used to give an IRQ every 1 percent - charge change) becomes a problem, the ACPI event handler will not - update this to the next 1 percent threshold, so the IRQ keeps firing - and we get an IRQ storm pegging 1 CPU core. - - This happens despite the max17042 driver not setting the charge - threshold because Windows uses it and leaves it set on reboot. - - So if we are unable to get the IRQ we need to reprogram the - charge threshold to its disabled setting. - -This commit fixes al of the above, while at it it also makes the error -msg when being unable to get the IRQ consistent with other messages. - -Signed-off-by: Hans de Goede ---- - drivers/power/supply/max17042_battery.c | 20 +++++++++++++++----- - 1 file changed, 15 insertions(+), 5 deletions(-) - -diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c -index b2ddb7eb69c6..18a44e4ed6ff 100644 ---- a/drivers/power/supply/max17042_battery.c -+++ b/drivers/power/supply/max17042_battery.c -@@ -1050,11 +1050,18 @@ static int max17042_probe(struct i2c_client *client, - } - - if (client->irq) { -+ unsigned int flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT; -+ -+ /* -+ * On ACPI systems the IRQ may be handled by ACPI-event code, -+ * so we need to share (if the ACPI code is willing to share). -+ */ -+ if (acpi_id) -+ flags |= IRQF_SHARED | IRQF_PROBE_SHARED; -+ - ret = devm_request_threaded_irq(&client->dev, client->irq, - NULL, -- max17042_thread_handler, -- IRQF_TRIGGER_FALLING | -- IRQF_ONESHOT, -+ max17042_thread_handler, flags, - chip->battery->desc->name, - chip); - if (!ret) { -@@ -1064,10 +1071,13 @@ static int max17042_probe(struct i2c_client *client, - max17042_set_soc_threshold(chip, 1); - } else { - client->irq = 0; -- dev_err(&client->dev, "%s(): cannot get IRQ\n", -- __func__); -+ if (ret != -EBUSY) -+ dev_err(&client->dev, "Failed to get IRQ\n"); - } - } -+ /* Not able to update the charge threshold when exceeded? -> disable */ -+ if (!client->irq) -+ regmap_write(chip->regmap, MAX17042_SALRT_Th, 0xff00); - - regmap_read(chip->regmap, MAX17042_STATUS, &val); - if (val & STATUS_POR_BIT) { --- -2.13.4 - diff --git a/0002-powerpc-64s-hash-Fix-512T-hint-detection-to-use-128T.patch b/0002-powerpc-64s-hash-Fix-512T-hint-detection-to-use-128T.patch deleted file mode 100644 index fc6b806..0000000 --- a/0002-powerpc-64s-hash-Fix-512T-hint-detection-to-use-128T.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 75c7f5172c113af1ea3cf094436c9e03191673e0 Mon Sep 17 00:00:00 2001 -From: Michael Ellerman -Date: Tue, 28 Nov 2017 11:26:55 +0100 -Subject: [PATCH 2/5] powerpc/64s/hash: Fix 512T hint detection to use >= 128T - -commit 7ece370996b694ae263025e056ad785afc1be5ab upstream. - -Currently userspace is able to request mmap() search between 128T-512T -by specifying a hint address that is greater than 128T. But that means -a hint of 128T exactly will return an address below 128T, which is -confusing and wrong. - -So fix the logic to check the hint is greater than *or equal* to 128T. - -Fixes: f4ea6dcb08ea ("powerpc/mm: Enable mappings above 128TB") -Suggested-by: Aneesh Kumar K.V -Suggested-by: Nicholas Piggin -[mpe: Split out of Nick's bigger patch] -Signed-off-by: Michael Ellerman -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/mm/slice.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 45f6740dd407..48a5312103a1 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -419,7 +419,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, - /* - * Check if we need to expland slice area. - */ -- if (unlikely(addr > mm->context.addr_limit && -+ if (unlikely(addr >= mm->context.addr_limit && - mm->context.addr_limit != TASK_SIZE)) { - mm->context.addr_limit = TASK_SIZE; - on_each_cpu(slice_flush_segments, mm, 1); -@@ -427,7 +427,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, - /* - * This mmap request can allocate upt to 512TB - */ -- if (addr > DEFAULT_MAP_WINDOW) -+ if (addr >= DEFAULT_MAP_WINDOW) - high_limit = mm->context.addr_limit; - else - high_limit = DEFAULT_MAP_WINDOW; --- -2.14.3 - diff --git a/0003-powerpc-64s-hash-Fix-128TB-512TB-virtual-address-bou.patch b/0003-powerpc-64s-hash-Fix-128TB-512TB-virtual-address-bou.patch deleted file mode 100644 index 009068a..0000000 --- a/0003-powerpc-64s-hash-Fix-128TB-512TB-virtual-address-bou.patch +++ /dev/null @@ -1,129 +0,0 @@ -From e90387a8d2227f95bf5e5b5ffd816d48a87466e2 Mon Sep 17 00:00:00 2001 -From: Nicholas Piggin -Date: Tue, 28 Nov 2017 11:26:56 +0100 -Subject: [PATCH 3/5] powerpc/64s/hash: Fix 128TB-512TB virtual address - boundary case allocation - -commit 6a72dc038b615229a1b285829d6c8378d15c2347 upstream. - -When allocating VA space with a hint that crosses 128TB, the SLB -addr_limit variable is not expanded if addr is not > 128TB, but the -slice allocation looks at task_size, which is 512TB. This results in -slice_check_fit() incorrectly succeeding because the slice_count -truncates off bit 128 of the requested mask, so the comparison to the -available mask succeeds. - -Fix this by using mm->context.addr_limit instead of mm->task_size for -testing allocation limits. This causes such allocations to fail. - -Fixes: f4ea6dcb08ea ("powerpc/mm: Enable mappings above 128TB") -Reported-by: Florian Weimer -Signed-off-by: Nicholas Piggin -Reviewed-by: Aneesh Kumar K.V -Signed-off-by: Michael Ellerman -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/mm/slice.c | 50 ++++++++++++++++++++++++------------------------- - 1 file changed, 24 insertions(+), 26 deletions(-) - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 48a5312103a1..3889201b560c 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -96,7 +96,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, - { - struct vm_area_struct *vma; - -- if ((mm->task_size - len) < addr) -+ if ((mm->context.addr_limit - len) < addr) - return 0; - vma = find_vma(mm, addr); - return (!vma || (addr + len) <= vm_start_gap(vma)); -@@ -133,7 +133,7 @@ static void slice_mask_for_free(struct mm_struct *mm, struct slice_mask *ret) - if (!slice_low_has_vma(mm, i)) - ret->low_slices |= 1u << i; - -- if (mm->task_size <= SLICE_LOW_TOP) -+ if (mm->context.addr_limit <= SLICE_LOW_TOP) - return; - - for (i = 0; i < GET_HIGH_SLICE_INDEX(mm->context.addr_limit); i++) -@@ -412,25 +412,31 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, - struct slice_mask compat_mask; - int fixed = (flags & MAP_FIXED); - int pshift = max_t(int, mmu_psize_defs[psize].shift, PAGE_SHIFT); -+ unsigned long page_size = 1UL << pshift; - struct mm_struct *mm = current->mm; - unsigned long newaddr; - unsigned long high_limit; - -- /* -- * Check if we need to expland slice area. -- */ -- if (unlikely(addr >= mm->context.addr_limit && -- mm->context.addr_limit != TASK_SIZE)) { -- mm->context.addr_limit = TASK_SIZE; -+ high_limit = DEFAULT_MAP_WINDOW; -+ if (addr >= high_limit) -+ high_limit = TASK_SIZE; -+ -+ if (len > high_limit) -+ return -ENOMEM; -+ if (len & (page_size - 1)) -+ return -EINVAL; -+ if (fixed) { -+ if (addr & (page_size - 1)) -+ return -EINVAL; -+ if (addr > high_limit - len) -+ return -ENOMEM; -+ } -+ -+ if (high_limit > mm->context.addr_limit) { -+ mm->context.addr_limit = high_limit; - on_each_cpu(slice_flush_segments, mm, 1); - } -- /* -- * This mmap request can allocate upt to 512TB -- */ -- if (addr >= DEFAULT_MAP_WINDOW) -- high_limit = mm->context.addr_limit; -- else -- high_limit = DEFAULT_MAP_WINDOW; -+ - /* - * init different masks - */ -@@ -446,27 +452,19 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, - - /* Sanity checks */ - BUG_ON(mm->task_size == 0); -+ BUG_ON(mm->context.addr_limit == 0); - VM_BUG_ON(radix_enabled()); - - slice_dbg("slice_get_unmapped_area(mm=%p, psize=%d...\n", mm, psize); - slice_dbg(" addr=%lx, len=%lx, flags=%lx, topdown=%d\n", - addr, len, flags, topdown); - -- if (len > mm->task_size) -- return -ENOMEM; -- if (len & ((1ul << pshift) - 1)) -- return -EINVAL; -- if (fixed && (addr & ((1ul << pshift) - 1))) -- return -EINVAL; -- if (fixed && addr > (mm->task_size - len)) -- return -ENOMEM; -- - /* If hint, make sure it matches our alignment restrictions */ - if (!fixed && addr) { -- addr = _ALIGN_UP(addr, 1ul << pshift); -+ addr = _ALIGN_UP(addr, page_size); - slice_dbg(" aligned addr=%lx\n", addr); - /* Ignore hint if it's too large or overlaps a VMA */ -- if (addr > mm->task_size - len || -+ if (addr > high_limit - len || - !slice_area_is_free(mm, addr, len)) - addr = 0; - } --- -2.14.3 - diff --git a/0004-powerpc-64s-hash-Fix-fork-with-512TB-process-address.patch b/0004-powerpc-64s-hash-Fix-fork-with-512TB-process-address.patch deleted file mode 100644 index 75d9d32..0000000 --- a/0004-powerpc-64s-hash-Fix-fork-with-512TB-process-address.patch +++ /dev/null @@ -1,48 +0,0 @@ -From fe50aa4374f20333d9b077bbe09397d38112b081 Mon Sep 17 00:00:00 2001 -From: Nicholas Piggin -Date: Tue, 28 Nov 2017 11:26:57 +0100 -Subject: [PATCH 4/5] powerpc/64s/hash: Fix fork() with 512TB process address - space - -commit effc1b25088502fbd30305c79773de2d1f7470a6 upstream. - -Hash unconditionally resets the addr_limit to default (128TB) when the -mm context is initialised. If a process has > 128TB mappings when it -forks, the child will not get the 512TB addr_limit, so accesses to -valid > 128TB mappings will fail in the child. - -Fix this by only resetting the addr_limit to default if it was 0. Non -zero indicates it was duplicated from the parent (0 means exec()). - -Fixes: f4ea6dcb08ea ("powerpc/mm: Enable mappings above 128TB") -Signed-off-by: Nicholas Piggin -Reviewed-by: Aneesh Kumar K.V -Signed-off-by: Michael Ellerman -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/mm/mmu_context_book3s64.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c -index a75f63833284..bb9cdf01fc4f 100644 ---- a/arch/powerpc/mm/mmu_context_book3s64.c -+++ b/arch/powerpc/mm/mmu_context_book3s64.c -@@ -95,11 +95,11 @@ static int hash__init_new_context(struct mm_struct *mm) - return index; - - /* -- * We do switch_slb() early in fork, even before we setup the -- * mm->context.addr_limit. Default to max task size so that we copy the -- * default values to paca which will help us to handle slb miss early. -+ * In the case of exec, use the default limit, -+ * otherwise inherit it from the mm we are duplicating. - */ -- mm->context.addr_limit = DEFAULT_MAP_WINDOW_USER64; -+ if (!mm->context.addr_limit) -+ mm->context.addr_limit = DEFAULT_MAP_WINDOW_USER64; - - /* - * The old code would re-promote on fork, we don't do that when using --- -2.14.3 - diff --git a/0005-powerpc-64s-hash-Allow-MAP_FIXED-allocations-to-cros.patch b/0005-powerpc-64s-hash-Allow-MAP_FIXED-allocations-to-cros.patch deleted file mode 100644 index e7e9a4a..0000000 --- a/0005-powerpc-64s-hash-Allow-MAP_FIXED-allocations-to-cros.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 2beb551e379191c2a24e7db8c4fcc64fef4b921a Mon Sep 17 00:00:00 2001 -From: Nicholas Piggin -Date: Tue, 28 Nov 2017 11:26:58 +0100 -Subject: [PATCH 5/5] powerpc/64s/hash: Allow MAP_FIXED allocations to cross - 128TB boundary - -commit 35602f82d0c765f991420e319c8d3a596c921eb8 upstream. - -While mapping hints with a length that cross 128TB are disallowed, -MAP_FIXED allocations that cross 128TB are allowed. These are failing -on hash (on radix they succeed). Add an additional case for fixed -mappings to expand the addr_limit when crossing 128TB. - -Fixes: f4ea6dcb08ea ("powerpc/mm: Enable mappings above 128TB") -Signed-off-by: Nicholas Piggin -Reviewed-by: Aneesh Kumar K.V -Signed-off-by: Michael Ellerman -Signed-off-by: Greg Kroah-Hartman ---- - arch/powerpc/mm/slice.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c -index 3889201b560c..a4f93699194b 100644 ---- a/arch/powerpc/mm/slice.c -+++ b/arch/powerpc/mm/slice.c -@@ -418,7 +418,7 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, - unsigned long high_limit; - - high_limit = DEFAULT_MAP_WINDOW; -- if (addr >= high_limit) -+ if (addr >= high_limit || (fixed && (addr + len > high_limit))) - high_limit = TASK_SIZE; - - if (len > high_limit) --- -2.14.3 - diff --git a/0011-Input-goodix-Add-support-for-capacitive-home-button.patch b/0011-Input-goodix-Add-support-for-capacitive-home-button.patch deleted file mode 100644 index 162357c..0000000 --- a/0011-Input-goodix-Add-support-for-capacitive-home-button.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 2a99775c336303d2efc43eab4f24b34722a28faa Mon Sep 17 00:00:00 2001 -From: "Sergei A. Trusov" -Date: Tue, 20 Jun 2017 18:08:35 +0200 -Subject: [PATCH 11/16] Input: goodix: Add support for capacitive home button - -On some x86 tablets with a Goodix touchscreen, the Windows logo on the -front is a capacitive home button. Touching this button results in a touch -with bit 4 of the first byte set, while only the lower 4 bits (0-3) are -used to indicate the number of touches. - -Report a KEY_LEFTMETA press when this happens. - -Note that the hardware might support more than one button, in which -case the "id" byte of coor_data would identify the button in question. -This is not implemented as we don't have access to hardware with -multiple buttons. - -Signed-off-by: Sergei A. Trusov -Acked-by: Bastien Nocera ---- - drivers/input/touchscreen/goodix.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c -index 240b16f3ee97..903137d9cf7d 100644 ---- a/drivers/input/touchscreen/goodix.c -+++ b/drivers/input/touchscreen/goodix.c -@@ -267,6 +267,12 @@ static void goodix_process_events(struct goodix_ts_data *ts) - if (touch_num < 0) - return; - -+ /* -+ * Bit 4 of the first byte reports the status of the capacitive -+ * Windows/Home button. -+ */ -+ input_report_key(ts->input_dev, KEY_LEFTMETA, !!(point_data[0] & BIT(4))); -+ - for (i = 0; i < touch_num; i++) - goodix_ts_report_touch(ts, - &point_data[1 + GOODIX_CONTACT_SIZE * i]); -@@ -612,6 +618,9 @@ static int goodix_request_input_dev(struct goodix_ts_data *ts) - ts->input_dev->id.product = ts->id; - ts->input_dev->id.version = ts->version; - -+ /* Capacitive Windows/Home button on some devices */ -+ input_set_capability(ts->input_dev, EV_KEY, KEY_LEFTMETA); -+ - error = input_register_device(ts->input_dev); - if (error) { - dev_err(&ts->client->dev, --- -2.13.0 - diff --git a/0013-iio-accel-bmc150-Add-support-for-BOSC0200-ACPI-devic.patch b/0013-iio-accel-bmc150-Add-support-for-BOSC0200-ACPI-devic.patch deleted file mode 100644 index 8eb41ee..0000000 --- a/0013-iio-accel-bmc150-Add-support-for-BOSC0200-ACPI-devic.patch +++ /dev/null @@ -1,32 +0,0 @@ -From bf3e9581e10a19b2ce77a45fe001116d269b4c7f Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sun, 18 Jun 2017 12:47:38 +0200 -Subject: [PATCH 13/16] iio: accel: bmc150: Add support for BOSC0200 ACPI - device id - -Add support for the BOSC0200 ACPI device id used on some x86 tablets. -note driver_data is not set to a specific model, driver_data is not -used anyways (instead detection is done on the chip_id reg) and the -2 tablets with a BOSC0200 ACPI device id I've have 2 different chips, -one has a BMA250E, the other a BMA222E. - -Signed-off-by: Hans de Goede ---- - drivers/iio/accel/bmc150-accel-i2c.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/iio/accel/bmc150-accel-i2c.c b/drivers/iio/accel/bmc150-accel-i2c.c -index 8ca8041267ef..f85014fbaa12 100644 ---- a/drivers/iio/accel/bmc150-accel-i2c.c -+++ b/drivers/iio/accel/bmc150-accel-i2c.c -@@ -64,6 +64,7 @@ static const struct acpi_device_id bmc150_accel_acpi_match[] = { - {"BMA250E", bma250e}, - {"BMA222E", bma222e}, - {"BMA0280", bma280}, -+ {"BOSC0200"}, - { }, - }; - MODULE_DEVICE_TABLE(acpi, bmc150_accel_acpi_match); --- -2.13.0 - diff --git a/0015-i2c-cht-wc-Add-Intel-Cherry-Trail-Whiskey-Cove-SMBUS.patch b/0015-i2c-cht-wc-Add-Intel-Cherry-Trail-Whiskey-Cove-SMBUS.patch deleted file mode 100644 index 5d7497c..0000000 --- a/0015-i2c-cht-wc-Add-Intel-Cherry-Trail-Whiskey-Cove-SMBUS.patch +++ /dev/null @@ -1,410 +0,0 @@ -From bd0d7169342e47919f68e75d659968f02b62f84b Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 3 Mar 2017 23:48:50 +0100 -Subject: [PATCH 15/16] i2c-cht-wc: Add Intel Cherry Trail Whiskey Cove SMBUS - controller driver - -The Intel Cherry Trail Whiskey Cove PMIC does not contain a builtin -battery charger, instead boards with this PMIC use an external TI -bq24292i charger IC, which is connected to a SMBUS controller built into -the PMIC. - -This commit adds an i2c-bus driver for the PMIC's builtin SMBUS -controller. The probe function for this i2c-bus will also register an -i2c-client for the TI bq24292i charger after the i2c-bus has been -registered. - -Note that several device-properties are set on the client-device to -tell the bq24190 power-supply driver to integrate the Whiskey Cove PMIC -and e.g. use the PMIC's BC1.2 detection (through extcon) to determine -the maximum input current. - -Cc: Andy Shevchenko -Signed-off-by: Hans de Goede ---- -Changes in v2: --Various style (mostly captialization and variable name) fixes --Use device-properties instead of platform_data for the i2c_board_info ---- - drivers/i2c/busses/Kconfig | 8 + - drivers/i2c/busses/Makefile | 1 + - drivers/i2c/busses/i2c-cht-wc.c | 336 ++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 345 insertions(+) - create mode 100644 drivers/i2c/busses/i2c-cht-wc.c - -diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig -index 144cbadc7c72..18c96178b177 100644 ---- a/drivers/i2c/busses/Kconfig -+++ b/drivers/i2c/busses/Kconfig -@@ -187,6 +187,14 @@ config I2C_PIIX4 - This driver can also be built as a module. If so, the module - will be called i2c-piix4. - -+config I2C_CHT_WC -+ tristate "Intel Cherry Trail Whiskey Cove PMIC smbus controller" -+ depends on INTEL_SOC_PMIC_CHTWC -+ help -+ If you say yes to this option, support will be included for the -+ SMBus controller found in the Intel Cherry Trail Whiskey Cove PMIC -+ found on some Intel Cherry Trail systems. -+ - config I2C_NFORCE2 - tristate "Nvidia nForce2, nForce3 and nForce4" - depends on PCI -diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile -index 30b60855fbcd..f6443fa44f61 100644 ---- a/drivers/i2c/busses/Makefile -+++ b/drivers/i2c/busses/Makefile -@@ -12,6 +12,7 @@ obj-$(CONFIG_I2C_ALI15X3) += i2c-ali15x3.o - obj-$(CONFIG_I2C_AMD756) += i2c-amd756.o - obj-$(CONFIG_I2C_AMD756_S4882) += i2c-amd756-s4882.o - obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o -+obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o - obj-$(CONFIG_I2C_I801) += i2c-i801.o - obj-$(CONFIG_I2C_ISCH) += i2c-isch.o - obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o -diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c -new file mode 100644 -index 000000000000..ccf0785bcb75 ---- /dev/null -+++ b/drivers/i2c/busses/i2c-cht-wc.c -@@ -0,0 +1,336 @@ -+/* -+ * Intel CHT Whiskey Cove PMIC I2C Master driver -+ * Copyright (C) 2017 Hans de Goede -+ * -+ * Based on various non upstream patches to support the CHT Whiskey Cove PMIC: -+ * Copyright (C) 2011 - 2014 Intel Corporation. All rights reserved. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License version -+ * 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define CHT_WC_I2C_CTRL 0x5e24 -+#define CHT_WC_I2C_CTRL_WR BIT(0) -+#define CHT_WC_I2C_CTRL_RD BIT(1) -+#define CHT_WC_I2C_CLIENT_ADDR 0x5e25 -+#define CHT_WC_I2C_REG_OFFSET 0x5e26 -+#define CHT_WC_I2C_WRDATA 0x5e27 -+#define CHT_WC_I2C_RDDATA 0x5e28 -+ -+#define CHT_WC_EXTCHGRIRQ 0x6e0a -+#define CHT_WC_EXTCHGRIRQ_CLIENT_IRQ BIT(0) -+#define CHT_WC_EXTCHGRIRQ_WRITE_IRQ BIT(1) -+#define CHT_WC_EXTCHGRIRQ_READ_IRQ BIT(2) -+#define CHT_WC_EXTCHGRIRQ_NACK_IRQ BIT(3) -+#define CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK ((u8)GENMASK(3, 1)) -+#define CHT_WC_EXTCHGRIRQ_MSK 0x6e17 -+ -+struct cht_wc_i2c_adap { -+ struct i2c_adapter adapter; -+ wait_queue_head_t wait; -+ struct irq_chip irqchip; -+ struct mutex irqchip_lock; -+ struct regmap *regmap; -+ struct irq_domain *irq_domain; -+ struct i2c_client *client; -+ int client_irq; -+ u8 irq_mask; -+ u8 old_irq_mask; -+ bool nack; -+ bool done; -+}; -+ -+static irqreturn_t cht_wc_i2c_adap_thread_handler(int id, void *data) -+{ -+ struct cht_wc_i2c_adap *adap = data; -+ int ret, reg; -+ -+ /* Read IRQs */ -+ ret = regmap_read(adap->regmap, CHT_WC_EXTCHGRIRQ, ®); -+ if (ret) { -+ dev_err(&adap->adapter.dev, "Error reading extchgrirq reg\n"); -+ return IRQ_NONE; -+ } -+ -+ reg &= ~adap->irq_mask; -+ -+ /* -+ * Immediately ack IRQs, so that if new IRQs arrives while we're -+ * handling the previous ones our irq will re-trigger when we're done. -+ */ -+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ, reg); -+ if (ret) -+ dev_err(&adap->adapter.dev, "Error writing extchgrirq reg\n"); -+ -+ /* -+ * Do NOT use handle_nested_irq here, the client irq handler will -+ * likely want to do i2c transfers and the i2c controller uses this -+ * interrupt handler as well, so running the client irq handler from -+ * this thread will cause things to lock up. -+ */ -+ if (reg & CHT_WC_EXTCHGRIRQ_CLIENT_IRQ) { -+ /* -+ * generic_handle_irq expects local IRQs to be disabled -+ * as normally it is called from interrupt context. -+ */ -+ local_irq_disable(); -+ generic_handle_irq(adap->client_irq); -+ local_irq_enable(); -+ } -+ -+ if (reg & CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK) { -+ adap->nack = !!(reg & CHT_WC_EXTCHGRIRQ_NACK_IRQ); -+ adap->done = true; -+ wake_up(&adap->wait); -+ } -+ -+ return IRQ_HANDLED; -+} -+ -+static u32 cht_wc_i2c_adap_master_func(struct i2c_adapter *adap) -+{ -+ /* This i2c adapter only supports SMBUS byte transfers */ -+ return I2C_FUNC_SMBUS_BYTE_DATA; -+} -+ -+static int cht_wc_i2c_adap_smbus_xfer(struct i2c_adapter *_adap, u16 addr, -+ unsigned short flags, char read_write, -+ u8 command, int size, -+ union i2c_smbus_data *data) -+{ -+ struct cht_wc_i2c_adap *adap = i2c_get_adapdata(_adap); -+ int ret, reg; -+ -+ adap->nack = false; -+ adap->done = false; -+ -+ ret = regmap_write(adap->regmap, CHT_WC_I2C_CLIENT_ADDR, addr); -+ if (ret) -+ return ret; -+ -+ if (read_write == I2C_SMBUS_WRITE) { -+ ret = regmap_write(adap->regmap, CHT_WC_I2C_WRDATA, data->byte); -+ if (ret) -+ return ret; -+ } -+ -+ ret = regmap_write(adap->regmap, CHT_WC_I2C_REG_OFFSET, command); -+ if (ret) -+ return ret; -+ -+ ret = regmap_write(adap->regmap, CHT_WC_I2C_CTRL, -+ (read_write == I2C_SMBUS_WRITE) ? -+ CHT_WC_I2C_CTRL_WR : CHT_WC_I2C_CTRL_RD); -+ if (ret) -+ return ret; -+ -+ /* 3 second timeout, during cable plug the PMIC responds quite slow */ -+ ret = wait_event_timeout(adap->wait, adap->done, 3 * HZ); -+ if (ret == 0) -+ return -ETIMEDOUT; -+ if (adap->nack) -+ return -EIO; -+ -+ if (read_write == I2C_SMBUS_READ) { -+ ret = regmap_read(adap->regmap, CHT_WC_I2C_RDDATA, ®); -+ if (ret) -+ return ret; -+ -+ data->byte = reg; -+ } -+ -+ return 0; -+} -+ -+static const struct i2c_algorithm cht_wc_i2c_adap_algo = { -+ .functionality = cht_wc_i2c_adap_master_func, -+ .smbus_xfer = cht_wc_i2c_adap_smbus_xfer, -+}; -+ -+/**** irqchip for the client connected to the extchgr i2c adapter ****/ -+static void cht_wc_i2c_irq_lock(struct irq_data *data) -+{ -+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data); -+ -+ mutex_lock(&adap->irqchip_lock); -+} -+ -+static void cht_wc_i2c_irq_sync_unlock(struct irq_data *data) -+{ -+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data); -+ int ret; -+ -+ if (adap->irq_mask != adap->old_irq_mask) { -+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ_MSK, -+ adap->irq_mask); -+ if (ret == 0) -+ adap->old_irq_mask = adap->irq_mask; -+ else -+ dev_err(&adap->adapter.dev, "Error writing EXTCHGRIRQ_MSK\n"); -+ } -+ -+ mutex_unlock(&adap->irqchip_lock); -+} -+ -+static void cht_wc_i2c_irq_enable(struct irq_data *data) -+{ -+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data); -+ -+ adap->irq_mask &= ~CHT_WC_EXTCHGRIRQ_CLIENT_IRQ; -+} -+ -+static void cht_wc_i2c_irq_disable(struct irq_data *data) -+{ -+ struct cht_wc_i2c_adap *adap = irq_data_get_irq_chip_data(data); -+ -+ adap->irq_mask |= CHT_WC_EXTCHGRIRQ_CLIENT_IRQ; -+} -+ -+static const struct irq_chip cht_wc_i2c_irq_chip = { -+ .irq_bus_lock = cht_wc_i2c_irq_lock, -+ .irq_bus_sync_unlock = cht_wc_i2c_irq_sync_unlock, -+ .irq_disable = cht_wc_i2c_irq_disable, -+ .irq_enable = cht_wc_i2c_irq_enable, -+ .name = "cht_wc_ext_chrg_irq_chip", -+}; -+ -+static const struct property_entry bq24190_props[] = { -+ PROPERTY_ENTRY_STRING("extcon-name", "cht_wcove_pwrsrc"), -+ PROPERTY_ENTRY_BOOL("omit-battery-class"), -+ PROPERTY_ENTRY_BOOL("disable-reset"), -+ { } -+}; -+ -+static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev) -+{ -+ struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent); -+ struct cht_wc_i2c_adap *adap; -+ struct i2c_board_info board_info = { -+ .type = "bq24190", -+ .addr = 0x6b, -+ .properties = bq24190_props, -+ }; -+ int ret, irq; -+ -+ irq = platform_get_irq(pdev, 0); -+ if (irq < 0) { -+ dev_err(&pdev->dev, "Error missing irq resource\n"); -+ return -EINVAL; -+ } -+ -+ adap = devm_kzalloc(&pdev->dev, sizeof(*adap), GFP_KERNEL); -+ if (!adap) -+ return -ENOMEM; -+ -+ init_waitqueue_head(&adap->wait); -+ mutex_init(&adap->irqchip_lock); -+ adap->irqchip = cht_wc_i2c_irq_chip; -+ adap->regmap = pmic->regmap; -+ adap->adapter.owner = THIS_MODULE; -+ adap->adapter.class = I2C_CLASS_HWMON; -+ adap->adapter.algo = &cht_wc_i2c_adap_algo; -+ strlcpy(adap->adapter.name, "PMIC I2C Adapter", -+ sizeof(adap->adapter.name)); -+ adap->adapter.dev.parent = &pdev->dev; -+ -+ /* Clear and activate i2c-adapter interrupts, disable client IRQ */ -+ adap->old_irq_mask = adap->irq_mask = ~CHT_WC_EXTCHGRIRQ_ADAP_IRQMASK; -+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ, ~adap->irq_mask); -+ if (ret) -+ return ret; -+ -+ ret = regmap_write(adap->regmap, CHT_WC_EXTCHGRIRQ_MSK, adap->irq_mask); -+ if (ret) -+ return ret; -+ -+ /* Alloc and register client IRQ */ -+ adap->irq_domain = irq_domain_add_linear(pdev->dev.of_node, 1, -+ &irq_domain_simple_ops, NULL); -+ if (!adap->irq_domain) -+ return -ENOMEM; -+ -+ adap->client_irq = irq_create_mapping(adap->irq_domain, 0); -+ if (!adap->client_irq) { -+ ret = -ENOMEM; -+ goto remove_irq_domain; -+ } -+ -+ irq_set_chip_data(adap->client_irq, adap); -+ irq_set_chip_and_handler(adap->client_irq, &adap->irqchip, -+ handle_simple_irq); -+ -+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, -+ cht_wc_i2c_adap_thread_handler, -+ IRQF_ONESHOT, "PMIC I2C Adapter", adap); -+ if (ret) -+ goto remove_irq_domain; -+ -+ i2c_set_adapdata(&adap->adapter, adap); -+ ret = i2c_add_adapter(&adap->adapter); -+ if (ret) -+ goto remove_irq_domain; -+ -+ board_info.irq = adap->client_irq; -+ adap->client = i2c_new_device(&adap->adapter, &board_info); -+ if (!adap->client) { -+ ret = -ENOMEM; -+ goto del_adapter; -+ } -+ -+ platform_set_drvdata(pdev, adap); -+ return 0; -+ -+del_adapter: -+ i2c_del_adapter(&adap->adapter); -+remove_irq_domain: -+ irq_domain_remove(adap->irq_domain); -+ return ret; -+} -+ -+static int cht_wc_i2c_adap_i2c_remove(struct platform_device *pdev) -+{ -+ struct cht_wc_i2c_adap *adap = platform_get_drvdata(pdev); -+ -+ i2c_unregister_device(adap->client); -+ i2c_del_adapter(&adap->adapter); -+ irq_domain_remove(adap->irq_domain); -+ -+ return 0; -+} -+ -+static struct platform_device_id cht_wc_i2c_adap_id_table[] = { -+ { .name = "cht_wcove_ext_chgr" }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(platform, cht_wc_i2c_adap_id_table); -+ -+struct platform_driver cht_wc_i2c_adap_driver = { -+ .probe = cht_wc_i2c_adap_i2c_probe, -+ .remove = cht_wc_i2c_adap_i2c_remove, -+ .driver = { -+ .name = "cht_wcove_ext_chgr", -+ }, -+ .id_table = cht_wc_i2c_adap_id_table, -+}; -+module_platform_driver(cht_wc_i2c_adap_driver); -+ -+MODULE_DESCRIPTION("Intel CHT Whiskey Cove PMIC I2C Master driver"); -+MODULE_AUTHOR("Hans de Goede "); -+MODULE_LICENSE("GPL"); --- -2.13.0 - diff --git a/1-2-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-NMI.patch b/1-2-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-NMI.patch deleted file mode 100644 index ca079af..0000000 --- a/1-2-kvm-vmx-Reinstate-support-for-CPUs-without-virtual-NMI.patch +++ /dev/null @@ -1,296 +0,0 @@ -From patchwork Mon Nov 6 12:31:12 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [1/2] kvm: vmx: Reinstate support for CPUs without virtual NMI -From: Paolo Bonzini -X-Patchwork-Id: 10043403 -Message-Id: <1509971473-74491-2-git-send-email-pbonzini@redhat.com> -To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org -Cc: rkrcmar@redhat.com, stable@vger.kernel.org -Date: Mon, 6 Nov 2017 13:31:12 +0100 - -This is more or less a revert of commit 2c82878b0cb3 ("KVM: VMX: require -virtual NMI support", 2017-03-27); it turns out that Core 2 Duo machines -only had virtual NMIs in some SKUs. - -The revert is not trivial because in the meanwhile there have been several -fixes to nested NMI injection. Therefore, the entire vNMI state is moved -to struct loaded_vmcs. - -Another change compared to before the patch is a simplification here: - - if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked && - !(is_guest_mode(vcpu) && nested_cpu_has_virtual_nmis( - get_vmcs12(vcpu))))) { - -The final condition here is always true (because nested_cpu_has_virtual_nmis -is always false) and is removed. - -Fixes: 2c82878b0cb38fd516fd612c67852a6bbf282003 -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1490803 -Cc: stable@vger.kernel.org -Signed-off-by: Paolo Bonzini ---- - arch/x86/kvm/vmx.c | 150 +++++++++++++++++++++++++++++++++++++---------------- - 1 file changed, 106 insertions(+), 44 deletions(-) - -diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c -index e6c8ffa84968..d6b3b12ae1e2 100644 ---- a/arch/x86/kvm/vmx.c -+++ b/arch/x86/kvm/vmx.c -@@ -202,6 +202,10 @@ struct loaded_vmcs { - bool nmi_known_unmasked; - unsigned long vmcs_host_cr3; /* May not match real cr3 */ - unsigned long vmcs_host_cr4; /* May not match real cr4 */ -+ /* Support for vnmi-less CPUs */ -+ int soft_vnmi_blocked; -+ ktime_t entry_time; -+ s64 vnmi_blocked_time; - struct list_head loaded_vmcss_on_cpu_link; - }; - -@@ -1291,6 +1295,11 @@ static inline bool cpu_has_vmx_invpcid(void) - SECONDARY_EXEC_ENABLE_INVPCID; - } - -+static inline bool cpu_has_virtual_nmis(void) -+{ -+ return vmcs_config.pin_based_exec_ctrl & PIN_BASED_VIRTUAL_NMIS; -+} -+ - static inline bool cpu_has_vmx_wbinvd_exit(void) - { - return vmcs_config.cpu_based_2nd_exec_ctrl & -@@ -1348,11 +1357,6 @@ static inline bool nested_cpu_has2(struct vmcs12 *vmcs12, u32 bit) - (vmcs12->secondary_vm_exec_control & bit); - } - --static inline bool nested_cpu_has_virtual_nmis(struct vmcs12 *vmcs12) --{ -- return vmcs12->pin_based_vm_exec_control & PIN_BASED_VIRTUAL_NMIS; --} -- - static inline bool nested_cpu_has_preemption_timer(struct vmcs12 *vmcs12) - { - return vmcs12->pin_based_vm_exec_control & -@@ -3712,9 +3716,9 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf) - &_vmexit_control) < 0) - return -EIO; - -- min = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING | -- PIN_BASED_VIRTUAL_NMIS; -- opt = PIN_BASED_POSTED_INTR | PIN_BASED_VMX_PREEMPTION_TIMER; -+ min = PIN_BASED_EXT_INTR_MASK | PIN_BASED_NMI_EXITING; -+ opt = PIN_BASED_VIRTUAL_NMIS | PIN_BASED_POSTED_INTR | -+ PIN_BASED_VMX_PREEMPTION_TIMER; - if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_PINBASED_CTLS, - &_pin_based_exec_control) < 0) - return -EIO; -@@ -5669,7 +5673,8 @@ static void enable_irq_window(struct kvm_vcpu *vcpu) - - static void enable_nmi_window(struct kvm_vcpu *vcpu) - { -- if (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_STI) { -+ if (!cpu_has_virtual_nmis() || -+ vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_STI) { - enable_irq_window(vcpu); - return; - } -@@ -5709,6 +5714,19 @@ static void vmx_inject_nmi(struct kvm_vcpu *vcpu) - { - struct vcpu_vmx *vmx = to_vmx(vcpu); - -+ if (!cpu_has_virtual_nmis()) { -+ /* -+ * Tracking the NMI-blocked state in software is built upon -+ * finding the next open IRQ window. This, in turn, depends on -+ * well-behaving guests: They have to keep IRQs disabled at -+ * least as long as the NMI handler runs. Otherwise we may -+ * cause NMI nesting, maybe breaking the guest. But as this is -+ * highly unlikely, we can live with the residual risk. -+ */ -+ vmx->loaded_vmcs->soft_vnmi_blocked = 1; -+ vmx->loaded_vmcs->vnmi_blocked_time = 0; -+ } -+ - ++vcpu->stat.nmi_injections; - vmx->loaded_vmcs->nmi_known_unmasked = false; - -@@ -5727,6 +5745,8 @@ static bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu) - struct vcpu_vmx *vmx = to_vmx(vcpu); - bool masked; - -+ if (!cpu_has_virtual_nmis()) -+ return vmx->loaded_vmcs->soft_vnmi_blocked; - if (vmx->loaded_vmcs->nmi_known_unmasked) - return false; - masked = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & GUEST_INTR_STATE_NMI; -@@ -5738,13 +5758,20 @@ static void vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked) - { - struct vcpu_vmx *vmx = to_vmx(vcpu); - -- vmx->loaded_vmcs->nmi_known_unmasked = !masked; -- if (masked) -- vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, -- GUEST_INTR_STATE_NMI); -- else -- vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO, -- GUEST_INTR_STATE_NMI); -+ if (!cpu_has_virtual_nmis()) { -+ if (vmx->loaded_vmcs->soft_vnmi_blocked != masked) { -+ vmx->loaded_vmcs->soft_vnmi_blocked = masked; -+ vmx->loaded_vmcs->vnmi_blocked_time = 0; -+ } -+ } else { -+ vmx->loaded_vmcs->nmi_known_unmasked = !masked; -+ if (masked) -+ vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, -+ GUEST_INTR_STATE_NMI); -+ else -+ vmcs_clear_bits(GUEST_INTERRUPTIBILITY_INFO, -+ GUEST_INTR_STATE_NMI); -+ } - } - - static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) -@@ -5752,6 +5779,10 @@ static int vmx_nmi_allowed(struct kvm_vcpu *vcpu) - if (to_vmx(vcpu)->nested.nested_run_pending) - return 0; - -+ if (!cpu_has_virtual_nmis() && -+ to_vmx(vcpu)->loaded_vmcs->soft_vnmi_blocked) -+ return 0; -+ - return !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & - (GUEST_INTR_STATE_MOV_SS | GUEST_INTR_STATE_STI - | GUEST_INTR_STATE_NMI)); -@@ -6479,6 +6510,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) - * AAK134, BY25. - */ - if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) && -+ cpu_has_virtual_nmis() && - (exit_qualification & INTR_INFO_UNBLOCK_NMI)) - vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); - -@@ -6965,7 +6997,7 @@ static struct loaded_vmcs *nested_get_current_vmcs02(struct vcpu_vmx *vmx) - } - - /* Create a new VMCS */ -- item = kmalloc(sizeof(struct vmcs02_list), GFP_KERNEL); -+ item = kzalloc(sizeof(struct vmcs02_list), GFP_KERNEL); - if (!item) - return NULL; - item->vmcs02.vmcs = alloc_vmcs(); -@@ -7982,6 +8014,7 @@ static int handle_pml_full(struct kvm_vcpu *vcpu) - * "blocked by NMI" bit has to be set before next VM entry. - */ - if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) && -+ cpu_has_virtual_nmis() && - (exit_qualification & INTR_INFO_UNBLOCK_NMI)) - vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, - GUEST_INTR_STATE_NMI); -@@ -8826,6 +8859,25 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) - return 0; - } - -+ if (unlikely(!cpu_has_virtual_nmis() && -+ vmx->loaded_vmcs->soft_vnmi_blocked)) { -+ if (vmx_interrupt_allowed(vcpu)) { -+ vmx->loaded_vmcs->soft_vnmi_blocked = 0; -+ } else if (vmx->loaded_vmcs->vnmi_blocked_time > 1000000000LL && -+ vcpu->arch.nmi_pending) { -+ /* -+ * This CPU don't support us in finding the end of an -+ * NMI-blocked window if the guest runs with IRQs -+ * disabled. So we pull the trigger after 1 s of -+ * futile waiting, but inform the user about this. -+ */ -+ printk(KERN_WARNING "%s: Breaking out of NMI-blocked " -+ "state on VCPU %d after 1 s timeout\n", -+ __func__, vcpu->vcpu_id); -+ vmx->loaded_vmcs->soft_vnmi_blocked = 0; -+ } -+ } -+ - if (exit_reason < kvm_vmx_max_exit_handlers - && kvm_vmx_exit_handlers[exit_reason]) - return kvm_vmx_exit_handlers[exit_reason](vcpu); -@@ -9108,33 +9160,38 @@ static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx) - - idtv_info_valid = vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK; - -- if (vmx->loaded_vmcs->nmi_known_unmasked) -- return; -- /* -- * Can't use vmx->exit_intr_info since we're not sure what -- * the exit reason is. -- */ -- exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); -- unblock_nmi = (exit_intr_info & INTR_INFO_UNBLOCK_NMI) != 0; -- vector = exit_intr_info & INTR_INFO_VECTOR_MASK; -- /* -- * SDM 3: 27.7.1.2 (September 2008) -- * Re-set bit "block by NMI" before VM entry if vmexit caused by -- * a guest IRET fault. -- * SDM 3: 23.2.2 (September 2008) -- * Bit 12 is undefined in any of the following cases: -- * If the VM exit sets the valid bit in the IDT-vectoring -- * information field. -- * If the VM exit is due to a double fault. -- */ -- if ((exit_intr_info & INTR_INFO_VALID_MASK) && unblock_nmi && -- vector != DF_VECTOR && !idtv_info_valid) -- vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, -- GUEST_INTR_STATE_NMI); -- else -- vmx->loaded_vmcs->nmi_known_unmasked = -- !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) -- & GUEST_INTR_STATE_NMI); -+ if (cpu_has_virtual_nmis()) { -+ if (vmx->loaded_vmcs->nmi_known_unmasked) -+ return; -+ /* -+ * Can't use vmx->exit_intr_info since we're not sure what -+ * the exit reason is. -+ */ -+ exit_intr_info = vmcs_read32(VM_EXIT_INTR_INFO); -+ unblock_nmi = (exit_intr_info & INTR_INFO_UNBLOCK_NMI) != 0; -+ vector = exit_intr_info & INTR_INFO_VECTOR_MASK; -+ /* -+ * SDM 3: 27.7.1.2 (September 2008) -+ * Re-set bit "block by NMI" before VM entry if vmexit caused by -+ * a guest IRET fault. -+ * SDM 3: 23.2.2 (September 2008) -+ * Bit 12 is undefined in any of the following cases: -+ * If the VM exit sets the valid bit in the IDT-vectoring -+ * information field. -+ * If the VM exit is due to a double fault. -+ */ -+ if ((exit_intr_info & INTR_INFO_VALID_MASK) && unblock_nmi && -+ vector != DF_VECTOR && !idtv_info_valid) -+ vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, -+ GUEST_INTR_STATE_NMI); -+ else -+ vmx->loaded_vmcs->nmi_known_unmasked = -+ !(vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) -+ & GUEST_INTR_STATE_NMI); -+ } else if (unlikely(vmx->loaded_vmcs->soft_vnmi_blocked)) -+ vmx->loaded_vmcs->vnmi_blocked_time += -+ ktime_to_ns(ktime_sub(ktime_get(), -+ vmx->loaded_vmcs->entry_time)); - } - - static void __vmx_complete_interrupts(struct kvm_vcpu *vcpu, -@@ -9251,6 +9308,11 @@ static void __noclone vmx_vcpu_run(struct kvm_vcpu *vcpu) - struct vcpu_vmx *vmx = to_vmx(vcpu); - unsigned long debugctlmsr, cr3, cr4; - -+ /* Record the guest's net vcpu time for enforced NMI injections. */ -+ if (unlikely(!cpu_has_virtual_nmis() && -+ vmx->loaded_vmcs->soft_vnmi_blocked)) -+ vmx->loaded_vmcs->entry_time = ktime_get(); -+ - /* Don't enter VMX if guest state is invalid, let the exit handler - start emulation until we arrive back to a valid state */ - if (vmx->emulation_required) diff --git a/1-3-net-set-tb--fast_sk_family.patch b/1-3-net-set-tb--fast_sk_family.patch deleted file mode 100644 index dbe5250..0000000 --- a/1-3-net-set-tb--fast_sk_family.patch +++ /dev/null @@ -1,50 +0,0 @@ -From patchwork Mon Sep 18 16:28:55 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [1/3] net: set tb->fast_sk_family -X-Patchwork-Submitter: Josef Bacik -X-Patchwork-Id: 815031 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <1505752137-15522-2-git-send-email-jbacik@fb.com> -To: davem@davemloft.net, netdev@vger.kernel.org, - linux-kernel@vger.kernel.org, crobinso@redhat.com, - labbott@redhat.com, kernel-team@fb.com -Cc: Josef Bacik , stable@vger.kernel.org -Date: Mon, 18 Sep 2017 12:28:55 -0400 -From: josef@toxicpanda.com -List-Id: - -From: Josef Bacik - -We need to set the tb->fast_sk_family properly so we can use the proper -comparison function for all subsequent reuseport bind requests. - -Cc: stable@vger.kernel.org -Fixes: 637bc8bbe6c0 ("inet: reset tb->fastreuseport when adding a reuseport sk") -Reported-and-tested-by: Cole Robinson -Signed-off-by: Josef Bacik ---- - net/ipv4/inet_connection_sock.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c -index b9c64b40a83a..f87f4805e244 100644 ---- a/net/ipv4/inet_connection_sock.c -+++ b/net/ipv4/inet_connection_sock.c -@@ -328,6 +328,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) - tb->fastuid = uid; - tb->fast_rcv_saddr = sk->sk_rcv_saddr; - tb->fast_ipv6_only = ipv6_only_sock(sk); -+ tb->fast_sk_family = sk->sk_family; - #if IS_ENABLED(CONFIG_IPV6) - tb->fast_v6_rcv_saddr = sk->sk_v6_rcv_saddr; - #endif -@@ -354,6 +355,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) - tb->fastuid = uid; - tb->fast_rcv_saddr = sk->sk_rcv_saddr; - tb->fast_ipv6_only = ipv6_only_sock(sk); -+ tb->fast_sk_family = sk->sk_family; - #if IS_ENABLED(CONFIG_IPV6) - tb->fast_v6_rcv_saddr = sk->sk_v6_rcv_saddr; - #endif diff --git a/2-3-net-use-inet6_rcv_saddr-to-compare-sockets.patch b/2-3-net-use-inet6_rcv_saddr-to-compare-sockets.patch deleted file mode 100644 index 3d64361..0000000 --- a/2-3-net-use-inet6_rcv_saddr-to-compare-sockets.patch +++ /dev/null @@ -1,44 +0,0 @@ -From patchwork Mon Sep 18 16:28:56 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [2/3] net: use inet6_rcv_saddr to compare sockets -X-Patchwork-Submitter: Josef Bacik -X-Patchwork-Id: 815028 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <1505752137-15522-3-git-send-email-jbacik@fb.com> -To: davem@davemloft.net, netdev@vger.kernel.org, - linux-kernel@vger.kernel.org, crobinso@redhat.com, - labbott@redhat.com, kernel-team@fb.com -Cc: Josef Bacik , stable@vger.kernel.org -Date: Mon, 18 Sep 2017 12:28:56 -0400 -From: josef@toxicpanda.com -List-Id: - -From: Josef Bacik - -In ipv6_rcv_saddr_equal() we need to use inet6_rcv_saddr(sk) for the -ipv6 compare with the fast socket information to make sure we're doing -the proper comparisons. - -Cc: stable@vger.kernel.org -Fixes: 637bc8bbe6c0 ("inet: reset tb->fastreuseport when adding a reuseport sk") -Reported-and-tested-by: Cole Robinson -Signed-off-by: Josef Bacik ---- - net/ipv4/inet_connection_sock.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c -index f87f4805e244..a1bf30438bc5 100644 ---- a/net/ipv4/inet_connection_sock.c -+++ b/net/ipv4/inet_connection_sock.c -@@ -266,7 +266,7 @@ static inline int sk_reuseport_match(struct inet_bind_bucket *tb, - #if IS_ENABLED(CONFIG_IPV6) - if (tb->fast_sk_family == AF_INET6) - return ipv6_rcv_saddr_equal(&tb->fast_v6_rcv_saddr, -- &sk->sk_v6_rcv_saddr, -+ inet6_rcv_saddr(sk), - tb->fast_rcv_saddr, - sk->sk_rcv_saddr, - tb->fast_ipv6_only, diff --git a/3-3-inet-fix-improper-empty-comparison.patch b/3-3-inet-fix-improper-empty-comparison.patch deleted file mode 100644 index 421a235..0000000 --- a/3-3-inet-fix-improper-empty-comparison.patch +++ /dev/null @@ -1,53 +0,0 @@ -From patchwork Mon Sep 18 16:28:57 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [3/3] inet: fix improper empty comparison -X-Patchwork-Submitter: Josef Bacik -X-Patchwork-Id: 815029 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <1505752137-15522-4-git-send-email-jbacik@fb.com> -To: davem@davemloft.net, netdev@vger.kernel.org, - linux-kernel@vger.kernel.org, crobinso@redhat.com, - labbott@redhat.com, kernel-team@fb.com -Cc: Josef Bacik , stable@vger.kernel.org -Date: Mon, 18 Sep 2017 12:28:57 -0400 -From: josef@toxicpanda.com -List-Id: - -From: Josef Bacik - -When doing my reuseport rework I screwed up and changed a - -if (hlist_empty(&tb->owners)) - -to - -if (!hlist_empty(&tb->owners)) - -This is obviously bad as all of the reuseport/reuse logic was reversed, -which caused weird problems like allowing an ipv4 bind conflict if we -opened an ipv4 only socket on a port followed by an ipv6 only socket on -the same port. - -Cc: stable@vger.kernel.org -Fixes: b9470c27607b ("inet: kill smallest_size and smallest_port") -Reported-by: Cole Robinson -Signed-off-by: Josef Bacik ---- - net/ipv4/inet_connection_sock.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c -index a1bf30438bc5..c039c937ba90 100644 ---- a/net/ipv4/inet_connection_sock.c -+++ b/net/ipv4/inet_connection_sock.c -@@ -321,7 +321,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) - goto fail_unlock; - } - success: -- if (!hlist_empty(&tb->owners)) { -+ if (hlist_empty(&tb->owners)) { - tb->fastreuse = reuse; - if (sk->sk_reuseport) { - tb->fastreuseport = FASTREUSEPORT_ANY; diff --git a/CVE-2017-16538.patch b/CVE-2017-16538.patch deleted file mode 100644 index e9cf4b0..0000000 --- a/CVE-2017-16538.patch +++ /dev/null @@ -1,166 +0,0 @@ -From patchwork Tue Sep 26 21:10:20 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [1/2] media: dvb-usb-v2: lmedm04: Improve logic checking of warm - start. -From: Malcolm Priestley -X-Patchwork-Id: 44566 -Message-Id: <20170926211021.11036-1-tvboxspy@gmail.com> -To: linux-media@vger.kernel.org -Cc: Andrey Konovalov , - Malcolm Priestley -Date: Tue, 26 Sep 2017 22:10:20 +0100 - -Warm start has no check as whether a genuine device has -connected and proceeds to next execution path. - -Check device should read 0x47 at offset of 2 on USB descriptor read -and it is the amount requested of 6 bytes. - -Fix for -kasan: CONFIG_KASAN_INLINE enabled -kasan: GPF could be caused by NULL-ptr deref or user memory access as - -Reported-by: Andrey Konovalov -Signed-off-by: Malcolm Priestley ---- - drivers/media/usb/dvb-usb-v2/lmedm04.c | 26 ++++++++++++++++++-------- - 1 file changed, 18 insertions(+), 8 deletions(-) - -diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c -index 5e320fa4a795..992f2011a6ba 100644 ---- a/drivers/media/usb/dvb-usb-v2/lmedm04.c -+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c -@@ -494,18 +494,23 @@ static int lme2510_pid_filter(struct dvb_usb_adapter *adap, int index, u16 pid, - - static int lme2510_return_status(struct dvb_usb_device *d) - { -- int ret = 0; -+ int ret; - u8 *data; - -- data = kzalloc(10, GFP_KERNEL); -+ data = kzalloc(6, GFP_KERNEL); - if (!data) - return -ENOMEM; - -- ret |= usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), -- 0x06, 0x80, 0x0302, 0x00, data, 0x0006, 200); -- info("Firmware Status: %x (%x)", ret , data[2]); -+ ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), -+ 0x06, 0x80, 0x0302, 0x00, -+ data, 0x6, 200); -+ if (ret != 6) -+ ret = -EINVAL; -+ else -+ ret = data[2]; -+ -+ info("Firmware Status: %6ph", data); - -- ret = (ret < 0) ? -ENODEV : data[2]; - kfree(data); - return ret; - } -@@ -1189,6 +1194,7 @@ static int lme2510_get_adapter_count(struct dvb_usb_device *d) - static int lme2510_identify_state(struct dvb_usb_device *d, const char **name) - { - struct lme2510_state *st = d->priv; -+ int status; - - usb_reset_configuration(d->udev); - -@@ -1197,12 +1203,16 @@ static int lme2510_identify_state(struct dvb_usb_device *d, const char **name) - - st->dvb_usb_lme2510_firmware = dvb_usb_lme2510_firmware; - -- if (lme2510_return_status(d) == 0x44) { -+ status = lme2510_return_status(d); -+ if (status == 0x44) { - *name = lme_firmware_switch(d, 0); - return COLD; - } - -- return 0; -+ if (status != 0x47) -+ return -EINVAL; -+ -+ return WARM; - } - - static int lme2510_get_stream_config(struct dvb_frontend *fe, u8 *ts_type, -From patchwork Tue Sep 26 21:10:21 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [2/2] media: dvb-usb-v2: lmedm04: move ts2020 attach to - dm04_lme2510_tuner -From: Malcolm Priestley -X-Patchwork-Id: 44567 -Message-Id: <20170926211021.11036-2-tvboxspy@gmail.com> -To: linux-media@vger.kernel.org -Cc: Andrey Konovalov , - Malcolm Priestley -Date: Tue, 26 Sep 2017 22:10:21 +0100 - -When the tuner was split from m88rs2000 the attach function is in wrong -place. - -Move to dm04_lme2510_tuner to trap errors on failure and removing -a call to lme_coldreset. - -Prevents driver starting up without any tuner connected. - -Fixes to trap for ts2020 fail. -LME2510(C): FE Found M88RS2000 -ts2020: probe of 0-0060 failed with error -11 -... -LME2510(C): TUN Found RS2000 tuner -kasan: CONFIG_KASAN_INLINE enabled -kasan: GPF could be caused by NULL-ptr deref or user memory access -general protection fault: 0000 [#1] PREEMPT SMP KASAN - -Reported-by: Andrey Konovalov -Signed-off-by: Malcolm Priestley -Tested-by: Andrey Konovalov ---- - drivers/media/usb/dvb-usb-v2/lmedm04.c | 13 ++++++------- - 1 file changed, 6 insertions(+), 7 deletions(-) - -diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c -index 992f2011a6ba..be26c029546b 100644 ---- a/drivers/media/usb/dvb-usb-v2/lmedm04.c -+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c -@@ -1076,8 +1076,6 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap) - - if (adap->fe[0]) { - info("FE Found M88RS2000"); -- dvb_attach(ts2020_attach, adap->fe[0], &ts2020_config, -- &d->i2c_adap); - st->i2c_tuner_gate_w = 5; - st->i2c_tuner_gate_r = 5; - st->i2c_tuner_addr = 0x60; -@@ -1143,17 +1141,18 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap) - ret = st->tuner_config; - break; - case TUNER_RS2000: -- ret = st->tuner_config; -+ if (dvb_attach(ts2020_attach, adap->fe[0], -+ &ts2020_config, &d->i2c_adap)) -+ ret = st->tuner_config; - break; - default: - break; - } - -- if (ret) -+ if (ret) { - info("TUN Found %s tuner", tun_msg[ret]); -- else { -- info("TUN No tuner found --- resetting device"); -- lme_coldreset(d); -+ } else { -+ info("TUN No tuner found"); - return -ENODEV; - } - diff --git a/CVE-2017-7477.patch b/CVE-2017-7477.patch deleted file mode 100644 index 6405614..0000000 --- a/CVE-2017-7477.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 4d6fa57b4dab0d77f4d8e9d9c73d1e63f6fe8fee Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" -Date: Fri, 21 Apr 2017 23:14:48 +0200 -Subject: macsec: avoid heap overflow in skb_to_sgvec - -While this may appear as a humdrum one line change, it's actually quite -important. An sk_buff stores data in three places: - -1. A linear chunk of allocated memory in skb->data. This is the easiest - one to work with, but it precludes using scatterdata since the memory - must be linear. -2. The array skb_shinfo(skb)->frags, which is of maximum length - MAX_SKB_FRAGS. This is nice for scattergather, since these fragments - can point to different pages. -3. skb_shinfo(skb)->frag_list, which is a pointer to another sk_buff, - which in turn can have data in either (1) or (2). - -The first two are rather easy to deal with, since they're of a fixed -maximum length, while the third one is not, since there can be -potentially limitless chains of fragments. Fortunately dealing with -frag_list is opt-in for drivers, so drivers don't actually have to deal -with this mess. For whatever reason, macsec decided it wanted pain, and -so it explicitly specified NETIF_F_FRAGLIST. - -Because dealing with (1), (2), and (3) is insane, most users of sk_buff -doing any sort of crypto or paging operation calls a convenient function -called skb_to_sgvec (which happens to be recursive if (3) is in use!). -This takes a sk_buff as input, and writes into its output pointer an -array of scattergather list items. Sometimes people like to declare a -fixed size scattergather list on the stack; othertimes people like to -allocate a fixed size scattergather list on the heap. However, if you're -doing it in a fixed-size fashion, you really shouldn't be using -NETIF_F_FRAGLIST too (unless you're also ensuring the sk_buff and its -frag_list children arent't shared and then you check the number of -fragments in total required.) - -Macsec specifically does this: - - size += sizeof(struct scatterlist) * (MAX_SKB_FRAGS + 1); - tmp = kmalloc(size, GFP_ATOMIC); - *sg = (struct scatterlist *)(tmp + sg_offset); - ... - sg_init_table(sg, MAX_SKB_FRAGS + 1); - skb_to_sgvec(skb, sg, 0, skb->len); - -Specifying MAX_SKB_FRAGS + 1 is the right answer usually, but not if you're -using NETIF_F_FRAGLIST, in which case the call to skb_to_sgvec will -overflow the heap, and disaster ensues. - -Signed-off-by: Jason A. Donenfeld -Cc: stable@vger.kernel.org -Cc: security@kernel.org -Signed-off-by: David S. Miller ---- - drivers/net/macsec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c -index ff0a5ed..dbab05a 100644 ---- a/drivers/net/macsec.c -+++ b/drivers/net/macsec.c -@@ -2716,7 +2716,7 @@ static netdev_tx_t macsec_start_xmit(struct sk_buff *skb, - } - - #define MACSEC_FEATURES \ -- (NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST) -+ (NETIF_F_SG | NETIF_F_HIGHDMA) - static struct lock_class_key macsec_netdev_addr_lock_key; - - static int macsec_dev_init(struct net_device *dev) --- -cgit v1.1 - diff --git a/HID-rmi-Check-that-a-device-is-a-RMI-device-before-c.patch b/HID-rmi-Check-that-a-device-is-a-RMI-device-before-c.patch deleted file mode 100644 index d6a8e6a..0000000 --- a/HID-rmi-Check-that-a-device-is-a-RMI-device-before-c.patch +++ /dev/null @@ -1,54 +0,0 @@ -From ef14a4bf0910d06c7e202552914028d4956809cb Mon Sep 17 00:00:00 2001 -From: Andrew Duggan -Date: Tue, 17 Oct 2017 18:37:36 -0700 -Subject: [PATCH] HID: rmi: Check that a device is a RMI device before calling - RMI functions - -The hid-rmi driver may handle non rmi devices on composite USB devices. -Callbacks need to make sure that the current device is a RMI device before -calling RMI specific functions. Most callbacks already have this check, but -this patch adds checks to the remaining callbacks. - -Reported-by: Hendrik Langer -Tested-by: Hendrik Langer -Reviewed-by: Benjamin Tissoires -Signed-off-by: Andrew Duggan -Signed-off-by: Jiri Kosina ---- - drivers/hid/hid-rmi.c | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - -diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c -index ef241d66562e..0f43c4292685 100644 ---- a/drivers/hid/hid-rmi.c -+++ b/drivers/hid/hid-rmi.c -@@ -368,6 +368,11 @@ static int rmi_check_sanity(struct hid_device *hdev, u8 *data, int size) - static int rmi_raw_event(struct hid_device *hdev, - struct hid_report *report, u8 *data, int size) - { -+ struct rmi_data *hdata = hid_get_drvdata(hdev); -+ -+ if (!(hdata->device_flags & RMI_DEVICE)) -+ return 0; -+ - size = rmi_check_sanity(hdev, data, size); - if (size < 2) - return 0; -@@ -713,9 +718,11 @@ static void rmi_remove(struct hid_device *hdev) - { - struct rmi_data *hdata = hid_get_drvdata(hdev); - -- clear_bit(RMI_STARTED, &hdata->flags); -- cancel_work_sync(&hdata->reset_work); -- rmi_unregister_transport_device(&hdata->xport); -+ if (hdata->device_flags & RMI_DEVICE) { -+ clear_bit(RMI_STARTED, &hdata->flags); -+ cancel_work_sync(&hdata->reset_work); -+ rmi_unregister_transport_device(&hdata->xport); -+ } - - hid_hw_stop(hdev); - } --- -2.14.3 - diff --git a/Input-synaptics---Disable-kernel-tracking-on-SMBus-devices.patch b/Input-synaptics---Disable-kernel-tracking-on-SMBus-devices.patch deleted file mode 100644 index 81e858f..0000000 --- a/Input-synaptics---Disable-kernel-tracking-on-SMBus-devices.patch +++ /dev/null @@ -1,51 +0,0 @@ -From patchwork Thu Sep 28 20:07:19 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 8bit -Subject: Input: synaptics - Disable kernel tracking on SMBus devices -From: Andrew Duggan -X-Patchwork-Id: 9976729 -Message-Id: <1506629239-5940-1-git-send-email-aduggan@synaptics.com> -To: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org -Cc: Andrew Duggan , - Dmitry Torokhov , - Benjamin Tissoires , - =?UTF-8?q?Kamil=20P=C3=A1ral?= -Date: Thu, 28 Sep 2017 13:07:19 -0700 - -In certain situations kernel tracking seems to be getting confused -and incorrectly reporting the slot of a contact. On example is when -the user does a three finger click or tap and then places two fingers -on the touchpad in the same area. The kernel tracking code seems to -continue to think that there are three contacts on the touchpad and -incorrectly alternates the slot of one of the contacts. The result that -is the input subsystem reports a stream of button press and release -events as the reported slot changes. - -Kernel tracking was originally enabled to prevent cursor jumps, but it -is unclear how much of an issue kernel jumps actually are. This patch -simply disabled kernel tracking for now. - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1482640 - -Signed-off-by: Andrew Duggan -Tested-by: Kamil Páral -Acked-by: Benjamin Tissoires ---- - drivers/input/mouse/synaptics.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c -index 5af0b7d..ee5466a 100644 ---- a/drivers/input/mouse/synaptics.c -+++ b/drivers/input/mouse/synaptics.c -@@ -1709,8 +1709,7 @@ static int synaptics_create_intertouch(struct psmouse *psmouse, - .sensor_pdata = { - .sensor_type = rmi_sensor_touchpad, - .axis_align.flip_y = true, -- /* to prevent cursors jumps: */ -- .kernel_tracking = true, -+ .kernel_tracking = false, - .topbuttonpad = topbuttonpad, - }, - .f30_data = { diff --git a/ahci-don-t-ignore-result-code-of-ahci_reset_controller.patch b/ahci-don-t-ignore-result-code-of-ahci_reset_controller.patch deleted file mode 100644 index 771ca79..0000000 --- a/ahci-don-t-ignore-result-code-of-ahci_reset_controller.patch +++ /dev/null @@ -1,77 +0,0 @@ -From patchwork Mon Oct 2 18:31:24 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: ahci: don't ignore result code of ahci_reset_controller() -X-Patchwork-Submitter: Ard Biesheuvel -X-Patchwork-Id: 820637 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <20171002183124.17003-1-ard.biesheuvel@linaro.org> -To: linux-ide@vger.kernel.org, tj@kernel.org -Cc: graeme.gregory@linaro.org, leif.lindholm@linaro.org, - daniel.thompson@Linaro.org, Ard Biesheuvel -Date: Mon, 2 Oct 2017 19:31:24 +0100 -From: Ard Biesheuvel -List-Id: - -ahci_pci_reset_controller() calls ahci_reset_controller(), which may -fail, but ignores the result code and always returns success. This -may result in failures like below - - ahci 0000:02:00.0: version 3.0 - ahci 0000:02:00.0: enabling device (0000 -> 0003) - ahci 0000:02:00.0: SSS flag set, parallel bus scan disabled - ahci 0000:02:00.0: controller reset failed (0xffffffff) - ahci 0000:02:00.0: failed to stop engine (-5) - ... repeated many times ... - ahci 0000:02:00.0: failed to stop engine (-5) - Unable to handle kernel paging request at virtual address ffff0000093f9018 - ... - PC is at ahci_stop_engine+0x5c/0xd8 [libahci] - LR is at ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci] - ... - [] ahci_stop_engine+0x5c/0xd8 [libahci] - [] ahci_deinit_port.constprop.12+0x1c/0xc0 [libahci] - [] ahci_init_controller+0x80/0x168 [libahci] - [] ahci_pci_init_controller+0x60/0x68 [ahci] - [] ahci_init_one+0x75c/0xd88 [ahci] - [] local_pci_probe+0x3c/0xb8 - [] pci_device_probe+0x138/0x170 - [] driver_probe_device+0x2dc/0x458 - [] __driver_attach+0x114/0x118 - [] bus_for_each_dev+0x60/0xa0 - [] driver_attach+0x20/0x28 - [] bus_add_driver+0x1f0/0x2a8 - [] driver_register+0x60/0xf8 - [] __pci_register_driver+0x3c/0x48 - [] ahci_pci_driver_init+0x1c/0x1000 [ahci] - [] do_one_initcall+0x38/0x120 - -where an obvious hardware level failure results in an unnecessary 15 second -delay and a subsequent crash. - -So record the result code of ahci_reset_controller() and relay it, rather -than ignoring it. - -Signed-off-by: Ard Biesheuvel ---- - drivers/ata/ahci.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c -index 5a5fd0b404eb..649e799df9c1 100644 ---- a/drivers/ata/ahci.c -+++ b/drivers/ata/ahci.c -@@ -621,8 +621,11 @@ static void ahci_pci_save_initial_config(struct pci_dev *pdev, - static int ahci_pci_reset_controller(struct ata_host *host) - { - struct pci_dev *pdev = to_pci_dev(host->dev); -+ int rc; - -- ahci_reset_controller(host); -+ rc = ahci_reset_controller(host); -+ if (rc) -+ return rc; - - if (pdev->vendor == PCI_VENDOR_ID_INTEL) { - struct ahci_host_priv *hpriv = host->private_data; diff --git a/allwinner-net-emac.patch b/allwinner-net-emac.patch index f5d680b..6d4f11d 100644 --- a/allwinner-net-emac.patch +++ b/allwinner-net-emac.patch @@ -1,18 +1,575 @@ -From 83e18f0ad4793ea83e03cb8e608bdd2939e76d78 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 4 Sep 2017 13:04:34 +0100 -Subject: [PATCH 1/4] Revert "net: stmmac: sun8i: Remove the compatibles" +From 1b28a544627ddce094091946f06f99bc41d0098f Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 24 Oct 2017 19:57:12 +0200 +Subject: [PATCH 01/11] net: stmmac: snps, dwmac-mdio MDIOs are automatically + registered + +stmmac bindings docs said that its mdio node must have +compatible = "snps,dwmac-mdio"; +Since dwmac-sun8i does not have any good reasons to not doing it, all +their MDIO node must have it. + +Since these compatible is automatically registered, dwmac-sun8i compatible +does not need to be in need_mdio_ids. + +Signed-off-by: Corentin Labbe +--- + drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +index 6383695004a5..645ef949705f 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +@@ -318,10 +318,6 @@ static int stmmac_dt_phy(struct plat_stmmacenet_data *plat, + bool mdio = true; + static const struct of_device_id need_mdio_ids[] = { + { .compatible = "snps,dwc-qos-ethernet-4.10" }, +- { .compatible = "allwinner,sun8i-a83t-emac" }, +- { .compatible = "allwinner,sun8i-h3-emac" }, +- { .compatible = "allwinner,sun8i-v3s-emac" }, +- { .compatible = "allwinner,sun50i-a64-emac" }, + {}, + }; + +-- +2.14.3 + +From 9a5b1d9a7614b022512744896d889e76f687e90a Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 24 Oct 2017 19:57:13 +0200 +Subject: [PATCH 02/11] net: stmmac: dwmac-sun8i: Handle integrated/external + MDIOs -This reverts commit ad4540cc5aa3dccb8e1e12458d57f8c40fae5a1c. +The Allwinner H3 SoC have two distinct MDIO bus, only one could be +active at the same time. +The selection of the active MDIO bus are done via some bits in the EMAC +register of the system controller. + +This patch implement this MDIO switch via a custom MDIO-mux. + +Signed-off-by: Corentin Labbe +Reviewed-by: Andrew Lunn +--- + drivers/net/ethernet/stmicro/stmmac/Kconfig | 1 + + drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 353 ++++++++++++++-------- + 2 files changed, 224 insertions(+), 130 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig +index 97035766c291..e28c0d2c58e9 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig ++++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig +@@ -159,6 +159,7 @@ config DWMAC_SUN8I + tristate "Allwinner sun8i GMAC support" + default ARCH_SUNXI + depends on OF && (ARCH_SUNXI || COMPILE_TEST) ++ select MDIO_BUS_MUX + ---help--- + Support for Allwinner H3 A83T A64 EMAC ethernet controllers. + +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +index 39c2122a4f26..b3eb344bb158 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -41,14 +42,14 @@ + * This value is used for disabling properly EMAC + * and used as a good starting value in case of the + * boot process(uboot) leave some stuff. +- * @internal_phy: Does the MAC embed an internal PHY ++ * @soc_has_internal_phy: Does the MAC embed an internal PHY + * @support_mii: Does the MAC handle MII + * @support_rmii: Does the MAC handle RMII + * @support_rgmii: Does the MAC handle RGMII + */ + struct emac_variant { + u32 default_syscon_value; +- int internal_phy; ++ bool soc_has_internal_phy; + bool support_mii; + bool support_rmii; + bool support_rgmii; +@@ -61,7 +62,8 @@ struct emac_variant { + * @rst_ephy: reference to the optional EPHY reset for the internal PHY + * @variant: reference to the current board variant + * @regmap: regmap for using the syscon +- * @use_internal_phy: Does the current PHY choice imply using the internal PHY ++ * @internal_phy_powered: Does the internal PHY is enabled ++ * @mux_handle: Internal pointer used by mdio-mux lib + */ + struct sunxi_priv_data { + struct clk *tx_clk; +@@ -70,12 +72,13 @@ struct sunxi_priv_data { + struct reset_control *rst_ephy; + const struct emac_variant *variant; + struct regmap *regmap; +- bool use_internal_phy; ++ bool internal_phy_powered; ++ void *mux_handle; + }; + + static const struct emac_variant emac_variant_h3 = { + .default_syscon_value = 0x58000, +- .internal_phy = PHY_INTERFACE_MODE_MII, ++ .soc_has_internal_phy = true, + .support_mii = true, + .support_rmii = true, + .support_rgmii = true +@@ -83,20 +86,20 @@ static const struct emac_variant emac_variant_h3 = { + + static const struct emac_variant emac_variant_v3s = { + .default_syscon_value = 0x38000, +- .internal_phy = PHY_INTERFACE_MODE_MII, ++ .soc_has_internal_phy = true, + .support_mii = true + }; + + static const struct emac_variant emac_variant_a83t = { + .default_syscon_value = 0, +- .internal_phy = 0, ++ .soc_has_internal_phy = false, + .support_mii = true, + .support_rgmii = true + }; + + static const struct emac_variant emac_variant_a64 = { + .default_syscon_value = 0, +- .internal_phy = 0, ++ .soc_has_internal_phy = false, + .support_mii = true, + .support_rmii = true, + .support_rgmii = true +@@ -195,6 +198,9 @@ static const struct emac_variant emac_variant_a64 = { + #define H3_EPHY_LED_POL BIT(17) /* 1: active low, 0: active high */ + #define H3_EPHY_SHUTDOWN BIT(16) /* 1: shutdown, 0: power up */ + #define H3_EPHY_SELECT BIT(15) /* 1: internal PHY, 0: external PHY */ ++#define H3_EPHY_MUX_MASK (H3_EPHY_SHUTDOWN | H3_EPHY_SELECT) ++#define DWMAC_SUN8I_MDIO_MUX_INTERNAL_ID 1 ++#define DWMAC_SUN8I_MDIO_MUX_EXTERNAL_ID 2 + + /* H3/A64 specific bits */ + #define SYSCON_RMII_EN BIT(13) /* 1: enable RMII (overrides EPIT) */ +@@ -634,6 +640,159 @@ static int sun8i_dwmac_reset(struct stmmac_priv *priv) + return 0; + } + ++/* Search in mdio-mux node for internal PHY node and get its clk/reset */ ++static int get_ephy_nodes(struct stmmac_priv *priv) ++{ ++ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; ++ struct device_node *mdio_mux, *iphynode; ++ struct device_node *mdio_internal; ++ int ret; ++ ++ mdio_mux = of_get_child_by_name(priv->device->of_node, "mdio-mux"); ++ if (!mdio_mux) { ++ dev_err(priv->device, "Cannot get mdio-mux node\n"); ++ return -ENODEV; ++ } ++ ++ mdio_internal = of_find_compatible_node(mdio_mux, NULL, ++ "allwinner,sun8i-h3-mdio-internal"); ++ if (!mdio_internal) { ++ dev_err(priv->device, "Cannot get internal_mdio node\n"); ++ return -ENODEV; ++ } ++ ++ /* Seek for internal PHY */ ++ for_each_child_of_node(mdio_internal, iphynode) { ++ gmac->ephy_clk = of_clk_get(iphynode, 0); ++ if (IS_ERR(gmac->ephy_clk)) ++ continue; ++ gmac->rst_ephy = of_reset_control_get_exclusive(iphynode, NULL); ++ if (IS_ERR(gmac->rst_ephy)) { ++ ret = PTR_ERR(gmac->rst_ephy); ++ if (ret == -EPROBE_DEFER) ++ return ret; ++ continue; ++ } ++ dev_info(priv->device, "Found internal PHY node\n"); ++ return 0; ++ } ++ return -ENODEV; ++} ++ ++static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) ++{ ++ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; ++ int ret; ++ ++ if (gmac->internal_phy_powered) { ++ dev_warn(priv->device, "Internal PHY already powered\n"); ++ return 0; ++ } ++ ++ dev_info(priv->device, "Powering internal PHY\n"); ++ ret = clk_prepare_enable(gmac->ephy_clk); ++ if (ret) { ++ dev_err(priv->device, "Cannot enable internal PHY\n"); ++ return ret; ++ } ++ ++ /* Make sure the EPHY is properly reseted, as U-Boot may leave ++ * it at deasserted state, and thus it may fail to reset EMAC. ++ */ ++ reset_control_assert(gmac->rst_ephy); ++ ++ ret = reset_control_deassert(gmac->rst_ephy); ++ if (ret) { ++ dev_err(priv->device, "Cannot deassert internal phy\n"); ++ clk_disable_unprepare(gmac->ephy_clk); ++ return ret; ++ } ++ ++ gmac->internal_phy_powered = true; ++ ++ return 0; ++} ++ ++static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) ++{ ++ if (!gmac->internal_phy_powered) ++ return 0; ++ ++ clk_disable_unprepare(gmac->ephy_clk); ++ reset_control_assert(gmac->rst_ephy); ++ gmac->internal_phy_powered = false; ++ return 0; ++} ++ ++/* MDIO multiplexing switch function ++ * This function is called by the mdio-mux layer when it thinks the mdio bus ++ * multiplexer needs to switch. ++ * 'current_child' is the current value of the mux register ++ * 'desired_child' is the value of the 'reg' property of the target child MDIO ++ * node. ++ * The first time this function is called, current_child == -1. ++ * If current_child == desired_child, then the mux is already set to the ++ * correct bus. ++ */ ++static int mdio_mux_syscon_switch_fn(int current_child, int desired_child, ++ void *data) ++{ ++ struct stmmac_priv *priv = data; ++ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; ++ u32 reg, val; ++ int ret = 0; ++ bool need_power_ephy = false; ++ ++ if (current_child ^ desired_child) { ++ regmap_read(gmac->regmap, SYSCON_EMAC_REG, ®); ++ switch (desired_child) { ++ case DWMAC_SUN8I_MDIO_MUX_INTERNAL_ID: ++ dev_info(priv->device, "Switch mux to internal PHY"); ++ val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SELECT; ++ ++ need_power_ephy = true; ++ break; ++ case DWMAC_SUN8I_MDIO_MUX_EXTERNAL_ID: ++ dev_info(priv->device, "Switch mux to external PHY"); ++ val = (reg & ~H3_EPHY_MUX_MASK) | H3_EPHY_SHUTDOWN; ++ need_power_ephy = false; ++ break; ++ default: ++ dev_err(priv->device, "Invalid child ID %x\n", ++ desired_child); ++ return -EINVAL; ++ } ++ regmap_write(gmac->regmap, SYSCON_EMAC_REG, val); ++ if (need_power_ephy) { ++ ret = sun8i_dwmac_power_internal_phy(priv); ++ if (ret) ++ return ret; ++ } else { ++ sun8i_dwmac_unpower_internal_phy(gmac); ++ } ++ /* After changing syscon value, the MAC need reset or it will ++ * use the last value (and so the last PHY set). ++ */ ++ ret = sun8i_dwmac_reset(priv); ++ } ++ return ret; ++} ++ ++static int sun8i_dwmac_register_mdio_mux(struct stmmac_priv *priv) ++{ ++ int ret; ++ struct device_node *mdio_mux; ++ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; ++ ++ mdio_mux = of_get_child_by_name(priv->device->of_node, "mdio-mux"); ++ if (!mdio_mux) ++ return -ENODEV; ++ ++ ret = mdio_mux_init(priv->device, mdio_mux, mdio_mux_syscon_switch_fn, ++ &gmac->mux_handle, priv, priv->mii); ++ return ret; ++} ++ + static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) + { + struct sunxi_priv_data *gmac = priv->plat->bsp_priv; +@@ -648,35 +807,25 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) + "Current syscon value is not the default %x (expect %x)\n", + val, reg); + +- if (gmac->variant->internal_phy) { +- if (!gmac->use_internal_phy) { +- /* switch to external PHY interface */ +- reg &= ~H3_EPHY_SELECT; +- } else { +- reg |= H3_EPHY_SELECT; +- reg &= ~H3_EPHY_SHUTDOWN; +- dev_dbg(priv->device, "Select internal_phy %x\n", reg); +- +- if (of_property_read_bool(priv->plat->phy_node, +- "allwinner,leds-active-low")) +- reg |= H3_EPHY_LED_POL; +- else +- reg &= ~H3_EPHY_LED_POL; +- +- /* Force EPHY xtal frequency to 24MHz. */ +- reg |= H3_EPHY_CLK_SEL; +- +- ret = of_mdio_parse_addr(priv->device, +- priv->plat->phy_node); +- if (ret < 0) { +- dev_err(priv->device, "Could not parse MDIO addr\n"); +- return ret; +- } +- /* of_mdio_parse_addr returns a valid (0 ~ 31) PHY +- * address. No need to mask it again. +- */ +- reg |= ret << H3_EPHY_ADDR_SHIFT; ++ if (gmac->variant->soc_has_internal_phy) { ++ if (of_property_read_bool(priv->plat->phy_node, ++ "allwinner,leds-active-low")) ++ reg |= H3_EPHY_LED_POL; ++ else ++ reg &= ~H3_EPHY_LED_POL; ++ ++ /* Force EPHY xtal frequency to 24MHz. */ ++ reg |= H3_EPHY_CLK_SEL; ++ ++ ret = of_mdio_parse_addr(priv->device, priv->plat->phy_node); ++ if (ret < 0) { ++ dev_err(priv->device, "Could not parse MDIO addr\n"); ++ return ret; + } ++ /* of_mdio_parse_addr returns a valid (0 ~ 31) PHY ++ * address. No need to mask it again. ++ */ ++ reg |= 1 << H3_EPHY_ADDR_SHIFT; + } + + if (!of_property_read_u32(node, "allwinner,tx-delay-ps", &val)) { +@@ -746,81 +895,21 @@ static void sun8i_dwmac_unset_syscon(struct sunxi_priv_data *gmac) + regmap_write(gmac->regmap, SYSCON_EMAC_REG, reg); + } + +-static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) ++static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) + { +- struct sunxi_priv_data *gmac = priv->plat->bsp_priv; +- int ret; +- +- if (!gmac->use_internal_phy) +- return 0; +- +- ret = clk_prepare_enable(gmac->ephy_clk); +- if (ret) { +- dev_err(priv->device, "Cannot enable ephy\n"); +- return ret; +- } +- +- /* Make sure the EPHY is properly reseted, as U-Boot may leave +- * it at deasserted state, and thus it may fail to reset EMAC. +- */ +- reset_control_assert(gmac->rst_ephy); ++ struct sunxi_priv_data *gmac = priv; + +- ret = reset_control_deassert(gmac->rst_ephy); +- if (ret) { +- dev_err(priv->device, "Cannot deassert ephy\n"); +- clk_disable_unprepare(gmac->ephy_clk); +- return ret; ++ if (gmac->variant->soc_has_internal_phy) { ++ /* sun8i_dwmac_exit could be called with mdiomux uninit */ ++ if (gmac->mux_handle) ++ mdio_mux_uninit(gmac->mux_handle); ++ if (gmac->internal_phy_powered) ++ sun8i_dwmac_unpower_internal_phy(gmac); + } + +- return 0; +-} +- +-static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) +-{ +- if (!gmac->use_internal_phy) +- return 0; +- +- clk_disable_unprepare(gmac->ephy_clk); +- reset_control_assert(gmac->rst_ephy); +- return 0; +-} +- +-/* sun8i_power_phy() - Activate the PHY: +- * In case of error, no need to call sun8i_unpower_phy(), +- * it will be called anyway by sun8i_dwmac_exit() +- */ +-static int sun8i_power_phy(struct stmmac_priv *priv) +-{ +- int ret; +- +- ret = sun8i_dwmac_power_internal_phy(priv); +- if (ret) +- return ret; +- +- ret = sun8i_dwmac_set_syscon(priv); +- if (ret) +- return ret; +- +- /* After changing syscon value, the MAC need reset or it will use +- * the last value (and so the last PHY set. +- */ +- ret = sun8i_dwmac_reset(priv); +- if (ret) +- return ret; +- return 0; +-} +- +-static void sun8i_unpower_phy(struct sunxi_priv_data *gmac) +-{ + sun8i_dwmac_unset_syscon(gmac); +- sun8i_dwmac_unpower_internal_phy(gmac); +-} +- +-static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) +-{ +- struct sunxi_priv_data *gmac = priv; + +- sun8i_unpower_phy(gmac); ++ reset_control_put(gmac->rst_ephy); + + clk_disable_unprepare(gmac->tx_clk); + +@@ -849,7 +938,7 @@ static struct mac_device_info *sun8i_dwmac_setup(void *ppriv) + if (!mac) + return NULL; + +- ret = sun8i_power_phy(priv); ++ ret = sun8i_dwmac_set_syscon(priv); + if (ret) + return NULL; + +@@ -889,6 +978,8 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) + struct sunxi_priv_data *gmac; + struct device *dev = &pdev->dev; + int ret; ++ struct stmmac_priv *priv; ++ struct net_device *ndev; + + ret = stmmac_get_platform_resources(pdev, &stmmac_res); + if (ret) +@@ -932,29 +1023,6 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) + } + + plat_dat->interface = of_get_phy_mode(dev->of_node); +- if (plat_dat->interface == gmac->variant->internal_phy) { +- dev_info(&pdev->dev, "Will use internal PHY\n"); +- gmac->use_internal_phy = true; +- gmac->ephy_clk = of_clk_get(plat_dat->phy_node, 0); +- if (IS_ERR(gmac->ephy_clk)) { +- ret = PTR_ERR(gmac->ephy_clk); +- dev_err(&pdev->dev, "Cannot get EPHY clock: %d\n", ret); +- return -EINVAL; +- } +- +- gmac->rst_ephy = of_reset_control_get(plat_dat->phy_node, NULL); +- if (IS_ERR(gmac->rst_ephy)) { +- ret = PTR_ERR(gmac->rst_ephy); +- if (ret == -EPROBE_DEFER) +- return ret; +- dev_err(&pdev->dev, "No EPHY reset control found %d\n", +- ret); +- return -EINVAL; +- } +- } else { +- dev_info(&pdev->dev, "Will use external PHY\n"); +- gmac->use_internal_phy = false; +- } + + /* platform data specifying hardware features and callbacks. + * hardware features were copied from Allwinner drivers. +@@ -973,9 +1041,34 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) + + ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); + if (ret) +- sun8i_dwmac_exit(pdev, plat_dat->bsp_priv); ++ goto dwmac_exit; ++ ++ ndev = dev_get_drvdata(&pdev->dev); ++ priv = netdev_priv(ndev); ++ /* The mux must be registered after parent MDIO ++ * so after stmmac_dvr_probe() ++ */ ++ if (gmac->variant->soc_has_internal_phy) { ++ ret = get_ephy_nodes(priv); ++ if (ret) ++ goto dwmac_exit; ++ ret = sun8i_dwmac_register_mdio_mux(priv); ++ if (ret) { ++ dev_err(&pdev->dev, "Failed to register mux\n"); ++ goto dwmac_mux; ++ } ++ } else { ++ ret = sun8i_dwmac_reset(priv); ++ if (ret) ++ goto dwmac_exit; ++ } + + return ret; ++dwmac_mux: ++ sun8i_dwmac_unset_syscon(gmac); ++dwmac_exit: ++ sun8i_dwmac_exit(pdev, plat_dat->bsp_priv); ++return ret; + } + + static const struct of_device_id sun8i_dwmac_match[] = { +-- +2.14.3 + +From f58f11ebb67468471ed8f232c576f348dd1a32b1 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 24 Oct 2017 19:57:14 +0200 +Subject: [PATCH 03/11] net: stmmac: sun8i: Restore the compatibles + +The original dwmac-sun8i DT bindings have some issue on how to handle +integrated PHY and was reverted in last RC of 4.13. +But now we have a solution so we need to get back that was reverted. + +This patch restore compatibles about dwmac-sun8i +This reverts commit ad4540cc5aa3 ("net: stmmac: sun8i: Remove the compatibles") + +Signed-off-by: Corentin Labbe --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -index 39c2122a4f26..fffd6d5fc907 100644 +index b3eb344bb158..e5ff734d4f9b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -@@ -979,6 +979,14 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) +@@ -1072,6 +1072,14 @@ return ret; } static const struct of_device_id sun8i_dwmac_match[] = { @@ -28,26 +585,483 @@ index 39c2122a4f26..fffd6d5fc907 100644 }; MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); -- -2.13.5 +2.14.3 + +From 54678636d98cd9625f342c831015e302642bf104 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 31 Oct 2017 09:19:08 +0100 +Subject: [PATCH 04/11] dt-bindings: net: Restore sun8i dwmac binding + +The original dwmac-sun8i DT bindings have some issue on how to handle +integrated PHY and was reverted in last RC of 4.13. +But now we have a solution so we need to get back that was reverted. + +This patch restore dt-bindings documentation about dwmac-sun8i +This reverts commit 8aa33ec2f481 ("dt-bindings: net: Revert sun8i dwmac binding") + +Signed-off-by: Corentin Labbe +Acked-by: Rob Herring +Acked-by: Florian Fainelli +--- + .../devicetree/bindings/net/dwmac-sun8i.txt | 84 ++++++++++++++++++++++ + 1 file changed, 84 insertions(+) + create mode 100644 Documentation/devicetree/bindings/net/dwmac-sun8i.txt + +diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt +new file mode 100644 +index 000000000000..725f3b187886 +--- /dev/null ++++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt +@@ -0,0 +1,84 @@ ++* Allwinner sun8i GMAC ethernet controller ++ ++This device is a platform glue layer for stmmac. ++Please see stmmac.txt for the other unchanged properties. ++ ++Required properties: ++- compatible: should be one of the following string: ++ "allwinner,sun8i-a83t-emac" ++ "allwinner,sun8i-h3-emac" ++ "allwinner,sun8i-v3s-emac" ++ "allwinner,sun50i-a64-emac" ++- reg: address and length of the register for the device. ++- interrupts: interrupt for the device ++- interrupt-names: should be "macirq" ++- clocks: A phandle to the reference clock for this device ++- clock-names: should be "stmmaceth" ++- resets: A phandle to the reset control for this device ++- reset-names: should be "stmmaceth" ++- phy-mode: See ethernet.txt ++- phy-handle: See ethernet.txt ++- #address-cells: shall be 1 ++- #size-cells: shall be 0 ++- syscon: A phandle to the syscon of the SoC with one of the following ++ compatible string: ++ - allwinner,sun8i-h3-system-controller ++ - allwinner,sun8i-v3s-system-controller ++ - allwinner,sun50i-a64-system-controller ++ - allwinner,sun8i-a83t-system-controller ++ ++Optional properties: ++- allwinner,tx-delay-ps: TX clock delay chain value in ps. Range value is 0-700. Default is 0) ++- allwinner,rx-delay-ps: RX clock delay chain value in ps. Range value is 0-3100. Default is 0) ++Both delay properties need to be a multiple of 100. They control the delay for ++external PHY. ++ ++Optional properties for the following compatibles: ++ - "allwinner,sun8i-h3-emac", ++ - "allwinner,sun8i-v3s-emac": ++- allwinner,leds-active-low: EPHY LEDs are active low ++ ++Required child node of emac: ++- mdio bus node: should be named mdio ++ ++Required properties of the mdio node: ++- #address-cells: shall be 1 ++- #size-cells: shall be 0 ++ ++The device node referenced by "phy" or "phy-handle" should be a child node ++of the mdio node. See phy.txt for the generic PHY bindings. ++ ++Required properties of the phy node with the following compatibles: ++ - "allwinner,sun8i-h3-emac", ++ - "allwinner,sun8i-v3s-emac": ++- clocks: a phandle to the reference clock for the EPHY ++- resets: a phandle to the reset control for the EPHY ++ ++Example: ++ ++emac: ethernet@1c0b000 { ++ compatible = "allwinner,sun8i-h3-emac"; ++ syscon = <&syscon>; ++ reg = <0x01c0b000 0x104>; ++ interrupts = ; ++ interrupt-names = "macirq"; ++ resets = <&ccu RST_BUS_EMAC>; ++ reset-names = "stmmaceth"; ++ clocks = <&ccu CLK_BUS_EMAC>; ++ clock-names = "stmmaceth"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy-handle = <&int_mii_phy>; ++ phy-mode = "mii"; ++ allwinner,leds-active-low; ++ mdio: mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ int_mii_phy: ethernet-phy@1 { ++ reg = <1>; ++ clocks = <&ccu CLK_BUS_EPHY>; ++ resets = <&ccu RST_BUS_EPHY>; ++ }; ++ }; ++}; +-- +2.14.3 + +From 227bc8c6bfad58c32c7a6c3bbc13d99eb6d266c0 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 31 Oct 2017 09:19:09 +0100 +Subject: [PATCH 05/11] dt-bindings: net: dwmac-sun8i: update documentation + about integrated PHY + +This patch add documentation about the MDIO switch used on sun8i-h3-emac +for integrated PHY. + +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli +Reviewed-by: Andrew Lunn +--- + .../devicetree/bindings/net/dwmac-sun8i.txt | 147 +++++++++++++++++++-- + 1 file changed, 135 insertions(+), 12 deletions(-) + +diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt +index 725f3b187886..3d6d5fa0c4d5 100644 +--- a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt ++++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt +@@ -4,18 +4,18 @@ This device is a platform glue layer for stmmac. + Please see stmmac.txt for the other unchanged properties. + + Required properties: +-- compatible: should be one of the following string: ++- compatible: must be one of the following string: + "allwinner,sun8i-a83t-emac" + "allwinner,sun8i-h3-emac" + "allwinner,sun8i-v3s-emac" + "allwinner,sun50i-a64-emac" + - reg: address and length of the register for the device. + - interrupts: interrupt for the device +-- interrupt-names: should be "macirq" ++- interrupt-names: must be "macirq" + - clocks: A phandle to the reference clock for this device +-- clock-names: should be "stmmaceth" ++- clock-names: must be "stmmaceth" + - resets: A phandle to the reset control for this device +-- reset-names: should be "stmmaceth" ++- reset-names: must be "stmmaceth" + - phy-mode: See ethernet.txt + - phy-handle: See ethernet.txt + - #address-cells: shall be 1 +@@ -39,23 +39,42 @@ Optional properties for the following compatibles: + - allwinner,leds-active-low: EPHY LEDs are active low + + Required child node of emac: +-- mdio bus node: should be named mdio ++- mdio bus node: should be named mdio with compatible "snps,dwmac-mdio" + + Required properties of the mdio node: + - #address-cells: shall be 1 + - #size-cells: shall be 0 + +-The device node referenced by "phy" or "phy-handle" should be a child node ++The device node referenced by "phy" or "phy-handle" must be a child node + of the mdio node. See phy.txt for the generic PHY bindings. + +-Required properties of the phy node with the following compatibles: ++The following compatibles require that the emac node have a mdio-mux child ++node called "mdio-mux": ++ - "allwinner,sun8i-h3-emac" ++ - "allwinner,sun8i-v3s-emac": ++Required properties for the mdio-mux node: ++ - compatible = "allwinner,sun8i-h3-mdio-mux" ++ - mdio-parent-bus: a phandle to EMAC mdio ++ - one child mdio for the integrated mdio with the compatible ++ "allwinner,sun8i-h3-mdio-internal" ++ - one child mdio for the external mdio if present (V3s have none) ++Required properties for the mdio-mux children node: ++ - reg: 1 for internal MDIO bus, 2 for external MDIO bus ++ ++The following compatibles require a PHY node representing the integrated ++PHY, under the integrated MDIO bus node if an mdio-mux node is used: + - "allwinner,sun8i-h3-emac", + - "allwinner,sun8i-v3s-emac": ++ ++Additional information regarding generic multiplexer properties can be found ++at Documentation/devicetree/bindings/net/mdio-mux.txt ++ ++Required properties of the integrated phy node: + - clocks: a phandle to the reference clock for the EPHY + - resets: a phandle to the reset control for the EPHY ++- Must be a child of the integrated mdio + +-Example: +- ++Example with integrated PHY: + emac: ethernet@1c0b000 { + compatible = "allwinner,sun8i-h3-emac"; + syscon = <&syscon>; +@@ -72,13 +91,117 @@ emac: ethernet@1c0b000 { + phy-handle = <&int_mii_phy>; + phy-mode = "mii"; + allwinner,leds-active-low; ++ ++ mdio: mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "snps,dwmac-mdio"; ++ }; ++ ++ mdio-mux { ++ compatible = "mdio-mux", "allwinner,sun8i-h3-mdio-mux"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mdio-parent-bus = <&mdio>; ++ ++ int_mdio: mdio@1 { ++ compatible = "allwinner,sun8i-h3-mdio-internal"; ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ int_mii_phy: ethernet-phy@1 { ++ reg = <1>; ++ clocks = <&ccu CLK_BUS_EPHY>; ++ resets = <&ccu RST_BUS_EPHY>; ++ phy-is-integrated; ++ }; ++ }; ++ ext_mdio: mdio@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; ++ }; ++}; ++ ++Example with external PHY: ++emac: ethernet@1c0b000 { ++ compatible = "allwinner,sun8i-h3-emac"; ++ syscon = <&syscon>; ++ reg = <0x01c0b000 0x104>; ++ interrupts = ; ++ interrupt-names = "macirq"; ++ resets = <&ccu RST_BUS_EMAC>; ++ reset-names = "stmmaceth"; ++ clocks = <&ccu CLK_BUS_EMAC>; ++ clock-names = "stmmaceth"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ allwinner,leds-active-low; ++ ++ mdio: mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ compatible = "snps,dwmac-mdio"; ++ }; ++ ++ mdio-mux { ++ compatible = "allwinner,sun8i-h3-mdio-mux"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mdio-parent-bus = <&mdio>; ++ ++ int_mdio: mdio@1 { ++ compatible = "allwinner,sun8i-h3-mdio-internal"; ++ reg = <1>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ int_mii_phy: ethernet-phy@1 { ++ reg = <1>; ++ clocks = <&ccu CLK_BUS_EPHY>; ++ resets = <&ccu RST_BUS_EPHY>; ++ }; ++ }; ++ ext_mdio: mdio@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ext_rgmii_phy: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ }: ++ }; ++}; ++ ++Example with SoC without integrated PHY ++ ++emac: ethernet@1c0b000 { ++ compatible = "allwinner,sun8i-a83t-emac"; ++ syscon = <&syscon>; ++ reg = <0x01c0b000 0x104>; ++ interrupts = ; ++ interrupt-names = "macirq"; ++ resets = <&ccu RST_BUS_EMAC>; ++ reset-names = "stmmaceth"; ++ clocks = <&ccu CLK_BUS_EMAC>; ++ clock-names = "stmmaceth"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ + mdio: mdio { ++ compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; +- int_mii_phy: ethernet-phy@1 { ++ ext_rgmii_phy: ethernet-phy@1 { + reg = <1>; +- clocks = <&ccu CLK_BUS_EPHY>; +- resets = <&ccu RST_BUS_EPHY>; + }; + }; + }; +-- +2.14.3 + +From 1de79efa35a1130c7a085f62b9d9b666d79b9a89 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 1 Nov 2017 14:04:20 +0000 +Subject: [PATCH 06/11] arm: dts: sunxi: h3/h5: Restore EMAC changes + +The original dwmac-sun8i DT bindings have some issue on how to handle +integrated PHY and was reverted in last RC of 4.13. +But now we have a solution so we need to get back that was reverted. + +This patch restore sunxi-h3-h5.dtsi +This reverts partially commit fe45174b72ae ("arm: dts: sunxi: Revert EMAC changes") + +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli +--- + arch/arm/boot/dts/sunxi-h3-h5.dtsi | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index 11240a8313c2..d38282b9e5d4 100644 +--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi ++++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +@@ -391,6 +391,32 @@ + clocks = <&osc24M>; + }; + ++ emac: ethernet@1c30000 { ++ compatible = "allwinner,sun8i-h3-emac"; ++ syscon = <&syscon>; ++ reg = <0x01c30000 0x10000>; ++ interrupts = ; ++ interrupt-names = "macirq"; ++ resets = <&ccu RST_BUS_EMAC>; ++ reset-names = "stmmaceth"; ++ clocks = <&ccu CLK_BUS_EMAC>; ++ clock-names = "stmmaceth"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ ++ mdio: mdio { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ int_mii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ clocks = <&ccu CLK_BUS_EPHY>; ++ resets = <&ccu RST_BUS_EPHY>; ++ }; ++ }; ++ }; ++ + spi0: spi@01c68000 { + compatible = "allwinner,sun8i-h3-spi"; + reg = <0x01c68000 0x1000>; +-- +2.14.3 + +From 65233cba93184e0efa8d94f907d65af947d197a1 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 31 Oct 2017 09:19:11 +0100 +Subject: [PATCH 07/11] ARM: dts: sunxi: h3/h5: represent the mdio switch used + by sun8i-h3-emac + +Since dwmac-sun8i could use either an integrated PHY or an external PHY +(which could be at same MDIO address), we need to represent this selection +by a MDIO switch. + +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli +Reviewed-by: Andrew Lunn +--- + arch/arm/boot/dts/sunxi-h3-h5.dtsi | 31 +++++++++++++++++++++++++++---- + 1 file changed, 27 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +index d38282b9e5d4..2721b39c1875 100644 +--- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi ++++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi +@@ -408,11 +408,34 @@ + mdio: mdio { + #address-cells = <1>; + #size-cells = <0>; +- int_mii_phy: ethernet-phy@1 { +- compatible = "ethernet-phy-ieee802.3-c22"; ++ compatible = "snps,dwmac-mdio"; ++ }; ++ ++ mdio-mux { ++ compatible = "allwinner,sun8i-h3-mdio-mux"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ mdio-parent-bus = <&mdio>; ++ /* Only one MDIO is usable at the time */ ++ internal_mdio: mdio@1 { ++ compatible = "allwinner,sun8i-h3-mdio-internal"; + reg = <1>; +- clocks = <&ccu CLK_BUS_EPHY>; +- resets = <&ccu RST_BUS_EPHY>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ int_mii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <1>; ++ clocks = <&ccu CLK_BUS_EPHY>; ++ resets = <&ccu RST_BUS_EPHY>; ++ }; ++ }; ++ ++ external_mdio: mdio@2 { ++ reg = <2>; ++ #address-cells = <1>; ++ #size-cells = <0>; + }; + }; + }; +-- +2.14.3 -From fa4788d88903c1e535d034c3dd3fcd386685a02c Mon Sep 17 00:00:00 2001 +From b705315d36dbe1b31062f30c987b3a502b437c85 Mon Sep 17 00:00:00 2001 From: Peter Robinson -Date: Mon, 4 Sep 2017 13:04:41 +0100 -Subject: [PATCH 2/4] Revert "arm: dts: sunxi: Revert EMAC changes" +Date: Wed, 1 Nov 2017 14:08:45 +0000 +Subject: [PATCH 08/11] ARM: dts: sunxi: Restore EMAC changes (boards) + +The original dwmac-sun8i DT bindings have some issue on how to handle +integrated PHY and was reverted in last RC of 4.13. +But now we have a solution so we need to get back that was reverted. -This reverts commit fe45174b72aead678da581bab9e9a37c9b26a070. +This patch restore all boards DT about dwmac-sun8i +This reverts partially commit fe45174b72ae ("arm: dts: sunxi: Revert EMAC changes") + +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli --- - arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 9 ++++++++ - arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts | 19 +++++++++++++++++ - arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 7 ++++++ - arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 +++++++ - arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 8 +++++++ + arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts | 9 +++++++++ + arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts | 19 +++++++++++++++++++ + arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts | 19 +++++++++++++++++++ + arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 7 +++++++ + arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 ++++++++ + arch/arm/boot/dts/sun8i-h3-orangepi-one.dts | 8 ++++++++ arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts | 5 +++++ - arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 8 +++++++ - arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 22 +++++++++++++++++++ - arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts | 16 ++++++++++++++ - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 26 +++++++++++++++++++++++ - 10 files changed, 128 insertions(+) + arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts | 8 ++++++++ + arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 22 ++++++++++++++++++++++ + arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts | 16 ++++++++++++++++ + 10 files changed, 121 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts index b1502df7b509..6713d0f2b3f4 100644 @@ -77,7 +1091,7 @@ index b1502df7b509..6713d0f2b3f4 100644 pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins_a>; diff --git a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts -index a337af1de322..d756ff825116 100644 +index a337af1de322..3f95d806355b 100644 --- a/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts +++ b/arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts @@ -52,6 +52,7 @@ @@ -88,7 +1102,7 @@ index a337af1de322..d756ff825116 100644 serial0 = &uart0; serial1 = &uart1; }; -@@ -114,12 +115,30 @@ +@@ -114,6 +115,24 @@ status = "okay"; }; @@ -103,22 +1117,43 @@ index a337af1de322..d756ff825116 100644 + status = "okay"; +}; + ++&external_mdio { ++ ext_rgmii_phy: ethernet-phy@1 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <0>; ++ }; ++}; ++ &ir { pinctrl-names = "default"; pinctrl-0 = <&ir_pins_a>; +diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts +index 8ddd1b2cc097..ef0371811296 100644 +--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts +@@ -62,3 +62,22 @@ + &ohci2 { status = "okay"; }; - -+&mdio { ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ ++ allwinner,leds-active-low; ++ ++ status = "okay"; ++}; ++ ++&external_mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <0>; ++ reg = <7>; + }; +}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts index 8d2cc6e9a03f..78f6c24952dd 100644 --- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts @@ -229,7 +1264,7 @@ index 1a044b17d6c6..998b60f8d295 100644 pinctrl-names = "default"; pinctrl-0 = <&ir_pins_a>; diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -index 828ae7a526d9..331ed683ac62 100644 +index 828ae7a526d9..3002c025e187 100644 --- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts @@ -47,6 +47,10 @@ @@ -258,7 +1293,7 @@ index 828ae7a526d9..331ed683ac62 100644 + status = "okay"; +}; + -+&mdio { ++&external_mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; @@ -269,7 +1304,7 @@ index 828ae7a526d9..331ed683ac62 100644 pinctrl-names = "default"; pinctrl-0 = <&mmc2_8bit_pins>; diff --git a/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts b/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts -index 97920b12a944..80026f3caafc 100644 +index 97920b12a944..6dbf7b2e0c13 100644 --- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts +++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts @@ -61,3 +61,19 @@ @@ -286,71 +1321,39 @@ index 97920b12a944..80026f3caafc 100644 + status = "okay"; +}; + -+&mdio { ++&external_mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; -diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -index 11240a8313c2..d38282b9e5d4 100644 ---- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi -+++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi -@@ -391,6 +391,32 @@ - clocks = <&osc24M>; - }; - -+ emac: ethernet@1c30000 { -+ compatible = "allwinner,sun8i-h3-emac"; -+ syscon = <&syscon>; -+ reg = <0x01c30000 0x10000>; -+ interrupts = ; -+ interrupt-names = "macirq"; -+ resets = <&ccu RST_BUS_EMAC>; -+ reset-names = "stmmaceth"; -+ clocks = <&ccu CLK_BUS_EMAC>; -+ clock-names = "stmmaceth"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ -+ mdio: mdio { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ int_mii_phy: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ clocks = <&ccu CLK_BUS_EPHY>; -+ resets = <&ccu RST_BUS_EPHY>; -+ }; -+ }; -+ }; -+ - spi0: spi@01c68000 { - compatible = "allwinner,sun8i-h3-spi"; - reg = <0x01c68000 0x1000>; -- -2.13.5 +2.14.3 -From 4aba5ca95496899165ee7ceef5d9c60a6e7b15dd Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Mon, 4 Sep 2017 13:04:47 +0100 -Subject: [PATCH 3/4] Revert "arm64: dts: allwinner: Revert EMAC changes" +From 516b88bfa40cf54732d2ba5e689fdf592a742ec3 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 31 Oct 2017 09:19:13 +0100 +Subject: [PATCH 09/11] arm64: dts: allwinner: A64: Restore EMAC changes + +The original dwmac-sun8i DT bindings have some issue on how to handle +integrated PHY and was reverted in last RC of 4.13. +But now we have a solution so we need to get back that was reverted. + +This patch restore arm64 DT about dwmac-sun8i for A64 +This reverts commit 87e1f5e8bb4b ("arm64: dts: allwinner: Revert EMAC changes") -This reverts commit 87e1f5e8bb4bd584de0a8f3b1e42196dca221d02. +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli --- .../boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 16 ++++++++++++++++ .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 15 +++++++++++++++ arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 17 +++++++++++++++++ .../dts/allwinner/sun50i-a64-sopine-baseboard.dts | 16 ++++++++++++++++ arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 20 ++++++++++++++++++++ - .../boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts | 17 +++++++++++++++++ - .../boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 17 +++++++++++++++++ - .../boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 17 +++++++++++++++++ - 8 files changed, 135 insertions(+) + 5 files changed, 84 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts -index 6872135d7f84..ba2fde2909f9 100644 +index d347f52e27f6..45bdbfb96126 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts @@ -51,6 +51,7 @@ @@ -361,8 +1364,8 @@ index 6872135d7f84..ba2fde2909f9 100644 serial0 = &uart0; serial1 = &uart1; }; -@@ -67,6 +68,14 @@ - }; +@@ -69,6 +70,14 @@ + status = "okay"; }; +&emac { @@ -376,7 +1379,7 @@ index 6872135d7f84..ba2fde2909f9 100644 &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; -@@ -77,6 +86,13 @@ +@@ -79,6 +88,13 @@ bias-pull-up; }; @@ -414,7 +1417,7 @@ index f82ccf332c0f..24f1aac366d6 100644 + }; +}; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -index 7c533b6d4ba9..827168bc22ed 100644 +index d06e34b5d192..806442d3e846 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts @@ -51,6 +51,7 @@ @@ -425,7 +1428,7 @@ index 7c533b6d4ba9..827168bc22ed 100644 serial0 = &uart0; serial1 = &uart1; serial2 = &uart2; -@@ -78,6 +79,15 @@ +@@ -71,6 +72,15 @@ status = "okay"; }; @@ -441,7 +1444,7 @@ index 7c533b6d4ba9..827168bc22ed 100644 &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; -@@ -88,6 +98,13 @@ +@@ -81,6 +91,13 @@ bias-pull-up; }; @@ -456,7 +1459,7 @@ index 7c533b6d4ba9..827168bc22ed 100644 pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins>; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts -index d891a1a27f6c..216e3a5dafae 100644 +index 17ccc12b58df..0eb2acedf8c3 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts @@ -53,6 +53,7 @@ @@ -490,7 +1493,7 @@ index d891a1a27f6c..216e3a5dafae 100644 pinctrl-names = "default"; pinctrl-0 = <&mmc2_pins>; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -index 68aadc9b96dc..bd0f33b77f57 100644 +index 8c8db1b057df..50f17bab0c07 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -449,6 +449,26 @@ @@ -520,8 +1523,31 @@ index 68aadc9b96dc..bd0f33b77f57 100644 gic: interrupt-controller@1c81000 { compatible = "arm,gic-400"; reg = <0x01c81000 0x1000>, +-- +2.14.3 + +From 070173449eb88e9cf9c91889c77f53616911f4d0 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 31 Oct 2017 09:19:14 +0100 +Subject: [PATCH 10/11] arm64: dts: allwinner: H5: Restore EMAC changes + +The original dwmac-sun8i DT bindings have some issue on how to handle +integrated PHY and was reverted in last RC of 4.13. +But now we have a solution so we need to get back that was reverted. + +This patch restore arm64 DT about dwmac-sun8i for H5 +This reverts a part of commit 87e1f5e8bb4b ("arm64: dts: allwinner: Revert EMAC changes") + +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli +--- + arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts | 17 +++++++++++++++++ + .../arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 17 +++++++++++++++++ + .../boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 17 +++++++++++++++++ + 3 files changed, 51 insertions(+) + diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts -index 1c2387bd5df6..968908761194 100644 +index 1c2387bd5df6..6eb8092d8e57 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts @@ -50,6 +50,7 @@ @@ -545,7 +1571,7 @@ index 1c2387bd5df6..968908761194 100644 + status = "okay"; +}; + -+&mdio { ++&external_mdio { + ext_rgmii_phy: ethernet-phy@7 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <7>; @@ -556,7 +1582,7 @@ index 1c2387bd5df6..968908761194 100644 pinctrl-names = "default"; pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts -index 4f77c8470f6c..a8296feee884 100644 +index 4f77c8470f6c..a0ca925175aa 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts @@ -59,6 +59,7 @@ @@ -567,7 +1593,7 @@ index 4f77c8470f6c..a8296feee884 100644 serial0 = &uart0; }; -@@ -136,12 +137,28 @@ +@@ -136,6 +137,22 @@ status = "okay"; }; @@ -580,24 +1606,18 @@ index 4f77c8470f6c..a8296feee884 100644 + status = "okay"; +}; + - &ir { - pinctrl-names = "default"; - pinctrl-0 = <&ir_pins_a>; - status = "okay"; - }; - -+&mdio { ++&external_mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + - &mmc0 { + &ir { pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; + pinctrl-0 = <&ir_pins_a>; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts -index 6be06873e5af..d906b302cbcd 100644 +index 6be06873e5af..b47790650144 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts @@ -54,6 +54,7 @@ @@ -608,7 +1628,7 @@ index 6be06873e5af..d906b302cbcd 100644 serial0 = &uart0; }; -@@ -143,12 +144,28 @@ +@@ -143,6 +144,22 @@ status = "okay"; }; @@ -621,126 +1641,151 @@ index 6be06873e5af..d906b302cbcd 100644 + status = "okay"; +}; + - &ir { - pinctrl-names = "default"; - pinctrl-0 = <&ir_pins_a>; - status = "okay"; - }; - -+&mdio { ++&external_mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + - &mmc0 { + &ir { pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; + pinctrl-0 = <&ir_pins_a>; -- -2.13.5 +2.14.3 -From 11190f020b948ccdf15061b6df8cc2836a2afcb1 Mon Sep 17 00:00:00 2001 +From 63118a9f7808a0a67c23e7d276138c996e094eae Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 31 Oct 2017 09:19:15 +0100 +Subject: [PATCH 11/11] arm64: dts: allwinner: add snps, dwmac-mdio compatible + to emac/mdio + +stmmac bindings docs said that its mdio node must have +compatible = "snps,dwmac-mdio"; +Since dwmac-sun8i does not have any good reasons to not doing it, all +their MDIO node must have it. + +Signed-off-by: Corentin Labbe +Acked-by: Florian Fainelli +--- + arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +index 50f17bab0c07..8fd75c95937a 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +@@ -464,6 +464,7 @@ + #size-cells = <0>; + + mdio: mdio { ++ compatible = "snps,dwmac-mdio"; + #address-cells = <1>; + #size-cells = <0>; + }; +-- +2.14.3 + +From patchwork Fri Nov 10 09:26:54 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: arm64: allwinner: a64: add Ethernet PHY regulator for several boards +From: Icenowy Zheng +X-Patchwork-Id: 10052659 +Message-Id: <20171110092654.10746-1-icenowy@aosc.io> +To: Maxime Ripard , + Chen-Yu Tsai +Cc: linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, Icenowy Zheng +Date: Fri, 10 Nov 2017 17:26:54 +0800 + +On several A64 boards the Ethernet PHY is powered by the DC1SW regulator +on the AXP803 PMIC. + +Add phy-handle property to these boards' emac node. + +Signed-off-by: Icenowy Zheng +Acked-by: Corentin LABBE +Tested-by: Corentin LABBE +--- + arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts | 1 + + arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 1 + + arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +index 45bdbfb96126..4a8d3f83a36e 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +@@ -75,6 +75,7 @@ + pinctrl-0 = <&rgmii_pins>; + phy-mode = "rgmii"; + phy-handle = <&ext_rgmii_phy>; ++ phy-supply = <®_dc1sw>; + status = "okay"; + }; + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +index 806442d3e846..604cdaedac38 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +@@ -77,6 +77,7 @@ + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&ext_rmii_phy1>; ++ phy-supply = <®_dc1sw>; + status = "okay"; + + }; +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +index 0eb2acedf8c3..a053a6ac5267 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +@@ -82,6 +82,7 @@ + pinctrl-0 = <&rgmii_pins>; + phy-mode = "rgmii"; + phy-handle = <&ext_rgmii_phy>; ++ phy-supply = <®_dc1sw>; + status = "okay"; + }; + +From 79e7d6c8bfe67fce8c8fe4953e74ce7f420dd732 Mon Sep 17 00:00:00 2001 From: Peter Robinson -Date: Mon, 4 Sep 2017 13:04:55 +0100 -Subject: [PATCH 4/4] Revert "dt-bindings: net: Revert sun8i dwmac binding" +Date: Tue, 21 Nov 2017 15:43:19 +0000 +Subject: [PATCH] ARM: dts: sunxi: sun8i-h3-nanopi-m1-plus: Add missing + regulator -This reverts commit 8aa33ec2f4812d1ee96f4c02ba013f5b9c514343. +This patch add the missing regulator for sun8i-h3-nanopi-m1-plus. + +Fixes: ("ARM: dts: sunxi: Restore EMAC changes (boards)") +Signed-off-by: Corentin Labbe --- - .../devicetree/bindings/net/dwmac-sun8i.txt | 84 ++++++++++++++++++++++ - 1 file changed, 84 insertions(+) - create mode 100644 Documentation/devicetree/bindings/net/dwmac-sun8i.txt + arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts | 11 +++++++++++ + 1 file changed, 11 insertions(+) -diff --git a/Documentation/devicetree/bindings/net/dwmac-sun8i.txt b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt -new file mode 100644 -index 000000000000..725f3b187886 ---- /dev/null -+++ b/Documentation/devicetree/bindings/net/dwmac-sun8i.txt -@@ -0,0 +1,84 @@ -+* Allwinner sun8i GMAC ethernet controller -+ -+This device is a platform glue layer for stmmac. -+Please see stmmac.txt for the other unchanged properties. -+ -+Required properties: -+- compatible: should be one of the following string: -+ "allwinner,sun8i-a83t-emac" -+ "allwinner,sun8i-h3-emac" -+ "allwinner,sun8i-v3s-emac" -+ "allwinner,sun50i-a64-emac" -+- reg: address and length of the register for the device. -+- interrupts: interrupt for the device -+- interrupt-names: should be "macirq" -+- clocks: A phandle to the reference clock for this device -+- clock-names: should be "stmmaceth" -+- resets: A phandle to the reset control for this device -+- reset-names: should be "stmmaceth" -+- phy-mode: See ethernet.txt -+- phy-handle: See ethernet.txt -+- #address-cells: shall be 1 -+- #size-cells: shall be 0 -+- syscon: A phandle to the syscon of the SoC with one of the following -+ compatible string: -+ - allwinner,sun8i-h3-system-controller -+ - allwinner,sun8i-v3s-system-controller -+ - allwinner,sun50i-a64-system-controller -+ - allwinner,sun8i-a83t-system-controller -+ -+Optional properties: -+- allwinner,tx-delay-ps: TX clock delay chain value in ps. Range value is 0-700. Default is 0) -+- allwinner,rx-delay-ps: RX clock delay chain value in ps. Range value is 0-3100. Default is 0) -+Both delay properties need to be a multiple of 100. They control the delay for -+external PHY. -+ -+Optional properties for the following compatibles: -+ - "allwinner,sun8i-h3-emac", -+ - "allwinner,sun8i-v3s-emac": -+- allwinner,leds-active-low: EPHY LEDs are active low -+ -+Required child node of emac: -+- mdio bus node: should be named mdio -+ -+Required properties of the mdio node: -+- #address-cells: shall be 1 -+- #size-cells: shall be 0 -+ -+The device node referenced by "phy" or "phy-handle" should be a child node -+of the mdio node. See phy.txt for the generic PHY bindings. -+ -+Required properties of the phy node with the following compatibles: -+ - "allwinner,sun8i-h3-emac", -+ - "allwinner,sun8i-v3s-emac": -+- clocks: a phandle to the reference clock for the EPHY -+- resets: a phandle to the reset control for the EPHY -+ -+Example: +diff --git a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts +index ef0371811296..738ef1d9e844 100644 +--- a/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts +@@ -45,6 +45,17 @@ + / { + model = "FriendlyArm NanoPi M1 Plus"; + compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3"; + -+emac: ethernet@1c0b000 { -+ compatible = "allwinner,sun8i-h3-emac"; -+ syscon = <&syscon>; -+ reg = <0x01c0b000 0x104>; -+ interrupts = ; -+ interrupt-names = "macirq"; -+ resets = <&ccu RST_BUS_EMAC>; -+ reset-names = "stmmaceth"; -+ clocks = <&ccu CLK_BUS_EMAC>; -+ clock-names = "stmmaceth"; -+ #address-cells = <1>; -+ #size-cells = <0>; ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; ++ }; + -+ phy-handle = <&int_mii_phy>; -+ phy-mode = "mii"; -+ allwinner,leds-active-low; -+ mdio: mdio { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ int_mii_phy: ethernet-phy@1 { -+ reg = <1>; -+ clocks = <&ccu CLK_BUS_EPHY>; -+ resets = <&ccu RST_BUS_EPHY>; -+ }; -+ }; -+}; + }; + + &ehci1 { -- -2.13.5 +2.14.3 diff --git a/arm-of-restrict-dma-configuration.patch b/arm-of-restrict-dma-configuration.patch deleted file mode 100644 index cc9ddd9..0000000 --- a/arm-of-restrict-dma-configuration.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 723288836628bc1c0855f3bb7b64b1803e4b9e4a Mon Sep 17 00:00:00 2001 -From: Robin Murphy -Date: Thu, 31 Aug 2017 11:32:54 +0100 -Subject: of: restrict DMA configuration - -Moving DMA configuration to happen later at driver probe time had the -unnoticed side-effect that we now perform DMA configuration for *every* -device represented in DT, rather than only those explicitly created by -the of_platform and PCI code. - -As Christoph points out, this is not really the best thing to do. Whilst -there may well be other DMA-capable buses that can benefit from having -their children automatically configured after the bridge has probed, -there are also plenty of others like USB, MDIO, etc. that definitely do -not support DMA and should not be indiscriminately processed. - -The good news is that in most cases the DT "dma-ranges" property serves -as an appropriate indicator - per a strict interpretation of the spec, -anything lacking a "dma-ranges" property should be considered not to -have a mapping of DMA address space from its children to its parent, -thus anything for which of_dma_get_range() does not succeed does not -need DMA configuration. Certain bus types have a general expectation of -DMA capability and carry a well-established precedent that an absent -"dma-ranges" implies the same as the empty property, so we automatically -opt those in to DMA configuration regardless, to avoid regressing most -existing platforms. - -Fixes: 09515ef5ddad ("of/acpi: Configure dma operations at probe time for platform/amba/pci bus devices") -Reported-by: Christoph Hellwig -Signed-off-by: Robin Murphy -Acked-by: Rob Herring -Signed-off-by: Christoph Hellwig ---- - drivers/of/device.c | 48 ++++++++++++++++++++++++++++++++---------------- - 1 file changed, 32 insertions(+), 16 deletions(-) - -diff --git a/drivers/of/device.c b/drivers/of/device.c -index e0a28ea..04c4c95 100644 ---- a/drivers/of/device.c -+++ b/drivers/of/device.c -@@ -9,6 +9,9 @@ - #include - #include - #include -+#include -+#include -+#include - - #include - #include "of_private.h" -@@ -84,31 +87,28 @@ int of_device_add(struct platform_device *ofdev) - */ - int of_dma_configure(struct device *dev, struct device_node *np) - { -- u64 dma_addr, paddr, size; -+ u64 dma_addr, paddr, size = 0; - int ret; - bool coherent; - unsigned long offset; - const struct iommu_ops *iommu; - u64 mask; - -- /* -- * Set default coherent_dma_mask to 32 bit. Drivers are expected to -- * setup the correct supported mask. -- */ -- if (!dev->coherent_dma_mask) -- dev->coherent_dma_mask = DMA_BIT_MASK(32); -- -- /* -- * Set it to coherent_dma_mask by default if the architecture -- * code has not set it. -- */ -- if (!dev->dma_mask) -- dev->dma_mask = &dev->coherent_dma_mask; -- - ret = of_dma_get_range(np, &dma_addr, &paddr, &size); - if (ret < 0) { -+ /* -+ * For legacy reasons, we have to assume some devices need -+ * DMA configuration regardless of whether "dma-ranges" is -+ * correctly specified or not. -+ */ -+ if (!dev_is_pci(dev) && -+#ifdef CONFIG_ARM_AMBA -+ dev->bus != &amba_bustype && -+#endif -+ dev->bus != &platform_bus_type) -+ return ret == -ENODEV ? 0 : ret; -+ - dma_addr = offset = 0; -- size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1); - } else { - offset = PFN_DOWN(paddr - dma_addr); - -@@ -129,6 +129,22 @@ int of_dma_configure(struct device *dev, struct device_node *np) - dev_dbg(dev, "dma_pfn_offset(%#08lx)\n", offset); - } - -+ /* -+ * Set default coherent_dma_mask to 32 bit. Drivers are expected to -+ * setup the correct supported mask. -+ */ -+ if (!dev->coherent_dma_mask) -+ dev->coherent_dma_mask = DMA_BIT_MASK(32); -+ /* -+ * Set it to coherent_dma_mask by default if the architecture -+ * code has not set it. -+ */ -+ if (!dev->dma_mask) -+ dev->dma_mask = &dev->coherent_dma_mask; -+ -+ if (!size) -+ size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1); -+ - dev->dma_pfn_offset = offset; - - /* --- -cgit v1.1 - diff --git a/arm-tegra-fix-gpu-iommu.patch b/arm-tegra-fix-gpu-iommu.patch deleted file mode 100644 index c775c88..0000000 --- a/arm-tegra-fix-gpu-iommu.patch +++ /dev/null @@ -1,39 +0,0 @@ -From patchwork Sun Jul 9 16:36:14 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: ARM: tegra: Register host1x node with iommu binding on tegra124 -From: Paul Kocialkowski -X-Patchwork-Id: 9831825 -Message-Id: <20170709163614.6746-1-contact@paulk.fr> -To: linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org, - linux-kernel@vger.kernel.org -Cc: Thierry Reding , - Stephen Warren , - Mikko Perttunen , - Paul Kocialkowski , - Jonathan Hunter -Date: Sun, 9 Jul 2017 19:36:14 +0300 - -This registers the host1x node with the SMMU (as HC swgroup) to allow -the host1x code to attach to it. It avoid failing the probe sequence, -which resulted in the tegra drm driver not probing and thus nothing -being displayed on-screen. - -Signed-off-by: Paul Kocialkowski ---- - arch/arm/boot/dts/tegra124.dtsi | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi -index 187a36c6d0fc..b3b89befffeb 100644 ---- a/arch/arm/boot/dts/tegra124.dtsi -+++ b/arch/arm/boot/dts/tegra124.dtsi -@@ -85,6 +85,7 @@ - clocks = <&tegra_car TEGRA124_CLK_HOST1X>; - resets = <&tegra_car 28>; - reset-names = "host1x"; -+ iommus = <&mc TEGRA_SWGROUP_HC>; - - #address-cells = <2>; - #size-cells = <2>; diff --git a/arm64-Revert-allwinner-a64-pine64-Use-dcdc1-regulato.patch b/arm64-Revert-allwinner-a64-pine64-Use-dcdc1-regulato.patch new file mode 100644 index 0000000..33f9271 --- /dev/null +++ b/arm64-Revert-allwinner-a64-pine64-Use-dcdc1-regulato.patch @@ -0,0 +1,41 @@ +From 90e388ca5d8bbee022f9ed5fc24137b31579fa6e Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 22 Nov 2017 15:52:36 +0000 +Subject: [PATCH] Revert "arm64: allwinner: a64: pine64: Use dcdc1 regulator + for mmc0" + +This reverts commit 3f241bfa60bdc9c4fde63fa6664a8ce00fd668c6. +--- + arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +index d06e34b5d192..caf8b6fbe5e3 100644 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +@@ -61,6 +61,13 @@ + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ reg_vcc3v3: vcc3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; + }; + + &ehci0 { +@@ -84,7 +91,7 @@ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins>; +- vmmc-supply = <®_dcdc1>; ++ vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; + cd-inverted; + disable-wp; +-- +2.14.3 + diff --git a/arm64-aw64-devices.patch b/arm64-aw64-devices.patch deleted file mode 100644 index 94b1b2b..0000000 --- a/arm64-aw64-devices.patch +++ /dev/null @@ -1,712 +0,0 @@ -From 4c0a84757b5a0365a5dde82e732972eda80a32b1 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Thu, 18 May 2017 15:16:51 +0800 -Subject: arm64: allwinner: a64: add DTSI file for AXP803 PMIC - -As nearly all A64 boards are using AXP803 PMIC, add a DTSI file for it, -like the old DTSI files for AXP20x/22x, for the common parts of the -PMIC. - -Signed-off-by: Icenowy Zheng -Acked-by: Mark Brown -Signed-off-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/axp803.dtsi | 150 ++++++++++++++++++++++++++++++ - 1 file changed, 150 insertions(+) - create mode 100644 arch/arm64/boot/dts/allwinner/axp803.dtsi - -diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi -new file mode 100644 -index 0000000..ff8af52 ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi -@@ -0,0 +1,150 @@ -+/* -+ * Copyright 2017 Icenowy Zheng -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * AXP803 Integrated Power Management Chip -+ * http://files.pine64.org/doc/datasheet/pine64/AXP803_Datasheet_V1.0.pdf -+ */ -+ -+&axp803 { -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ -+ regulators { -+ /* Default work frequency for buck regulators */ -+ x-powers,dcdc-freq = <3000>; -+ -+ reg_aldo1: aldo1 { -+ regulator-name = "aldo1"; -+ }; -+ -+ reg_aldo2: aldo2 { -+ regulator-name = "aldo2"; -+ }; -+ -+ reg_aldo3: aldo3 { -+ regulator-name = "aldo3"; -+ }; -+ -+ reg_dc1sw: dc1sw { -+ regulator-name = "dc1sw"; -+ }; -+ -+ reg_dcdc1: dcdc1 { -+ regulator-name = "dcdc1"; -+ }; -+ -+ reg_dcdc2: dcdc2 { -+ regulator-name = "dcdc2"; -+ }; -+ -+ reg_dcdc3: dcdc3 { -+ regulator-name = "dcdc3"; -+ }; -+ -+ reg_dcdc4: dcdc4 { -+ regulator-name = "dcdc4"; -+ }; -+ -+ reg_dcdc5: dcdc5 { -+ regulator-name = "dcdc5"; -+ }; -+ -+ reg_dcdc6: dcdc6 { -+ regulator-name = "dcdc6"; -+ }; -+ -+ reg_dldo1: dldo1 { -+ regulator-name = "dldo1"; -+ }; -+ -+ reg_dldo2: dldo2 { -+ regulator-name = "dldo2"; -+ }; -+ -+ reg_dldo3: dldo3 { -+ regulator-name = "dldo3"; -+ }; -+ -+ reg_dldo4: dldo4 { -+ regulator-name = "dldo4"; -+ }; -+ -+ reg_eldo1: eldo1 { -+ regulator-name = "eldo1"; -+ }; -+ -+ reg_eldo2: eldo2 { -+ regulator-name = "eldo2"; -+ }; -+ -+ reg_eldo3: eldo3 { -+ regulator-name = "eldo3"; -+ }; -+ -+ reg_fldo1: fldo1 { -+ regulator-name = "fldo1"; -+ }; -+ -+ reg_fldo2: fldo2 { -+ regulator-name = "fldo2"; -+ }; -+ -+ reg_ldo_io0: ldo-io0 { -+ regulator-name = "ldo-io0"; -+ status = "disabled"; -+ }; -+ -+ reg_ldo_io1: ldo-io1 { -+ regulator-name = "ldo-io1"; -+ status = "disabled"; -+ }; -+ -+ reg_rtc_ldo: rtc-ldo { -+ /* RTC_LDO is a fixed, always-on regulator */ -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "rtc-ldo"; -+ }; -+ }; -+}; --- -cgit v1.1 -From 535ca50858e2d8bf1618ace056cd96f0b3d01133 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Tue, 6 Jun 2017 13:59:32 +0800 -Subject: arm64: allwinner: a64: add NMI (R_INTC) controller on A64 - -Allwinner A64 SoC features a R_INTC controller, which controls the NMI -line, and this interrupt line is usually connected to the AXP PMIC. - -Add support for it. - -Signed-off-by: Icenowy Zheng -[wens@csie.org: Add fallback sun6i-a31-r-intc compatible] -Signed-off-by: Chen-Yu Tsai -Acked-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -index 9d00622..78c7c9d 100644 ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -487,6 +487,15 @@ - ; - }; - -+ r_intc: interrupt-controller@1f00c00 { -+ compatible = "allwinner,sun50i-a64-r-intc", -+ "allwinner,sun6i-a31-r-intc"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x01f00c00 0x400>; -+ interrupts = ; -+ }; -+ - r_ccu: clock@1f01400 { - compatible = "allwinner,sun50i-a64-r-ccu"; - reg = <0x01f01400 0x100>; --- -cgit v1.1 -From bf397214530ee5c873dac7b12126b250afd3831f Mon Sep 17 00:00:00 2001 -From: Jagan Teki -Date: Mon, 14 Aug 2017 16:06:53 +0530 -Subject: arm64: allwinner: a64: Add initial NanoPi A64 support - -NanoPi A64 is a new board of high performance with low cost -designed by FriendlyElec., using the Allwinner A64 SOC. - -Nanopi A64 features -- Allwinner A64, 64-bit Quad-core Cortex-A53@648MHz to 1.152GHz, DVFS -- 1GB DDR3 RAM -- MicroSD -- Gigabit Ethernet (RTL8211E) -- Wi-Fi 802.11b/g/n -- IR receiver -- Audio In/Out -- Video In/Out -- Serial Debug Port -- microUSB 5V 2A DC power-supply - -Signed-off-by: Jagan Teki -Signed-off-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/Makefile | 1 + - .../boot/dts/allwinner/sun50i-a64-nanopi-a64.dts | 207 +++++++++++++++++++++ - 2 files changed, 208 insertions(+) - create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts - -diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile -index 108f12c..c997b5c 100644 ---- a/arch/arm64/boot/dts/allwinner/Makefile -+++ b/arch/arm64/boot/dts/allwinner/Makefile -@@ -1,4 +1,5 @@ - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb -+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts -new file mode 100644 -index 0000000..2beef9e ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts -@@ -0,0 +1,207 @@ -+/* -+ * Copyright (C) 2017 Jagan Teki -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+ -+#include "sun50i-a64.dtsi" -+ -+#include -+ -+/ { -+ model = "FriendlyARM NanoPi A64"; -+ compatible = "friendlyarm,nanopi-a64", "allwinner,sun50i-a64"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+/* i2c1 connected with gpio headers like pine64, bananapi */ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins>; -+ status = "disabled"; -+}; -+ -+&i2c1_pins { -+ bias-pull-up; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins>; -+ vmmc-supply = <®_dcdc1>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; -+ cd-inverted; -+ disable-wp; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&r_rsb { -+ status = "okay"; -+ -+ axp803: pmic@3a3 { -+ compatible = "x-powers,axp803"; -+ reg = <0x3a3>; -+ interrupt-parent = <&r_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp803.dtsi" -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pl"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1040000>; -+ regulator-max-microvolt = <1300000>; -+ regulator-name = "vdd-cpux"; -+}; -+ -+/* DCDC3 is polyphased with DCDC2 */ -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dcdc6 { -+ regulator-always-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-hdmi-dsi"; -+}; -+ -+®_dldo4 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-pg-wifi-io"; -+}; -+ -+®_eldo1 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "cpvdd"; -+}; -+ -+®_fldo1 { -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-name = "vcc-1v2-hsic"; -+}; -+ -+/* -+ * The A64 chip cannot work without this regulator off, although -+ * it seems to be only driving the AR100 core. -+ * Maybe we don't still know well about CPUs domain. -+ */ -+®_fldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ status = "okay"; -+}; --- -cgit v1.1 -From 4969efb28b4301b09aba621f30cf81c582c018a8 Mon Sep 17 00:00:00 2001 -From: Jagan Teki -Date: Mon, 14 Aug 2017 16:16:04 +0530 -Subject: arm64: allwinner: a64: Add A64-OLinuXino initial support - -OLimex A64-OLinuXino is an open-source hardware board -using the Allwinner A64 SOC. - -OLimex A64-OLinuXino has -- A64 Quad-core Cortex-A53 64bit -- 1GB or 2GB RAM DDR3L @ 672Mhz -- microSD slot and 4/8/16GB eMMC -- Debug TTL UART -- HDMI -- LCD -- IR receiver -- 5V DC power supply - -Signed-off-by: Jagan Teki -Signed-off-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/Makefile | 1 + - .../boot/dts/allwinner/sun50i-a64-olinuxino.dts | 199 +++++++++++++++++++++ - 2 files changed, 200 insertions(+) - create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts - -diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile -index c997b5c..19c3fbd 100644 ---- a/arch/arm64/boot/dts/allwinner/Makefile -+++ b/arch/arm64/boot/dts/allwinner/Makefile -@@ -1,5 +1,6 @@ - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-bananapi-m64.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-nanopi-a64.dtb -+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-olinuxino.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-orangepi-win.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb - dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb -diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts -new file mode 100644 -index 0000000..338e7861 ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts -@@ -0,0 +1,199 @@ -+/* -+ * Copyright (C) 2017 Jagan Teki -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+ -+#include "sun50i-a64.dtsi" -+ -+#include -+ -+/ { -+ model = "Olimex A64-Olinuxino"; -+ compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins>; -+ vmmc-supply = <®_dcdc1>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; -+ cd-inverted; -+ disable-wp; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&r_rsb { -+ status = "okay"; -+ -+ axp803: pmic@3a3 { -+ compatible = "x-powers,axp803"; -+ reg = <0x3a3>; -+ interrupt-parent = <&r_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp803.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vcc-pe"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pl"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-3v3"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1040000>; -+ regulator-max-microvolt = <1300000>; -+ regulator-name = "vdd-cpux"; -+}; -+ -+/* DCDC3 is polyphased with DCDC2 */ -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-ddr3"; -+}; -+ -+®_dcdc6 { -+ regulator-always-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-hdmi"; -+}; -+ -+®_dldo2 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-mipi"; -+}; -+ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vcc-avdd-csi"; -+}; -+ -+®_dldo4 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi-io"; -+}; -+ -+®_eldo1 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "cpvdd"; -+}; -+ -+®_eldo2 { -+ regulator-min-microvolt = <1800000>; -+ regulator-max-microvolt = <1800000>; -+ regulator-name = "vcc-dvdd-csi"; -+}; -+ -+®_fldo1 { -+ regulator-min-microvolt = <1200000>; -+ regulator-max-microvolt = <1200000>; -+ regulator-name = "vcc-1v2-hsic"; -+}; -+ -+/* -+ * The A64 chip cannot work without this regulator off, although -+ * it seems to be only driving the AR100 core. -+ * Maybe we don't still know well about CPUs domain. -+ */ -+®_fldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1100000>; -+ regulator-max-microvolt = <1100000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; --- -cgit v1.1 diff --git a/arm64-cavium-fixes.patch b/arm64-cavium-fixes.patch deleted file mode 100644 index a898bb7..0000000 --- a/arm64-cavium-fixes.patch +++ /dev/null @@ -1,455 +0,0 @@ -From c03847b4a603846903ee72a5e1baab03e0591423 Mon Sep 17 00:00:00 2001 -From: Ashok Kumar Sekar -Date: Fri, 23 Sep 2016 04:16:19 -0700 -Subject: [PATCH 1/8] PCI: Vulcan: AHCI PCI bar fix for Broadcom Vulcan early - silicon - -PCI BAR 5 is not setup correctly for the on-board AHCI -controller on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 -by using BAR 4's resources which are populated correctly but NOT used -by the AHCI controller actually. - -Signed-off-by: Ashok Kumar Sekar -Signed-off-by: Jayachandran C -Signed-off-by: Robert Richter ---- - drivers/pci/quirks.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c -index dc624fb34e72..94b7bdf63b19 100644 ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -3994,6 +3994,30 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9084, - quirk_bridge_cavm_thrx2_pcie_root); - - /* -+ * PCI BAR 5 is not setup correctly for the on-board AHCI controller -+ * on Broadcom's Vulcan processor. Added a quirk to fix BAR 5 by -+ * using BAR 4's resources which are populated correctly and NOT -+ * actually used by the AHCI controller. -+ */ -+static void quirk_fix_vulcan_ahci_bars(struct pci_dev *dev) -+{ -+ struct resource *r = &dev->resource[4]; -+ -+ if (!(r->flags & IORESOURCE_MEM) || (r->start == 0)) -+ return; -+ -+ /* Set BAR5 resource to BAR4 */ -+ dev->resource[5] = *r; -+ -+ /* Update BAR5 in pci config space */ -+ pci_write_config_dword(dev, PCI_BASE_ADDRESS_5, r->start); -+ -+ /* Clear BAR4's resource */ -+ memset(r, 0, sizeof(*r)); -+} -+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_BROADCOM, 0x9027, quirk_fix_vulcan_ahci_bars); -+ -+/* - * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero) - * class code. Fix it. - */ --- -2.11.0 - -From c84892e4b6b671fda7e499a0bb0787bd026de015 Mon Sep 17 00:00:00 2001 -From: Jayachandran C -Date: Fri, 10 Mar 2017 10:04:52 +0000 -Subject: [PATCH 2/8] ahci: thunderx2: Fix for errata that affects stop engine - -Apply workaround for this errata: - Synopsis: Resetting PxCMD.ST may hang the SATA device - - Description: An internal ping-pong buffer state is not reset - correctly for an PxCMD.ST=0 command for a SATA channel. This - may cause the SATA interface to hang when a PxCMD.ST=0 command - is received. - - Workaround: A SATA_BIU_CORE_ENABLE.sw_init_bsi must be asserted - by the driver whenever the PxCMD.ST needs to be de-asserted. This - will reset both the ports. So, it may not always work in a 2 - channel SATA system. - - Resolution: Fix in B0. - -Add the code to ahci_stop_engine() to do this. It is not easy to -stop the other "port" since it is associated with a different AHCI -interface. Please note that with this fix, SATA reset does not -hang any more, but it can cause failures on the other interface -if that is in active use. - -Unfortunately, we have nothing other the the CPU ID to check if the -SATA block has this issue. - -Signed-off-by: Jayachandran C -[added check to restict to pci devs on the soc only] -Signed-off-by: Robert Richter ---- - drivers/ata/libahci.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c -index 3e286d86ab42..9116bba1b07d 100644 ---- a/drivers/ata/libahci.c -+++ b/drivers/ata/libahci.c -@@ -669,6 +669,23 @@ int ahci_stop_engine(struct ata_port *ap) - tmp &= ~PORT_CMD_START; - writel(tmp, port_mmio + PORT_CMD); - -+#ifdef CONFIG_ARM64 -+ /* Rev Ax of Cavium CN99XX needs a hack for port stop */ -+ if (dev_is_pci(ap->host->dev) && -+ to_pci_dev(ap->host->dev)->vendor == 0x14e4 && -+ to_pci_dev(ap->host->dev)->device == 0x9027 && -+ MIDR_IS_CPU_MODEL_RANGE(read_cpuid_id(), -+ MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN), -+ MIDR_CPU_VAR_REV(0, 0), -+ MIDR_CPU_VAR_REV(0, MIDR_REVISION_MASK))) { -+ tmp = readl(hpriv->mmio + 0x8000); -+ writel(tmp | (1 << 26), hpriv->mmio + 0x8000); -+ udelay(1); -+ writel(tmp & ~(1 << 26), hpriv->mmio + 0x8000); -+ dev_warn(ap->host->dev, "CN99XX stop engine fix applied!\n"); -+ } -+#endif -+ - /* wait for engine to stop. This could be as long as 500 msec */ - tmp = ata_wait_register(ap, port_mmio + PORT_CMD, - PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); --- -2.11.0 - -From 98a39621952f6a13c5198e79f1c080ea6fc1d092 Mon Sep 17 00:00:00 2001 -From: Jayachandran C -Date: Sun, 22 Feb 1998 18:42:42 -0800 -Subject: [PATCH 3/8] ahci: thunderx2: stop engine fix update - -The current reset fix fails during continuous reboot test. The failure -happens when both the on-board SATA slots are used and when one of the -controllers are reset. - -The latest ThunderX2 firmware (3.1) enables hardware error interrupts and -when the reset fix fails, we get a hang with the print: -[ 14.839308] sd 1:0:0:0: [sdb] 468862128 512-byte logical blocks: (240 GB/224 GiB) -[ 14.846796] sd 1:0:0:0: [sdb] 4096-byte physical blocks -[ 14.852036] sd 1:0:0:0: [sdb] Write Protect is off -[ 14.856843] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA -[ 14.866022] ata2.00: Enabling discard_zeroes_data - - *** NBU BAR Error 0x1e25c *** - AddrLo 0x1d80180 AddrHi 0x0 - -To fix this issue, update the SATA reset fix to increase the delays between register writes. - -Signed-off-by: Jayachandran C -Signed-off-by: Robert Richter ---- - drivers/ata/libahci.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c -index 9116bba1b07d..1d3e614bad2b 100644 ---- a/drivers/ata/libahci.c -+++ b/drivers/ata/libahci.c -@@ -679,10 +679,11 @@ int ahci_stop_engine(struct ata_port *ap) - MIDR_CPU_VAR_REV(0, 0), - MIDR_CPU_VAR_REV(0, MIDR_REVISION_MASK))) { - tmp = readl(hpriv->mmio + 0x8000); -+ udelay(100); - writel(tmp | (1 << 26), hpriv->mmio + 0x8000); -- udelay(1); -+ udelay(100); - writel(tmp & ~(1 << 26), hpriv->mmio + 0x8000); -- dev_warn(ap->host->dev, "CN99XX stop engine fix applied!\n"); -+ dev_warn(ap->host->dev, "CN99XX SATA reset workaround applied\n"); - } - #endif - --- -2.11.0 - -From 33c107d2a2b570cd5246262108ad07cc102e9fcd Mon Sep 17 00:00:00 2001 -From: Robert Richter -Date: Thu, 16 Mar 2017 18:01:59 +0100 -Subject: [PATCH 4/8] iommu/arm-smmu, ACPI: Enable Cavium SMMU-v2 - -In next IORT spec release there will be a definition of a Cavium -specific model. Until then, enable the Cavium SMMU using cpu id -registers. All versions of Cavium's SMMUv2 implementation must be -enabled. - -Signed-off-by: Robert Richter ---- - drivers/iommu/arm-smmu.c | 22 +++++++++++++++++++++- - 1 file changed, 21 insertions(+), 1 deletion(-) - -diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c -index d42cad5a3d52..37aee96ccc0e 100644 ---- a/drivers/iommu/arm-smmu.c -+++ b/drivers/iommu/arm-smmu.c -@@ -53,6 +53,8 @@ - - #include - -+#include -+ - #include "io-pgtable.h" - #include "arm-smmu-regs.h" - -@@ -1871,6 +1873,24 @@ static const struct of_device_id arm_smmu_of_match[] = { - MODULE_DEVICE_TABLE(of, arm_smmu_of_match); - - #ifdef CONFIG_ACPI -+ -+static int acpi_smmu_enable_cavium(struct arm_smmu_device *smmu, int ret) -+{ -+ u32 cpu_model; -+ -+ if (!IS_ENABLED(CONFIG_ARM64)) -+ return ret; -+ -+ cpu_model = read_cpuid_id() & MIDR_CPU_MODEL_MASK; -+ if (cpu_model != MIDR_THUNDERX) -+ return ret; -+ -+ smmu->version = ARM_SMMU_V2; -+ smmu->model = CAVIUM_SMMUV2; -+ -+ return 0; -+} -+ - static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu) - { - int ret = 0; -@@ -1901,7 +1921,7 @@ static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu) - ret = -ENODEV; - } - -- return ret; -+ return acpi_smmu_enable_cavium(smmu, ret); - } - - static int arm_smmu_device_acpi_probe(struct platform_device *pdev, --- -2.11.0 - -From 5523edb06c95d7ac9e81d94366e71d929c08ebd4 Mon Sep 17 00:00:00 2001 -From: Robert Richter -Date: Wed, 12 Apr 2017 15:06:03 +0200 -Subject: [PATCH 5/8] iommu: Print a message with the default domain type - created - -There are several ways the bypass mode can be enabled. With commit - - fccb4e3b8ab0 iommu: Allow default domain type to be set on the kernel command line - -there is the option to switch into bypass mode. And, depending on -devicetree options, bypass mode can be also enabled. This makes it -hard to determine if direct mapping is enabled. Print message with the -default domain type case. - -Signed-off-by: Robert Richter ---- - drivers/iommu/iommu.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c -index 3f6ea160afed..7aaafaca6baf 100644 ---- a/drivers/iommu/iommu.c -+++ b/drivers/iommu/iommu.c -@@ -599,7 +599,9 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev) - - trace_add_device_to_group(group->id, dev); - -- pr_info("Adding device %s to group %d\n", dev_name(dev), group->id); -+ pr_info("Adding device %s to group %d, default domain type %d\n", -+ dev_name(dev), group->id, -+ group->default_domain ? group->default_domain->type : -1); - - return 0; - --- -2.11.0 - -From 71e0ad5ab606077c24a96d69f4bfed58d7ef16c7 Mon Sep 17 00:00:00 2001 -From: Robert Richter -Date: Thu, 4 May 2017 17:48:48 +0200 -Subject: [PATCH 6/8] iommu, aarch64: Set bypass mode per default - -We see a performance degradation if smmu is enabled in non-bypass mode. -This is a problem in the kernel's implememntation. Until that is solved, -enable smmu in bypass mode per default. - -We have tested that SMMU passthrough mode doesn't effect VFIO on both -CN88xx and CN99xx and haven't found any issues. - -Signed-off-by: Robert Richter ---- - drivers/iommu/iommu.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c -index 7aaafaca6baf..24de0b934221 100644 ---- a/drivers/iommu/iommu.c -+++ b/drivers/iommu/iommu.c -@@ -36,7 +36,12 @@ - - static struct kset *iommu_group_kset; - static DEFINE_IDA(iommu_group_ida); -+ -+#ifdef CONFIG_ARM64 -+static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_IDENTITY; -+#else - static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA; -+#endif - - struct iommu_callback_data { - const struct iommu_ops *ops; --- -2.11.0 - -From 27f103963f926d6a7a8adaad1ee227fd3b51f591 Mon Sep 17 00:00:00 2001 -From: Robert Richter -Date: Wed, 12 Apr 2017 10:31:15 +0200 -Subject: [PATCH 7/8] iommu/arm-smmu, ACPI: Enable Cavium SMMU-v3 - -In next IORT spec release there will be a definition of a Cavium -specific model. Until then, enable the Cavium SMMU using cpu id -registers. Early silicon versions (A1) of Cavium's CN99xx SMMUv3 -implementation must be enabled. For later silicon versions (B0) the -iort change will be in place. - -Signed-off-by: Robert Richter ---- - drivers/acpi/arm64/iort.c | 16 ++++++++++++++-- - drivers/iommu/arm-smmu-v3.c | 19 +++++++++++++++++++ - 2 files changed, 33 insertions(+), 2 deletions(-) - -diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c -index a3215ee671c1..b603af92eec2 100644 ---- a/drivers/acpi/arm64/iort.c -+++ b/drivers/acpi/arm64/iort.c -@@ -26,6 +26,8 @@ - #include - #include - -+#include -+ - #define IORT_TYPE_MASK(type) (1 << (type)) - #define IORT_MSI_TYPE (1 << ACPI_IORT_NODE_ITS_GROUP) - #define IORT_IOMMU_TYPE ((1 << ACPI_IORT_NODE_SMMU) | \ -@@ -824,13 +826,22 @@ static int __init arm_smmu_v3_count_resources(struct acpi_iort_node *node) - return num_res; - } - -+static bool is_cavium_cn99xx_smmu_v3(void) -+{ -+ u32 cpu_model = read_cpuid_id() & MIDR_CPU_MODEL_MASK; -+ -+ return cpu_model == MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, -+ BRCM_CPU_PART_VULCAN); -+} -+ - static bool arm_smmu_v3_is_combined_irq(struct acpi_iort_smmu_v3 *smmu) - { - /* - * Cavium ThunderX2 implementation doesn't not support unique - * irq line. Use single irq line for all the SMMUv3 interrupts. - */ -- if (smmu->model != ACPI_IORT_SMMU_V3_CAVIUM_CN99XX) -+ if (smmu->model != ACPI_IORT_SMMU_V3_CAVIUM_CN99XX -+ && !is_cavium_cn99xx_smmu_v3()) - return false; - - /* -@@ -848,7 +859,8 @@ static unsigned long arm_smmu_v3_resource_size(struct acpi_iort_smmu_v3 *smmu) - * Override the size, for Cavium ThunderX2 implementation - * which doesn't support the page 1 SMMU register space. - */ -- if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX) -+ if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX -+ || is_cavium_cn99xx_smmu_v3()) - return SZ_64K; - - return SZ_128K; -diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c -index 568c400eeaed..d147cb5c7309 100644 ---- a/drivers/iommu/arm-smmu-v3.c -+++ b/drivers/iommu/arm-smmu-v3.c -@@ -39,6 +39,8 @@ - - #include - -+#include -+ - #include "io-pgtable.h" - - /* MMIO registers */ -@@ -2659,6 +2661,21 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu) - } - - #ifdef CONFIG_ACPI -+ -+static void acpi_smmu_enable_cavium(struct arm_smmu_device *smmu) -+{ -+ u32 cpu_model; -+ -+ if (!IS_ENABLED(CONFIG_ARM64)) -+ return; -+ -+ cpu_model = read_cpuid_id() & MIDR_CPU_MODEL_MASK; -+ if (cpu_model != MIDR_CPU_MODEL(ARM_CPU_IMP_BRCM, BRCM_CPU_PART_VULCAN)) -+ return; -+ -+ smmu->options |= ARM_SMMU_OPT_PAGE0_REGS_ONLY; -+} -+ - static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu) - { - switch (model) { -@@ -2670,6 +2687,8 @@ static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu) - break; - } - -+ acpi_smmu_enable_cavium(smmu); -+ - dev_notice(smmu->dev, "option mask 0x%x\n", smmu->options); - } - --- -2.11.0 - -From ff677cc625b52b93351dd73d7881251067f0e976 Mon Sep 17 00:00:00 2001 -From: Radha Mohan Chintakuntla -Date: Wed, 20 Aug 2014 15:10:58 -0700 -Subject: [PATCH 8/8] arm64: gicv3: its: Increase FORCE_MAX_ZONEORDER for - Cavium ThunderX - -In case of ARCH_THUNDER, there is a need to allocate the GICv3 ITS table -which is bigger than the allowed max order. So we are forcing it only in -case of 4KB page size. - -Signed-off-by: Radha Mohan Chintakuntla -[rric: use ARM64_4K_PAGES since we have now ARM64_16K_PAGES, change order] -Signed-off-by: Robert Richter ---- - arch/arm64/Kconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 2c3e2d693d76..023867378f45 100644 ---- a/arch/arm64/Kconfig -+++ b/arch/arm64/Kconfig -@@ -784,6 +784,7 @@ config FORCE_MAX_ZONEORDER - default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) - default "13" if (ARCH_THUNDER && !ARM64_64K_PAGES) - default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE) -+ default "13" if (ARM64_4K_PAGES && ARCH_THUNDER) - default "11" - help - The kernel memory allocator divides physically contiguous memory --- -2.11.0 - diff --git a/arm64-socionext-96b-enablement.patch b/arm64-socionext-96b-enablement.patch index 8eb99ea..0a7df3a 100644 --- a/arm64-socionext-96b-enablement.patch +++ b/arm64-socionext-96b-enablement.patch @@ -108,6 +108,158 @@ index fd4b7f6..14e2419 100644 -- cgit v1.1 +From 33d983b5bb2929ae242606925e708092b1dfdd8f Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Sat, 2 Sep 2017 11:01:22 +0100 +Subject: drivers/irqchip: gicv3: add workaround for Synquacer pre-ITS + +In their infinite wisdom, the Socionext engineers have decided +that ITS device IDs should not be hardwired, but it should be +left up to the software to assign them, by allowing it to +redirect MSI doorbell writes via a separate hardware block +that issues the doorbell write with a device ID that is +derived from the memory address. This completely breaks any +kind of isolation, or virtualization in general, for that +matter, but add support for it nonetheless. + +Signed-off-by: Ard Biesheuvel +--- + arch/arm64/Kconfig | 8 +++++++ + drivers/irqchip/irq-gic-v3-its.c | 48 +++++++++++++++++++++++++++++++++++----- + 2 files changed, 51 insertions(+), 5 deletions(-) + +diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig +index 0df64a6..c4361df 100644 +--- a/arch/arm64/Kconfig ++++ b/arch/arm64/Kconfig +@@ -539,6 +539,14 @@ config QCOM_QDF2400_ERRATUM_0065 + + If unsure, say Y. + ++config SOCIONEXT_SYNQUACER_PREITS ++ bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" ++ default y ++ help ++ Socionext Synquacer SoCs implement a separate h/w block to generate ++ MSI doorbell writes with non-zero values for the device ID. ++ ++ If unsure, say Y. + endmenu + + +diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c +index e8d8934..0d372f1 100644 +--- a/drivers/irqchip/irq-gic-v3-its.c ++++ b/drivers/irqchip/irq-gic-v3-its.c +@@ -46,6 +46,7 @@ + #define ITS_FLAGS_CMDQ_NEEDS_FLUSHING (1ULL << 0) + #define ITS_FLAGS_WORKAROUND_CAVIUM_22375 (1ULL << 1) + #define ITS_FLAGS_WORKAROUND_CAVIUM_23144 (1ULL << 2) ++#define ITS_FLAGS_WORKAROUND_SOCIONEXT_PREITS (1ULL << 3) + + #define RDIST_FLAGS_PROPBASE_NEEDS_FLUSHING (1 << 0) + +@@ -99,6 +100,10 @@ struct its_node { + struct its_collection *collections; + struct list_head its_device_list; + u64 flags; ++#ifdef CONFIG_SOCIONEXT_SYNQUACER_PREITS ++ u64 pre_its_base; ++ u64 pre_its_size; ++#endif + u32 ite_size; + u32 device_ids; + int numa_node; +@@ -1102,13 +1107,29 @@ static void its_irq_compose_msi_msg(struct irq_data *d, struct msi_msg *msg) + u64 addr; + + its = its_dev->its; +- addr = its->phys_base + GITS_TRANSLATER; ++ ++#ifdef CONFIG_SOCIONEXT_SYNQUACER_PREITS ++ if (its->flags & ITS_FLAGS_WORKAROUND_SOCIONEXT_PREITS) ++ ++ /* ++ * The Socionext Synquacer SoC has a so-called 'pre-ITS', ++ * which maps 32-bit writes into a separate window of size ++ * '4 << device_id_bits' onto writes to GITS_TRANSLATER with ++ * device ID taken from bits [device_id_bits + 1:2] of the ++ * window offset. ++ */ ++ addr = its->pre_its_base + (its_dev->device_id << 2); ++ else ++#endif ++ addr = its->phys_base + GITS_TRANSLATER; + + msg->address_lo = lower_32_bits(addr); + msg->address_hi = upper_32_bits(addr); + msg->data = its_get_event_id(d); + +- iommu_dma_map_msi_msg(d->irq, msg); ++ if (!IS_ENABLED(CONFIG_SOCIONEXT_SYNQUACER_PREITS) || ++ !(its->flags & ITS_FLAGS_WORKAROUND_SOCIONEXT_PREITS)) ++ iommu_dma_map_msi_msg(d->irq, msg); + } + + static int its_irq_set_irqchip_state(struct irq_data *d, +@@ -1666,6 +1687,11 @@ static int its_alloc_tables(struct its_node *its) + ids = 0x14; /* 20 bits, 8MB */ + } + ++#ifdef CONFIG_SOCIONEXT_SYNQUACER_PREITS ++ if (its->flags & ITS_FLAGS_WORKAROUND_SOCIONEXT_PREITS) ++ ids = ilog2(its->pre_its_size) - 2; ++#endif ++ + its->device_ids = ids; + + for (i = 0; i < GITS_BASER_NR_REGS; i++) { +@@ -2788,11 +2814,21 @@ static const struct gic_quirk its_quirks[] = { + } + }; + +-static void its_enable_quirks(struct its_node *its) ++static void its_enable_quirks(struct its_node *its, ++ struct fwnode_handle *handle) + { + u32 iidr = readl_relaxed(its->base + GITS_IIDR); + + gic_enable_quirks(iidr, its_quirks, its); ++ ++#ifdef CONFIG_SOCIONEXT_SYNQUACER_PREITS ++ if (!fwnode_property_read_u64_array(handle, ++ "socionext,synquacer-pre-its", ++ &its->pre_its_base, 2)) { ++ its->flags |= ITS_FLAGS_WORKAROUND_SOCIONEXT_PREITS; ++ pr_info("ITS: enabling workaround for Socionext Synquacer pre-ITS\n"); ++ } ++#endif + } + + static int its_init_domain(struct fwnode_handle *handle, struct its_node *its) +@@ -2812,7 +2848,9 @@ static int its_init_domain(struct fwnode_handle *handle, struct its_node *its) + + inner_domain->parent = its_parent; + irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_NEXUS); +- inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_REMAP; ++ ++ if (!(its->flags & ITS_FLAGS_WORKAROUND_SOCIONEXT_PREITS)) ++ inner_domain->flags |= IRQ_DOMAIN_FLAG_MSI_REMAP; + info->ops = &its_msi_domain_ops; + info->data = its; + inner_domain->host_data = info; +@@ -2966,7 +3004,7 @@ static int __init its_probe_one(struct resource *res, + } + its->cmd_write = its->cmd_base; + +- its_enable_quirks(its); ++ its_enable_quirks(its, handle); + + err = its_alloc_tables(its); + if (err) +-- +cgit v1.1 + From 26e7bb47b0fb03a01be1e391a08c7375b45335a2 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Mon, 21 Aug 2017 20:29:05 +0100 @@ -173,6 +325,7 @@ index c61be97..7d5a23e 100644 --- a/drivers/pci/dwc/Makefile +++ b/drivers/pci/dwc/Makefile @@ -1,5 +1,6 @@ + # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_PCIE_DW) += pcie-designware.o obj-$(CONFIG_PCIE_DW_HOST) += pcie-designware-host.o +obj-$(CONFIG_PCIE_DW_HOST_ECAM) += pcie-designware-ecam.o @@ -2896,3 +3049,51 @@ index 0000000..4695969 -- cgit v1.1 +From d2fc584f8237746a84e6ec8690d8884f148fc449 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Tue, 10 Oct 2017 11:35:51 +0100 +Subject: [PATCH] add interrupt.h, sort alphabetically + +Signed-off-by: Peter Robinson +--- + drivers/net/ethernet/socionext/netsec/netsec_platform.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/drivers/net/ethernet/socionext/netsec/netsec_platform.c b/drivers/net/ethernet/socionext/netsec/netsec_platform.c +index 624f6a7093f6..79072bae917d 100644 +--- a/drivers/net/ethernet/socionext/netsec/netsec_platform.c ++++ b/drivers/net/ethernet/socionext/netsec/netsec_platform.c +@@ -14,21 +14,22 @@ + */ + + #include +-#include +-#include +-#include +-#include + #include ++#include ++#include ++#include + #include ++#include ++#include + #include +-#include +-#include +-#include ++#include + #include + #include + #include +-#include ++#include + #include ++#include ++#include + + #include "netsec.h" + +-- +2.14.2 + diff --git a/arm64-xgene-acpi-fix.patch b/arm64-xgene-acpi-fix.patch deleted file mode 100644 index e0df833..0000000 --- a/arm64-xgene-acpi-fix.patch +++ /dev/null @@ -1,38 +0,0 @@ -From bdb9458a3382ba745a66be5526d3899103c76eda Mon Sep 17 00:00:00 2001 -From: Loc Ho -Date: Fri, 21 Jul 2017 11:24:37 -0700 -Subject: ACPI: APEI: Enable APEI multiple GHES source to share a single - external IRQ - -X-Gene platforms describe multiple GHES error sources with the same -hardware error notification type (external interrupt) and interrupt -number. - -Change the GHES interrupt request to support sharing the same IRQ. - -This change includs contributions from Tuan Phan . - -Signed-off-by: Loc Ho -Acked-by: Borislav Petkov -Signed-off-by: Rafael J. Wysocki ---- - drivers/acpi/apei/ghes.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c -index d661d45..eed09fc 100644 ---- a/drivers/acpi/apei/ghes.c -+++ b/drivers/acpi/apei/ghes.c -@@ -1157,7 +1157,8 @@ static int ghes_probe(struct platform_device *ghes_dev) - generic->header.source_id); - goto err_edac_unreg; - } -- rc = request_irq(ghes->irq, ghes_irq_func, 0, "GHES IRQ", ghes); -+ rc = request_irq(ghes->irq, ghes_irq_func, IRQF_SHARED, -+ "GHES IRQ", ghes); - if (rc) { - pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n", - generic->header.source_id); --- -cgit v1.1 - diff --git a/baseconfig/CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ b/baseconfig/CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ new file mode 100644 index 0000000..40a287f --- /dev/null +++ b/baseconfig/CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ @@ -0,0 +1 @@ +CONFIG_ALLOW_LOCKDOWN_LIFT_BY_SYSRQ=y diff --git a/baseconfig/CONFIG_ALTERA_MSGDMA b/baseconfig/CONFIG_ALTERA_MSGDMA new file mode 100644 index 0000000..7a1edd8 --- /dev/null +++ b/baseconfig/CONFIG_ALTERA_MSGDMA @@ -0,0 +1 @@ +CONFIG_ALTERA_MSGDMA=m diff --git a/baseconfig/CONFIG_ATH10K_USB b/baseconfig/CONFIG_ATH10K_USB new file mode 100644 index 0000000..2902150 --- /dev/null +++ b/baseconfig/CONFIG_ATH10K_USB @@ -0,0 +1 @@ +CONFIG_ATH10K_USB=m diff --git a/baseconfig/CONFIG_BATTERY_MAX1721X b/baseconfig/CONFIG_BATTERY_MAX1721X new file mode 100644 index 0000000..98c0456 --- /dev/null +++ b/baseconfig/CONFIG_BATTERY_MAX1721X @@ -0,0 +1 @@ +# CONFIG_BATTERY_MAX1721X is not set diff --git a/baseconfig/CONFIG_BLK_CPQ_CISS_DA b/baseconfig/CONFIG_BLK_CPQ_CISS_DA deleted file mode 100644 index be78700..0000000 --- a/baseconfig/CONFIG_BLK_CPQ_CISS_DA +++ /dev/null @@ -1 +0,0 @@ -CONFIG_BLK_CPQ_CISS_DA=m diff --git a/baseconfig/CONFIG_BNXT_FLOWER_OFFLOAD b/baseconfig/CONFIG_BNXT_FLOWER_OFFLOAD new file mode 100644 index 0000000..170bbf3 --- /dev/null +++ b/baseconfig/CONFIG_BNXT_FLOWER_OFFLOAD @@ -0,0 +1 @@ +CONFIG_BNXT_FLOWER_OFFLOAD=y diff --git a/baseconfig/CONFIG_BPF_STREAM_PARSER b/baseconfig/CONFIG_BPF_STREAM_PARSER new file mode 100644 index 0000000..7cf7835 --- /dev/null +++ b/baseconfig/CONFIG_BPF_STREAM_PARSER @@ -0,0 +1 @@ +CONFIG_BPF_STREAM_PARSER=y diff --git a/baseconfig/CONFIG_CCS811 b/baseconfig/CONFIG_CCS811 new file mode 100644 index 0000000..931f14e --- /dev/null +++ b/baseconfig/CONFIG_CCS811 @@ -0,0 +1 @@ +# CONFIG_CCS811 is not set diff --git a/baseconfig/CONFIG_CEC_PIN b/baseconfig/CONFIG_CEC_PIN new file mode 100644 index 0000000..395ddfb --- /dev/null +++ b/baseconfig/CONFIG_CEC_PIN @@ -0,0 +1 @@ +CONFIG_CEC_PIN=y diff --git a/baseconfig/CONFIG_CISS_SCSI_TAPE b/baseconfig/CONFIG_CISS_SCSI_TAPE deleted file mode 100644 index 2170cc8..0000000 --- a/baseconfig/CONFIG_CISS_SCSI_TAPE +++ /dev/null @@ -1 +0,0 @@ -CONFIG_CISS_SCSI_TAPE=y diff --git a/baseconfig/CONFIG_CLK_HSDK b/baseconfig/CONFIG_CLK_HSDK new file mode 100644 index 0000000..e1788bb --- /dev/null +++ b/baseconfig/CONFIG_CLK_HSDK @@ -0,0 +1 @@ +# CONFIG_CLK_HSDK is not set diff --git a/baseconfig/CONFIG_CLOCK_THERMAL b/baseconfig/CONFIG_CLOCK_THERMAL new file mode 100644 index 0000000..72ca05f --- /dev/null +++ b/baseconfig/CONFIG_CLOCK_THERMAL @@ -0,0 +1 @@ +# CONFIG_CLOCK_THERMAL is not set diff --git a/baseconfig/CONFIG_CRYPTO_DEV_SP_CCP b/baseconfig/CONFIG_CRYPTO_DEV_SP_CCP new file mode 100644 index 0000000..c494dcc --- /dev/null +++ b/baseconfig/CONFIG_CRYPTO_DEV_SP_CCP @@ -0,0 +1 @@ +# CONFIG_CRYPTO_DEV_SP_CCP is not set diff --git a/baseconfig/CONFIG_DEVFREQ_THERMAL b/baseconfig/CONFIG_DEVFREQ_THERMAL new file mode 100644 index 0000000..5b90f90 --- /dev/null +++ b/baseconfig/CONFIG_DEVFREQ_THERMAL @@ -0,0 +1 @@ +# CONFIG_DEVFREQ_THERMAL is not set diff --git a/baseconfig/CONFIG_DP83867_PHY b/baseconfig/CONFIG_DP83867_PHY index 5ba3d57..2bb3289 100644 --- a/baseconfig/CONFIG_DP83867_PHY +++ b/baseconfig/CONFIG_DP83867_PHY @@ -1 +1 @@ -CONFIG_DP83867_PHY=m +# CONFIG_DP83867_PHY is not set diff --git a/baseconfig/CONFIG_DVB_DDBRIDGE_MSIENABLE b/baseconfig/CONFIG_DVB_DDBRIDGE_MSIENABLE new file mode 100644 index 0000000..4f0814b --- /dev/null +++ b/baseconfig/CONFIG_DVB_DDBRIDGE_MSIENABLE @@ -0,0 +1 @@ +# CONFIG_DVB_DDBRIDGE_MSIENABLE is not set diff --git a/baseconfig/CONFIG_GPIO_BD9571MWV b/baseconfig/CONFIG_GPIO_BD9571MWV new file mode 100644 index 0000000..0cdd67b --- /dev/null +++ b/baseconfig/CONFIG_GPIO_BD9571MWV @@ -0,0 +1 @@ +CONFIG_GPIO_BD9571MWV=m diff --git a/baseconfig/CONFIG_GPIO_TPS68470 b/baseconfig/CONFIG_GPIO_TPS68470 new file mode 100644 index 0000000..3176e95 --- /dev/null +++ b/baseconfig/CONFIG_GPIO_TPS68470 @@ -0,0 +1 @@ +CONFIG_GPIO_TPS68470=y diff --git a/baseconfig/CONFIG_INFINIBAND_EXP_USER_ACCESS b/baseconfig/CONFIG_INFINIBAND_EXP_USER_ACCESS new file mode 100644 index 0000000..478415c --- /dev/null +++ b/baseconfig/CONFIG_INFINIBAND_EXP_USER_ACCESS @@ -0,0 +1 @@ +# CONFIG_INFINIBAND_EXP_USER_ACCESS is not set diff --git a/baseconfig/CONFIG_INPUT_PWM_VIBRA b/baseconfig/CONFIG_INPUT_PWM_VIBRA new file mode 100644 index 0000000..39a51b4 --- /dev/null +++ b/baseconfig/CONFIG_INPUT_PWM_VIBRA @@ -0,0 +1 @@ +# CONFIG_INPUT_PWM_VIBRA is not set diff --git a/baseconfig/CONFIG_INPUT_RK805_PWRKEY b/baseconfig/CONFIG_INPUT_RK805_PWRKEY new file mode 100644 index 0000000..4ce96f5 --- /dev/null +++ b/baseconfig/CONFIG_INPUT_RK805_PWRKEY @@ -0,0 +1 @@ +CONFIG_INPUT_RK805_PWRKEY=m diff --git a/baseconfig/CONFIG_IP_DCCP b/baseconfig/CONFIG_IP_DCCP index 26ba413..6ecb43a 100644 --- a/baseconfig/CONFIG_IP_DCCP +++ b/baseconfig/CONFIG_IP_DCCP @@ -1 +1 @@ -CONFIG_IP_DCCP=m +# CONFIG_IP_DCCP is not set diff --git a/baseconfig/CONFIG_IR_GPIO_TX b/baseconfig/CONFIG_IR_GPIO_TX new file mode 100644 index 0000000..4b6b484 --- /dev/null +++ b/baseconfig/CONFIG_IR_GPIO_TX @@ -0,0 +1 @@ +CONFIG_IR_GPIO_TX=m diff --git a/baseconfig/CONFIG_IR_PWM_TX b/baseconfig/CONFIG_IR_PWM_TX new file mode 100644 index 0000000..4dfd418 --- /dev/null +++ b/baseconfig/CONFIG_IR_PWM_TX @@ -0,0 +1 @@ +CONFIG_IR_PWM_TX=m diff --git a/baseconfig/CONFIG_LEDS_AS3645A b/baseconfig/CONFIG_LEDS_AS3645A new file mode 100644 index 0000000..25d6f9f --- /dev/null +++ b/baseconfig/CONFIG_LEDS_AS3645A @@ -0,0 +1 @@ +CONFIG_LEDS_AS3645A=m diff --git a/baseconfig/CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT b/baseconfig/CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT new file mode 100644 index 0000000..3365285 --- /dev/null +++ b/baseconfig/CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT @@ -0,0 +1 @@ +# CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT is not set diff --git a/baseconfig/CONFIG_LTC2471 b/baseconfig/CONFIG_LTC2471 new file mode 100644 index 0000000..5d272ac --- /dev/null +++ b/baseconfig/CONFIG_LTC2471 @@ -0,0 +1 @@ +# CONFIG_LTC2471 is not set diff --git a/baseconfig/CONFIG_MDIO_I2C b/baseconfig/CONFIG_MDIO_I2C new file mode 100644 index 0000000..df7d9e0 --- /dev/null +++ b/baseconfig/CONFIG_MDIO_I2C @@ -0,0 +1 @@ +CONFIG_MDIO_I2C=m diff --git a/baseconfig/CONFIG_MFD_BD9571MWV b/baseconfig/CONFIG_MFD_BD9571MWV new file mode 100644 index 0000000..28d27a0 --- /dev/null +++ b/baseconfig/CONFIG_MFD_BD9571MWV @@ -0,0 +1 @@ +CONFIG_MFD_BD9571MWV=m diff --git a/baseconfig/CONFIG_MFD_TPS68470 b/baseconfig/CONFIG_MFD_TPS68470 new file mode 100644 index 0000000..10fd404 --- /dev/null +++ b/baseconfig/CONFIG_MFD_TPS68470 @@ -0,0 +1 @@ +CONFIG_MFD_TPS68470=y diff --git a/baseconfig/CONFIG_MLX5_ESWITCH b/baseconfig/CONFIG_MLX5_ESWITCH new file mode 100644 index 0000000..8a69e06 --- /dev/null +++ b/baseconfig/CONFIG_MLX5_ESWITCH @@ -0,0 +1 @@ +CONFIG_MLX5_ESWITCH=y diff --git a/baseconfig/CONFIG_MLX5_MPFS b/baseconfig/CONFIG_MLX5_MPFS new file mode 100644 index 0000000..6799ed4 --- /dev/null +++ b/baseconfig/CONFIG_MLX5_MPFS @@ -0,0 +1 @@ +CONFIG_MLX5_MPFS=y diff --git a/baseconfig/CONFIG_MMC_BLOCK_BOUNCE b/baseconfig/CONFIG_MMC_BLOCK_BOUNCE deleted file mode 100644 index 4470e83..0000000 --- a/baseconfig/CONFIG_MMC_BLOCK_BOUNCE +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MMC_BLOCK_BOUNCE=y diff --git a/baseconfig/CONFIG_NET_NSH b/baseconfig/CONFIG_NET_NSH new file mode 100644 index 0000000..2a9a24e --- /dev/null +++ b/baseconfig/CONFIG_NET_NSH @@ -0,0 +1 @@ +CONFIG_NET_NSH=m diff --git a/baseconfig/CONFIG_NET_VENDOR_HUAWEI b/baseconfig/CONFIG_NET_VENDOR_HUAWEI new file mode 100644 index 0000000..ae01b91 --- /dev/null +++ b/baseconfig/CONFIG_NET_VENDOR_HUAWEI @@ -0,0 +1 @@ +# CONFIG_NET_VENDOR_HUAWEI is not set diff --git a/baseconfig/CONFIG_NFT_FIB_NETDEV b/baseconfig/CONFIG_NFT_FIB_NETDEV new file mode 100644 index 0000000..273bfeb --- /dev/null +++ b/baseconfig/CONFIG_NFT_FIB_NETDEV @@ -0,0 +1 @@ +CONFIG_NFT_FIB_NETDEV=m diff --git a/baseconfig/CONFIG_PHYLINK b/baseconfig/CONFIG_PHYLINK new file mode 100644 index 0000000..cc1e23e --- /dev/null +++ b/baseconfig/CONFIG_PHYLINK @@ -0,0 +1 @@ +CONFIG_PHYLINK=m diff --git a/baseconfig/CONFIG_PHY_MVEBU_CP110_COMPHY b/baseconfig/CONFIG_PHY_MVEBU_CP110_COMPHY new file mode 100644 index 0000000..8c10468 --- /dev/null +++ b/baseconfig/CONFIG_PHY_MVEBU_CP110_COMPHY @@ -0,0 +1 @@ +# CONFIG_PHY_MVEBU_CP110_COMPHY is not set diff --git a/baseconfig/CONFIG_PI433 b/baseconfig/CONFIG_PI433 new file mode 100644 index 0000000..b275e1e --- /dev/null +++ b/baseconfig/CONFIG_PI433 @@ -0,0 +1 @@ +# CONFIG_PI433 is not set diff --git a/baseconfig/CONFIG_PINCTRL_RK805 b/baseconfig/CONFIG_PINCTRL_RK805 new file mode 100644 index 0000000..47b4fd8 --- /dev/null +++ b/baseconfig/CONFIG_PINCTRL_RK805 @@ -0,0 +1 @@ +CONFIG_PINCTRL_RK805=m diff --git a/baseconfig/CONFIG_PINCTRL_SPRD b/baseconfig/CONFIG_PINCTRL_SPRD new file mode 100644 index 0000000..cffa735 --- /dev/null +++ b/baseconfig/CONFIG_PINCTRL_SPRD @@ -0,0 +1 @@ +# CONFIG_PINCTRL_SPRD is not set diff --git a/baseconfig/CONFIG_PINCTRL_SPRD_SC9860 b/baseconfig/CONFIG_PINCTRL_SPRD_SC9860 new file mode 100644 index 0000000..f9b405f --- /dev/null +++ b/baseconfig/CONFIG_PINCTRL_SPRD_SC9860 @@ -0,0 +1 @@ +# CONFIG_PINCTRL_SPRD_SC9860 is not set diff --git a/baseconfig/CONFIG_PM_OPP b/baseconfig/CONFIG_PM_OPP index a77bd27..bbe2b56 100644 --- a/baseconfig/CONFIG_PM_OPP +++ b/baseconfig/CONFIG_PM_OPP @@ -1 +1 @@ -# CONFIG_PM_OPP is not set +CONFIG_PM_OPP=y diff --git a/baseconfig/CONFIG_QCOM_GLINK_SSR b/baseconfig/CONFIG_QCOM_GLINK_SSR new file mode 100644 index 0000000..1c67b32 --- /dev/null +++ b/baseconfig/CONFIG_QCOM_GLINK_SSR @@ -0,0 +1 @@ +# CONFIG_QCOM_GLINK_SSR is not set diff --git a/baseconfig/CONFIG_R8822BE b/baseconfig/CONFIG_R8822BE new file mode 100644 index 0000000..2f7c087 --- /dev/null +++ b/baseconfig/CONFIG_R8822BE @@ -0,0 +1 @@ +CONFIG_R8822BE=m diff --git a/baseconfig/CONFIG_REGULATOR_BD9571MWV b/baseconfig/CONFIG_REGULATOR_BD9571MWV new file mode 100644 index 0000000..3b0acb7 --- /dev/null +++ b/baseconfig/CONFIG_REGULATOR_BD9571MWV @@ -0,0 +1 @@ +CONFIG_REGULATOR_BD9571MWV=m diff --git a/baseconfig/CONFIG_RESET_ATTACK_MITIGATION b/baseconfig/CONFIG_RESET_ATTACK_MITIGATION new file mode 100644 index 0000000..8202a78 --- /dev/null +++ b/baseconfig/CONFIG_RESET_ATTACK_MITIGATION @@ -0,0 +1 @@ +CONFIG_RESET_ATTACK_MITIGATION=y diff --git a/baseconfig/CONFIG_RESET_HSDK_V1 b/baseconfig/CONFIG_RESET_HSDK_V1 new file mode 100644 index 0000000..4c2b97d --- /dev/null +++ b/baseconfig/CONFIG_RESET_HSDK_V1 @@ -0,0 +1 @@ +# CONFIG_RESET_HSDK_V1 is not set diff --git a/baseconfig/CONFIG_RMNET b/baseconfig/CONFIG_RMNET new file mode 100644 index 0000000..5e8c115 --- /dev/null +++ b/baseconfig/CONFIG_RMNET @@ -0,0 +1 @@ +# CONFIG_RMNET is not set diff --git a/baseconfig/CONFIG_ROCKCHIP_PHY b/baseconfig/CONFIG_ROCKCHIP_PHY new file mode 100644 index 0000000..4ca6087 --- /dev/null +++ b/baseconfig/CONFIG_ROCKCHIP_PHY @@ -0,0 +1 @@ +# CONFIG_ROCKCHIP_PHY is not set diff --git a/baseconfig/CONFIG_RPMSG_QCOM_GLINK_SMEM b/baseconfig/CONFIG_RPMSG_QCOM_GLINK_SMEM new file mode 100644 index 0000000..c2c0a0c --- /dev/null +++ b/baseconfig/CONFIG_RPMSG_QCOM_GLINK_SMEM @@ -0,0 +1 @@ +# CONFIG_RPMSG_QCOM_GLINK_SMEM is not set diff --git a/baseconfig/CONFIG_SENSORS_IBM_CFFPS b/baseconfig/CONFIG_SENSORS_IBM_CFFPS new file mode 100644 index 0000000..a217d97 --- /dev/null +++ b/baseconfig/CONFIG_SENSORS_IBM_CFFPS @@ -0,0 +1 @@ +# CONFIG_SENSORS_IBM_CFFPS is not set diff --git a/baseconfig/CONFIG_SENSORS_TPS53679 b/baseconfig/CONFIG_SENSORS_TPS53679 new file mode 100644 index 0000000..461a703 --- /dev/null +++ b/baseconfig/CONFIG_SENSORS_TPS53679 @@ -0,0 +1 @@ +CONFIG_SENSORS_TPS53679=m diff --git a/baseconfig/CONFIG_SERIO_GPIO_PS2 b/baseconfig/CONFIG_SERIO_GPIO_PS2 new file mode 100644 index 0000000..22c1adb --- /dev/null +++ b/baseconfig/CONFIG_SERIO_GPIO_PS2 @@ -0,0 +1 @@ +# CONFIG_SERIO_GPIO_PS2 is not set diff --git a/baseconfig/CONFIG_SFP b/baseconfig/CONFIG_SFP new file mode 100644 index 0000000..db57db1 --- /dev/null +++ b/baseconfig/CONFIG_SFP @@ -0,0 +1 @@ +CONFIG_SFP=m diff --git a/baseconfig/CONFIG_SLAB_FREELIST_HARDENED b/baseconfig/CONFIG_SLAB_FREELIST_HARDENED new file mode 100644 index 0000000..52602d2 --- /dev/null +++ b/baseconfig/CONFIG_SLAB_FREELIST_HARDENED @@ -0,0 +1 @@ +CONFIG_SLAB_FREELIST_HARDENED=y diff --git a/baseconfig/CONFIG_SND_BCD2000 b/baseconfig/CONFIG_SND_BCD2000 index b56c916..0a60c49 100644 --- a/baseconfig/CONFIG_SND_BCD2000 +++ b/baseconfig/CONFIG_SND_BCD2000 @@ -1 +1 @@ -CONFIG_SND_BCD2000=m +# CONFIG_SND_BCD2000 is not set diff --git a/baseconfig/CONFIG_SND_HDA_POWER_SAVE_DEFAULT b/baseconfig/CONFIG_SND_HDA_POWER_SAVE_DEFAULT index ce02ec9..ba01897 100644 --- a/baseconfig/CONFIG_SND_HDA_POWER_SAVE_DEFAULT +++ b/baseconfig/CONFIG_SND_HDA_POWER_SAVE_DEFAULT @@ -1 +1 @@ -CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=1 diff --git a/baseconfig/CONFIG_SND_SOC_CS43130 b/baseconfig/CONFIG_SND_SOC_CS43130 new file mode 100644 index 0000000..3fad16f --- /dev/null +++ b/baseconfig/CONFIG_SND_SOC_CS43130 @@ -0,0 +1 @@ +CONFIG_SND_SOC_CS43130=m diff --git a/baseconfig/CONFIG_SND_SOC_WM8524 b/baseconfig/CONFIG_SND_SOC_WM8524 new file mode 100644 index 0000000..1eb33d7 --- /dev/null +++ b/baseconfig/CONFIG_SND_SOC_WM8524 @@ -0,0 +1 @@ +CONFIG_SND_SOC_WM8524=m diff --git a/baseconfig/CONFIG_SQUASHFS_ZSTD b/baseconfig/CONFIG_SQUASHFS_ZSTD new file mode 100644 index 0000000..023fb21 --- /dev/null +++ b/baseconfig/CONFIG_SQUASHFS_ZSTD @@ -0,0 +1 @@ +CONFIG_SQUASHFS_ZSTD=y diff --git a/baseconfig/CONFIG_STRING_SELFTEST b/baseconfig/CONFIG_STRING_SELFTEST new file mode 100644 index 0000000..dbff6d7 --- /dev/null +++ b/baseconfig/CONFIG_STRING_SELFTEST @@ -0,0 +1 @@ +# CONFIG_STRING_SELFTEST is not set diff --git a/baseconfig/CONFIG_W1_SLAVE_DS2805 b/baseconfig/CONFIG_W1_SLAVE_DS2805 new file mode 100644 index 0000000..eddd3bb --- /dev/null +++ b/baseconfig/CONFIG_W1_SLAVE_DS2805 @@ -0,0 +1 @@ +CONFIG_W1_SLAVE_DS2805=m diff --git a/baseconfig/CONFIG_WIL6210_DEBUGFS b/baseconfig/CONFIG_WIL6210_DEBUGFS new file mode 100644 index 0000000..f0f5fe7 --- /dev/null +++ b/baseconfig/CONFIG_WIL6210_DEBUGFS @@ -0,0 +1 @@ +CONFIG_WIL6210_DEBUGFS=y diff --git a/baseconfig/CONFIG_ZRAM_WRITEBACK b/baseconfig/CONFIG_ZRAM_WRITEBACK new file mode 100644 index 0000000..9a566b7 --- /dev/null +++ b/baseconfig/CONFIG_ZRAM_WRITEBACK @@ -0,0 +1 @@ +# CONFIG_ZRAM_WRITEBACK is not set diff --git a/baseconfig/arm/CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG b/baseconfig/arm/CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG new file mode 100644 index 0000000..62fd0b8 --- /dev/null +++ b/baseconfig/arm/CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG @@ -0,0 +1 @@ +CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y diff --git a/baseconfig/arm/CONFIG_CRYPTO_SHA256_ARM64 b/baseconfig/arm/CONFIG_CRYPTO_SHA256_ARM64 index ba32f85..3aa7dac 100644 --- a/baseconfig/arm/CONFIG_CRYPTO_SHA256_ARM64 +++ b/baseconfig/arm/CONFIG_CRYPTO_SHA256_ARM64 @@ -1 +1 @@ -CONFIG_CRYPTO_SHA256_ARM64=m +CONFIG_CRYPTO_SHA256_ARM64=y diff --git a/baseconfig/arm/CONFIG_DRM_DW_HDMI_CEC b/baseconfig/arm/CONFIG_DRM_DW_HDMI_CEC new file mode 100644 index 0000000..a3e178e --- /dev/null +++ b/baseconfig/arm/CONFIG_DRM_DW_HDMI_CEC @@ -0,0 +1 @@ +CONFIG_DRM_DW_HDMI_CEC=m diff --git a/baseconfig/arm/CONFIG_DRM_SUN4I_BACKEND b/baseconfig/arm/CONFIG_DRM_SUN4I_BACKEND deleted file mode 100644 index c1d1d21..0000000 --- a/baseconfig/arm/CONFIG_DRM_SUN4I_BACKEND +++ /dev/null @@ -1 +0,0 @@ -CONFIG_DRM_SUN4I_BACKEND=m diff --git a/baseconfig/arm/CONFIG_DRM_VC4_HDMI_CEC b/baseconfig/arm/CONFIG_DRM_VC4_HDMI_CEC new file mode 100644 index 0000000..da0132c --- /dev/null +++ b/baseconfig/arm/CONFIG_DRM_VC4_HDMI_CEC @@ -0,0 +1 @@ +CONFIG_DRM_VC4_HDMI_CEC=y diff --git a/baseconfig/arm/CONFIG_EXTCON_USBC_CROS_EC b/baseconfig/arm/CONFIG_EXTCON_USBC_CROS_EC new file mode 100644 index 0000000..831bc6e --- /dev/null +++ b/baseconfig/arm/CONFIG_EXTCON_USBC_CROS_EC @@ -0,0 +1 @@ +CONFIG_EXTCON_USBC_CROS_EC=m diff --git a/baseconfig/arm/CONFIG_HW_RANDOM_IMX_RNGC b/baseconfig/arm/CONFIG_HW_RANDOM_IMX_RNGC new file mode 100644 index 0000000..e7b39a2 --- /dev/null +++ b/baseconfig/arm/CONFIG_HW_RANDOM_IMX_RNGC @@ -0,0 +1 @@ +CONFIG_HW_RANDOM_IMX_RNGC=m diff --git a/baseconfig/arm/CONFIG_I2C_DESIGNWARE_CORE b/baseconfig/arm/CONFIG_I2C_DESIGNWARE_CORE index 661ffb0..f9cdc63 100644 --- a/baseconfig/arm/CONFIG_I2C_DESIGNWARE_CORE +++ b/baseconfig/arm/CONFIG_I2C_DESIGNWARE_CORE @@ -1 +1 @@ -CONFIG_I2C_DESIGNWARE_CORE=m +CONFIG_I2C_DESIGNWARE_CORE=y diff --git a/baseconfig/arm/CONFIG_I2C_DESIGNWARE_PLATFORM b/baseconfig/arm/CONFIG_I2C_DESIGNWARE_PLATFORM index cec2f86..3d50a3e 100644 --- a/baseconfig/arm/CONFIG_I2C_DESIGNWARE_PLATFORM +++ b/baseconfig/arm/CONFIG_I2C_DESIGNWARE_PLATFORM @@ -1 +1 @@ -CONFIG_I2C_DESIGNWARE_PLATFORM=m +CONFIG_I2C_DESIGNWARE_PLATFORM=y diff --git a/baseconfig/arm/CONFIG_MESON_GX_SOCINFO b/baseconfig/arm/CONFIG_MESON_GX_SOCINFO new file mode 100644 index 0000000..ce5ba6f --- /dev/null +++ b/baseconfig/arm/CONFIG_MESON_GX_SOCINFO @@ -0,0 +1 @@ +CONFIG_MESON_GX_SOCINFO=y diff --git a/baseconfig/arm/CONFIG_MTD_NAND_PXA3xx b/baseconfig/arm/CONFIG_MTD_NAND_PXA3xx new file mode 100644 index 0000000..584b57e --- /dev/null +++ b/baseconfig/arm/CONFIG_MTD_NAND_PXA3xx @@ -0,0 +1 @@ +CONFIG_MTD_NAND_PXA3xx=m diff --git a/baseconfig/arm/CONFIG_ROCKCHIP_PHY b/baseconfig/arm/CONFIG_ROCKCHIP_PHY new file mode 100644 index 0000000..e49faf8 --- /dev/null +++ b/baseconfig/arm/CONFIG_ROCKCHIP_PHY @@ -0,0 +1 @@ +CONFIG_ROCKCHIP_PHY=m diff --git a/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_AC97 b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_AC97 new file mode 100644 index 0000000..fa8e0e0 --- /dev/null +++ b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_AC97 @@ -0,0 +1 @@ +CONFIG_SND_SOC_TEGRA20_AC97=m diff --git a/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_DAS b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_DAS new file mode 100644 index 0000000..82205dc --- /dev/null +++ b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_DAS @@ -0,0 +1 @@ +CONFIG_SND_SOC_TEGRA20_DAS=m diff --git a/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_I2S b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_I2S new file mode 100644 index 0000000..abfe228 --- /dev/null +++ b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_I2S @@ -0,0 +1 @@ +CONFIG_SND_SOC_TEGRA20_I2S=m diff --git a/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_SPDIF b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_SPDIF new file mode 100644 index 0000000..0f05cff --- /dev/null +++ b/baseconfig/arm/CONFIG_SND_SOC_TEGRA20_SPDIF @@ -0,0 +1 @@ +CONFIG_SND_SOC_TEGRA20_SPDIF=m diff --git a/baseconfig/arm/CONFIG_SND_SOC_TEGRA30_AHUB b/baseconfig/arm/CONFIG_SND_SOC_TEGRA30_AHUB new file mode 100644 index 0000000..d5632de --- /dev/null +++ b/baseconfig/arm/CONFIG_SND_SOC_TEGRA30_AHUB @@ -0,0 +1 @@ +CONFIG_SND_SOC_TEGRA30_AHUB=m diff --git a/baseconfig/arm/CONFIG_SND_SOC_TEGRA30_I2S b/baseconfig/arm/CONFIG_SND_SOC_TEGRA30_I2S new file mode 100644 index 0000000..c7fabc7 --- /dev/null +++ b/baseconfig/arm/CONFIG_SND_SOC_TEGRA30_I2S @@ -0,0 +1 @@ +CONFIG_SND_SOC_TEGRA30_I2S=m diff --git a/baseconfig/arm/CONFIG_TINYDRM_REPAPER b/baseconfig/arm/CONFIG_TINYDRM_REPAPER new file mode 100644 index 0000000..c4d2874 --- /dev/null +++ b/baseconfig/arm/CONFIG_TINYDRM_REPAPER @@ -0,0 +1 @@ +# CONFIG_TINYDRM_REPAPER is not set diff --git a/baseconfig/arm/CONFIG_TINYDRM_ST7586 b/baseconfig/arm/CONFIG_TINYDRM_ST7586 new file mode 100644 index 0000000..2b9e29f --- /dev/null +++ b/baseconfig/arm/CONFIG_TINYDRM_ST7586 @@ -0,0 +1 @@ +# CONFIG_TINYDRM_ST7586 is not set diff --git a/baseconfig/arm/CONFIG_VIDEO_MESON_AO_CEC b/baseconfig/arm/CONFIG_VIDEO_MESON_AO_CEC new file mode 100644 index 0000000..499a440 --- /dev/null +++ b/baseconfig/arm/CONFIG_VIDEO_MESON_AO_CEC @@ -0,0 +1 @@ +CONFIG_VIDEO_MESON_AO_CEC=m diff --git a/baseconfig/arm/arm64/CONFIG_ARM64_PMEM b/baseconfig/arm/arm64/CONFIG_ARM64_PMEM new file mode 100644 index 0000000..9325600 --- /dev/null +++ b/baseconfig/arm/arm64/CONFIG_ARM64_PMEM @@ -0,0 +1 @@ +# CONFIG_ARM64_PMEM is not set diff --git a/baseconfig/arm/arm64/CONFIG_CRYPTO_AES_ARM64 b/baseconfig/arm/arm64/CONFIG_CRYPTO_AES_ARM64 index 113c72b..dd0ae2c 100644 --- a/baseconfig/arm/arm64/CONFIG_CRYPTO_AES_ARM64 +++ b/baseconfig/arm/arm64/CONFIG_CRYPTO_AES_ARM64 @@ -1 +1 @@ -CONFIG_CRYPTO_AES_ARM64=m +CONFIG_CRYPTO_AES_ARM64=y diff --git a/baseconfig/arm/arm64/CONFIG_GPIO_THUNDERX b/baseconfig/arm/arm64/CONFIG_GPIO_THUNDERX new file mode 100644 index 0000000..6895cc0 --- /dev/null +++ b/baseconfig/arm/arm64/CONFIG_GPIO_THUNDERX @@ -0,0 +1 @@ +CONFIG_GPIO_THUNDERX=m diff --git a/baseconfig/arm/arm64/CONFIG_MMC_QCOM_DML b/baseconfig/arm/arm64/CONFIG_MMC_QCOM_DML index 059d0d4..48facf3 100644 --- a/baseconfig/arm/arm64/CONFIG_MMC_QCOM_DML +++ b/baseconfig/arm/arm64/CONFIG_MMC_QCOM_DML @@ -1 +1 @@ -CONFIG_MMC_QCOM_DML=m +CONFIG_MMC_QCOM_DML=y diff --git a/baseconfig/arm/arm64/CONFIG_PHY_MVEBU_CP110_COMPHY b/baseconfig/arm/arm64/CONFIG_PHY_MVEBU_CP110_COMPHY new file mode 100644 index 0000000..1902b0c --- /dev/null +++ b/baseconfig/arm/arm64/CONFIG_PHY_MVEBU_CP110_COMPHY @@ -0,0 +1 @@ +CONFIG_PHY_MVEBU_CP110_COMPHY=m diff --git a/baseconfig/arm/arm64/CONFIG_USB_CONFIGFS_F_LB_SS b/baseconfig/arm/arm64/CONFIG_USB_CONFIGFS_F_LB_SS new file mode 100644 index 0000000..213edb5 --- /dev/null +++ b/baseconfig/arm/arm64/CONFIG_USB_CONFIGFS_F_LB_SS @@ -0,0 +1 @@ +# CONFIG_USB_CONFIGFS_F_LB_SS is not set diff --git a/baseconfig/arm/arm64/CONFIG_VIDEO_QCOM_CAMSS b/baseconfig/arm/arm64/CONFIG_VIDEO_QCOM_CAMSS new file mode 100644 index 0000000..5e2512c --- /dev/null +++ b/baseconfig/arm/arm64/CONFIG_VIDEO_QCOM_CAMSS @@ -0,0 +1 @@ +CONFIG_VIDEO_QCOM_CAMSS=m diff --git a/baseconfig/arm/arm64/CONFIG_VMAP_STACK b/baseconfig/arm/arm64/CONFIG_VMAP_STACK new file mode 100644 index 0000000..8bd9868 --- /dev/null +++ b/baseconfig/arm/arm64/CONFIG_VMAP_STACK @@ -0,0 +1 @@ +CONFIG_VMAP_STACK=y diff --git a/baseconfig/arm/armv7/CONFIG_DRM_SUN4I_BACKEND b/baseconfig/arm/armv7/CONFIG_DRM_SUN4I_BACKEND new file mode 100644 index 0000000..c1d1d21 --- /dev/null +++ b/baseconfig/arm/armv7/CONFIG_DRM_SUN4I_BACKEND @@ -0,0 +1 @@ +CONFIG_DRM_SUN4I_BACKEND=m diff --git a/baseconfig/arm/armv7/CONFIG_DRM_SUN4I_HDMI_CEC b/baseconfig/arm/armv7/CONFIG_DRM_SUN4I_HDMI_CEC new file mode 100644 index 0000000..8ba7340 --- /dev/null +++ b/baseconfig/arm/armv7/CONFIG_DRM_SUN4I_HDMI_CEC @@ -0,0 +1 @@ +# CONFIG_DRM_SUN4I_HDMI_CEC is not set diff --git a/baseconfig/arm/armv7/CONFIG_MMC_QCOM_DML b/baseconfig/arm/armv7/CONFIG_MMC_QCOM_DML deleted file mode 100644 index 059d0d4..0000000 --- a/baseconfig/arm/armv7/CONFIG_MMC_QCOM_DML +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MMC_QCOM_DML=m diff --git a/baseconfig/arm/armv7/CONFIG_MTD_NAND_PXA3xx b/baseconfig/arm/armv7/CONFIG_MTD_NAND_PXA3xx deleted file mode 100644 index 584b57e..0000000 --- a/baseconfig/arm/armv7/CONFIG_MTD_NAND_PXA3xx +++ /dev/null @@ -1 +0,0 @@ -CONFIG_MTD_NAND_PXA3xx=m diff --git a/baseconfig/arm/armv7/CONFIG_PWM_TIECAP b/baseconfig/arm/armv7/CONFIG_PWM_TIECAP new file mode 100644 index 0000000..84f1e9b --- /dev/null +++ b/baseconfig/arm/armv7/CONFIG_PWM_TIECAP @@ -0,0 +1 @@ +CONFIG_PWM_TIECAP=m diff --git a/baseconfig/arm/armv7/CONFIG_RTC_DRV_ARMADA38X b/baseconfig/arm/armv7/CONFIG_RTC_DRV_ARMADA38X deleted file mode 100644 index 7dcdafc..0000000 --- a/baseconfig/arm/armv7/CONFIG_RTC_DRV_ARMADA38X +++ /dev/null @@ -1 +0,0 @@ -CONFIG_RTC_DRV_ARMADA38X=m diff --git a/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA20_I2S b/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA20_I2S deleted file mode 100644 index abfe228..0000000 --- a/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA20_I2S +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_TEGRA20_I2S=m diff --git a/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA30_AHUB b/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA30_AHUB deleted file mode 100644 index d5632de..0000000 --- a/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA30_AHUB +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_TEGRA30_AHUB=m diff --git a/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA30_I2S b/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA30_I2S deleted file mode 100644 index c7fabc7..0000000 --- a/baseconfig/arm/armv7/CONFIG_SND_SOC_TEGRA30_I2S +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_TEGRA30_I2S=m diff --git a/baseconfig/arm/armv7/CONFIG_SUN4I_A10_CCU b/baseconfig/arm/armv7/CONFIG_SUN4I_A10_CCU new file mode 100644 index 0000000..3b2ba68 --- /dev/null +++ b/baseconfig/arm/armv7/CONFIG_SUN4I_A10_CCU @@ -0,0 +1 @@ +CONFIG_SUN4I_A10_CCU=y diff --git a/baseconfig/arm/armv7/CONFIG_SUN8I_R40_CCU b/baseconfig/arm/armv7/CONFIG_SUN8I_R40_CCU new file mode 100644 index 0000000..1499009 --- /dev/null +++ b/baseconfig/arm/armv7/CONFIG_SUN8I_R40_CCU @@ -0,0 +1 @@ +CONFIG_SUN8I_R40_CCU=y diff --git a/baseconfig/arm/armv7/armv7/CONFIG_BATTERY_BQ27XXX_HDQ b/baseconfig/arm/armv7/armv7/CONFIG_BATTERY_BQ27XXX_HDQ new file mode 100644 index 0000000..2be0785 --- /dev/null +++ b/baseconfig/arm/armv7/armv7/CONFIG_BATTERY_BQ27XXX_HDQ @@ -0,0 +1 @@ +CONFIG_BATTERY_BQ27XXX_HDQ=m diff --git a/baseconfig/arm/armv7/armv7/CONFIG_IMX_REMOTEPROC b/baseconfig/arm/armv7/armv7/CONFIG_IMX_REMOTEPROC new file mode 100644 index 0000000..53983d8 --- /dev/null +++ b/baseconfig/arm/armv7/armv7/CONFIG_IMX_REMOTEPROC @@ -0,0 +1 @@ +CONFIG_IMX_REMOTEPROC=m diff --git a/baseconfig/arm/armv7/armv7/CONFIG_MMC_QCOM_DML b/baseconfig/arm/armv7/armv7/CONFIG_MMC_QCOM_DML index 059d0d4..48facf3 100644 --- a/baseconfig/arm/armv7/armv7/CONFIG_MMC_QCOM_DML +++ b/baseconfig/arm/armv7/armv7/CONFIG_MMC_QCOM_DML @@ -1 +1 @@ -CONFIG_MMC_QCOM_DML=m +CONFIG_MMC_QCOM_DML=y diff --git a/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_AC97 b/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_AC97 deleted file mode 100644 index fa8e0e0..0000000 --- a/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_AC97 +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_TEGRA20_AC97=m diff --git a/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_DAS b/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_DAS deleted file mode 100644 index 82205dc..0000000 --- a/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_DAS +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_TEGRA20_DAS=m diff --git a/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_SPDIF b/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_SPDIF deleted file mode 100644 index 0f05cff..0000000 --- a/baseconfig/arm/armv7/armv7/CONFIG_SND_SOC_TEGRA20_SPDIF +++ /dev/null @@ -1 +0,0 @@ -CONFIG_SND_SOC_TEGRA20_SPDIF=m diff --git a/baseconfig/arm/armv7/armv7/CONFIG_VIDEO_QCOM_CAMSS b/baseconfig/arm/armv7/armv7/CONFIG_VIDEO_QCOM_CAMSS new file mode 100644 index 0000000..5e2512c --- /dev/null +++ b/baseconfig/arm/armv7/armv7/CONFIG_VIDEO_QCOM_CAMSS @@ -0,0 +1 @@ +CONFIG_VIDEO_QCOM_CAMSS=m diff --git a/baseconfig/arm/armv7/lpae/CONFIG_SND_SOC_TEGRA20_DAS b/baseconfig/arm/armv7/lpae/CONFIG_SND_SOC_TEGRA20_DAS deleted file mode 100644 index 71a38a4..0000000 --- a/baseconfig/arm/armv7/lpae/CONFIG_SND_SOC_TEGRA20_DAS +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_SND_SOC_TEGRA20_DAS is not set diff --git a/baseconfig/powerpc/CONFIG_PPC_MEMTRACE b/baseconfig/powerpc/CONFIG_PPC_MEMTRACE new file mode 100644 index 0000000..c783714 --- /dev/null +++ b/baseconfig/powerpc/CONFIG_PPC_MEMTRACE @@ -0,0 +1 @@ +# CONFIG_PPC_MEMTRACE is not set diff --git a/baseconfig/powerpc/CONFIG_PPC_VAS b/baseconfig/powerpc/CONFIG_PPC_VAS new file mode 100644 index 0000000..ec767da --- /dev/null +++ b/baseconfig/powerpc/CONFIG_PPC_VAS @@ -0,0 +1 @@ +CONFIG_PPC_VAS=y diff --git a/baseconfig/powerpc/CONFIG_SENSORS_IBM_CFFPS b/baseconfig/powerpc/CONFIG_SENSORS_IBM_CFFPS new file mode 100644 index 0000000..31f2603 --- /dev/null +++ b/baseconfig/powerpc/CONFIG_SENSORS_IBM_CFFPS @@ -0,0 +1 @@ +CONFIG_SENSORS_IBM_CFFPS=m diff --git a/baseconfig/s390x/CONFIG_BLK_CPQ_CISS_DA b/baseconfig/s390x/CONFIG_BLK_CPQ_CISS_DA deleted file mode 100644 index 2e6c723..0000000 --- a/baseconfig/s390x/CONFIG_BLK_CPQ_CISS_DA +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_BLK_CPQ_CISS_DA is not set diff --git a/baseconfig/s390x/CONFIG_CMA b/baseconfig/s390x/CONFIG_CMA new file mode 100644 index 0000000..309c9e7 --- /dev/null +++ b/baseconfig/s390x/CONFIG_CMA @@ -0,0 +1 @@ +CONFIG_CMA=y diff --git a/baseconfig/s390x/CONFIG_CMA_AREAS b/baseconfig/s390x/CONFIG_CMA_AREAS new file mode 100644 index 0000000..5474a48 --- /dev/null +++ b/baseconfig/s390x/CONFIG_CMA_AREAS @@ -0,0 +1 @@ +CONFIG_CMA_AREAS=7 diff --git a/baseconfig/s390x/CONFIG_CMA_DEBUG b/baseconfig/s390x/CONFIG_CMA_DEBUG new file mode 100644 index 0000000..64ff80c --- /dev/null +++ b/baseconfig/s390x/CONFIG_CMA_DEBUG @@ -0,0 +1 @@ +# CONFIG_CMA_DEBUG is not set diff --git a/baseconfig/s390x/CONFIG_CMA_DEBUGFS b/baseconfig/s390x/CONFIG_CMA_DEBUGFS new file mode 100644 index 0000000..fba8990 --- /dev/null +++ b/baseconfig/s390x/CONFIG_CMA_DEBUGFS @@ -0,0 +1 @@ +# CONFIG_CMA_DEBUGFS is not set diff --git a/baseconfig/s390x/CONFIG_MFD_BD9571MWV b/baseconfig/s390x/CONFIG_MFD_BD9571MWV new file mode 100644 index 0000000..d321ad3 --- /dev/null +++ b/baseconfig/s390x/CONFIG_MFD_BD9571MWV @@ -0,0 +1 @@ +# CONFIG_MFD_BD9571MWV is not set diff --git a/baseconfig/s390x/CONFIG_MFD_RTSX_USB b/baseconfig/s390x/CONFIG_MFD_RTSX_USB new file mode 100644 index 0000000..b6efa65 --- /dev/null +++ b/baseconfig/s390x/CONFIG_MFD_RTSX_USB @@ -0,0 +1 @@ +# CONFIG_MFD_RTSX_USB is not set diff --git a/baseconfig/s390x/CONFIG_MFD_TPS68470 b/baseconfig/s390x/CONFIG_MFD_TPS68470 new file mode 100644 index 0000000..e82f415 --- /dev/null +++ b/baseconfig/s390x/CONFIG_MFD_TPS68470 @@ -0,0 +1 @@ +# CONFIG_MFD_TPS68470 is not set diff --git a/baseconfig/s390x/CONFIG_MFD_VIPERBOARD b/baseconfig/s390x/CONFIG_MFD_VIPERBOARD new file mode 100644 index 0000000..1d4d005 --- /dev/null +++ b/baseconfig/s390x/CONFIG_MFD_VIPERBOARD @@ -0,0 +1 @@ +# CONFIG_MFD_VIPERBOARD is not set diff --git a/baseconfig/s390x/CONFIG_VMCP_CMA_SIZE b/baseconfig/s390x/CONFIG_VMCP_CMA_SIZE new file mode 100644 index 0000000..aee0667 --- /dev/null +++ b/baseconfig/s390x/CONFIG_VMCP_CMA_SIZE @@ -0,0 +1 @@ +CONFIG_VMCP_CMA_SIZE=4 diff --git a/baseconfig/x86/CONFIG_CONFIG_PINCTRL_LEWISBURG b/baseconfig/x86/CONFIG_CONFIG_PINCTRL_LEWISBURG new file mode 100644 index 0000000..c2c5119 --- /dev/null +++ b/baseconfig/x86/CONFIG_CONFIG_PINCTRL_LEWISBURG @@ -0,0 +1 @@ +CONFIG_PINCTRL_LEWISBURG=m diff --git a/baseconfig/x86/CONFIG_HYPERV_VSOCKETS b/baseconfig/x86/CONFIG_HYPERV_VSOCKETS new file mode 100644 index 0000000..bd21cd6 --- /dev/null +++ b/baseconfig/x86/CONFIG_HYPERV_VSOCKETS @@ -0,0 +1 @@ +CONFIG_HYPERV_VSOCKETS=m diff --git a/baseconfig/x86/CONFIG_INTEL_RDT b/baseconfig/x86/CONFIG_INTEL_RDT new file mode 100644 index 0000000..0dcef9a --- /dev/null +++ b/baseconfig/x86/CONFIG_INTEL_RDT @@ -0,0 +1 @@ +CONFIG_INTEL_RDT=y diff --git a/baseconfig/x86/CONFIG_MAXSMP b/baseconfig/x86/CONFIG_MAXSMP index 8d0fa58..d0d71de 100644 --- a/baseconfig/x86/CONFIG_MAXSMP +++ b/baseconfig/x86/CONFIG_MAXSMP @@ -1 +1 @@ -CONFIG_MAXSMP=y +# CONFIG_MAXSMP is not set diff --git a/baseconfig/x86/CONFIG_PINCTRL_DENVERTON b/baseconfig/x86/CONFIG_PINCTRL_DENVERTON new file mode 100644 index 0000000..ec6b4e8 --- /dev/null +++ b/baseconfig/x86/CONFIG_PINCTRL_DENVERTON @@ -0,0 +1 @@ +CONFIG_PINCTRL_DENVERTON=m diff --git a/baseconfig/x86/CONFIG_XEN_PVCALLS_BACKEND b/baseconfig/x86/CONFIG_XEN_PVCALLS_BACKEND new file mode 100644 index 0000000..3a5b2c4 --- /dev/null +++ b/baseconfig/x86/CONFIG_XEN_PVCALLS_BACKEND @@ -0,0 +1 @@ +# CONFIG_XEN_PVCALLS_BACKEND is not set diff --git a/baseconfig/x86/x86_64/CONFIG_AMD_MEM_ENCRYPT b/baseconfig/x86/x86_64/CONFIG_AMD_MEM_ENCRYPT new file mode 100644 index 0000000..f9eacfa --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_AMD_MEM_ENCRYPT @@ -0,0 +1 @@ +CONFIG_AMD_MEM_ENCRYPT=y diff --git a/baseconfig/x86/x86_64/CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT b/baseconfig/x86/x86_64/CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT new file mode 100644 index 0000000..e41f0cf --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT @@ -0,0 +1 @@ +# CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT is not set diff --git a/baseconfig/x86/x86_64/CONFIG_DEVICE_PRIVATE b/baseconfig/x86/x86_64/CONFIG_DEVICE_PRIVATE new file mode 100644 index 0000000..ef0a4ad --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_DEVICE_PRIVATE @@ -0,0 +1 @@ +CONFIG_DEVICE_PRIVATE=y diff --git a/baseconfig/x86/x86_64/CONFIG_DEVICE_PUBLIC b/baseconfig/x86/x86_64/CONFIG_DEVICE_PUBLIC new file mode 100644 index 0000000..c790e94 --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_DEVICE_PUBLIC @@ -0,0 +1 @@ +CONFIG_DEVICE_PUBLIC=y diff --git a/baseconfig/x86/x86_64/CONFIG_HMM_MIRROR b/baseconfig/x86/x86_64/CONFIG_HMM_MIRROR new file mode 100644 index 0000000..11dfee6 --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_HMM_MIRROR @@ -0,0 +1 @@ +CONFIG_HMM_MIRROR=y diff --git a/baseconfig/x86/x86_64/CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT b/baseconfig/x86/x86_64/CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT new file mode 100644 index 0000000..4a06cfc --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT @@ -0,0 +1 @@ +CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT=y diff --git a/baseconfig/x86/x86_64/CONFIG_NR_CPUS b/baseconfig/x86/x86_64/CONFIG_NR_CPUS index 4411916..27d187f 100644 --- a/baseconfig/x86/x86_64/CONFIG_NR_CPUS +++ b/baseconfig/x86/x86_64/CONFIG_NR_CPUS @@ -1 +1 @@ -CONFIG_NR_CPUS=8192 +CONFIG_NR_CPUS=1024 diff --git a/baseconfig/x86/x86_64/CONFIG_X86_5LEVEL b/baseconfig/x86/x86_64/CONFIG_X86_5LEVEL new file mode 100644 index 0000000..db301f3 --- /dev/null +++ b/baseconfig/x86/x86_64/CONFIG_X86_5LEVEL @@ -0,0 +1 @@ +# CONFIG_X86_5LEVEL is not set diff --git a/bcm2837-bluetooth-support.patch b/bcm2837-bluetooth-support.patch index bdba4aa..c272c1e 100644 --- a/bcm2837-bluetooth-support.patch +++ b/bcm2837-bluetooth-support.patch @@ -1,597 +1,3 @@ -From 98dc77d57169f51d100f8b0cb3e4d1e0911ef7a4 Mon Sep 17 00:00:00 2001 -From: Loic Poulain -Date: Tue, 4 Jul 2017 12:57:56 +0200 -Subject: Bluetooth: hci_bcm: Make bcm_request_irq fail if no IRQ resource - -In case of no IRQ resource associated to the bcm_device, requesting -IRQ should return an error in order to not enable low power mgmt. - -Signed-off-by: Loic Poulain -Reported-by: Ian Molton -Signed-off-by: Marcel Holtmann ---- - drivers/bluetooth/hci_bcm.c | 30 ++++++++++++++++-------------- - 1 file changed, 16 insertions(+), 14 deletions(-) - -diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c -index 6a662d0..6b42372 100644 ---- a/drivers/bluetooth/hci_bcm.c -+++ b/drivers/bluetooth/hci_bcm.c -@@ -176,7 +176,7 @@ static irqreturn_t bcm_host_wake(int irq, void *data) - static int bcm_request_irq(struct bcm_data *bcm) - { - struct bcm_device *bdev = bcm->dev; -- int err = 0; -+ int err; - - /* If this is not a platform device, do not enable PM functionalities */ - mutex_lock(&bcm_device_lock); -@@ -185,21 +185,23 @@ static int bcm_request_irq(struct bcm_data *bcm) - goto unlock; - } - -- if (bdev->irq > 0) { -- err = devm_request_irq(&bdev->pdev->dev, bdev->irq, -- bcm_host_wake, IRQF_TRIGGER_RISING, -- "host_wake", bdev); -- if (err) -- goto unlock; -+ if (bdev->irq <= 0) { -+ err = -EOPNOTSUPP; -+ goto unlock; -+ } - -- device_init_wakeup(&bdev->pdev->dev, true); -+ err = devm_request_irq(&bdev->pdev->dev, bdev->irq, bcm_host_wake, -+ IRQF_TRIGGER_RISING, "host_wake", bdev); -+ if (err) -+ goto unlock; - -- pm_runtime_set_autosuspend_delay(&bdev->pdev->dev, -- BCM_AUTOSUSPEND_DELAY); -- pm_runtime_use_autosuspend(&bdev->pdev->dev); -- pm_runtime_set_active(&bdev->pdev->dev); -- pm_runtime_enable(&bdev->pdev->dev); -- } -+ device_init_wakeup(&bdev->pdev->dev, true); -+ -+ pm_runtime_set_autosuspend_delay(&bdev->pdev->dev, -+ BCM_AUTOSUSPEND_DELAY); -+ pm_runtime_use_autosuspend(&bdev->pdev->dev); -+ pm_runtime_set_active(&bdev->pdev->dev); -+ pm_runtime_enable(&bdev->pdev->dev); - - unlock: - mutex_unlock(&bcm_device_lock); --- -cgit v1.1 - -From 74183a1c50a3c61e62d2e585107ea3c0b942a3ff Mon Sep 17 00:00:00 2001 -From: Marcel Holtmann -Date: Wed, 16 Aug 2017 09:53:30 +0200 -Subject: Bluetooth: hci_bcm: Use operation speed of 4Mbps only for ACPI - devices - -Not all Broadcom controller support the 4Mbps operational speed on UART -devices. This is because the UART clock setting changes might not be -supported. - - < HCI Command: Broadcom Write UART Clock Setting (0x3f|0x0045) plen 1 - 01 . - > HCI Event: Command Complete (0x0e) plen 4 - Broadcom Write UART Clock Setting (0x3f|0x0045) ncmd 1 - Status: Unknown HCI Command (0x01) - -To support any operational speed higher than 3Mbps, support for this -command is required. With that respect it is better to not enforce any -operational speed by default. Only when its support is known, then allow -for higher operational speed. - -This patch assigns the 4Mbps opertional speed only for devices -discovered through ACPI and leave all others at the default 115200. - -Signed-off-by: Marcel Holtmann -Signed-off-by: Johan Hedberg ---- - drivers/bluetooth/hci_bcm.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c -index 6b42372..1eb286a 100644 ---- a/drivers/bluetooth/hci_bcm.c -+++ b/drivers/bluetooth/hci_bcm.c -@@ -59,6 +59,7 @@ struct bcm_device { - bool clk_enabled; - - u32 init_speed; -+ u32 oper_speed; - int irq; - u8 irq_polarity; - -@@ -303,6 +304,7 @@ static int bcm_open(struct hci_uart *hu) - if (hu->tty->dev->parent == dev->pdev->dev.parent) { - bcm->dev = dev; - hu->init_speed = dev->init_speed; -+ hu->oper_speed = dev->oper_speed; - #ifdef CONFIG_PM - dev->hu = hu; - #endif -@@ -699,8 +701,10 @@ static int bcm_resource(struct acpi_resource *ares, void *data) - - case ACPI_RESOURCE_TYPE_SERIAL_BUS: - sb = &ares->data.uart_serial_bus; -- if (sb->type == ACPI_RESOURCE_SERIAL_TYPE_UART) -+ if (sb->type == ACPI_RESOURCE_SERIAL_TYPE_UART) { - dev->init_speed = sb->default_baud_rate; -+ dev->oper_speed = 4000000; -+ } - break; - - default: -@@ -853,7 +857,6 @@ static const struct hci_uart_proto bcm_proto = { - .name = "Broadcom", - .manufacturer = 15, - .init_speed = 115200, -- .oper_speed = 4000000, - .open = bcm_open, - .close = bcm_close, - .flush = bcm_flush, --- -cgit v1.1 - -From 33cd149e767be9afbab9fcd3d5165a2de62313c8 Mon Sep 17 00:00:00 2001 -From: Loic Poulain -Date: Thu, 17 Aug 2017 19:59:51 +0200 -Subject: Bluetooth: hci_bcm: Add serdev support - -Add basic support for Broadcom serial slave devices. -Probe the serial device, retrieve its maximum speed and -register a new hci uart device. - -Tested/compatible with bcm43438 (RPi3). - -Signed-off-by: Loic Poulain -Signed-off-by: Marcel Holtmann ---- - drivers/bluetooth/Kconfig | 1 + - drivers/bluetooth/hci_bcm.c | 85 +++++++++++++++++++++++++++++++++++++++++++-- - 2 files changed, 84 insertions(+), 2 deletions(-) - -diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig -index 3a6ead6..fae5a74 100644 ---- a/drivers/bluetooth/Kconfig -+++ b/drivers/bluetooth/Kconfig -@@ -168,6 +168,7 @@ config BT_HCIUART_INTEL - config BT_HCIUART_BCM - bool "Broadcom protocol support" - depends on BT_HCIUART -+ depends on BT_HCIUART_SERDEV - select BT_HCIUART_H4 - select BT_BCM - help -diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c -index 1eb286a..34882f1 100644 ---- a/drivers/bluetooth/hci_bcm.c -+++ b/drivers/bluetooth/hci_bcm.c -@@ -27,6 +27,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - #include -@@ -34,6 +36,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -46,6 +49,7 @@ - - #define BCM_AUTOSUSPEND_DELAY 5000 /* default autosleep delay */ - -+/* platform device driver resources */ - struct bcm_device { - struct list_head list; - -@@ -69,6 +73,12 @@ struct bcm_device { - #endif - }; - -+/* serdev driver resources */ -+struct bcm_serdev { -+ struct hci_uart hu; -+}; -+ -+/* generic bcm uart resources */ - struct bcm_data { - struct sk_buff *rx_skb; - struct sk_buff_head txq; -@@ -80,6 +90,14 @@ struct bcm_data { - static DEFINE_MUTEX(bcm_device_lock); - static LIST_HEAD(bcm_device_list); - -+static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) -+{ -+ if (hu->serdev) -+ serdev_device_set_baudrate(hu->serdev, speed); -+ else -+ hci_uart_set_baudrate(hu, speed); -+} -+ - static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed) - { - struct hci_dev *hdev = hu->hdev; -@@ -290,6 +308,14 @@ static int bcm_open(struct hci_uart *hu) - - hu->priv = bcm; - -+ /* If this is a serdev defined device, then only use -+ * serdev open primitive and skip the rest. -+ */ -+ if (hu->serdev) { -+ serdev_device_open(hu->serdev); -+ goto out; -+ } -+ - if (!hu->tty->dev) - goto out; - -@@ -325,6 +351,12 @@ static int bcm_close(struct hci_uart *hu) - - bt_dev_dbg(hu->hdev, "hu %p", hu); - -+ /* If this is a serdev defined device, only use serdev -+ * close primitive and then continue as usual. -+ */ -+ if (hu->serdev) -+ serdev_device_close(hu->serdev); -+ - /* Protect bcm->dev against removal of the device or driver */ - mutex_lock(&bcm_device_lock); - if (bcm_device_exists(bdev)) { -@@ -400,7 +432,7 @@ static int bcm_setup(struct hci_uart *hu) - speed = 0; - - if (speed) -- hci_uart_set_baudrate(hu, speed); -+ host_set_baudrate(hu, speed); - - /* Operational speed if any */ - if (hu->oper_speed) -@@ -413,7 +445,7 @@ static int bcm_setup(struct hci_uart *hu) - if (speed) { - err = bcm_set_baudrate(hu, speed); - if (!err) -- hci_uart_set_baudrate(hu, speed); -+ host_set_baudrate(hu, speed); - } - - finalize: -@@ -906,9 +938,57 @@ static struct platform_driver bcm_driver = { - }, - }; - -+static int bcm_serdev_probe(struct serdev_device *serdev) -+{ -+ struct bcm_serdev *bcmdev; -+ u32 speed; -+ int err; -+ -+ bcmdev = devm_kzalloc(&serdev->dev, sizeof(*bcmdev), GFP_KERNEL); -+ if (!bcmdev) -+ return -ENOMEM; -+ -+ bcmdev->hu.serdev = serdev; -+ serdev_device_set_drvdata(serdev, bcmdev); -+ -+ err = device_property_read_u32(&serdev->dev, "max-speed", &speed); -+ if (!err) -+ bcmdev->hu.oper_speed = speed; -+ -+ return hci_uart_register_device(&bcmdev->hu, &bcm_proto); -+} -+ -+static void bcm_serdev_remove(struct serdev_device *serdev) -+{ -+ struct bcm_serdev *bcmdev = serdev_device_get_drvdata(serdev); -+ -+ hci_uart_unregister_device(&bcmdev->hu); -+} -+ -+#ifdef CONFIG_OF -+static const struct of_device_id bcm_bluetooth_of_match[] = { -+ { .compatible = "brcm,bcm43438-bt" }, -+ { }, -+}; -+MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match); -+#endif -+ -+static struct serdev_device_driver bcm_serdev_driver = { -+ .probe = bcm_serdev_probe, -+ .remove = bcm_serdev_remove, -+ .driver = { -+ .name = "hci_uart_bcm", -+ .of_match_table = of_match_ptr(bcm_bluetooth_of_match), -+ }, -+}; -+ - int __init bcm_init(void) - { -+ /* For now, we need to keep both platform device -+ * driver (ACPI generated) and serdev driver (DT). -+ */ - platform_driver_register(&bcm_driver); -+ serdev_device_driver_register(&bcm_serdev_driver); - - return hci_uart_register_proto(&bcm_proto); - } -@@ -916,6 +996,7 @@ int __init bcm_init(void) - int __exit bcm_deinit(void) - { - platform_driver_unregister(&bcm_driver); -+ serdev_device_driver_unregister(&bcm_serdev_driver); - - return hci_uart_unregister_proto(&bcm_proto); - } --- -cgit v1.1 - -From 01d5e44ace8a20fc51e0d530f98acb3c365345a5 Mon Sep 17 00:00:00 2001 -From: Marcel Holtmann -Date: Thu, 17 Aug 2017 21:41:09 +0200 -Subject: Bluetooth: hci_bcm: Handle empty packet after firmware loading - -The Broadcom controller on the Raspberry Pi3 sends an empty packet with -packet type 0x00 after launching the firmware. This will cause logging -of errors. - - Bluetooth: hci0: Frame reassembly failed (-84) - -Since this seems to be an intented behaviour of the controller, handle -it gracefully by parsing that empty packet with packet type 0x00 and -then just simply report it as diagnostic packet. - -With that change no errors are logging and the packet itself is actually -recorded in the Bluetooth monitor traces. - - < HCI Command: Broadcom Launch RAM (0x3f|0x004e) plen 4 - Address: 0xffffffff - > HCI Event: Command Complete (0x0e) plen 4 - Broadcom Launch RAM (0x3f|0x004e) ncmd 1 - Status: Success (0x00) - = Vendor Diagnostic (len 0) - < HCI Command: Broadcom Update UART Baud Rate (0x3f|0x0018) plen 6 - 00 00 00 10 0e 00 ...... - > HCI Event: Command Complete (0x0e) plen 4 - Broadcom Update UART Baud Rate (0x3f|0x0018) ncmd 1 - Status: Success (0x00) - < HCI Command: Reset (0x03|0x0003) plen 0 - > HCI Event: Command Complete (0x0e) plen 4 - Reset (0x03|0x0003) ncmd 1 - Status: Success (0x00) - -Signed-off-by: Marcel Holtmann -Signed-off-by: Johan Hedberg ---- - drivers/bluetooth/hci_bcm.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c -index 34882f1..e254011 100644 ---- a/drivers/bluetooth/hci_bcm.c -+++ b/drivers/bluetooth/hci_bcm.c -@@ -44,6 +44,9 @@ - #include "btbcm.h" - #include "hci_uart.h" - -+#define BCM_NULL_PKT 0x00 -+#define BCM_NULL_SIZE 0 -+ - #define BCM_LM_DIAG_PKT 0x07 - #define BCM_LM_DIAG_SIZE 63 - -@@ -468,11 +471,19 @@ finalize: - .lsize = 0, \ - .maxlen = BCM_LM_DIAG_SIZE - -+#define BCM_RECV_NULL \ -+ .type = BCM_NULL_PKT, \ -+ .hlen = BCM_NULL_SIZE, \ -+ .loff = 0, \ -+ .lsize = 0, \ -+ .maxlen = BCM_NULL_SIZE -+ - static const struct h4_recv_pkt bcm_recv_pkts[] = { - { H4_RECV_ACL, .recv = hci_recv_frame }, - { H4_RECV_SCO, .recv = hci_recv_frame }, - { H4_RECV_EVENT, .recv = hci_recv_frame }, - { BCM_RECV_LM_DIAG, .recv = hci_recv_diag }, -+ { BCM_RECV_NULL, .recv = hci_recv_diag }, - }; - - static int bcm_recv(struct hci_uart *hu, const void *data, int count) --- -cgit v1.1 - -From c34dc3bfa7642fda423208579015d615f7becfa0 Mon Sep 17 00:00:00 2001 -From: Ian Molton -Date: Sat, 8 Jul 2017 17:37:41 +0100 -Subject: Bluetooth: hci_serdev: Introduce hci_uart_unregister_device() - -Several drivers have the same (and incorrect) code in their -_remove() handler. - -Coalesce this into a shared function. - -Signed-off-by: Ian Molton -Reviewed-by: Sebastian Reichel -Signed-off-by: Marcel Holtmann ---- - drivers/bluetooth/hci_serdev.c | 13 +++++++++++++ - drivers/bluetooth/hci_uart.h | 1 + - 2 files changed, 14 insertions(+) - -diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c -index aea9301..b725ac4 100644 ---- a/drivers/bluetooth/hci_serdev.c -+++ b/drivers/bluetooth/hci_serdev.c -@@ -354,3 +354,16 @@ err_alloc: - return err; - } - EXPORT_SYMBOL_GPL(hci_uart_register_device); -+ -+void hci_uart_unregister_device(struct hci_uart *hu) -+{ -+ struct hci_dev *hdev = hu->hdev; -+ -+ hci_unregister_dev(hdev); -+ hci_free_dev(hdev); -+ -+ cancel_work_sync(&hu->write_work); -+ -+ hu->proto->close(hu); -+} -+EXPORT_SYMBOL_GPL(hci_uart_unregister_device); -diff --git a/drivers/bluetooth/hci_uart.h b/drivers/bluetooth/hci_uart.h -index c6e9e1c..d9cd95d 100644 ---- a/drivers/bluetooth/hci_uart.h -+++ b/drivers/bluetooth/hci_uart.h -@@ -112,6 +112,7 @@ struct hci_uart { - int hci_uart_register_proto(const struct hci_uart_proto *p); - int hci_uart_unregister_proto(const struct hci_uart_proto *p); - int hci_uart_register_device(struct hci_uart *hu, const struct hci_uart_proto *p); -+void hci_uart_unregister_device(struct hci_uart *hu); - - int hci_uart_tx_wakeup(struct hci_uart *hu); - int hci_uart_init_ready(struct hci_uart *hu); --- -cgit v1.1 - -From patchwork Thu Aug 17 17:59:48 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [v4,1/4] dt-bindings: net: bluetooth: Add broadcom-bluetooth -X-Patchwork-Submitter: Loic Poulain -X-Patchwork-Id: 802828 -Message-Id: <1502992791-10265-1-git-send-email-loic.poulain@gmail.com> -To: robh+dt@kernel.org, f.fainelli@gmail.com, rjui@broadcom.com, - marcel@holtmann.org, johan.hedberg@gmail.com, stefan.wahren@i2se.com -Cc: devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org, - linux-rpi-kernel@lists.infradead.org, Loic Poulain -Date: Thu, 17 Aug 2017 19:59:48 +0200 -From: Loic Poulain -List-Id: - -Add binding document for serial bluetooth chips using -Broadcom protocol. - -Signed-off-by: Loic Poulain -Acked-by: Rob Herring -Acked-by: Rob Herring -Acked-by: Rob Herring ---- - v2: dt-bindings as separate patch - rebase on upcoming pi3 dts changes - v3: changes in bcm serdev drivers: - name refactoring and additional comments - Add generic host_set_baudrate method - Use agnostic device_property_read - v4: changes in doc and dts: - Add additional params to broadcom bt dt-bindings - Set the max baudrate to 2000000 instead of 921600 - use chosen/stdout-path instead of console= - remove useless earlyprintk - same changes in bcm283x.dtsi - - .../devicetree/bindings/net/broadcom-bluetooth.txt | 35 ++++++++++++++++++++++ - 1 file changed, 35 insertions(+) - create mode 100644 Documentation/devicetree/bindings/net/broadcom-bluetooth.txt - -diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt -new file mode 100644 -index 0000000..4194ff7 ---- /dev/null -+++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt -@@ -0,0 +1,35 @@ -+Broadcom Bluetooth Chips -+--------------------- -+ -+This documents the binding structure and common properties for serial -+attached Broadcom devices. -+ -+Serial attached Broadcom devices shall be a child node of the host UART -+device the slave device is attached to. -+ -+Required properties: -+ -+ - compatible: should contain one of the following: -+ * "brcm,bcm43438-bt" -+ -+Optional properties: -+ -+ - max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt -+ - shutdown-gpios: GPIO specifier, used to enable the BT module -+ - device-wakeup-gpios: GPIO specifier, used to wakeup the controller -+ - host-wakeup-gpios: GPIO specifier, used to wakeup the host processor -+ - clocks: clock specifier if external clock provided to the controller -+ - clock-names: should be "extclk" -+ -+ -+Example: -+ -+&uart2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart2_pins>; -+ -+ bluetooth { -+ compatible = "brcm,bcm43438-bt"; -+ max-speed = <921600>; -+ }; -+}; -From a92507095467d77f4fd05f54ae8d299459c2c3a3 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Sun, 10 Sep 2017 19:29:23 +0100 -Subject: [PATCH 1/2] ARM: dts: bcm283x: Use stdout-path instead of console - bootarg - -Add the serial port config to "chosen/stdout-path". -Create serial0/1 aliases referring to uart0 ant uart1 paths. -Remove unneeded earlyprintk. - -Signed-off-by: Loic Poulain -Signed-off-by: Peter Robinson ---- - arch/arm/boot/dts/bcm283x.dtsi | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index 431dcfc900c0..013431e3d7c3 100644 ---- a/arch/arm/boot/dts/bcm283x.dtsi -+++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -20,8 +20,13 @@ - #address-cells = <1>; - #size-cells = <1>; - -+ aliases { -+ serial0 = &uart0; -+ serial1 = &uart1; -+ }; -+ - chosen { -- bootargs = "earlyprintk console=ttyAMA0"; -+ stdout-path = "serial0:115200n8"; - }; - - thermal-zones { --- -2.13.5 - From 50252c318fe2fcfcbd0832fa835e7fd1fafd7d2d Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sun, 10 Sep 2017 19:30:02 +0100 @@ -613,18 +19,6 @@ diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-r index 20725ca487f3..e4488cb3067e 100644 --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -@@ -8,6 +8,11 @@ - compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; - model = "Raspberry Pi 3 Model B"; - -+ chosen { -+ /* 8250 auxiliar UART instead of pl011 */ -+ stdout-path = "serial1:115200n8"; -+ }; -+ - memory { - reg = <0 0x40000000>; - }; @@ -24,6 +29,11 @@ pinctrl-names = "default"; pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>; diff --git a/bcm2837-move-dt.patch b/bcm2837-move-dt.patch deleted file mode 100644 index 018cf81..0000000 --- a/bcm2837-move-dt.patch +++ /dev/null @@ -1,516 +0,0 @@ -From 3bfe25fa9f8a56c5c877c7fd854d89238787c6d8 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 26 Jul 2017 13:01:56 -0700 -Subject: ARM: dts: bcm283x: Move the BCM2837 DT contents from arm64 to arm. - -BCM2837 is somewhat unusual in that we build its DT on both arm32 and -arm64. Most devices are being run in arm32 mode. - -Having the body of the DT for 2837 separate from 2835/6 has been a -source of pain, as we often need to make changes that span both -directories simultaneously (for example, the thermal changes for 4.13, -or anything that changes the name of a node referenced by '&' from -board files). Other changes are made more complicated than they need -to be, such as the SDHOST enabling, because we have to split a single -logical change into a 283[56] half and a 2837 half. - -To fix this, make the stub board include file live in arm64 instead of -arm32, and keep all of BCM283x's contents in arm32. From here on, our -changes to DT contents can be submitted through a single tree. - -Signed-off-by: Eric Anholt -Signed-off-by: Florian Fainelli ---- - arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 42 ++++++++++- - arch/arm/boot/dts/bcm2837.dtsi | 86 ++++++++++++++++++++++ - arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi | 1 - - arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts | 42 +---------- - arch/arm64/boot/dts/broadcom/bcm2837.dtsi | 86 ---------------------- - .../boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi | 1 - - .../boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi | 1 - - arch/arm64/boot/dts/broadcom/bcm283x.dtsi | 1 - - 8 files changed, 128 insertions(+), 132 deletions(-) - create mode 100644 arch/arm/boot/dts/bcm2837.dtsi - delete mode 120000 arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi - delete mode 100644 arch/arm64/boot/dts/broadcom/bcm2837.dtsi - delete mode 120000 arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi - delete mode 120000 arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi - delete mode 120000 arch/arm64/boot/dts/broadcom/bcm283x.dtsi - -diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -index c72a27d..972f14d 100644 ---- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -@@ -1 +1,41 @@ --#include "arm64/broadcom/bcm2837-rpi-3-b.dts" -+/dts-v1/; -+#include "bcm2837.dtsi" -+#include "bcm2835-rpi.dtsi" -+#include "bcm283x-rpi-smsc9514.dtsi" -+#include "bcm283x-rpi-usb-host.dtsi" -+ -+/ { -+ compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; -+ model = "Raspberry Pi 3 Model B"; -+ -+ memory { -+ reg = <0 0x40000000>; -+ }; -+ -+ leds { -+ act { -+ gpios = <&gpio 47 0>; -+ }; -+ }; -+}; -+ -+&uart1 { -+ status = "okay"; -+}; -+ -+/* SDHCI is used to control the SDIO for wireless */ -+&sdhci { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emmc_gpio34>; -+ status = "okay"; -+ bus-width = <4>; -+ non-removable; -+}; -+ -+/* SDHOST is used to drive the SD card */ -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_gpio48>; -+ status = "okay"; -+ bus-width = <4>; -+}; -diff --git a/arch/arm/boot/dts/bcm2837.dtsi b/arch/arm/boot/dts/bcm2837.dtsi -new file mode 100644 -index 0000000..2d5de6f0 ---- /dev/null -+++ b/arch/arm/boot/dts/bcm2837.dtsi -@@ -0,0 +1,86 @@ -+#include "bcm283x.dtsi" -+ -+/ { -+ compatible = "brcm,bcm2837"; -+ -+ soc { -+ ranges = <0x7e000000 0x3f000000 0x1000000>, -+ <0x40000000 0x40000000 0x00001000>; -+ dma-ranges = <0xc0000000 0x00000000 0x3f000000>; -+ -+ local_intc: local_intc { -+ compatible = "brcm,bcm2836-l1-intc"; -+ reg = <0x40000000 0x100>; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ interrupt-parent = <&local_intc>; -+ }; -+ }; -+ -+ timer { -+ compatible = "arm,armv7-timer"; -+ interrupt-parent = <&local_intc>; -+ interrupts = <0>, // PHYS_SECURE_PPI -+ <1>, // PHYS_NONSECURE_PPI -+ <3>, // VIRT_PPI -+ <2>; // HYP_PPI -+ always-on; -+ }; -+ -+ cpus: cpus { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ cpu0: cpu@0 { -+ device_type = "cpu"; -+ compatible = "arm,cortex-a53"; -+ reg = <0>; -+ enable-method = "spin-table"; -+ cpu-release-addr = <0x0 0x000000d8>; -+ }; -+ -+ cpu1: cpu@1 { -+ device_type = "cpu"; -+ compatible = "arm,cortex-a53"; -+ reg = <1>; -+ enable-method = "spin-table"; -+ cpu-release-addr = <0x0 0x000000e0>; -+ }; -+ -+ cpu2: cpu@2 { -+ device_type = "cpu"; -+ compatible = "arm,cortex-a53"; -+ reg = <2>; -+ enable-method = "spin-table"; -+ cpu-release-addr = <0x0 0x000000e8>; -+ }; -+ -+ cpu3: cpu@3 { -+ device_type = "cpu"; -+ compatible = "arm,cortex-a53"; -+ reg = <3>; -+ enable-method = "spin-table"; -+ cpu-release-addr = <0x0 0x000000f0>; -+ }; -+ }; -+}; -+ -+/* Make the BCM2835-style global interrupt controller be a child of the -+ * CPU-local interrupt controller. -+ */ -+&intc { -+ compatible = "brcm,bcm2836-armctrl-ic"; -+ reg = <0x7e00b200 0x200>; -+ interrupt-parent = <&local_intc>; -+ interrupts = <8>; -+}; -+ -+&cpu_thermal { -+ coefficients = <(-538) 412000>; -+}; -+ -+/* enable thermal sensor with the correct compatible property set */ -+&thermal { -+ compatible = "brcm,bcm2837-thermal"; -+ status = "okay"; -+}; -diff --git a/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi b/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi -deleted file mode 120000 -index 3937b77..0000000 ---- a/arch/arm64/boot/dts/broadcom/bcm2835-rpi.dtsi -+++ /dev/null -@@ -1 +0,0 @@ --../../../../arm/boot/dts/bcm2835-rpi.dtsi -\ No newline at end of file -diff --git a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts -index 972f14d..699d340 100644 ---- a/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts -+++ b/arch/arm64/boot/dts/broadcom/bcm2837-rpi-3-b.dts -@@ -1,41 +1 @@ --/dts-v1/; --#include "bcm2837.dtsi" --#include "bcm2835-rpi.dtsi" --#include "bcm283x-rpi-smsc9514.dtsi" --#include "bcm283x-rpi-usb-host.dtsi" -- --/ { -- compatible = "raspberrypi,3-model-b", "brcm,bcm2837"; -- model = "Raspberry Pi 3 Model B"; -- -- memory { -- reg = <0 0x40000000>; -- }; -- -- leds { -- act { -- gpios = <&gpio 47 0>; -- }; -- }; --}; -- --&uart1 { -- status = "okay"; --}; -- --/* SDHCI is used to control the SDIO for wireless */ --&sdhci { -- pinctrl-names = "default"; -- pinctrl-0 = <&emmc_gpio34>; -- status = "okay"; -- bus-width = <4>; -- non-removable; --}; -- --/* SDHOST is used to drive the SD card */ --&sdhost { -- pinctrl-names = "default"; -- pinctrl-0 = <&sdhost_gpio48>; -- status = "okay"; -- bus-width = <4>; --}; -+#include "arm/bcm2837-rpi-3-b.dts" -diff --git a/arch/arm64/boot/dts/broadcom/bcm2837.dtsi b/arch/arm64/boot/dts/broadcom/bcm2837.dtsi -deleted file mode 100644 -index 2d5de6f0..0000000 ---- a/arch/arm64/boot/dts/broadcom/bcm2837.dtsi -+++ /dev/null -@@ -1,86 +0,0 @@ --#include "bcm283x.dtsi" -- --/ { -- compatible = "brcm,bcm2837"; -- -- soc { -- ranges = <0x7e000000 0x3f000000 0x1000000>, -- <0x40000000 0x40000000 0x00001000>; -- dma-ranges = <0xc0000000 0x00000000 0x3f000000>; -- -- local_intc: local_intc { -- compatible = "brcm,bcm2836-l1-intc"; -- reg = <0x40000000 0x100>; -- interrupt-controller; -- #interrupt-cells = <1>; -- interrupt-parent = <&local_intc>; -- }; -- }; -- -- timer { -- compatible = "arm,armv7-timer"; -- interrupt-parent = <&local_intc>; -- interrupts = <0>, // PHYS_SECURE_PPI -- <1>, // PHYS_NONSECURE_PPI -- <3>, // VIRT_PPI -- <2>; // HYP_PPI -- always-on; -- }; -- -- cpus: cpus { -- #address-cells = <1>; -- #size-cells = <0>; -- -- cpu0: cpu@0 { -- device_type = "cpu"; -- compatible = "arm,cortex-a53"; -- reg = <0>; -- enable-method = "spin-table"; -- cpu-release-addr = <0x0 0x000000d8>; -- }; -- -- cpu1: cpu@1 { -- device_type = "cpu"; -- compatible = "arm,cortex-a53"; -- reg = <1>; -- enable-method = "spin-table"; -- cpu-release-addr = <0x0 0x000000e0>; -- }; -- -- cpu2: cpu@2 { -- device_type = "cpu"; -- compatible = "arm,cortex-a53"; -- reg = <2>; -- enable-method = "spin-table"; -- cpu-release-addr = <0x0 0x000000e8>; -- }; -- -- cpu3: cpu@3 { -- device_type = "cpu"; -- compatible = "arm,cortex-a53"; -- reg = <3>; -- enable-method = "spin-table"; -- cpu-release-addr = <0x0 0x000000f0>; -- }; -- }; --}; -- --/* Make the BCM2835-style global interrupt controller be a child of the -- * CPU-local interrupt controller. -- */ --&intc { -- compatible = "brcm,bcm2836-armctrl-ic"; -- reg = <0x7e00b200 0x200>; -- interrupt-parent = <&local_intc>; -- interrupts = <8>; --}; -- --&cpu_thermal { -- coefficients = <(-538) 412000>; --}; -- --/* enable thermal sensor with the correct compatible property set */ --&thermal { -- compatible = "brcm,bcm2837-thermal"; -- status = "okay"; --}; -diff --git a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi -deleted file mode 120000 -index dca7c05..0000000 ---- a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-smsc9514.dtsi -+++ /dev/null -@@ -1 +0,0 @@ --../../../../arm/boot/dts/bcm283x-rpi-smsc9514.dtsi -\ No newline at end of file -diff --git a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi -deleted file mode 120000 -index cbeebe3..0000000 ---- a/arch/arm64/boot/dts/broadcom/bcm283x-rpi-usb-host.dtsi -+++ /dev/null -@@ -1 +0,0 @@ --../../../../arm/boot/dts/bcm283x-rpi-usb-host.dtsi -\ No newline at end of file -diff --git a/arch/arm64/boot/dts/broadcom/bcm283x.dtsi b/arch/arm64/boot/dts/broadcom/bcm283x.dtsi -deleted file mode 120000 -index 5f54e4c..0000000 ---- a/arch/arm64/boot/dts/broadcom/bcm283x.dtsi -+++ /dev/null -@@ -1 +0,0 @@ --../../../../arm/boot/dts/bcm283x.dtsi -\ No newline at end of file --- -cgit v1.1 - -From 4188ea2aeb6dd8f99ab77662f463e41bc464a704 Mon Sep 17 00:00:00 2001 -From: Stefan Wahren -Date: Sun, 30 Jul 2017 19:10:32 +0200 -Subject: ARM: bcm283x: Define UART pinmuxing on board level - -Until RPI 3 and Zero W the pl011 (uart0) was always on pin 14/15. So in -order to take care of them and other boards in the future, -we need to define UART pinmuxing on board level. - -This work based on Eric Anholt's patch "ARM: bcm2385: Don't force pl011 -onto pins 14/15." and Fabian Vogt's patch "ARM64: dts: bcm2837: assign -uart0 to BT and uart1 to pin headers". - -Signed-off-by: Stefan Wahren -Reviewed-by: Eric Anholt -Signed-off-by: Eric Anholt ---- - arch/arm/boot/dts/bcm2835-rpi-a-plus.dts | 6 ++++++ - arch/arm/boot/dts/bcm2835-rpi-a.dts | 6 ++++++ - arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 6 ++++++ - arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts | 6 ++++++ - arch/arm/boot/dts/bcm2835-rpi-b.dts | 6 ++++++ - arch/arm/boot/dts/bcm2835-rpi-zero.dts | 6 ++++++ - arch/arm/boot/dts/bcm2835-rpi.dtsi | 2 +- - arch/arm/boot/dts/bcm2836-rpi-2-b.dts | 6 ++++++ - arch/arm/boot/dts/bcm2837-rpi-3-b.dts | 10 ++++++++++ - 9 files changed, 53 insertions(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts -index d070454..9f86649 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts -+++ b/arch/arm/boot/dts/bcm2835-rpi-a-plus.dts -@@ -99,3 +99,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2835-rpi-a.dts b/arch/arm/boot/dts/bcm2835-rpi-a.dts -index 46d078e..4b1af06 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi-a.dts -+++ b/arch/arm/boot/dts/bcm2835-rpi-a.dts -@@ -94,3 +94,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts -index 432088e..a846f1e 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts -+++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts -@@ -101,3 +101,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts -index 4133bc2..e860964 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts -+++ b/arch/arm/boot/dts/bcm2835-rpi-b-rev2.dts -@@ -94,3 +94,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2835-rpi-b.dts b/arch/arm/boot/dts/bcm2835-rpi-b.dts -index 4d56fe3..5d77f3f 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi-b.dts -+++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts -@@ -89,3 +89,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero.dts b/arch/arm/boot/dts/bcm2835-rpi-zero.dts -index 79a20d5..7036240 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi-zero.dts -+++ b/arch/arm/boot/dts/bcm2835-rpi-zero.dts -@@ -103,3 +103,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi -index e55b362..e36c392 100644 ---- a/arch/arm/boot/dts/bcm2835-rpi.dtsi -+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi -@@ -39,7 +39,7 @@ - }; - - alt0: alt0 { -- brcm,pins = <4 5 7 8 9 10 11 14 15>; -+ brcm,pins = <4 5 7 8 9 10 11>; - brcm,function = ; - }; - }; -diff --git a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts -index bf19e8c..e8de414 100644 ---- a/arch/arm/boot/dts/bcm2836-rpi-2-b.dts -+++ b/arch/arm/boot/dts/bcm2836-rpi-2-b.dts -@@ -39,3 +39,9 @@ - &hdmi { - hpd-gpios = <&gpio 46 GPIO_ACTIVE_LOW>; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio14>; -+ status = "okay"; -+}; -diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -index 972f14d..20725ca 100644 ---- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -+++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts -@@ -19,7 +19,17 @@ - }; - }; - -+/* uart0 communicates with the BT module */ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_gpio32 &gpclk2_gpio43>; -+ status = "okay"; -+}; -+ -+/* uart1 is mapped to the pin header */ - &uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1_gpio14>; - status = "okay"; - }; - --- -cgit v1.1 - diff --git a/bcm283x-vc4-fixes.patch b/bcm283x-vc4-fixes.patch deleted file mode 100644 index d17ff18..0000000 --- a/bcm283x-vc4-fixes.patch +++ /dev/null @@ -1,1803 +0,0 @@ -From d74617cb4aebe5a4cb3eeda3070053ccfc36a0ae Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 25 Jul 2017 09:27:32 -0700 -Subject: [PATCH 1/6] drm/vc4: Demote user-accessible DRM_ERROR paths to - DRM_DEBUG. - -Userspace shouldn't be able to spam dmesg by passing bad arguments. -This has particularly become an issues since we started using a bad -argument to set_tiling to detect if set_tiling was supported. - -Signed-off-by: Eric Anholt -Fixes: 83753117f1de ("drm/vc4: Add get/set tiling ioctls.") -Link: https://patchwork.freedesktop.org/patch/msgid/20170725162733.28007-1-eric@anholt.net -Reviewed-by: Boris Brezillon ---- - drivers/gpu/drm/vc4/vc4_bo.c | 14 +++--- - drivers/gpu/drm/vc4/vc4_gem.c | 10 ++-- - drivers/gpu/drm/vc4/vc4_kms.c | 2 +- - drivers/gpu/drm/vc4/vc4_render_cl.c | 40 +++++++-------- - drivers/gpu/drm/vc4/vc4_validate.c | 78 +++++++++++++++--------------- - drivers/gpu/drm/vc4/vc4_validate_shaders.c | 72 +++++++++++++-------------- - 6 files changed, 108 insertions(+), 108 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c -index 487f96412d35..ede80199001d 100644 ---- a/drivers/gpu/drm/vc4/vc4_bo.c -+++ b/drivers/gpu/drm/vc4/vc4_bo.c -@@ -389,7 +389,7 @@ vc4_prime_export(struct drm_device *dev, struct drm_gem_object *obj, int flags) - struct vc4_bo *bo = to_vc4_bo(obj); - - if (bo->validated_shader) { -- DRM_ERROR("Attempting to export shader BO\n"); -+ DRM_DEBUG("Attempting to export shader BO\n"); - return ERR_PTR(-EINVAL); - } - -@@ -410,7 +410,7 @@ int vc4_mmap(struct file *filp, struct vm_area_struct *vma) - bo = to_vc4_bo(gem_obj); - - if (bo->validated_shader && (vma->vm_flags & VM_WRITE)) { -- DRM_ERROR("mmaping of shader BOs for writing not allowed.\n"); -+ DRM_DEBUG("mmaping of shader BOs for writing not allowed.\n"); - return -EINVAL; - } - -@@ -435,7 +435,7 @@ int vc4_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) - struct vc4_bo *bo = to_vc4_bo(obj); - - if (bo->validated_shader && (vma->vm_flags & VM_WRITE)) { -- DRM_ERROR("mmaping of shader BOs for writing not allowed.\n"); -+ DRM_DEBUG("mmaping of shader BOs for writing not allowed.\n"); - return -EINVAL; - } - -@@ -447,7 +447,7 @@ void *vc4_prime_vmap(struct drm_gem_object *obj) - struct vc4_bo *bo = to_vc4_bo(obj); - - if (bo->validated_shader) { -- DRM_ERROR("mmaping of shader BOs not allowed.\n"); -+ DRM_DEBUG("mmaping of shader BOs not allowed.\n"); - return ERR_PTR(-EINVAL); - } - -@@ -501,7 +501,7 @@ int vc4_mmap_bo_ioctl(struct drm_device *dev, void *data, - - gem_obj = drm_gem_object_lookup(file_priv, args->handle); - if (!gem_obj) { -- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); -+ DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle); - return -EINVAL; - } - -@@ -605,7 +605,7 @@ int vc4_set_tiling_ioctl(struct drm_device *dev, void *data, - - gem_obj = drm_gem_object_lookup(file_priv, args->handle); - if (!gem_obj) { -- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); -+ DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle); - return -ENOENT; - } - bo = to_vc4_bo(gem_obj); -@@ -636,7 +636,7 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, - - gem_obj = drm_gem_object_lookup(file_priv, args->handle); - if (!gem_obj) { -- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); -+ DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle); - return -ENOENT; - } - bo = to_vc4_bo(gem_obj); -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index d5b821ad06af..a3e45e67f417 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -659,7 +659,7 @@ vc4_cl_lookup_bos(struct drm_device *dev, - /* See comment on bo_index for why we have to check - * this. - */ -- DRM_ERROR("Rendering requires BOs to validate\n"); -+ DRM_DEBUG("Rendering requires BOs to validate\n"); - return -EINVAL; - } - -@@ -691,7 +691,7 @@ vc4_cl_lookup_bos(struct drm_device *dev, - struct drm_gem_object *bo = idr_find(&file_priv->object_idr, - handles[i]); - if (!bo) { -- DRM_ERROR("Failed to look up GEM BO %d: %d\n", -+ DRM_DEBUG("Failed to look up GEM BO %d: %d\n", - i, handles[i]); - ret = -EINVAL; - spin_unlock(&file_priv->table_lock); -@@ -729,7 +729,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) - args->shader_rec_count >= (UINT_MAX / - sizeof(struct vc4_shader_state)) || - temp_size < exec_size) { -- DRM_ERROR("overflow in exec arguments\n"); -+ DRM_DEBUG("overflow in exec arguments\n"); - ret = -EINVAL; - goto fail; - } -@@ -974,7 +974,7 @@ vc4_wait_bo_ioctl(struct drm_device *dev, void *data, - - gem_obj = drm_gem_object_lookup(file_priv, args->handle); - if (!gem_obj) { -- DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); -+ DRM_DEBUG("Failed to look up GEM BO %d\n", args->handle); - return -EINVAL; - } - bo = to_vc4_bo(gem_obj); -@@ -1009,7 +1009,7 @@ vc4_submit_cl_ioctl(struct drm_device *dev, void *data, - int ret = 0; - - if ((args->flags & ~VC4_SUBMIT_CL_USE_CLEAR_COLOR) != 0) { -- DRM_ERROR("Unknown flags: 0x%02x\n", args->flags); -+ DRM_DEBUG("Unknown flags: 0x%02x\n", args->flags); - return -EINVAL; - } - -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index bc6ecdc6f104..b2c55eb09ca3 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -204,7 +204,7 @@ static struct drm_framebuffer *vc4_fb_create(struct drm_device *dev, - gem_obj = drm_gem_object_lookup(file_priv, - mode_cmd->handles[0]); - if (!gem_obj) { -- DRM_ERROR("Failed to look up GEM BO %d\n", -+ DRM_DEBUG("Failed to look up GEM BO %d\n", - mode_cmd->handles[0]); - return ERR_PTR(-ENOENT); - } -diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c -index 5dc19429d4ae..da3bfd53f0bd 100644 ---- a/drivers/gpu/drm/vc4/vc4_render_cl.c -+++ b/drivers/gpu/drm/vc4/vc4_render_cl.c -@@ -378,14 +378,14 @@ static int vc4_full_res_bounds_check(struct vc4_exec_info *exec, - u32 render_tiles_stride = DIV_ROUND_UP(exec->args->width, 32); - - if (surf->offset > obj->base.size) { -- DRM_ERROR("surface offset %d > BO size %zd\n", -+ DRM_DEBUG("surface offset %d > BO size %zd\n", - surf->offset, obj->base.size); - return -EINVAL; - } - - if ((obj->base.size - surf->offset) / VC4_TILE_BUFFER_SIZE < - render_tiles_stride * args->max_y_tile + args->max_x_tile) { -- DRM_ERROR("MSAA tile %d, %d out of bounds " -+ DRM_DEBUG("MSAA tile %d, %d out of bounds " - "(bo size %zd, offset %d).\n", - args->max_x_tile, args->max_y_tile, - obj->base.size, -@@ -401,7 +401,7 @@ static int vc4_rcl_msaa_surface_setup(struct vc4_exec_info *exec, - struct drm_vc4_submit_rcl_surface *surf) - { - if (surf->flags != 0 || surf->bits != 0) { -- DRM_ERROR("MSAA surface had nonzero flags/bits\n"); -+ DRM_DEBUG("MSAA surface had nonzero flags/bits\n"); - return -EINVAL; - } - -@@ -415,7 +415,7 @@ static int vc4_rcl_msaa_surface_setup(struct vc4_exec_info *exec, - exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; - - if (surf->offset & 0xf) { -- DRM_ERROR("MSAA write must be 16b aligned.\n"); -+ DRM_DEBUG("MSAA write must be 16b aligned.\n"); - return -EINVAL; - } - -@@ -437,7 +437,7 @@ static int vc4_rcl_surface_setup(struct vc4_exec_info *exec, - int ret; - - if (surf->flags & ~VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES) { -- DRM_ERROR("Extra flags set\n"); -+ DRM_DEBUG("Extra flags set\n"); - return -EINVAL; - } - -@@ -453,12 +453,12 @@ static int vc4_rcl_surface_setup(struct vc4_exec_info *exec, - - if (surf->flags & VC4_SUBMIT_RCL_SURFACE_READ_IS_FULL_RES) { - if (surf == &exec->args->zs_write) { -- DRM_ERROR("general zs write may not be a full-res.\n"); -+ DRM_DEBUG("general zs write may not be a full-res.\n"); - return -EINVAL; - } - - if (surf->bits != 0) { -- DRM_ERROR("load/store general bits set with " -+ DRM_DEBUG("load/store general bits set with " - "full res load/store.\n"); - return -EINVAL; - } -@@ -473,19 +473,19 @@ static int vc4_rcl_surface_setup(struct vc4_exec_info *exec, - if (surf->bits & ~(VC4_LOADSTORE_TILE_BUFFER_TILING_MASK | - VC4_LOADSTORE_TILE_BUFFER_BUFFER_MASK | - VC4_LOADSTORE_TILE_BUFFER_FORMAT_MASK)) { -- DRM_ERROR("Unknown bits in load/store: 0x%04x\n", -+ DRM_DEBUG("Unknown bits in load/store: 0x%04x\n", - surf->bits); - return -EINVAL; - } - - if (tiling > VC4_TILING_FORMAT_LT) { -- DRM_ERROR("Bad tiling format\n"); -+ DRM_DEBUG("Bad tiling format\n"); - return -EINVAL; - } - - if (buffer == VC4_LOADSTORE_TILE_BUFFER_ZS) { - if (format != 0) { -- DRM_ERROR("No color format should be set for ZS\n"); -+ DRM_DEBUG("No color format should be set for ZS\n"); - return -EINVAL; - } - cpp = 4; -@@ -499,16 +499,16 @@ static int vc4_rcl_surface_setup(struct vc4_exec_info *exec, - cpp = 4; - break; - default: -- DRM_ERROR("Bad tile buffer format\n"); -+ DRM_DEBUG("Bad tile buffer format\n"); - return -EINVAL; - } - } else { -- DRM_ERROR("Bad load/store buffer %d.\n", buffer); -+ DRM_DEBUG("Bad load/store buffer %d.\n", buffer); - return -EINVAL; - } - - if (surf->offset & 0xf) { -- DRM_ERROR("load/store buffer must be 16b aligned.\n"); -+ DRM_DEBUG("load/store buffer must be 16b aligned.\n"); - return -EINVAL; - } - -@@ -533,7 +533,7 @@ vc4_rcl_render_config_surface_setup(struct vc4_exec_info *exec, - int cpp; - - if (surf->flags != 0) { -- DRM_ERROR("No flags supported on render config.\n"); -+ DRM_DEBUG("No flags supported on render config.\n"); - return -EINVAL; - } - -@@ -541,7 +541,7 @@ vc4_rcl_render_config_surface_setup(struct vc4_exec_info *exec, - VC4_RENDER_CONFIG_FORMAT_MASK | - VC4_RENDER_CONFIG_MS_MODE_4X | - VC4_RENDER_CONFIG_DECIMATE_MODE_4X)) { -- DRM_ERROR("Unknown bits in render config: 0x%04x\n", -+ DRM_DEBUG("Unknown bits in render config: 0x%04x\n", - surf->bits); - return -EINVAL; - } -@@ -556,7 +556,7 @@ vc4_rcl_render_config_surface_setup(struct vc4_exec_info *exec, - exec->rcl_write_bo[exec->rcl_write_bo_count++] = *obj; - - if (tiling > VC4_TILING_FORMAT_LT) { -- DRM_ERROR("Bad tiling format\n"); -+ DRM_DEBUG("Bad tiling format\n"); - return -EINVAL; - } - -@@ -569,7 +569,7 @@ vc4_rcl_render_config_surface_setup(struct vc4_exec_info *exec, - cpp = 4; - break; - default: -- DRM_ERROR("Bad tile buffer format\n"); -+ DRM_DEBUG("Bad tile buffer format\n"); - return -EINVAL; - } - -@@ -590,7 +590,7 @@ int vc4_get_rcl(struct drm_device *dev, struct vc4_exec_info *exec) - - if (args->min_x_tile > args->max_x_tile || - args->min_y_tile > args->max_y_tile) { -- DRM_ERROR("Bad render tile set (%d,%d)-(%d,%d)\n", -+ DRM_DEBUG("Bad render tile set (%d,%d)-(%d,%d)\n", - args->min_x_tile, args->min_y_tile, - args->max_x_tile, args->max_y_tile); - return -EINVAL; -@@ -599,7 +599,7 @@ int vc4_get_rcl(struct drm_device *dev, struct vc4_exec_info *exec) - if (has_bin && - (args->max_x_tile > exec->bin_tiles_x || - args->max_y_tile > exec->bin_tiles_y)) { -- DRM_ERROR("Render tiles (%d,%d) outside of bin config " -+ DRM_DEBUG("Render tiles (%d,%d) outside of bin config " - "(%d,%d)\n", - args->max_x_tile, args->max_y_tile, - exec->bin_tiles_x, exec->bin_tiles_y); -@@ -642,7 +642,7 @@ int vc4_get_rcl(struct drm_device *dev, struct vc4_exec_info *exec) - */ - if (!setup.color_write && !setup.zs_write && - !setup.msaa_color_write && !setup.msaa_zs_write) { -- DRM_ERROR("RCL requires color or Z/S write\n"); -+ DRM_DEBUG("RCL requires color or Z/S write\n"); - return -EINVAL; - } - -diff --git a/drivers/gpu/drm/vc4/vc4_validate.c b/drivers/gpu/drm/vc4/vc4_validate.c -index 814b512c6b9a..2db485abb186 100644 ---- a/drivers/gpu/drm/vc4/vc4_validate.c -+++ b/drivers/gpu/drm/vc4/vc4_validate.c -@@ -109,7 +109,7 @@ vc4_use_bo(struct vc4_exec_info *exec, uint32_t hindex) - struct vc4_bo *bo; - - if (hindex >= exec->bo_count) { -- DRM_ERROR("BO index %d greater than BO count %d\n", -+ DRM_DEBUG("BO index %d greater than BO count %d\n", - hindex, exec->bo_count); - return NULL; - } -@@ -117,7 +117,7 @@ vc4_use_bo(struct vc4_exec_info *exec, uint32_t hindex) - bo = to_vc4_bo(&obj->base); - - if (bo->validated_shader) { -- DRM_ERROR("Trying to use shader BO as something other than " -+ DRM_DEBUG("Trying to use shader BO as something other than " - "a shader\n"); - return NULL; - } -@@ -172,7 +172,7 @@ vc4_check_tex_size(struct vc4_exec_info *exec, struct drm_gem_cma_object *fbo, - * our math. - */ - if (width > 4096 || height > 4096) { -- DRM_ERROR("Surface dimensions (%d,%d) too large", -+ DRM_DEBUG("Surface dimensions (%d,%d) too large", - width, height); - return false; - } -@@ -191,7 +191,7 @@ vc4_check_tex_size(struct vc4_exec_info *exec, struct drm_gem_cma_object *fbo, - aligned_height = round_up(height, utile_h); - break; - default: -- DRM_ERROR("buffer tiling %d unsupported\n", tiling_format); -+ DRM_DEBUG("buffer tiling %d unsupported\n", tiling_format); - return false; - } - -@@ -200,7 +200,7 @@ vc4_check_tex_size(struct vc4_exec_info *exec, struct drm_gem_cma_object *fbo, - - if (size + offset < size || - size + offset > fbo->base.size) { -- DRM_ERROR("Overflow in %dx%d (%dx%d) fbo size (%d + %d > %zd)\n", -+ DRM_DEBUG("Overflow in %dx%d (%dx%d) fbo size (%d + %d > %zd)\n", - width, height, - aligned_width, aligned_height, - size, offset, fbo->base.size); -@@ -214,7 +214,7 @@ static int - validate_flush(VALIDATE_ARGS) - { - if (!validate_bin_pos(exec, untrusted, exec->args->bin_cl_size - 1)) { -- DRM_ERROR("Bin CL must end with VC4_PACKET_FLUSH\n"); -+ DRM_DEBUG("Bin CL must end with VC4_PACKET_FLUSH\n"); - return -EINVAL; - } - exec->found_flush = true; -@@ -226,13 +226,13 @@ static int - validate_start_tile_binning(VALIDATE_ARGS) - { - if (exec->found_start_tile_binning_packet) { -- DRM_ERROR("Duplicate VC4_PACKET_START_TILE_BINNING\n"); -+ DRM_DEBUG("Duplicate VC4_PACKET_START_TILE_BINNING\n"); - return -EINVAL; - } - exec->found_start_tile_binning_packet = true; - - if (!exec->found_tile_binning_mode_config_packet) { -- DRM_ERROR("missing VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); -+ DRM_DEBUG("missing VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); - return -EINVAL; - } - -@@ -243,7 +243,7 @@ static int - validate_increment_semaphore(VALIDATE_ARGS) - { - if (!validate_bin_pos(exec, untrusted, exec->args->bin_cl_size - 2)) { -- DRM_ERROR("Bin CL must end with " -+ DRM_DEBUG("Bin CL must end with " - "VC4_PACKET_INCREMENT_SEMAPHORE\n"); - return -EINVAL; - } -@@ -264,7 +264,7 @@ validate_indexed_prim_list(VALIDATE_ARGS) - - /* Check overflow condition */ - if (exec->shader_state_count == 0) { -- DRM_ERROR("shader state must precede primitives\n"); -+ DRM_DEBUG("shader state must precede primitives\n"); - return -EINVAL; - } - shader_state = &exec->shader_state[exec->shader_state_count - 1]; -@@ -281,7 +281,7 @@ validate_indexed_prim_list(VALIDATE_ARGS) - - if (offset > ib->base.size || - (ib->base.size - offset) / index_size < length) { -- DRM_ERROR("IB access overflow (%d + %d*%d > %zd)\n", -+ DRM_DEBUG("IB access overflow (%d + %d*%d > %zd)\n", - offset, length, index_size, ib->base.size); - return -EINVAL; - } -@@ -301,13 +301,13 @@ validate_gl_array_primitive(VALIDATE_ARGS) - - /* Check overflow condition */ - if (exec->shader_state_count == 0) { -- DRM_ERROR("shader state must precede primitives\n"); -+ DRM_DEBUG("shader state must precede primitives\n"); - return -EINVAL; - } - shader_state = &exec->shader_state[exec->shader_state_count - 1]; - - if (length + base_index < length) { -- DRM_ERROR("primitive vertex count overflow\n"); -+ DRM_DEBUG("primitive vertex count overflow\n"); - return -EINVAL; - } - max_index = length + base_index - 1; -@@ -324,7 +324,7 @@ validate_gl_shader_state(VALIDATE_ARGS) - uint32_t i = exec->shader_state_count++; - - if (i >= exec->shader_state_size) { -- DRM_ERROR("More requests for shader states than declared\n"); -+ DRM_DEBUG("More requests for shader states than declared\n"); - return -EINVAL; - } - -@@ -332,7 +332,7 @@ validate_gl_shader_state(VALIDATE_ARGS) - exec->shader_state[i].max_index = 0; - - if (exec->shader_state[i].addr & ~0xf) { -- DRM_ERROR("high bits set in GL shader rec reference\n"); -+ DRM_DEBUG("high bits set in GL shader rec reference\n"); - return -EINVAL; - } - -@@ -356,7 +356,7 @@ validate_tile_binning_config(VALIDATE_ARGS) - int bin_slot; - - if (exec->found_tile_binning_mode_config_packet) { -- DRM_ERROR("Duplicate VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); -+ DRM_DEBUG("Duplicate VC4_PACKET_TILE_BINNING_MODE_CONFIG\n"); - return -EINVAL; - } - exec->found_tile_binning_mode_config_packet = true; -@@ -368,14 +368,14 @@ validate_tile_binning_config(VALIDATE_ARGS) - - if (exec->bin_tiles_x == 0 || - exec->bin_tiles_y == 0) { -- DRM_ERROR("Tile binning config of %dx%d too small\n", -+ DRM_DEBUG("Tile binning config of %dx%d too small\n", - exec->bin_tiles_x, exec->bin_tiles_y); - return -EINVAL; - } - - if (flags & (VC4_BIN_CONFIG_DB_NON_MS | - VC4_BIN_CONFIG_TILE_BUFFER_64BIT)) { -- DRM_ERROR("unsupported binning config flags 0x%02x\n", flags); -+ DRM_DEBUG("unsupported binning config flags 0x%02x\n", flags); - return -EINVAL; - } - -@@ -493,20 +493,20 @@ vc4_validate_bin_cl(struct drm_device *dev, - const struct cmd_info *info; - - if (cmd >= ARRAY_SIZE(cmd_info)) { -- DRM_ERROR("0x%08x: packet %d out of bounds\n", -+ DRM_DEBUG("0x%08x: packet %d out of bounds\n", - src_offset, cmd); - return -EINVAL; - } - - info = &cmd_info[cmd]; - if (!info->name) { -- DRM_ERROR("0x%08x: packet %d invalid\n", -+ DRM_DEBUG("0x%08x: packet %d invalid\n", - src_offset, cmd); - return -EINVAL; - } - - if (src_offset + info->len > len) { -- DRM_ERROR("0x%08x: packet %d (%s) length 0x%08x " -+ DRM_DEBUG("0x%08x: packet %d (%s) length 0x%08x " - "exceeds bounds (0x%08x)\n", - src_offset, cmd, info->name, info->len, - src_offset + len); -@@ -519,7 +519,7 @@ vc4_validate_bin_cl(struct drm_device *dev, - if (info->func && info->func(exec, - dst_pkt + 1, - src_pkt + 1)) { -- DRM_ERROR("0x%08x: packet %d (%s) failed to validate\n", -+ DRM_DEBUG("0x%08x: packet %d (%s) failed to validate\n", - src_offset, cmd, info->name); - return -EINVAL; - } -@@ -537,7 +537,7 @@ vc4_validate_bin_cl(struct drm_device *dev, - exec->ct0ea = exec->ct0ca + dst_offset; - - if (!exec->found_start_tile_binning_packet) { -- DRM_ERROR("Bin CL missing VC4_PACKET_START_TILE_BINNING\n"); -+ DRM_DEBUG("Bin CL missing VC4_PACKET_START_TILE_BINNING\n"); - return -EINVAL; - } - -@@ -549,7 +549,7 @@ vc4_validate_bin_cl(struct drm_device *dev, - * semaphore increment. - */ - if (!exec->found_increment_semaphore_packet || !exec->found_flush) { -- DRM_ERROR("Bin CL missing VC4_PACKET_INCREMENT_SEMAPHORE + " -+ DRM_DEBUG("Bin CL missing VC4_PACKET_INCREMENT_SEMAPHORE + " - "VC4_PACKET_FLUSH\n"); - return -EINVAL; - } -@@ -588,11 +588,11 @@ reloc_tex(struct vc4_exec_info *exec, - uint32_t remaining_size = tex->base.size - p0; - - if (p0 > tex->base.size - 4) { -- DRM_ERROR("UBO offset greater than UBO size\n"); -+ DRM_DEBUG("UBO offset greater than UBO size\n"); - goto fail; - } - if (p1 > remaining_size - 4) { -- DRM_ERROR("UBO clamp would allow reads " -+ DRM_DEBUG("UBO clamp would allow reads " - "outside of UBO\n"); - goto fail; - } -@@ -612,14 +612,14 @@ reloc_tex(struct vc4_exec_info *exec, - if (VC4_GET_FIELD(p3, VC4_TEX_P2_PTYPE) == - VC4_TEX_P2_PTYPE_CUBE_MAP_STRIDE) { - if (cube_map_stride) { -- DRM_ERROR("Cube map stride set twice\n"); -+ DRM_DEBUG("Cube map stride set twice\n"); - goto fail; - } - - cube_map_stride = p3 & VC4_TEX_P2_CMST_MASK; - } - if (!cube_map_stride) { -- DRM_ERROR("Cube map stride not set\n"); -+ DRM_DEBUG("Cube map stride not set\n"); - goto fail; - } - } -@@ -660,7 +660,7 @@ reloc_tex(struct vc4_exec_info *exec, - case VC4_TEXTURE_TYPE_RGBA64: - case VC4_TEXTURE_TYPE_YUV422R: - default: -- DRM_ERROR("Texture format %d unsupported\n", type); -+ DRM_DEBUG("Texture format %d unsupported\n", type); - goto fail; - } - utile_w = utile_width(cpp); -@@ -713,7 +713,7 @@ reloc_tex(struct vc4_exec_info *exec, - level_size = aligned_width * cpp * aligned_height; - - if (offset < level_size) { -- DRM_ERROR("Level %d (%dx%d -> %dx%d) size %db " -+ DRM_DEBUG("Level %d (%dx%d -> %dx%d) size %db " - "overflowed buffer bounds (offset %d)\n", - i, level_width, level_height, - aligned_width, aligned_height, -@@ -764,7 +764,7 @@ validate_gl_shader_rec(struct drm_device *dev, - - nr_relocs = ARRAY_SIZE(shader_reloc_offsets) + nr_attributes; - if (nr_relocs * 4 > exec->shader_rec_size) { -- DRM_ERROR("overflowed shader recs reading %d handles " -+ DRM_DEBUG("overflowed shader recs reading %d handles " - "from %d bytes left\n", - nr_relocs, exec->shader_rec_size); - return -EINVAL; -@@ -774,7 +774,7 @@ validate_gl_shader_rec(struct drm_device *dev, - exec->shader_rec_size -= nr_relocs * 4; - - if (packet_size > exec->shader_rec_size) { -- DRM_ERROR("overflowed shader recs copying %db packet " -+ DRM_DEBUG("overflowed shader recs copying %db packet " - "from %d bytes left\n", - packet_size, exec->shader_rec_size); - return -EINVAL; -@@ -794,7 +794,7 @@ validate_gl_shader_rec(struct drm_device *dev, - - for (i = 0; i < shader_reloc_count; i++) { - if (src_handles[i] > exec->bo_count) { -- DRM_ERROR("Shader handle %d too big\n", src_handles[i]); -+ DRM_DEBUG("Shader handle %d too big\n", src_handles[i]); - return -EINVAL; - } - -@@ -810,13 +810,13 @@ validate_gl_shader_rec(struct drm_device *dev, - - if (((*(uint16_t *)pkt_u & VC4_SHADER_FLAG_FS_SINGLE_THREAD) == 0) != - to_vc4_bo(&bo[0]->base)->validated_shader->is_threaded) { -- DRM_ERROR("Thread mode of CL and FS do not match\n"); -+ DRM_DEBUG("Thread mode of CL and FS do not match\n"); - return -EINVAL; - } - - if (to_vc4_bo(&bo[1]->base)->validated_shader->is_threaded || - to_vc4_bo(&bo[2]->base)->validated_shader->is_threaded) { -- DRM_ERROR("cs and vs cannot be threaded\n"); -+ DRM_DEBUG("cs and vs cannot be threaded\n"); - return -EINVAL; - } - -@@ -831,7 +831,7 @@ validate_gl_shader_rec(struct drm_device *dev, - *(uint32_t *)(pkt_v + o) = bo[i]->paddr + src_offset; - - if (src_offset != 0) { -- DRM_ERROR("Shaders must be at offset 0 of " -+ DRM_DEBUG("Shaders must be at offset 0 of " - "the BO.\n"); - return -EINVAL; - } -@@ -842,7 +842,7 @@ validate_gl_shader_rec(struct drm_device *dev, - - if (validated_shader->uniforms_src_size > - exec->uniforms_size) { -- DRM_ERROR("Uniforms src buffer overflow\n"); -+ DRM_DEBUG("Uniforms src buffer overflow\n"); - return -EINVAL; - } - -@@ -900,7 +900,7 @@ validate_gl_shader_rec(struct drm_device *dev, - - if (vbo->base.size < offset || - vbo->base.size - offset < attr_size) { -- DRM_ERROR("BO offset overflow (%d + %d > %zu)\n", -+ DRM_DEBUG("BO offset overflow (%d + %d > %zu)\n", - offset, attr_size, vbo->base.size); - return -EINVAL; - } -@@ -909,7 +909,7 @@ validate_gl_shader_rec(struct drm_device *dev, - max_index = ((vbo->base.size - offset - attr_size) / - stride); - if (state->max_index > max_index) { -- DRM_ERROR("primitives use index %d out of " -+ DRM_DEBUG("primitives use index %d out of " - "supplied %d\n", - state->max_index, max_index); - return -EINVAL; -diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c -index 0b2df5c6efb4..d3f15bf60900 100644 ---- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c -+++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c -@@ -200,7 +200,7 @@ check_tmu_write(struct vc4_validated_shader_info *validated_shader, - uint32_t clamp_reg, clamp_offset; - - if (sig == QPU_SIG_SMALL_IMM) { -- DRM_ERROR("direct TMU read used small immediate\n"); -+ DRM_DEBUG("direct TMU read used small immediate\n"); - return false; - } - -@@ -209,7 +209,7 @@ check_tmu_write(struct vc4_validated_shader_info *validated_shader, - */ - if (is_mul || - QPU_GET_FIELD(inst, QPU_OP_ADD) != QPU_A_ADD) { -- DRM_ERROR("direct TMU load wasn't an add\n"); -+ DRM_DEBUG("direct TMU load wasn't an add\n"); - return false; - } - -@@ -220,13 +220,13 @@ check_tmu_write(struct vc4_validated_shader_info *validated_shader, - */ - clamp_reg = raddr_add_a_to_live_reg_index(inst); - if (clamp_reg == ~0) { -- DRM_ERROR("direct TMU load wasn't clamped\n"); -+ DRM_DEBUG("direct TMU load wasn't clamped\n"); - return false; - } - - clamp_offset = validation_state->live_min_clamp_offsets[clamp_reg]; - if (clamp_offset == ~0) { -- DRM_ERROR("direct TMU load wasn't clamped\n"); -+ DRM_DEBUG("direct TMU load wasn't clamped\n"); - return false; - } - -@@ -238,7 +238,7 @@ check_tmu_write(struct vc4_validated_shader_info *validated_shader, - - if (!(add_b == QPU_MUX_A && raddr_a == QPU_R_UNIF) && - !(add_b == QPU_MUX_B && raddr_b == QPU_R_UNIF)) { -- DRM_ERROR("direct TMU load didn't add to a uniform\n"); -+ DRM_DEBUG("direct TMU load didn't add to a uniform\n"); - return false; - } - -@@ -246,14 +246,14 @@ check_tmu_write(struct vc4_validated_shader_info *validated_shader, - } else { - if (raddr_a == QPU_R_UNIF || (sig != QPU_SIG_SMALL_IMM && - raddr_b == QPU_R_UNIF)) { -- DRM_ERROR("uniform read in the same instruction as " -+ DRM_DEBUG("uniform read in the same instruction as " - "texture setup.\n"); - return false; - } - } - - if (validation_state->tmu_write_count[tmu] >= 4) { -- DRM_ERROR("TMU%d got too many parameters before dispatch\n", -+ DRM_DEBUG("TMU%d got too many parameters before dispatch\n", - tmu); - return false; - } -@@ -265,7 +265,7 @@ check_tmu_write(struct vc4_validated_shader_info *validated_shader, - */ - if (!is_direct) { - if (validation_state->needs_uniform_address_update) { -- DRM_ERROR("Texturing with undefined uniform address\n"); -+ DRM_DEBUG("Texturing with undefined uniform address\n"); - return false; - } - -@@ -336,35 +336,35 @@ validate_uniform_address_write(struct vc4_validated_shader_info *validated_shade - case QPU_SIG_LOAD_TMU1: - break; - default: -- DRM_ERROR("uniforms address change must be " -+ DRM_DEBUG("uniforms address change must be " - "normal math\n"); - return false; - } - - if (is_mul || QPU_GET_FIELD(inst, QPU_OP_ADD) != QPU_A_ADD) { -- DRM_ERROR("Uniform address reset must be an ADD.\n"); -+ DRM_DEBUG("Uniform address reset must be an ADD.\n"); - return false; - } - - if (QPU_GET_FIELD(inst, QPU_COND_ADD) != QPU_COND_ALWAYS) { -- DRM_ERROR("Uniform address reset must be unconditional.\n"); -+ DRM_DEBUG("Uniform address reset must be unconditional.\n"); - return false; - } - - if (QPU_GET_FIELD(inst, QPU_PACK) != QPU_PACK_A_NOP && - !(inst & QPU_PM)) { -- DRM_ERROR("No packing allowed on uniforms reset\n"); -+ DRM_DEBUG("No packing allowed on uniforms reset\n"); - return false; - } - - if (add_lri == -1) { -- DRM_ERROR("First argument of uniform address write must be " -+ DRM_DEBUG("First argument of uniform address write must be " - "an immediate value.\n"); - return false; - } - - if (validation_state->live_immediates[add_lri] != expected_offset) { -- DRM_ERROR("Resetting uniforms with offset %db instead of %db\n", -+ DRM_DEBUG("Resetting uniforms with offset %db instead of %db\n", - validation_state->live_immediates[add_lri], - expected_offset); - return false; -@@ -372,7 +372,7 @@ validate_uniform_address_write(struct vc4_validated_shader_info *validated_shade - - if (!(add_b == QPU_MUX_A && raddr_a == QPU_R_UNIF) && - !(add_b == QPU_MUX_B && raddr_b == QPU_R_UNIF)) { -- DRM_ERROR("Second argument of uniform address write must be " -+ DRM_DEBUG("Second argument of uniform address write must be " - "a uniform.\n"); - return false; - } -@@ -417,7 +417,7 @@ check_reg_write(struct vc4_validated_shader_info *validated_shader, - switch (waddr) { - case QPU_W_UNIFORMS_ADDRESS: - if (is_b) { -- DRM_ERROR("relative uniforms address change " -+ DRM_DEBUG("relative uniforms address change " - "unsupported\n"); - return false; - } -@@ -452,11 +452,11 @@ check_reg_write(struct vc4_validated_shader_info *validated_shader, - /* XXX: I haven't thought about these, so don't support them - * for now. - */ -- DRM_ERROR("Unsupported waddr %d\n", waddr); -+ DRM_DEBUG("Unsupported waddr %d\n", waddr); - return false; - - case QPU_W_VPM_ADDR: -- DRM_ERROR("General VPM DMA unsupported\n"); -+ DRM_DEBUG("General VPM DMA unsupported\n"); - return false; - - case QPU_W_VPM: -@@ -559,7 +559,7 @@ check_instruction_writes(struct vc4_validated_shader_info *validated_shader, - bool ok; - - if (is_tmu_write(waddr_add) && is_tmu_write(waddr_mul)) { -- DRM_ERROR("ADD and MUL both set up textures\n"); -+ DRM_DEBUG("ADD and MUL both set up textures\n"); - return false; - } - -@@ -588,7 +588,7 @@ check_branch(uint64_t inst, - * there's no need for it. - */ - if (waddr_add != QPU_W_NOP || waddr_mul != QPU_W_NOP) { -- DRM_ERROR("branch instruction at %d wrote a register.\n", -+ DRM_DEBUG("branch instruction at %d wrote a register.\n", - validation_state->ip); - return false; - } -@@ -614,7 +614,7 @@ check_instruction_reads(struct vc4_validated_shader_info *validated_shader, - validated_shader->uniforms_size += 4; - - if (validation_state->needs_uniform_address_update) { -- DRM_ERROR("Uniform read with undefined uniform " -+ DRM_DEBUG("Uniform read with undefined uniform " - "address\n"); - return false; - } -@@ -660,19 +660,19 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - continue; - - if (ip - last_branch < 4) { -- DRM_ERROR("Branch at %d during delay slots\n", ip); -+ DRM_DEBUG("Branch at %d during delay slots\n", ip); - return false; - } - last_branch = ip; - - if (inst & QPU_BRANCH_REG) { -- DRM_ERROR("branching from register relative " -+ DRM_DEBUG("branching from register relative " - "not supported\n"); - return false; - } - - if (!(inst & QPU_BRANCH_REL)) { -- DRM_ERROR("relative branching required\n"); -+ DRM_DEBUG("relative branching required\n"); - return false; - } - -@@ -682,13 +682,13 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - * end of the shader object. - */ - if (branch_imm % sizeof(inst) != 0) { -- DRM_ERROR("branch target not aligned\n"); -+ DRM_DEBUG("branch target not aligned\n"); - return false; - } - - branch_target_ip = after_delay_ip + (branch_imm >> 3); - if (branch_target_ip >= validation_state->max_ip) { -- DRM_ERROR("Branch at %d outside of shader (ip %d/%d)\n", -+ DRM_DEBUG("Branch at %d outside of shader (ip %d/%d)\n", - ip, branch_target_ip, - validation_state->max_ip); - return false; -@@ -699,7 +699,7 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - * the shader. - */ - if (after_delay_ip >= validation_state->max_ip) { -- DRM_ERROR("Branch at %d continues past shader end " -+ DRM_DEBUG("Branch at %d continues past shader end " - "(%d/%d)\n", - ip, after_delay_ip, validation_state->max_ip); - return false; -@@ -709,7 +709,7 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - } - - if (max_branch_target > validation_state->max_ip - 3) { -- DRM_ERROR("Branch landed after QPU_SIG_PROG_END"); -+ DRM_DEBUG("Branch landed after QPU_SIG_PROG_END"); - return false; - } - -@@ -750,7 +750,7 @@ vc4_handle_branch_target(struct vc4_shader_validation_state *validation_state) - return true; - - if (texturing_in_progress(validation_state)) { -- DRM_ERROR("Branch target landed during TMU setup\n"); -+ DRM_DEBUG("Branch target landed during TMU setup\n"); - return false; - } - -@@ -837,7 +837,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) - case QPU_SIG_LAST_THREAD_SWITCH: - if (!check_instruction_writes(validated_shader, - &validation_state)) { -- DRM_ERROR("Bad write at ip %d\n", ip); -+ DRM_DEBUG("Bad write at ip %d\n", ip); - goto fail; - } - -@@ -855,7 +855,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) - validated_shader->is_threaded = true; - - if (ip < last_thread_switch_ip + 3) { -- DRM_ERROR("Thread switch too soon after " -+ DRM_DEBUG("Thread switch too soon after " - "last switch at ip %d\n", ip); - goto fail; - } -@@ -867,7 +867,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) - case QPU_SIG_LOAD_IMM: - if (!check_instruction_writes(validated_shader, - &validation_state)) { -- DRM_ERROR("Bad LOAD_IMM write at ip %d\n", ip); -+ DRM_DEBUG("Bad LOAD_IMM write at ip %d\n", ip); - goto fail; - } - break; -@@ -878,14 +878,14 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) - goto fail; - - if (ip < last_thread_switch_ip + 3) { -- DRM_ERROR("Branch in thread switch at ip %d", -+ DRM_DEBUG("Branch in thread switch at ip %d", - ip); - goto fail; - } - - break; - default: -- DRM_ERROR("Unsupported QPU signal %d at " -+ DRM_DEBUG("Unsupported QPU signal %d at " - "instruction %d\n", sig, ip); - goto fail; - } -@@ -898,7 +898,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) - } - - if (ip == validation_state.max_ip) { -- DRM_ERROR("shader failed to terminate before " -+ DRM_DEBUG("shader failed to terminate before " - "shader BO end at %zd\n", - shader_obj->base.size); - goto fail; -@@ -907,7 +907,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) - /* Might corrupt other thread */ - if (validated_shader->is_threaded && - validation_state.all_registers_used) { -- DRM_ERROR("Shader uses threading, but uses the upper " -+ DRM_DEBUG("Shader uses threading, but uses the upper " - "half of the registers, too\n"); - goto fail; - } --- -2.13.5 - -From 28b369f5abc790f56e668869d88f261ca7a27c55 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 8 Aug 2017 13:56:05 -0700 -Subject: [PATCH 2/6] drm/vc4: Fix leak of HDMI EDID - -We don't keep a pointer to it around anywhere, so it's our job to free -it. - -Cc: Stefan Wahren -Link: https://github.com/anholt/linux/issues/101 -Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") -Signed-off-by: Eric Anholt -Link: https://patchwork.freedesktop.org/patch/msgid/20170808205605.4432-1-eric@anholt.net -Reviewed-by: Daniel Vetter -Tested-by: Stefan Wahren ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c -index ed63d4e85762..f7803fd7f47c 100644 ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -260,6 +260,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector) - drm_mode_connector_update_edid_property(connector, edid); - ret = drm_add_edid_modes(connector, edid); - drm_edid_to_eld(connector, edid); -+ kfree(edid); - - return ret; - } --- -2.13.5 - -From 3b688b6d347f777a8e86165decc33198b063b8c0 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 25 Jul 2017 11:27:16 -0700 -Subject: [PATCH 3/6] drm/vc4: Start using u64_to_user_ptr. - -Chris Wilson pointed out this little cleanup in a review of new code, -so let's fix up the code I was copying from. - -Signed-off-by: Eric Anholt -Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-1-eric@anholt.net -Reviewed-by: Daniel Vetter ---- - drivers/gpu/drm/vc4/vc4_gem.c | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index a3e45e67f417..8b551bc630c4 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -119,7 +119,7 @@ vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, - bo_state[i].size = vc4_bo->base.base.size; - } - -- if (copy_to_user((void __user *)(uintptr_t)get_state->bo, -+ if (copy_to_user(u64_to_user_ptr(get_state->bo), - bo_state, - state->bo_count * sizeof(*bo_state))) - ret = -EFAULT; -@@ -678,8 +678,7 @@ vc4_cl_lookup_bos(struct drm_device *dev, - goto fail; - } - -- if (copy_from_user(handles, -- (void __user *)(uintptr_t)args->bo_handles, -+ if (copy_from_user(handles, u64_to_user_ptr(args->bo_handles), - exec->bo_count * sizeof(uint32_t))) { - ret = -EFAULT; - DRM_ERROR("Failed to copy in GEM handles\n"); -@@ -755,21 +754,21 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) - exec->shader_state_size = args->shader_rec_count; - - if (copy_from_user(bin, -- (void __user *)(uintptr_t)args->bin_cl, -+ u64_to_user_ptr(args->bin_cl), - args->bin_cl_size)) { - ret = -EFAULT; - goto fail; - } - - if (copy_from_user(exec->shader_rec_u, -- (void __user *)(uintptr_t)args->shader_rec, -+ u64_to_user_ptr(args->shader_rec), - args->shader_rec_size)) { - ret = -EFAULT; - goto fail; - } - - if (copy_from_user(exec->uniforms_u, -- (void __user *)(uintptr_t)args->uniforms, -+ u64_to_user_ptr(args->uniforms), - args->uniforms_size)) { - ret = -EFAULT; - goto fail; --- -2.13.5 - -From da81d76bce216c160d2924a52e362b160bbb6ca1 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Tue, 25 Jul 2017 11:27:17 -0700 -Subject: [PATCH 4/6] drm/vc4: Add an ioctl for labeling GEM BOs for summary - stats - -This has proven immensely useful for debugging memory leaks and -overallocation (which is a rather serious concern on the platform, -given that we typically run at about 256MB of CMA out of up to 1GB -total memory, with framebuffers that are about 8MB ecah). - -The state of the art without this is to dump debug logs from every GL -application, guess as to kernel allocations based on bo_stats, and try -to merge that all together into a global picture of memory allocation -state. With this, you can add a couple of calls to the debug build of -the 3D driver and get a pretty detailed view of GPU memory usage from -/debug/dri/0/bo_stats (or when we debug print to dmesg on allocation -failure). - -The Mesa side currently labels at the gallium resource level (so you -see that a 1920x20 pixmap has been created, presumably for the window -system panel), but we could extend that to be even more useful with -glObjectLabel() names being sent all the way down to the kernel. - -(partial) example of sorted debugfs output with Mesa labeling all -resources: - - kernel BO cache: 16392kb BOs (3) - tiling shadow 1920x1080: 8160kb BOs (1) - resource 1920x1080@32/0: 8160kb BOs (1) -scanout resource 1920x1080@32/0: 8100kb BOs (1) - kernel: 8100kb BOs (1) - -v2: Use strndup_user(), use lockdep assertion instead of just a - comment, fix an array[-1] reference, extend comment about name - freeing. - -Signed-off-by: Eric Anholt -Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-2-eric@anholt.net -Reviewed-by: Chris Wilson ---- - drivers/gpu/drm/vc4/vc4_bo.c | 258 ++++++++++++++++++++++++++++-------- - drivers/gpu/drm/vc4/vc4_drv.c | 8 +- - drivers/gpu/drm/vc4/vc4_drv.h | 39 +++++- - drivers/gpu/drm/vc4/vc4_gem.c | 2 +- - drivers/gpu/drm/vc4/vc4_render_cl.c | 2 +- - drivers/gpu/drm/vc4/vc4_v3d.c | 3 +- - include/uapi/drm/vc4_drm.h | 11 ++ - 7 files changed, 257 insertions(+), 66 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c -index ede80199001d..27c4a927311f 100644 ---- a/drivers/gpu/drm/vc4/vc4_bo.c -+++ b/drivers/gpu/drm/vc4/vc4_bo.c -@@ -24,21 +24,35 @@ - #include "vc4_drv.h" - #include "uapi/drm/vc4_drm.h" - -+static const char * const bo_type_names[] = { -+ "kernel", -+ "V3D", -+ "V3D shader", -+ "dumb", -+ "binner", -+ "RCL", -+ "BCL", -+ "kernel BO cache", -+}; -+ -+static bool is_user_label(int label) -+{ -+ return label >= VC4_BO_TYPE_COUNT; -+} -+ - static void vc4_bo_stats_dump(struct vc4_dev *vc4) - { -- DRM_INFO("num bos allocated: %d\n", -- vc4->bo_stats.num_allocated); -- DRM_INFO("size bos allocated: %dkb\n", -- vc4->bo_stats.size_allocated / 1024); -- DRM_INFO("num bos used: %d\n", -- vc4->bo_stats.num_allocated - vc4->bo_stats.num_cached); -- DRM_INFO("size bos used: %dkb\n", -- (vc4->bo_stats.size_allocated - -- vc4->bo_stats.size_cached) / 1024); -- DRM_INFO("num bos cached: %d\n", -- vc4->bo_stats.num_cached); -- DRM_INFO("size bos cached: %dkb\n", -- vc4->bo_stats.size_cached / 1024); -+ int i; -+ -+ for (i = 0; i < vc4->num_labels; i++) { -+ if (!vc4->bo_labels[i].num_allocated) -+ continue; -+ -+ DRM_INFO("%30s: %6dkb BOs (%d)\n", -+ vc4->bo_labels[i].name, -+ vc4->bo_labels[i].size_allocated / 1024, -+ vc4->bo_labels[i].num_allocated); -+ } - } - - #ifdef CONFIG_DEBUG_FS -@@ -47,30 +61,103 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *unused) - struct drm_info_node *node = (struct drm_info_node *)m->private; - struct drm_device *dev = node->minor->dev; - struct vc4_dev *vc4 = to_vc4_dev(dev); -- struct vc4_bo_stats stats; -+ int i; - -- /* Take a snapshot of the current stats with the lock held. */ - mutex_lock(&vc4->bo_lock); -- stats = vc4->bo_stats; -+ for (i = 0; i < vc4->num_labels; i++) { -+ if (!vc4->bo_labels[i].num_allocated) -+ continue; -+ -+ seq_printf(m, "%30s: %6dkb BOs (%d)\n", -+ vc4->bo_labels[i].name, -+ vc4->bo_labels[i].size_allocated / 1024, -+ vc4->bo_labels[i].num_allocated); -+ } - mutex_unlock(&vc4->bo_lock); - -- seq_printf(m, "num bos allocated: %d\n", -- stats.num_allocated); -- seq_printf(m, "size bos allocated: %dkb\n", -- stats.size_allocated / 1024); -- seq_printf(m, "num bos used: %d\n", -- stats.num_allocated - stats.num_cached); -- seq_printf(m, "size bos used: %dkb\n", -- (stats.size_allocated - stats.size_cached) / 1024); -- seq_printf(m, "num bos cached: %d\n", -- stats.num_cached); -- seq_printf(m, "size bos cached: %dkb\n", -- stats.size_cached / 1024); -- - return 0; - } - #endif - -+/* Takes ownership of *name and returns the appropriate slot for it in -+ * the bo_labels[] array, extending it as necessary. -+ * -+ * This is inefficient and could use a hash table instead of walking -+ * an array and strcmp()ing. However, the assumption is that user -+ * labeling will be infrequent (scanout buffers and other long-lived -+ * objects, or debug driver builds), so we can live with it for now. -+ */ -+static int vc4_get_user_label(struct vc4_dev *vc4, const char *name) -+{ -+ int i; -+ int free_slot = -1; -+ -+ for (i = 0; i < vc4->num_labels; i++) { -+ if (!vc4->bo_labels[i].name) { -+ free_slot = i; -+ } else if (strcmp(vc4->bo_labels[i].name, name) == 0) { -+ kfree(name); -+ return i; -+ } -+ } -+ -+ if (free_slot != -1) { -+ WARN_ON(vc4->bo_labels[free_slot].num_allocated != 0); -+ vc4->bo_labels[free_slot].name = name; -+ return free_slot; -+ } else { -+ u32 new_label_count = vc4->num_labels + 1; -+ struct vc4_label *new_labels = -+ krealloc(vc4->bo_labels, -+ new_label_count * sizeof(*new_labels), -+ GFP_KERNEL); -+ -+ if (!new_labels) { -+ kfree(name); -+ return -1; -+ } -+ -+ free_slot = vc4->num_labels; -+ vc4->bo_labels = new_labels; -+ vc4->num_labels = new_label_count; -+ -+ vc4->bo_labels[free_slot].name = name; -+ vc4->bo_labels[free_slot].num_allocated = 0; -+ vc4->bo_labels[free_slot].size_allocated = 0; -+ -+ return free_slot; -+ } -+} -+ -+static void vc4_bo_set_label(struct drm_gem_object *gem_obj, int label) -+{ -+ struct vc4_bo *bo = to_vc4_bo(gem_obj); -+ struct vc4_dev *vc4 = to_vc4_dev(gem_obj->dev); -+ -+ lockdep_assert_held(&vc4->bo_lock); -+ -+ if (label != -1) { -+ vc4->bo_labels[label].num_allocated++; -+ vc4->bo_labels[label].size_allocated += gem_obj->size; -+ } -+ -+ vc4->bo_labels[bo->label].num_allocated--; -+ vc4->bo_labels[bo->label].size_allocated -= gem_obj->size; -+ -+ if (vc4->bo_labels[bo->label].num_allocated == 0 && -+ is_user_label(bo->label)) { -+ /* Free user BO label slots on last unreference. -+ * Slots are just where we track the stats for a given -+ * name, and once a name is unused we can reuse that -+ * slot. -+ */ -+ kfree(vc4->bo_labels[bo->label].name); -+ vc4->bo_labels[bo->label].name = NULL; -+ } -+ -+ bo->label = label; -+} -+ - static uint32_t bo_page_index(size_t size) - { - return (size / PAGE_SIZE) - 1; -@@ -80,7 +167,8 @@ static uint32_t bo_page_index(size_t size) - static void vc4_bo_destroy(struct vc4_bo *bo) - { - struct drm_gem_object *obj = &bo->base.base; -- struct vc4_dev *vc4 = to_vc4_dev(obj->dev); -+ -+ vc4_bo_set_label(obj, -1); - - if (bo->validated_shader) { - kfree(bo->validated_shader->texture_samples); -@@ -88,9 +176,6 @@ static void vc4_bo_destroy(struct vc4_bo *bo) - bo->validated_shader = NULL; - } - -- vc4->bo_stats.num_allocated--; -- vc4->bo_stats.size_allocated -= obj->size; -- - reservation_object_fini(&bo->_resv); - - drm_gem_cma_free_object(obj); -@@ -99,12 +184,6 @@ static void vc4_bo_destroy(struct vc4_bo *bo) - /* Must be called with bo_lock held. */ - static void vc4_bo_remove_from_cache(struct vc4_bo *bo) - { -- struct drm_gem_object *obj = &bo->base.base; -- struct vc4_dev *vc4 = to_vc4_dev(obj->dev); -- -- vc4->bo_stats.num_cached--; -- vc4->bo_stats.size_cached -= obj->size; -- - list_del(&bo->unref_head); - list_del(&bo->size_head); - } -@@ -165,7 +244,8 @@ static void vc4_bo_cache_purge(struct drm_device *dev) - } - - static struct vc4_bo *vc4_bo_get_from_cache(struct drm_device *dev, -- uint32_t size) -+ uint32_t size, -+ enum vc4_kernel_bo_type type) - { - struct vc4_dev *vc4 = to_vc4_dev(dev); - uint32_t page_index = bo_page_index(size); -@@ -186,6 +266,8 @@ static struct vc4_bo *vc4_bo_get_from_cache(struct drm_device *dev, - kref_init(&bo->base.base.refcount); - - out: -+ if (bo) -+ vc4_bo_set_label(&bo->base.base, type); - mutex_unlock(&vc4->bo_lock); - return bo; - } -@@ -208,8 +290,9 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) - return ERR_PTR(-ENOMEM); - - mutex_lock(&vc4->bo_lock); -- vc4->bo_stats.num_allocated++; -- vc4->bo_stats.size_allocated += size; -+ bo->label = VC4_BO_TYPE_KERNEL; -+ vc4->bo_labels[VC4_BO_TYPE_KERNEL].num_allocated++; -+ vc4->bo_labels[VC4_BO_TYPE_KERNEL].size_allocated += size; - mutex_unlock(&vc4->bo_lock); - bo->resv = &bo->_resv; - reservation_object_init(bo->resv); -@@ -218,7 +301,7 @@ struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size) - } - - struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size, -- bool allow_unzeroed) -+ bool allow_unzeroed, enum vc4_kernel_bo_type type) - { - size_t size = roundup(unaligned_size, PAGE_SIZE); - struct vc4_dev *vc4 = to_vc4_dev(dev); -@@ -229,7 +312,7 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size, - return ERR_PTR(-EINVAL); - - /* First, try to get a vc4_bo from the kernel BO cache. */ -- bo = vc4_bo_get_from_cache(dev, size); -+ bo = vc4_bo_get_from_cache(dev, size, type); - if (bo) { - if (!allow_unzeroed) - memset(bo->base.vaddr, 0, bo->base.base.size); -@@ -251,7 +334,13 @@ struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t unaligned_size, - return ERR_PTR(-ENOMEM); - } - } -- return to_vc4_bo(&cma_obj->base); -+ bo = to_vc4_bo(&cma_obj->base); -+ -+ mutex_lock(&vc4->bo_lock); -+ vc4_bo_set_label(&cma_obj->base, type); -+ mutex_unlock(&vc4->bo_lock); -+ -+ return bo; - } - - int vc4_dumb_create(struct drm_file *file_priv, -@@ -268,7 +357,7 @@ int vc4_dumb_create(struct drm_file *file_priv, - if (args->size < args->pitch * args->height) - args->size = args->pitch * args->height; - -- bo = vc4_bo_create(dev, args->size, false); -+ bo = vc4_bo_create(dev, args->size, false, VC4_BO_TYPE_DUMB); - if (IS_ERR(bo)) - return PTR_ERR(bo); - -@@ -348,8 +437,7 @@ void vc4_free_object(struct drm_gem_object *gem_bo) - list_add(&bo->size_head, cache_list); - list_add(&bo->unref_head, &vc4->bo_cache.time_list); - -- vc4->bo_stats.num_cached++; -- vc4->bo_stats.size_cached += gem_bo->size; -+ vc4_bo_set_label(&bo->base.base, VC4_BO_TYPE_KERNEL_CACHE); - - vc4_bo_cache_free_old(dev); - -@@ -483,7 +571,7 @@ int vc4_create_bo_ioctl(struct drm_device *dev, void *data, - * We can't allocate from the BO cache, because the BOs don't - * get zeroed, and that might leak data between users. - */ -- bo = vc4_bo_create(dev, args->size, false); -+ bo = vc4_bo_create(dev, args->size, false, VC4_BO_TYPE_V3D); - if (IS_ERR(bo)) - return PTR_ERR(bo); - -@@ -536,7 +624,7 @@ vc4_create_shader_bo_ioctl(struct drm_device *dev, void *data, - return -EINVAL; - } - -- bo = vc4_bo_create(dev, args->size, true); -+ bo = vc4_bo_create(dev, args->size, true, VC4_BO_TYPE_V3D_SHADER); - if (IS_ERR(bo)) - return PTR_ERR(bo); - -@@ -651,9 +739,24 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, - return 0; - } - --void vc4_bo_cache_init(struct drm_device *dev) -+int vc4_bo_cache_init(struct drm_device *dev) - { - struct vc4_dev *vc4 = to_vc4_dev(dev); -+ int i; -+ -+ /* Create the initial set of BO labels that the kernel will -+ * use. This lets us avoid a bunch of string reallocation in -+ * the kernel's draw and BO allocation paths. -+ */ -+ vc4->bo_labels = kcalloc(VC4_BO_TYPE_COUNT, sizeof(*vc4->bo_labels), -+ GFP_KERNEL); -+ if (!vc4->bo_labels) -+ return -ENOMEM; -+ vc4->num_labels = VC4_BO_TYPE_COUNT; -+ -+ BUILD_BUG_ON(ARRAY_SIZE(bo_type_names) != VC4_BO_TYPE_COUNT); -+ for (i = 0; i < VC4_BO_TYPE_COUNT; i++) -+ vc4->bo_labels[i].name = bo_type_names[i]; - - mutex_init(&vc4->bo_lock); - -@@ -663,19 +766,66 @@ void vc4_bo_cache_init(struct drm_device *dev) - setup_timer(&vc4->bo_cache.time_timer, - vc4_bo_cache_time_timer, - (unsigned long)dev); -+ -+ return 0; - } - - void vc4_bo_cache_destroy(struct drm_device *dev) - { - struct vc4_dev *vc4 = to_vc4_dev(dev); -+ int i; - - del_timer(&vc4->bo_cache.time_timer); - cancel_work_sync(&vc4->bo_cache.time_work); - - vc4_bo_cache_purge(dev); - -- if (vc4->bo_stats.num_allocated) { -- DRM_ERROR("Destroying BO cache while BOs still allocated:\n"); -- vc4_bo_stats_dump(vc4); -+ for (i = 0; i < vc4->num_labels; i++) { -+ if (vc4->bo_labels[i].num_allocated) { -+ DRM_ERROR("Destroying BO cache with %d %s " -+ "BOs still allocated\n", -+ vc4->bo_labels[i].num_allocated, -+ vc4->bo_labels[i].name); -+ } -+ -+ if (is_user_label(i)) -+ kfree(vc4->bo_labels[i].name); - } -+ kfree(vc4->bo_labels); -+} -+ -+int vc4_label_bo_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv) -+{ -+ struct vc4_dev *vc4 = to_vc4_dev(dev); -+ struct drm_vc4_label_bo *args = data; -+ char *name; -+ struct drm_gem_object *gem_obj; -+ int ret = 0, label; -+ -+ if (!args->len) -+ return -EINVAL; -+ -+ name = strndup_user(u64_to_user_ptr(args->name), args->len + 1); -+ if (IS_ERR(name)) -+ return PTR_ERR(name); -+ -+ gem_obj = drm_gem_object_lookup(file_priv, args->handle); -+ if (!gem_obj) { -+ DRM_ERROR("Failed to look up GEM BO %d\n", args->handle); -+ kfree(name); -+ return -ENOENT; -+ } -+ -+ mutex_lock(&vc4->bo_lock); -+ label = vc4_get_user_label(vc4, name); -+ if (label != -1) -+ vc4_bo_set_label(gem_obj, label); -+ else -+ ret = -ENOMEM; -+ mutex_unlock(&vc4->bo_lock); -+ -+ drm_gem_object_unreference_unlocked(gem_obj); -+ -+ return ret; - } -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index c6b487c3d2b7..75c1f50a7b5d 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -140,6 +140,7 @@ static const struct drm_ioctl_desc vc4_drm_ioctls[] = { - DRM_IOCTL_DEF_DRV(VC4_GET_PARAM, vc4_get_param_ioctl, DRM_RENDER_ALLOW), - DRM_IOCTL_DEF_DRV(VC4_SET_TILING, vc4_set_tiling_ioctl, DRM_RENDER_ALLOW), - DRM_IOCTL_DEF_DRV(VC4_GET_TILING, vc4_get_tiling_ioctl, DRM_RENDER_ALLOW), -+ DRM_IOCTL_DEF_DRV(VC4_LABEL_BO, vc4_label_bo_ioctl, DRM_RENDER_ALLOW), - }; - - static struct drm_driver vc4_drm_driver = { -@@ -257,7 +258,9 @@ static int vc4_drm_bind(struct device *dev) - vc4->dev = drm; - drm->dev_private = vc4; - -- vc4_bo_cache_init(drm); -+ ret = vc4_bo_cache_init(drm); -+ if (ret) -+ goto dev_unref; - - drm_mode_config_init(drm); - -@@ -281,8 +284,9 @@ static int vc4_drm_bind(struct device *dev) - component_unbind_all(dev, drm); - gem_destroy: - vc4_gem_destroy(drm); -- drm_dev_unref(drm); - vc4_bo_cache_destroy(drm); -+dev_unref: -+ drm_dev_unref(drm); - return ret; - } - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index df22698d62ee..75d9957cb76d 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -11,6 +11,24 @@ - #include - #include - -+/* Don't forget to update vc4_bo.c: bo_type_names[] when adding to -+ * this. -+ */ -+enum vc4_kernel_bo_type { -+ /* Any kernel allocation (gem_create_object hook) before it -+ * gets another type set. -+ */ -+ VC4_BO_TYPE_KERNEL, -+ VC4_BO_TYPE_V3D, -+ VC4_BO_TYPE_V3D_SHADER, -+ VC4_BO_TYPE_DUMB, -+ VC4_BO_TYPE_BIN, -+ VC4_BO_TYPE_RCL, -+ VC4_BO_TYPE_BCL, -+ VC4_BO_TYPE_KERNEL_CACHE, -+ VC4_BO_TYPE_COUNT -+}; -+ - struct vc4_dev { - struct drm_device *dev; - -@@ -46,14 +64,14 @@ struct vc4_dev { - struct timer_list time_timer; - } bo_cache; - -- struct vc4_bo_stats { -+ u32 num_labels; -+ struct vc4_label { -+ const char *name; - u32 num_allocated; - u32 size_allocated; -- u32 num_cached; -- u32 size_cached; -- } bo_stats; -+ } *bo_labels; - -- /* Protects bo_cache and the BO stats. */ -+ /* Protects bo_cache and bo_labels. */ - struct mutex bo_lock; - - uint64_t dma_fence_context; -@@ -169,6 +187,11 @@ struct vc4_bo { - /* normally (resv == &_resv) except for imported bo's */ - struct reservation_object *resv; - struct reservation_object _resv; -+ -+ /* One of enum vc4_kernel_bo_type, or VC4_BO_TYPE_COUNT + i -+ * for user-allocated labels. -+ */ -+ int label; - }; - - static inline struct vc4_bo * -@@ -460,7 +483,7 @@ struct vc4_validated_shader_info { - struct drm_gem_object *vc4_create_object(struct drm_device *dev, size_t size); - void vc4_free_object(struct drm_gem_object *gem_obj); - struct vc4_bo *vc4_bo_create(struct drm_device *dev, size_t size, -- bool from_cache); -+ bool from_cache, enum vc4_kernel_bo_type type); - int vc4_dumb_create(struct drm_file *file_priv, - struct drm_device *dev, - struct drm_mode_create_dumb *args); -@@ -478,6 +501,8 @@ int vc4_get_tiling_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv); - int vc4_get_hang_state_ioctl(struct drm_device *dev, void *data, - struct drm_file *file_priv); -+int vc4_label_bo_ioctl(struct drm_device *dev, void *data, -+ struct drm_file *file_priv); - int vc4_mmap(struct file *filp, struct vm_area_struct *vma); - struct reservation_object *vc4_prime_res_obj(struct drm_gem_object *obj); - int vc4_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma); -@@ -485,7 +510,7 @@ struct drm_gem_object *vc4_prime_import_sg_table(struct drm_device *dev, - struct dma_buf_attachment *attach, - struct sg_table *sgt); - void *vc4_prime_vmap(struct drm_gem_object *obj); --void vc4_bo_cache_init(struct drm_device *dev); -+int vc4_bo_cache_init(struct drm_device *dev); - void vc4_bo_cache_destroy(struct drm_device *dev); - int vc4_bo_stats_debugfs(struct seq_file *m, void *arg); - -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index 8b551bc630c4..80f1953b4938 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -774,7 +774,7 @@ vc4_get_bcl(struct drm_device *dev, struct vc4_exec_info *exec) - goto fail; - } - -- bo = vc4_bo_create(dev, exec_size, true); -+ bo = vc4_bo_create(dev, exec_size, true, VC4_BO_TYPE_BCL); - if (IS_ERR(bo)) { - DRM_ERROR("Couldn't allocate BO for binning\n"); - ret = PTR_ERR(bo); -diff --git a/drivers/gpu/drm/vc4/vc4_render_cl.c b/drivers/gpu/drm/vc4/vc4_render_cl.c -index da3bfd53f0bd..e0539731130b 100644 ---- a/drivers/gpu/drm/vc4/vc4_render_cl.c -+++ b/drivers/gpu/drm/vc4/vc4_render_cl.c -@@ -320,7 +320,7 @@ static int vc4_create_rcl_bo(struct drm_device *dev, struct vc4_exec_info *exec, - - size += xtiles * ytiles * loop_body_size; - -- setup->rcl = &vc4_bo_create(dev, size, true)->base; -+ setup->rcl = &vc4_bo_create(dev, size, true, VC4_BO_TYPE_RCL)->base; - if (IS_ERR(setup->rcl)) - return PTR_ERR(setup->rcl); - list_add_tail(&to_vc4_bo(&setup->rcl->base)->unref_head, -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index 8c723da71f66..622cd43840b8 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -236,7 +236,8 @@ vc4_allocate_bin_bo(struct drm_device *drm) - INIT_LIST_HEAD(&list); - - while (true) { -- struct vc4_bo *bo = vc4_bo_create(drm, size, true); -+ struct vc4_bo *bo = vc4_bo_create(drm, size, true, -+ VC4_BO_TYPE_BIN); - - if (IS_ERR(bo)) { - ret = PTR_ERR(bo); -diff --git a/include/uapi/drm/vc4_drm.h b/include/uapi/drm/vc4_drm.h -index 6ac4c5c014cb..551628e571f9 100644 ---- a/include/uapi/drm/vc4_drm.h -+++ b/include/uapi/drm/vc4_drm.h -@@ -40,6 +40,7 @@ extern "C" { - #define DRM_VC4_GET_PARAM 0x07 - #define DRM_VC4_SET_TILING 0x08 - #define DRM_VC4_GET_TILING 0x09 -+#define DRM_VC4_LABEL_BO 0x0a - - #define DRM_IOCTL_VC4_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SUBMIT_CL, struct drm_vc4_submit_cl) - #define DRM_IOCTL_VC4_WAIT_SEQNO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_WAIT_SEQNO, struct drm_vc4_wait_seqno) -@@ -51,6 +52,7 @@ extern "C" { - #define DRM_IOCTL_VC4_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_PARAM, struct drm_vc4_get_param) - #define DRM_IOCTL_VC4_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_SET_TILING, struct drm_vc4_set_tiling) - #define DRM_IOCTL_VC4_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_GET_TILING, struct drm_vc4_get_tiling) -+#define DRM_IOCTL_VC4_LABEL_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_VC4_LABEL_BO, struct drm_vc4_label_bo) - - struct drm_vc4_submit_rcl_surface { - __u32 hindex; /* Handle index, or ~0 if not present. */ -@@ -311,6 +313,15 @@ struct drm_vc4_set_tiling { - __u64 modifier; - }; - -+/** -+ * struct drm_vc4_label_bo - Attach a name to a BO for debug purposes. -+ */ -+struct drm_vc4_label_bo { -+ __u32 handle; -+ __u32 len; -+ __u64 name; -+}; -+ - #if defined(__cplusplus) - } - #endif --- -2.13.5 - -From 34cbed8ed9441caa13017108dac189e09c35f9af Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 2 Aug 2017 13:32:40 -0700 -Subject: [PATCH 5/6] drm/vc4: Fix double destroy of the BO cache on teardown. -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It's also destroyed from the top level vc4_drv.c initialization, which -is where the cache was actually initialized from. - -This used to just involve duplicate del_timer() and cancel_work_sync() -being called, but it started causing kmalloc issues once we -double-freed the new BO label array. - -Fixes: 1908a876f909 ("drm/vc4: Add an ioctl for labeling GEM BOs for summary stats") -Signed-off-by: Eric Anholt -Link: https://patchwork.freedesktop.org/patch/msgid/20170802203242.12815-1-eric@anholt.net -Tested-by: Noralf Trønnes -Acked-by: Noralf Trønnes -Reviewed-by: Boris Brezillon ---- - drivers/gpu/drm/vc4/vc4_gem.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index 80f1953b4938..624177b9cce4 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -1117,6 +1117,4 @@ vc4_gem_destroy(struct drm_device *dev) - - if (vc4->hang_state) - vc4_free_hang_state(dev, vc4->hang_state); -- -- vc4_bo_cache_destroy(dev); - } --- -2.13.5 - -From 4f218eea5be54c8506e6db700750e8b8019dc6af Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Fri, 16 Jun 2017 10:30:33 +0200 -Subject: [PATCH 6/6] drm/vc4: Send a VBLANK event when disabling a CRTC - -VBLANK events are missed when the CRTC is being disabled because the -driver does not wait till the end of the frame before stopping the -HVS and PV blocks. In this case, we should explicitly issue a VBLANK -event if there's one waiting. - -Signed-off-by: Boris Brezillon -Reviewed-by: Eric Anholt -Link: http://patchwork.freedesktop.org/patch/msgid/1497601833-24588-1-git-send-email-boris.brezillon@free-electrons.com ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index a12cc7ea99b6..b0582ad3f459 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -518,6 +518,19 @@ static void vc4_crtc_disable(struct drm_crtc *crtc) - WARN_ON_ONCE((HVS_READ(SCALER_DISPSTATX(chan)) & - (SCALER_DISPSTATX_FULL | SCALER_DISPSTATX_EMPTY)) != - SCALER_DISPSTATX_EMPTY); -+ -+ /* -+ * Make sure we issue a vblank event after disabling the CRTC if -+ * someone was waiting it. -+ */ -+ if (crtc->state->event) { -+ unsigned long flags; -+ -+ spin_lock_irqsave(&dev->event_lock, flags); -+ drm_crtc_send_vblank_event(crtc, crtc->state->event); -+ crtc->state->event = NULL; -+ spin_unlock_irqrestore(&dev->event_lock, flags); -+ } - } - - static void vc4_crtc_update_dlist(struct drm_crtc *crtc) --- -2.13.5 - diff --git a/config_generation b/config_generation index 6708b10..64ae444 100644 --- a/config_generation +++ b/config_generation @@ -5,7 +5,7 @@ # x86_64 x86_64=baseconfig:baseconfig-x86:baseconfig-x86-x86_64 -x86_64-debug=baseconfig:baseconfig-x86:baseconfig-x86-x86_64:debugconfig:debugconfig-x86 +x86_64-debug=baseconfig:baseconfig-x86:baseconfig-x86-x86_64:debugconfig:debugconfig-x86:debugconfig-x86-x86_64 # i686 i686=baseconfig:baseconfig-x86:baseconfig-x86-i686 diff --git a/drm-cma-reduce-dmesg-logs.patch b/drm-cma-reduce-dmesg-logs.patch index 2e39d6e..d7252c4 100644 --- a/drm-cma-reduce-dmesg-logs.patch +++ b/drm-cma-reduce-dmesg-logs.patch @@ -41,56 +41,3 @@ index 373e33f22be4..020e7668dfab 100644 size); ret = -ENOMEM; goto error; -From patchwork Wed Oct 4 12:54:47 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: cma: Take __GFP_NOWARN into account in cma_alloc() -From: Boris Brezillon -X-Patchwork-Id: 180554 -Message-Id: <20171004125447.15195-1-boris.brezillon@free-electrons.com> -To: linux-mm@kvack.org, Andrew Morton , - Laura Abbott -Cc: Boris Brezillon , - Jaewon Kim , dri-devel@lists.freedesktop.org -Date: Wed, 4 Oct 2017 14:54:47 +0200 - -cma_alloc() unconditionally prints an INFO message when the CMA -allocation fails. Make this message conditional on the non-presence of -__GFP_NOWARN in gfp_mask. - -Signed-off-by: Boris Brezillon -Acked-by: Laura Abbott ---- -Hello, - -This patch aims at removing INFO messages that are displayed when the -VC4 driver tries to allocate buffer objects. From the driver perspective -an allocation failure is acceptable, and the driver can possibly do -something to make following allocation succeed (like flushing the VC4 -internal cache). - -Also, I don't understand why this message is only an INFO message, and -not a WARN (pr_warn()). Please let me know if you have good reasons to -keep it as an unconditional pr_info(). - -Thanks, - -Boris ---- - mm/cma.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mm/cma.c b/mm/cma.c -index c0da318c020e..022e52bd8370 100644 ---- a/mm/cma.c -+++ b/mm/cma.c -@@ -460,7 +460,7 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, - - trace_cma_alloc(pfn, page, count, align); - -- if (ret) { -+ if (ret && !(gfp_mask & __GFP_NOWARN)) { - pr_info("%s: alloc failed, req-size: %zu pages, ret: %d\n", - __func__, count, ret); - cma_debug_show_areas(cma); diff --git a/drm-i915-Boost-GPU-clocks-if-we-miss-the-pageflip-s-vblank.patch b/drm-i915-Boost-GPU-clocks-if-we-miss-the-pageflip-s-vblank.patch new file mode 100644 index 0000000..07f8111 --- /dev/null +++ b/drm-i915-Boost-GPU-clocks-if-we-miss-the-pageflip-s-vblank.patch @@ -0,0 +1,200 @@ +From patchwork Thu Aug 17 12:37:06 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: drm/i915: Boost GPU clocks if we miss the pageflip's vblank +From: Chris Wilson +X-Patchwork-Id: 172204 +Message-Id: <20170817123706.6777-1-chris@chris-wilson.co.uk> +To: intel-gfx@lists.freedesktop.org +Cc: Daniel Vetter +Date: Thu, 17 Aug 2017 13:37:06 +0100 + +If we miss the current vblank because the gpu was busy, that may cause a +jitter as the frame rate temporarily drops. We try to limit the impact +of this by then boosting the GPU clock to deliver the frame as quickly +as possible. Originally done in commit 6ad790c0f5ac ("drm/i915: Boost GPU +frequency if we detect outstanding pageflips") but was never forward +ported to atomic and finally dropped in commit fd3a40242e87 ("drm/i915: +Rip out legacy page_flip completion/irq handling"). + +References: https://bugs.freedesktop.org/show_bug.cgi?id=102199 +Signed-off-by: Chris Wilson +Cc: Maarten Lankhorst +Cc: Ville Syrjälä +Cc: Daniel Vetter +Tested-by: Lyude Paul +Reviewed-by: Radoslaw Szwichtenberg +--- + drivers/gpu/drm/i915/intel_display.c | 59 ++++++++++++++++++++++++++++++++++++ + drivers/gpu/drm/i915/intel_drv.h | 1 - + drivers/gpu/drm/i915/intel_pm.c | 42 ++----------------------- + 3 files changed, 62 insertions(+), 40 deletions(-) + +diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c +index 0e93ec201fe3..7d5b19553637 100644 +--- a/drivers/gpu/drm/i915/intel_display.c ++++ b/drivers/gpu/drm/i915/intel_display.c +@@ -12636,6 +12636,55 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { + .set_crc_source = intel_crtc_set_crc_source, + }; + ++struct wait_rps_boost { ++ struct wait_queue_entry wait; ++ ++ struct drm_crtc *crtc; ++ struct drm_i915_gem_request *request; ++}; ++ ++static int do_rps_boost(struct wait_queue_entry *_wait, ++ unsigned mode, int sync, void *key) ++{ ++ struct wait_rps_boost *wait = container_of(_wait, typeof(*wait), wait); ++ struct drm_i915_gem_request *rq = wait->request; ++ ++ gen6_rps_boost(rq, NULL); ++ i915_gem_request_put(rq); ++ ++ drm_crtc_vblank_put(wait->crtc); ++ ++ list_del(&wait->wait.entry); ++ kfree(wait); ++ return 1; ++} ++ ++static void add_rps_boost_after_vblank(struct drm_crtc *crtc, ++ struct dma_fence *fence) ++{ ++ struct wait_rps_boost *wait; ++ ++ if (!dma_fence_is_i915(fence)) ++ return; ++ ++ if (drm_crtc_vblank_get(crtc)) ++ return; ++ ++ wait = kmalloc(sizeof(*wait), GFP_KERNEL); ++ if (!wait) { ++ drm_crtc_vblank_put(crtc); ++ return; ++ } ++ ++ wait->request = to_request(dma_fence_get(fence)); ++ wait->crtc = crtc; ++ ++ wait->wait.func = do_rps_boost; ++ wait->wait.flags = 0; ++ ++ add_wait_queue(drm_crtc_vblank_waitqueue(crtc), &wait->wait); ++} ++ + /** + * intel_prepare_plane_fb - Prepare fb for usage on plane + * @plane: drm plane to prepare for +@@ -12733,12 +12782,22 @@ intel_prepare_plane_fb(struct drm_plane *plane, + return ret; + + if (!new_state->fence) { /* implicit fencing */ ++ struct dma_fence *fence; ++ + ret = i915_sw_fence_await_reservation(&intel_state->commit_ready, + obj->resv, NULL, + false, I915_FENCE_TIMEOUT, + GFP_KERNEL); + if (ret < 0) + return ret; ++ ++ fence = reservation_object_get_excl_rcu(obj->resv); ++ if (fence) { ++ add_rps_boost_after_vblank(new_state->crtc, fence); ++ dma_fence_put(fence); ++ } ++ } else { ++ add_rps_boost_after_vblank(new_state->crtc, new_state->fence); + } + + return 0; +diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h +index fa47285918f4..e092354b4d63 100644 +--- a/drivers/gpu/drm/i915/intel_drv.h ++++ b/drivers/gpu/drm/i915/intel_drv.h +@@ -1844,7 +1844,6 @@ void gen6_rps_reset_ei(struct drm_i915_private *dev_priv); + void gen6_rps_idle(struct drm_i915_private *dev_priv); + void gen6_rps_boost(struct drm_i915_gem_request *rq, + struct intel_rps_client *rps); +-void intel_queue_rps_boost_for_request(struct drm_i915_gem_request *req); + void g4x_wm_get_hw_state(struct drm_device *dev); + void vlv_wm_get_hw_state(struct drm_device *dev); + void ilk_wm_get_hw_state(struct drm_device *dev); +diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c +index ed662937ec3c..c9fa2eb1903c 100644 +--- a/drivers/gpu/drm/i915/intel_pm.c ++++ b/drivers/gpu/drm/i915/intel_pm.c +@@ -6169,6 +6169,7 @@ void gen6_rps_boost(struct drm_i915_gem_request *rq, + struct intel_rps_client *rps) + { + struct drm_i915_private *i915 = rq->i915; ++ unsigned long flags; + bool boost; + + /* This is intentionally racy! We peek at the state here, then +@@ -6178,13 +6179,13 @@ void gen6_rps_boost(struct drm_i915_gem_request *rq, + return; + + boost = false; +- spin_lock_irq(&rq->lock); ++ spin_lock_irqsave(&rq->lock, flags); + if (!rq->waitboost && !i915_gem_request_completed(rq)) { + atomic_inc(&i915->rps.num_waiters); + rq->waitboost = true; + boost = true; + } +- spin_unlock_irq(&rq->lock); ++ spin_unlock_irqrestore(&rq->lock, flags); + if (!boost) + return; + +@@ -9132,43 +9133,6 @@ int intel_freq_opcode(struct drm_i915_private *dev_priv, int val) + return DIV_ROUND_CLOSEST(val, GT_FREQUENCY_MULTIPLIER); + } + +-struct request_boost { +- struct work_struct work; +- struct drm_i915_gem_request *req; +-}; +- +-static void __intel_rps_boost_work(struct work_struct *work) +-{ +- struct request_boost *boost = container_of(work, struct request_boost, work); +- struct drm_i915_gem_request *req = boost->req; +- +- if (!i915_gem_request_completed(req)) +- gen6_rps_boost(req, NULL); +- +- i915_gem_request_put(req); +- kfree(boost); +-} +- +-void intel_queue_rps_boost_for_request(struct drm_i915_gem_request *req) +-{ +- struct request_boost *boost; +- +- if (req == NULL || INTEL_GEN(req->i915) < 6) +- return; +- +- if (i915_gem_request_completed(req)) +- return; +- +- boost = kmalloc(sizeof(*boost), GFP_ATOMIC); +- if (boost == NULL) +- return; +- +- boost->req = i915_gem_request_get(req); +- +- INIT_WORK(&boost->work, __intel_rps_boost_work); +- queue_work(req->i915->wq, &boost->work); +-} +- + void intel_pm_setup(struct drm_i915_private *dev_priv) + { + mutex_init(&dev_priv->rps.hw_lock); diff --git a/drm-i915-boost-GPU-clocks-if-we-miss-the-pageflip.patch b/drm-i915-boost-GPU-clocks-if-we-miss-the-pageflip.patch deleted file mode 100644 index 0bd0e7c..0000000 --- a/drm-i915-boost-GPU-clocks-if-we-miss-the-pageflip.patch +++ /dev/null @@ -1,238 +0,0 @@ -From 333e2a813cdfb86ff286ece6f13bec371aa03d7b Mon Sep 17 00:00:00 2001 -From: Chris Wilson -Date: Thu, 17 Aug 2017 13:37:06 +0100 -Subject: [PATCH] drm/i915: Boost GPU clocks if we miss the pageflip's vblank -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If we miss the current vblank because the gpu was busy, that may cause a -jitter as the frame rate temporarily drops. We try to limit the impact -of this by then boosting the GPU clock to deliver the frame as quickly -as possible. Originally done in commit 6ad790c0f5ac ("drm/i915: Boost GPU -frequency if we detect outstanding pageflips") but was never forward -ported to atomic and finally dropped in commit fd3a40242e87 ("drm/i915: -Rip out legacy page_flip completion/irq handling"). - -One of the most typical use-cases for this is a mostly idle desktop. -Rendering one frame of the desktop's frontbuffer can easily be -accomplished by the GPU running at low frequency, but often exceeds -the time budget of the desktop compositor. The result is that animations -such as opening the menu, doing a fullscreen switch, or even just trying -to move a window around are slow and jerky. We need to respond within a -frame to give the best impression of a smooth UX, as a compromise we -instead respond if that first frame misses its goal. The result should -be a near-imperceivable initial delay and a smooth animation even -starting from idle. The cost, as ever, is that we spend more power than -is strictly necessary as we overestimate the required GPU frequency and -then try to ramp down. - -This of course is reactionary, too little, too late; nevertheless it is -surprisingly effective. - -Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102199 -Signed-off-by: Chris Wilson -Cc: Maarten Lankhorst -Cc: Ville Syrjälä -Cc: Daniel Vetter -Link: https://patchwork.freedesktop.org/patch/msgid/20170817123706.6777-1-chris@chris-wilson.co.uk -Tested-by: Lyude Paul -Reviewed-by: Radoslaw Szwichtenberg ---- - drivers/gpu/drm/i915/i915_gem.c | 10 +++--- - drivers/gpu/drm/i915/intel_display.c | 63 ++++++++++++++++++++++++++++++++++++ - drivers/gpu/drm/i915/intel_pm.c | 14 ++++---- - 3 files changed, 77 insertions(+), 10 deletions(-) - -diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c -index 969bac8404f1..7d409b29d75a 100644 ---- a/drivers/gpu/drm/i915/i915_gem.c -+++ b/drivers/gpu/drm/i915/i915_gem.c -@@ -355,6 +355,7 @@ i915_gem_object_wait_fence(struct dma_fence *fence, - long timeout, - struct intel_rps_client *rps) - { -+ unsigned long irq_flags; - struct drm_i915_gem_request *rq; - - BUILD_BUG_ON(I915_WAIT_INTERRUPTIBLE != 0x1); -@@ -410,9 +411,9 @@ i915_gem_object_wait_fence(struct dma_fence *fence, - * Compensate by giving the synchronous client credit for - * a waitboost next time. - */ -- spin_lock(&rq->i915->rps.client_lock); -+ spin_lock_irqsave(&rq->i915->rps.client_lock, irq_flags); - list_del_init(&rps->link); -- spin_unlock(&rq->i915->rps.client_lock); -+ spin_unlock_irqrestore(&rq->i915->rps.client_lock, irq_flags); - } - - return timeout; -@@ -5029,6 +5030,7 @@ void i915_gem_release(struct drm_device *dev, struct drm_file *file) - { - struct drm_i915_file_private *file_priv = file->driver_priv; - struct drm_i915_gem_request *request; -+ unsigned long flags; - - /* Clean up our request list when the client is going away, so that - * later retire_requests won't dereference our soon-to-be-gone -@@ -5040,9 +5042,9 @@ void i915_gem_release(struct drm_device *dev, struct drm_file *file) - spin_unlock(&file_priv->mm.lock); - - if (!list_empty(&file_priv->rps.link)) { -- spin_lock(&to_i915(dev)->rps.client_lock); -+ spin_lock_irqsave(&to_i915(dev)->rps.client_lock, flags); - list_del(&file_priv->rps.link); -- spin_unlock(&to_i915(dev)->rps.client_lock); -+ spin_unlock_irqrestore(&to_i915(dev)->rps.client_lock, flags); - } - } - -diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c -index 022125082649..875eb7aec2f1 100644 ---- a/drivers/gpu/drm/i915/intel_display.c -+++ b/drivers/gpu/drm/i915/intel_display.c -@@ -13301,6 +13301,58 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { - .set_crc_source = intel_crtc_set_crc_source, - }; - -+struct wait_rps_boost { -+ struct wait_queue_entry wait; -+ -+ struct drm_crtc *crtc; -+ struct drm_i915_gem_request *request; -+}; -+ -+static int do_rps_boost(struct wait_queue_entry *_wait, -+ unsigned mode, int sync, void *key) -+{ -+ struct wait_rps_boost *wait = container_of(_wait, typeof(*wait), wait); -+ struct drm_i915_gem_request *rq = wait->request; -+ -+ gen6_rps_boost(rq->i915, NULL, rq->emitted_jiffies); -+ i915_gem_request_put(rq); -+ -+ drm_crtc_vblank_put(wait->crtc); -+ -+ list_del(&wait->wait.entry); -+ kfree(wait); -+ return 1; -+} -+ -+static void add_rps_boost_after_vblank(struct drm_crtc *crtc, -+ struct dma_fence *fence) -+{ -+ struct wait_rps_boost *wait; -+ -+ if (!dma_fence_is_i915(fence)) -+ return; -+ -+ if (INTEL_GEN(to_i915(crtc->dev)) < 6) -+ return; -+ -+ if (drm_crtc_vblank_get(crtc)) -+ return; -+ -+ wait = kmalloc(sizeof(*wait), GFP_KERNEL); -+ if (!wait) { -+ drm_crtc_vblank_put(crtc); -+ return; -+ } -+ -+ wait->request = to_request(dma_fence_get(fence)); -+ wait->crtc = crtc; -+ -+ wait->wait.func = do_rps_boost; -+ wait->wait.flags = 0; -+ -+ add_wait_queue(drm_crtc_vblank_waitqueue(crtc), &wait->wait); -+} -+ - /** - * intel_prepare_plane_fb - Prepare fb for usage on plane - * @plane: drm plane to prepare for -@@ -13392,6 +13444,8 @@ intel_prepare_plane_fb(struct drm_plane *plane, - return 0; - - if (!new_state->fence) { /* implicit fencing */ -+ struct dma_fence *fence; -+ - ret = i915_sw_fence_await_reservation(&intel_state->commit_ready, - obj->resv, NULL, - false, I915_FENCE_TIMEOUT, -@@ -13399,7 +13453,16 @@ intel_prepare_plane_fb(struct drm_plane *plane, - if (ret < 0) - return ret; - -+ fence = reservation_object_get_excl_rcu(obj->resv); -+ if (fence) { -+ add_rps_boost_after_vblank(new_state->crtc, fence); -+ dma_fence_put(fence); -+ } -+ - i915_gem_object_wait_priority(obj, 0, I915_PRIORITY_DISPLAY); -+ -+ } else { -+ add_rps_boost_after_vblank(new_state->crtc, new_state->fence); - } - - return 0; -diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c -index 40b224b44d1b..b0ee9c4d33f4 100644 ---- a/drivers/gpu/drm/i915/intel_pm.c -+++ b/drivers/gpu/drm/i915/intel_pm.c -@@ -6108,6 +6108,7 @@ void gen6_rps_busy(struct drm_i915_private *dev_priv) - - void gen6_rps_idle(struct drm_i915_private *dev_priv) - { -+ unsigned long flags; - /* Flush our bottom-half so that it does not race with us - * setting the idle frequency and so that it is bounded by - * our rpm wakeref. And then disable the interrupts to stop any -@@ -6127,16 +6128,17 @@ void gen6_rps_idle(struct drm_i915_private *dev_priv) - } - mutex_unlock(&dev_priv->rps.hw_lock); - -- spin_lock(&dev_priv->rps.client_lock); -+ spin_lock_irqsave(&dev_priv->rps.client_lock, flags); - while (!list_empty(&dev_priv->rps.clients)) - list_del_init(dev_priv->rps.clients.next); -- spin_unlock(&dev_priv->rps.client_lock); -+ spin_unlock_irqrestore(&dev_priv->rps.client_lock, flags); - } - - void gen6_rps_boost(struct drm_i915_private *dev_priv, - struct intel_rps_client *rps, - unsigned long submitted) - { -+ unsigned long flags; - /* This is intentionally racy! We peek at the state here, then - * validate inside the RPS worker. - */ -@@ -6151,14 +6153,14 @@ void gen6_rps_boost(struct drm_i915_private *dev_priv, - if (rps && time_after(jiffies, submitted + DRM_I915_THROTTLE_JIFFIES)) - rps = NULL; - -- spin_lock(&dev_priv->rps.client_lock); -+ spin_lock_irqsave(&dev_priv->rps.client_lock, flags); - if (rps == NULL || list_empty(&rps->link)) { -- spin_lock_irq(&dev_priv->irq_lock); -+ spin_lock(&dev_priv->irq_lock); - if (dev_priv->rps.interrupts_enabled) { - dev_priv->rps.client_boost = true; - schedule_work(&dev_priv->rps.work); - } -- spin_unlock_irq(&dev_priv->irq_lock); -+ spin_unlock(&dev_priv->irq_lock); - - if (rps != NULL) { - list_add(&rps->link, &dev_priv->rps.clients); -@@ -6166,7 +6168,7 @@ void gen6_rps_boost(struct drm_i915_private *dev_priv, - } else - dev_priv->rps.boosts++; - } -- spin_unlock(&dev_priv->rps.client_lock); -+ spin_unlock_irqrestore(&dev_priv->rps.client_lock, flags); - } - - int intel_set_rps(struct drm_i915_private *dev_priv, u8 val) diff --git a/efi-lockdown.patch b/efi-lockdown.patch index e048784..4ac65fd 100644 --- a/efi-lockdown.patch +++ b/efi-lockdown.patch @@ -1,53 +1,7 @@ -From df7d76ae50f18d4465e59fdf7f19d3df44906cb5 Mon Sep 17 00:00:00 2001 -From: Josh Boyer -Date: Mon, 21 Nov 2016 23:55:55 +0000 -Subject: [PATCH 07/32] efi: Add EFI_SECURE_BOOT bit - -UEFI machines can be booted in Secure Boot mode. Add a EFI_SECURE_BOOT bit -that can be passed to efi_enabled() to find out whether secure boot is -enabled. - -This will be used by the SysRq+x handler, registered by the x86 arch, to find -out whether secure boot mode is enabled so that it can be disabled. - -Signed-off-by: Josh Boyer -Signed-off-by: David Howells ---- - arch/x86/kernel/setup.c | 1 + - include/linux/efi.h | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 69780ed..447905e 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -1182,6 +1182,7 @@ void __init setup_arch(char **cmdline_p) - pr_info("Secure boot disabled\n"); - break; - case efi_secureboot_mode_enabled: -+ set_bit(EFI_SECURE_BOOT, &efi.flags); - pr_info("Secure boot enabled\n"); - break; - default: -diff --git a/include/linux/efi.h b/include/linux/efi.h -index 94d34e0..6049600 100644 ---- a/include/linux/efi.h -+++ b/include/linux/efi.h -@@ -1069,6 +1069,7 @@ extern int __init efi_setup_pcdp_console(char *); - #define EFI_DBG 8 /* Print additional debug info at runtime */ - #define EFI_NX_PE_DATA 9 /* Can runtime data regions be mapped non-executable? */ - #define EFI_MEM_ATTR 10 /* Did firmware publish an EFI_MEMORY_ATTRIBUTES table? */ -+#define EFI_SECURE_BOOT 11 /* Are we in Secure Boot mode? */ - - #ifdef CONFIG_EFI - /* --- -2.7.4 - -From f05a90c19a9613d8d50597319ed91f691e25b689 Mon Sep 17 00:00:00 2001 +From 646ac5c07196bc3680e34188e55c8cc3565f65e7 Mon Sep 17 00:00:00 2001 From: David Howells -Date: Mon, 21 Nov 2016 23:36:17 +0000 -Subject: [PATCH 09/32] Add the ability to lock down access to the running +Date: Wed, 24 May 2017 14:56:00 +0100 +Subject: [PATCH 01/26] Add the ability to lock down access to the running kernel image Provide a single call to allow kernel code to determine whether the system @@ -57,64 +11,70 @@ modules that aren't validly signed with a key we recognise, fiddling with MSR registers and disallowing hibernation, Signed-off-by: David Howells +Acked-by: James Morris --- - include/linux/kernel.h | 9 +++++++++ - include/linux/security.h | 11 +++++++++++ - security/Kconfig | 15 +++++++++++++++ + include/linux/kernel.h | 17 ++++++++++++++ + include/linux/security.h | 8 +++++++ + security/Kconfig | 8 +++++++ security/Makefile | 3 +++ - security/lock_down.c | 40 ++++++++++++++++++++++++++++++++++++++++ - 5 files changed, 78 insertions(+) + security/lock_down.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 96 insertions(+) create mode 100644 security/lock_down.c diff --git a/include/linux/kernel.h b/include/linux/kernel.h -index cb09238..3cd3be9 100644 +index 0ad4c3044cf9..362da2e4bf53 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h -@@ -273,6 +273,15 @@ extern int oops_may_print(void); - void do_exit(long error_code) __noreturn; - void complete_and_exit(struct completion *, long) __noreturn; - +@@ -287,6 +287,23 @@ static inline void refcount_error_report(struct pt_regs *regs, const char *err) + { } + #endif + +#ifdef CONFIG_LOCK_DOWN_KERNEL -+extern bool kernel_is_locked_down(void); ++extern bool __kernel_is_locked_down(const char *what, bool first); +#else -+static inline bool kernel_is_locked_down(void) ++static inline bool __kernel_is_locked_down(const char *what, bool first) +{ + return false; +} +#endif + ++#define kernel_is_locked_down(what) \ ++ ({ \ ++ static bool message_given; \ ++ bool locked_down = __kernel_is_locked_down(what, !message_given); \ ++ message_given = true; \ ++ locked_down; \ ++ }) ++ /* Internal, do not use. */ int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res); int __must_check _kstrtol(const char *s, unsigned int base, long *res); diff --git a/include/linux/security.h b/include/linux/security.h -index d3868f2..187b74b 100644 +index ce6265960d6c..310775476b68 100644 --- a/include/linux/security.h +++ b/include/linux/security.h -@@ -1679,5 +1679,16 @@ static inline void free_secdata(void *secdata) +@@ -1753,5 +1753,13 @@ static inline void free_secdata(void *secdata) { } #endif /* CONFIG_SECURITY */ - + +#ifdef CONFIG_LOCK_DOWN_KERNEL -+extern void lock_kernel_down(void); -+#ifdef CONFIG_ALLOW_LOCKDOWN_LIFT -+extern void lift_kernel_lockdown(void); -+#endif ++extern void __init init_lockdown(void); +#else -+static inline void lock_kernel_down(void) ++static inline void __init init_lockdown(void) +{ +} +#endif + #endif /* ! __LINUX_SECURITY_H */ - + diff --git a/security/Kconfig b/security/Kconfig -index d900f47..d9b391d 100644 +index e8e449444e65..8e01fd59ae7e 100644 --- a/security/Kconfig +++ b/security/Kconfig -@@ -193,6 +193,21 @@ config STATIC_USERMODEHELPER_PATH +@@ -205,6 +205,14 @@ config STATIC_USERMODEHELPER_PATH If you wish for all usermode helper programs to be disabled, specify an empty string here (i.e. ""). - + +config LOCK_DOWN_KERNEL + bool "Allow the kernel to be 'locked down'" + help @@ -123,18 +83,11 @@ index d900f47..d9b391d 100644 + turns off various features that might otherwise allow access to the + kernel image (eg. setting MSR registers). + -+config ALLOW_LOCKDOWN_LIFT -+ bool -+ help -+ Allow the lockdown on a kernel to be lifted, thereby restoring the -+ ability of userspace to access the kernel image (eg. by SysRq+x under -+ x86). -+ source security/selinux/Kconfig source security/smack/Kconfig source security/tomoyo/Kconfig diff --git a/security/Makefile b/security/Makefile -index f2d71cd..8c4a43e 100644 +index f2d71cdb8e19..8c4a43e3d4e0 100644 --- a/security/Makefile +++ b/security/Makefile @@ -29,3 +29,6 @@ obj-$(CONFIG_CGROUP_DEVICE) += device_cgroup.o @@ -146,10 +99,10 @@ index f2d71cd..8c4a43e 100644 +obj-$(CONFIG_LOCK_DOWN_KERNEL) += lock_down.o diff --git a/security/lock_down.c b/security/lock_down.c new file mode 100644 -index 0000000..5788c60 +index 000000000000..d8595c0e6673 --- /dev/null +++ b/security/lock_down.c -@@ -0,0 +1,40 @@ +@@ -0,0 +1,60 @@ +/* Lock down the kernel + * + * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved. @@ -164,282 +117,110 @@ index 0000000..5788c60 +#include +#include + -+static __read_mostly bool kernel_locked_down; ++static __ro_after_init bool kernel_locked_down; + +/* + * Put the kernel into lock-down mode. + */ -+void lock_kernel_down(void) ++static void __init lock_kernel_down(const char *where) +{ -+ kernel_locked_down = true; ++ if (!kernel_locked_down) { ++ kernel_locked_down = true; ++ pr_notice("Kernel is locked down from %s; see man kernel_lockdown.7\n", ++ where); ++ } +} + ++static int __init lockdown_param(char *ignored) ++{ ++ lock_kernel_down("command line"); ++ return 0; ++} ++ ++early_param("lockdown", lockdown_param); ++ +/* -+ * Take the kernel out of lockdown mode. ++ * Lock the kernel down from very early in the arch setup. This must happen ++ * prior to things like ACPI being initialised. + */ -+void lift_kernel_lockdown(void) ++void __init init_lockdown(void) +{ -+ kernel_locked_down = false; ++#ifdef CONFIG_LOCK_DOWN_IN_EFI_SECURE_BOOT ++ if (efi_enabled(EFI_SECURE_BOOT)) ++ lock_kernel_down("EFI secure boot"); ++#endif +} + +/** + * kernel_is_locked_down - Find out if the kernel is locked down ++ * @what: Tag to use in notice generated if lockdown is in effect + */ -+bool kernel_is_locked_down(void) ++bool __kernel_is_locked_down(const char *what, bool first) +{ ++ if (what && first && kernel_locked_down) ++ pr_notice("Lockdown: %s is restricted; see man kernel_lockdown.7\n", ++ what); + return kernel_locked_down; +} -+EXPORT_SYMBOL(kernel_is_locked_down); ++EXPORT_SYMBOL(__kernel_is_locked_down); -- -2.7.4 - -From fb6feb38e297260d050fc477c72683ac51d07ae3 Mon Sep 17 00:00:00 2001 -From: David Howells -Date: Mon, 21 Nov 2016 23:55:55 +0000 -Subject: [PATCH 10/32] efi: Lock down the kernel if booted in secure boot mode +2.13.6 -UEFI Secure Boot provides a mechanism for ensuring that the firmware will -only load signed bootloaders and kernels. Certain use cases may also -require that all kernel modules also be signed. Add a configuration option -that to lock down the kernel - which includes requiring validly signed -modules - if the kernel is secure-booted. - -Signed-off-by: David Howells ---- - arch/x86/Kconfig | 12 ++++++++++++ - arch/x86/kernel/setup.c | 8 +++++++- - 2 files changed, 19 insertions(+), 1 deletion(-) - -diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 874c123..a315974 100644 ---- a/arch/x86/Kconfig -+++ b/arch/x86/Kconfig -@@ -1816,6 +1816,18 @@ config EFI_MIXED - - If unsure, say N. - -+config EFI_SECURE_BOOT_LOCK_DOWN -+ def_bool n -+ depends on EFI -+ prompt "Lock down the kernel when UEFI Secure Boot is enabled" -+ ---help--- -+ UEFI Secure Boot provides a mechanism for ensuring that the firmware -+ will only load signed bootloaders and kernels. Certain use cases may -+ also require that all kernel modules also be signed and that -+ userspace is prevented from directly changing the running kernel -+ image. Say Y here to automatically lock down the kernel when a -+ system boots with UEFI Secure Boot enabled. -+ - config SECCOMP - def_bool y - prompt "Enable seccomp to safely compute untrusted bytecode" -diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c -index 447905e..d44e60e 100644 ---- a/arch/x86/kernel/setup.c -+++ b/arch/x86/kernel/setup.c -@@ -69,6 +69,7 @@ - #include - #include - #include -+#include - - #include - #include