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 'soc-fixes-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC fixes from Arnd Bergmann:
"A couple of fixes for firmware drivers have come up, addressing kernel
side bugs in op-tee and ff-a code, as well as compatibility issues
with exynos-acpm and ff-a protocols.

The only devicetree fixes are for the Apple platform, addressing
issues with conformance to the bindings for the wlan, spi and mipi
nodes"

* tag 'soc-fixes-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
arm64: dts: apple: Move touchbar mipi {address,size}-cells from dtsi to dts
arm64: dts: apple: Drop {address,size}-cells from SPI NOR
arm64: dts: apple: t8103: Fix PCIe BCM4377 nodename
optee: ffa: fix sleep in atomic context
firmware: exynos-acpm: fix timeouts on xfers handling
arm64: defconfig: update renamed PHY_SNPS_EUSB2
firmware: arm_ffa: Fix the missing entry in struct ffa_indirect_msg_hdr
firmware: arm_ffa: Replace mutex with rwlock to avoid sleep in atomic context
firmware: arm_ffa: Move memory allocation outside the mutex locking
firmware: arm_ffa: Fix memory leak by freeing notifier callback node

+87 -69
-2
arch/arm64/boot/dts/apple/spi1-nvram.dtsi
··· 20 20 compatible = "jedec,spi-nor"; 21 21 reg = <0x0>; 22 22 spi-max-frequency = <25000000>; 23 - #address-cells = <1>; 24 - #size-cells = <1>; 25 23 26 24 partitions { 27 25 compatible = "fixed-partitions";
+2
arch/arm64/boot/dts/apple/t8103-j293.dts
··· 100 100 101 101 &displaydfr_mipi { 102 102 status = "okay"; 103 + #address-cells = <1>; 104 + #size-cells = <0>; 103 105 104 106 dfr_panel: panel@0 { 105 107 compatible = "apple,j293-summit", "apple,summit";
+1 -1
arch/arm64/boot/dts/apple/t8103-jxxx.dtsi
··· 71 71 */ 72 72 &port00 { 73 73 bus-range = <1 1>; 74 - wifi0: network@0,0 { 74 + wifi0: wifi@0,0 { 75 75 compatible = "pci14e4,4425"; 76 76 reg = <0x10000 0x0 0x0 0x0 0x0>; 77 77 /* To be filled by the loader */
-2
arch/arm64/boot/dts/apple/t8103.dtsi
··· 405 405 compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi"; 406 406 reg = <0x2 0x28600000 0x0 0x100000>; 407 407 power-domains = <&ps_mipi_dsi>; 408 - #address-cells = <1>; 409 - #size-cells = <0>; 410 408 status = "disabled"; 411 409 412 410 ports {
+2
arch/arm64/boot/dts/apple/t8112-j493.dts
··· 63 63 64 64 &displaydfr_mipi { 65 65 status = "okay"; 66 + #address-cells = <1>; 67 + #size-cells = <0>; 66 68 67 69 dfr_panel: panel@0 { 68 70 compatible = "apple,j493-summit", "apple,summit";
-2
arch/arm64/boot/dts/apple/t8112.dtsi
··· 420 420 compatible = "apple,t8112-display-pipe-mipi", "apple,h7-display-pipe-mipi"; 421 421 reg = <0x2 0x28600000 0x0 0x100000>; 422 422 power-domains = <&ps_mipi_dsi>; 423 - #address-cells = <1>; 424 - #size-cells = <0>; 425 423 status = "disabled"; 426 424 427 425 ports {
+1 -1
arch/arm64/configs/defconfig
··· 1573 1573 CONFIG_RESET_QCOM_PDC=m 1574 1574 CONFIG_RESET_RZG2L_USBPHY_CTRL=y 1575 1575 CONFIG_RESET_TI_SCI=y 1576 + CONFIG_PHY_SNPS_EUSB2=m 1576 1577 CONFIG_PHY_XGENE=y 1577 1578 CONFIG_PHY_CAN_TRANSCEIVER=m 1578 1579 CONFIG_PHY_NXP_PTN3222=m ··· 1598 1597 CONFIG_PHY_QCOM_PCIE2=m 1599 1598 CONFIG_PHY_QCOM_QMP=m 1600 1599 CONFIG_PHY_QCOM_QUSB2=m 1601 - CONFIG_PHY_QCOM_SNPS_EUSB2=m 1602 1600 CONFIG_PHY_QCOM_EUSB2_REPEATER=m 1603 1601 CONFIG_PHY_QCOM_M31_USB=m 1604 1602 CONFIG_PHY_QCOM_USB_HS=m
+36 -35
drivers/firmware/arm_ffa/driver.c
··· 110 110 struct work_struct sched_recv_irq_work; 111 111 struct xarray partition_info; 112 112 DECLARE_HASHTABLE(notifier_hash, ilog2(FFA_MAX_NOTIFICATIONS)); 113 - struct mutex notify_lock; /* lock to protect notifier hashtable */ 113 + rwlock_t notify_lock; /* lock to protect notifier hashtable */ 114 114 }; 115 115 116 116 static struct ffa_drv_info *drv_info; ··· 1250 1250 return NULL; 1251 1251 } 1252 1252 1253 - static int 1254 - update_notifier_cb(struct ffa_device *dev, int notify_id, void *cb, 1255 - void *cb_data, bool is_registration, bool is_framework) 1253 + static int update_notifier_cb(struct ffa_device *dev, int notify_id, 1254 + struct notifier_cb_info *cb, bool is_framework) 1256 1255 { 1257 1256 struct notifier_cb_info *cb_info = NULL; 1258 1257 enum notify_type type = ffa_notify_type_get(dev->vm_id); 1259 - bool cb_found; 1258 + bool cb_found, is_registration = !!cb; 1260 1259 1261 1260 if (is_framework) 1262 1261 cb_info = notifier_hnode_get_by_vmid_uuid(notify_id, dev->vm_id, ··· 1269 1270 return -EINVAL; 1270 1271 1271 1272 if (is_registration) { 1272 - cb_info = kzalloc(sizeof(*cb_info), GFP_KERNEL); 1273 - if (!cb_info) 1274 - return -ENOMEM; 1275 - 1276 - cb_info->dev = dev; 1277 - cb_info->cb_data = cb_data; 1278 - if (is_framework) 1279 - cb_info->fwk_cb = cb; 1280 - else 1281 - cb_info->cb = cb; 1282 - 1283 - hash_add(drv_info->notifier_hash, &cb_info->hnode, notify_id); 1273 + hash_add(drv_info->notifier_hash, &cb->hnode, notify_id); 1284 1274 } else { 1285 1275 hash_del(&cb_info->hnode); 1276 + kfree(cb_info); 1286 1277 } 1287 1278 1288 1279 return 0; ··· 1289 1300 if (notify_id >= FFA_MAX_NOTIFICATIONS) 1290 1301 return -EINVAL; 1291 1302 1292 - mutex_lock(&drv_info->notify_lock); 1303 + write_lock(&drv_info->notify_lock); 1293 1304 1294 - rc = update_notifier_cb(dev, notify_id, NULL, NULL, false, 1295 - is_framework); 1305 + rc = update_notifier_cb(dev, notify_id, NULL, is_framework); 1296 1306 if (rc) { 1297 1307 pr_err("Could not unregister notification callback\n"); 1298 - mutex_unlock(&drv_info->notify_lock); 1308 + write_unlock(&drv_info->notify_lock); 1299 1309 return rc; 1300 1310 } 1301 1311 1302 1312 if (!is_framework) 1303 1313 rc = ffa_notification_unbind(dev->vm_id, BIT(notify_id)); 1304 1314 1305 - mutex_unlock(&drv_info->notify_lock); 1315 + write_unlock(&drv_info->notify_lock); 1306 1316 1307 1317 return rc; 1308 1318 } ··· 1322 1334 { 1323 1335 int rc; 1324 1336 u32 flags = 0; 1337 + struct notifier_cb_info *cb_info = NULL; 1325 1338 1326 1339 if (ffa_notifications_disabled()) 1327 1340 return -EOPNOTSUPP; ··· 1330 1341 if (notify_id >= FFA_MAX_NOTIFICATIONS) 1331 1342 return -EINVAL; 1332 1343 1333 - mutex_lock(&drv_info->notify_lock); 1344 + cb_info = kzalloc(sizeof(*cb_info), GFP_KERNEL); 1345 + if (!cb_info) 1346 + return -ENOMEM; 1347 + 1348 + cb_info->dev = dev; 1349 + cb_info->cb_data = cb_data; 1350 + if (is_framework) 1351 + cb_info->fwk_cb = cb; 1352 + else 1353 + cb_info->cb = cb; 1354 + 1355 + write_lock(&drv_info->notify_lock); 1334 1356 1335 1357 if (!is_framework) { 1336 1358 if (is_per_vcpu) 1337 1359 flags = PER_VCPU_NOTIFICATION_FLAG; 1338 1360 1339 1361 rc = ffa_notification_bind(dev->vm_id, BIT(notify_id), flags); 1340 - if (rc) { 1341 - mutex_unlock(&drv_info->notify_lock); 1342 - return rc; 1343 - } 1362 + if (rc) 1363 + goto out_unlock_free; 1344 1364 } 1345 1365 1346 - rc = update_notifier_cb(dev, notify_id, cb, cb_data, true, 1347 - is_framework); 1366 + rc = update_notifier_cb(dev, notify_id, cb_info, is_framework); 1348 1367 if (rc) { 1349 1368 pr_err("Failed to register callback for %d - %d\n", 1350 1369 notify_id, rc); 1351 1370 if (!is_framework) 1352 1371 ffa_notification_unbind(dev->vm_id, BIT(notify_id)); 1353 1372 } 1354 - mutex_unlock(&drv_info->notify_lock); 1373 + 1374 + out_unlock_free: 1375 + write_unlock(&drv_info->notify_lock); 1376 + if (rc) 1377 + kfree(cb_info); 1355 1378 1356 1379 return rc; 1357 1380 } ··· 1407 1406 if (!(bitmap & 1)) 1408 1407 continue; 1409 1408 1410 - mutex_lock(&drv_info->notify_lock); 1409 + read_lock(&drv_info->notify_lock); 1411 1410 cb_info = notifier_hnode_get_by_type(notify_id, type); 1412 - mutex_unlock(&drv_info->notify_lock); 1411 + read_unlock(&drv_info->notify_lock); 1413 1412 1414 1413 if (cb_info && cb_info->cb) 1415 1414 cb_info->cb(notify_id, cb_info->cb_data); ··· 1447 1446 1448 1447 ffa_rx_release(); 1449 1448 1450 - mutex_lock(&drv_info->notify_lock); 1449 + read_lock(&drv_info->notify_lock); 1451 1450 cb_info = notifier_hnode_get_by_vmid_uuid(notify_id, target, &uuid); 1452 - mutex_unlock(&drv_info->notify_lock); 1451 + read_unlock(&drv_info->notify_lock); 1453 1452 1454 1453 if (cb_info && cb_info->fwk_cb) 1455 1454 cb_info->fwk_cb(notify_id, cb_info->cb_data, buf); ··· 1974 1973 goto cleanup; 1975 1974 1976 1975 hash_init(drv_info->notifier_hash); 1977 - mutex_init(&drv_info->notify_lock); 1976 + rwlock_init(&drv_info->notify_lock); 1978 1977 1979 1978 drv_info->notif_enabled = true; 1980 1979 return;
+10 -17
drivers/firmware/samsung/exynos-acpm.c
··· 430 430 return -EOPNOTSUPP; 431 431 } 432 432 433 + msg.chan_id = xfer->acpm_chan_id; 434 + msg.chan_type = EXYNOS_MBOX_CHAN_TYPE_DOORBELL; 435 + 433 436 scoped_guard(mutex, &achan->tx_lock) { 434 437 tx_front = readl(achan->tx.front); 435 438 idx = (tx_front + 1) % achan->qlen; ··· 449 446 450 447 /* Advance TX front. */ 451 448 writel(idx, achan->tx.front); 449 + 450 + ret = mbox_send_message(achan->chan, (void *)&msg); 451 + if (ret < 0) 452 + return ret; 453 + 454 + mbox_client_txdone(achan->chan, 0); 452 455 } 453 456 454 - msg.chan_id = xfer->acpm_chan_id; 455 - msg.chan_type = EXYNOS_MBOX_CHAN_TYPE_DOORBELL; 456 - ret = mbox_send_message(achan->chan, (void *)&msg); 457 - if (ret < 0) 458 - return ret; 459 - 460 - ret = acpm_wait_for_message_response(achan, xfer); 461 - 462 - /* 463 - * NOTE: we might prefer not to need the mailbox ticker to manage the 464 - * transfer queueing since the protocol layer queues things by itself. 465 - * Unfortunately, we have to kick the mailbox framework after we have 466 - * received our message. 467 - */ 468 - mbox_client_txdone(achan->chan, ret); 469 - 470 - return ret; 457 + return acpm_wait_for_message_response(achan, xfer); 471 458 } 472 459 473 460 /**
+32 -9
drivers/tee/optee/ffa_abi.c
··· 728 728 return true; 729 729 } 730 730 731 + static void notif_work_fn(struct work_struct *work) 732 + { 733 + struct optee_ffa *optee_ffa = container_of(work, struct optee_ffa, 734 + notif_work); 735 + struct optee *optee = container_of(optee_ffa, struct optee, ffa); 736 + 737 + optee_do_bottom_half(optee->ctx); 738 + } 739 + 731 740 static void notif_callback(int notify_id, void *cb_data) 732 741 { 733 742 struct optee *optee = cb_data; 734 743 735 744 if (notify_id == optee->ffa.bottom_half_value) 736 - optee_do_bottom_half(optee->ctx); 745 + queue_work(optee->ffa.notif_wq, &optee->ffa.notif_work); 737 746 else 738 747 optee_notif_send(optee, notify_id); 739 748 } ··· 826 817 struct optee *optee = ffa_dev_get_drvdata(ffa_dev); 827 818 u32 bottom_half_id = optee->ffa.bottom_half_value; 828 819 829 - if (bottom_half_id != U32_MAX) 820 + if (bottom_half_id != U32_MAX) { 830 821 ffa_dev->ops->notifier_ops->notify_relinquish(ffa_dev, 831 822 bottom_half_id); 823 + destroy_workqueue(optee->ffa.notif_wq); 824 + } 832 825 optee_remove_common(optee); 833 826 834 827 mutex_destroy(&optee->ffa.mutex); ··· 845 834 bool is_per_vcpu = false; 846 835 u32 notif_id = 0; 847 836 int rc; 837 + 838 + INIT_WORK(&optee->ffa.notif_work, notif_work_fn); 839 + optee->ffa.notif_wq = create_workqueue("optee_notification"); 840 + if (!optee->ffa.notif_wq) { 841 + rc = -EINVAL; 842 + goto err; 843 + } 848 844 849 845 while (true) { 850 846 rc = ffa_dev->ops->notifier_ops->notify_request(ffa_dev, ··· 869 851 * notifications in that case. 870 852 */ 871 853 if (rc != -EACCES) 872 - return rc; 854 + goto err_wq; 873 855 notif_id++; 874 856 if (notif_id >= OPTEE_FFA_MAX_ASYNC_NOTIF_VALUE) 875 - return rc; 857 + goto err_wq; 876 858 } 877 859 optee->ffa.bottom_half_value = notif_id; 878 860 879 861 rc = enable_async_notif(optee); 880 - if (rc < 0) { 881 - ffa_dev->ops->notifier_ops->notify_relinquish(ffa_dev, 882 - notif_id); 883 - optee->ffa.bottom_half_value = U32_MAX; 884 - } 862 + if (rc < 0) 863 + goto err_rel; 864 + 865 + return 0; 866 + err_rel: 867 + ffa_dev->ops->notifier_ops->notify_relinquish(ffa_dev, notif_id); 868 + err_wq: 869 + destroy_workqueue(optee->ffa.notif_wq); 870 + err: 871 + optee->ffa.bottom_half_value = U32_MAX; 885 872 886 873 return rc; 887 874 }
+2
drivers/tee/optee/optee_private.h
··· 165 165 /* Serializes access to @global_ids */ 166 166 struct mutex mutex; 167 167 struct rhashtable global_ids; 168 + struct workqueue_struct *notif_wq; 169 + struct work_struct notif_work; 168 170 }; 169 171 170 172 struct optee;
+1
include/linux/arm_ffa.h
··· 283 283 u32 offset; 284 284 u32 send_recv_id; 285 285 u32 size; 286 + u32 res1; 286 287 uuid_t uuid; 287 288 }; 288 289