All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: D Scott Phillips <scott@os.amperecomputing.com>
Cc: linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org>,
	Darren Hart <darren@os.amperecomputing.com>,
	patches@amperecomputing.com
Subject: Re: [PATCH v2 2/2] PCI: hotplug: Add extension driver for Ampere Altra hotplug LED control
Date: Wed, 25 Oct 2023 12:22:37 -0500	[thread overview]
Message-ID: <20231025172237.GA1754650@bhelgaas> (raw)
In-Reply-To: <20230930002036.6491-2-scott@os.amperecomputing.com>

On Fri, Sep 29, 2023 at 05:20:36PM -0700, D Scott Phillips wrote:
> On Ampere Altra, PCIe hotplug is handled through ACPI. A side interface is
> also present to request system firmware control of attention LEDs. Add an
> ACPI PCI Hotplug companion driver to support attention LED control.
> ...

> +	arm_smccc_smc(REQUEST, LED_CMD, led_status(status), LED_ATTENTION,
> +		      pci_domain_nr(bus) | (PCI_SLOT(root_port->devfn) << 4), 0, 0,

pci_domain_nr() returns "int" (normally 32 bits), but since this is an
ACPI system, the domain comes from _SEG, which is defined to be 16
bits (ACPI r6.5, sec 6.5.6).

So it looks like ORing in the "slot << 4" clobbers the upper 12 bits
of _SEG.

Is this code doing the right thing?

  parent reply	other threads:[~2023-10-25 17:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-30  0:20 [PATCH v2 1/2] PCI: acpiphp: Allow built-in attention drivers D Scott Phillips
2023-09-30  0:20 ` [PATCH v2 2/2] PCI: hotplug: Add extension driver for Ampere Altra hotplug LED control D Scott Phillips
2023-10-03 18:32   ` Rafael J. Wysocki
2023-10-25 17:22   ` Bjorn Helgaas [this message]
2023-10-25 17:41     ` D Scott Phillips
2023-10-25 18:06       ` Bjorn Helgaas
2023-10-26 10:47         ` Anders Roxell
2023-10-26 11:04           ` Bjorn Helgaas
2023-10-11  0:13 ` [PATCH v2 1/2] PCI: acpiphp: Allow built-in attention drivers D Scott Phillips

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=20231025172237.GA1754650@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=darren@os.amperecomputing.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=patches@amperecomputing.com \
    --cc=rafael@kernel.org \
    --cc=scott@os.amperecomputing.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.