Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver fixes from Greg KH:
"Here are some small char/misc driver fixes for 5.11-rc5:

- habanalabs driver fixes

- phy driver fixes

- hwtracing driver fixes

- rtsx cardreader driver fix

All of these have been in linux-next with no reported issues"

* tag 'char-misc-5.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
misc: rtsx: init value of aspm_enabled
habanalabs: disable FW events on device removal
habanalabs: fix backward compatibility of idle check
habanalabs: zero pci counters packet before submit to FW
intel_th: pci: Add Alder Lake-P support
stm class: Fix module init return on allocation failure
habanalabs: prevent soft lockup during unmap
habanalabs: fix reset process in case of failures
habanalabs: fix dma_addr passed to dma_mmap_coherent
phy: mediatek: allow compile-testing the dsi phy
phy: cpcap-usb: Fix warning for missing regulator_disable
PHY: Ingenic: fix unconditional build of phy-ingenic-usb

+75 -21
+5
drivers/hwtracing/intel_th/pci.c
··· 269 .driver_data = (kernel_ulong_t)&intel_th_2x, 270 }, 271 { 272 /* Alder Lake CPU */ 273 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), 274 .driver_data = (kernel_ulong_t)&intel_th_2x,
··· 269 .driver_data = (kernel_ulong_t)&intel_th_2x, 270 }, 271 { 272 + /* Alder Lake-P */ 273 + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x51a6), 274 + .driver_data = (kernel_ulong_t)&intel_th_2x, 275 + }, 276 + { 277 /* Alder Lake CPU */ 278 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), 279 .driver_data = (kernel_ulong_t)&intel_th_2x,
+4 -2
drivers/hwtracing/stm/heartbeat.c
··· 64 65 static int stm_heartbeat_init(void) 66 { 67 - int i, ret = -ENOMEM; 68 69 if (nr_devs < 0 || nr_devs > STM_HEARTBEAT_MAX) 70 return -EINVAL; ··· 72 for (i = 0; i < nr_devs; i++) { 73 stm_heartbeat[i].data.name = 74 kasprintf(GFP_KERNEL, "heartbeat.%d", i); 75 - if (!stm_heartbeat[i].data.name) 76 goto fail_unregister; 77 78 stm_heartbeat[i].data.nr_chans = 1; 79 stm_heartbeat[i].data.link = stm_heartbeat_link;
··· 64 65 static int stm_heartbeat_init(void) 66 { 67 + int i, ret; 68 69 if (nr_devs < 0 || nr_devs > STM_HEARTBEAT_MAX) 70 return -EINVAL; ··· 72 for (i = 0; i < nr_devs; i++) { 73 stm_heartbeat[i].data.name = 74 kasprintf(GFP_KERNEL, "heartbeat.%d", i); 75 + if (!stm_heartbeat[i].data.name) { 76 + ret = -ENOMEM; 77 goto fail_unregister; 78 + } 79 80 stm_heartbeat[i].data.nr_chans = 1; 81 stm_heartbeat[i].data.link = stm_heartbeat_link;
+6 -1
drivers/misc/cardreader/rtsx_pcr.c
··· 1512 struct pcr_handle *handle; 1513 u32 base, len; 1514 int ret, i, bar = 0; 1515 1516 dev_dbg(&(pcidev->dev), 1517 ": Realtek PCI-E Card Reader found at %s [%04x:%04x] (rev %x)\n", ··· 1578 pcr->host_cmds_addr = pcr->rtsx_resv_buf_addr; 1579 pcr->host_sg_tbl_ptr = pcr->rtsx_resv_buf + HOST_CMDS_BUF_LEN; 1580 pcr->host_sg_tbl_addr = pcr->rtsx_resv_buf_addr + HOST_CMDS_BUF_LEN; 1581 - 1582 pcr->card_inserted = 0; 1583 pcr->card_removed = 0; 1584 INIT_DELAYED_WORK(&pcr->carddet_work, rtsx_pci_card_detect);
··· 1512 struct pcr_handle *handle; 1513 u32 base, len; 1514 int ret, i, bar = 0; 1515 + u8 val; 1516 1517 dev_dbg(&(pcidev->dev), 1518 ": Realtek PCI-E Card Reader found at %s [%04x:%04x] (rev %x)\n", ··· 1577 pcr->host_cmds_addr = pcr->rtsx_resv_buf_addr; 1578 pcr->host_sg_tbl_ptr = pcr->rtsx_resv_buf + HOST_CMDS_BUF_LEN; 1579 pcr->host_sg_tbl_addr = pcr->rtsx_resv_buf_addr + HOST_CMDS_BUF_LEN; 1580 + rtsx_pci_read_register(pcr, ASPM_FORCE_CTL, &val); 1581 + if (val & FORCE_ASPM_CTL0 && val & FORCE_ASPM_CTL1) 1582 + pcr->aspm_enabled = false; 1583 + else 1584 + pcr->aspm_enabled = true; 1585 pcr->card_inserted = 0; 1586 pcr->card_removed = 0; 1587 INIT_DELAYED_WORK(&pcr->carddet_work, rtsx_pci_card_detect);
+10 -1
drivers/misc/habanalabs/common/device.c
··· 1037 1038 if (hard_reset) { 1039 /* Release kernel context */ 1040 - if (hl_ctx_put(hdev->kernel_ctx) == 1) 1041 hdev->kernel_ctx = NULL; 1042 hl_vm_fini(hdev); 1043 hl_mmu_fini(hdev); ··· 1486 return; 1487 } 1488 } 1489 1490 /* Mark device as disabled */ 1491 hdev->disabled = true;
··· 1037 1038 if (hard_reset) { 1039 /* Release kernel context */ 1040 + if (hdev->kernel_ctx && hl_ctx_put(hdev->kernel_ctx) == 1) 1041 hdev->kernel_ctx = NULL; 1042 hl_vm_fini(hdev); 1043 hl_mmu_fini(hdev); ··· 1486 return; 1487 } 1488 } 1489 + 1490 + /* Disable PCI access from device F/W so it won't send us additional 1491 + * interrupts. We disable MSI/MSI-X at the halt_engines function and we 1492 + * can't have the F/W sending us interrupts after that. We need to 1493 + * disable the access here because if the device is marked disable, the 1494 + * message won't be send. Also, in case of heartbeat, the device CPU is 1495 + * marked as disable so this message won't be sent 1496 + */ 1497 + hl_fw_send_pci_access_msg(hdev, CPUCP_PACKET_DISABLE_PCI_ACCESS); 1498 1499 /* Mark device as disabled */ 1500 hdev->disabled = true;
+5
drivers/misc/habanalabs/common/firmware_if.c
··· 402 } 403 counters->rx_throughput = result; 404 405 /* Fetch PCI tx counter */ 406 pkt.index = cpu_to_le32(cpucp_pcie_throughput_tx); 407 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), ··· 418 counters->tx_throughput = result; 419 420 /* Fetch PCI replay counter */ 421 pkt.ctl = cpu_to_le32(CPUCP_PACKET_PCIE_REPLAY_CNT_GET << 422 CPUCP_PKT_CTL_OPCODE_SHIFT); 423
··· 402 } 403 counters->rx_throughput = result; 404 405 + memset(&pkt, 0, sizeof(pkt)); 406 + pkt.ctl = cpu_to_le32(CPUCP_PACKET_PCIE_THROUGHPUT_GET << 407 + CPUCP_PKT_CTL_OPCODE_SHIFT); 408 + 409 /* Fetch PCI tx counter */ 410 pkt.index = cpu_to_le32(cpucp_pcie_throughput_tx); 411 rc = hdev->asic_funcs->send_cpu_message(hdev, (u32 *) &pkt, sizeof(pkt), ··· 414 counters->tx_throughput = result; 415 416 /* Fetch PCI replay counter */ 417 + memset(&pkt, 0, sizeof(pkt)); 418 pkt.ctl = cpu_to_le32(CPUCP_PACKET_PCIE_REPLAY_CNT_GET << 419 CPUCP_PKT_CTL_OPCODE_SHIFT); 420
+1
drivers/misc/habanalabs/common/habanalabs.h
··· 2182 int hl_mmu_va_to_pa(struct hl_ctx *ctx, u64 virt_addr, u64 *phys_addr); 2183 int hl_mmu_get_tlb_info(struct hl_ctx *ctx, u64 virt_addr, 2184 struct hl_mmu_hop_info *hops); 2185 2186 int hl_fw_load_fw_to_device(struct hl_device *hdev, const char *fw_name, 2187 void __iomem *dst, u32 src_offset, u32 size);
··· 2182 int hl_mmu_va_to_pa(struct hl_ctx *ctx, u64 virt_addr, u64 *phys_addr); 2183 int hl_mmu_get_tlb_info(struct hl_ctx *ctx, u64 virt_addr, 2184 struct hl_mmu_hop_info *hops); 2185 + bool hl_is_dram_va(struct hl_device *hdev, u64 virt_addr); 2186 2187 int hl_fw_load_fw_to_device(struct hl_device *hdev, const char *fw_name, 2188 void __iomem *dst, u32 src_offset, u32 size);
+2
drivers/misc/habanalabs/common/habanalabs_ioctl.c
··· 133 134 hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev, 135 &hw_idle.busy_engines_mask_ext, NULL); 136 137 return copy_to_user(out, &hw_idle, 138 min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0;
··· 133 134 hw_idle.is_idle = hdev->asic_funcs->is_device_idle(hdev, 135 &hw_idle.busy_engines_mask_ext, NULL); 136 + hw_idle.busy_engines_mask = 137 + lower_32_bits(hw_idle.busy_engines_mask_ext); 138 139 return copy_to_user(out, &hw_idle, 140 min((size_t) max_size, sizeof(hw_idle))) ? -EFAULT : 0;
+8 -2
drivers/misc/habanalabs/common/memory.c
··· 886 { 887 struct hl_device *hdev = ctx->hdev; 888 u64 next_vaddr, i; 889 u32 page_size; 890 891 page_size = phys_pg_pack->page_size; 892 next_vaddr = vaddr; 893 ··· 902 /* 903 * unmapping on Palladium can be really long, so avoid a CPU 904 * soft lockup bug by sleeping a little between unmapping pages 905 */ 906 - if (hdev->pldm) 907 - usleep_range(500, 1000); 908 } 909 } 910
··· 886 { 887 struct hl_device *hdev = ctx->hdev; 888 u64 next_vaddr, i; 889 + bool is_host_addr; 890 u32 page_size; 891 892 + is_host_addr = !hl_is_dram_va(hdev, vaddr); 893 page_size = phys_pg_pack->page_size; 894 next_vaddr = vaddr; 895 ··· 900 /* 901 * unmapping on Palladium can be really long, so avoid a CPU 902 * soft lockup bug by sleeping a little between unmapping pages 903 + * 904 + * In addition, when unmapping host memory we pass through 905 + * the Linux kernel to unpin the pages and that takes a long 906 + * time. Therefore, sleep every 32K pages to avoid soft lockup 907 */ 908 + if (hdev->pldm || (is_host_addr && (i & 0x7FFF) == 0)) 909 + usleep_range(50, 200); 910 } 911 } 912
+3 -3
drivers/misc/habanalabs/common/mmu.c
··· 9 10 #include "habanalabs.h" 11 12 - static bool is_dram_va(struct hl_device *hdev, u64 virt_addr) 13 { 14 struct asic_fixed_properties *prop = &hdev->asic_prop; 15 ··· 156 if (!hdev->mmu_enable) 157 return 0; 158 159 - is_dram_addr = is_dram_va(hdev, virt_addr); 160 161 if (is_dram_addr) 162 mmu_prop = &prop->dmmu; ··· 236 if (!hdev->mmu_enable) 237 return 0; 238 239 - is_dram_addr = is_dram_va(hdev, virt_addr); 240 241 if (is_dram_addr) 242 mmu_prop = &prop->dmmu;
··· 9 10 #include "habanalabs.h" 11 12 + bool hl_is_dram_va(struct hl_device *hdev, u64 virt_addr) 13 { 14 struct asic_fixed_properties *prop = &hdev->asic_prop; 15 ··· 156 if (!hdev->mmu_enable) 157 return 0; 158 159 + is_dram_addr = hl_is_dram_va(hdev, virt_addr); 160 161 if (is_dram_addr) 162 mmu_prop = &prop->dmmu; ··· 236 if (!hdev->mmu_enable) 237 return 0; 238 239 + is_dram_addr = hl_is_dram_va(hdev, virt_addr); 240 241 if (is_dram_addr) 242 mmu_prop = &prop->dmmu;
+10 -2
drivers/misc/habanalabs/common/mmu_v1.c
··· 467 { 468 /* MMU H/W fini was already done in device hw_fini() */ 469 470 - kvfree(hdev->mmu_priv.dr.mmu_shadow_hop0); 471 - gen_pool_destroy(hdev->mmu_priv.dr.mmu_pgt_pool); 472 } 473 474 /**
··· 467 { 468 /* MMU H/W fini was already done in device hw_fini() */ 469 470 + if (!ZERO_OR_NULL_PTR(hdev->mmu_priv.hr.mmu_shadow_hop0)) { 471 + kvfree(hdev->mmu_priv.dr.mmu_shadow_hop0); 472 + gen_pool_destroy(hdev->mmu_priv.dr.mmu_pgt_pool); 473 + } 474 + 475 + /* Make sure that if we arrive here again without init was called we 476 + * won't cause kernel panic. This can happen for example if we fail 477 + * during hard reset code at certain points 478 + */ 479 + hdev->mmu_priv.dr.mmu_shadow_hop0 = NULL; 480 } 481 482 /**
+2 -1
drivers/misc/habanalabs/gaudi/gaudi.c
··· 4002 vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | 4003 VM_DONTCOPY | VM_NORESERVE; 4004 4005 - rc = dma_mmap_coherent(hdev->dev, vma, cpu_addr, dma_addr, size); 4006 if (rc) 4007 dev_err(hdev->dev, "dma_mmap_coherent error %d", rc); 4008
··· 4002 vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | 4003 VM_DONTCOPY | VM_NORESERVE; 4004 4005 + rc = dma_mmap_coherent(hdev->dev, vma, cpu_addr, 4006 + (dma_addr - HOST_PHYS_BASE), size); 4007 if (rc) 4008 dev_err(hdev->dev, "dma_mmap_coherent error %d", rc); 4009
+2 -1
drivers/misc/habanalabs/goya/goya.c
··· 2719 vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | 2720 VM_DONTCOPY | VM_NORESERVE; 2721 2722 - rc = dma_mmap_coherent(hdev->dev, vma, cpu_addr, dma_addr, size); 2723 if (rc) 2724 dev_err(hdev->dev, "dma_mmap_coherent error %d", rc); 2725
··· 2719 vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | 2720 VM_DONTCOPY | VM_NORESERVE; 2721 2722 + rc = dma_mmap_coherent(hdev->dev, vma, cpu_addr, 2723 + (dma_addr - HOST_PHYS_BASE), size); 2724 if (rc) 2725 dev_err(hdev->dev, "dma_mmap_coherent error %d", rc); 2726
+1 -1
drivers/phy/ingenic/Makefile
··· 1 # SPDX-License-Identifier: GPL-2.0 2 - obj-y += phy-ingenic-usb.o
··· 1 # SPDX-License-Identifier: GPL-2.0 2 + obj-$(CONFIG_PHY_INGENIC_USB) += phy-ingenic-usb.o
+3 -1
drivers/phy/mediatek/Kconfig
··· 49 50 config PHY_MTK_MIPI_DSI 51 tristate "MediaTek MIPI-DSI Driver" 52 - depends on ARCH_MEDIATEK && OF 53 select GENERIC_PHY 54 help 55 Support MIPI DSI for Mediatek SoCs.
··· 49 50 config PHY_MTK_MIPI_DSI 51 tristate "MediaTek MIPI-DSI Driver" 52 + depends on ARCH_MEDIATEK || COMPILE_TEST 53 + depends on COMMON_CLK 54 + depends on OF 55 select GENERIC_PHY 56 help 57 Support MIPI DSI for Mediatek SoCs.
+13 -6
drivers/phy/motorola/phy-cpcap-usb.c
··· 662 generic_phy = devm_phy_create(ddata->dev, NULL, &ops); 663 if (IS_ERR(generic_phy)) { 664 error = PTR_ERR(generic_phy); 665 - return PTR_ERR(generic_phy); 666 } 667 668 phy_set_drvdata(generic_phy, ddata); 669 670 phy_provider = devm_of_phy_provider_register(ddata->dev, 671 of_phy_simple_xlate); 672 - if (IS_ERR(phy_provider)) 673 - return PTR_ERR(phy_provider); 674 675 error = cpcap_usb_init_optional_pins(ddata); 676 if (error) 677 - return error; 678 679 cpcap_usb_init_optional_gpios(ddata); 680 681 error = cpcap_usb_init_iio(ddata); 682 if (error) 683 - return error; 684 685 error = cpcap_usb_init_interrupts(pdev, ddata); 686 if (error) 687 - return error; 688 689 usb_add_phy_dev(&ddata->phy); 690 atomic_set(&ddata->active, 1); 691 schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1)); 692 693 return 0; 694 } 695 696 static int cpcap_usb_phy_remove(struct platform_device *pdev)
··· 662 generic_phy = devm_phy_create(ddata->dev, NULL, &ops); 663 if (IS_ERR(generic_phy)) { 664 error = PTR_ERR(generic_phy); 665 + goto out_reg_disable; 666 } 667 668 phy_set_drvdata(generic_phy, ddata); 669 670 phy_provider = devm_of_phy_provider_register(ddata->dev, 671 of_phy_simple_xlate); 672 + if (IS_ERR(phy_provider)) { 673 + error = PTR_ERR(phy_provider); 674 + goto out_reg_disable; 675 + } 676 677 error = cpcap_usb_init_optional_pins(ddata); 678 if (error) 679 + goto out_reg_disable; 680 681 cpcap_usb_init_optional_gpios(ddata); 682 683 error = cpcap_usb_init_iio(ddata); 684 if (error) 685 + goto out_reg_disable; 686 687 error = cpcap_usb_init_interrupts(pdev, ddata); 688 if (error) 689 + goto out_reg_disable; 690 691 usb_add_phy_dev(&ddata->phy); 692 atomic_set(&ddata->active, 1); 693 schedule_delayed_work(&ddata->detect_work, msecs_to_jiffies(1)); 694 695 return 0; 696 + 697 + out_reg_disable: 698 + regulator_disable(ddata->vusb); 699 + 700 + return error; 701 } 702 703 static int cpcap_usb_phy_remove(struct platform_device *pdev)