mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yicong Yang <yangyicong@huawei.com>
To: Krishna Chaitanya Chundru <quic_krichai@quicinc.com>
Cc: <yangyicong@hisilicon.com>,
	Shuai Xue <xueshuai@linux.alibaba.com>,
	Jing Zhang <renyu.zj@linux.alibaba.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Jonathan Corbet <corbet@lwn.net>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <quic_vbadigan@quicinc.com>,
	<quic_nitegupt@quicinc.com>, <quic_skananth@quicinc.com>,
	<quic_ramkri@quicinc.com>, <quic_parass@quicinc.com>,
	<quic_mrana@quicinc.com>
Subject: Re: [PATCH 3/4] perf/dwc_pcie: Always register for PCIe bus notifier
Date: Fri, 16 Aug 2024 15:42:01 +0800	[thread overview]
Message-ID: <82a28788-eed8-6cff-c2ee-fb4b421ae53c@huawei.com> (raw)
In-Reply-To: <2d882c88-fd56-c512-0dcc-8825ba920b51@quicinc.com>

On 2024/8/16 11:51, Krishna Chaitanya Chundru wrote:
> 
> 
> On 8/15/2024 7:19 PM, Yicong Yang wrote:
>> On 2024/7/31 12:23, Krishna chaitanya chundru wrote:
>>> When the PCIe devices are discovered late, the driver can't find
>>> the PCIe devices and returns in the init without registering with
>>> the bus notifier. Due to that the devices which are discovered late
>>> the driver can't register for this.
>>>
>>> Register for bus notifier even if the device is not found in init.
>>>
>>> Fixes: af9597adc2f1 ("drivers/perf: add DesignWare PCIe PMU driver")
>>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
>>> ---
>>>   drivers/perf/dwc_pcie_pmu.c | 10 +++++-----
>>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/perf/dwc_pcie_pmu.c b/drivers/perf/dwc_pcie_pmu.c
>>> index c115348b8d53..aa1010b44bcb 100644
>>> --- a/drivers/perf/dwc_pcie_pmu.c
>>> +++ b/drivers/perf/dwc_pcie_pmu.c
>>> @@ -741,8 +741,6 @@ static int __init dwc_pcie_pmu_init(void)
>>>             found = true;
>>>       }
>>> -    if (!found)
>>> -        return -ENODEV;
>>>         ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN,
>>>                         "perf/dwc_pcie_pmu:online",
>>> @@ -753,9 +751,11 @@ static int __init dwc_pcie_pmu_init(void)
>>>         dwc_pcie_pmu_hp_state = ret;
>>>   -    ret = platform_driver_register(&dwc_pcie_pmu_driver);
>>> -    if (ret)
>>> -        goto platform_driver_register_err;
>>> +    if (!found) {
>>> +        ret = platform_driver_register(&dwc_pcie_pmu_driver);
>>> +        if (ret)
>>> +            goto platform_driver_register_err;
>>> +    }
>>>
>>
>> This doesn't match the commit.
>> > If any device is found at this stage, we cannot use them since you don't
>> register a driver.
>>
> If the device is not found then only we are skipping platform driver
> register otherwise driver will be registering with the platform driver.
> 

think about the case that devices already discovered before module init.
without the change here we'll register both the platform devices and driver
but with the change here we'll only register the platform devices without
the related driver to probe them.

Try to register the driver and notifier unconditionally will solve the issue.
It'll probe the device and register the PMU if later device is added by
the bus notifier.

Thanks.

> - Krishna Chaitanya.
>>>       ret = bus_register_notifier(&pci_bus_type, &dwc_pcie_pmu_nb);
>>>       if (ret)
>>>
> 
> .

  reply	other threads:[~2024-08-16  7:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  4:23 [PATCH 0/4] perf/dwc_pcie: Fix registration issue in multi PCIe controller instances Krishna chaitanya chundru
2024-07-31  4:23 ` [PATCH 1/4] " Krishna chaitanya chundru
2024-08-15 13:40   ` Yicong Yang
2024-08-16  3:41     ` Krishna Chaitanya Chundru
2024-07-31  4:23 ` [PATCH 2/4] Documentation: dwc_pcie_pmu: Update bdf to sbdf Krishna chaitanya chundru
2024-08-15 13:44   ` Yicong Yang
2024-07-31  4:23 ` [PATCH 3/4] perf/dwc_pcie: Always register for PCIe bus notifier Krishna chaitanya chundru
2024-08-15 13:49   ` Yicong Yang
2024-08-16  3:51     ` Krishna Chaitanya Chundru
2024-08-16  7:42       ` Yicong Yang [this message]
2024-07-31  4:23 ` [PATCH 4/4] perf/dwc_pcie: Add support for QCOM vendor devices Krishna chaitanya chundru
2024-08-15 13:51   ` Yicong Yang

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=82a28788-eed8-6cff-c2ee-fb4b421ae53c@huawei.com \
    --to=yangyicong@huawei.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=corbet@lwn.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=quic_krichai@quicinc.com \
    --cc=quic_mrana@quicinc.com \
    --cc=quic_nitegupt@quicinc.com \
    --cc=quic_parass@quicinc.com \
    --cc=quic_ramkri@quicinc.com \
    --cc=quic_skananth@quicinc.com \
    --cc=quic_vbadigan@quicinc.com \
    --cc=renyu.zj@linux.alibaba.com \
    --cc=will@kernel.org \
    --cc=xueshuai@linux.alibaba.com \
    --cc=yangyicong@hisilicon.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®