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.14-rc7' 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 driver fixes for 5.14-rc7.

They consist of:

- revert for an interconnect patch that was found to have problems

- ipack tpci200 driver fixes for reported problems

- slimbus messaging and ngd fixes for reported problems

All are small and have been in linux-next for a while with no reported
issues"

* tag 'char-misc-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
ipack: tpci200: fix memory leak in the tpci200_register
ipack: tpci200: fix many double free issues in tpci200_pci_probe
slimbus: ngd: reset dma setup during runtime pm
slimbus: ngd: set correct device for pm
slimbus: messaging: check for valid transaction id
slimbus: messaging: start transaction ids from 1 instead of zero
Revert "interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate"

+54 -45
+5 -5
drivers/interconnect/qcom/icc-rpmh.c
··· 20 20 { 21 21 size_t i; 22 22 struct qcom_icc_node *qn; 23 - struct qcom_icc_provider *qp; 24 23 25 24 qn = node->data; 26 - qp = to_qcom_provider(node->provider); 27 25 28 26 for (i = 0; i < QCOM_ICC_NUM_BUCKETS; i++) { 29 27 qn->sum_avg[i] = 0; 30 28 qn->max_peak[i] = 0; 31 29 } 32 - 33 - for (i = 0; i < qn->num_bcms; i++) 34 - qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]); 35 30 } 36 31 EXPORT_SYMBOL_GPL(qcom_icc_pre_aggregate); 37 32 ··· 44 49 { 45 50 size_t i; 46 51 struct qcom_icc_node *qn; 52 + struct qcom_icc_provider *qp; 47 53 48 54 qn = node->data; 55 + qp = to_qcom_provider(node->provider); 49 56 50 57 if (!tag) 51 58 tag = QCOM_ICC_TAG_ALWAYS; ··· 66 69 67 70 *agg_avg += avg_bw; 68 71 *agg_peak = max_t(u32, *agg_peak, peak_bw); 72 + 73 + for (i = 0; i < qn->num_bcms; i++) 74 + qcom_icc_bcm_voter_add(qp->voter, qn->bcms[i]); 69 75 70 76 return 0; 71 77 }
+32 -28
drivers/ipack/carriers/tpci200.c
··· 89 89 free_irq(tpci200->info->pdev->irq, (void *) tpci200); 90 90 91 91 pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs); 92 - pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs); 93 92 94 93 pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR); 95 94 pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR); 96 95 pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR); 97 96 pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR); 98 - pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR); 99 97 100 98 pci_disable_device(tpci200->info->pdev); 101 - pci_dev_put(tpci200->info->pdev); 102 99 } 103 100 104 101 static void tpci200_enable_irq(struct tpci200_board *tpci200, ··· 254 257 "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 2 !", 255 258 tpci200->info->pdev->bus->number, 256 259 tpci200->info->pdev->devfn); 257 - goto out_disable_pci; 260 + goto err_disable_device; 258 261 } 259 262 260 263 /* Request IO ID INT space (Bar 3) */ ··· 266 269 "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 3 !", 267 270 tpci200->info->pdev->bus->number, 268 271 tpci200->info->pdev->devfn); 269 - goto out_release_ip_space; 272 + goto err_ip_interface_bar; 270 273 } 271 274 272 275 /* Request MEM8 space (Bar 5) */ ··· 277 280 "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 5!", 278 281 tpci200->info->pdev->bus->number, 279 282 tpci200->info->pdev->devfn); 280 - goto out_release_ioid_int_space; 283 + goto err_io_id_int_spaces_bar; 281 284 } 282 285 283 286 /* Request MEM16 space (Bar 4) */ ··· 288 291 "(bn 0x%X, sn 0x%X) failed to allocate PCI resource for BAR 4!", 289 292 tpci200->info->pdev->bus->number, 290 293 tpci200->info->pdev->devfn); 291 - goto out_release_mem8_space; 294 + goto err_mem8_space_bar; 292 295 } 293 296 294 297 /* Map internal tpci200 driver user space */ ··· 302 305 tpci200->info->pdev->bus->number, 303 306 tpci200->info->pdev->devfn); 304 307 res = -ENOMEM; 305 - goto out_release_mem8_space; 308 + goto err_mem16_space_bar; 306 309 } 307 310 308 311 /* Initialize lock that protects interface_regs */ ··· 341 344 "(bn 0x%X, sn 0x%X) unable to register IRQ !", 342 345 tpci200->info->pdev->bus->number, 343 346 tpci200->info->pdev->devfn); 344 - goto out_release_ioid_int_space; 347 + goto err_interface_regs; 345 348 } 346 349 347 350 return 0; 348 351 349 - out_release_mem8_space: 352 + err_interface_regs: 353 + pci_iounmap(tpci200->info->pdev, tpci200->info->interface_regs); 354 + err_mem16_space_bar: 355 + pci_release_region(tpci200->info->pdev, TPCI200_MEM16_SPACE_BAR); 356 + err_mem8_space_bar: 350 357 pci_release_region(tpci200->info->pdev, TPCI200_MEM8_SPACE_BAR); 351 - out_release_ioid_int_space: 358 + err_io_id_int_spaces_bar: 352 359 pci_release_region(tpci200->info->pdev, TPCI200_IO_ID_INT_SPACES_BAR); 353 - out_release_ip_space: 360 + err_ip_interface_bar: 354 361 pci_release_region(tpci200->info->pdev, TPCI200_IP_INTERFACE_BAR); 355 - out_disable_pci: 362 + err_disable_device: 356 363 pci_disable_device(tpci200->info->pdev); 357 364 return res; 358 365 } ··· 528 527 tpci200->info = kzalloc(sizeof(struct tpci200_infos), GFP_KERNEL); 529 528 if (!tpci200->info) { 530 529 ret = -ENOMEM; 531 - goto out_err_info; 530 + goto err_tpci200; 532 531 } 533 532 534 533 pci_dev_get(pdev); ··· 539 538 if (ret) { 540 539 dev_err(&pdev->dev, "Failed to allocate PCI Configuration Memory"); 541 540 ret = -EBUSY; 542 - goto out_err_pci_request; 541 + goto err_tpci200_info; 543 542 } 544 543 tpci200->info->cfg_regs = ioremap( 545 544 pci_resource_start(pdev, TPCI200_CFG_MEM_BAR), ··· 547 546 if (!tpci200->info->cfg_regs) { 548 547 dev_err(&pdev->dev, "Failed to map PCI Configuration Memory"); 549 548 ret = -EFAULT; 550 - goto out_err_ioremap; 549 + goto err_request_region; 551 550 } 552 551 553 552 /* Disable byte swapping for 16 bit IP module access. This will ensure ··· 570 569 if (ret) { 571 570 dev_err(&pdev->dev, "error during tpci200 install\n"); 572 571 ret = -ENODEV; 573 - goto out_err_install; 572 + goto err_cfg_regs; 574 573 } 575 574 576 575 /* Register the carrier in the industry pack bus driver */ ··· 582 581 dev_err(&pdev->dev, 583 582 "error registering the carrier on ipack driver\n"); 584 583 ret = -EFAULT; 585 - goto out_err_bus_register; 584 + goto err_tpci200_install; 586 585 } 587 586 588 587 /* save the bus number given by ipack to logging purpose */ ··· 593 592 tpci200_create_device(tpci200, i); 594 593 return 0; 595 594 596 - out_err_bus_register: 595 + err_tpci200_install: 597 596 tpci200_uninstall(tpci200); 598 - /* tpci200->info->cfg_regs is unmapped in tpci200_uninstall */ 599 - tpci200->info->cfg_regs = NULL; 600 - out_err_install: 601 - if (tpci200->info->cfg_regs) 602 - iounmap(tpci200->info->cfg_regs); 603 - out_err_ioremap: 597 + err_cfg_regs: 598 + pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs); 599 + err_request_region: 604 600 pci_release_region(pdev, TPCI200_CFG_MEM_BAR); 605 - out_err_pci_request: 606 - pci_dev_put(pdev); 601 + err_tpci200_info: 607 602 kfree(tpci200->info); 608 - out_err_info: 603 + pci_dev_put(pdev); 604 + err_tpci200: 609 605 kfree(tpci200); 610 606 return ret; 611 607 } ··· 611 613 { 612 614 ipack_bus_unregister(tpci200->info->ipack_bus); 613 615 tpci200_uninstall(tpci200); 616 + 617 + pci_iounmap(tpci200->info->pdev, tpci200->info->cfg_regs); 618 + 619 + pci_release_region(tpci200->info->pdev, TPCI200_CFG_MEM_BAR); 620 + 621 + pci_dev_put(tpci200->info->pdev); 614 622 615 623 kfree(tpci200->info); 616 624 kfree(tpci200);
+4 -3
drivers/slimbus/messaging.c
··· 66 66 int ret = 0; 67 67 68 68 spin_lock_irqsave(&ctrl->txn_lock, flags); 69 - ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 0, 69 + ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 1, 70 70 SLIM_MAX_TIDS, GFP_ATOMIC); 71 71 if (ret < 0) { 72 72 spin_unlock_irqrestore(&ctrl->txn_lock, flags); ··· 131 131 goto slim_xfer_err; 132 132 } 133 133 } 134 - 134 + /* Initialize tid to invalid value */ 135 + txn->tid = 0; 135 136 need_tid = slim_tid_txn(txn->mt, txn->mc); 136 137 137 138 if (need_tid) { ··· 164 163 txn->mt, txn->mc, txn->la, ret); 165 164 166 165 slim_xfer_err: 167 - if (!clk_pause_msg && (!need_tid || ret == -ETIMEDOUT)) { 166 + if (!clk_pause_msg && (txn->tid == 0 || ret == -ETIMEDOUT)) { 168 167 /* 169 168 * remove runtime-pm vote if this was TX only, or 170 169 * if there was error during this transaction
+13 -9
drivers/slimbus/qcom-ngd-ctrl.c
··· 618 618 (mc == SLIM_USR_MC_GENERIC_ACK && 619 619 mt == SLIM_MSG_MT_SRC_REFERRED_USER)) { 620 620 slim_msg_response(&ctrl->ctrl, &buf[4], buf[3], len - 4); 621 - pm_runtime_mark_last_busy(ctrl->dev); 621 + pm_runtime_mark_last_busy(ctrl->ctrl.dev); 622 622 } 623 623 } 624 624 ··· 1080 1080 { 1081 1081 u32 cfg = readl_relaxed(ctrl->ngd->base); 1082 1082 1083 - if (ctrl->state == QCOM_SLIM_NGD_CTRL_DOWN) 1083 + if (ctrl->state == QCOM_SLIM_NGD_CTRL_DOWN || 1084 + ctrl->state == QCOM_SLIM_NGD_CTRL_ASLEEP) 1084 1085 qcom_slim_ngd_init_dma(ctrl); 1085 1086 1086 1087 /* By default enable message queues */ ··· 1132 1131 dev_info(ctrl->dev, "Subsys restart: ADSP active framer\n"); 1133 1132 return 0; 1134 1133 } 1134 + qcom_slim_ngd_setup(ctrl); 1135 1135 return 0; 1136 1136 } 1137 1137 ··· 1259 1257 } 1260 1258 /* controller state should be in sync with framework state */ 1261 1259 complete(&ctrl->qmi.qmi_comp); 1262 - if (!pm_runtime_enabled(ctrl->dev) || 1263 - !pm_runtime_suspended(ctrl->dev)) 1264 - qcom_slim_ngd_runtime_resume(ctrl->dev); 1260 + if (!pm_runtime_enabled(ctrl->ctrl.dev) || 1261 + !pm_runtime_suspended(ctrl->ctrl.dev)) 1262 + qcom_slim_ngd_runtime_resume(ctrl->ctrl.dev); 1265 1263 else 1266 - pm_runtime_resume(ctrl->dev); 1267 - pm_runtime_mark_last_busy(ctrl->dev); 1268 - pm_runtime_put(ctrl->dev); 1264 + pm_runtime_resume(ctrl->ctrl.dev); 1265 + 1266 + pm_runtime_mark_last_busy(ctrl->ctrl.dev); 1267 + pm_runtime_put(ctrl->ctrl.dev); 1269 1268 1270 1269 ret = slim_register_controller(&ctrl->ctrl); 1271 1270 if (ret) { ··· 1392 1389 /* Make sure the last dma xfer is finished */ 1393 1390 mutex_lock(&ctrl->tx_lock); 1394 1391 if (ctrl->state != QCOM_SLIM_NGD_CTRL_DOWN) { 1395 - pm_runtime_get_noresume(ctrl->dev); 1392 + pm_runtime_get_noresume(ctrl->ctrl.dev); 1396 1393 ctrl->state = QCOM_SLIM_NGD_CTRL_DOWN; 1397 1394 qcom_slim_ngd_down(ctrl); 1398 1395 qcom_slim_ngd_exit_dma(ctrl); ··· 1620 1617 struct qcom_slim_ngd_ctrl *ctrl = dev_get_drvdata(dev); 1621 1618 int ret = 0; 1622 1619 1620 + qcom_slim_ngd_exit_dma(ctrl); 1623 1621 if (!ctrl->qmi.handle) 1624 1622 return 0; 1625 1623