Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1129047rwb; Tue, 27 Sep 2022 08:47:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4zzPsba25f7CwvPmjk9rxxiSdnicTvmZxlHbRhmYOcJ1s3aHg6sCLBMhYBaN1+Y3BAQPLs X-Received: by 2002:a63:174c:0:b0:438:aece:e2f5 with SMTP id 12-20020a63174c000000b00438aecee2f5mr25061030pgx.366.1664293633894; Tue, 27 Sep 2022 08:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664293633; cv=none; d=google.com; s=arc-20160816; b=P8BbeDoGK4vdoLG5noh2jw0YZMSn/IIj1HL4XEZu4I27aneAvznzlv4nxiq2W7GApu XvcTW6nFDddrsiOKllaAb1O9pmv3bn8wiEzUyciiLmRyqCOgGa3FwQTm9iI3WiWk/WVt Sd93ZqYFEkiehlCQfEAdaRO+xjcSzuQP+k/6Y5zVMraJdhsRWfJG3OG9wYYekDuIhxvH MtmYCvK6aM7ttWQMFMh4EGPAjB5LWsqtlSB5w2sFwC7H3MtRCuptJLJ+3qUipjU3jYuP MSEXBoAD1QXePpIAcWf9ap2b1m+ZGJ9VFP+jYm8lIUtigU/YYZYajaN8vfzZ0A8Oq0X/ tdSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OZYXrDRo4ZcUMqkfWVnwAKnHZHh0FD6cKpXWbXErncU=; b=fI9GzGbqDaD4UjVeNw4uww8O5iLAYFioNDNTTGnpChmf5mGkfZ3BViBhl4ZfLau2CB WumuUsNR9IkuTPegaokWcFVtuy8kD7JVy9KqF0LWqgwyGD7vhOe1Dy4IS44W6W7yEyq7 +7Zms2SE0kZzZpuOn4AVdzF5d94s9czL8pppROtnFP89alFds6fRvJk/kS4G1KgekQhW KWmPt9VS012FB7OREFpw3sS9qCBHDnXj4BVpsx8aSyA47LxPu/ZcS1Lq9tNTf7v8xlFD vXYnhAEx7XPFDAz+e4Ei6CSH+1oeKxyN/CtzNJo3PONw9mUuzOHN6Yqh3yzd+9pCORBD a9KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G8pFAzbw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i9-20020a636d09000000b0043c1067ea80si2312025pgc.210.2022.09.27.08.47.02; Tue, 27 Sep 2022 08:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G8pFAzbw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232077AbiI0P2Q (ORCPT + 99 others); Tue, 27 Sep 2022 11:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232054AbiI0P2D (ORCPT ); Tue, 27 Sep 2022 11:28:03 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0F7D1B348F; Tue, 27 Sep 2022 08:27:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8635DB81C5B; Tue, 27 Sep 2022 15:27:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3BF2C433C1; Tue, 27 Sep 2022 15:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664292474; bh=CjW2AN+Ns/4UkIYVLzkQVu05g1VFuqqL8TsZ16gUCiU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G8pFAzbwfdtfmmaqK33lZ2OGoMucfWPApXvcXYd5qlrohRakBeU2Ajmdvggm7M27M 33GwSGkmUp4EtQ3Ods9DhloQJfqkvBAy4LayIjSh6rdDTjHfNCK+2Ou8PlEN0NaXlL rxI2CPfjrCaB/XvpU3XjaqdY8nGDwYzTye0ooZ0nB4qhKwopg2ETPBz2OHht/YYAHF HXG5De57FiNFaCC8oeoIqTM6z+WVOvYMyDuoI24bAUiJkYGh0oVU9eA1GFgjFgSZFC raRKWON/qBfQkWIkrTJeEf+WfGjWBz6UK7iEqKnv9RDw/sP4UO5SGc5gr+JoXu8i+c qichXszpNcc6w== Date: Tue, 27 Sep 2022 17:27:42 +0200 From: Lorenzo Pieralisi To: Marc Zyngier Cc: Johan Hovold , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= , Johan Hovold , Kishon Vijay Abraham I , Xiaowei Song , Binghui Wang , Thierry Reding , Ryder Lee , Jianjun Wang , linux-pci@vger.kernel.org, Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Ley Foon Tan , linux-kernel@vger.kernel.org Subject: Re: Why set .suppress_bind_attrs even though .remove() implemented? Message-ID: References: <20220722143858.GA1818206@bhelgaas> <87czdtxnfn.wl-maz@kernel.org> <87zggxaye8.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zggxaye8.wl-maz@kernel.org> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 25, 2022 at 06:35:27PM +0100, Marc Zyngier wrote: [...] > > That is precisely the way I've been testing it and everything appears > > to be tore down as it should. > > > > And a PCI driver that has been unbound should have released its > > resources, or that's a driver bug. Right? > > But that's the thing: you can easily remove part of the infrastructure > without the endpoint driver even noticing. It may not happen in your > particular case if removing the RC driver will also nuke the endpoints > in the process, but I can't see this is an absolute guarantee. The > crash pointed to by an earlier email is symptomatic of it. > > > And for the OF INTx case you mentioned earlier, aren't those mapped by > > PCI core and could in theory be released by core as well? > > Potentially, though I haven't tried to follow the life cycle of those. > The whole thing is pretty fragile, and this sort of resource is rarely > expected to be removed... This made me notice that we don't undo the actions (ie bridge->map_irq()) executed in pci_assign_irq() in pci_device_remove(); I don't think this can be right and that's already a candidate for a fix. It is not necessarily related to this thread topic, though I believe, in an _ideal_ world, removing a bridge should guarantee that all the downstream devices (ie drivers) had a chance of freeing/disposing the resources they allocated. This in theory; I totally understand Marc's point of view here and we should make up our mind about what we want to do on host bridge removal policy - this will take me more time to get to the bottom of it. Lorenzo