All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ravi Kumar Bandi <ravib@amazon.com>
To: <kwilczynski@kernel.org>
Cc: <bhelgaas@google.com>, <ilpo.jarvinen@linux.intel.com>,
	<linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<ravib@amazon.com>
Subject: Re: [PATCH] PCI/sysfs: Check IORESOURCE_DISABLED in resource mmap handler
Date: Wed, 13 May 2026 06:48:20 +0000	[thread overview]
Message-ID: <20260513064822.39534-1-ravib@amazon.com> (raw)
In-Reply-To: <20260513043934.GA4124219@rocinante>

On Wed, May 13, 2026 at 14:07:02 +0900, Krzysztof Wilczyński wrote:
> There also exists pci_device_is_present() which would attempt an actual
> read of a vendor/device IDs, so if this succeeds, then you have a more
> solid assurance that the device should be working.  However, this adds
> latency, and there might be side-effects, potentially...

Yeah, exactly - it adds latency and will be more profound if applications
mmap the resources periodically.

> I wonder, if for you, you could forfeit setting any flags on a resource,
> which drivers don't customarily do, such that we would only rely on
> checking pci_dev_is_disconnected() on our side, so to speak.
>
> We won't be setting any precedent here, as the helpers such as
> pci_read_config_byte(), perform this check internally already.
>
> Bjorn and Ilpo might have different take on this, though.

Thank you for the suggestion. Yes, we can forfeit setting
IORESOURCE_DISABLED and rely solely on pci_dev_is_disconnected()
check in pci_mmap_resource(). I have submitted v2 patch, please
review.

Thank you.
Ravi Kumar Bandi

  reply	other threads:[~2026-05-13  6:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12  8:43 [PATCH] PCI/sysfs: Check IORESOURCE_DISABLED in resource mmap handler Ravi Kumar Bandi
2026-05-12  9:26 ` Krzysztof Wilczyński
2026-05-12  9:43   ` Ilpo Järvinen
2026-05-12  9:54     ` Krzysztof Wilczyński
2026-05-13  4:04       ` Ravi Kumar Bandi
2026-05-13  5:07         ` Krzysztof Wilczyński
2026-05-13  6:48           ` Ravi Kumar Bandi [this message]
2026-05-13  4:13 ` [PATCH v2] PCI/sysfs: Check if device disabled " Ravi Kumar Bandi
2026-05-14  1:47   ` sashiko-bot
2026-05-13 19:42 ` [PATCH] PCI/sysfs: Check IORESOURCE_DISABLED " sashiko-bot

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=20260513064822.39534-1-ravib@amazon.com \
    --to=ravib@amazon.com \
    --cc=bhelgaas@google.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.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.