Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4317421pxf; Tue, 23 Mar 2021 07:59:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyho+VqMbJVoGmhC7cp7by6fOiciiYhCDr5fggrUUplKkrpmdGKllPrcelhmYJLH6pnyCH X-Received: by 2002:a17:907:7355:: with SMTP id dq21mr5173325ejc.159.1616511544693; Tue, 23 Mar 2021 07:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616511544; cv=none; d=google.com; s=arc-20160816; b=LXDC3+JHaNF9rLweyxFUEZBGgmeWwWlhGHl65yCh7JTx1NXL889K9g5unGHVLpKWyV IV+iRh0TBQd464DLl8GAqqsG3OXkga3Zuq53Pl6HlzKXOqntQZclvlMQ6Wnq+0NwThS3 hnt5NUdzr8Vsk3P9wV2s6CI6lLlOWEu2W9j8BtX7jbKVUYy/nr8w6zIo+1BgxDafPAY1 pkrusPvNypA3AJnnEZlXYtsfZcPa2QD3O9P63J7ZGmS36nfwIadiOxp0J7QwKmpKkITX jhd1QUXjleqmV59ZLwRs3b93uSW+SeVmeIprX8+xe5IVhSZPONSDfdik8B93+qorRElV jC3g== 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=crpOCZ60DCBuwt1S72UL7ppFvHjUGvqZ5yR3kG9lxbs=; b=EtpR+LtLET5dSrhKu0BJ/4uaHTiUTpp/6DGyu3FZ9jLEc/1mnL8erufVHE50B8SSio ZObPGk7piWdAnyjdV/Nu8dDbguecaXCW9zmck+IjtmVvJG2sTKwbC8udJRd9cnlI0T2t T4JF65C47SOXzNoKWcdxCS9fb4Qd/hbCUihlJbm/bgILFXlq9zmd1D7Xr5SsKsiw0Ki9 qBAG4GsI1ZwJ/FOUSKNPjKiSak1x8atzoMIawnTVYuiFu39jYsyIwtdbRnZLFr4ZCPee tZBc+fuMIwlf6hNlCjgPl34vFaciR1F4tj74i8cqh25lhQEGC5t+0dbemEVQ6Qh1P9Tu 4W9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cJmfOsPz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si13689516ejg.224.2021.03.23.07.58.32; Tue, 23 Mar 2021 07:59:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cJmfOsPz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232486AbhCWO5D (ORCPT + 99 others); Tue, 23 Mar 2021 10:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232387AbhCWO4f (ORCPT ); Tue, 23 Mar 2021 10:56:35 -0400 Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com [IPv6:2607:f8b0:4864:20::c32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464BDC061574 for ; Tue, 23 Mar 2021 07:56:33 -0700 (PDT) Received: by mail-oo1-xc32.google.com with SMTP id n6-20020a4ac7060000b02901b50acc169fso4992958ooq.12 for ; Tue, 23 Mar 2021 07:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=crpOCZ60DCBuwt1S72UL7ppFvHjUGvqZ5yR3kG9lxbs=; b=cJmfOsPzE0P+Wx3J0VF/8JzInsyP2vvvZHUaXxyOFUTwyQhErBHfFdqxeVhtfRxLtp KMFCT3xSwNLSEYPBwkqsQMNVTRMsmhPsEYNwVVjSMGquedqLS0XoORy+Hy+LgNA7rrl5 YB/ESJgMuvnXmnHBZRHeKvWWNQezitrBqm3jv3pm9xvOVDi/7RXun3+C8VZzf3Vh6vXG G9KCi34XuLlYmtY4Xp175rYgMgvRfWVJqfKsENAwjqlWjQcw/dmDZblJTTS4JPp0DbRT 8MZHJVwjOvJqqzoCfiaLQOwZKF0pD8zpZ6rMwTKUIGskmx48uaTGQ335Uw2JQCMI0Dub YC6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=crpOCZ60DCBuwt1S72UL7ppFvHjUGvqZ5yR3kG9lxbs=; b=CDCqOgQwA53622IdKXP0nO4nbRiypfxv70/1skty0yZxejDZVdfTOhPEzJkSu9CQaY rfhVetdXrkJYLl8z11xODKDaiieLKOgAR2Td1OiWzw/q8pQpHRrnhDvfwj6Pm4nJ+zQA uLqE/vNNK+XGIHVMfy6Hf9wI5iQLOvYrsfcFuy9AI9yJE9WlPK8Rh40m/B9TehETDmjx vQaryqxZqalcUOO7aUj0sZpZiGUj17FvRUf448kmiZQ+dVl3EAn9LWoxp9cwNpUBvvDe Sy8MW6q/sNIj5evWhz3Yi+VVboaPVC3mso+Of/lBEKIH+hYoc/Tn3v9kWh4FVcokNQzQ vpOw== X-Gm-Message-State: AOAM533sQih0xmT20SfHsej3auw3GSuJjG2VExXfAT6bH7COdnidJb7R h+YysaMWSwDRGWViYL6dTs5Wq0s+mQbhTnq8Anw= X-Received: by 2002:a4a:7615:: with SMTP id t21mr4120473ooc.72.1616511392713; Tue, 23 Mar 2021 07:56:32 -0700 (PDT) MIME-Version: 1.0 References: <1616315298-109091-1-git-send-email-jinsdb@126.com> In-Reply-To: <1616315298-109091-1-git-send-email-jinsdb@126.com> From: Alex Deucher Date: Tue, 23 Mar 2021 10:56:21 -0400 Message-ID: Subject: Re: [PATCH] drm/amdkfd: Fix cat debugfs hang_hws file causes system crash bug To: Qu Huang Cc: "Kuehling, Felix" , "Deucher, Alexander" , Christian Koenig , Dave Airlie , Daniel Vetter , Maling list - DRI developers , amd-gfx list , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Applied. Thanks! Alex On Sun, Mar 21, 2021 at 5:33 AM Qu Huang wrote: > > Here is the system crash log: > [ 1272.884438] BUG: unable to handle kernel NULL pointer dereference at > (null) > [ 1272.884444] IP: [< (null)>] (null) > [ 1272.884447] PGD 825b09067 PUD 8267c8067 PMD 0 > [ 1272.884452] Oops: 0010 [#1] SMP > [ 1272.884509] CPU: 13 PID: 3485 Comm: cat Kdump: loaded Tainted: G > [ 1272.884515] task: ffff9a38dbd4d140 ti: ffff9a37cd3b8000 task.ti: > ffff9a37cd3b8000 > [ 1272.884517] RIP: 0010:[<0000000000000000>] [< (null)>] > (null) > [ 1272.884520] RSP: 0018:ffff9a37cd3bbe68 EFLAGS: 00010203 > [ 1272.884522] RAX: 0000000000000000 RBX: 0000000000000000 RCX: > 0000000000014d5f > [ 1272.884524] RDX: fffffffffffffff4 RSI: 0000000000000001 RDI: > ffff9a38aca4d200 > [ 1272.884526] RBP: ffff9a37cd3bbed0 R08: ffff9a38dcd5f1a0 R09: > ffff9a31ffc07300 > [ 1272.884527] R10: ffff9a31ffc07300 R11: ffffffffaddd5e9d R12: > ffff9a38b4e0fb00 > [ 1272.884529] R13: 0000000000000001 R14: ffff9a37cd3bbf18 R15: > ffff9a38aca4d200 > [ 1272.884532] FS: 00007feccaa67740(0000) GS:ffff9a38dcd40000(0000) > knlGS:0000000000000000 > [ 1272.884534] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 1272.884536] CR2: 0000000000000000 CR3: 00000008267c0000 CR4: > 00000000003407e0 > [ 1272.884537] Call Trace: > [ 1272.884544] [] ? seq_read+0x130/0x440 > [ 1272.884548] [] vfs_read+0x9f/0x170 > [ 1272.884552] [] SyS_read+0x7f/0xf0 > [ 1272.884557] [] system_call_fastpath+0x22/0x27 > [ 1272.884558] Code: Bad RIP value. > [ 1272.884562] RIP [< (null)>] (null) > [ 1272.884564] RSP > [ 1272.884566] CR2: 0000000000000000 > > Signed-off-by: Qu Huang > --- > drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c b/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c > index 511712c..673d5e3 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c > @@ -33,6 +33,11 @@ static int kfd_debugfs_open(struct inode *inode, struct file *file) > > return single_open(file, show, NULL); > } > +static int kfd_debugfs_hang_hws_read(struct seq_file *m, void *data) > +{ > + seq_printf(m, "echo gpu_id > hang_hws\n"); > + return 0; > +} > > static ssize_t kfd_debugfs_hang_hws_write(struct file *file, > const char __user *user_buf, size_t size, loff_t *ppos) > @@ -94,7 +99,7 @@ void kfd_debugfs_init(void) > debugfs_create_file("rls", S_IFREG | 0444, debugfs_root, > kfd_debugfs_rls_by_device, &kfd_debugfs_fops); > debugfs_create_file("hang_hws", S_IFREG | 0200, debugfs_root, > - NULL, &kfd_debugfs_hang_hws_fops); > + kfd_debugfs_hang_hws_read, &kfd_debugfs_hang_hws_fops); > } > > void kfd_debugfs_fini(void) > -- > 1.8.3.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel