From: Michel =?ISO-8859-1?Q?D=E4nzer?= Subject: Re: [PATCH] drm/radeon: disable any GPU activity after unrecovered lockup v5 Date: Thu, 28 Jun 2012 10:56:25 +0200 Message-ID: <1340873785.3562.126.camel@thor.local> References: <1340820861-3494-1-git-send-email-j.glisse@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail.gna.ch (darkcity.gna.ch [195.226.6.51]) by gabe.freedesktop.org (Postfix) with ESMTP id CF6749E759 for ; Thu, 28 Jun 2012 01:56:37 -0700 (PDT) In-Reply-To: <1340820861-3494-1-git-send-email-j.glisse@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: j.glisse@gmail.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Mit, 2012-06-27 at 14:14 -0400, j.glisse@gmail.com wrote: = > From: Jerome Glisse > = > After unrecovered GPU lockup avoid any GPU activities to avoid > things like kernel segfault and alike to happen in any of the > path that assume hw is working. > = > The segfault is due to PCIE vram gart table being unmapped after > suspend in the GPU reset path. To avoid segault to happen and to > avoid further GPU activity if unsuccessful at reseting GPU we > use the accel_working boolean to transform ttm activities into > noop. It does not impact the module load path because in that > path ttm have an empty schedule queue and accel_working will be > set to true as soon as the gart table is in valid state. Because > ttm might have work queued it is better to use the accel working > then disabling radeon_bo ioctl. > = > To trigger the segfault launch a program that repeatly create bo > in ttm and let it run in background, then trigger gpu lockup from > another process. > = > This patch also for video mode restoring on r1xx,r2xx,r3xx,r4xx, > r5xx,rs4xx,rs6xx GPU even if GPU reset fail. When GPU reset fails > it is very likely (so far i never had it not working) that the > modesetting part of the GPU is still alive. So we can have a > chance to get kernel backtrace or other debugging informations > on the screen if we always restore the video mode. > = > v2: fix spelling error and disable accel before suspend and reenable > it after pcie gart initialization to be even more cautious about > possible segfault. Improve commit message > v3: Improve commit message to describe the video mode restoring no > matter what. > v4: Avoid issue after successfull GPU lockup recovery. Don't do noop > ttm move, instead report error if move needs bind or unbind or > fallback to memcpy. Don't restrict new bo domain instead refuse > to create new bo if gpu reset failed. Disable accel working > in gart vram table unpin thus we don't change the behavior of > the suspend path. > v5: Avoid set domain to also trigger noop bind/unbind, instead force > it to wait for GPU reset to go through or return failure if > gpu reset fails. > = > cc: stable@vger.kernel.org > Signed-off-by: Jerome Glisse [...] > + /* try memcpy */ > + goto memcpy; This comment is redundant. :) Either way though, Reviewed-by: Michel D=E4nzer -- = Earthling Michel D=E4nzer | http://www.amd.com Libre software enthusiast | Debian, X and DRI developer