All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Yicong Yang <yangyicong@huawei.com>
Cc: <mathieu.poirier@linaro.org>, <suzuki.poulose@arm.com>,
	<corbet@lwn.net>, <linux-kernel@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <alexander.shishkin@linux.intel.com>,
	<helgaas@kernel.org>, <linux-pci@vger.kernel.org>,
	<prime.zeng@huawei.com>, <linuxarm@huawei.com>,
	<yangyicong@hisilicon.com>
Subject: Re: [PATCH v4 5/5] hwtracing: hisi_ptt: Fix potential sleep in atomic context
Date: Tue, 6 Jun 2023 17:43:05 +0100	[thread overview]
Message-ID: <20230606174305.00005a10@Huawei.com> (raw)
In-Reply-To: <20230606142244.10939-6-yangyicong@huawei.com>

On Tue, 6 Jun 2023 22:22:44 +0800
Yicong Yang <yangyicong@huawei.com> wrote:

> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> We're using pci_irq_vector() to obtain the interrupt number and then
> bind it to the CPU start perf under the protection of spinlock in
> pmu::start(). pci_irq_vector() might sleep since [1] because it will
> call msi_domain_get_virq() to get the MSI interrupt number and it
> needs to acquire dev->msi.data->mutex. Getting a mutex will sleep on
> contention. So use pci_irq_vector() in an atomic context is problematic.
> 
> This patch cached the interrupt number in the probe() and uses the
> cached data instead to avoid potential sleep.
> 
> [1] commit 82ff8e6b78fc ("PCI/MSI: Use msi_get_virq() in pci_get_vector()")
> Fixes: ff0de066b463 ("hwtracing: hisi_ptt: Add trace function support for HiSilicon PCIe Tune and Trace device")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

LGTM

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>


      reply	other threads:[~2023-06-06 16:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 14:22 [PATCH v4 0/5] Improve PTT filter interface and some fixes Yicong Yang
2023-06-06 14:22 ` [PATCH v4 1/5] hwtracing: hisi_ptt: Factor out filter allocation and release operation Yicong Yang
2023-06-06 14:22 ` [PATCH v4 2/5] hwtracing: hisi_ptt: Add support for dynamically updating the filter list Yicong Yang
2023-06-06 16:40   ` Jonathan Cameron
2023-06-06 14:22 ` [PATCH v4 3/5] hwtracing: hisi_ptt: Export available filters through sysfs Yicong Yang
2023-06-06 16:46   ` Jonathan Cameron
2023-06-06 14:22 ` [PATCH v4 4/5] hwtracing: hisi_ptt: Advertise PERF_PMU_CAP_NO_EXCLUDE for PTT PMU Yicong Yang
2023-06-19 13:00   ` hejunhao
2023-06-20  9:09     ` Yicong Yang
2023-06-06 14:22 ` [PATCH v4 5/5] hwtracing: hisi_ptt: Fix potential sleep in atomic context Yicong Yang
2023-06-06 16:43   ` Jonathan Cameron [this message]

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=20230606174305.00005a10@Huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=corbet@lwn.net \
    --cc=helgaas@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=prime.zeng@huawei.com \
    --cc=suzuki.poulose@arm.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yangyicong@huawei.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 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.