Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp454634ybe; Fri, 6 Sep 2019 02:07:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy4cpKLOKciPQDHZ1VhWFluX6/1di7HZU4+NkVklm0kSPh4XX2jSXqQfOUfxErbwHgCBUAp X-Received: by 2002:a17:902:5c3:: with SMTP id f61mr7639782plf.98.1567760829559; Fri, 06 Sep 2019 02:07:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567760829; cv=none; d=google.com; s=arc-20160816; b=JNJLG0rTpsfEhPnQiIK7XODmGRYwF8ArZ7mQKWaq+U99Lf0qEzFnEm+WJ+BIbsJBFC CN41p8zz2W6QDU8YBHATQpa+R5x3o3w9EYYpXGo4SmQ+cGzwR/AlvDD2t8luO+F4TUUR f2tZZL3azWfMuk9Flxnt1vOLCA+ZWGzxzeboiXv22Z1TfpfOWqb1ZwamElVmktvb0suS e1iYnoQytqb410sUR7qe6nCE8S+OcUBw5oBmF4XKaLFF32LhxP7CJWoI2dciKhtCPVtE kD/sIVIvVQNrBgTzmi+DQ3kDz5JguSQhSYV16ZaQT+yevy8QjNSV2Tl3/xUbP007yYSJ 5FPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=adXDVMNtetKO4F573/QuhBO9FEd0/9c6yeD3I5aXqtM=; b=Bps7HRoqg36OkZhia6QIfGgMCPl78TeP3W0/EE1msqOvX03TfE9y6GNx+IrJklJUvx euS31obDKXM2HhrnZ0FhzikuuEZ7yeuXcSbtkaheZBLhyGamd4M5OcH0FyPr3jzb9CZg kbZ9wBBjRI2b7gEiQP/0XcdtwsQ5533hSDDmL9vNbDG76hN1xjR79ajmAhjlcM+BIe90 pKlcplEGXdJ+U9OADKZ/fe5l7wwM8N9KJqC9uBNhxJaQcaDBdzv68KrBkz0xpfgL7x4Z T8Or95olPst/XNEQ2ieahT15QQY7q/btNyXNwdQNx2rrbamPvm6pi2dTmib3llQwJIQD VD+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d63si4327149pld.139.2019.09.06.02.06.51; Fri, 06 Sep 2019 02:07:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389544AbfIEWDa (ORCPT + 99 others); Thu, 5 Sep 2019 18:03:30 -0400 Received: from bmailout3.hostsharing.net ([176.9.242.62]:34171 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727346AbfIEWD3 (ORCPT ); Thu, 5 Sep 2019 18:03:29 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id A86CC100B00EC; Fri, 6 Sep 2019 00:03:27 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 64A0330C9DE; Fri, 6 Sep 2019 00:03:27 +0200 (CEST) Date: Fri, 6 Sep 2019 00:03:27 +0200 From: Lukas Wunner To: Bjorn Helgaas Cc: Denis Efremov , linux-pci@vger.kernel.org, Kuppuswamy Sathyanarayanan , Oliver O'Halloran , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/4] Simplify PCIe hotplug indicator control Message-ID: <20190905220327.poa6sknhei6tj47v@wunner.de> References: <20190903111021.1559-1-efremov@linux.com> <20190905210102.GG103977@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190905210102.GG103977@google.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 05, 2019 at 04:01:02PM -0500, Bjorn Helgaas wrote: > void pciehp_set_indicators(struct controller *ctrl, int pwr, int attn) > { > u16 cmd = 0, mask = 0; > > - if (PWR_LED(ctrl) && pwr > 0) { > - cmd |= pwr; > + if (PWR_LED(ctrl) && pwr != INDICATOR_NOOP) { > + cmd |= (pwr & PCI_EXP_SLTCTL_PIC); > mask |= PCI_EXP_SLTCTL_PIC; > } > > - if (ATTN_LED(ctrl) && attn > 0) { > - cmd |= attn; > + if (ATTN_LED(ctrl) && attn != INDICATOR_NOOP) { > + cmd |= (attn & PCI_EXP_SLTCTL_AIC); > mask |= PCI_EXP_SLTCTL_AIC; > } There's a subtle issue here: A value of "0" is "reserved" per PCIe r4.0, sec 7.8.10. Denis filtered that out, with your change it's an accepted value. I don't think the function ever gets called with a value of "0", so it's not a big deal. And maybe we don't even want to filter that value out. Just noting anyway. Thanks, Lukas