Merge tag 'media/v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

- fixes for the new ipu6 driver (and related fixes to mei csi driver)

- fix a double debugfs remove logic at mgb4 driver

- a documentation fix

* tag 'media/v6.10-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
media: intel/ipu6: add csi2 port sanity check in notifier bound
media: intel/ipu6: update the maximum supported csi2 port number to 6
media: mei: csi: Warn less verbosely of a missing device fwnode
media: mei: csi: Put the IPU device reference
media: intel/ipu6: fix the buffer flags caused by wrong parentheses
media: intel/ipu6: Fix an error handling path in isys_probe()
media: intel/ipu6: Move isys_remove() close to isys_probe()
media: intel/ipu6: Fix some redundant resources freeing in ipu6_pci_remove()
media: Documentation: v4l: Fix ACTIVE route flag
media: mgb4: Fix double debugfs remove

+56 -40
+1 -1
Documentation/userspace-api/media/v4l/dev-subdev.rst
··· 582 582 Devices generating the streams may allow enabling and disabling some of the 583 583 routes or have a fixed routing configuration. If the routes can be disabled, not 584 584 declaring the routes (or declaring them without 585 - ``VIDIOC_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will 585 + ``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will 586 586 disable the routes. ``VIDIOC_SUBDEV_S_ROUTING`` will still return such routes 587 587 back to the user in the routes array, with the ``V4L2_SUBDEV_STREAM_FL_ACTIVE`` 588 588 flag unset.
+3 -3
drivers/media/pci/intel/ipu6/ipu6-isys-queue.c
··· 301 301 out_requeue: 302 302 if (bl && bl->nbufs) 303 303 ipu6_isys_buffer_list_queue(bl, 304 - (IPU6_ISYS_BUFFER_LIST_FL_INCOMING | 305 - error) ? 304 + IPU6_ISYS_BUFFER_LIST_FL_INCOMING | 305 + (error ? 306 306 IPU6_ISYS_BUFFER_LIST_FL_SET_STATE : 307 - 0, error ? VB2_BUF_STATE_ERROR : 307 + 0), error ? VB2_BUF_STATE_ERROR : 308 308 VB2_BUF_STATE_QUEUED); 309 309 flush_firmware_streamon_fail(stream); 310 310
+43 -28
drivers/media/pci/intel/ipu6/ipu6-isys.c
··· 678 678 container_of(asc, struct sensor_async_sd, asc); 679 679 int ret; 680 680 681 + if (s_asd->csi2.port >= isys->pdata->ipdata->csi2.nports) { 682 + dev_err(&isys->adev->auxdev.dev, "invalid csi2 port %u\n", 683 + s_asd->csi2.port); 684 + return -EINVAL; 685 + } 686 + 681 687 ret = ipu_bridge_instantiate_vcm(sd->dev); 682 688 if (ret) { 683 689 dev_err(&isys->adev->auxdev.dev, "instantiate vcm failed\n"); ··· 931 925 .resume = isys_resume, 932 926 }; 933 927 934 - static void isys_remove(struct auxiliary_device *auxdev) 928 + static void free_fw_msg_bufs(struct ipu6_isys *isys) 935 929 { 936 - struct ipu6_bus_device *adev = auxdev_to_adev(auxdev); 937 - struct ipu6_isys *isys = dev_get_drvdata(&auxdev->dev); 938 - struct ipu6_device *isp = adev->isp; 930 + struct device *dev = &isys->adev->auxdev.dev; 939 931 struct isys_fw_msgs *fwmsg, *safe; 940 - unsigned int i; 941 932 942 933 list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist, head) 943 - dma_free_attrs(&auxdev->dev, sizeof(struct isys_fw_msgs), 944 - fwmsg, fwmsg->dma_addr, 0); 934 + dma_free_attrs(dev, sizeof(struct isys_fw_msgs), fwmsg, 935 + fwmsg->dma_addr, 0); 945 936 946 937 list_for_each_entry_safe(fwmsg, safe, &isys->framebuflist_fw, head) 947 - dma_free_attrs(&auxdev->dev, sizeof(struct isys_fw_msgs), 948 - fwmsg, fwmsg->dma_addr, 0); 949 - 950 - isys_unregister_devices(isys); 951 - isys_notifier_cleanup(isys); 952 - 953 - cpu_latency_qos_remove_request(&isys->pm_qos); 954 - 955 - if (!isp->secure_mode) { 956 - ipu6_cpd_free_pkg_dir(adev); 957 - ipu6_buttress_unmap_fw_image(adev, &adev->fw_sgt); 958 - release_firmware(adev->fw); 959 - } 960 - 961 - for (i = 0; i < IPU6_ISYS_MAX_STREAMS; i++) 962 - mutex_destroy(&isys->streams[i].mutex); 963 - 964 - isys_iwake_watermark_cleanup(isys); 965 - mutex_destroy(&isys->stream_mutex); 966 - mutex_destroy(&isys->mutex); 938 + dma_free_attrs(dev, sizeof(struct isys_fw_msgs), fwmsg, 939 + fwmsg->dma_addr, 0); 967 940 } 968 941 969 942 static int alloc_fw_msg_bufs(struct ipu6_isys *isys, int amount) ··· 1125 1140 1126 1141 ret = isys_register_devices(isys); 1127 1142 if (ret) 1128 - goto out_remove_pkg_dir_shared_buffer; 1143 + goto free_fw_msg_bufs; 1129 1144 1130 1145 ipu6_mmu_hw_cleanup(adev->mmu); 1131 1146 1132 1147 return 0; 1133 1148 1149 + free_fw_msg_bufs: 1150 + free_fw_msg_bufs(isys); 1134 1151 out_remove_pkg_dir_shared_buffer: 1135 1152 if (!isp->secure_mode) 1136 1153 ipu6_cpd_free_pkg_dir(adev); ··· 1152 1165 ipu6_mmu_hw_cleanup(adev->mmu); 1153 1166 1154 1167 return ret; 1168 + } 1169 + 1170 + static void isys_remove(struct auxiliary_device *auxdev) 1171 + { 1172 + struct ipu6_bus_device *adev = auxdev_to_adev(auxdev); 1173 + struct ipu6_isys *isys = dev_get_drvdata(&auxdev->dev); 1174 + struct ipu6_device *isp = adev->isp; 1175 + unsigned int i; 1176 + 1177 + free_fw_msg_bufs(isys); 1178 + 1179 + isys_unregister_devices(isys); 1180 + isys_notifier_cleanup(isys); 1181 + 1182 + cpu_latency_qos_remove_request(&isys->pm_qos); 1183 + 1184 + if (!isp->secure_mode) { 1185 + ipu6_cpd_free_pkg_dir(adev); 1186 + ipu6_buttress_unmap_fw_image(adev, &adev->fw_sgt); 1187 + release_firmware(adev->fw); 1188 + } 1189 + 1190 + for (i = 0; i < IPU6_ISYS_MAX_STREAMS; i++) 1191 + mutex_destroy(&isys->streams[i].mutex); 1192 + 1193 + isys_iwake_watermark_cleanup(isys); 1194 + mutex_destroy(&isys->stream_mutex); 1195 + mutex_destroy(&isys->mutex); 1155 1196 } 1156 1197 1157 1198 struct fwmsg {
+1 -4
drivers/media/pci/intel/ipu6/ipu6.c
··· 285 285 #define IPU6_ISYS_CSI2_NPORTS 4 286 286 #define IPU6SE_ISYS_CSI2_NPORTS 4 287 287 #define IPU6_TGL_ISYS_CSI2_NPORTS 8 288 - #define IPU6EP_MTL_ISYS_CSI2_NPORTS 4 288 + #define IPU6EP_MTL_ISYS_CSI2_NPORTS 6 289 289 290 290 static void ipu6_internal_pdata_init(struct ipu6_device *isp) 291 291 { ··· 726 726 727 727 pm_runtime_forbid(&pdev->dev); 728 728 pm_runtime_get_noresume(&pdev->dev); 729 - 730 - pci_release_regions(pdev); 731 - pci_disable_device(pdev); 732 729 733 730 release_firmware(isp->cpd_fw); 734 731
+4 -1
drivers/media/pci/intel/ivsc/mei_csi.c
··· 677 677 return -ENODEV; 678 678 679 679 ret = ipu_bridge_init(&ipu->dev, ipu_bridge_parse_ssdb); 680 + put_device(&ipu->dev); 680 681 if (ret < 0) 681 682 return ret; 682 - if (WARN_ON(!dev_fwnode(dev))) 683 + if (!dev_fwnode(dev)) { 684 + dev_err(dev, "mei-csi probed without device fwnode!\n"); 683 685 return -ENXIO; 686 + } 684 687 685 688 csi = devm_kzalloc(dev, sizeof(struct mei_csi), GFP_KERNEL); 686 689 if (!csi)
+4 -3
drivers/media/pci/mgb4/mgb4_core.c
··· 642 642 struct mgb4_dev *mgbdev = pci_get_drvdata(pdev); 643 643 int i; 644 644 645 - #ifdef CONFIG_DEBUG_FS 646 - debugfs_remove_recursive(mgbdev->debugfs); 647 - #endif 648 645 #if IS_REACHABLE(CONFIG_HWMON) 649 646 hwmon_device_unregister(mgbdev->hwmon_dev); 650 647 #endif ··· 655 658 for (i = 0; i < MGB4_VIN_DEVICES; i++) 656 659 if (mgbdev->vin[i]) 657 660 mgb4_vin_free(mgbdev->vin[i]); 661 + 662 + #ifdef CONFIG_DEBUG_FS 663 + debugfs_remove_recursive(mgbdev->debugfs); 664 + #endif 658 665 659 666 device_remove_groups(&mgbdev->pdev->dev, mgb4_pci_groups); 660 667 free_spi(mgbdev);