Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2918207rwb; Mon, 15 Aug 2022 14:02:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Lvgw8WbEcqrtOvm/BlsleUKqM6W6t62ml0oFZMdfgWJaU6HbHKSQNXoYzZjpDk5sU1r9p X-Received: by 2002:aa7:da4b:0:b0:43d:cc2e:c097 with SMTP id w11-20020aa7da4b000000b0043dcc2ec097mr16157195eds.188.1660597375007; Mon, 15 Aug 2022 14:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597374; cv=none; d=google.com; s=arc-20160816; b=Q9FH3iEJAABYr25MmFnfQlMqPp/aGTlt+o/3W6hegLX589Iik6VuNsmXqTyjvFT0Me K4b4de175iQSmPxuxa+MMtTsghSCYUFeD9GxqojsXvyZANkM4Ogtz6n3o4Hn55oFo5nh DUrhEVrwsCE6s2QgSn5PTyJzm8oqM08e+/xLyEknYFixQdYjbcRGsOKJWVlU/dYa7laL FeMtNk9ahdvIdmHmJT94+Hb4Rzm4MlPTuWxaYl++LsiWrNRQuNTvFvNUKkeF36ngtIBR X/HfQkE7UIqtIHcHY2tzruEnngZc+tHBodUsIhG/Vv3NKrDfMPzvMIV7KUbaeYFvWwJz g0+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vw2aEgsbaIt5/Zw31YZ4lk+xe6hLeF7vbcJ2MnvxF6k=; b=hgBP5VKhVbveITrdxbqs0JkCmxuO9HoJUnd8ZySl/G1hJT5WMOS/mE4+WG4l8u6tq9 jv/3SKaseEUTglGW4lUxQujOwa5CFUgUHY5lJYrYCXb4xUCKEREuhbAUxgjhfR7yrzCl e2NJpkpPMygirIvo+f6VNZ4bVTiorA24VQfexvUcna0DFEQzRGDLC72k690wK+MkFO6B bkyv0cMCSEiOjxlvT35UZzrVBo85wbTd33z/0KX5wiT3TaXw1Q2XWSn669CgstlQYuCu XNKzoALooqV+ZMLvZcHv+zNmzawdOdfbiMhuT7o7B+mh3zRK23TSbdaNjJBXyh9EtsDC SeSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=phk4YWV6; 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=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw40-20020a1709066a2800b00732fca94958si8866447ejc.706.2022.08.15.14.02.29; Mon, 15 Aug 2022 14:02:54 -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=@quicinc.com header.s=qcppdkim1 header.b=phk4YWV6; 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=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344109AbiHOTgO (ORCPT + 99 others); Mon, 15 Aug 2022 15:36:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245049AbiHOT3u (ORCPT ); Mon, 15 Aug 2022 15:29:50 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 051725E337; Mon, 15 Aug 2022 11:44:06 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27FHMNaK030017; Mon, 15 Aug 2022 18:43:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=vw2aEgsbaIt5/Zw31YZ4lk+xe6hLeF7vbcJ2MnvxF6k=; b=phk4YWV6PTYU+9EHaLJECmxMb0kLbT9vsI9iiBRG/5vsoI2ZupaeyQJRmrkgYAlJfs5d fr6A7lwlNRWaPLdchYSso+Ry7bMsVN5HgB/ZUECeOwK9KPc+E/d8vWfbAB1pCevJB7tX dJ3llJOrKM+GZbmg8nLlho1qTl8mAqF27X02cH5Nd3kCtot5dE8YUz+Y5eVj4TzwWVCi bjRCS2llK7/q8B/tYd0cZEcYiTGmTCv755jXYjM7Z1MRpBTAExFs3B/cUVgmttVDHZjb MAuxOlKoYM3yf2/nqZIL6OCizJqO1Cktp/Si4JLrWKyDiL9oWUkDTxe2pr37nZIF68Iy 7g== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3hx1nkpcyp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Aug 2022 18:43:00 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 27FIgxH2002139 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Aug 2022 18:42:59 GMT Received: from jhugo-lnx.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Mon, 15 Aug 2022 11:42:58 -0700 From: Jeffrey Hugo To: , , , , CC: , , , , , , Jeffrey Hugo Subject: [RFC PATCH 00/14] QAIC DRM accelerator driver Date: Mon, 15 Aug 2022 12:42:22 -0600 Message-ID: <1660588956-24027-1-git-send-email-quic_jhugo@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: FszHdqSkAcX3-nHcj_vrX0c14wKRl-Dw X-Proofpoint-ORIG-GUID: FszHdqSkAcX3-nHcj_vrX0c14wKRl-Dw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-15_08,2022-08-15_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 clxscore=1011 malwarescore=0 mlxscore=0 impostorscore=0 mlxlogscore=980 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208150070 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 This patchset introduces a Linux Kernel driver (QAIC - Qualcomm AIC) for the Qualcomm Cloud AI 100 product (AIC100). Qualcomm Cloud AI 100 is a PCIe adapter card that hosts a dedicated machine learning inference accelerator. Tons of documentation in the first patch of the series. The driver was a misc device until recently. In accordance with the 2021 Ksummit (per LWN), it has been converted to a DRM driver due to the use of dma_buf. For historical purposes, the last revision that was on list is: https://lore.kernel.org/all/1589897645-17088-1-git-send-email-jhugo@codeaurora.org/ The driver has evolved quite a bit in the two years since. Regarding the open userspace, it is currently a work in progress (WIP) but will be delivered. The motivation for this RFC series is to get some early feedback on the driver since Daniel Vetter and David Airlie indicated that would good idea while the userspace is being worked on. We are a bit new to the DRM area, and appreciate all guidence/feedback. Questions we are hoping to get an answer to: 1. Does Qualcomm Cloud AI 100 fit in DRM? 2. Would a "QAIC" directory in the GPU documentation be acceptable? We'd like to split up the documentation into multiple files as we feel that would make it more organized. It looks like only AMD has a directory, everyone else has a single file. Things that are still a todo (in no particular order): -Open userspace (see above) -Figure out what to do with the device partitioning feature. The uAPI for it is clunky. Seems like perhaps it should fall under a cgroup. The intent is to start a discussion over in the cgroup area to see what the experts say. -Add proper documentation for our sysfs additions -Extend the driver to export a few of the MHI channels to userspace. We are currently using an old driver which was proposed and rejected. Need to refactor and make something QAIC specific. -Covert the documentation (patch 1) to proper rst syntax Jeffrey Hugo (14): drm/qaic: Add documentation for AIC100 accelerator driver drm/qaic: Add uapi and core driver file drm/qaic: Add qaic.h internal header drm/qaic: Add MHI controller drm/qaic: Add control path drm/qaic: Add datapath drm/qaic: Add debugfs drm/qaic: Add RAS component drm/qaic: Add ssr component drm/qaic: Add sysfs drm/qaic: Add telemetry drm/qaic: Add tracepoints drm/qaic: Add qaic driver to the build system MAINTAINERS: Add entry for QAIC driver Documentation/gpu/drivers.rst | 1 + Documentation/gpu/qaic.rst | 567 +++++++++ MAINTAINERS | 7 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/qaic/Kconfig | 33 + drivers/gpu/drm/qaic/Makefile | 17 + drivers/gpu/drm/qaic/mhi_controller.c | 575 +++++++++ drivers/gpu/drm/qaic/mhi_controller.h | 18 + drivers/gpu/drm/qaic/qaic.h | 396 ++++++ drivers/gpu/drm/qaic/qaic_control.c | 1788 +++++++++++++++++++++++++++ drivers/gpu/drm/qaic/qaic_data.c | 2152 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/qaic/qaic_debugfs.c | 335 +++++ drivers/gpu/drm/qaic/qaic_debugfs.h | 33 + drivers/gpu/drm/qaic/qaic_drv.c | 825 +++++++++++++ drivers/gpu/drm/qaic/qaic_ras.c | 653 ++++++++++ drivers/gpu/drm/qaic/qaic_ras.h | 11 + drivers/gpu/drm/qaic/qaic_ssr.c | 889 ++++++++++++++ drivers/gpu/drm/qaic/qaic_ssr.h | 13 + drivers/gpu/drm/qaic/qaic_sysfs.c | 113 ++ drivers/gpu/drm/qaic/qaic_telemetry.c | 851 +++++++++++++ drivers/gpu/drm/qaic/qaic_telemetry.h | 14 + drivers/gpu/drm/qaic/qaic_trace.h | 493 ++++++++ include/uapi/drm/qaic_drm.h | 283 +++++ 24 files changed, 10070 insertions(+) create mode 100644 Documentation/gpu/qaic.rst create mode 100644 drivers/gpu/drm/qaic/Kconfig create mode 100644 drivers/gpu/drm/qaic/Makefile create mode 100644 drivers/gpu/drm/qaic/mhi_controller.c create mode 100644 drivers/gpu/drm/qaic/mhi_controller.h create mode 100644 drivers/gpu/drm/qaic/qaic.h create mode 100644 drivers/gpu/drm/qaic/qaic_control.c create mode 100644 drivers/gpu/drm/qaic/qaic_data.c create mode 100644 drivers/gpu/drm/qaic/qaic_debugfs.c create mode 100644 drivers/gpu/drm/qaic/qaic_debugfs.h create mode 100644 drivers/gpu/drm/qaic/qaic_drv.c create mode 100644 drivers/gpu/drm/qaic/qaic_ras.c create mode 100644 drivers/gpu/drm/qaic/qaic_ras.h create mode 100644 drivers/gpu/drm/qaic/qaic_ssr.c create mode 100644 drivers/gpu/drm/qaic/qaic_ssr.h create mode 100644 drivers/gpu/drm/qaic/qaic_sysfs.c create mode 100644 drivers/gpu/drm/qaic/qaic_telemetry.c create mode 100644 drivers/gpu/drm/qaic/qaic_telemetry.h create mode 100644 drivers/gpu/drm/qaic/qaic_trace.h create mode 100644 include/uapi/drm/qaic_drm.h -- 2.7.4