From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD53FC4332F for ; Mon, 14 Nov 2022 13:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o188T7PCJdlSC0fOIjpgRXTxTEyhgiGIPGElP5lxOyk=; b=NfBJVJEhtEQ+Rh qSKagoMJspWhXR0LRvTaPkRyPadi2cwZdYJqgIl29iHzrb7r9aPBs4w/bdgfz5Nl3SIO+iub+TVIe u1IAt54YscwlYfV301ENUuTGiv9YRr9Mg2Zj5jTHik0UHh+IEpXhGMbyHxZnfyuZyv0XAJWTyyTgy 6AZGK3qsWtYssIg4jyV5IvdmJAqWhWDOtEuKIIvBX/4ywIyljPxBwGG0Ghvob/CpPVQNPU7OkLn+U bgk0xpjO6nfs7t7D+m+jg5vN1XWEBImc3Nxa6e6hRQAMFlcDIxrM3cCowMUvobaYwAha2UqmlkUuu VhIVcjyvaiDIdGlRbxFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouZri-001QZr-V6; Mon, 14 Nov 2022 13:51:11 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouZrd-001QXA-76 for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 13:51:08 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67BD06109A; Mon, 14 Nov 2022 13:51:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69AD5C433C1; Mon, 14 Nov 2022 13:51:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668433863; bh=ugtcmt7FyPihhJ5NcM21Bx302D5wCzUkW8Okfg6RYvk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V8onaSjHBRHzE8wxh5vslXQpRI4NRb3sBz31h0p92zvb4qVsENG1qmK+olWrWD6e2 1xyLH14xUBfssEMvnKDJD+AZIaP55MHe2Lb6lCsOLaYBqv2y864dbbRvckC1CaE1A1 bzpEc+RonbXCltx3H71Zm7iKa+0p/vCMSznz31SLiL3BMjEHHwEat/I36CEyHtlTDe Q0odXn13SjXBG46audjKy1Ru3qO6MY9Jln9+LuU51+5sXhtOrwTuCc/SkXH/cyZCCW 6633Qoo+XuB1f5OI50TvZqcZRzTqYaLNV2DdFZwAEoB51gtgO6lyVuoIzYfYAaZlkt REI43axuPvQpw== Date: Mon, 14 Nov 2022 13:50:58 +0000 From: Will Deacon To: Nicolin Chen Cc: joro@8bytes.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jgg@nvidia.com, robin.murphy@arm.com Subject: Re: [PATCH v2] iommu/arm-smmu-v3: Restore prints in arm_smmu_attach_dev() Message-ID: <20221114135057.GE30263@willie-the-truck> References: <20221109184636.14264-1-nicolinc@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221109184636.14264-1-nicolinc@nvidia.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221114_055105_317403_F4239F5C X-CRM114-Status: GOOD ( 18.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Nov 09, 2022 at 10:46:36AM -0800, Nicolin Chen wrote: > The prints for incompatible failures in arm_smmu_attach_dev() might be > still useful for error diagnosis. As VFIO and IOMMUFD would do testing > attach() call, having previous dev_err() isn't ideal either. > > Add the prints back using dev_dbg(). > > Fixes: f4a147735793 ("iommu: Use EINVAL for incompatible device/domain in ->attach_dev") > Suggested-by: Will Deacon > Reviewed-by: Jason Gunthorpe > Signed-off-by: Nicolin Chen > --- > Changelog > v1->v2: > * Add "Fixes" line and Reviewed-by from Jason > > drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > index ab160198edd6..076d3710b1fe 100644 > --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c > @@ -2433,14 +2433,21 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) > goto out_unlock; > } > } else if (smmu_domain->smmu != smmu) { > + dev_dbg(dev, "cannot attach to SMMU %s (upstream of %s)\n", > + dev_name(smmu_domain->smmu->dev), dev_name(smmu->dev)); > ret = -EINVAL; > goto out_unlock; > } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1 && > master->ssid_bits != smmu_domain->s1_cfg.s1cdmax) { > + dev_dbg(dev, > + "cannot attach to incompatible domain (%u SSID bits != %u)\n", > + smmu_domain->s1_cfg.s1cdmax, master->ssid_bits); > ret = -EINVAL; > goto out_unlock; > } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1 && > smmu_domain->stall_enabled != master->stall_enabled) { > + dev_dbg(dev, "cannot attach to stall-%s domain\n", > + smmu_domain->stall_enabled ? "enabled" : "disabled"); > ret = -EINVAL; > goto out_unlock; Thanks! Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel