Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1190343rwb; Thu, 22 Sep 2022 11:18:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5RUUK0taq9rSzFvyWlnWSPyvC2eFor+Y5dw+dSZXnrzgePrGCGGTHUVnaCBIJLllo2+AH0 X-Received: by 2002:a05:6a00:2918:b0:536:3967:5d08 with SMTP id cg24-20020a056a00291800b0053639675d08mr4816860pfb.68.1663870681259; Thu, 22 Sep 2022 11:18:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663870681; cv=pass; d=google.com; s=arc-20160816; b=AlQ4DkRo+od4qgA4FNBCXVZ9u91Zik+Gj8oksjV16sAnaknL9O27murZ6wyVEO6K7+ lPTnTwLndaRNRnShT85OWbE1FBrFdmiqOEYUc/GFwPRReoQxFZVEaBLAXbo2C7KjxZ+F JerHF9gWYg5z0u//f0HErhqgFOywTpxR9vSACBYUw2nb4YYYOlIZLkcBkn6BwkMoxmQN E78uZvo75oor+EEBXvXdMZ7JQKxzfFsignpeZ8wDUe2pkBuX7JtGmCNsVAExSl6yg+gb X/vfQNKMNYt1HEVtBkSgbNZEvkh+3FUtsviHGZVCBs8xnFLCChudwENfZIGtxLH9RnUO jgdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+gc3/Dl9Zi/F2VuDvD7OEkQyvNFxK3kDdwEH9h2Bx3g=; b=wlwKvgrvJQAUfH84m92LOuWp7UxkByoL+aaZoyT9ZDq27lD9alLpiVNKT4Z1UE1wmm tV2bvjQ4npBLeA808BHoRVPH8+WDRNU+BMFtC3JUjFtLbanA9eYqVKVP9AtiyrKXdVXF WSJumKrCulI0L7jB+b6nmGqb0K2t4yoTuQOEBDmS0smTHWVmhZzqzpAm4IgnQ80SkMJP WKJlBVxfBtIvoUNJchXtzDWHIlCeEef/79x6LXNQ1Y4AAKVZHQKNucsfjPnn8Yt/wC+l D1pmFsTuMx8P71a16TMPVcnrqugGPkbY9DwQcCAHDK0RXcpDuLWw7k6LdoGDJ1wjHu39 G+YA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Lkx25gza; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q127-20020a632a85000000b00439c9310023si6231402pgq.740.2022.09.22.11.17.49; Thu, 22 Sep 2022 11:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Lkx25gza; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231839AbiIVRv1 (ORCPT + 99 others); Thu, 22 Sep 2022 13:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229713AbiIVRvY (ORCPT ); Thu, 22 Sep 2022 13:51:24 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B09FF962B for ; Thu, 22 Sep 2022 10:51:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M7fTtQWBrsB+Yak5nTeesGqMxj1KhEI5mmXQK3jUNclX9Y6m3aeZvRuQpOEX6R9zwaW4qs+3dpS8trf2ZXS0k+O7cbVLOCGsvJWGPWQaJRfrsdv+YDTJHCTa3TibP8nDi77jxS4z3oqyQme4K6/rXcGp2mdOl2nHTmL3I6h6ptrT6ml72tVwDyMydYnXUagX9Dz5qqbUY1zmikBcTiqXMikm0UK0okfgpN7tsTCEKBmxfHNdfAtr1bNudDrVOEMCfTCJ18FRY0Pgn3ZfzexxHg05HBbfCCPdvaCPhpDmhN+srpP8GOCcPFwCqZBFeu+ocEKinkS8YC7KLL/EukhDxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+gc3/Dl9Zi/F2VuDvD7OEkQyvNFxK3kDdwEH9h2Bx3g=; b=GvqdYMpBGKdJO3q2cqIbLdhTkjKzbC6BCINurKEnhD8+wJygQ0MjxMPlsa94vGvv72FqZiF01mzW+uzYpUptFD7DrrbXyKzj1tBCBJ/55ClaAE9QdPpnWD/5TsPXay7I99oqu+ycue0S7WaDMIpHB2qjDbJWLePL9/GFVx2NUTOl44SZII4Kda04D2mI9mVjc9fDLBPP8YOYU9hFzOsWsUJROAeRKFuD0RN78dSLS8a5sz/DEL8gjg0QFHOrHXsGhCoYKAgUJNFPdWKe4WSDxDyJtDEw4EnmWMmC8h5APaTMeQjKWCEFkRnpnHMtufignGnNyQ5SW/Ym44VN1FXeqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+gc3/Dl9Zi/F2VuDvD7OEkQyvNFxK3kDdwEH9h2Bx3g=; b=Lkx25gzasBvgV6Xmr0ihDlPb5MoSjd9j4kIlv9MLpPXOdaSwpf4s1lBU1QzWgHugbSy8GPtqRWYqxsA2xgDWgVSguQYwxeEK4OqUnmTJDgV3g2LzbyOajT7vfRdNOghT/r9o5rWKl6NeNLl45KQ1ZRa8SA5N0mcgwdxA1AgMz8GjIGM0SIzKaW5E9za2rtinvUMlKwEfyLHihXPoV/9LP2n2E4uLuPGaH1xX2+IIwECVhBWJ/DFW6xhbymxdfDFeitjy/9427ts3qN/9iGlX6aUmItmvQstbBQkW6nGLQDsDXCz/2unTsfvFl/cbXM3leLgv6t7q6TwrF+/E+D7UFw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) by BN9PR12MB5034.namprd12.prod.outlook.com (2603:10b6:408:104::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.19; Thu, 22 Sep 2022 17:51:22 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::462:7fe:f04f:d0d5]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::462:7fe:f04f:d0d5%7]) with mapi id 15.20.5654.019; Thu, 22 Sep 2022 17:51:22 +0000 Date: Thu, 22 Sep 2022 14:51:21 -0300 From: Jason Gunthorpe To: Nicolin Chen Cc: yong.wu@mediatek.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, matthias.bgg@gmail.com, jean-philippe@linaro.org, kevin.tian@intel.com, iommu@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v5 6/6] iommu: Propagate return value in ->attach_dev callback functions Message-ID: References: <8040df414a1d4bc007a25553b8341acf37ead670.1663836372.git.nicolinc@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8040df414a1d4bc007a25553b8341acf37ead670.1663836372.git.nicolinc@nvidia.com> X-ClientProxiedBy: BL1PR13CA0214.namprd13.prod.outlook.com (2603:10b6:208:2bf::9) To MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN2PR12MB4192:EE_|BN9PR12MB5034:EE_ X-MS-Office365-Filtering-Correlation-Id: b1d77cde-89ab-4929-edea-08da9cc30f84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FiwSxppvAszd1JDpo86xgT5DZPxRSmknVk6Zj3UZ3VS3sfvzEivY8j3OQ1sgUE16Ny9Lv9u2qOQfVHalW799GtjYkBj4hx0xgIqiUgxEC+tk1tI3dyBX8aiLOtOQudC1HGo/i0mg62reWiGNvqXi+GZeEtqTsm/jGR3tfqFUZdj0/52wZO+6aUe7DeQOpcakjCsUFafi8HyRzyrpAC+cLRLTak7Mrki22l7ELp6+Q9orQgA7DR0UAjCO8jytmrMDA1FH33mXReVPuV5rIxAZyNMAO4u2VcyQZwXS5kr0Qx629tcsaU6T1Z/didya9Mls+S2DUPbyvS9YJRCBCJN8Dbt/mtpmPN4Q9uoG709e753a7fa3kztm6KqWNkkok9+ITREFvfUJUznL2j2yIWuMPw0uCwY1YoJ2FTb3off7KxbL9i+vHUP28E/bt2igLitd1QpfkBjJ0ofCSqfsCjF9HQoGZYOVeJUyii1NtMyHyVkBEZmtvy1i4HgpOx5eyXO1sFoSHz4RjBI3I2e1iL+fVhE5crvNXA5g9IctK+NTWsq62rf21OOYwHyvUzSWeKFd4WMtrNipoua5Z2iojbgHaS/BBBXJjBck9YeU6dSN4rWPIjZYVKmCHdSqYMBWjIfcY6qinCFNke6QvIBdGYzswRv2mL5KfSHkgWHDIGIRtJjr4LI+y9KTeClmGxTTS1aFY0iTK3F+quyxxj/twLqwBw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4192.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(366004)(346002)(136003)(376002)(396003)(39860400002)(451199015)(38100700002)(2906002)(478600001)(41300700001)(4326008)(6636002)(7416002)(86362001)(4744005)(6486002)(5660300002)(6506007)(66476007)(316002)(36756003)(6862004)(37006003)(8676002)(2616005)(66946007)(66556008)(83380400001)(6512007)(26005)(8936002)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZewODiwpv5B7M/+fFWOiz3FglXf6NmmfxPpKKDIO05y+9spZ8WyPIuH1O8LE?= =?us-ascii?Q?RJL+n9KGIJIO8rc34NXQvNNjcFW5yAYedmItiK8wM2gPT7p1zeysPZ34HPGh?= =?us-ascii?Q?Zddw0ef32F3tueo6W5jAM4b9LAXXcR3kgMVBor2noylIFZxnmhqssma4T9HY?= =?us-ascii?Q?WyQXqIT2ewzUeQp2iH2Vb+AcsIf3qTyqWF8P4XsreKzVbNxbnRrPxRb/pn3N?= =?us-ascii?Q?Ml3uSklqHpvuRPRoRZvW21z8I23+RSadPjGwP2L6ODBDg7DykpkcU1j0w0d+?= =?us-ascii?Q?CGSdJVPW90srazMQM96nZ5VclNLdwN70eko5YNI60CFNJ9ggLqtb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gQId+dAEy+mIMxWgZnmVRxzcDbydfU4e?= =?us-ascii?Q?5nDQ6axvYxN1IFZ9cQWEBD8vvYpzF4FRQfTFXNR/zG2sKY9HiasdGm4OC36m?= =?us-ascii?Q?aPpVW7A4zOVWrDQL5ddtfmX2XoVyalle+S2jBPbcQdV7UCSwTlAMdAq+03bI?= =?us-ascii?Q?KGQDXYua3gt0HQoO7cRWTNERUXLKVM14EIu3ufbOdk3j5pMkPSkSwwb4ZUMR?= =?us-ascii?Q?CyipyWQB5BJEVV47174nzh39HVyFxye+QPKZF6V0K1y8+t7xwvQo98XolkAs?= =?us-ascii?Q?KH3RKT97Slc8wAlleNVNviAn9kGdLe+euDc4683T5DPlH+PYr+7wQc4TzNdJ?= =?us-ascii?Q?BnxbXdX/zZYMR9OJFSPPHqMCopJrotRuFhcxsd6E?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1d77cde-89ab-4929-edea-08da9cc30f84 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2022 17:51:22.0834 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kZbHx5KEHGnVUi+mumBvc5t64pahvzK5c9quJruU6L9O8zUj4IFGC0BK8G636Cf1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5034 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 22, 2022 at 01:54:45AM -0700, Nicolin Chen wrote: > The mtk_iommu and virtio drivers have places in the ->attach_dev callback > functions that return hardcode errnos instead of the returned values, but > callers of these ->attach_dv callback functions may care. Propagate them > directly without the extra conversions. > > Reviewed-by: Kevin Tian > Reviewed-by: Jean-Philippe Brucker > Signed-off-by: Nicolin Chen > --- > drivers/iommu/mtk_iommu.c | 2 +- > drivers/iommu/virtio-iommu.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Jason Gunthorpe Jason