From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 853DDC83F27 for ; Tue, 15 Jul 2025 21:39:47 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4bhXdt1YPyz2xgQ; Wed, 16 Jul 2025 07:39:46 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=23.155.224.40 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1752615586; cv=none; b=W69upLunBRRbvA5u84C73KInO5cDfPcLxJO+ox3CrAEB0w4FcMSvnZZjo+Y2v7WAnUzbfFPtZznnkHxzvRFA9rdRTx52+9+ubIbAY2psUdOxJPPObrnBoLfhIF8qk/iBuS+0eRzD08zOR1Ef5OgYQ8XVTPOJqFbJHyH16hAZ7wPuT2J9W1D5O9KOYU+salj3tf2xUAT6MzROu7pJUO7d+LhdjX/gTI07kFIX8bxbNVF6o0yvtew3bYBVHRijOXie3C/vXqdM2LM/sfXOh6LpsEfaicNDzUG94RxWe/dDWXnFA8U9vhHiiUMFvggRI6YfwhacQJp0Uf4594AelztHXw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1752615586; c=relaxed/relaxed; bh=R/JTJdtwW+QkveuipqtnZ2LcFEWOkXpaagYwjf7bvsU=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=bJ9BDAATyYWxsn6J2KHeS8TCb41Mj0cSJUGL0e49/nrXhLaIaLNoqe/A/IRNyL5IiJC1SGev/lNAMa1SjApKQpwO94L6eNRY8pZu7LLVN13V0iLieLrMTD8fUBBacmptP87jfYiA3NuIqCITMmHwonVEMkICB84F+iEIgLDJ3sHYbdLf2Si7QBu0asDoMsuGREyF8O2S5F4hcPjUaAkfQNpr76jmRTlGxj1BmGIJqDgy9HSUVYiOucJH1kvPYCEbSNtCnf9enIASZiQseZFd5JQ7LpenpzckL2TASRZuVxUXn6X+L7nXIWCQAivIgYMnylwt6PeoomOI8l3i5/wzmQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=raptorengineering.com; dkim=pass (1024-bit key; secure) header.d=raptorengineering.com header.i=@raptorengineering.com header.a=rsa-sha256 header.s=B8E824E6-0BE2-11E6-931D-288C65937AAD header.b=D3iAdAgV; dkim-atps=neutral; spf=pass (client-ip=23.155.224.40; helo=raptorengineering.com; envelope-from=tpearson@raptorengineering.com; receiver=lists.ozlabs.org) smtp.mailfrom=raptorengineering.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=raptorengineering.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=raptorengineering.com header.i=@raptorengineering.com header.a=rsa-sha256 header.s=B8E824E6-0BE2-11E6-931D-288C65937AAD header.b=D3iAdAgV; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=raptorengineering.com (client-ip=23.155.224.40; helo=raptorengineering.com; envelope-from=tpearson@raptorengineering.com; receiver=lists.ozlabs.org) Received: from raptorengineering.com (mail.raptorengineering.com [23.155.224.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4bhXds1DHqz2xd6 for ; Wed, 16 Jul 2025 07:39:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 57CE08286D62; Tue, 15 Jul 2025 16:39:43 -0500 (CDT) Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id tmyS4NZMKEi3; Tue, 15 Jul 2025 16:39:42 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 5087B8287698; Tue, 15 Jul 2025 16:39:42 -0500 (CDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.rptsys.com 5087B8287698 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raptorengineering.com; s=B8E824E6-0BE2-11E6-931D-288C65937AAD; t=1752615582; bh=R/JTJdtwW+QkveuipqtnZ2LcFEWOkXpaagYwjf7bvsU=; h=Date:From:To:Message-ID:MIME-Version; b=D3iAdAgVu/nXdic/B0Uspr+WTRVXdaQpR4f6o+2w4RVT6N/HZoVhElCyeQ8BlqXcW 29fuWOnScL8FRtP3mVPwyBGfmxY3fcBB5kC8gADmcvoOr0s6URKYGJcrkPAZyM81kv pSqrk6Dsk01Muk1HWcjk7wIJlQ21qpkt0ZThnhgg= X-Virus-Scanned: amavisd-new at rptsys.com Received: from mail.rptsys.com ([127.0.0.1]) by localhost (vali.starlink.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1e5Fx11LJPWI; Tue, 15 Jul 2025 16:39:42 -0500 (CDT) Received: from vali.starlink.edu (localhost [127.0.0.1]) by mail.rptsys.com (Postfix) with ESMTP id 173C08286D62; Tue, 15 Jul 2025 16:39:42 -0500 (CDT) Date: Tue, 15 Jul 2025 16:39:42 -0500 (CDT) From: Timothy Pearson To: Timothy Pearson Cc: linuxppc-dev , linux-kernel , linux-pci , Madhavan Srinivasan , Michael Ellerman , christophe leroy , Naveen N Rao , Bjorn Helgaas , Shawn Anastasio Message-ID: <1210309411.1359866.1752615582001.JavaMail.zimbra@raptorengineeringinc.com> In-Reply-To: <1268570622.1359844.1752615109932.JavaMail.zimbra@raptorengineeringinc.com> References: <1268570622.1359844.1752615109932.JavaMail.zimbra@raptorengineeringinc.com> Subject: [PATCH v3 6/6] PCI: pnv_php: Enable third attention indicator state X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Mailer: Zimbra 8.5.0_GA_3042 (ZimbraWebClient - GC138 (Linux)/8.5.0_GA_3042) Thread-Topic: pnv_php: Enable third attention indicator state Thread-Index: XyF2OaMn/3q+H+nwsGaxXLVF4U4PFzXTlJEB The PCIe specification allows three attention indicator states, on, off, and blink. Enable all three states instead of basic on / off control. This changes the userspace API to match the behavior of pcihp. Signed-off-by: Timothy Pearson --- drivers/pci/hotplug/pnv_php.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 3533f7f23b71..c65460ced862 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -441,10 +441,23 @@ static int pnv_php_get_adapter_state(struct hotplug_slot *slot, u8 *state) return ret; } +static int pnv_php_get_raw_indicator_status(struct hotplug_slot *slot, u8 *state) +{ + struct pnv_php_slot *php_slot = to_pnv_php_slot(slot); + struct pci_dev *bridge = php_slot->pdev; + u16 status; + + pcie_capability_read_word(bridge, PCI_EXP_SLTCTL, &status); + *state = (status & (PCI_EXP_SLTCTL_AIC | PCI_EXP_SLTCTL_PIC)) >> 6; + return 0; +} + + static int pnv_php_get_attention_state(struct hotplug_slot *slot, u8 *state) { struct pnv_php_slot *php_slot = to_pnv_php_slot(slot); + pnv_php_get_raw_indicator_status(slot, &php_slot->attention_state); *state = php_slot->attention_state; return 0; } @@ -462,7 +475,7 @@ static int pnv_php_set_attention_state(struct hotplug_slot *slot, u8 state) mask = PCI_EXP_SLTCTL_AIC; if (state) - new = PCI_EXP_SLTCTL_ATTN_IND_ON; + new = FIELD_PREP(PCI_EXP_SLTCTL_AIC, state); else new = PCI_EXP_SLTCTL_ATTN_IND_OFF; -- 2.39.5