Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp53300ybt; Tue, 7 Jul 2020 15:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCTwas5CqHtPa3rc70E6JdEpusr7eXBJ6SQlbxPbYOyk/TRxAluCM7np3K1BEOucT6GyDS X-Received: by 2002:a05:6402:318d:: with SMTP id di13mr54325752edb.172.1594162323555; Tue, 07 Jul 2020 15:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594162323; cv=none; d=google.com; s=arc-20160816; b=B+Ezj2/Vt267sbrblAVUjzfff8l6zVvpP23YPSeRKkBgY4N0IMZd+eSMHzrnR8Mwz/ w4nvb44DivHRdjxUp2RYCjbpKth8q6dt7EuYMXjSr28L1qArpwwLvDCQiMFBIQrET8qy PjS4ATP7JNnJAZhj4sWmZ6IJ92qwJsjDFd+nLT1rjxySKkL5XoerpN5Wd7zNjlaoI7Mo HS+TxuEuDgyAWz0rg8ErwwtopiMtQBquDfR/aqixhP+1ZQI8+VgHC38Ax3pwlq8oTxHm fwQmeaLAvERhm9lC9y/ZdV1Dd2P6ax0DNdEmRX70IWduEHSOERbUFAs20ExWWw3XfFR5 /lXw== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=8XSwF3Ki0uqZwjqnLKs3VgE9rHmMwCUYScIk8lDDguM=; b=eURHBSuT8LI3cMpexkbzH7lVevaNSv+cmZm5byY3Hrph4BGaRgYVl56xC012T1qTet /iApcGWVPpqxl7hMB/LNGvo2Sz0T41D1WzxCuMGZyxJkmovthWpsVX0vukBa9s7L3xg1 bSl/m91T/rvHffkt0jyjz3Eq/bYDPpyj+4s1bgf2Pm/DFPYMg+uvebZ2o34R8pQD9YSK h7C04RoypX6rW093enf1pktY3YZxxysMGXVf8ns7wiliCl+c4QsWz4ouqj/itwg5M0PP Vo2q5LmAurDog9os6Bybu6dLmJ6YZogrV9C5hnGsyL0Tu5oAgODONJSWJS2LWlQqEycd GLzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xetdEKJ5; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk25si15691218edb.28.2020.07.07.15.51.41; Tue, 07 Jul 2020 15:52:03 -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=@kernel.org header.s=default header.b=xetdEKJ5; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbgGGWgi (ORCPT + 99 others); Tue, 7 Jul 2020 18:36:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:54210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728299AbgGGWgi (ORCPT ); Tue, 7 Jul 2020 18:36:38 -0400 Received: from localhost (mobile-166-175-191-139.mycingular.net [166.175.191.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D3EB320675; Tue, 7 Jul 2020 22:36:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594161397; bh=XNyL4Knjloue7Zmtlah/X6qQu06hR830oaTwsSUXTHg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=xetdEKJ5aWdBTllQu7iCldcr2gL0pHQD1391STAhb/ZytwPjQ3LkU7pnMm4aRcFwP E8Ui4PxHIhfM839vwO2yKQkjGPz5EfvczV0Vo07a1qGBZlagfuWVisiGO8Fna15qob nc7qm4xvca7SwrnNClgxex/yUGc1KWYI8CZyXaJc= Date: Tue, 7 Jul 2020 17:36:34 -0500 From: Bjorn Helgaas To: Rajat Jain Cc: David Woodhouse , Lu Baolu , Joerg Roedel , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, Raj Ashok , lalithambika.krishnakumar@intel.com, Mika Westerberg , Jean-Philippe Brucker , Prashant Malani , Benson Leung , Todd Broch , Alex Levin , Mattias Nissler , Rajat Jain , Bernie Keany , Aaron Durbin , Diego Rivas , Duncan Laurie , Furquan Shaikh , Jesse Barnes , Christian Kellner , Alex Williamson , Greg Kroah-Hartman , oohall@gmail.com, Saravana Kannan , Suzuki K Poulose , Arnd Bergmann , Heikki Krogerus , stable@vger.kernel.org Subject: Re: [PATCH RESEND v2] PCI: Add device even if driver attach failed Message-ID: <20200707223634.GA392692@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200706233240.3245512-1-rajatja@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 06, 2020 at 04:32:40PM -0700, Rajat Jain wrote: > device_attach() returning failure indicates a driver error while trying to > probe the device. In such a scenario, the PCI device should still be added > in the system and be visible to the user. > > This patch partially reverts: > commit ab1a187bba5c ("PCI: Check device_attach() return value always") > > Signed-off-by: Rajat Jain > Reviewed-by: Greg Kroah-Hartman > --- > Resending to stable, independent from other patches per Greg's suggestion > v2: Add Greg's reviewed by, fix commit log Applied to pci/enumeration for v5.8 with stable tag, thanks! > drivers/pci/bus.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c > index 8e40b3e6da77d..3cef835b375fd 100644 > --- a/drivers/pci/bus.c > +++ b/drivers/pci/bus.c > @@ -322,12 +322,8 @@ void pci_bus_add_device(struct pci_dev *dev) > > dev->match_driver = true; > retval = device_attach(&dev->dev); > - if (retval < 0 && retval != -EPROBE_DEFER) { > + if (retval < 0 && retval != -EPROBE_DEFER) > pci_warn(dev, "device attach failed (%d)\n", retval); > - pci_proc_detach_device(dev); > - pci_remove_sysfs_dev_files(dev); > - return; > - } > > pci_dev_assign_added(dev, true); > } > -- > 2.27.0.212.ge8ba1cc988-goog >