Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5855782ybv; Wed, 12 Feb 2020 01:22:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy3xo4RQxfJT6wyccTQkWxZgEXa9nmHmAyEIfAaVPefDC/aRonogMdcOXQeyYOW0CcjkGME X-Received: by 2002:a05:6830:22cc:: with SMTP id q12mr8811810otc.110.1581499352029; Wed, 12 Feb 2020 01:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581499352; cv=none; d=google.com; s=arc-20160816; b=kNwYYkxtUerv7Xw1cyLa8uPXibQsSZ02Ddg5ZgJOSu+xm1UVjF+s1pMGjMe0iIBhdl S8hL3eBQ1uJjdbDWlF2SQ7MXe2A8JxMt4Qm4m08g5R+sib+EbvxsySepouoP+lhtAQLE 37L47AinpmkruS7wbyIWRk14HUQ/0DKa5F3dkRXpZyl+mZquzUDymis7rCE6BKtboNpi +7K1Gnqr0TB8SrGN6xlgW+H7cDBYO6lGS/Hv455apsPlifV+u7nBcaYFdt4qelQp30dd eXdq1M6PydZP5bhi0MBQcSIBZAKg9o/smsMXjgrF/k/CLm7Xq1iYo0qqYl9bErtgO2uE qYpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=DzmJbxskk6AlcHsD2V7eyusyF086fPjD2IYe+QvfO+A=; b=L0uwXnocftFtCcQix1cXLzaIwRxW5yE6l4Y3HlKExnb6VRO2MHfoFZxZEEA+UnwMhw nDsK82l0RiFRpphcQ3duDRD0h3VVQp9tNcdkQRrc+iXHPtiMW/brFvJu+yWcQvbNDTYE fatDe0Io7j0krx2aWBIL2ZjKWriB8vAP9vfwkryP55+89gCghiN/hiYj4DyfGNfFUeXJ WviMfoNcEPZXJJFaFes5kMasZB3q9at7B1dZJnAX4KLu7A8RnC83DQhNo4TDekeyy8eD PSyLg4bATGfxkud3Xf8eq6LVg1jA6QC3zrjIrMwr6oM5oQs2WD1zXHcHoLBDg2fZRjzC xxFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QBjSfRt6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si3555205otq.250.2020.02.12.01.22.20; Wed, 12 Feb 2020 01:22:32 -0800 (PST) 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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QBjSfRt6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728728AbgBLJUu (ORCPT + 99 others); Wed, 12 Feb 2020 04:20:50 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23668 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728530AbgBLJUu (ORCPT ); Wed, 12 Feb 2020 04:20:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581499249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DzmJbxskk6AlcHsD2V7eyusyF086fPjD2IYe+QvfO+A=; b=QBjSfRt62jDCOmdmZZDX/oGvknf8ensaGEC/CFjmqZ6dxIdSoOS6U0OUb+ZSQqnFkipAoc IeFG6Zlq/yFFwQQNRvIXNB71Od/5cJn2wtt2iPTqDKoOo3irW3bIxlDa3njIy5XyZTZiVf mv9gGze0hdHORYbpHCCqqiagqA8Lu1E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-qLzioGbBOXmvZhndA3JKZQ-1; Wed, 12 Feb 2020 04:20:45 -0500 X-MC-Unique: qLzioGbBOXmvZhndA3JKZQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0EF19107ACC9; Wed, 12 Feb 2020 09:20:44 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-39.ams2.redhat.com [10.36.117.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id BE63D1001281; Wed, 12 Feb 2020 09:20:43 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B751D9D6B; Wed, 12 Feb 2020 10:20:42 +0100 (CET) Date: Wed, 12 Feb 2020 10:20:42 +0100 From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org, David Airlie , "open list:DRM DRIVER FOR BOCHS VIRTUAL GPU" , open list Subject: Re: [PATCH v4] drm/bochs: add drm_driver.release callback. Message-ID: <20200212092042.wnolwagpiucyw25m@sirius.home.kraxel.org> References: <20200211135218.22871-1-kraxel@redhat.com> <20200211141956.GC2363188@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200211141956.GC2363188@phenom.ffwll.local> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 11, 2020 at 03:19:56PM +0100, Daniel Vetter wrote: > On Tue, Feb 11, 2020 at 02:52:18PM +0100, Gerd Hoffmann wrote: > > Call bochs_unload via drm_driver.release to make sure we release stuff > > when it is safe to do so. Use drm_dev_{enter,exit,unplug} to avoid > > touching hardware after device removal. Tidy up here and there. > > > > v4: add changelog. > > v3: use drm_dev_*(). > > v2: move hardware deinit to pci_remove(). > > > > Signed-off-by: Gerd Hoffmann > > Reviewed-by: Daniel Vetter > > Btw I checked around whether there's anything else that obviously needs a > drm_dev_enter/exit, and I spotted the !bochs->mmio check in > bochs_hw_load_edid. That one looks like cargo-cult, there's a single > caller in the init path, so either mmio works at that point or this is > dead code ... slightly confusing. FYI: bochs->mmio actually can be NULL when running on very old qemu versions, the mmio bar was added in qemu release 1.3. All the register access functions in bochs_hw.c have a fallback going to ioports because of that. So there is a reason for the check, even though it is highly unlikely that mmio actually is NULL these days. qemu 1.3 was released in 2013 ... cheers, Gerd