Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp607371ybt; Fri, 26 Jun 2020 07:17:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxMBIh/9RIDwlvdO2bv50VNMTXBq7cPk5oDnRUKquahyYa2AmOMYOezMAUUraK+anGhMYK X-Received: by 2002:a17:907:20ee:: with SMTP id rh14mr2806146ejb.395.1593181039873; Fri, 26 Jun 2020 07:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593181039; cv=none; d=google.com; s=arc-20160816; b=CvYVJoQhr3wbgDyWcawGYgrGnNRlREkyKpzFlvMSnx5TGXKhphoxVKp9lYPoM6pXVB tnXIHzdEGVWTeexHd7XRPZpzzoG4eE2TFGkBZICuO82i7UzgfNzID+ODbi8VFmtKmeVT ipdxfwIueg0RL9KtwAJ4apy3MfJpT4G6dVSRCObmD+lUR5JDUx6h7bQ/uh9THbXSJ0pg fz0clO56+qN1q9+Z1WYvpb5FJM0OoVtowvnzdhqmgsXgaFPdiJau1TlCdhqip384xTUp 3+2CGrVuFnrDvX1T3K+n8aOo8ZGqKa9wBedCX0KJDnkapNQdceXHXSPBLX7lKMaAum2T 31KQ== 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:cc:to:from:date :dkim-signature; bh=22biqK+MDjkiUyim3VS5Kb7TFc0EMIDAHBllK1kvJcM=; b=D2M0enJyu1fzo6oa1EMnFjIH4TBBVgal7WGxhV6unkNWlA2buM0dNQoCorrfgu7iWb qqg8Qa43ZmXkCmu27APiDFL9M6Ktkk0cwcflYBRqwC1QXU91BoVQZz2/dd6njcvZS0sY P5LAdSukI8LU1hy5It9+XuxrOsldjPmJ7om70jpzlXmv7BR++bzYLwNdCflwW9Mer4Tv U2Utb/6mzcTxQttp3Dl3xoHdX++hb7aqzJ1ZPoOTHKpVfRIu3LKlWxcfkgZg5eRPnc+k JFRfASyEwQ69cTgpDwLVwGnJBrtu5B3OoLzkPeNl9hXP5v72rHjpcwSUTnmc8Rj0vpLu BNGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="QPTW8Ha/"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dj11si4434812edb.279.2020.06.26.07.16.54; Fri, 26 Jun 2020 07:17:19 -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="QPTW8Ha/"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728977AbgFZOOw (ORCPT + 99 others); Fri, 26 Jun 2020 10:14:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:55240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgFZOOw (ORCPT ); Fri, 26 Jun 2020 10:14:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 846AE207D8; Fri, 26 Jun 2020 14:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593180891; bh=sN7O78kWzaOfq2AFXfpw7hyMcqTy+eQ7YRaBapD4TOA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QPTW8Ha/GJwy4+4ATZKyZWys7YBBw2w+XeJ3gJ+SKOdkBIpGe1i89ZF3PpifMyqzp Vm7LTL3lB7Ehx+qB5TJgKkf/RfiaLyeDNj9qe83EhBY/hsBlo5vfiPfOxqWWEwWR0X YX4VeveYm+UNgv2CnUv3OtOSldNj5orTIL8912ZM= Date: Fri, 26 Jun 2020 16:14:46 +0200 From: Greg Kroah-Hartman 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 , oohall@gmail.com Subject: Re: [PATCH 1/2] pci: Add pci device even if the driver failed to attach Message-ID: <20200626141446.GA4141629@kroah.com> References: <20200626002710.110200-1-rajatja@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200626002710.110200-1-rajatja@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 25, 2020 at 05:27:09PM -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 > --- > 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; > - } Nice catch, sysfs stuff shouldn't be dependant if a driver is bound to a device or not. Reviewed-by: Greg Kroah-Hartman