Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp183881pxf; Thu, 25 Mar 2021 01:20:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJhOkqSYI/OsPlhsmWSiHrYO2nIGqx1hKvlW5I1lIC6SzL8X7eqFtAPoQFbsgg6i+9iClu X-Received: by 2002:a17:907:7699:: with SMTP id jv25mr7781646ejc.363.1616660454478; Thu, 25 Mar 2021 01:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616660454; cv=none; d=google.com; s=arc-20160816; b=wwN6D2xvOttC7+27/vdQng7IGni24UWCD+nwg2CjVfZ57RiT74EgwKVs3hKy3MgcGs vk8aMqPFrbfwTQStT2ttIB1h/N8VsB1RUDJmUuBcmzTkGahRr8QdutvQK1Ezv7wFUisJ IpUKoYf0LMsw/Q49J9EPmyUuETT6eG+rF/b6l6vwefJjqW8KKLYy573Q+2UKMoGgop/5 ZBODQ6TXNkNIAEeXXcHkrwZb6+bclVVq1OxcbunvBetWWQ1kHrEpYcBUyuTPZlArGney m9N8T6zZW+lhsHcSTaxlWx/Lz/CY7m282yXmdjyiWjFehP8ZnCjJqFI1qBrNnYdEzDFj 2nig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bh7wP2L3MUfdWgUnQuBUElgHs80OttJY20MheoOX9z0=; b=cKpmFH1K5483fJyO0k0055BcDvvMiKdVY38jjPgZSHFYiCXR055l6SxGvyuTTsFp7w IiRC2GyjutyMCVxOL26UkhriPeg/j5tyaqjhgRgV0iKvEI7uBQxUhfowRJvKlJm1wXIC TESvhwLGllyPgvuyA7+Iu9fbP+h8atRVYDC1yragvyZi+AtL7+mo/ynNPrh+qko01v+M ECvGZAOaCRGyYStW40JIfvoyOi3lxNO+sM8NCJERgDc4DiVMYnobAlRnV79zmGopuY/B HUBOWc5jjYrhT4IDqo6FdcMxKl38ASxXdlPOowJrKTu8+4IyWnAPB7u/3/btAghoz4xX rZyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=kQTslmY7; 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=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ka24si3627773ejc.64.2021.03.25.01.20.31; Thu, 25 Mar 2021 01:20:54 -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=@natalenko.name header.s=dkim-20170712 header.b=kQTslmY7; 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=REJECT sp=REJECT dis=NONE) header.from=natalenko.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229962AbhCYIRV (ORCPT + 99 others); Thu, 25 Mar 2021 04:17:21 -0400 Received: from vulcan.natalenko.name ([104.207.131.136]:35816 "EHLO vulcan.natalenko.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbhCYIRE (ORCPT ); Thu, 25 Mar 2021 04:17:04 -0400 Received: from localhost (kaktus.kanapka.ml [151.237.229.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id 983589F89B3; Thu, 25 Mar 2021 09:17:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1616660222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bh7wP2L3MUfdWgUnQuBUElgHs80OttJY20MheoOX9z0=; b=kQTslmY70D+XU8hjEh8DFuJnXj25xjL2XNEaBKRcuvuP2/wrjZ8BMGKZKdUcDE9WV77jTD ub2HCCrifZzp4J45mkD5VPV2wM3IWielQptu5QYeAXofs7jz8r4RcLAmCBXZicV6VMlhoU oexebAnGATmsBpI5eo35dMt2nO1eBFQ= Date: Thu, 25 Mar 2021 09:17:02 +0100 From: Oleksandr Natalenko To: linux-kernel@vger.kernel.org Cc: Ilkka Prusi , Chris Rankin , Christian Koenig , Huang Rui , David Airlie , Daniel Vetter , Sumit Semwal , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman Subject: Re: WARNING: AMDGPU DRM warning in 5.11.9 Message-ID: <20210325081702.5kdzp7moqhcox65b@spock.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On Thu, Mar 25, 2021 at 07:57:33AM +0200, Ilkka Prusi wrote: > On 24.3.2021 16.16, Chris Rankin wrote: > > Hi, > > > > Theee warnings ares not present in my dmesg log from 5.11.8: > > > > [ 43.390159] ------------[ cut here ]------------ > > [ 43.393574] WARNING: CPU: 2 PID: 1268 at > > drivers/gpu/drm/ttm/ttm_bo.c:517 ttm_bo_release+0x172/0x282 [ttm] > > [ 43.401940] Modules linked in: nf_nat_ftp nf_conntrack_ftp cfg80211 > > Changing WARN_ON to WARN_ON_ONCE in drivers/gpu/drm/ttm/ttm_bo.c > ttm_bo_release() reduces the flood of messages into single splat. > > This warning appears to come from 57fcd550eb15bce ("drm/ttm: Warn on pinning > without holding a reference)" and reverting it might be one choice. > > > > > > There are others, but I am assuming there is a common cause here. > > > > Cheers, > > Chris > > > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index a76eb2c14e8c..50b53355b265 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -514,7 +514,7 @@ static void ttm_bo_release(struct kref *kref) > * shrinkers, now that they are queued for > * destruction. > */ > - if (WARN_ON(bo->pin_count)) { > + if (WARN_ON_ONCE(bo->pin_count)) { > bo->pin_count = 0; > ttm_bo_del_from_lru(bo); > ttm_bo_add_mem_to_lru(bo, &bo->mem); > > > > -- > - Ilkka > WARN_ON_ONCE() will just hide the underlying problem. Do we know why this happens at all? Same for me, BTW, with v5.11.9: ``` [~]> lspci | grep VGA 0a:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Lexa PRO [Radeon 540/540X/550/550X / RX 540X/550/550X] (rev c7) [ 3676.033140] ------------[ cut here ]------------ [ 3676.033153] WARNING: CPU: 7 PID: 1318 at drivers/gpu/drm/ttm/ttm_bo.c:517 ttm_bo_release+0x375/0x500 [ttm] … [ 3676.033340] Hardware name: ASUS System Product Name/Pro WS X570-ACE, BIOS 3302 03/05/2021 … [ 3676.033469] Call Trace: [ 3676.033473] ttm_bo_move_accel_cleanup+0x1ab/0x3a0 [ttm] [ 3676.033478] amdgpu_bo_move+0x334/0x860 [amdgpu] [ 3676.033580] ttm_bo_validate+0x1f1/0x2d0 [ttm] [ 3676.033585] amdgpu_cs_bo_validate+0x9b/0x1c0 [amdgpu] [ 3676.033665] amdgpu_cs_list_validate+0x115/0x150 [amdgpu] [ 3676.033743] amdgpu_cs_ioctl+0x873/0x20a0 [amdgpu] [ 3676.033960] drm_ioctl_kernel+0xb8/0x140 [drm] [ 3676.033977] drm_ioctl+0x222/0x3c0 [drm] [ 3676.034071] amdgpu_drm_ioctl+0x49/0x80 [amdgpu] [ 3676.034145] __x64_sys_ioctl+0x83/0xb0 [ 3676.034149] do_syscall_64+0x33/0x40 … [ 3676.034171] ---[ end trace 66e9865b027112f3 ]--- ``` Thanks. -- Oleksandr Natalenko (post-factum)