Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2397136imn; Tue, 2 Aug 2022 00:50:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR5w8D7rnex7BN90smgj3YyGmNNg3Cb+4of6UM2Ds9dcc2oNijh2tUBNcaYX1yohXEw3Eop6 X-Received: by 2002:a17:903:41cf:b0:16d:68b4:fcc1 with SMTP id u15-20020a17090341cf00b0016d68b4fcc1mr20030354ple.21.1659426638584; Tue, 02 Aug 2022 00:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659426638; cv=none; d=google.com; s=arc-20160816; b=rsmXkWVfJVMMpwwPihOqCT0xuNlotw0UyQSfzk0ZOw4rJYlCrCTOp+hC8r0DJtuUDq Mmw5Hxl8PtaBluqbnP1DEHYIbyGUoJRdiMYdMFGExPMrTPL7OMJuM+GfehQ+88PfQ8RF z95XGLho63miMdeyKk9weE6klnWQ7BbykQTupdGaRONyYHwPKUpo8/pY/zxzSi+LVumg DVmk0W8vq5NTF0X17V+A+yhREEOQ/E+LnIl63TKGNYjVs+16FsNJThQ6O2+TfMonRGEB 0P2qI7262VbQEhZMKHzPFwcBpVV7ru8MO2e7P2skgXTfPLZkanrm3Ngd/Tv0b2yi4oJQ a4qA== 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=7CWlA2+lkbubnWGtr6j474HLCnz+upKajwJ7DVrFrZk=; b=R7VPgYkoxIStZZQnAHVIYq/GDRAuBoB0wgdrl5I3tAwOsbtiMirC6IEQHiEIMONpu3 FYb+tn2IGvZbJENqLkCBPMDMw+1uKTk2s/AAcdQqJBQkpKZvJThCDPOH+owaFHp+6AFR ouy/4oOxxVnVdXEFB31a0k9zifWLrDT+8mGTggxuM/X68IRx1ugirFT/JQtF4Y3VCQa4 4aNNFNc8RUS2Zj1OvZMqSHbLj+ezZG9oVNULO6RBEkZsp+IN+T+EW+8Pzka6APrX3Cgp s3aAlWVksqjQU6E+crYxFfnBDu5PmW6IINFL2u74D27r7y7Q2ArdriT8FkwTMLZFmXwY NfFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w70M3FKq; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a635206000000b003c64eaa98cbsi6616667pgb.58.2022.08.02.00.50.24; Tue, 02 Aug 2022 00:50:38 -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=@linaro.org header.s=google header.b=w70M3FKq; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235830AbiHBHYk (ORCPT + 99 others); Tue, 2 Aug 2022 03:24:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231804AbiHBHYi (ORCPT ); Tue, 2 Aug 2022 03:24:38 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A666446D88 for ; Tue, 2 Aug 2022 00:24:37 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id b10so12876648pjq.5 for ; Tue, 02 Aug 2022 00:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=7CWlA2+lkbubnWGtr6j474HLCnz+upKajwJ7DVrFrZk=; b=w70M3FKql12kzWfxf2FSt2qzi3lp2sqrJ0YXLWoBPuvSsqxoqyFJJtfFUK5FZH6Y+I 6Bz/+uPE1rNq26bhrYjrDdcbIHQFCNL45iTc176kV+0mbTzSKkl70XOBgVYpdunKAWDp MrI1cJfPQogKsWvliKQK7FikVh8QY3q8VeSKxmNay3/niMVT4du2za4MKmgY3sYm+I4a w9d7xoht5NYCuCAsfPlZn71gZBawq1P1465L9V+cF9uEQtLOcueHYv4Zb9wlNlQkr39R j5RVaxHEuHiKNUMI3La7sHhUjlhEEwCbWIzzoUdRy7NqhQJL26/5CcVnfgUmjfA+tdJw exXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=7CWlA2+lkbubnWGtr6j474HLCnz+upKajwJ7DVrFrZk=; b=W6e/NiSsKvQ9DlwNWi/UjlP+7fX7oKWJNljKMj6WL23zr8kJldvjzKaG/RwLhtIUqh N0TNQPAjDEk5aN9Du/22ResiS+KwzlUwYwAvyPqEz0jlHoeBC9w3A9ZRGPN4ev48HLrh 59zcdTwbifbr6/JeOwEAaAP6LVpusmB8fF/bleEyFfeaCQgHD/dHM70IWflnA9Sf51H6 UWytczsYepEHdzdLKAHT0fDwwJQodxvYErSmqEhl62xXyThe/GxQIyqNaD8+o7TfcT0+ 0HJxk7rZw7AELgnQJKRM1H/96fqv90rvrJE4bI1h8HMFxrZkiTWnJ8+w50gcj2sbHT7p afEA== X-Gm-Message-State: ACgBeo3s6XyFmKGxdaLhQSDgXLSSVdijP8AfEabyDtSjoUSTGtJDnsBZ nu7EmpBmwLOVdSU/M2S5fFXi X-Received: by 2002:a17:902:e54c:b0:16d:4c2d:d52b with SMTP id n12-20020a170902e54c00b0016d4c2dd52bmr20365410plf.90.1659425077054; Tue, 02 Aug 2022 00:24:37 -0700 (PDT) Received: from thinkpad ([117.193.215.193]) by smtp.gmail.com with ESMTPSA id c189-20020a624ec6000000b0052b6ed5ca40sm3805709pfb.192.2022.08.02.00.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Aug 2022 00:24:36 -0700 (PDT) Date: Tue, 2 Aug 2022 12:54:26 +0530 From: Manivannan Sadhasivam To: Rob Herring Cc: Bjorn Helgaas , Vidya Sagar , Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Krzysztof Wilczynski , Bjorn Helgaas , PCI , "linux-kernel@vger.kernel.org" , Krishna Thota , Manikanta Maddireddy , sagar.tv@gmail.com, Xiaowei Bao , Hou Zhiqiang Subject: Re: [PATCH V1] PCI: designware-ep: Fix DBI access before core init Message-ID: <20220802072426.GA2494@thinkpad> References: <051a3baf-b4dd-7764-2e61-03584cefb4d3@nvidia.com> <20220729224404.GA478920@bhelgaas> <20220730145025.GA4005@thinkpad> 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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, Aug 01, 2022 at 02:27:14PM -0600, Rob Herring wrote: > On Sat, Jul 30, 2022 at 8:50 AM Manivannan Sadhasivam > wrote: > > > > On Fri, Jul 29, 2022 at 05:44:04PM -0500, Bjorn Helgaas wrote: > > > [+cc Xiaowei (author of 6bfc9c3a2c70), Hou (author of 8bcca2658558)] > > > > > > On Thu, Jul 28, 2022 at 05:56:28PM +0530, Vidya Sagar wrote: > > > > On 7/28/2022 3:44 AM, Bjorn Helgaas wrote: > > > > > On Wed, Jun 22, 2022 at 09:31:33AM +0530, Vidya Sagar wrote: > > > > > > Platforms that cannot support their core initialization without the > > > > > > reference clock from the host, implement the feature 'core_init_notifier' > > > > > > to indicate the DesignWare sub-system about when their core is getting > > > > > > initialized. Any accesses to the core (Ex:- DBI) would result in system > > > > > > hang in such systems (Ex:- tegra194). This patch moves any access to the > > > > > > core to dw_pcie_ep_init_complete() API which is effectively called only > > > > > > after the core initialization. > > > > 6) What's going on with the CORE_INIT and LINK_UP notifiers? > > > dw_pcie_ep_init_notify() is only called by qcom and tegra. > > > dw_pcie_ep_linkup() is only called by dra7xx, qcom, and tegra. > > > As far as I can tell, nobody at all registers to handle those > > > events except a test. I think it's pointless to have that code > > > if nobody uses it. > > > > > > > I have submitted an actual driver that makes use of these notifiers: > > https://lore.kernel.org/lkml/20220502060611.58987-9-manivannan.sadhasivam@linaro.org/ > > Notifiers aren't the best interface in the kernel. I think they are > best used if there's no real linkage between the sender and receiver. > For an EPC and EPF that's a fixed interface, so define a proper > interface. > Fair point! The use of notifiers also suffer from an issue where the notifier chain in EPC is atomic but the EPF calls some of the functions like pci_epc_write_header() could potentially sleep. I'll try to come up with an interface. Thanks, Mani > Rob -- மணிவண்ணன் சதாசிவம்