public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Ryo Takakura <ryotkkr98@gmail.com>
To: lgoncalv@redhat.com
Cc: bhelgaas@google.com, jonathan.derrick@linux.dev, kw@linux.com,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-rt-devel@lists.linux.dev, lpieralisi@kernel.org,
	manivannan.sadhasivam@linaro.org, nirmal.patel@linux.intel.com,
	robh@kernel.org, rostedt@goodmis.org, bigeasy@linutronix.de
Subject: Re: [PATCH] PCI: vmd: Fix spinlock usage on config access for RT kernel
Date: Tue, 17 Dec 2024 17:22:45 +0900	[thread overview]
Message-ID: <20241217082245.12514-1-ryotkkr98@gmail.com> (raw)
In-Reply-To: <Z2A6VEMN5jkXg2lr@uudg.org>

Hi Luis,

On Mon, 16 Dec 2024 11:33:56 -0300, Luis Claudio R. Goncalves wrote:
>On Sun, Dec 15, 2024 at 11:13:21PM +0900, Ryo Takakura wrote:
>> PCI config access is locked with pci_lock which is raw_spinlock.
>> Convert cfg_lock to raw_spinlock so that the lock usage is consistent
>> for RT kernel.
>> 
>> Reported as following:
>> [   18.756807] BUG: sleeping function called from invalid context at kernel/locking/spinlock_rt.c:48
>> [   18.756810] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 1617, name: nodedev-init
>> [   18.756810] preempt_count: 1, expected: 0
>> [   18.756811] RCU nest depth: 0, expected: 0
>> [   18.756811] INFO: lockdep is turned off.
>> [   18.756812] irq event stamp: 0
>
>This problem has been discussed in the past at:
>
>    [PATCH v6.4-rc5-rt4] rt: vmd: make cfg_lock a raw spinlock
>    https://lore.kernel.org/linux-rt-users/20230608210232.056e731f@gandalf.local.home/T/#t
>
>And there was a suggestion to remove the lock altogether as (at the time) the
>only two call sites of vmd_pci_read() were already protected by pci_lock.
>
>I wrote the patch removing the lock and it worked as expected, but never
>sent it to the list. If you think that for the current code that makes
>sense, please have fun removing the lock. :)

I see, thanks for the link!
I took a look at current the code and I think that cfg_lock can still
safely be removed as explained by Sebastian [0].
I'll send another patch shortly!

>Best regards,
>Luis

Sincerely,
Ryo Takakura

[0] https://lore.kernel.org/linux-rt-users/20230620154434.MosrzRUh@linutronix.de/

      reply	other threads:[~2024-12-17  8:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-15 14:13 [PATCH] PCI: vmd: Fix spinlock usage on config access for RT kernel Ryo Takakura
2024-12-16 14:33 ` Luis Claudio R. Goncalves
2024-12-17  8:22   ` Ryo Takakura [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=20241217082245.12514-1-ryotkkr98@gmail.com \
    --to=ryotkkr98@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=bigeasy@linutronix.de \
    --cc=jonathan.derrick@linux.dev \
    --cc=kw@linux.com \
    --cc=lgoncalv@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=nirmal.patel@linux.intel.com \
    --cc=robh@kernel.org \
    --cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox