Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1745831rwb; Mon, 7 Nov 2022 05:25:08 -0800 (PST) X-Google-Smtp-Source: AMsMyM7kuIOos4Cr9IenxzNPvQvg0gPUEMa2XDz3FzL5BlhUhO4/ICqAfrQQhCRcTa/LnGgZbLFX X-Received: by 2002:a05:6402:1382:b0:464:1e50:1a41 with SMTP id b2-20020a056402138200b004641e501a41mr25613972edv.245.1667827508190; Mon, 07 Nov 2022 05:25:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1667827508; cv=pass; d=google.com; s=arc-20160816; b=m33LamxwRE6DOXnIhpSOVAhQLnuWyESpJvKnCuSbFULc+DGzyKOhv9U1tiwNI00nHH R++MOtPtUxMhxid9+Ogc15mQeq/MVtnpaT8LstQK6WgnKFkKBZ/IlpilcCeU2L/PIVzY CCTBRKf9s2Dml1O68L05VgOvsAhU0aZS2PWdBWVeR2R+6yTZrP2GAqbg/dUOnI492Fm0 bioEDbNPuW7ns0XBxlaTvz8BLIRGOa6nTs9EONRnnegeRXowVPEON0KG1NnkPpp3ztRP 88/xyj5mwTPbFd3Sn6YCcnmFofu63u3HYQLALPwS5zwrytif3Pp9BEQ3g4q40GsdafoU 8LPQ== 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=iAgn3zVWLdlP03Eg/9KFD+rIXZWtNE3QBsDLAWSYeZk=; b=s1O/WITMai6YCxac0OBkBlDwbXqB+cDn7kQvLsgpSO2yGobtdJWKfguo7cNwCex+TX U8s2drX4MM86QOVB8GC68yclVyjZWQ/3TpbPejIdst+0mzEZrUAx/yLFCuo3rmK/Cep9 rT4l9qxH5JDIHVZ9HvA875yjsFvB6ICzlKbRxBLMDiWdYsuPvunH5bDrpiXVfJnFKL6/ Blu7hkbIYbOvUkyRdy2xL2b+bvcj/GgLdS2pT86Fuagpl5nwEhfodXQP5/ojDBgJlqTA nP2euj8WkqvyUvaZKPgFbGXp4pexutWEbGfL2nrycCZ1qmBHcMXTt2C6lT3CSoahFKOT emnQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=YBTkVAph; 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 6-20020a508e46000000b00462dca18096si8868596edx.520.2022.11.07.05.24.45; Mon, 07 Nov 2022 05:25:08 -0800 (PST) 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=YBTkVAph; 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 S231901AbiKGM4V (ORCPT + 94 others); Mon, 7 Nov 2022 07:56:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbiKGM4U (ORCPT ); Mon, 7 Nov 2022 07:56:20 -0500 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2041.outbound.protection.outlook.com [40.107.212.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 521DC1C112 for ; Mon, 7 Nov 2022 04:56:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AKn4Ek8bTuEeoq5GH/75I+CILCp1mVJPDIxnD0tSNt1MDlCbWDKJzJzTafje0KjKz3F9kRCqTFHMfBnKYrVmqgT3g50njpvt9wJWu7lSa3vSPeT6eDH9vjGrBB0gulC5k6uuGEK/gBUYzo25ixaVY/Rp8n/gRzfc3UBcxukbnR1v4CXcuWpcD0QaQOGXjTMH/oDImY2psNwtQ5VJeZbpjpmgb3jhnVLWgPyxW+w2fDa8uIiMaInNkYhX1HCgjlM+gCy8AnzJ0fLlqUWcSNqOcod4HPDvKWg1LRO9UzB4AtMsGCh6oBTVcEKuTR68Z+kHz3bUvcihgCiAocFxf8rUag== 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=iAgn3zVWLdlP03Eg/9KFD+rIXZWtNE3QBsDLAWSYeZk=; b=Q/31KqBq1Q939PWKa6EnnwkdjgbXVErQ3u1nAxiWNZkWu/viqk3d8FoVvOGc601UHB62RFCNrMV346Hv5753FVyu6OGIue8it1QmRsP+6qn10iFHLFSJ1vBKq3zSkfUOzyvvd9QtvelOFoWBWmXxBSqoKKbJX9yRnzIvyK0QHldlJhzupCitcJzdJ1WPJqqAZgc8yLUw4b7vwp+J2vZONk/HtllLW7LXcIJVLVglzDs1rXyc4zBzP4LDue3e5Mjjt8bdI1HJFl+Uho3BsNDu8MIWL0Uw4AjfUJ88pYDuUg0ufR2BjchKmzO/xsF0dYbQoSYLMJGk0gVT8w89Jrc75A== 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=iAgn3zVWLdlP03Eg/9KFD+rIXZWtNE3QBsDLAWSYeZk=; b=YBTkVAphjZh0d3lB7mUkncvOzXt6VdDoreJjIAXWtL50ep60Bh557Zf+fa9O/gvGn97/JB/r9tHIj8mehBpUFEJlFHRiU4FRh6O/3GEo2SYdFV/hAEAuoecadmAq+xANnJPbCoCA1SyaNeQ8OKhgKGXXEGkJJ5ydIPJ4jMOFeCbwelaildTIqXW3OK5xC66lIz9XmMAVPPU0TskWCCJyrRk5O2BCOC7vQy8vnyA/AuJKWhORuiBX9cBC51RsdS7ZuCsbTm0G1NNtsbfPRCJIEt1u80oc1LBC+rrN1/+hgkRmnVr7JbJNNXYYLmVEOQFBWMG+0F4FJPBVs86PsSInhQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by BL1PR12MB5334.namprd12.prod.outlook.com (2603:10b6:208:31d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.26; Mon, 7 Nov 2022 12:56:17 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::7a81:a4e4:bb9c:d1de%6]) with mapi id 15.20.5791.026; Mon, 7 Nov 2022 12:56:17 +0000 Date: Mon, 7 Nov 2022 08:56:16 -0400 From: Jason Gunthorpe To: Oded Gabbay Cc: Greg Kroah-Hartman , David Airlie , Daniel Vetter , Arnd Bergmann , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, John Hubbard , Alex Deucher , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Yuji Ishikawa , Jiho Chu , Daniel Stone , Tvrtko Ursulin , Jeffrey Hugo , Christoph Hellwig , Kevin Hilman , Jagan Teki , Jacek Lawrynowicz , Maciej Kwapulinski , stanislaw.gruszka@intel.com Subject: Re: [RFC PATCH v2 1/3] drivers/accel: define kconfig and register a new major Message-ID: References: <20221102203405.1797491-1-ogabbay@kernel.org> <20221102203405.1797491-2-ogabbay@kernel.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BLAPR05CA0001.namprd05.prod.outlook.com (2603:10b6:208:36e::6) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|BL1PR12MB5334:EE_ X-MS-Office365-Filtering-Correlation-Id: aa6e3214-adbf-4ab6-eb68-08dac0bf7593 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9MXh7VlySWAuRz0qD/b9pM4hhoVBg2jS2rouzP8kNE3Gh/N2v5mRdtyK1lJmsq5hgFZBMpZuKWSVLmpKLIu40EiKmb/hmxc3+CN9VTC5nRQADkw3871Fs3GEao2EnaCVl4Hu07xeRl1tIAHklDNwMrAIjHe4VX1hET/yE36BTGhIEC+xUzssChIg0QrFjbO8oIPOq4FBkBZYFFolc7vf1kqJbt+l32/HY6P4kGCcRbfE2TS2BKsr1n0TPVu52cfMH9LYIrWkSCk1KoCzmuyMTINfI9v91Wuc4jQ4WKKkh5wozK4Jznz2j1cgJZImrBqZi7F6OJdp8YM6N/pr8UUCO0kYVrnKzBVWGG8o7L5pNyhL1rWEuTrHjIFUm14HmONufwTqpTaL6ZTdwgKetr+PqrCYAMyWJ9M0ZjSxoW5Krvy7cqK0lou+IL0PM6/na7yRilcqa1EYMw3GIEVeQ89bSLo96T4FLisLSzRLfnqdKMAZEwGm03KvGNoGOfY3W2gy2rRNWHnXhxuqTtFGzetByUwbZYaBGEOcJ3mO55i6gmlE+3X2hRUx6HuEPwp1sUzqSxt/ZXmFjN/pJYGp/jvnqXTmyaraiGj7Ky7nBXphA+nsNyJSP9g0r7FmHN0imaxZPsb6WNryYj6Rrba1cQkqg1kVfrJ3qonm6U5ZN2zgV8c4XTU0EySldyUBROGRZg8+X40h02E7KdCNoNRUlFjD9Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(366004)(396003)(376002)(346002)(136003)(451199015)(5660300002)(8936002)(38100700002)(7416002)(41300700001)(8676002)(4326008)(66946007)(66476007)(66556008)(2906002)(83380400001)(316002)(36756003)(6916009)(86362001)(54906003)(478600001)(53546011)(26005)(6512007)(6506007)(6486002)(2616005)(186003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sVgXKt+CrtvbWqrgNUaUYQFN1pN88g5czUrmppHIDMOB5tzIC9wGa1pCrnta?= =?us-ascii?Q?sOsq5avPN33SeT6PlopFqjpt0wCLErYlVD1FAPur4SlsDmjHdVdDa57cilaV?= =?us-ascii?Q?omkNzior6G+aj0pgpkyqWIBzs2EowmGsRj0Q8jruVK5D/E0Xd6YpEozIkIfU?= =?us-ascii?Q?X8VczBLWoaDOn0Qz9SmzJcj9fhbZeOLJ8uF4ncPlez2JIcNeUgStDNiBLojR?= =?us-ascii?Q?Tn7sO16JbNyRlZojSkTYtkr+dByU0HIsaHHVIkwqL/5vRUx+BFSZ8rH9ZyNM?= =?us-ascii?Q?fLCRahARmoxXhx2HPegipDtU2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rDFNZZ5SkEhIMc9DdIUEWlUU6+Neb6CEEk3XeG9MgRy1rbX8DCA/4h?= =?us-ascii?Q?43QK1xShsZQJNOAyb1hWNPqXnChXirkjKLMXYGYn9/v7wFYMfyY8tlLP8jIP?= =?us-ascii?Q?0iIwvem1w4QVGP9L0MU9iuFyXal21RJgMwv3zbfETYqxn53Q7pAbYQQjC5if?= =?us-ascii?Q?S8GBxyWDWgp4u9BYTxB1bMnqZZ73qsOq6EX9ETUkRcN/PJCA3rmz8uzJPzow?= =?us-ascii?Q?B0vBc/isY0d6tzncAfCAhEVhVgfqzGSMqrFG9J4vVsvrnQbC2dq/FDEXBbJO?= =?us-ascii?Q?G+sE9SCneVfUCCWbHFWuEIKydClbejiYMSKTLSyNqJBiRpb7qEGKi40g4MVx?= =?us-ascii?Q?xhKzctWlxi6IldUQYMftP9bjkqQjbtQHqptUM2th?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa6e3214-adbf-4ab6-eb68-08dac0bf7593 X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2022 12:56:17.3073 (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: Ef0KuyMsIMxv5MKNgjtYxVnqnwAEKqlYPZibh6qN1zyJquFZ/YTSfMvkP4BzNyHG X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5334 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, Nov 03, 2022 at 10:39:36PM +0200, Oded Gabbay wrote: > On Thu, Nov 3, 2022 at 3:31 PM Oded Gabbay wrote: > > > > On Thu, Nov 3, 2022 at 2:31 AM Greg Kroah-Hartman > > wrote: > > > > > > On Wed, Nov 02, 2022 at 10:34:03PM +0200, Oded Gabbay wrote: > > > > --- /dev/null > > > > +++ b/drivers/accel/Kconfig > > > > @@ -0,0 +1,24 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only > > > > +# > > > > +# Compute Acceleration device configuration > > > > +# > > > > +# This framework provides support for compute acceleration devices, such > > > > +# as, but not limited to, Machine-Learning and Deep-Learning acceleration > > > > +# devices > > > > +# > > > > +menuconfig ACCEL > > > > + tristate "Compute Acceleration Framework" > > > > + depends on DRM > > > > + help > > > > + Framework for device drivers of compute acceleration devices, such > > > > + as, but not limited to, Machine-Learning and Deep-Learning > > > > + acceleration devices. > > > > + If you say Y here, you need to select the module that's right for > > > > + your acceleration device from the list below. > > > > + This framework is integrated with the DRM subsystem as compute > > > > + accelerators and GPUs share a lot in common and can use almost the > > > > + same infrastructure code. > > > > + Having said that, acceleration devices will have a different > > > > + major number than GPUs, and will be exposed to user-space using > > > > + different device files, called accel/accel* (in /dev, sysfs > > > > + and debugfs) > > > > > > Module name if "M" is chosen? > > Will add > So, unfortunately, the path of doing accel as a kernel module won't > work cleanly (Thanks stanislaw for pointing this out to me). > The reason is the circular dependency between drm and accel. drm calls > accel exported symbols during init and when devices are registering > (all the minor handling), and accel calls drm exported symbols because > I don't want to duplicate the entire drm core code. I really don't think this is the right way to integrate with DRM. Accel should be a layer over top of DRM, not have these wakky co-dependencies. The fact you are running into stuff like this already smells really bad. Jason