From patchwork Tue Sep 20 12:41:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 9341613 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6275E607D0 for ; Tue, 20 Sep 2016 12:50:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51FD02959E for ; Tue, 20 Sep 2016 12:50:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4130729680; Tue, 20 Sep 2016 12:50:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0624C2967A for ; Tue, 20 Sep 2016 12:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932570AbcITMu1 (ORCPT ); Tue, 20 Sep 2016 08:50:27 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34693 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932223AbcITMu0 (ORCPT ); Tue, 20 Sep 2016 08:50:26 -0400 Received: by mail-pf0-f196.google.com with SMTP id 21so951910pfy.1 for ; Tue, 20 Sep 2016 05:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:date:message-id:subject; bh=IaikGVfmFqM5bvvz/tEl4y3OweLYIlLmfShgZlwDLkU=; b=nEDTtIVFjBMkGwNTy6mfbnHik4H0zTOUngu89VW5N1q4rrVxzFeqX+YcR5OVqObxVL YAx/+FvddGQl9GUMT4iS8aLqvbXCwljCj06Y0qN8mr1tcasfi0qThYvXppjBMJ7Zt1we URgRMunrACHPOb2JFN3lolASU6R/J1StfkbAkr6FCiYryxpffm0N6GTmcfQD6HtxCkbf e/w92XKK355AUQB1ITVv+Tla3CjgGf6LyOcCKxkzMq7s7bPwrpWl+P3Dfsn8Ww/EJBHO 65ruYD1lV3px2YsiSs7d6xLso7Vqus5J107ot5wTStZoTLWHENER4Vwno93O/GbLPO7K t6xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:date:message-id:subject; bh=IaikGVfmFqM5bvvz/tEl4y3OweLYIlLmfShgZlwDLkU=; b=i+yU6RnCklBICmSq/f4hYQqAanZSEo6VJ6qi+VCXIRR9wpmOsrOZamLSWtv8aoDbzv a6+Jn/FTP7NQOmskqMTms3/SeMVDbyrtCW8TS3lGmi5V+Axf/MU9FfWoiwNjYMNzROae esyjrQmXrwLGtk7KZ9hlgHod98mI6R77ETVLFJyfGIz1Jlo6RT0F3kJjnOlEoEATo3WC qNSyYmVx6G8inNS2xRRPui4jbJ/te5BLCVGr+Dx/eYdwXX+SaYEbH1ZoqxwM9voV0b3z X6ldJYzFri4qeDej0qrD4qK1A7kpnjFo0MRIbLo466hFboW8bpzUAq95pp+o7EH43DZI CjNQ== X-Gm-Message-State: AE9vXwNNhFR41MMRVG5BFv7bIa3fZ/0ryypqdl/2oVIyfuz9ZaewH1MIltniukzd+eeiGw== X-Received: by 10.98.66.212 with SMTP id h81mr55936147pfd.51.1474375815367; Tue, 20 Sep 2016 05:50:15 -0700 (PDT) Received: from [127.0.0.1] (s214090.ppp.asahi-net.or.jp. [220.157.214.90]) by smtp.gmail.com with ESMTPSA id m5sm39237127paw.40.2016.09.20.05.50.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Sep 2016 05:50:14 -0700 (PDT) From: Magnus Damm To: iommu@lists.linux-foundation.org Cc: linux-renesas-soc@vger.kernel.org, Magnus Damm , laurent.pinchart+renesas@ideasonboard.com, joro@8bytes.org, geert+renesas@glider.be Date: Tue, 20 Sep 2016 21:41:44 +0900 Message-Id: <20160920124144.8629.22575.sendpatchset@little-apple> Subject: [PATCH/RFC] iommu/ipmmu-vmsa: Update ->add_device() return value Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Magnus Damm Update the IPMMU driver to return -ENODEV when adding devices not hooked up a particular IPMMU instance. Currently the ->add_device() callback implementation in the IPMMU driver returns -ENODEV for devices with no "iommus" property, however the function ipmmu_find_utlbs() may return -EINVAL. This patch updates the ipmmu_find_utlbs() return value to -ENODEV for the case when multiple IPMMU instances exist. That way the code matches the expected behaviour described in the comment of the add_iommu_group() function in iommu.c: /* * We ignore -ENODEV errors for now, as they just mean that the * device is not translated by an IOMMU. We still care about * other errors and fail to initialize when they happen. */ Signed-off-by: Magnus Damm --- Applies to next-20160920 on top of: b1e2afc iommu/ipmmu-vmsa: Fix wrong error handle of ipmmu_add_device drivers/iommu/ipmmu-vmsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 0002/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2016-09-08 18:20:06.270607110 +0900 @@ -781,7 +781,7 @@ static int ipmmu_find_utlbs(struct ipmmu of_node_put(args.np); if (args.np != mmu->dev->of_node || args.args_count != 1) - return -EINVAL; + return -ENODEV; utlbs[i] = args.args[0]; }