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 24A60C30653 for ; Tue, 25 Jun 2024 18:44:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=W7L/MtvXundCyWrRjvsF7if5FsV+JY1h+CkGVz7wH0o=; b=m/5whjWyIxAc3UHWoLok4Mq57s HNUhP/vIcz0pbNEkHMNW7kVhPjTnocUBXve+CiP6MKbLmwH+6ROP0Y6FehSNnR8BaXGuWTJ0+WQ8s X8E/V7AMS/t+pLnpP5jSfASGe3yppv+yomfcwVKM/QoOzsZuyYEBpHbTns5oQCCBf8rPdtaej5bYi 3hZXs4FXp7EIyIm3DP77RpV41h2KTK0UjPzcX4Fj8zqV5AIcy5URuT+W3mT0TduA3NgfruvU5AvkN alV/1mSqAm/QH6rcGZYBWSYLBsSR2X9NUq7alFKTUHOsVnjCrTrv5rIaFa7MoRKSiT2uvTcaDVola 7j8KLvgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMB9O-000000048yc-09GS; Tue, 25 Jun 2024 18:44:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMB9H-000000048vO-3Chb for linux-arm-kernel@lists.infradead.org; Tue, 25 Jun 2024 18:44:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D1AF6339; Tue, 25 Jun 2024 11:44:33 -0700 (PDT) Received: from [10.57.73.131] (unknown [10.57.73.131]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B5193F73B; Tue, 25 Jun 2024 11:44:06 -0700 (PDT) Message-ID: <4db1945e-ec8c-4e96-90fc-cd5386a9d6b4@arm.com> Date: Tue, 25 Jun 2024 19:44:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 3/4] OF: Simplify of_iommu_configure() To: Andy Shevchenko Cc: Will Deacon , Joerg Roedel , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, Rob Herring , Saravana Kannan , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , Jean-Philippe Brucker References: <0dc14431c8a495e1135fc1d9c4500d4cb96b4e39.1718994350.git.robin.murphy@arm.com> From: Robin Murphy Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240625_114411_876441_B5EDD143 X-CRM114-Status: GOOD ( 14.66 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024-06-22 11:23 pm, Andy Shevchenko wrote: > On Fri, Jun 21, 2024 at 8:47 PM Robin Murphy wrote: >> >> We no longer have a notion of partially-initialised fwspecs existing, >> and we also no longer need to use an iommu_ops pointer to return status >> to of_dma_configure(). Clean up the remains of those, which lends itself >> to clarifying the logic around the dma_range_map allocation as well. > > ... > >> + if (!err && dev->bus) >> + err = iommu_probe_device(dev); >> >> + if (err && err != -EPROBE_DEFER) >> + dev_dbg(dev, "Adding to IOMMU failed: %d\n", err); > > Hmm... I'm wondering if dev_err_probe() can be used here. It's still possible to have other errors here benignly [1] (however questionable the underlying reason), and this has always been a dev_dbg(), it's just getting shuffled around again. The aim here is to carry on removing cruft to work towards getting rid of this iommu_probe_device() call altogether since it's fundamentally wrong, so I'm not inclined to add anything new or spend too much effort polishing code I still want to delete. >> return err; > > ... > >> + dev_dbg(dev, "device is%sbehind an iommu\n", >> + !ret ? " " : " not "); > > Why not a positive test? Again, mostly because that's how it was written in 2014, same reason I'm not deduplicating the redundant space despite it still being the tiniest bit irritating. If you make me think about it, though, I suppose when both outcomes are otherwise equally weighted it does seems natural to consider "success" before "failure", thus the condition tests for success. Thanks, Robin. [1] https://lore.kernel.org/linux-iommu/bbmhcoghrprmbdibnjum6lefix2eoquxrde7wyqeulm4xabmlm@b6jy32saugqh/