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

Merge tag 'soc-fixes-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc

Pull SoC fixes from Arnd Bergmann:
"The main change this time is an update to the MAINTAINERS file,
listing Krzysztof Kozlowski, Alexandre Belloni, and Linus Walleij as
additional maintainers for the SoC tree, in order to go back to a
group maintainership. Drew Fustini joins as an additional reviewer for
the SoC tree.

Thanks to all of you for volunteering to help out.

On the actual bugfixes, we have a few correctness changes for firmware
drivers (qtee, arm-ffa, scmi) and two devicetree fixes for Raspberry
Pi"

* tag 'soc-fixes-6.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
soc: officially expand maintainership team
firmware: arm_scmi: Fix premature SCMI_XFER_FLAG_IS_RAW clearing in raw mode
firmware: arm_scmi: Skip RAW initialization on failure
include: trace: Fix inflight count helper on failed initialization
firmware: arm_scmi: Account for failed debug initialization
ARM: dts: broadcom: rpi: Switch to V3D firmware clock
arm64: dts: broadcom: bcm2712: Define VGIC interrupt
firmware: arm_ffa: Add support for IMPDEF value in the memory access descriptor
tee: QCOMTEE should depend on ARCH_QCOM
tee: qcom: return -EFAULT instead of -EINVAL if copy_from_user() fails
tee: qcom: prevent potential off by one read

+119 -58
+4
MAINTAINERS
··· 1997 1997 1998 1998 ARM AND ARM64 SoC SUB-ARCHITECTURES (COMMON PARTS) 1999 1999 M: Arnd Bergmann <arnd@arndb.de> 2000 + M: Krzysztof Kozlowski <krzk@kernel.org> 2001 + M: Alexandre Belloni <alexandre.belloni@bootlin.com> 2002 + M: Linus Walleij <linus.walleij@linaro.org> 2003 + R: Drew Fustini <fustini@kernel.org> 2000 2004 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2001 2005 L: soc@lists.linux.dev 2002 2006 S: Maintained
+8
arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
··· 77 77 /delete-property/ pinctrl-0; 78 78 }; 79 79 80 + &pm { 81 + clocks = <&firmware_clocks 5>, 82 + <&clocks BCM2835_CLOCK_PERI_IMAGE>, 83 + <&clocks BCM2835_CLOCK_H264>, 84 + <&clocks BCM2835_CLOCK_ISP>; 85 + clock-names = "v3d", "peri_image", "h264", "isp"; 86 + }; 87 + 80 88 &rmem { 81 89 /* 82 90 * RPi4's co-processor will copy the board's bootloader configuration
+9
arch/arm/boot/dts/broadcom/bcm2835-rpi-common.dtsi
··· 13 13 clock-names = "pixel", "hdmi"; 14 14 }; 15 15 16 + &pm { 17 + clocks = <&firmware_clocks 5>, 18 + <&clocks BCM2835_CLOCK_PERI_IMAGE>, 19 + <&clocks BCM2835_CLOCK_H264>, 20 + <&clocks BCM2835_CLOCK_ISP>; 21 + clock-names = "v3d", "peri_image", "h264", "isp"; 22 + }; 23 + 16 24 &v3d { 25 + clocks = <&firmware_clocks 5>; 17 26 power-domains = <&power RPI_POWER_DOMAIN_V3D>; 18 27 }; 19 28
+2
arch/arm64/boot/dts/broadcom/bcm2712.dtsi
··· 326 326 <0x7fffe000 0x2000>; 327 327 interrupt-controller; 328 328 #address-cells = <0>; 329 + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | 330 + IRQ_TYPE_LEVEL_HIGH)>; 329 331 #interrupt-cells = <3>; 330 332 }; 331 333
+27 -10
drivers/firmware/arm_ffa/driver.c
··· 649 649 return FFA_MEM_NORMAL | FFA_MEM_WRITE_BACK | FFA_MEM_INNER_SHAREABLE; 650 650 } 651 651 652 + static void ffa_emad_impdef_value_init(u32 version, void *dst, void *src) 653 + { 654 + struct ffa_mem_region_attributes *ep_mem_access; 655 + 656 + if (FFA_EMAD_HAS_IMPDEF_FIELD(version)) 657 + memcpy(dst, src, sizeof(ep_mem_access->impdef_val)); 658 + } 659 + 660 + static void 661 + ffa_mem_region_additional_setup(u32 version, struct ffa_mem_region *mem_region) 662 + { 663 + if (!FFA_MEM_REGION_HAS_EP_MEM_OFFSET(version)) { 664 + mem_region->ep_mem_size = 0; 665 + } else { 666 + mem_region->ep_mem_size = ffa_emad_size_get(version); 667 + mem_region->ep_mem_offset = sizeof(*mem_region); 668 + memset(mem_region->reserved, 0, 12); 669 + } 670 + } 671 + 652 672 static int 653 673 ffa_setup_and_transmit(u32 func_id, void *buffer, u32 max_fragsize, 654 674 struct ffa_mem_ops_args *args) ··· 687 667 mem_region->flags = args->flags; 688 668 mem_region->sender_id = drv_info->vm_id; 689 669 mem_region->attributes = ffa_memory_attributes_get(func_id); 690 - ep_mem_access = buffer + 691 - ffa_mem_desc_offset(buffer, 0, drv_info->version); 692 670 composite_offset = ffa_mem_desc_offset(buffer, args->nattrs, 693 671 drv_info->version); 694 672 695 - for (idx = 0; idx < args->nattrs; idx++, ep_mem_access++) { 673 + for (idx = 0; idx < args->nattrs; idx++) { 674 + ep_mem_access = buffer + 675 + ffa_mem_desc_offset(buffer, idx, drv_info->version); 696 676 ep_mem_access->receiver = args->attrs[idx].receiver; 697 677 ep_mem_access->attrs = args->attrs[idx].attrs; 698 678 ep_mem_access->composite_off = composite_offset; 699 679 ep_mem_access->flag = 0; 700 680 ep_mem_access->reserved = 0; 681 + ffa_emad_impdef_value_init(drv_info->version, 682 + ep_mem_access->impdef_val, 683 + args->attrs[idx].impdef_val); 701 684 } 702 685 mem_region->handle = 0; 703 686 mem_region->ep_count = args->nattrs; 704 - if (drv_info->version <= FFA_VERSION_1_0) { 705 - mem_region->ep_mem_size = 0; 706 - } else { 707 - mem_region->ep_mem_size = sizeof(*ep_mem_access); 708 - mem_region->ep_mem_offset = sizeof(*mem_region); 709 - memset(mem_region->reserved, 0, 12); 710 - } 687 + ffa_mem_region_additional_setup(drv_info->version, mem_region); 711 688 712 689 composite = buffer + composite_offset; 713 690 composite->total_pg_cnt = ffa_get_num_pages_sg(args->sg);
+26 -6
drivers/firmware/arm_scmi/common.h
··· 309 309 SCMI_DEBUG_COUNTERS_LAST 310 310 }; 311 311 312 - static inline void scmi_inc_count(atomic_t *arr, int stat) 312 + /** 313 + * struct scmi_debug_info - Debug common info 314 + * @top_dentry: A reference to the top debugfs dentry 315 + * @name: Name of this SCMI instance 316 + * @type: Type of this SCMI instance 317 + * @is_atomic: Flag to state if the transport of this instance is atomic 318 + * @counters: An array of atomic_c's used for tracking statistics (if enabled) 319 + */ 320 + struct scmi_debug_info { 321 + struct dentry *top_dentry; 322 + const char *name; 323 + const char *type; 324 + bool is_atomic; 325 + atomic_t counters[SCMI_DEBUG_COUNTERS_LAST]; 326 + }; 327 + 328 + static inline void scmi_inc_count(struct scmi_debug_info *dbg, int stat) 313 329 { 314 - if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) 315 - atomic_inc(&arr[stat]); 330 + if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) { 331 + if (dbg) 332 + atomic_inc(&dbg->counters[stat]); 333 + } 316 334 } 317 335 318 - static inline void scmi_dec_count(atomic_t *arr, int stat) 336 + static inline void scmi_dec_count(struct scmi_debug_info *dbg, int stat) 319 337 { 320 - if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) 321 - atomic_dec(&arr[stat]); 338 + if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) { 339 + if (dbg) 340 + atomic_dec(&dbg->counters[stat]); 341 + } 322 342 } 323 343 324 344 enum scmi_bad_msg {
+21 -38
drivers/firmware/arm_scmi/driver.c
··· 116 116 #define ph_to_pi(h) container_of(h, struct scmi_protocol_instance, ph) 117 117 118 118 /** 119 - * struct scmi_debug_info - Debug common info 120 - * @top_dentry: A reference to the top debugfs dentry 121 - * @name: Name of this SCMI instance 122 - * @type: Type of this SCMI instance 123 - * @is_atomic: Flag to state if the transport of this instance is atomic 124 - * @counters: An array of atomic_c's used for tracking statistics (if enabled) 125 - */ 126 - struct scmi_debug_info { 127 - struct dentry *top_dentry; 128 - const char *name; 129 - const char *type; 130 - bool is_atomic; 131 - atomic_t counters[SCMI_DEBUG_COUNTERS_LAST]; 132 - }; 133 - 134 - /** 135 119 * struct scmi_info - Structure representing a SCMI instance 136 120 * 137 121 * @id: A sequence number starting from zero identifying this instance ··· 594 610 /* Set in-flight */ 595 611 set_bit(xfer->hdr.seq, minfo->xfer_alloc_table); 596 612 hash_add(minfo->pending_xfers, &xfer->node, xfer->hdr.seq); 597 - scmi_inc_count(info->dbg->counters, XFERS_INFLIGHT); 613 + scmi_inc_count(info->dbg, XFERS_INFLIGHT); 598 614 599 615 xfer->pending = true; 600 616 } ··· 803 819 hash_del(&xfer->node); 804 820 xfer->pending = false; 805 821 806 - scmi_dec_count(info->dbg->counters, XFERS_INFLIGHT); 822 + scmi_dec_count(info->dbg, XFERS_INFLIGHT); 807 823 } 824 + xfer->flags = 0; 808 825 hlist_add_head(&xfer->node, &minfo->free_xfers); 809 826 } 810 827 spin_unlock_irqrestore(&minfo->xfer_lock, flags); ··· 824 839 { 825 840 struct scmi_info *info = handle_to_scmi_info(handle); 826 841 827 - xfer->flags &= ~SCMI_XFER_FLAG_IS_RAW; 828 - xfer->flags &= ~SCMI_XFER_FLAG_CHAN_SET; 829 842 return __scmi_xfer_put(&info->tx_minfo, xfer); 830 843 } 831 844 ··· 1017 1034 spin_unlock_irqrestore(&minfo->xfer_lock, flags); 1018 1035 1019 1036 scmi_bad_message_trace(cinfo, msg_hdr, MSG_UNEXPECTED); 1020 - scmi_inc_count(info->dbg->counters, ERR_MSG_UNEXPECTED); 1037 + scmi_inc_count(info->dbg, ERR_MSG_UNEXPECTED); 1021 1038 1022 1039 return xfer; 1023 1040 } ··· 1045 1062 msg_type, xfer_id, msg_hdr, xfer->state); 1046 1063 1047 1064 scmi_bad_message_trace(cinfo, msg_hdr, MSG_INVALID); 1048 - scmi_inc_count(info->dbg->counters, ERR_MSG_INVALID); 1065 + scmi_inc_count(info->dbg, ERR_MSG_INVALID); 1049 1066 1050 1067 /* On error the refcount incremented above has to be dropped */ 1051 1068 __scmi_xfer_put(minfo, xfer); ··· 1090 1107 PTR_ERR(xfer)); 1091 1108 1092 1109 scmi_bad_message_trace(cinfo, msg_hdr, MSG_NOMEM); 1093 - scmi_inc_count(info->dbg->counters, ERR_MSG_NOMEM); 1110 + scmi_inc_count(info->dbg, ERR_MSG_NOMEM); 1094 1111 1095 1112 scmi_clear_channel(info, cinfo); 1096 1113 return; ··· 1106 1123 trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id, 1107 1124 xfer->hdr.id, "NOTI", xfer->hdr.seq, 1108 1125 xfer->hdr.status, xfer->rx.buf, xfer->rx.len); 1109 - scmi_inc_count(info->dbg->counters, NOTIFICATION_OK); 1126 + scmi_inc_count(info->dbg, NOTIFICATION_OK); 1110 1127 1111 1128 scmi_notify(cinfo->handle, xfer->hdr.protocol_id, 1112 1129 xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts); ··· 1166 1183 if (xfer->hdr.type == MSG_TYPE_DELAYED_RESP) { 1167 1184 scmi_clear_channel(info, cinfo); 1168 1185 complete(xfer->async_done); 1169 - scmi_inc_count(info->dbg->counters, DELAYED_RESPONSE_OK); 1186 + scmi_inc_count(info->dbg, DELAYED_RESPONSE_OK); 1170 1187 } else { 1171 1188 complete(&xfer->done); 1172 - scmi_inc_count(info->dbg->counters, RESPONSE_OK); 1189 + scmi_inc_count(info->dbg, RESPONSE_OK); 1173 1190 } 1174 1191 1175 1192 if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) { ··· 1279 1296 "timed out in resp(caller: %pS) - polling\n", 1280 1297 (void *)_RET_IP_); 1281 1298 ret = -ETIMEDOUT; 1282 - scmi_inc_count(info->dbg->counters, XFERS_RESPONSE_POLLED_TIMEOUT); 1299 + scmi_inc_count(info->dbg, XFERS_RESPONSE_POLLED_TIMEOUT); 1283 1300 } 1284 1301 } 1285 1302 ··· 1304 1321 "RESP" : "resp", 1305 1322 xfer->hdr.seq, xfer->hdr.status, 1306 1323 xfer->rx.buf, xfer->rx.len); 1307 - scmi_inc_count(info->dbg->counters, RESPONSE_POLLED_OK); 1324 + scmi_inc_count(info->dbg, RESPONSE_POLLED_OK); 1308 1325 1309 1326 if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) { 1310 1327 scmi_raw_message_report(info->raw, xfer, ··· 1319 1336 dev_err(dev, "timed out in resp(caller: %pS)\n", 1320 1337 (void *)_RET_IP_); 1321 1338 ret = -ETIMEDOUT; 1322 - scmi_inc_count(info->dbg->counters, XFERS_RESPONSE_TIMEOUT); 1339 + scmi_inc_count(info->dbg, XFERS_RESPONSE_TIMEOUT); 1323 1340 } 1324 1341 } 1325 1342 ··· 1403 1420 !is_transport_polling_capable(info->desc)) { 1404 1421 dev_warn_once(dev, 1405 1422 "Polling mode is not supported by transport.\n"); 1406 - scmi_inc_count(info->dbg->counters, SENT_FAIL_POLLING_UNSUPPORTED); 1423 + scmi_inc_count(info->dbg, SENT_FAIL_POLLING_UNSUPPORTED); 1407 1424 return -EINVAL; 1408 1425 } 1409 1426 1410 1427 cinfo = idr_find(&info->tx_idr, pi->proto->id); 1411 1428 if (unlikely(!cinfo)) { 1412 - scmi_inc_count(info->dbg->counters, SENT_FAIL_CHANNEL_NOT_FOUND); 1429 + scmi_inc_count(info->dbg, SENT_FAIL_CHANNEL_NOT_FOUND); 1413 1430 return -EINVAL; 1414 1431 } 1415 1432 /* True ONLY if also supported by transport. */ ··· 1444 1461 ret = info->desc->ops->send_message(cinfo, xfer); 1445 1462 if (ret < 0) { 1446 1463 dev_dbg(dev, "Failed to send message %d\n", ret); 1447 - scmi_inc_count(info->dbg->counters, SENT_FAIL); 1464 + scmi_inc_count(info->dbg, SENT_FAIL); 1448 1465 return ret; 1449 1466 } 1450 1467 1451 1468 trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id, 1452 1469 xfer->hdr.id, "CMND", xfer->hdr.seq, 1453 1470 xfer->hdr.status, xfer->tx.buf, xfer->tx.len); 1454 - scmi_inc_count(info->dbg->counters, SENT_OK); 1471 + scmi_inc_count(info->dbg, SENT_OK); 1455 1472 1456 1473 ret = scmi_wait_for_message_response(cinfo, xfer); 1457 1474 if (!ret && xfer->hdr.status) { 1458 1475 ret = scmi_to_linux_errno(xfer->hdr.status); 1459 - scmi_inc_count(info->dbg->counters, ERR_PROTOCOL); 1476 + scmi_inc_count(info->dbg, ERR_PROTOCOL); 1460 1477 } 1461 1478 1462 1479 if (info->desc->ops->mark_txdone) ··· 3027 3044 u8 channels[SCMI_MAX_CHANNELS] = {}; 3028 3045 DECLARE_BITMAP(protos, SCMI_MAX_CHANNELS) = {}; 3029 3046 3030 - if (!info->dbg) 3031 - return -EINVAL; 3032 - 3033 3047 /* Enumerate all channels to collect their ids */ 3034 3048 idr_for_each_entry(&info->tx_idr, cinfo, id) { 3035 3049 /* ··· 3198 3218 if (!info->dbg) 3199 3219 dev_warn(dev, "Failed to setup SCMI debugfs.\n"); 3200 3220 3201 - if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) { 3221 + if (info->dbg && IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT)) { 3202 3222 ret = scmi_debugfs_raw_mode_setup(info); 3203 3223 if (!coex) { 3204 3224 if (ret) ··· 3402 3422 { 3403 3423 if (IS_ENABLED(CONFIG_ARM_SCMI_DEBUG_COUNTERS)) { 3404 3424 struct scmi_info *info = handle_to_scmi_info(handle); 3425 + 3426 + if (!info->dbg) 3427 + return 0; 3405 3428 3406 3429 return atomic_read(&info->dbg->counters[XFERS_INFLIGHT]); 3407 3430 } else {
+1
drivers/tee/qcomtee/Kconfig
··· 2 2 # Qualcomm Trusted Execution Environment Configuration 3 3 config QCOMTEE 4 4 tristate "Qualcomm TEE Support" 5 + depends on ARCH_QCOM || COMPILE_TEST 5 6 depends on !CPU_BIG_ENDIAN 6 7 select QCOM_SCM 7 8 select QCOM_TZMEM_MODE_SHMBRIDGE
+1 -1
drivers/tee/qcomtee/call.c
··· 308 308 } 309 309 310 310 /* Release any IO and OO objects not processed. */ 311 - for (; u[i].type && i < num_params; i++) { 311 + for (; i < num_params && u[i].type; i++) { 312 312 if (u[i].type == QCOMTEE_ARG_TYPE_OO || 313 313 u[i].type == QCOMTEE_ARG_TYPE_IO) 314 314 qcomtee_object_put(u[i].o);
+1 -1
drivers/tee/qcomtee/core.c
··· 424 424 if (!(u[i].flags & QCOMTEE_ARG_FLAGS_UADDR)) 425 425 memcpy(msgptr, u[i].b.addr, u[i].b.size); 426 426 else if (copy_from_user(msgptr, u[i].b.uaddr, u[i].b.size)) 427 - return -EINVAL; 427 + return -EFAULT; 428 428 429 429 offset += qcomtee_msg_offset_align(u[i].b.size); 430 430 ib++;
+19 -2
include/linux/arm_ffa.h
··· 338 338 * an `struct ffa_mem_region_addr_range`. 339 339 */ 340 340 u32 composite_off; 341 + u8 impdef_val[16]; 341 342 u64 reserved; 342 343 }; 343 344 ··· 418 417 #define CONSTITUENTS_OFFSET(x) \ 419 418 (offsetof(struct ffa_composite_mem_region, constituents[x])) 420 419 420 + #define FFA_EMAD_HAS_IMPDEF_FIELD(version) ((version) >= FFA_VERSION_1_2) 421 + #define FFA_MEM_REGION_HAS_EP_MEM_OFFSET(version) ((version) > FFA_VERSION_1_0) 422 + 423 + static inline u32 ffa_emad_size_get(u32 ffa_version) 424 + { 425 + u32 sz; 426 + struct ffa_mem_region_attributes *ep_mem_access; 427 + 428 + if (FFA_EMAD_HAS_IMPDEF_FIELD(ffa_version)) 429 + sz = sizeof(*ep_mem_access); 430 + else 431 + sz = sizeof(*ep_mem_access) - sizeof(ep_mem_access->impdef_val); 432 + 433 + return sz; 434 + } 435 + 421 436 static inline u32 422 437 ffa_mem_desc_offset(struct ffa_mem_region *buf, int count, u32 ffa_version) 423 438 { 424 - u32 offset = count * sizeof(struct ffa_mem_region_attributes); 439 + u32 offset = count * ffa_emad_size_get(ffa_version); 425 440 /* 426 441 * Earlier to v1.1, the endpoint memory descriptor array started at 427 442 * offset 32(i.e. offset of ep_mem_offset in the current structure) 428 443 */ 429 - if (ffa_version <= FFA_VERSION_1_0) 444 + if (!FFA_MEM_REGION_HAS_EP_MEM_OFFSET(ffa_version)) 430 445 offset += offsetof(struct ffa_mem_region, ep_mem_offset); 431 446 else 432 447 offset += sizeof(struct ffa_mem_region);