Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1552758lqs; Sat, 15 Jun 2024 14:26:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXfUdhR2mGtTdCXY1/r/BmmY+4DGlJkN0Zs1B52LGvA0si90xTEwy6lUZPSmiwPOdBm7k+LdoQd/q8Ch/9e7talXecvoztmsaSeJWeQAA== X-Google-Smtp-Source: AGHT+IFu3c6vQ5BT2xPJK07GmKyAJ11uaWYewq+Xtko6DP+HBy4GBFuiqHdbj7u2+lfeksT79WSU X-Received: by 2002:a17:90a:d517:b0:2ac:5d2d:12ac with SMTP id 98e67ed59e1d1-2c4db131a23mr7259578a91.5.1718486773759; Sat, 15 Jun 2024 14:26:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718486773; cv=pass; d=google.com; s=arc-20160816; b=YqOC/DWvXcRQSYQjPBFpQcdQ27o7NtdAzNMUz95wA+1xfsSzu6M+kq0Uoy513WV7oB O1Et2NE7uvhmGGwFq6pM7aV6ItHTw+qSMgFpkOoou8bSjlZg3FvH5iiOdWwe56RFOVbb 7S5azXNL5wHzeYBhyZcK5vVvyep4LrM9mSEBfztoKXN6Tz2bF0tJ2Z2KamWYOkc40wmK +MEkrkJ6+JNwecE1LUknQhJeHSUjmi/IQlThdX6fEKWk4YshzWVZtCjaXaEkHyTZAWZN rtktTlyd0oCDsIA0x2SB+1J0DfArrCICuozfUBPaVzkkirGpmh/qZWVvKgmtzt5QZcP8 bTtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=t/fNUCIZ/MSS4WvccBnAWFZT55dEKEKnpVcMg+0SMX0=; fh=q9QPg/g0ztyzPMyzZIT3jfV7QwpU0ufR6KiWiQI9s0Q=; b=J/e4jQ/bCS9F+D5Xh9cYHSxsZJrLcoT0L/A8lG+XvgFRMu1F1/XTq/MPT44+1NzLou GyTKQCuLl2UxW4fnDELPB2vzXJCgw7+N3UyEzrjWhZNP8eijb+kYbQBOxiOn0uh0vzDU +DU9Q7va928UrjzNq/xi2bESsr8mfson86vtpiUYtmx1ZRUjjMbgemiQ+8ryE8IbcywW iWQmSW+OMHydw+9aNhayffwYSmQKkyf/kta11etpqC4C8vd5A/kDV1AYLtFG8aAIdIRk cjMaRBOwGcIxIznVCm5JUelylbt05FbZvXDlu3XPIDLF9bFJB/7EOF0+rS34lTK5Zfwo tPNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qKSGlNtX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-216020-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4c47af66dsi6256034a91.176.2024.06.15.14.26.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 14:26:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-216020-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qKSGlNtX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-216020-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-216020-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5F9D9282C58 for ; Sat, 15 Jun 2024 21:26:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D496961FEF; Sat, 15 Jun 2024 21:26:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qKSGlNtX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 014361870; Sat, 15 Jun 2024 21:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718486766; cv=none; b=n3LwwSgVDpf30G24KJWaIbGrDx8WY46ltyB0J4ba7kEAUsBjJ/XvcCZHlQWdhHarnlpJ95rn7kC9tQ/uDCGRy95BL+0Fb5Vgy/DP29E7FoKMpPBqjJRKqbCucMLbycyfTFSJPEQjy1c+d1JshUuPUgaSvSnp13HqmSzvL/ux/Jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718486766; c=relaxed/simple; bh=IWW9A/n8TsLEyGyRo81wdPtnXrZ48OmSjXppUhL7hvI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=p6lMb4oonp7txXDC8kxgLdyLliHhvta/ibWuddMAZXIEH0WjJaWdc4n0LXK1RSJamiXYC673xvl0iSTmj+ay8f7g4U+OlGT7p0IjDGGWVqjdzoWa3nHjEZz67gQX7yvvvK7C/SqaKlRF0bK0fdE3Hfog3tg6KR9C4IyGvooAI6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qKSGlNtX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CC87C116B1; Sat, 15 Jun 2024 21:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718486765; bh=IWW9A/n8TsLEyGyRo81wdPtnXrZ48OmSjXppUhL7hvI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qKSGlNtXmQRJZ0DD6CG1dYBKaax7NCCEn7bW22dvIEPYZYzPsmnJGt+crImsHs3n/ JcVLnB8MXdk2JPf+qaeO4QFhdKfNY2YRcE8xVOd+TL51PXr4hyFk8y+eTNVE6YhAv+ o/8QQo+V2REqlgsiw4AbHqZ92UN9Eu3Ab+Tr8aHv063AvfOmHPIZI8b7JC0T5LGS67 xV+YP1VCc0VyePvyJO0H9DazI+LSXEcQxmFEXoZ/FQ905vl/gBkFIh1Jqglcg4qTlh /edTSTgNd4WLNyb/S96QtYPVcypOP/YPQqcbdALxlq3M02vKd4knSWyjF5Lh9NG0wG 5wEEgR9wLf02A== Date: Sat, 15 Jun 2024 16:26:03 -0500 From: Bjorn Helgaas To: Songyang Li Cc: bhelgaas@google.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH] PCI: Cancel compilation restrictions on function pcie_clear_device_status Message-ID: <20240615212603.GA1157372@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sat, Jun 15, 2024 at 11:13:07AM +0800, Songyang Li wrote: > On Wed, 12 Jun 2024 15:14:32 -0500, Bjorn Helgaas wrote: > > I think all current any callers of pcie_clear_device_status() are also > > under CONFIG_PCIEAER, so I don't think this fixes a current problem. > > > > As you point out, it might make sense to use > > pcie_clear_device_status() even without AER, but I think we should > > include this change at the time when we add such a use. > > > > If I'm missing a use with the current kernel, let me know. > > As far as I know, some PCIe device drivers, for example, > [net/ethernet/broadcom/tg3.c],[net/ethernet/atheros/atl1c/atl1c_main.c], > which use the following code to clear the device status register, > pcie_capability_write_word(tp->pdev, PCI_EXP_DEVSTA, > PCI_EXP_DEVSTA_CED | > PCI_EXP_DEVSTA_NFED | > PCI_EXP_DEVSTA_FED | > PCI_EXP_DEVSTA_URD); > I think it may be more suitable to export the pcie_clear_device_status() > for use in the driver code. If we want to use this from drivers, it would make sense to do something like this patch, and this patch could be part of a series to call it from the drivers. But at the same time, we should ask whether drivers should be clearing this status themselves, or whether it should be done by the PCI core. Bjorn