Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp44846rdb; Tue, 16 Jan 2024 14:30:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+eJVLPHAK0oocBgKGzQdtKzRhV/n/rhmwb5RamB6vAq/TYuoj9nPUNOa24XwPlOoguwdA X-Received: by 2002:aa7:dd13:0:b0:559:c677:35ad with SMTP id i19-20020aa7dd13000000b00559c67735admr703709edv.21.1705444218625; Tue, 16 Jan 2024 14:30:18 -0800 (PST) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dz10-20020a0564021d4a00b005590dee9f68si3259379edb.298.2024.01.16.14.30.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 14:30:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-28311-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-28311-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-28311-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 601941F2D719 for ; Tue, 16 Jan 2024 22:30:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAF1E35EE9; Tue, 16 Jan 2024 21:37:47 +0000 (UTC) Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) (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 C1B0B20315 for ; Tue, 16 Jan 2024 21:37:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705441067; cv=none; b=UVHUHfpbnk2Uq779Qs0sXfT0uvQIHlTFC9d+NAYd/aVjhJslOZkniAVVmHPCBXsbnWUQKl/2F8M7buYPq8hVppxhBU2fAi8YMJ650U0XQWKTPC6OZ7jEvenKLpoQvYsq6OLNs2d+AWpW68Bl0ejxWkHHsT42AuE8lli8eUwpfGU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705441067; c=relaxed/simple; bh=DrPYOohz5TNLetnSbNFby5mXuPuzhsqpd/t6fTixqvY=; h=Received:From:Date:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; b=rESAlXc56GjK6MZPD2NWpDnMzfWHe8b9Oay69As2gSibUgQEld569PYEnDtQwcvfNLeKqNbyIlLj168G+gUVWyXAopza18YiWbnZRF3dZysT3iCQPT77wZMsgQn94ZFV7lhM1YvaVHz6mD3bIHEz062oO1A4Lj6kRutwzwgQcxM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-24-108.elisa-laajakaista.fi [88.113.24.108]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 7afc7402-b4b7-11ee-abf4-005056bdd08f; Tue, 16 Jan 2024 23:37:43 +0200 (EET) From: andy.shevchenko@gmail.com Date: Tue, 16 Jan 2024 23:37:39 +0200 To: Philipp Stanner Cc: Jonathan Corbet , Hans de Goede , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Bjorn Helgaas , Sam Ravnborg , dakr@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org Subject: Re: [PATCH 08/10] pci: devres: give pci(m)_intx its own callback Message-ID: References: <20240115144655.32046-2-pstanner@redhat.com> <20240115144655.32046-10-pstanner@redhat.com> 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: <20240115144655.32046-10-pstanner@redhat.com> Mon, Jan 15, 2024 at 03:46:19PM +0100, Philipp Stanner kirjoitti: > pci_intx() is one of the functions that have "hybrid mode" (i.e., > sometimes managed, sometimes not). Providing a separate pcim_intx() > function with its own device resource and cleanup callback allows for > removing further large parts of the legacy pci-devres implementation. > > As in the region-request-functions, pci_intx() has to call into its > managed counterpart for backwards compatibility. > > Implement pcim_intx() with its own device resource. > Make pci_intx() call pcim_intx() in the managed case. > Remove the legacy devres struct from pci.h. .. > + /* > + * This is done for backwards compatibility, because the old pci-devres > + * API had a mode in which this function became managed if the dev had > + * been enabled with pcim_enable_device() instead of pci_enable_device(). > + */ > + if (pci_is_managed(pdev)) { > + if (pcim_intx(pdev, enable) != 0) > + WARN_ON_ONCE(1); WARN_ON_ONCE(pcim_intx(pdev, enable)); ? > + return; > + } .. > + if (new != pci_command) if (new == pci_command) return; ? > pci_write_config_word(pdev, PCI_COMMAND, new); -- With Best Regards, Andy Shevchenko