From: Bjorn Helgaas <helgaas@kernel.org>
To: manivannan.sadhasivam@linaro.org
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Johan Hovold <johan+linaro@kernel.org>,
Abel Vesa <abel.vesa@linaro.org>,
Stephan Gerhold <stephan.gerhold@linaro.org>,
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>,
stable+noautosel@kernel.org,
Krishna chaitanya chundru <quic_krichai@quicinc.com>
Subject: Re: [PATCH v2 3/5] PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers
Date: Wed, 20 Nov 2024 10:10:47 -0600 [thread overview]
Message-ID: <20241120161047.GA2325953@bhelgaas> (raw)
In-Reply-To: <20241025-pci-pwrctl-rework-v2-3-568756156cbe@linaro.org>
On Fri, Oct 25, 2024 at 01:24:53PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
> As per the kernel device driver model, pwrctl device is the supplier for
> the PCI device. But the device link that enforces the supplier-consumer
> relationship is created inside the pwrctl driver currently. Due to this,
> the driver model doesn't prevent probing of the PCI client drivers before
> probing the corresponding pwrctl drivers. This may lead to a race condition
> if the PCI device was already powered on by the bootloader (before the
> pwrctl driver).
> + * Create a device link between the PCI device and pwrctl device (if
> + * exists). This ensures that the pwrctl drivers are probed before the
> + * PCI client drivers.
> + */
> + pdev = of_find_device_by_node(dn);
> + if (pdev) {
> + if (!device_link_add(&dev->dev, &pdev->dev, DL_FLAG_AUTOREMOVE_CONSUMER))
> + pci_err(dev, "failed to add device link between %s and %s\n",
> + dev_name(&dev->dev), pdev->name);
This prints the name for "dev" twice (once by pci_err(dev) and again
from dev_name(&dev->dev)). Is it helpful to see it twice here?
next prev parent reply other threads:[~2024-11-20 16:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 7:54 [PATCH v2 0/5] PCI/pwrctl: Ensure that the pwrctl drivers are probed before PCI client drivers Manivannan Sadhasivam
2024-10-25 7:54 ` Manivannan Sadhasivam via B4 Relay
2024-10-25 7:54 ` [PATCH v2 1/5] PCI/pwrctl: Use of_platform_device_create() to create pwrctl devices Manivannan Sadhasivam
2024-10-25 7:54 ` Manivannan Sadhasivam via B4 Relay
2024-10-25 7:57 ` Bartosz Golaszewski
2024-10-25 7:54 ` [PATCH v2 2/5] PCI/pwrctl: Create pwrctl devices only if at least one power supply is present Manivannan Sadhasivam
2024-10-25 7:54 ` Manivannan Sadhasivam via B4 Relay
2024-11-06 21:28 ` Bjorn Helgaas
2024-11-07 9:52 ` Bartosz Golaszewski
2024-11-07 11:15 ` Manivannan Sadhasivam
2024-11-16 18:41 ` Krzysztof Wilczyński
2024-11-21 8:54 ` Klara Modin
2024-11-21 16:03 ` Krzysztof Wilczyński
2024-10-25 7:54 ` [PATCH v2 3/5] PCI/pwrctl: Ensure that the pwrctl drivers are probed before the PCI client drivers Manivannan Sadhasivam
2024-10-25 7:54 ` Manivannan Sadhasivam via B4 Relay
2024-11-20 16:10 ` Bjorn Helgaas [this message]
2024-11-20 17:02 ` Manivannan Sadhasivam
2024-11-20 20:18 ` Bjorn Helgaas
2024-11-21 12:00 ` Manivannan Sadhasivam
2024-11-21 18:28 ` Krzysztof Wilczyński
2024-11-21 20:14 ` Krzysztof Wilczyński
2024-10-25 7:54 ` [PATCH v2 4/5] PCI/pwrctl: Move pwrctl device creation to its own helper function Manivannan Sadhasivam
2024-10-25 7:54 ` Manivannan Sadhasivam via B4 Relay
2024-10-25 8:07 ` Bartosz Golaszewski
2024-10-25 7:54 ` [PATCH v2 5/5] PCI/pwrctl: Remove pwrctl device without iterating over all children of pwrctl parent Manivannan Sadhasivam
2024-10-25 7:54 ` Manivannan Sadhasivam via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241120161047.GA2325953@bhelgaas \
--to=helgaas@kernel.org \
--cc=abel.vesa@linaro.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=bhelgaas@google.com \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=brgl@bgdev.pl \
--cc=dmitry.baryshkov@linaro.org \
--cc=johan+linaro@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=quic_krichai@quicinc.com \
--cc=srinivas.kandagatla@linaro.org \
--cc=stable+noautosel@kernel.org \
--cc=stephan.gerhold@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.