Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp668852lqd; Wed, 24 Apr 2024 13:13:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXr/y+ouHDjuaywKaakRYFiC97lhe/m2DqNO4KIDeIaYIgwmBei2xdFeJNjuEJuunr5Yp0dQk00srYXJWXvcPYxtwaeXZcJnJiSC6cM8Q== X-Google-Smtp-Source: AGHT+IEyjbf27eolwI3FSQQnZbaRWd8Op1IvZGsGMa42cvZ6SgfJ8z5GDAR6o1R+1a9/eqOWb9u2 X-Received: by 2002:a05:690c:7308:b0:61a:b1a7:b300 with SMTP id jp8-20020a05690c730800b0061ab1a7b300mr3601064ywb.29.1713989589565; Wed, 24 Apr 2024 13:13:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713989589; cv=pass; d=google.com; s=arc-20160816; b=v1LPDZf4sWhjefqpO7azL6dKfNWyXBdc8Lj6+HpeRh0Z5mh36etbcsMVuf6+3fGxAf SoUjKNrPEI0lzttcZEp9jYzbci9I/FCAiRYwh+IsFEHM/FPa3n+8AZ4ZC/e/9rJTLkqR kPhsGcjeraTmpwy6SlXMZsm5AbUDxLb0GhquziCjZQE9jfUUTrbJ1pBPqidcjTLG5hdj uf1ZXzP4O/F7ISEy0DPZGXNEzYFr1PWlBMSphG96RxzXesFLDKTkqgoByV4qxxTCh/K7 xkWi+dWe65dK0CdPPlA0LxNmlC4mT+cm0++26zZe2plsFLwn/l9E30qP/sHGxMSOslvL ezpA== 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=KETrW7439t6jXGdV2Y2P0EEKF3y1T5YldbPmtv6UmjM=; fh=yGZPJrR4jI61f4b9Skp0m6ankuyTR1bnhxbrcmxZQ6Q=; b=ub3nZgNmv89xFz1pGzMuccRVMx/NzlLamNcxgjp23Yej4nNBJu8s8qv4BzRyjBrIpn bpIMlek+NzJiVX1aZOlHUyzYr4OIybwcLQb4zYatCzeMp3GtK2Nx/vb087gdmVpTe1PJ 4+v1xLgCKnNlPOzdDnIY2qPAIOkqBkQISOPeFNCWC6ALoNIzEqRR+cPyJk+jhy03gtCO UEP2s+UwHHYL9e7kmZs2IdUBD5g3kF5D5MLtICJLKhUzHRhBIJcUMcJruFBZGSXMDI27 oFFNh/8UGNnf/rQu5ni0VhiQKlFBKIzzI23bLE+/n8KuYfN9tdXfwMdTnTncpKuH68Q0 IBKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kVnkFev/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157665-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c7-20020a05622a058700b00434ab538521si15960187qtb.294.2024.04.24.13.13.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 13:13:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kVnkFev/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157665-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157665-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 477581C21269 for ; Wed, 24 Apr 2024 20:13:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0004D13E8B5; Wed, 24 Apr 2024 20:12:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kVnkFev/" 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 27E2813C9C6; Wed, 24 Apr 2024 20:12:55 +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=1713989576; cv=none; b=HxFLdXMsfuwmdx/ZDW0ueDTdGJ6YnXXEaqTAQk7VtTp8K8uM+TWkAGxQ2Wz4+IM8MaPgcBduwlnfdU0aO8Z0yXHWWhN+TgVcDiyQIAFxmhL+NbPDFsPFLtcjYowfB5R8Wym78yi9Vu0hv/xADs4NZQhXJF+HhI12g3ax88eZMUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713989576; c=relaxed/simple; bh=Z31A8N0qW+ZyGJx8PwhBZp2nsGK8UYpFU7rmbakzEfc=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=TcM0yEUlvD1Rlwr3dbN3hl9JMEnS+EO9H9dIBh9aq/dnpJJhCUyJM26lvZuChhK/9K8rtQRbemIDwlhyN/p+LYHSexv2aIByyiujdi52uJ8l0HGFkUnP8kPYE0wXcXD+ITboCtysiwNaserPtwa+4b5hxayb9+uR8erffMjy7Oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kVnkFev/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91507C113CD; Wed, 24 Apr 2024 20:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713989575; bh=Z31A8N0qW+ZyGJx8PwhBZp2nsGK8UYpFU7rmbakzEfc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=kVnkFev/TiZTySQUl4vTE3gALeCYbONHxzH+MJibn9p60uXTGAbHlT7Jm6T0LG431 AldHO2UoU3LA5UJeDdQzsDqD9ANeyL18Kd4+nM3DN2TcLuwwN6AMDbGAC53CjtSJVe hM41diZx+HhF+/tTHMHdssvTCmJKfH7YJNyX6N2LNbi4kULJH5B6z4rCjH9vQFfFk+ suMwe50kS0IvOjRmKeECTqlxEWiev8IXU1GzRq6klc7ukkDdEl6tC3WPQ3EScIHpQJ 6DLftMO+cXRHN4hs5bWTflXQ99tX07tk8z1bJ7BmW9V4sS9tf+UL7iT4fU4U9Jly52 ji6qGFJSyN5bQ== Date: Wed, 24 Apr 2024 15:12:53 -0500 From: Bjorn Helgaas To: Philipp Stanner Cc: Hans de Goede , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Bjorn Helgaas , Sam Ravnborg , dakr@redhat.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH v6 03/10] PCI: Warn users about complicated devres nature Message-ID: <20240424201253.GA499493@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: <20240408084423.6697-4-pstanner@redhat.com> On Mon, Apr 08, 2024 at 10:44:15AM +0200, Philipp Stanner wrote: > The PCI region-request functions become managed functions when > pcim_enable_device() has been called previously instead of > pci_enable_device(). > > This has already caused bugs by confusing users, who came to believe > that all pci functions, such as pci_iomap_range(), suddenly are managed > that way. Since you mention a bug, it'd be nice to include a URL or commit if you have one. > This is not the case. > > Add comments to the relevant functions' docstrings that warn users about > this behavior. > @@ -3914,6 +3916,13 @@ EXPORT_SYMBOL(pci_release_region); > * > * Returns 0 on success, or %EBUSY on error. A warning > * message is also printed on failure. > + * > + * NOTE: > + * This is a "hybrid" function: Its normally unmanaged, but becomes managed > + * when pcim_enable_device() has been called in advance. > + * This hybrid feature is DEPRECATED! If you need to implement a new pci > + * function that does automatic cleanup, write a new pcim_* function that uses > + * devres directly. This note makes sense on exported functions, but I think it's overkill on static ones like this. s/Its normally/It's normally/ s/new pci/new PCI/ Rewrap into one paragraph (or separate by blank line). Applies to all the hunks of this patch. > static int __pci_request_region(struct pci_dev *pdev, int bar, > const char *res_name, int exclusive)