Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp483575lqh; Sat, 4 May 2024 08:48:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUALEaUMfQxQOIm6a/BTKnPbyOL9yugR6tDqkDx/10iPq1Z+K7wYYWvl604LAGyHBzz/w6AbSyojj926AhSRd5S+3QI6F1bqzTd+q9Fjg== X-Google-Smtp-Source: AGHT+IEJrX4R2TUXtVqMpjEjp+5qK1SFHfqHv0wO603P+guHj7qDxscrixnT1cYw575BoR10+HP3 X-Received: by 2002:a05:620a:8012:b0:78e:db2f:2726 with SMTP id ee18-20020a05620a801200b0078edb2f2726mr7589031qkb.51.1714837712190; Sat, 04 May 2024 08:48:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714837712; cv=pass; d=google.com; s=arc-20160816; b=B/1uOg+Be64jYfUsyzZhhyJRJXPsiVrNF+Xh3T/cCM1hp26PZjxmuea3J1C81Z1BXU F8/jiwij4qS/48tMa3h3qzfJ+tT9xhAProLLaLO+E3IxE4dwDgSkv4tkphcNR+At3Lin NOSx8zrXRbMpC8sjg5zu4HVNy61I9GkJH46d9gahouBrTSASJ3MZW8PsBK/x/WlgoH1y zplJnDkUrSdKmn0MH1DL5ekJAcjWrl1rFEaYx4LCcii0ujybJu4Oi/2YmuA1Fl2ifOlV 8B0H17+GKHZs28zvwBX+412iXdzoC/1fhGwZ0TT2YDnuDM6z2hWcaBlAWgjiWPq+0zEY I+YA== 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:dkim-signature:dkim-signature:date; bh=4KBN0TKU29q7oTncF5x//I8JiIVxS6XRK8cMe/alR+k=; fh=R4j4qiw7dx79VBWDiGdC5ArhbBgmhYQQrmRrLp4Mbao=; b=GQQ7Ze24l2Jji9Sh4I5Jiif2JjMKfzRzRdbZ1cWSnodax8j5SJ+TDSHLWRjXsspBpc UC9Kqg5llrm1I0G3/8uf/69zDpY4rGMwdEnnswYUecb4d+iNsRZgE/vk99QBAxOgoMFs gthJhlowaLKHGF38TV61uWdQHJEWk2v5RM2itSnY2Z2vR24UuzgzHGKrvVsktm+sH7/C lPhNYx97wKku8d2kAkISKpFosjme56JJ9n77hFKy+LccDpbHeZ9oh8fLMOtH35uRkdg9 xG4uQiagOUOPSrtH1d0MzgzirKHEOwNtOLk5PQYOqByRcR2niOCt1aaYakoardFDYLBj Mw2A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lVgSE3m2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-168734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id g15-20020a05620a40cf00b007928a8a5a1dsi1216359qko.255.2024.05.04.08.48.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 08:48:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lVgSE3m2; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-168734-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168734-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E22411C20FDA for ; Sat, 4 May 2024 15:48:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92D7F4EB52; Sat, 4 May 2024 15:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="lVgSE3m2"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nZgkTPHB" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 26644225D0; Sat, 4 May 2024 15:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714837702; cv=none; b=ZBeZfK2CMhWhaAbJZ4EnZ+5+GyQkXqwtb8KkgKKG8pC7tSSic6+uYbupKZPDn0PRef5iFTnTRTi5jjc7iAa+FNWhIEkyucUyC35Yle00RXrTjL7bormLaJpiWbWAbzf0EnmoUC+IoX6WF09/K++k6SI5ZrIrQo72Hcn/Kx3Cyjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714837702; c=relaxed/simple; bh=N7dQrrzlTJ++kwcKr2K8iINkTGGrKX9dIW9u5tuH/Xk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kTZjDRH6f62uYPtUnQtNawcQUN78koz/yh7YDC27zrSxPUBgApOsRKIElm2Zz1KSEeXHpDG7I4icMdviQxVPnEnYP6qZoAw2PIYVWWR1ZVK2SCAz9hfPs/dYZAOV8MSxtw0dRn0MWiIoGhwy2Yr6E6EBw3bBr0kaxtFIwUAM3NU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=lVgSE3m2; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nZgkTPHB; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Sat, 4 May 2024 17:48:06 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1714837691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4KBN0TKU29q7oTncF5x//I8JiIVxS6XRK8cMe/alR+k=; b=lVgSE3m2E6R7yHoq1UG9d3tj1bAq+4qNMT895p8iaxqTJ9RZtgcGclq+Mxr92UaWEBQp+V 2UL9tep2y8E/5XRFvqRdMsuKMoL1ZXGdb2ZBbPwcv57EYVVjzD+MGV16UiQwkyCzjAuuGK KLtTbOBOmmFVZnSwfk+CehcHwdaaHyAjjoERAWRfI2gdC/CMpf3lpMBvPuAatSLRkiC5Sy gOleu83O0IbUSjUe69NL3Em8xwtH7UHrPYG6FctKNNfApt/jTPHIPEWkTweuXYlQaVZKo2 F8cSuBopDfqQbqLaLxqj8faauvfeM0f0IBsbL9n2D+YvQnb8VUDRvP86IOzUzw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714837691; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4KBN0TKU29q7oTncF5x//I8JiIVxS6XRK8cMe/alR+k=; b=nZgkTPHBLQnlTx337VnCjY7JLKgwg+lemVQCUcfb06rqGzM0eLnLf07fhajq5AOEzCTvOf eccKgI4ZmY9/rpDQ== From: Nam Cao To: Lukas Wunner 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: <20240504154806.zpZEo__F@linutronix.de> 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: On Sat, May 04, 2024 at 05:02:34PM +0200, Lukas Wunner wrote: > 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 for the suggestion. This is applicable to shpchp as well. Best regards, Nam