From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D939DC41604 for ; Wed, 7 Oct 2020 17:42:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 374972168B for ; Wed, 7 Oct 2020 17:42:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="grNsKbcr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 374972168B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BEz8LnEUwHTMXe3zikrjkgKPNLvSz01vT72slSX/kGM=; b=grNsKbcrmFZdhWV3lvmwNUOob DlQCsWYxGvcSKLA3+ry35R0MzUpnLgAB9P979XYI1MFIFu/aRA9UVkU9cPgzil9YUX7sGExRkCesP 86TTNAUlF9t/ilwGiyGeJMhzy5M+uQBe/M0jMT/BUnyXzRLw0StmIw5lr8r2S6+WkKGrK9loauxBI NGHSzH4BwPJL7musMg4iuij+j3ph+s9L1hk9yU8EBd7Jzr43effXp0CXEq6hCFKA32sH29t5di8Xi rzfzHMXinyanay+z1XwK2N3dsE3sef1R8lcamgj/sWG+RmPQsTq5y45hv5wqn5LaMal0s2Vee5QY0 8/tHW9a2Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQDRN-0001Xv-BL; Wed, 07 Oct 2020 17:41:25 +0000 Received: from mail-oi1-f196.google.com ([209.85.167.196]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kQDRK-0001X3-Pp for linux-arm-kernel@lists.infradead.org; Wed, 07 Oct 2020 17:41:23 +0000 Received: by mail-oi1-f196.google.com with SMTP id u17so3370204oie.3 for ; Wed, 07 Oct 2020 10:41:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2tkejhV+QuFeIWOyFwduIfZWNAaS8WIxtLLItp9kA84=; b=E7RYlpd5a1+xwUiN1GTCCYWX5ZppecxRsphXUDY0J8Eq14fWh7vxPBoER2ZTMlm3eJ ifFDHYY7Qaucn7oLM5n5wyGeZdOhJ9hZ51wfa7yDgXej+bpIx2+jGMMMLkH2YTwpEYDE 27BMGa3f6pT05dq/zhgBtpIu/65cHWwWOL3OIUcueDNFkdknoWca74uf+mXHk0mnC1vv KdJMBSRVmPsukXsRQ22thhg/FH7u/ILgqLcsU70bOdAcbJ7VC2vbT3uFjTBinr/n0BTu PYwQofzFkf5VrPkjg3E3HItDW03FUKvjXxJubNtNomZApwxBntXR0Ntz1344MXdrJ9im W9tw== X-Gm-Message-State: AOAM530RbWM/Lo4H3+ruXkgZFHkKi1GrXDAD+/tSqFNTphZEOUlSvcb5 tyr5BAD444Yw0dL5DjF76A== X-Google-Smtp-Source: ABdhPJxy4/uInRR/gtoRZx5s94r1PKrLbTZqexPwokp6bMvw8z07Hv/IAIrmZFrzABmlkeIG7hXUGQ== X-Received: by 2002:aca:d17:: with SMTP id 23mr2722546oin.9.1602092481310; Wed, 07 Oct 2020 10:41:21 -0700 (PDT) Received: from xps15 (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id g7sm2027896otk.56.2020.10.07.10.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 10:41:20 -0700 (PDT) Received: (nullmailer pid 432483 invoked by uid 1000); Wed, 07 Oct 2020 17:41:19 -0000 Date: Wed, 7 Oct 2020 12:41:19 -0500 From: Rob Herring To: Jisheng Zhang Subject: Re: [PATCH v5 2/2] PCI: dwc: Fix MSI page leakage in suspend/resume Message-ID: <20201007174119.GA376477@bogus> References: <20200930091205.792d6c7c@xhacker.debian> <20200930091449.50ae0caf@xhacker.debian> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200930091449.50ae0caf@xhacker.debian> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201007_134122_888644_A80C2451 X-CRM114-Status: GOOD ( 17.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Jingoo Han , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kishon Vijay Abraham I , Gustavo Pimentel , Bjorn Helgaas , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 30, 2020 at 09:15:25AM +0800, Jisheng Zhang wrote: > Currently, dw_pcie_msi_init() allocates and maps page for msi, then > program the PCIE_MSI_ADDR_LO and PCIE_MSI_ADDR_HI. The Root Complex > may lose power during suspend-to-RAM, so when we resume, we want to > redo the latter but not the former. If designware based driver (for > example, pcie-tegra194.c) calls dw_pcie_msi_init() in resume path, the > msi page will be leaked. > > As pointed out by Rob and Ard, there's no need to allocate a page for > the MSI address, we could use an address in the driver data. > > To avoid map the MSI msg again during resume, we move the map MSI msg > from dw_pcie_msi_init() to dw_pcie_host_init(). > > Signed-off-by: Jisheng Zhang > --- > drivers/pci/controller/dwc/pci-dra7xx.c | 18 ++++++++++- > .../pci/controller/dwc/pcie-designware-host.c | 32 +++++++++---------- > drivers/pci/controller/dwc/pcie-designware.h | 2 +- > 3 files changed, 34 insertions(+), 18 deletions(-) I'm working on some larger MSI clean-ups which should eliminate the dra7xx addition, but this is good enough for now. Reviewed-by: Rob Herring _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel