Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6105842rwd; Mon, 19 Jun 2023 02:19:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7v1q+Q4BEQk5g4uxOUVPT6YHraHT/Q+Fg0d926GJh7R33OG2sNJQgHyhCPPTUetNDTDPXG X-Received: by 2002:a17:903:1309:b0:1b6:6963:4cc0 with SMTP id iy9-20020a170903130900b001b669634cc0mr502051plb.53.1687166376757; Mon, 19 Jun 2023 02:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687166376; cv=none; d=google.com; s=arc-20160816; b=BlUmGQiOazf4T5MGflYF+Nbb0S9U6zRlerlYtfAMlXaTIwnNfK38lfUSBkTA4bGVtE jNuyCLA63SOJG8ICTQVx7HTEJl+UnHGaACnx7Hacm7FzV7bDKFgtrP07ZaUK5rz4CyLV K+p/thJ6I4ysJgQnIFmf5E9Y7JlEi+x9zSmMU7NbMxovIOKyo4BtDPMqAeVXSlDwxth4 MpGKZHu+riWzd5j8T7RMHf6khlu9I/scZTZVeT7gj5o60WB98KptJtWnKqMTqGdNHU9f pxoJ/Ws2MIe7m52QzSn0qxYtuiGkLfC9ywxAAOaiWcFeF67sdagwXV1jCXUDNR7Sk+t9 fBlA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=89atWBpKJOLhQJi/3rH3Wi4ujE7P73GVeIL92PH5pnk=; b=FgxaXiDJnmZxG52HNWauQbV22XWTipMpRtOIpkTJeKyRY3FHu5SNEMYGj3ZONf8lAg iWr/JRLOawabRsAlK+ftD/gbbHNAWwxZWK0Z6ZSWUiIRagdZdfoNV7aVl5VrHcu3R3MA 8jjwWisE+mmkSlkT6XHx/SHEt0ZqujoIhZ7dtOfxiknA4r8ddeMQYWyTpy166nM4Q5TI uqC9xVojorpOceWmZ4X0aAYEvGyNeuHNuF/s6z+DmyaZCfslqerkcNEU4KcNdzuJdPgx DdzoFppmvuFiAD+LsAL8YDUAlGt18s7IwLK2EcYfRFsv+vCxIUgLDi5fwGlWcMsPyv2d Q5zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B9tlb1O7; 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 j18-20020a170902da9200b001b3d8ac8dadsi10861619plx.476.2023.06.19.02.19.24; Mon, 19 Jun 2023 02:19:36 -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=B9tlb1O7; 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 S230329AbjFSJHh (ORCPT + 99 others); Mon, 19 Jun 2023 05:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230190AbjFSJHf (ORCPT ); Mon, 19 Jun 2023 05:07:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF507B4; Mon, 19 Jun 2023 02:07:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 441AA60B42; Mon, 19 Jun 2023 09:07:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A63C433C8; Mon, 19 Jun 2023 09:07:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687165653; bh=14J4WS+8yy469joEoEVl33nkw3ghjN+BWRbdAbpGaU0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B9tlb1O7jbTOkBZh0+L/dMVuqQVsH5U+Wy/XX47i0cD6T/QRklmp/GNNT2/XtMP80 3YL4FQgWuyrs5jvAHOJ9wyD+9N8FSJuWyY9WB3ZBjYaGpF8NfjjoXsl0p/SNP+aHXg kVtja0B7ictQY+Ue96WUtQmr2jmfLVjdQ5uYIVO/bSWuuJb/TjurGkOd+Qg++4JSfz tiRGlwp/7c9UF6/tOnLRgds404eejjbY3Vu6zAP7SfsZdJUeHKHyyX6eQx/9U/peRZ 3hH4JYTMV8EfDtL2desisfGwrWGJKryttrAQEFp/VLXW3nsV5en8Q+KXKzc1Ez9XMa gNs3HBK7H8XlQ== Date: Mon, 19 Jun 2023 11:07:24 +0200 From: Lorenzo Pieralisi To: Hongxing Zhu Cc: Bjorn Helgaas , "l.stach@pengutronix.de" , "bhelgaas@google.com" , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "kernel@pengutronix.de" , dl-linux-imx , Serge Semin Subject: Re: [PATCH v2] PCI: imx6: Save and restore MSI control of RC in suspend and resume Message-ID: References: <20230317222436.GA1978818@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, Apr 10, 2023 at 06:48:48AM +0000, Hongxing Zhu wrote: [...] > > I am getting back to this since I am still not convinced and I want to understand > > this once for all. > > > > We do use dw_pcie_find_capability() in most DWC drivers to find and peek/poke > > at eg PCI express capability of the *Root port* (?), > > > > eg dw_pcie_wait_for_link() > > > > so I assume that for iMX6 dw_pcie_find_capability() does just the same, which > > would mean that we are poking the "Message Control" field of the Root port MSI > > capability. > > > > Either that (which would mean that iMX6 has a HW bug because the RP Message > > Control field does not control the delivery of MSIs from endpoints but just for the > > root port itself ) or all DWC controllers modelled the root complex MMIO space as > > a set of PCI/PCIe capabilities that are NOT necessarily mappable to PCI > > specifications defined ones. > > > > Can anyone please shed some light on this ? I don't have DWC HW, we need to > > know before merging this code. > Hi Lorenzo: > Regarding my understanding, DWC HW has the PCI/PCIe capability map when > it works in RC mode and Spec doesn’t specify these Caps for host controller. > And, there are comments describe these callbacks already in pcie-designware.c. > ... > /* > * These interfaces resemble the pci_find_*capability() interfaces, but these > * are for configuring host controllers, which are bridges *to* PCI devices but > * are not PCI devices themselves. > */ > static u8 __dw_pcie_find_next_cap(struct dw_pcie *pci, u8 cap_ptr, > u8 cap) > ... > > I still believe this is an integration bug, more so after reading the commit Serge pointed out: 75cb8d20c112 ("PCI: imx: Enable MSI from downstream components"). The commit above implies that if you have CONFIG_PCIEPORTBUS enabled, you would not need to set the MSI enable bit explicitly because that's done by the port driver while requesting RP services. This means that it is _seen_ by the PCI core as a capability register and it also means that if you have CONFIG_PCIEPORTBUS enabled and that the port driver disables MSIs, all downstream MSIs are disabled, not only the RP ones (as it should be according to the PCI specs). So, this is a HW bug I am afraid - I will merge this patch but AFAICS the HW integration bug is there regardless, however we slice it. Thanks, Lorenzo