Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1120836rdb; Fri, 19 Jan 2024 08:45:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHweylOZcrxSDSPURcfvzpPmlg3mkiriaqLdgIPSIPG7dOLFkriwLSazAFiBAk+YMmGNgK3 X-Received: by 2002:a17:903:11c5:b0:1d4:6484:fb63 with SMTP id q5-20020a17090311c500b001d46484fb63mr192119plh.85.1705682752603; Fri, 19 Jan 2024 08:45:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705682752; cv=pass; d=google.com; s=arc-20160816; b=0lD4uG9oJq+nkG0873xx5cxr4azVhmlFx6MOG6/eIqLEr5VVlRVQtPQLHPfe58aafQ 1rJaLMd5qCPRoY2Jx9m8TSm1Cu1SJT79sdxT4X1zl+cb2NE0hozE1wEtqGz01S33P4HR kDB1Eegy75Q0r51tHZkSYtAAxKg6WN1VGEwz0NG6FJZqGrhza9+MZLfF4jWV/CkTCrxv oE8fw3fFFXnXMbjwBnZl7tXoMAPUwsD5FugG4KGlG38Vlixdx35msHwR+4+1uToUm7gl svNg5IzrCArv4OvoGhxxeKOIKvw23LFXS3ewqb506aokzQg9naqPw0qa6r3Oou4ofNdr RQQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Txo1OueoDLxHIemOchAiO26LJw2wuuWi6pAo386hds0=; fh=kA/nHtkWe7kq3JAn+ZnAQ4DTmZzwSBnn92O6uU2xLKk=; b=kHoiFYyP9PnDWOi06bt3pBCZWBx9byhNjbJ3/bLml/m7Jr+0SzocXJ0QaU6d4Jkk85 U56XFCcZqNKvGiNBraQuPDDBHDAlgIDuNGH/gaQ9XIQudG8Vct8O9WNwgCKwT/6IOC3F I2jbKKTWuVrgAXRM4yV2lma9kN01lAfYFUWFvNQdEh5McFZpffQbnzG2cW/2XJoyTONt BcwWW/Kd6IS5eCjg1mlc4sFxUPr5+7Krs/bnyQVdK3WhZ/StLfL50R8dpuSvgyFe1oES wIQuypL6aph/as1pMK7MperOE1SsVNjph9wivZzq9FfqvcW0GsS9FaHfO127PR3hnoic lvgQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YZHoH88h; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2261-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2261-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k10-20020a170902c40a00b001d015cec684si3690535plk.238.2024.01.19.08.45.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:45:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2261-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YZHoH88h; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2261-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2261-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 227E7284A08 for ; Fri, 19 Jan 2024 16:45:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B43335577B; Fri, 19 Jan 2024 16:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YZHoH88h" X-Original-To: linux-wireless@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7FD3B5380D; Fri, 19 Jan 2024 16:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705682739; cv=none; b=ls9zEMYG1l+a+ursl/6jOnBcUVz00y5DpTMo9y9rK/eJouhjG0A7qytNPmb18OMGgUCl/C2/AO/0jleQOa9DFW7eV5l7oMFiLZz552qmRp+QGn3oaRnQxkesoIWP7ehzF3/JajhbcuiFXzkNWR1u/cA2ujfL3DJx/qRCBaSQHFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705682739; c=relaxed/simple; bh=Txo1OueoDLxHIemOchAiO26LJw2wuuWi6pAo386hds0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=D2J5Mv/GOGOR6NvroJkuIk9iKRAGSVWCmsmo+YWCOwcRaFmbpYFKzaP+g/l4QugtWHM6pZSfBvvRzV8A9OX8gMTHTgtjzTm/XEnSmxxuLVQILAHpVtsy9X9XDjX2i1jgHzc/GKN8l1DbykKI4BaBBqbZ7dlkxYKtNrQTEtJmX+M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YZHoH88h; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09746C433C7; Fri, 19 Jan 2024 16:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705682739; bh=Txo1OueoDLxHIemOchAiO26LJw2wuuWi6pAo386hds0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YZHoH88hsemWlCk6FbTmuBQypDjrF9bOXPFOxQjJ+6aGkTXnoZ/IWKMYEFszCKlPX +RTLxXwJdCX3/b5MjOND90T0pBSz43prhBnoJiODZjrstK67Rhe7avZwyLl//ci6C9 rjU2P9qv4OiUm2EJdfIceQOaOF2COJMvBwM8wnp+p/b5R2PigIwyfa/IlHA7pC2NaP SR80Hk8VfkddYSDgqyaJ1Qc1joMfv4bqvG0GjIFJQkHNxnq6agOLw8+LZ8ykgVeWhJ bvFwcc4ltC0OgC05bFSSq1PF6B6lboQOt6MzEjhyYDTaHeW6xUckPkzqiCCQTT6w8o urzHYCgFJ35Yg== Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-50e4e3323a6so2266585e87.0; Fri, 19 Jan 2024 08:45:38 -0800 (PST) X-Gm-Message-State: AOJu0YwSM+5J28KkhagLauV9+2HlszeQ+Id+ochTw2hDj+jzdeLLoiO2 EDKlZTOhiBYGAxCmbd19Xhp7JBJ9k7pKGfpFY4/unsURjXZGNd3Dapyar79cKcMp8oZlnfQzEzR tvlbReAc+did8blJo15Rh1SVcaA== X-Received: by 2002:a2e:bc83:0:b0:2cd:8ee4:50b6 with SMTP id h3-20020a2ebc83000000b002cd8ee450b6mr119453ljf.3.1705682717099; Fri, 19 Jan 2024 08:45:17 -0800 (PST) Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240117160748.37682-1-brgl@bgdev.pl> <20240119163405.GA32506@wunner.de> In-Reply-To: <20240119163405.GA32506@wunner.de> From: Rob Herring Date: Fri, 19 Jan 2024 10:45:04 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/9] PCI: introduce the concept of power sequencing of PCIe devices To: Lukas Wunner Cc: Bartosz Golaszewski , Dmitry Baryshkov , Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?UTF-8?B?TsOtY29sYXMgRiAuIFIgLiBBIC4gUHJhZG8=?= , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , Abel Vesa , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 19, 2024 at 10:34=E2=80=AFAM Lukas Wunner wro= te: > > On Fri, Jan 19, 2024 at 12:52:00PM +0100, Bartosz Golaszewski wrote: > > We have two separate issues: one is powering-up a PCI device so that > > it can be detected > > Just wondering, I note in really_probe() we configure the pin controller, > active the pm_domain etc before probing a driver. > > Would it make sense for the issue you mention above to similarly > amend pci_scan_device() to enable whatever clocks or regulators > are described in the devicetree as providers for the given PCI device? If you mean via a callback to some device specific code, then yes, I think that's exactly what should be done here. That's roughly what MDIO does. If firmware says there is a device present, then probe it anyways even if not detected. I don't think that will work for PCI because it accesses a lot of registers before probe. We'd need some sort of pre-probe hook instead called after reading vendor and device ID, but before anything else. If you mean PCI core just enable whatever clocks and regulators (and GPIOs), then no, because what is the correct order and timing for each of those? You don't know because that is device specific information just as how to program a device is. Rob