From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422927AbdEXOnP (ORCPT ); Wed, 24 May 2017 10:43:15 -0400 Received: from mailout3.hostsharing.net ([176.9.242.54]:57905 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422813AbdEXOnN (ORCPT ); Wed, 24 May 2017 10:43:13 -0400 Date: Wed, 24 May 2017 16:43:10 +0200 From: Lukas Wunner To: Mika Westerberg Cc: Greg Kroah-Hartman , Andreas Noever , Michael Jamet , Yehezkel Bernat , Amir Levy , Andy Lutomirski , Mario.Limonciello@dell.com, Jared.Dominguez@dell.com, Andy Shevchenko , linux-kernel@vger.kernel.org Subject: Re: [PATCH 20/24] thunderbolt: Do not touch the hardware if the NHI is gone on resume Message-ID: <20170524144310.wxtcburhjxnuocge@wunner.de> References: <20170518143914.60902-1-mika.westerberg@linux.intel.com> <20170518143914.60902-21-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170518143914.60902-21-mika.westerberg@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 18, 2017 at 05:39:10PM +0300, Mika Westerberg wrote: > @@ -655,6 +659,16 @@ static int nhi_resume_noirq(struct device *dev) > { > struct pci_dev *pdev = to_pci_dev(dev); > struct tb *tb = pci_get_drvdata(pdev); > + u32 vid; > + > + /* > + * Check that the device is still there. It may be that the user > + * unplugged last device which causes the host controller to go > + * away on PCs. > + */ > + pci_read_config_dword(pdev, PCI_VENDOR_ID, &vid); > + if (vid == ~0) > + tb->nhi->going_away = true; if (!pci_device_is_present(pdev)) Thanks, Lukas