From nobody Fri Dec 19 09:50:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 7DD1472053 for ; Mon, 18 Dec 2023 20:28:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Zrd12Sim" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702931303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w2UwYCwVRjcUcjWfvK32U8AOw6QLNt0hCo/IhBitX7A=; b=Zrd12Sim23UHVyr0ohytTzAmszhDPSRt3eK9/PZ+86zvEXLzobq7mRKn6qAs38mm6eowrN ekfNLmFOeQ/5td0Z6o2thqb2wBrVDoUcIG3V6LS+i3zHnVWOceNZEWij3ZuHlt93moUF2X Igt7V6BUZ6FMa62GRgP7+dAQ5AtaUfA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-513-zvj7prIuPea6IqfLEFZBGQ-1; Mon, 18 Dec 2023 15:28:21 -0500 X-MC-Unique: zvj7prIuPea6IqfLEFZBGQ-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-40c31eb65a7so22132065e9.1 for ; Mon, 18 Dec 2023 12:28:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702931299; x=1703536099; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w2UwYCwVRjcUcjWfvK32U8AOw6QLNt0hCo/IhBitX7A=; b=ZlFUA1rCedNdPDR/3enRLPFZ+tS8zhUvJIK6IA3nH4nVABjw+w9QoxCsxmmTvjDqyk Sau5NxVXPqnvMkqFUWdx1vzESRPy9EYMZChBMbTwYXSZkNFRox2oh0Qi+HRwztX3YbRh kgV3+W5uE8QHMyvscXA7oor1g4kGIhQD3DwAC1jX14s4iyVJ8MJ0kwGXjg/rnlXxy63t TbQ4Apn2MhYtl0RPZH7/l6Gg9ytVkT04v4FetEPxfM5Iv1ewdFvpc0IeFTNF623CT5gY a/UwqwiytCAvoqSr819tJUu3riFY88VNCcNchF57niUMs2B/LLFIrFXJ/xpma+15whLD F4Xw== X-Gm-Message-State: AOJu0YxnhFQr1wcWvEXmKs42rvE/0+XfPe3uebmRu4tRbKQLj/yJUm65 JXP/b9xVjn/Kjn3wd9v1HxWodfjXAcXltqKR8shlAPo7wG/KRN/iIKubaPEyl1X5J/aO1UBBc5x 2NvRyUqxb039fkyXbTYl7BZHek9l5hGo= X-Received: by 2002:a05:600c:206:b0:40c:2710:f67 with SMTP id 6-20020a05600c020600b0040c27100f67mr7826187wmi.85.1702931299497; Mon, 18 Dec 2023 12:28:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDg29E4gIyB56631JHFETgOjS+yb8CjqZn4f9smNDpgvRnBZUbsLTlpMaOUHcZAV1EcmOPZw== X-Received: by 2002:a05:600c:206:b0:40c:2710:f67 with SMTP id 6-20020a05600c020600b0040c27100f67mr7826182wmi.85.1702931299220; Mon, 18 Dec 2023 12:28:19 -0800 (PST) Received: from klayman.redhat.com (net-2-34-31-72.cust.vodafonedsl.it. [2.34.31.72]) by smtp.gmail.com with ESMTPSA id p3-20020a05600c1d8300b0040d1450ca7esm9487652wms.7.2023.12.18.12.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:28:18 -0800 (PST) From: Marco Pagani To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , Greg Kroah-Hartman Cc: Marco Pagani , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [RFC PATCH v3 1/2] fpga: add an owner field and use it to take the low-level module's refcount Date: Mon, 18 Dec 2023 21:28:08 +0100 Message-ID: <20231218202809.84253-2-marpagan@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218202809.84253-1-marpagan@redhat.com> References: <20231218202809.84253-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add a module owner field to the fpga_manager_ops struct and use it to take the low-level control module's refcount instead of relying on the parent device's driver pointer. Low-level control modules should statically set the owner field to THIS_MODULE. To detect when the owner module pointer becomes stale, set the mops pointer to null during fpga_mgr_unregister() (called by the low-level module exit function) and test it before taking the module's refcount. Use a mutex to avoid a crash that can happen if __fpga_mgr_get() gets suspended between testing the mops pointer and taking the low-level refcount and then resumes when the low-level module has already been freed. Thanks to Xu Yilun for suggesting the locking pattern. Other changes: move put_device() from __fpga_mgr_get() to fpga_mgr_get() and of_fpga_mgr_get() to improve code clarity. Fixes: 654ba4cc0f3e ("fpga manager: ensure lifetime with of_fpga_mgr_get") Signed-off-by: Marco Pagani --- drivers/fpga/fpga-mgr.c | 50 ++++++++++++++++++++++++----------- include/linux/fpga/fpga-mgr.h | 4 +++ 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index 06651389c592..a32b7d40080d 100644 --- a/drivers/fpga/fpga-mgr.c +++ b/drivers/fpga/fpga-mgr.c @@ -664,20 +664,20 @@ static struct attribute *fpga_mgr_attrs[] =3D { }; ATTRIBUTE_GROUPS(fpga_mgr); =20 -static struct fpga_manager *__fpga_mgr_get(struct device *dev) +static struct fpga_manager *__fpga_mgr_get(struct device *mgr_dev) { struct fpga_manager *mgr; =20 - mgr =3D to_fpga_manager(dev); + mgr =3D to_fpga_manager(mgr_dev); =20 - if (!try_module_get(dev->parent->driver->owner)) - goto err_dev; + mutex_lock(&mgr->mops_mutex); =20 - return mgr; + if (!mgr->mops || !try_module_get(mgr->mops->owner)) + mgr =3D ERR_PTR(-ENODEV); =20 -err_dev: - put_device(dev); - return ERR_PTR(-ENODEV); + mutex_unlock(&mgr->mops_mutex); + + return mgr; } =20 static int fpga_mgr_dev_match(struct device *dev, const void *data) @@ -693,12 +693,18 @@ static int fpga_mgr_dev_match(struct device *dev, con= st void *data) */ struct fpga_manager *fpga_mgr_get(struct device *dev) { - struct device *mgr_dev =3D class_find_device(&fpga_mgr_class, NULL, dev, - fpga_mgr_dev_match); + struct fpga_manager *mgr; + struct device *mgr_dev; + + mgr_dev =3D class_find_device(&fpga_mgr_class, NULL, dev, fpga_mgr_dev_ma= tch); if (!mgr_dev) return ERR_PTR(-ENODEV); =20 - return __fpga_mgr_get(mgr_dev); + mgr =3D __fpga_mgr_get(mgr_dev); + if (IS_ERR(mgr)) + put_device(mgr_dev); + + return mgr; } EXPORT_SYMBOL_GPL(fpga_mgr_get); =20 @@ -711,13 +717,18 @@ EXPORT_SYMBOL_GPL(fpga_mgr_get); */ struct fpga_manager *of_fpga_mgr_get(struct device_node *node) { - struct device *dev; + struct fpga_manager *mgr; + struct device *mgr_dev; =20 - dev =3D class_find_device_by_of_node(&fpga_mgr_class, node); - if (!dev) + mgr_dev =3D class_find_device_by_of_node(&fpga_mgr_class, node); + if (!mgr_dev) return ERR_PTR(-ENODEV); =20 - return __fpga_mgr_get(dev); + mgr =3D __fpga_mgr_get(mgr_dev); + if (IS_ERR(mgr)) + put_device(mgr_dev); + + return mgr; } EXPORT_SYMBOL_GPL(of_fpga_mgr_get); =20 @@ -727,7 +738,7 @@ EXPORT_SYMBOL_GPL(of_fpga_mgr_get); */ void fpga_mgr_put(struct fpga_manager *mgr) { - module_put(mgr->dev.parent->driver->owner); + module_put(mgr->mops->owner); put_device(&mgr->dev); } EXPORT_SYMBOL_GPL(fpga_mgr_put); @@ -803,6 +814,7 @@ fpga_mgr_register_full(struct device *parent, const str= uct fpga_manager_info *in } =20 mutex_init(&mgr->ref_mutex); + mutex_init(&mgr->mops_mutex); =20 mgr->name =3D info->name; mgr->mops =3D info->mops; @@ -888,6 +900,12 @@ void fpga_mgr_unregister(struct fpga_manager *mgr) */ fpga_mgr_fpga_remove(mgr); =20 + mutex_lock(&mgr->mops_mutex); + + mgr->mops =3D NULL; + + mutex_unlock(&mgr->mops_mutex); + device_unregister(&mgr->dev); } EXPORT_SYMBOL_GPL(fpga_mgr_unregister); diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index 54f63459efd6..b4d9413cb444 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h @@ -162,6 +162,7 @@ struct fpga_manager_info { * @write_complete: set FPGA to operating state after writing is done * @fpga_remove: optional: Set FPGA into a specific state during driver re= move * @groups: optional attribute groups. + * @owner: owner module containing the ops. * * fpga_manager_ops are the low level functions implemented by a specific * fpga manager driver. The optional ones are tested for NULL before being @@ -184,6 +185,7 @@ struct fpga_manager_ops { struct fpga_image_info *info); void (*fpga_remove)(struct fpga_manager *mgr); const struct attribute_group **groups; + struct module *owner; }; =20 /* FPGA manager status: Partial/Full Reconfiguration errors */ @@ -201,6 +203,7 @@ struct fpga_manager_ops { * @state: state of fpga manager * @compat_id: FPGA manager id for compatibility check. * @mops: pointer to struct of fpga manager ops + * @mops_mutex: protects mops from low-level module removal * @priv: low level driver private date */ struct fpga_manager { @@ -209,6 +212,7 @@ struct fpga_manager { struct mutex ref_mutex; enum fpga_mgr_states state; struct fpga_compat_id *compat_id; + struct mutex mops_mutex; const struct fpga_manager_ops *mops; void *priv; }; --=20 2.43.0 From nobody Fri Dec 19 09:50:24 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 4A5237349E for ; Mon, 18 Dec 2023 20:28:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PjoclVYz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702931310; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lOWn0wj6qXxxeTngLZ5KOGdMqo1DcukWPJi/j2lPYpM=; b=PjoclVYz9Y73PqGw4yXSUhhRwR4TcWqMwXulDGUMz0Z72XPfdTImjreDxjHdpFPbh3AbSJ 9nweWUvzLOfVlMzn0x0Uv5Ra0pPTPoyRPbA0wx5W4e2wV34wKRoULMaeJbGLqUc0jk8GjH UCbGfb/MPinSwQ+KSh2WTR43cuFl6wE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-231-ws12NWgcNCuxoApUFSJLRQ-1; Mon, 18 Dec 2023 15:28:28 -0500 X-MC-Unique: ws12NWgcNCuxoApUFSJLRQ-1 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-40c514f9243so25052135e9.3 for ; Mon, 18 Dec 2023 12:28:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702931307; x=1703536107; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lOWn0wj6qXxxeTngLZ5KOGdMqo1DcukWPJi/j2lPYpM=; b=GPRK6kDa55W1M4cQvNuGo78ZnG8XemA5G90Hg4HOrxkuS2f3VuwwmzhV1eqdPiY8ju zlXcP7caX1Ir9778bUvwNuyYuqMTwP6+jDXovOskvsQqAUov4QgXT4dLV1oUKhYKdk1Z LXDkkI+p5YM4vpMvqgawS5gRGA4A+0lDzbmK1M609PcZ4O0LW3ldXMw09CywmM2MVg0R l/wu8qqX+uYH1Q096RCp0kN9zzMHGI4s4fvjlFLh8gz3c8kF0G+6BEO4HnYfQFXcFjNQ G6Fli6uWQTXSZwVpmtAcI2AinQ1TEvM1nJ/kvDw5eVXyeqgff6xA2FWWrPkjTPOfYf1u EA1A== X-Gm-Message-State: AOJu0YwNw4ep3ADT10ClPKZLf4WxUGtJ11oZ60nizgCsmtaznsTK9Pt1 rtSNSrsdqhM0ptLSQs0hYMhw/p2i+0f15Gbjzh2yCrZprXlykfPf7kITjhx/Jltn0rlzhaDnym9 fTwghoATh6OdyF+XvKw1sZw8= X-Received: by 2002:a05:600c:a05:b0:40d:1748:d0aa with SMTP id z5-20020a05600c0a0500b0040d1748d0aamr1672747wmp.100.1702931307710; Mon, 18 Dec 2023 12:28:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy4tnHt3nijGGcXssK3ZXuXwABkOFt85EuXUEgUmM1Fa5xYettK+MtYLbbXXwZG2y8eX++YQ== X-Received: by 2002:a05:600c:a05:b0:40d:1748:d0aa with SMTP id z5-20020a05600c0a0500b0040d1748d0aamr1672742wmp.100.1702931307492; Mon, 18 Dec 2023 12:28:27 -0800 (PST) Received: from klayman.redhat.com (net-2-34-31-72.cust.vodafonedsl.it. [2.34.31.72]) by smtp.gmail.com with ESMTPSA id p3-20020a05600c1d8300b0040d1450ca7esm9487652wms.7.2023.12.18.12.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 12:28:27 -0800 (PST) From: Marco Pagani To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , Greg Kroah-Hartman Cc: Marco Pagani , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org Subject: [RFC PATCH v3 2/2] fpga: set owner of fpga_manager_ops for existing low-level modules Date: Mon, 18 Dec 2023 21:28:09 +0100 Message-ID: <20231218202809.84253-3-marpagan@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218202809.84253-1-marpagan@redhat.com> References: <20231218202809.84253-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch tentatively set the owner field of fpga_manager_ops to THIS_MODULE for existing fpga manager low-level control modules. Signed-off-by: Marco Pagani --- drivers/fpga/altera-cvp.c | 1 + drivers/fpga/altera-pr-ip-core.c | 1 + drivers/fpga/altera-ps-spi.c | 1 + drivers/fpga/dfl-fme-mgr.c | 1 + drivers/fpga/ice40-spi.c | 1 + drivers/fpga/lattice-sysconfig.c | 1 + drivers/fpga/machxo2-spi.c | 1 + drivers/fpga/microchip-spi.c | 1 + drivers/fpga/socfpga-a10.c | 1 + drivers/fpga/socfpga.c | 1 + drivers/fpga/stratix10-soc.c | 1 + drivers/fpga/tests/fpga-mgr-test.c | 1 + drivers/fpga/tests/fpga-region-test.c | 1 + drivers/fpga/ts73xx-fpga.c | 1 + drivers/fpga/versal-fpga.c | 1 + drivers/fpga/xilinx-spi.c | 1 + drivers/fpga/zynq-fpga.c | 1 + drivers/fpga/zynqmp-fpga.c | 1 + 18 files changed, 18 insertions(+) diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c index 4ffb9da537d8..aeb913547dd8 100644 --- a/drivers/fpga/altera-cvp.c +++ b/drivers/fpga/altera-cvp.c @@ -520,6 +520,7 @@ static const struct fpga_manager_ops altera_cvp_ops =3D= { .write_init =3D altera_cvp_write_init, .write =3D altera_cvp_write, .write_complete =3D altera_cvp_write_complete, + .owner =3D THIS_MODULE, }; =20 static const struct cvp_priv cvp_priv_v1 =3D { diff --git a/drivers/fpga/altera-pr-ip-core.c b/drivers/fpga/altera-pr-ip-c= ore.c index df8671af4a92..354221c609e6 100644 --- a/drivers/fpga/altera-pr-ip-core.c +++ b/drivers/fpga/altera-pr-ip-core.c @@ -171,6 +171,7 @@ static const struct fpga_manager_ops alt_pr_ops =3D { .write_init =3D alt_pr_fpga_write_init, .write =3D alt_pr_fpga_write, .write_complete =3D alt_pr_fpga_write_complete, + .owner =3D THIS_MODULE, }; =20 int alt_pr_register(struct device *dev, void __iomem *reg_base) diff --git a/drivers/fpga/altera-ps-spi.c b/drivers/fpga/altera-ps-spi.c index 740980e7cef8..3be05796a6fc 100644 --- a/drivers/fpga/altera-ps-spi.c +++ b/drivers/fpga/altera-ps-spi.c @@ -228,6 +228,7 @@ static const struct fpga_manager_ops altera_ps_ops =3D { .write_init =3D altera_ps_write_init, .write =3D altera_ps_write, .write_complete =3D altera_ps_write_complete, + .owner =3D THIS_MODULE, }; =20 static int altera_ps_probe(struct spi_device *spi) diff --git a/drivers/fpga/dfl-fme-mgr.c b/drivers/fpga/dfl-fme-mgr.c index ab228d8837a0..740ce82e3ac9 100644 --- a/drivers/fpga/dfl-fme-mgr.c +++ b/drivers/fpga/dfl-fme-mgr.c @@ -264,6 +264,7 @@ static const struct fpga_manager_ops fme_mgr_ops =3D { .write =3D fme_mgr_write, .write_complete =3D fme_mgr_write_complete, .status =3D fme_mgr_status, + .owner =3D THIS_MODULE, }; =20 static void fme_mgr_get_compat_id(void __iomem *fme_pr, diff --git a/drivers/fpga/ice40-spi.c b/drivers/fpga/ice40-spi.c index 7cbb3558b844..97afa6dc5d76 100644 --- a/drivers/fpga/ice40-spi.c +++ b/drivers/fpga/ice40-spi.c @@ -130,6 +130,7 @@ static const struct fpga_manager_ops ice40_fpga_ops =3D= { .write_init =3D ice40_fpga_ops_write_init, .write =3D ice40_fpga_ops_write, .write_complete =3D ice40_fpga_ops_write_complete, + .owner =3D THIS_MODULE, }; =20 static int ice40_fpga_probe(struct spi_device *spi) diff --git a/drivers/fpga/lattice-sysconfig.c b/drivers/fpga/lattice-syscon= fig.c index ba51a60f672f..1393cdd11e49 100644 --- a/drivers/fpga/lattice-sysconfig.c +++ b/drivers/fpga/lattice-sysconfig.c @@ -348,6 +348,7 @@ static const struct fpga_manager_ops sysconfig_fpga_mgr= _ops =3D { .write_init =3D sysconfig_ops_write_init, .write =3D sysconfig_ops_write, .write_complete =3D sysconfig_ops_write_complete, + .owner =3D THIS_MODULE, }; =20 int sysconfig_probe(struct sysconfig_priv *priv) diff --git a/drivers/fpga/machxo2-spi.c b/drivers/fpga/machxo2-spi.c index 905607992a12..46193a47f863 100644 --- a/drivers/fpga/machxo2-spi.c +++ b/drivers/fpga/machxo2-spi.c @@ -358,6 +358,7 @@ static const struct fpga_manager_ops machxo2_ops =3D { .write_init =3D machxo2_write_init, .write =3D machxo2_write, .write_complete =3D machxo2_write_complete, + .owner =3D THIS_MODULE, }; =20 static int machxo2_spi_probe(struct spi_device *spi) diff --git a/drivers/fpga/microchip-spi.c b/drivers/fpga/microchip-spi.c index 2a82c726d6e5..023ccdf2d5da 100644 --- a/drivers/fpga/microchip-spi.c +++ b/drivers/fpga/microchip-spi.c @@ -362,6 +362,7 @@ static const struct fpga_manager_ops mpf_ops =3D { .write_init =3D mpf_ops_write_init, .write =3D mpf_ops_write, .write_complete =3D mpf_ops_write_complete, + .owner =3D THIS_MODULE, }; =20 static int mpf_probe(struct spi_device *spi) diff --git a/drivers/fpga/socfpga-a10.c b/drivers/fpga/socfpga-a10.c index cc4861e345c9..a8ab74b30006 100644 --- a/drivers/fpga/socfpga-a10.c +++ b/drivers/fpga/socfpga-a10.c @@ -463,6 +463,7 @@ static const struct fpga_manager_ops socfpga_a10_fpga_m= gr_ops =3D { .write_init =3D socfpga_a10_fpga_write_init, .write =3D socfpga_a10_fpga_write, .write_complete =3D socfpga_a10_fpga_write_complete, + .owner =3D THIS_MODULE, }; =20 static int socfpga_a10_fpga_probe(struct platform_device *pdev) diff --git a/drivers/fpga/socfpga.c b/drivers/fpga/socfpga.c index 723ea0ad3f09..87f3f4a367d0 100644 --- a/drivers/fpga/socfpga.c +++ b/drivers/fpga/socfpga.c @@ -538,6 +538,7 @@ static const struct fpga_manager_ops socfpga_fpga_ops = =3D { .write_init =3D socfpga_fpga_ops_configure_init, .write =3D socfpga_fpga_ops_configure_write, .write_complete =3D socfpga_fpga_ops_configure_complete, + .owner =3D THIS_MODULE, }; =20 static int socfpga_fpga_probe(struct platform_device *pdev) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c index cacb9cc5757e..63a5a2fe4911 100644 --- a/drivers/fpga/stratix10-soc.c +++ b/drivers/fpga/stratix10-soc.c @@ -393,6 +393,7 @@ static const struct fpga_manager_ops s10_ops =3D { .write_init =3D s10_ops_write_init, .write =3D s10_ops_write, .write_complete =3D s10_ops_write_complete, + .owner =3D THIS_MODULE, }; =20 static int s10_probe(struct platform_device *pdev) diff --git a/drivers/fpga/tests/fpga-mgr-test.c b/drivers/fpga/tests/fpga-m= gr-test.c index 6acec55b60ce..4c2a3e98f8ad 100644 --- a/drivers/fpga/tests/fpga-mgr-test.c +++ b/drivers/fpga/tests/fpga-mgr-test.c @@ -187,6 +187,7 @@ static const struct fpga_manager_ops fake_mgr_ops =3D { .write =3D op_write, .write_sg =3D op_write_sg, .write_complete =3D op_write_complete, + .owner =3D THIS_MODULE, }; =20 static void fpga_mgr_test_get(struct kunit *test) diff --git a/drivers/fpga/tests/fpga-region-test.c b/drivers/fpga/tests/fpg= a-region-test.c index baab07e3fc59..2705c1b33d09 100644 --- a/drivers/fpga/tests/fpga-region-test.c +++ b/drivers/fpga/tests/fpga-region-test.c @@ -52,6 +52,7 @@ static int op_write(struct fpga_manager *mgr, const char = *buf, size_t count) */ static const struct fpga_manager_ops fake_mgr_ops =3D { .write =3D op_write, + .owner =3D THIS_MODULE, }; =20 static int op_enable_set(struct fpga_bridge *bridge, bool enable) diff --git a/drivers/fpga/ts73xx-fpga.c b/drivers/fpga/ts73xx-fpga.c index 4e1d2a4d3df4..20b8db0d150a 100644 --- a/drivers/fpga/ts73xx-fpga.c +++ b/drivers/fpga/ts73xx-fpga.c @@ -96,6 +96,7 @@ static const struct fpga_manager_ops ts73xx_fpga_ops =3D { .write_init =3D ts73xx_fpga_write_init, .write =3D ts73xx_fpga_write, .write_complete =3D ts73xx_fpga_write_complete, + .owner =3D THIS_MODULE, }; =20 static int ts73xx_fpga_probe(struct platform_device *pdev) diff --git a/drivers/fpga/versal-fpga.c b/drivers/fpga/versal-fpga.c index 3710e8f01be2..02fd8ed36ff0 100644 --- a/drivers/fpga/versal-fpga.c +++ b/drivers/fpga/versal-fpga.c @@ -40,6 +40,7 @@ static int versal_fpga_ops_write(struct fpga_manager *mgr, static const struct fpga_manager_ops versal_fpga_ops =3D { .write_init =3D versal_fpga_ops_write_init, .write =3D versal_fpga_ops_write, + .owner =3D THIS_MODULE, }; =20 static int versal_fpga_probe(struct platform_device *pdev) diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c index e1a227e7ff2a..d58cf0ccbd41 100644 --- a/drivers/fpga/xilinx-spi.c +++ b/drivers/fpga/xilinx-spi.c @@ -218,6 +218,7 @@ static const struct fpga_manager_ops xilinx_spi_ops =3D= { .write_init =3D xilinx_spi_write_init, .write =3D xilinx_spi_write, .write_complete =3D xilinx_spi_write_complete, + .owner =3D THIS_MODULE, }; =20 static int xilinx_spi_probe(struct spi_device *spi) diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c index 96611d424a10..241e1fe48a13 100644 --- a/drivers/fpga/zynq-fpga.c +++ b/drivers/fpga/zynq-fpga.c @@ -548,6 +548,7 @@ static const struct fpga_manager_ops zynq_fpga_ops =3D { .write_init =3D zynq_fpga_ops_write_init, .write_sg =3D zynq_fpga_ops_write, .write_complete =3D zynq_fpga_ops_write_complete, + .owner =3D THIS_MODULE, }; =20 static int zynq_fpga_probe(struct platform_device *pdev) diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c index f3434e2c487b..2f66400d2330 100644 --- a/drivers/fpga/zynqmp-fpga.c +++ b/drivers/fpga/zynqmp-fpga.c @@ -101,6 +101,7 @@ static const struct fpga_manager_ops zynqmp_fpga_ops = =3D { .state =3D zynqmp_fpga_ops_state, .write_init =3D zynqmp_fpga_ops_write_init, .write =3D zynqmp_fpga_ops_write, + .owner =3D THIS_MODULE, }; =20 static int zynqmp_fpga_probe(struct platform_device *pdev) --=20 2.43.0