Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2162172imn; Mon, 1 Aug 2022 13:33:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uMBruh+RY8FOJrA1v8sweVu1MDNGGm/4ava5espwO756kCa1K8yRFs9e3GZHO5aDHPVaJI X-Received: by 2002:a17:907:9612:b0:72e:56bd:2b9a with SMTP id gb18-20020a170907961200b0072e56bd2b9amr13813552ejc.526.1659386030566; Mon, 01 Aug 2022 13:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659386030; cv=none; d=google.com; s=arc-20160816; b=vX0Q2vrH278prHIGnWcnkON60IpOhflUpejvg8FdHsIgt5ZFCgbUXWVGpqJX2emL1l 1x5SGG6IYisWN/4pC9yKIhpb+ZlDg6GO1Qa+xrsbmgJCQrZIT4EsAAdzy5JTEqm7p9aS rMgjraVO7unQIbUPLQaVoLFctDP3JB9Fs9QX/IwrCn1G1EJ/ca/e89jY5G8G0aCsAGKg A9cXWnx4TNqQX2T57MsCfckIY3y1FG8sDzzBAtq1gjAiHPLVQ/zFGF/HJe6oGYOZj8sM w3ufPGoiyM26wBPlxOXybt/YHP+mRX/jz4gYlUpf2Ng59eWX0QVWWeb5d+a7/MXFfLsE /w/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tYCiH+rGs1T42uyvRbCQgGO1DGFwqJBBZQugvweLePI=; b=0RIP3mUU83dcQiJ5VOX933iXGAhl4BFoUAmlkHeWtP0H+P5wFvCb+w15z+4S/zn9EQ Ubm2kUlBeAL7zc5a5yiPOk9PUT8pihEFRpiBMu3vSMjAeU/E3YZDtfiUCH6imr1D6T6T 6oBMaQVFZ8fRTppK+WwSTvfEvUr/uivO+WVXUC2hT/HHt1X590GyNKhbUrOSmUnwh4Ps sL7cnhysOGM8Fl6sMfWuyaZqcKUlz/hhv9RyxTnwiY9nKMFlJ/vMNQjyH8XwIZ9HWJoE gGn8AinPKZK85GTMhhPgjB5KcTYRm4y3BabmL13Q3SBvQklNJaKw+OTaD/lpv4brVEDp IvjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jnMitWJP; 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 p26-20020a056402501a00b0043d4fe7f8e7si6537780eda.330.2022.08.01.13.33.24; Mon, 01 Aug 2022 13:33:50 -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=jnMitWJP; 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 S234356AbiHAU1a (ORCPT + 99 others); Mon, 1 Aug 2022 16:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229901AbiHAU12 (ORCPT ); Mon, 1 Aug 2022 16:27:28 -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 A40B62A415; Mon, 1 Aug 2022 13:27:27 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 4BCFF60FFF; Mon, 1 Aug 2022 20:27:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A24B5C433C1; Mon, 1 Aug 2022 20:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659385646; bh=z80kg64xPITISs6PDw5Rf/ii1v3KJpLzca2pJ8vefG0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=jnMitWJP3fSNWbDAXcoZNB5KC+lLcugiMeMYWlVLgofoB+Ko+8UanE+W7wf5B5XzP 4oPHdTqW9lyuErPgJNn/sHyevhSUFzs1LxpHyfstyVWFQPH64YTjqllCeEZJyUphFx iTQJ2LSFR9fCmfeFuzWo2+sXUrUI14kskPoLIBSyRLLM4GZmvza3911LrBeiXJ1r/s gg24hHa1x80+csI0npXIo3bxDt0G8Ph869PB6WKFwCKaTzJxkpScCgCAH0tSNTKjQj yYt5AXO5ETqWjc6rhoD1V61YYYnGoqkSj15CCiefZdLWhT2KJgyawI7tlMg6kZjJHt il/SEQCl790Sg== Received: by mail-vk1-f177.google.com with SMTP id x184so3285315vka.11; Mon, 01 Aug 2022 13:27:26 -0700 (PDT) X-Gm-Message-State: ACgBeo3cQ098bNZZYoX3KQnr50XE/2BlO7EE4OhhcZzpR6jhy25jwElV MX+vKwYvGm9woGrux9G/rCgaFcx+rYXu0ZwfcQ== X-Received: by 2002:a1f:ecc4:0:b0:377:8f7c:8873 with SMTP id k187-20020a1fecc4000000b003778f7c8873mr1585564vkh.14.1659385645513; Mon, 01 Aug 2022 13:27:25 -0700 (PDT) MIME-Version: 1.0 References: <051a3baf-b4dd-7764-2e61-03584cefb4d3@nvidia.com> <20220729224404.GA478920@bhelgaas> <20220730145025.GA4005@thinkpad> In-Reply-To: <20220730145025.GA4005@thinkpad> From: Rob Herring Date: Mon, 1 Aug 2022 14:27:14 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V1] PCI: designware-ep: Fix DBI access before core init To: Manivannan Sadhasivam 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 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 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. Rob