Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1212583pxa; Thu, 20 Aug 2020 05:49:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2ZS0Kl+6irp8debGvvnQdAPUVmKnFyy+cLOH8oUdHUykMUOMHCgiyR1+tYAiVOk6JnzW2 X-Received: by 2002:a05:6402:b67:: with SMTP id cb7mr2733953edb.216.1597927769500; Thu, 20 Aug 2020 05:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597927769; cv=none; d=google.com; s=arc-20160816; b=SUaf5Sm8O7OgUuYQ+kZUFr+3kgPgp5ljMybkg5a6ZLNNNBt8+3Kn1Fds8K82hmTsiF rYyN0idIjalDCg6V/LFuiRA2W/6+U+H81I6iMWJ6u8sVaiCdFDWVKCVQ7LuXIwEvMitX ldWp8N4vytzMWpxxEKADbkHcibPoaGLr+EVtTvLnmhLzLWtKjp58tuaG+e9xU50zoubz Z2q+14dIXOIlvIRLMUiYMwwKJjGYnOMINn77fOHXcBLQ6wkhVjY3fa8fraSTtGuXm+Hv resS5Osl5n9x9JeKzV2n3GMhLAmElgLH5Ezf0PJE7xtF+tFTQnbRmD9pQuze0vMuC3cb I9TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UBEv0xtjmhIxqJpQ9ge/k2lBS+kxSgdcs4zrl66xoOo=; b=IVV7hfU+8Lua1c0e6SnC0SBlpWcflpBVow1FK1Za3a7AI5IJMZ3wb7B45N7sOIN+xX vQSRhBGTl1USv39SDLks65Qd3PnJZsqc7W4KNPJ7MtigYBRB/WfRPFibNyNckhxS4f9z LywmSTW00pe3PoDxcp5/BYaubnlWilMC5qWv2GJk3OqLaVRYXx0+ojjRQ0WbS5G+1eh0 4OYknxzE8+9iTM/A8rkCU2ROaUOuK4qB85mGvxstdR3oygtgr/6ajfBVHdewIfQ2KdeY +z1lk8Yuob+fxS9UqjoJ0K5FOQpUcas4D6GGt8HUvy9DBLQ6PQbaFAD6iLqHx75yE3m6 P2iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZrN399sE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si1325852edr.73.2020.08.20.05.49.05; Thu, 20 Aug 2020 05:49:29 -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=ZrN399sE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729951AbgHTMrf (ORCPT + 99 others); Thu, 20 Aug 2020 08:47:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:45718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729209AbgHTJp3 (ORCPT ); Thu, 20 Aug 2020 05:45:29 -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 8697422D06; Thu, 20 Aug 2020 09:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916694; bh=+Nv6csKMBWGiy1e80R3z4GTu13tZAaLYToez1KLYUvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrN399sEBlLNUV0h2XFJwm5lIBkboRQIgHEyoYzIyHiyYYSIlDdeIDXniQlj8dTER JoQYiKZcywXdwINYc6ZBcRQ9ZVC8qd4EWzsMTeneurYGieldVUxkUMux07JDKFFi34 fyS2IZOdQZWLDm6E47gtKvGz78makgL86B1wKtQ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rajat Jain , Bjorn Helgaas Subject: [PATCH 5.4 006/152] PCI: Add device even if driver attach failed Date: Thu, 20 Aug 2020 11:19:33 +0200 Message-Id: <20200820091553.956066058@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091553.615456912@linuxfoundation.org> References: <20200820091553.615456912@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajat Jain commit 2194bc7c39610be7cabe7456c5f63a570604f015 upstream. 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. When device_attach() fails, merely warn about it and keep the PCI device in the system. This partially reverts ab1a187bba5c ("PCI: Check device_attach() return value always"). Link: https://lore.kernel.org/r/20200706233240.3245512-1-rajatja@google.com Signed-off-by: Rajat Jain Signed-off-by: Bjorn Helgaas Reviewed-by: Greg Kroah-Hartman Cc: stable@vger.kernel.org # v4.6+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/bus.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c @@ -322,12 +322,8 @@ void pci_bus_add_device(struct pci_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); }