Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp11035467rwb; Fri, 25 Nov 2022 10:17:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7vslS3NvQLC1BalgThCMZGtP00ow0KteAe8tsWjmzrrQe82TRXmTIHS4ad0XAJbdAu5xM6 X-Received: by 2002:a63:5005:0:b0:470:1187:4dae with SMTP id e5-20020a635005000000b0047011874daemr20392520pgb.239.1669400273502; Fri, 25 Nov 2022 10:17:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669400273; cv=none; d=google.com; s=arc-20160816; b=HEOnVHVPNvmqQMBMeakKwygaKH1bBwV5AVYays8MOOX9mUAyPMlQpcuPKX4VNi89Il gfkHUB2PTR6iqhUqGcfQml5TiCa3UMkL/KxAK3Fmg0RoLam8VsIw1KAn1hkxAZus/iGt 58Am8Hg+NadQyw0LtLzx6TIEB6VqbDaprUvDj+Gez0U61wa3iUNwQolcVeeKdcBIc/09 ZAVIL+o6anI7o0ILcW9dAPuMAt424pEgQWCiu+keQGeOUrjFbUvEiWE6901gESsQHkFY wsweYc8t/+e+V97wo4kgHOb5d95b/16mXrY7kIUBl4oux/K9I8aW49UUeAfjzHwxh2Bt mesQ== 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=GIcWfR29KxBSmoIZOlpYH+gYQbsCenYVDvVyeGYpOa4=; b=eLB2W0cvOqsCqvW8EC9GVbkWPG/RkongqfUjeG1dOEcHGULcAkUl3hkSM2bXLneMWi yTnuLAFkW3SVxSGWZQdIuMzpiwBke2GiaWcsvfysQMZqpQxfcuXhO7P5FOzdm6lisEdU 5KlllIpfaSvzPHf0iOjPLSq4Wm4RzE3nZ7IlIyo9EmU1vF/lwgcMz8WQKW7xHCaNb3Wt oAeH18Vwou6iTNlAI6jIks1SqSaaoLCE3tWDNkAV7N00ufprqC2971wXVP/jbmXHTPg4 +ngztfQCaAqm3tRbx7CC9gkjX5KDfr6VrzLw/+f4aHuDC8E/UPeym0NYNL5oe0vX4G5B xM/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=Os8oO+tE; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j10-20020a65428a000000b00476d6927ba2si4998054pgp.659.2022.11.25.10.17.42; Fri, 25 Nov 2022 10:17:53 -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=fail header.i=@igalia.com header.s=20170329 header.b=Os8oO+tE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiKYRwf (ORCPT + 85 others); Fri, 25 Nov 2022 12:52:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiKYRwd (ORCPT ); Fri, 25 Nov 2022 12:52:33 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A75CA46B for ; Fri, 25 Nov 2022 09:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=GIcWfR29KxBSmoIZOlpYH+gYQbsCenYVDvVyeGYpOa4=; b=Os8oO+tErbmLzBCYSvntbuX9PH C88GYeet3nbuGPlPvFdLRr4wP9NmyLQJbFbHaLK/GnBl19SD7RJ7DWmQki0rdw+QDkIwM4F2Dq/c0 RMrkdgtaOEBxT+nzDVo1N91k7U2YvhR9ovwB/JiDk0UCq4UTHFCd2p7mD0zRSeQyZPMPSroQaYii+ hc2KLZYAKaIUalK4Xgxn+VNK2DTCIPtdH7XWfFPYx9n6OkfNSRTNOId0J0sTZL+2CokkGwvWJWTfw aE9bQJt6Z1zjLOaiHy90buK6e47xjpv/3D7oxfWq2mI+NwDFcVfeU8twLgTB5uU3LN1C4HTaAVqZv x3T6r+xg==; Received: from 200-148-10-170.dsl.telesp.net.br ([200.148.10.170] helo=steammachine.lan) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1oycsD-008yzi-6T; Fri, 25 Nov 2022 18:52:25 +0100 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: kernel-dev@igalia.com, alexander.deucher@amd.com, contactshashanksharma@gmail.com, amaranath.somalapuram@amd.com, christian.koenig@amd.com, pierre-eric.pelloux-prayer@amd.com, Simon Ser , Rob Clark , Andrey Grodzovsky , Pekka Paalanen , Daniel Vetter , Daniel Stone , =?UTF-8?q?=27Marek=20Ol=C5=A1=C3=A1k=27?= , Dave Airlie , "Pierre-Loup A . Griffais" , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v3 0/2] drm: Add GPU reset sysfs Date: Fri, 25 Nov 2022 14:52:01 -0300 Message-Id: <20221125175203.52481-1-andrealmeid@igalia.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 This patchset adds a udev event for DRM device's resets. Userspace apps can trigger GPU resets by misuse of graphical APIs or driver bugs. Either way, the GPU reset might lead the system to a broken state[1], that might be recovered if user has access to a tty or a remote shell. Arguably, this recovery could happen automatically by the system itself, thus this is the goal of this patchset. For debugging and report purposes, device coredump support was already added for amdgpu[2], but it's not suitable for programmatic usage like this one given the uAPI not being stable and the need for parsing. GL/VK is out of scope for this use, giving that we are dealing with device resets regardless of API. A basic userspace daemon is provided at [3] showing how the interface is used to recovery from resets. [1] A search for "reset" in DRM/AMD issue tracker shows reports of resets making the system unusable: https://gitlab.freedesktop.org/drm/amd/-/issues/?search=reset [2] https://lore.kernel.org/amd-gfx/20220602081538.1652842-2-Amaranath.Somalapuram@amd.com/ [3] https://gitlab.freedesktop.org/andrealmeid/gpu-resetd v2: https://lore.kernel.org/dri-devel/20220308180403.75566-1-contactshashanksharma@gmail.com/ André Almeida (1): drm/amdgpu: Add work function for GPU reset event Shashank Sharma (1): drm: Add GPU reset sysfs event drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 30 ++++++++++++++++++++++ drivers/gpu/drm/drm_sysfs.c | 26 +++++++++++++++++++ include/drm/drm_sysfs.h | 13 ++++++++++ 4 files changed, 73 insertions(+) -- 2.38.1