Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp462035lqh; Sat, 4 May 2024 08:02:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXA33iWTGTSDTHYTjq1J/cRrDV8+erCfoMzXLaG/MWO0N2VvBVu5WTgfqf0p+AGSC51wnTTrBA0DNrgWYtcJW0So9Y5GilQXcuDCuOLvg== X-Google-Smtp-Source: AGHT+IF0jZwguY+5FCCOMSSNMDrvc8Ou2rBiYwXzG3KHMrn6IhxWC+icPUsicdsCPZoO6VlBXwR6 X-Received: by 2002:a05:6870:b89:b0:22e:a036:c33a with SMTP id lg9-20020a0568700b8900b0022ea036c33amr7623796oab.6.1714834971561; Sat, 04 May 2024 08:02:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714834971; cv=pass; d=google.com; s=arc-20160816; b=SVuf8uLnLDYtTo2gqpA4FfW7G+x5NXlx+ktmdeBbSLl4CoVvShx1xkflnPUweqbK1A AL6CwdL4dXJsLHTExFhrbhSduAkvKXoFoZmnA3buNv0lJLoffwKB9JW5+tvNUvsD8o3W DYJu6Zvslil/+3TdsjzMHsx3Pf24eEyJurjuHu4TqEoOLVBTJ8DFfxkNvJYX4ozM3ucI msoCSL9FZ9tkytati5oRDvNi6bbJF2C2VGUPy2T7liE8ZpGNSvrdBTepIhPKLjKlzV3/ oug2p+AlcpP07IvWhmBihIgp1H8f3rC1BE0P4ALBjY5r4jbMsQn28T5HlRuiPUrOhW53 fXcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=HgwWoeWp67ddap1ZRUuBg99n1e2WJO/3LlebKKAR/MY=; fh=wQhH/Ip3KRi/trFKMirlOoRVyj87VZYub6ebQtblXVs=; b=y6SDc6Ot8UGvGFixR44v7pd3BLIv0q6YkaR9/+DhYm6oAEdJjTNUWZ9Xztbpkv2sCv Cv0BWOsBBiGdjkF5TjmwboLNer0tT/16BPjtP62HunAC+uRQ915NiMEPD4VmwosiTj13 22mnAAne+xQ4DhtBZBi9LD0BiH3mv1dYSvrDHeqUQTRukqO7k0E4fWwBvfOTh4n9zG2q thlJlx2pRgUmJFb+j5L8wGlOTvuXApeclbpk6hdm9HeneeC6R999gC/p66ff5quMP9E+ JT0S8jyehxzRYChNQX3LMVVhLNkC260+eDWhdZMHgi8SNTVJbCebrbDdc/K8aGElWsSy ppSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-168719-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168719-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id gi12-20020a0568703b8c00b0023ebe4e5c5bsi743866oab.186.2024.05.04.08.02.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:02:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168719-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-168719-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168719-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 34407282199 for ; Sat, 4 May 2024 15:02:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C7B23D994; Sat, 4 May 2024 15:02:41 +0000 (UTC) Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [83.223.95.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FCE222F00; Sat, 4 May 2024 15:02:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.95.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714834961; cv=none; b=Pw+rPecVMXZiTXNE+opLjDZHkSxcbE0/w28yUyCSDQp+86ta8mckdc+2JlfJ8E+82lg9sD5lKir4wwWsB8CYlUgCx0dDHMXJr/b0mOPcgYgijO3s7Fqk4KnS7sTyKtOSB6n52BXm1/r6JVbNb2t3Fp9NXtfUeC8MbpSkjTPI5NQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714834961; c=relaxed/simple; bh=XZg0u3kPXV8uWQS8+jwlLEsQrGKyPRpGzYxINexgUf0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Lg8grW5Nn/mVmVX9eJpV9CxSQDK12F4/TZ2nHLJgWDnBYwKZqD9P8z5/KjrH5tnPTQEP7w6NLrS+gpulVwNDJ76KeA6qjePZEhP+pw3acyRtGuuB/MxYvvF9iQ92MOH6YssD8fk6U0F93emJ/YIBCAQK02DqxFmFWehD7J0Js7Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=83.223.95.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 09DEE3000FF11; Sat, 4 May 2024 17:02:35 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id D7D7148D184; Sat, 4 May 2024 17:02:34 +0200 (CEST) Date: Sat, 4 May 2024 17:02:34 +0200 From: Lukas Wunner To: Nam Cao Cc: Bjorn Helgaas , Yinghai Lu , Greg Kroah-Hartman , Rajesh Shah , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 2/4] PCI: pciehp: bail out if pci_hp_add_bridge() fails Message-ID: References: <401e4044e05d52e4243ca7faa65d5ec8b19526b8.1714762038.git.namcao@linutronix.de> <20240504093529.p8pbGxuK@linutronix.de> <20240504105630.DPSzrgHe@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240504105630.DPSzrgHe@linutronix.de> On Sat, May 04, 2024 at 12:56:30PM +0200, Nam Cao wrote: > On Sat, May 04, 2024 at 11:51:54AM +0200, Lukas Wunner wrote: > > Could you reproduce with pciehp instead of shpchp please? > > Same thing for pciehp below. I think the problem is because without > pci_stop_and_remove_bus_device(), no one cleans up the device added in > pci_scan_slot(). When another device get hot-added, pci_get_slot() wrongly > thinks another device is already there, so the hot-plug fails. pciehp powers down the slot because you're returning a negative errno from pciehp_configure_device(). Please return 0 instead if pci_hp_add_bridge() fails. Thanks, Lukas