From patchwork Thu Feb 15 15:18:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 201546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp474005dyb; Thu, 15 Feb 2024 07:24:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVDzFfReRcDtQtLHwoq82yMcNoEI6vUNJ3FwO+MmECluZR2xPF40GRl4SiF9Fninn/qyfOwS/Mux0vtsvxleLOHeQg82g== X-Google-Smtp-Source: AGHT+IFO6I9XimvT+NEGcl3nqTBy33N6clwXin2fJvIcf4fN7FG40C9BlKcSqWjFZeqT5OomelY6 X-Received: by 2002:a05:6a00:1803:b0:6e1:eb1:cc8f with SMTP id y3-20020a056a00180300b006e10eb1cc8fmr7103039pfa.4.1708010678515; Thu, 15 Feb 2024 07:24:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010678; cv=pass; d=google.com; s=arc-20160816; b=cIFyHlm5rx2BiKimguhQiDfImlpaq0ynS4BeFghuIuDQUWN0gSJQQLpMRE60tG+y9G FYGh740QGxngAsd6tKaWOSE4Qn4gzE3OqIv00kKktqILrHGSiyJWLaMRW92L3foRlFEm JbPcybWIzJ2zzhf9rZ0ZZEe8nVChhyVaoKgwGJb219F5EoLrJEGxLgZ1KuV0yo8LRUnQ C9bP0A5DwAiYVwLYNX6pUAR+F/lGGpFQFauudI6Jq7PXE02o/oo4IsEusHMl7+lE1qQj ImiwxtA1T3E71LpvpfvEwMiaFR+qkLcZ0Y3vt25z6CoYfaVwndUtGtllhjlliSJa0UoI q8UQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=WIGGC0lj48fyJbGMqvl3dkIPzOEFiGF9ZPkrCVi5RWA=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=jmNxIiNBVcCEie4PqhcTVeRphqGGfhIZj7WkY3kLtusTLkD8ZBInRYP/dgq3TWhueZ FAYtEQQJ++vYr7D+bok22wFgJA+Zcb1CdHHBeoVPeT0kDGaTnYZh92f3+hcG/kWnndnH 4wf88A7DHFTi5x8zG78y038b9nFxTsD4cp9ZLWUtJZgbP0Gjg0tSP7xoQS8ADnoEeJRy K8az6M4EJIdFwlQ4WN157yNrozNgypOy3GvjdZszHmOJtcIoah8bG112OfvvfdvmYaIb c9A47LyYE3Zed7fbDinIrU5hNoFMPA0sNhRxFLEcnwIVGfE0Jzio2/RIkcwmKkAJ6IKG Y0ng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZjIA2HtP; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67164-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67164-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id lm22-20020a056a003c9600b006e0537cfa43si1319960pfb.186.2024.02.15.07.24.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:24:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67164-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ZjIA2HtP; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67164-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67164-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AED5428B88E for ; Thu, 15 Feb 2024 15:23:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1AE7B1384BE; Thu, 15 Feb 2024 15:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ZjIA2HtP" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4A9913698A; Thu, 15 Feb 2024 15:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010301; cv=none; b=GdvzNfrNiEc1vfbr3PMN5Md5DDo5rD6WklTDr4JF2SY0ZFCoR4y/ZiMonOOjFK5lbkiZd157nsATka2wb+LcDSLqhohj5gF57vU0VDahDrw91ESqn4WHDmilEFQh2VlJoI95N/0v2cGSc17XU6MW9rbAk2BbtRJI3TV+Lo0K5oI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010301; c=relaxed/simple; bh=2w2Jeas0HTHvkD1vXAGqgrRtxpU1SWleMSDVt8qU37E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=J+HRdB5OGZRrXJlbkxPFlOPffi8qx6Xu3lY8LEU3/Cy/8RG6hh3FHg2+pKONwp8EIFgb2PAHsjQMPwcb0fOH6TwLadO2c7qK+sxKYR9JGAVzEgafLcb+/CDeAv3ha1WQ7rh1WQY2Ov+pSXvtlTlHCy7xR1vhMVlupTP5F8ROhdA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ZjIA2HtP; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 5A70B240011; Thu, 15 Feb 2024 15:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010297; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WIGGC0lj48fyJbGMqvl3dkIPzOEFiGF9ZPkrCVi5RWA=; b=ZjIA2HtPvJTv2WhUZQ0z3cbQUg92xBdAbXHiEtRpbgkaAfMA7t++pQjgY1WuiTONb17dnn 016yjw4b87/Sp6OQHmKA+1Z51jFnWRRhHX6zKOdhaV8yP61/Cw34Oe2mvLttkUdqPIw193 VOto2Ot9CprgUcZVdAEbZNEi9/jpa9dbxbA26VCmK/Xf/mV1Wo+tTP9UfRl0aNHUZjqoMr +kWfU5IRNUx5ZoHdQc7IBC67++fe/gxsNn5IbOa/TpM799uaFakht73vSrXG6sZbNWeiz7 kpLbBs7Lnee7JuZmMtlQciobFKFbv1r0PehP9m8LLfeLjS6zz4JdZxo6DHqNsQ== From: Thomas Richard Date: Thu, 15 Feb 2024 16:18:01 +0100 Subject: [PATCH v3 16/18] PCI: cadence: set cdns_pcie_host_init() global Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240102-j7200-pcie-s2r-v3-16-5c2e4a3fac1f@bootlin.com> References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790979005316066868 X-GMAIL-MSGID: 1790979005316066868 During the resume sequence of the host, cdns_pcie_host_init() needs to be called, so set it global. The dev function parameter is removed, as it isn't used. Signed-off-by: Thomas Richard Reviewed-by: Siddharth Vadapalli --- drivers/pci/controller/cadence/pcie-cadence-host.c | 5 ++--- drivers/pci/controller/cadence/pcie-cadence.h | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 93d9922730af..8af95e9da7ce 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -485,8 +485,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) return cdns_pcie_host_map_dma_ranges(rc); } -static int cdns_pcie_host_init(struct device *dev, - struct cdns_pcie_rc *rc) +int cdns_pcie_host_init(struct cdns_pcie_rc *rc) { int err; @@ -564,7 +563,7 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) for (bar = RP_BAR0; bar <= RP_NO_BAR; bar++) rc->avail_ib_bar[bar] = true; - ret = cdns_pcie_host_init(dev, rc); + ret = cdns_pcie_host_init(rc); if (ret) return ret; diff --git a/drivers/pci/controller/cadence/pcie-cadence.h b/drivers/pci/controller/cadence/pcie-cadence.h index 4c687aeb810e..d55dfd173f22 100644 --- a/drivers/pci/controller/cadence/pcie-cadence.h +++ b/drivers/pci/controller/cadence/pcie-cadence.h @@ -516,6 +516,7 @@ static inline bool cdns_pcie_link_up(struct cdns_pcie *pcie) #ifdef CONFIG_PCIE_CADENCE_HOST int cdns_pcie_host_link_setup(struct cdns_pcie_rc *rc); +int cdns_pcie_host_init(struct cdns_pcie_rc *rc); int cdns_pcie_host_setup(struct cdns_pcie_rc *rc); void __iomem *cdns_pci_map_bus(struct pci_bus *bus, unsigned int devfn, int where); @@ -525,6 +526,11 @@ static inline int cdns_pcie_host_link_setup(struct cdns_pcie_rc *rc) return 0; } +static inline int cdns_pcie_host_init(struct cdns_pcie_rc *rc) +{ + return 0; +} + static inline int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) { return 0;