Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp712733lqt; Tue, 19 Mar 2024 01:04:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXR2rU23wB9+KqIevBpvWcWJn8fc5c5/XPygPUsV8g0vZ1rtaDtoCJcsTwb5wJsXm9Yk2fhbdK2HvLohwnptn9KJHdvcbXn8fV296fDFA== X-Google-Smtp-Source: AGHT+IGBvawkJres9QcXRhU3V0G6j/HuA5sPCtyfld1hM+RTz6rehZjaHdQEF+XhTiLmVUpKY91m X-Received: by 2002:a17:906:6a19:b0:a46:af3e:dedc with SMTP id qw25-20020a1709066a1900b00a46af3ededcmr5426561ejc.40.1710835454594; Tue, 19 Mar 2024 01:04:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710835454; cv=pass; d=google.com; s=arc-20160816; b=peegqJa2TcCl4E/MuUVJloEGq9JyuWpzGvNIuZj/39S5LgfrHm9r4Sx+oDkhoebThR xwXZapNYLuzssJV4jRpHfkclHxZtwm4qbOtr5kZT7945X3mfRTnLTHHvXuQ8xzLBHAUR ABPrxA1qyPiPK4WkoIL4fWjutn1RpCVPLVy3sFiGuOcXb4HMmw0NLDre/djemSCm9w8g z3E+BrFuy8DyIk6ThmYU17hKk8cugBLVLLEa/cN/AZ0iOVBvElZRwsFctEYS7e1gIrlr yN2OX/Fw4xwRm9+W50O28MpFmSK5NwMzpogSP4YIc3AeBDq8QugJsnWJn/KpVfzBNfON rsRQ== 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:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AFr6/sHna1pUZ/eQA3/P9SCeqS9c/LxT+6TMT5V1IH4=; fh=YF+mOFLN66KFCPZn66Y6WGCZdXUNtHqjc7r6dDAn2tU=; b=D1GjBECoh0Wgmy0QOPvK4PV84Ahk0KwrnN0RZO+9X9I4bOQVxnzwiW7/tzb171ueQ0 RKY7OxtlzdEugktV9F8VGleeNijVj08hNp8FJ0bjeR5QkaJ8hxZj6DK6hahFp3CYiHIo N75DLSzIMhsXo2oPFq60MsU9LXk/MqzxELREblNYi0DUORbgTOKr98nEr+7qr4van2N8 pgPRgL8twikpt1sdqFWRTvMf+i+FH6ar7yMPOq4meOYVk+MwJIDvy0ISl/AeVeZqc06J YuXUTE57WL8geLflPLR2C+AUXGgqGQbdwBNCJ36IKrv5XCiz12j0d2+Y1D9D7wc5pcig ADuw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="E/EBz4TP"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-107188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s19-20020a170906169300b00a467368475fsi4782820ejd.927.2024.03.19.01.04.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 01:04:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107188-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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="E/EBz4TP"; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-107188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 549A11F2281D for ; Tue, 19 Mar 2024 08:04:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 978855380B; Tue, 19 Mar 2024 08:03:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="E/EBz4TP" 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 A8EF5537E4; Tue, 19 Mar 2024 08:03:56 +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=1710835436; cv=none; b=lLpbG/r1KlsBsRl8GF3HScK+D1iPjvCktQUwbeEt3xGhci9Z4GiRJApUSzrzBR9yfKp6/aTyYGYnWhsJHYlRRFc2m9B7UOUZi0k4bnu+aVbbMOpvlRV7QalhPjWpnCWkBAGp3lqrncdNmj+hbVy67hscHAOfWmxNLctAi0orumA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835436; c=relaxed/simple; bh=5pMIwSL+oFaceFU0q+VQ+fxw61PUaymJCTKh5tTE8EM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ufFmRhevwMl345ve92GFkt44CTxKQhkK+Df6Z1Xc709zjsfcOgOLH/XrmBy43z+hd4uXVdScxnk8EZrRY3XbjI1NeJ7YcgtkXF4pISzcWbTIUPRo2rmofEeM8YdnNxYL2uGt1HpJK+fkQJoZh6XBwPQdgR0it3ohyO6a6Q84Ktw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=E/EBz4TP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9AADC433F1; Tue, 19 Mar 2024 08:03:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1710835436; bh=5pMIwSL+oFaceFU0q+VQ+fxw61PUaymJCTKh5tTE8EM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E/EBz4TP05UV76e4ihRit4qedT8ItYeorbvPeugThFfi2vX7De3TcITjKglIRY95g pJ/Y5enNynI/uF0nTfb6yYOtekimQnUsV0TOLka5xF7KbGrOFd/ntpt2LkEtbaosGG Hdwbs8A4i7UQhNFQgQVinlNIVhnyLYoMgbvlwD6o= Date: Tue, 19 Mar 2024 09:01:32 +0100 From: Greg Kroah-Hartman To: Xu Yilun Cc: Marco Pagani , Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , Jonathan Corbet , Alan Tull , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fpga@vger.kernel.org Subject: Re: [PATCH v6] fpga: manager: add owner module and take its refcount Message-ID: <2024031906-radish-handbrake-93b4@gregkh> References: <20240305192926.84886-1-marpagan@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: On Tue, Mar 19, 2024 at 12:04:13PM +0800, Xu Yilun wrote: > On Tue, Mar 05, 2024 at 08:29:26PM +0100, Marco Pagani wrote: > > The current implementation of the fpga manager assumes that the low-level > > module registers a driver for the parent device and uses its owner pointer > > to take the module's refcount. This approach is problematic since it can > > lead to a null pointer dereference while attempting to get the manager if > > the parent device does not have a driver. > > > > To address this problem, add a module owner pointer to the fpga_manager > > struct and use it to take the module's refcount. Modify the functions for > > registering the manager to take an additional owner module parameter and > > rename them to avoid conflicts. Use the old function names for helper > > macros that automatically set the module that registers the manager as the > > owner. This ensures compatibility with existing low-level control modules > > and reduces the chances of registering a manager without setting the owner. > > > > Also, update the documentation to keep it consistent with the new interface > > for registering an fpga manager. > > > > Other changes: opportunistically move put_device() from __fpga_mgr_get() to > > fpga_mgr_get() and of_fpga_mgr_get() to improve code clarity since the > > manager device is taken in these functions. > > > > Fixes: 654ba4cc0f3e ("fpga manager: ensure lifetime with of_fpga_mgr_get") > > Suggested-by: Greg Kroah-Hartman > > Suggested-by: Xu Yilun > > Signed-off-by: Marco Pagani > > Acked-by: Xu Yilun > > Will apply to v6.9-rc1 It is way too late for -rc1, sorry, this needs to wait for the next release. thanks, greg k-h