On Thu, Apr 13, 2023 at 12:05:15PM +0300, Dan Carpenter wrote: > On Thu, Apr 13, 2023 at 10:57:52AM +0200, Thierry Reding wrote: > > On Thu, Apr 13, 2023 at 08:06:08AM +0300, Dan Carpenter wrote: > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 69 > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 70 err = of_dma_configure_id(&ctx->dev, node, true, &i); > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 71 if (err) { > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 72 dev_err(host1x->dev, "IOMMU configuration failed for context device %d: %d\n", > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 73 i, err); > > > 55879dad0f3ae8 Yang Yingliang 2022-11-26 74 device_unregister(&ctx->dev); > > > 55879dad0f3ae8 Yang Yingliang 2022-11-26 75 goto unreg_devices; > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 76 } > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 77 > > > 9026ba722360ce Thierry Reding 2022-11-17 78 if (!tegra_dev_iommu_get_stream_id(&ctx->dev, &ctx->stream_id) || > > > 9026ba722360ce Thierry Reding 2022-11-17 79 !device_iommu_mapped(&ctx->dev)) { > > > 8aa5bcb6161206 Mikko Perttunen 2022-06-27 80 dev_err(host1x->dev, "Context device %d has no IOMMU!\n", i); > > > 55879dad0f3ae8 Yang Yingliang 2022-11-26 81 device_unregister(&ctx->dev); > > > 55879dad0f3ae8 Yang Yingliang 2022-11-26 @82 goto unreg_devices; > > > > > > error code? > > > > We don't actually want this to be a fatal failure, so err = 0 is what we > > want here. Should we set err = 0 explicitly here to appease smatch? > > Yes, please. Looks like Mikko has a different interpretation: http://patchwork.ozlabs.org/project/linux-tegra/patch/20230413082202.114721-2-cyndis@xxxxxxxx/ I suppose that's another way to do it. It's not exactly backwards- compatible with existing DTs, though. Thierry
Attachment:
signature.asc
Description: PGP signature