Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1030677imm; Tue, 2 Oct 2018 01:14:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Pg9jw0E3kg2ibTOy4ddwTskL4dF/lz/LyT1R5Iyr/yJyp7apLrTPUv2R/2toGfDh87MwC X-Received: by 2002:a63:cd12:: with SMTP id i18-v6mr12111665pgg.319.1538468093126; Tue, 02 Oct 2018 01:14:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538468093; cv=none; d=google.com; s=arc-20160816; b=tkOH3gdf8QjSHa8d02k0ls5vYCzkyoyrCw6TUPKD6ZMALgH0qMBtwxbc9PfCq5wQG8 43zKBhSz6XyMWmLG/pILdLI734mdAQTz7kdf2JKJJ3Z6U8N4vNwKf01ACz8P1qjNjyo+ WWKxhKMR2lyhSruCMRY/uG6fI/1C/R8KVCZvzPlk/+RcxrOvvN1Mnkj2Tk1xtTujSmyI qUelJdv0mWC1cFax4+bTXYQGRshH1bFcZhDazB6s9dt8yIOPY9AGYFx4sNTEhMq5sjg9 T5OzM9++wgqX3TJpqdApKHNLdpwpdZ+L/D5I7amXutNhf/jTwhQmVGDkTuIa7NiL0TBc TNjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=RgegIQ/byNt8xV1I27XfF+twtuqfNZLc6USJrQVa6Ew=; b=AVgXlEoOGy2OKS3dByHRqMbdRtlkubyNZeM7ozU3ZOwXkdR49j+INW4kEMdFhFAqcv e6qjG9qJ2r4emErfg5co7XqFxdRXzYoE76i34LA1uOmrhZzkC9zQ/M5G5W/EDk5cmvp3 g6+5GV+PjvQ19jZuo1hVu/LNb0JIT+C36TbOPSJeO0Cls2qQQxa8Qm0yH6X5xf7n8c/a 3sGmKLAsZ4fHjilhQ06or9GNSWmpx0LbyNh6S8TE+zka2fcoLq3XaLZv9/tWyVJMhhbZ zNghnyzxaSepUkQEROrRtA/0GHC7n3bZwLAuEG/AiunGXT5J6LZoQrPTnMCv3hRuwoCY ZTaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=EWzSSDHu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13-v6si11185247ply.279.2018.10.02.01.14.38; Tue, 02 Oct 2018 01:14:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=EWzSSDHu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727396AbeJBO42 (ORCPT + 99 others); Tue, 2 Oct 2018 10:56:28 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:43785 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727011AbeJBO42 (ORCPT ); Tue, 2 Oct 2018 10:56:28 -0400 Received: by mail-ed1-f67.google.com with SMTP id a4-v6so1224914eds.10 for ; Tue, 02 Oct 2018 01:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=RgegIQ/byNt8xV1I27XfF+twtuqfNZLc6USJrQVa6Ew=; b=EWzSSDHuTh2Pof4KiSgg28UnElBctb7qwgVE5xH0nopa59GJf3quuEcn0gI/51FVpw l+Alv48GzRGqyuHIeVPBTEQrAByhja41Wa3JrjvkxI2rwK//0U0VOsOmOKTXWisMV4tN +e81AkYl8ZAf8AtQ1YUMh+PZvAtd7F7T1ojeU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=RgegIQ/byNt8xV1I27XfF+twtuqfNZLc6USJrQVa6Ew=; b=J5C7Rj9d7S1NKycPf9hGnaSlMkWVrMp8KyDtZxjd6+LFt6gOl8SQb2wk9cG5wr941s 3PL5g67xuFmBXCoYhXrUFznPvt8EMIQDDX+/tyFsajswkJzvvw2MeQGQiLvAI5SNuWVV 4Nb2WBb35/mSiAxKDPsgsrkIIYRR5iN4K2M4lLZsaWcRB0C2HnuMqoMApVgWdlcudsm0 9ba8Kb4M/jl13STYnRy+Q5AagOYJzoXxtVBWlUQNfwR5db8h/Jier33jsGZ4hSeHdeEw 4GM2/zBV8BlLSORrG7KQcm1408RCx+LNM9L1/Qbg2D/rIKJpTVLsL4hfiixGg57xCpgG Pa1A== X-Gm-Message-State: ABuFfoiLyu2SXRxhxvhR+f/jXUocm84vc4ZSSISUgqOYzNOtfmCr/1fX ZCMVlyIjcC/SnlOFPKY2KpSJAw== X-Received: by 2002:aa7:c883:: with SMTP id p3-v6mr6979191eds.295.1538468065115; Tue, 02 Oct 2018 01:14:25 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id i38-v6sm3246145ede.83.2018.10.02.01.14.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 01:14:24 -0700 (PDT) Date: Tue, 2 Oct 2018 10:14:22 +0200 From: Daniel Vetter To: Peter Wu , Laurent Pinchart Cc: Dave Airlie , Gerd Hoffmann , Alan Jenkins , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH] qxl: fix null-pointer crash during suspend Message-ID: <20181002081422.GH11082@phenom.ffwll.local> Mail-Followup-To: Peter Wu , Laurent Pinchart , Dave Airlie , Gerd Hoffmann , Alan Jenkins , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org References: <20180904202747.14968-1-peter@lekensteyn.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180904202747.14968-1-peter@lekensteyn.nl> X-Operating-System: Linux phenom 4.14.0-1-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 04, 2018 at 10:27:47PM +0200, Peter Wu wrote: > "crtc->helper_private" is not initialized by the QXL driver and thus the This is still initialized, it's the ->disable that goes boom. At least the call to drm_crtc_helper_add is still there. The ->disable was removed in: commit 64581714b58bc3e16ede8dc37a025c3aa0e0eef1 Author: Laurent Pinchart Date: Fri Jun 30 12:36:45 2017 +0300 drm: Convert atomic drivers from CRTC .disable() to .atomic_disable() Fixes: 64581714b58b ("drm: Convert atomic drivers from CRTC .disable() to .atomic_disable()") Cc: # v4.14+ Reviewed-by: Daniel Vetter I'll let Gerd pick this one up, after some testing. Also adding Laurent. -Daniel > "crtc_funcs->disable" call would crash (resulting in suspend failure). > Fix this by converting the suspend/resume functions to use the > drm_mode_config_helper_* helpers. > > Tested system sleep with QEMU 3.0 using "echo mem > /sys/power/state". > During suspend the following message is visible from QEMU: > > spice/server/display-channel.c:2425:display_channel_validate_surface: canvas address is 0x7fd05da68308 for 0 (and is NULL) > spice/server/display-channel.c:2426:display_channel_validate_surface: failed on 0 > > This seems to be triggered by QXL_IO_NOTIFY_CMD after > QXL_IO_DESTROY_PRIMARY_ASYNC, but aside from the warning things still > seem to work (tested with both the GTK and -spice options). > > Signed-off-by: Peter Wu > --- > Hi, > > I found this issue while trying to suspend a VM that uses QXL. In order to see > the stack trace over serial, boot with no_console_suspend. Searching for > "qxl_drm_freeze" showed one recent report from Alan: > https://lkml.kernel.org/r/891e334c-cf19-032c-b996-59ac166fcde1@gmail.com > > Kind regards, > Peter > --- > drivers/gpu/drm/qxl/qxl_drv.c | 26 +++++--------------------- > 1 file changed, 5 insertions(+), 21 deletions(-) > > diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c > index 2445e75cf7ea..d00f45eed03c 100644 > --- a/drivers/gpu/drm/qxl/qxl_drv.c > +++ b/drivers/gpu/drm/qxl/qxl_drv.c > @@ -136,20 +136,11 @@ static int qxl_drm_freeze(struct drm_device *dev) > { > struct pci_dev *pdev = dev->pdev; > struct qxl_device *qdev = dev->dev_private; > - struct drm_crtc *crtc; > - > - drm_kms_helper_poll_disable(dev); > - > - console_lock(); > - qxl_fbdev_set_suspend(qdev, 1); > - console_unlock(); > + int ret; > > - /* unpin the front buffers */ > - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { > - const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; > - if (crtc->enabled) > - (*crtc_funcs->disable)(crtc); > - } > + ret = drm_mode_config_helper_suspend(dev); > + if (ret) > + return ret; > > qxl_destroy_monitors_object(qdev); > qxl_surf_evict(qdev); > @@ -175,14 +166,7 @@ static int qxl_drm_resume(struct drm_device *dev, bool thaw) > } > > qxl_create_monitors_object(qdev); > - drm_helper_resume_force_mode(dev); > - > - console_lock(); > - qxl_fbdev_set_suspend(qdev, 0); > - console_unlock(); > - > - drm_kms_helper_poll_enable(dev); > - return 0; > + return drm_mode_config_helper_resume(dev); > } > > static int qxl_pm_suspend(struct device *dev) > -- > 2.18.0 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch