From patchwork Thu Jan 4 17:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 759867 Delivered-To: patch@linaro.org Received: by 2002:a5d:67c6:0:b0:336:6142:bf13 with SMTP id n6csp7080953wrw; Thu, 4 Jan 2024 09:13:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn4xKB06QaFFOyp3ia/+k54g438/cs49EqmmtMA7hOVYE+COJxUihhjtAco3LyyzSe05PL X-Received: by 2002:a05:600c:5251:b0:40e:36ba:e56e with SMTP id fc17-20020a05600c525100b0040e36bae56emr1941wmb.1.1704388434978; Thu, 04 Jan 2024 09:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704388434; cv=none; d=google.com; s=arc-20160816; b=Yw2O0LEOiuaFoXU64y9EaAoofph7L7DP8w4qHaDpmNwsysOMMXrZ0pj5AJHax1/kE7 YZPwAU7LnFC2nTFj97LcL7Yc6sZlWRJx7xLHvszfZQ6zeu4a7zccc+KK73Yh2o9JjAbZ /w3HyLRahamvDtbz8R8Y6Vs1f9YA4HtZGy4OoSfnWCvqLViRaBXrM4zjzD2nehdxeC8G AQsujds+PRkLzbd4xGSglb0pQX8hyTAvYX8lJpGC2dTHBIT6rSsRom5sA6Y+4QRRZhmY rmei4OrbPY5saRL0HwoOILGk9aukcg4SYCrEcFBn1xQnRmG0oXX6gObjHAXbyMgEAQr6 KD/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=g96/FLUPxCWETfyGDBBBwzPoTEFyJI5CMD6mEUwfDs8=; fh=bog/S6RZ0lLPBGm0m9i3e0ZzhYF8yfDVwY2RPtGimVk=; b=AadkIKsXL8XwZhZxGpvhVstZ356e+9yzqKOV6oDiWuxtd5+Jv4XrDnkt8wcxuU6id9 6TtTLN4g/cm5dwqrYTKrFYMXvyvt7Uo5vgFjpdlPWCfPA5C2ZenckmQxOGkcwmAIdVTn hyl7Z+j+AX6CGidDldr0OeAB+cy0OoDIDte3DRDliE3tgLR3ZTJL+MwrdHtAo82ab3gU o3r3KIOgkfCL/eYfc8l72vTcqLrGPs9vH3eFmgPTEjCEuQOGPrKPHKp4D4d+ZnTlvh9S ULg96+homNeU4+EQD6Bz4CqumUvnmcbcIHTVEGU9QKrxIkqQcNzDbwoAeMRFcbakV0Wg 5Eow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KP5O3wBY; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 18-20020a05600c249200b0040d4f3eec1asi2041980wms.196.2024.01.04.09.13.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:13:54 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KP5O3wBY; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B100E878E5; Thu, 4 Jan 2024 18:13:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KP5O3wBY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7492A87930; Thu, 4 Jan 2024 18:13:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 94CDE877D5 for ; Thu, 4 Jan 2024 18:13:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40d3c4bfe45so6283765e9.1 for ; Thu, 04 Jan 2024 09:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704388430; x=1704993230; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=g96/FLUPxCWETfyGDBBBwzPoTEFyJI5CMD6mEUwfDs8=; b=KP5O3wBYPvIea25VPq+VvjXnDh1lzgkoM0tfPlawJ+CuJ0pDDnldfZunjWid/Lj3aK 9haQSzoMtHXXYY7RAO/qOhb2Q5JU/36797TLtvnw1JHFnf3IGsL8QiEHvBZ7fsvy6mhV ZyW0s2ENI2/n4YT77qhujE7AYbOIsjkzReCQOr57pFMiQ5GBlARH4rxfnsq/f1Mpe3sC +YzrCwU5j5AV0gQmdYX4JkrRinxywgM4HIZ2oYo0aBbNMVKoH+hR51k9Oy4cES2CyYcU 2UYXG9S8bMBj/+DQYnsrY2h1YWLg/P65l0EuusQX3Yy1aX6BR+9dHD0fcA3E7cfYvY3q Jcgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704388430; x=1704993230; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g96/FLUPxCWETfyGDBBBwzPoTEFyJI5CMD6mEUwfDs8=; b=hdX8uIMHfEHF2/9hRKDOaSdVvnqlxz2U/YCBeXQ2LjzMhXN4Evl82JFTmEMCcnOLAq kXZbtFlRJL/gszK40EZ1cHvi5JxU+dtYg4SA5PB5qGsOF/RwTSTA1fm2JGWIf549aTNk p3Dp8lLS4a2W74wtjtPxiqFoDZOabADwE8311nFn2jwIOfKvWqnR2oyhGEGd2nsugpdO EEyiajStw/gGLhfoZZGPQcngfThNmBoZVekRsqas5RyUCZAH6exhAYgly7EMdhlz4HkD zpA/KuY1Nfq1/dpdmy2Oxle46DggOz2accrmgC9aVgt44YPRovpPErxm2JJCqQCKePW0 m/nQ== X-Gm-Message-State: AOJu0YzTYReT3xXp42VqDVk1huTOW/epT4zF65C3kv1AIfIP5lKmf2up hxfQyZh8EQqogMlQ9oJUYxb3Jkmx61zZ9LDSm30/gSDSEm6taA== X-Received: by 2002:a05:600c:188a:b0:40d:37c3:30d2 with SMTP id x10-20020a05600c188a00b0040d37c330d2mr253999wmp.312.1704388430019; Thu, 04 Jan 2024 09:13:50 -0800 (PST) Received: from lion.caleb.rex.connolly.tech (host-92-17-96-230.as13285.net. [92.17.96.230]) by smtp.gmail.com with ESMTPSA id p5-20020a05600c358500b0040d39d61a94sm1854086wmq.1.2024.01.04.09.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 09:13:49 -0800 (PST) From: Caleb Connolly To: Tom Rini , Mark Kettenis Cc: u-boot@lists.denx.de, Caleb Connolly Subject: [PATCH] iommu: dont fail silently Date: Thu, 4 Jan 2024 17:12:22 +0000 Message-ID: <20240104171335.342540-1-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When attempting to probe a device which has an associated IOMMU, if the IOMMU device can't be found (no driver, disabled driver, driver failed to probe, etc) then we currently fail to probe the device with no discernable error. If we fail to hook the device up to its IOMMU, we should make sure that the user knows about it. Write some better error messages for dev_iommu_enable() to facilitate this. Signed-off-by: Caleb Connolly --- drivers/iommu/iommu-uclass.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/iommu-uclass.c b/drivers/iommu/iommu-uclass.c index 6babc0e3a672..dff3239cccb1 100644 --- a/drivers/iommu/iommu-uclass.c +++ b/drivers/iommu/iommu-uclass.c @@ -86,16 +86,16 @@ int dev_iommu_enable(struct udevice *dev) ret = dev_read_phandle_with_args(dev, "iommus", "#iommu-cells", 0, i, &args); if (ret) { - debug("%s: dev_read_phandle_with_args failed: %d\n", - __func__, ret); + log_err("%s: Failed to parse 'iommus' property for '%s': %d\n", + __func__, dev->name, ret); return ret; } ret = uclass_get_device_by_ofnode(UCLASS_IOMMU, args.node, &dev_iommu); if (ret) { - debug("%s: uclass_get_device_by_ofnode failed: %d\n", - __func__, ret); + log_err("%s: Failed to find IOMMU device for '%s': %d\n", + __func__, dev->name, ret); return ret; } dev->iommu = dev_iommu; @@ -106,8 +106,11 @@ int dev_iommu_enable(struct udevice *dev) ops = device_get_ops(dev->iommu); if (ops && ops->connect) { ret = ops->connect(dev); - if (ret) + if (ret) { + log_err("%s: Failed to connect '%s' to IOMMU '%s': %d\n", + __func__, dev->name, dev->iommu->name, ret); return ret; + } } }