Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7029428rwi; Mon, 24 Oct 2022 09:00:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4vNAAW9zvfQMugyo8gHgSmFEGH+4IlomqaWGFJX7UCniLB2b04WEmsN8G3xqj+ruxzp7y9 X-Received: by 2002:a17:906:ee8e:b0:730:4a24:f311 with SMTP id wt14-20020a170906ee8e00b007304a24f311mr28952409ejb.420.1666627213951; Mon, 24 Oct 2022 09:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627213; cv=none; d=google.com; s=arc-20160816; b=ltx4xWdz13HKBIbAJDWcD7De9kKhDbw8mstzYYkzyQRyVrHHU229yvtldMsaxLRKj5 OpE8pWEeMaLwv/RqXAeMmK6dYv2fhO0SMwtMKpehLafFtPFOH8acTMgjuqFE8tTSs+tt qkiFJ8SiF1wYoTai+0Hifdeu5o7pk4JNTwnNWBcmKr/hjv4qRIJm2bqOBAqgR3x/2CuP xT8gOV6U04YnpIz75wXntYxk8zs2oEjtVnnYov/rr7zmBJSfq97kVnO85c9X9+YetBYu 3WzjFX77wzblar4Er4Suu7uOxbxVlWAYq2tP+mBrohDUtrMptUm6PPnozYgUnIpAD70I mPuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SLy1rvfHOR6fvZX4wUC0MNcz5p/zlg2NigI8l8/yRGs=; b=rV8oJ2kgRTWgw5qDzkvHpeVGEoasVV20bs2FZT3ldaSrfCCzx1V/hIf+ENGQr6rA+x QLhDcEVNino2T8IIde60XaMOK1iumw76YcQAdnUEBNbs2sT4loW7z4yCJZJfdkHm8Pau TwlUnYWnTybvh9nN102NvfhsA46hV+OdsBg2M8re2msesri/9XSIWfaA/7kUvR57Ibw/ m7IaRw8qOmLrkjwsYd72jILCKhN9G31fdfHO/LPK9i18Zj4W4zTOZYXoGduCHu6t505E Q7quLWWJQVBGXn3e15EhW2jkUqZG4wArFkYZo/Ru8vl5HDJhGCN9GVlO4HgkdYasEtzJ plRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CqIasuSZ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd15-20020a170907968f00b00792e39c31dcsi63596ejc.988.2022.10.24.08.59.49; Mon, 24 Oct 2022 09:00:13 -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=@gmail.com header.s=20210112 header.b=CqIasuSZ; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230446AbiJXPS1 (ORCPT + 99 others); Mon, 24 Oct 2022 11:18:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbiJXPSH (ORCPT ); Mon, 24 Oct 2022 11:18:07 -0400 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9382DF46 for ; Mon, 24 Oct 2022 06:59:28 -0700 (PDT) Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-13b103a3e5dso11941466fac.2 for ; Mon, 24 Oct 2022 06:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SLy1rvfHOR6fvZX4wUC0MNcz5p/zlg2NigI8l8/yRGs=; b=CqIasuSZ5uIB8stglnpfvRgHPEbtPHy4hdOHecTc7Ln8YdB+iByVHXCFS9O2jfv8PS wU3QKz7U4/dHwBkvlQPvjTn1W4rbR3OQc8uqQg/iaRau7l/WE8jbC8gL800Vqutztqmv HTDTDtx6225EYgaNUh4EYdNwjXq9ogpoAVym2U2JDkBmcURzY1R/t+sjRk8LX+1CvCa3 QnVX3pCx0r7jePe6fBuwR9qmwLRL4fs0iNSYh8ss534bjb4SkiBCWp9jN62nGtG6koa1 a5Vhv1SQt0cCmuIBDKUsoD871gE8ZmPtDyAyIfEVdcAuYG9tej/ZJM103Xl1yLqmuWlG k70w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SLy1rvfHOR6fvZX4wUC0MNcz5p/zlg2NigI8l8/yRGs=; b=M+3Oc9AGdcgAkikNz01IcQRX52fftBlflHBeCRfAsJr66fd0Sl+lZQDtGtzRdQXBpS cLzIAKS3E11zVtT1q2V5KN73LnqUoovuGRQWWvBhj6hDd+CaCI8WI1pVgq6M3s5OTfdS Zts1QBsNBIIR1bVrSp3OJhj54c+RH2fCdYX22oU0yEET5km6kcVdvcDqYAfejuQfLKpJ 2QDKYXvvMhqX9wMhoc5M/4hqXHLPcke9JgA1RlkFAzbJGVo6Odtl2E0pC771+nmBBym+ G6K1P2zSjirZuD4eIXEhAeT+xIawyBge5U6ZdgqQT4KqSTwQ580Edk+AtJUMl3Rf0jFT k2aw== X-Gm-Message-State: ACrzQf33jvDFAciK+rxJXqQiMbk5ZOSs+Ju1M+AW7Rq63TjxIdvPq2+H Ckrwc9IEdMaDgMz3dI2nIBBFS1xlXJfNjFxdBQE= X-Received: by 2002:a05:6870:a116:b0:13a:f9de:6fd0 with SMTP id m22-20020a056870a11600b0013af9de6fd0mr13348716oae.46.1666619717251; Mon, 24 Oct 2022 06:55:17 -0700 (PDT) MIME-Version: 1.0 References: <20221022214622.18042-1-ogabbay@kernel.org> In-Reply-To: <20221022214622.18042-1-ogabbay@kernel.org> From: Alex Deucher Date: Mon, 24 Oct 2022 09:55:05 -0400 Message-ID: Subject: Re: [RFC PATCH 0/3] new subsystem for compute accelerator devices To: Oded Gabbay Cc: David Airlie , Daniel Vetter , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jason Gunthorpe , John Hubbard , Alex Deucher , Tvrtko Ursulin , Jacek Lawrynowicz , Jeffrey Hugo , Jiho Chu , Christoph Hellwig , Thomas Zimmermann , Kevin Hilman , Yuji Ishikawa , Maciej Kwapulinski , Jagan Teki Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 Sat, Oct 22, 2022 at 5:46 PM Oded Gabbay wrote: > > In the last couple of months we had a discussion [1] about creating a new > subsystem for compute accelerator devices in the kernel. > > After an analysis that was done by DRM maintainers and myself, and following > a BOF session at the Linux Plumbers conference a few weeks ago [2], we > decided to create a new subsystem that will use the DRM subsystem's code and > functionality. i.e. the accel core code will be part of the DRM subsystem. > > This will allow us to leverage the extensive DRM code-base and > collaborate with DRM developers that have experience with this type of > devices. In addition, new features that will be added for the accelerator > drivers can be of use to GPU drivers as well (e.g. RAS). > > As agreed in the BOF session, the accelerator devices will be exposed to > user-space with a new, dedicated device char files and a dedicated major > number (261), to clearly separate them from graphic cards and the graphic > user-space s/w stack. Furthermore, the drivers will be located in a separate > place in the kernel tree (drivers/accel/). > > This series of patches is the first step in this direction as it adds the > necessary infrastructure for accelerator devices to DRM. The new devices will > be exposed with the following convention: > > device char files - /dev/accel/accel* > sysfs - /sys/class/accel/accel*/ > debugfs - /sys/kernel/debug/accel/accel*/ > > I tried to reuse the existing DRM code as much as possible, while keeping it > readable and maintainable. Wouldn't something like this: https://patchwork.freedesktop.org/series/109575/ Be simpler and provide better backwards compatibility for existing non-gfx devices in the drm subsystem as well as newer devices? Alex > > One thing that is missing from this series is defining a namespace for the > new accel subsystem, while I'll add in the next iteration of this patch-set, > after I will receive feedback from the community. > > As for drivers, once this series will be accepted (after adding the namespace), > I will start working on migrating the habanalabs driver to the new accel > subsystem. I have talked about it with Dave and we agreed that it will be > a good start to simply move the driver as-is with minimal changes, and then > start working on the driver's individual features that will be either added > to the accel core code (with or without changes), or will be removed and > instead the driver will use existing DRM code. > > In addition, I know of at least 3 or 4 drivers that were submitted for review > and are good candidates to be included in this new subsystem, instead of being > a drm render node driver or a misc driver. > > [1] https://lkml.org/lkml/2022/7/31/83 > [2] https://airlied.blogspot.com/2022/09/accelerators-bof-outcomes-summary.html > > Thanks, > Oded > > Oded Gabbay (3): > drivers/accel: add new kconfig and update MAINTAINERS > drm: define new accel major and register it > drm: add dedicated minor for accelerator devices > > Documentation/admin-guide/devices.txt | 5 + > MAINTAINERS | 8 + > drivers/Kconfig | 2 + > drivers/accel/Kconfig | 24 +++ > drivers/gpu/drm/drm_drv.c | 214 +++++++++++++++++++++----- > drivers/gpu/drm/drm_file.c | 69 ++++++--- > drivers/gpu/drm/drm_internal.h | 5 +- > drivers/gpu/drm/drm_sysfs.c | 81 +++++++++- > include/drm/drm_device.h | 3 + > include/drm/drm_drv.h | 8 + > include/drm/drm_file.h | 21 ++- > include/drm/drm_ioctl.h | 1 + > 12 files changed, 374 insertions(+), 67 deletions(-) > create mode 100644 drivers/accel/Kconfig > > -- > 2.34.1 >