From nobody Wed Dec 17 19:03:25 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1DABC61D97 for ; Wed, 22 Nov 2023 14:33:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232167AbjKVOdT (ORCPT ); Wed, 22 Nov 2023 09:33:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232207AbjKVOdQ (ORCPT ); Wed, 22 Nov 2023 09:33:16 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B42C5D5C for ; Wed, 22 Nov 2023 06:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700663590; 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=DZFOSfIM7TPtd3vStgatz2Vc2HN+6585nrKoz3NT+MI=; b=aXQIxUQl3wlQ3yhNsUi5kn+bYU1p9O/DfUvxmVo3xjMvUCoJuZvS32RW1sIiwvSe1iBxsG DgguowqbDYEXO2Gjm8UPqttF+TSgDQoSjV8mNS0BOI1ww/cZo4hdnaCa1eGhjC2xx0HPwh 4UUvHLT+snJxeWFuKQTE+IoyX+kCj2U= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-317-RUJ8uCMUNjOpuZUNnHVBxg-1; Wed, 22 Nov 2023 09:33:08 -0500 X-MC-Unique: RUJ8uCMUNjOpuZUNnHVBxg-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-421b20c9893so94839691cf.0 for ; Wed, 22 Nov 2023 06:33:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700663588; x=1701268388; 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=DZFOSfIM7TPtd3vStgatz2Vc2HN+6585nrKoz3NT+MI=; b=AqvCynrQozKLZVpEdpU5GScwEhv4V9phVkD+098mHHKavEanMNgU8msJPQw5tlRPJf /l/GBT3pWo1BPRLsgASX+vthsLxRsyBpTL+Ic/HgqYIQGIrA6cAdIYkNAHiaaEQtzA2Z GF/ZFMQx3HU2QsC0yCd10Dkpv5wq2F/LRSqIuaULlsxip+D/aCu9ayucfXXFP1BpRXCu J1QtTmAWE4YzXCQbWS275Y/L40aShinAGl6JRDhk12KDHiShKPHBGQyvAKwpfK+WfOie 68z6QbcRQ2+5tezWjzWrqaZuNR3sOOuJS5lexDW3UhOy8MtGR/8LsMP9X9o8uhJOZz65 nxHQ== X-Gm-Message-State: AOJu0Yx4SZRZfB2d00DM5AxPNNWXKv4f+x/wsqmogC4+6tsLv/fG8euT y5O5ydW8zPfGpOo6snFagNECvr1e9izoOwOhr835pRgyZX+FVU/ebYtgt0oqX5Hd6/LxeJcrEpR DQpfjAcBtP3tx3AcxInz/mrk= X-Received: by 2002:ac8:7f82:0:b0:417:d340:c426 with SMTP id z2-20020ac87f82000000b00417d340c426mr2710695qtj.9.1700663587712; Wed, 22 Nov 2023 06:33:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+VKezDiPMwB09AoFaLVNXlCjJFB3AaOFjc1WBPZePAd7tIVJqYUk/IfQO1lX6kerNxmAjrg== X-Received: by 2002:ac8:7f82:0:b0:417:d340:c426 with SMTP id z2-20020ac87f82000000b00417d340c426mr2710678qtj.9.1700663587434; Wed, 22 Nov 2023 06:33:07 -0800 (PST) Received: from klayman.redhat.com (net-2-34-24-178.cust.vodafonedsl.it. [2.34.24.178]) by smtp.gmail.com with ESMTPSA id v7-20020ac87487000000b0041950c7f6d8sm4430101qtq.60.2023.11.22.06.33.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 06:33:07 -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 1/2] fpga: add a module owner field to fpga_manager and fpga_manager_ops Date: Wed, 22 Nov 2023 15:32:51 +0100 Message-ID: <20231122143252.181680-2-marpagan@redhat.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122143252.181680-1-marpagan@redhat.com> References: <20231122143252.181680-1-marpagan@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a module *owner field to the fpga_manager_ops and fpga_manager structs to protect the fpga manager against the unloading of the low-level control module while someone is holding a reference to the manager device. Low-level control modules should statically set the owner field of the fpga_manager_ops struct to THIS_MODULE. Then, when the manager is registered using fpga_mgr_register(), the value is copied into the owner field of the fpga_manager struct (that contains the device context). In this way, the manager can later use it in fpga_mgr_get() to take the low-level module's refcount. To prevent races while unloading the low-level control module, the fpga_mgr_get() and fpga_mgr_put() methods are protected with a mutex. Other changes: moved put_device() form __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 | 56 +++++++++++++++++++++++++---------- include/linux/fpga/fpga-mgr.h | 4 +++ 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index 06651389c592..f76be7e2f722 100644 --- a/drivers/fpga/fpga-mgr.c +++ b/drivers/fpga/fpga-mgr.c @@ -21,6 +21,8 @@ static DEFINE_IDA(fpga_mgr_ida); static const struct class fpga_mgr_class; =20 +static DEFINE_MUTEX(mgr_lock); + struct fpga_mgr_devres { struct fpga_manager *mgr; }; @@ -667,17 +669,15 @@ ATTRIBUTE_GROUPS(fpga_mgr); static struct fpga_manager *__fpga_mgr_get(struct device *dev) { struct fpga_manager *mgr; + struct module *owner; =20 mgr =3D to_fpga_manager(dev); + owner =3D mgr->owner; =20 - if (!try_module_get(dev->parent->driver->owner)) - goto err_dev; + if (owner && !try_module_get(owner)) + mgr =3D ERR_PTR(-ENODEV); =20 return mgr; - -err_dev: - put_device(dev); - return ERR_PTR(-ENODEV); } =20 static int fpga_mgr_dev_match(struct device *dev, const void *data) @@ -693,12 +693,22 @@ 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 =3D ERR_PTR(-ENODEV); + struct device *mgr_dev; + + mutex_lock(&mgr_lock); + + mgr_dev =3D class_find_device(&fpga_mgr_class, NULL, dev, fpga_mgr_dev_ma= tch); if (!mgr_dev) - return ERR_PTR(-ENODEV); + goto out; + + mgr =3D __fpga_mgr_get(mgr_dev); + if (IS_ERR(mgr)) + put_device(mgr_dev); =20 - return __fpga_mgr_get(mgr_dev); +out: + mutex_unlock(&mgr_lock); + return mgr; } EXPORT_SYMBOL_GPL(fpga_mgr_get); =20 @@ -711,13 +721,22 @@ EXPORT_SYMBOL_GPL(fpga_mgr_get); */ struct fpga_manager *of_fpga_mgr_get(struct device_node *node) { - struct device *dev; + struct fpga_manager *mgr =3D ERR_PTR(-ENODEV); + struct device *mgr_dev; + + mutex_lock(&mgr_lock); + + mgr_dev =3D class_find_device_by_of_node(&fpga_mgr_class, node); + if (!mgr_dev) + goto out; =20 - dev =3D class_find_device_by_of_node(&fpga_mgr_class, node); - if (!dev) - return ERR_PTR(-ENODEV); + mgr =3D __fpga_mgr_get(mgr_dev); + if (IS_ERR(mgr)) + put_device(mgr_dev); =20 - return __fpga_mgr_get(dev); +out: + mutex_unlock(&mgr_lock); + return mgr; } EXPORT_SYMBOL_GPL(of_fpga_mgr_get); =20 @@ -727,8 +746,12 @@ EXPORT_SYMBOL_GPL(of_fpga_mgr_get); */ void fpga_mgr_put(struct fpga_manager *mgr) { - module_put(mgr->dev.parent->driver->owner); + mutex_lock(&mgr_lock); + + module_put(mgr->owner); put_device(&mgr->dev); + + mutex_unlock(&mgr_lock); } EXPORT_SYMBOL_GPL(fpga_mgr_put); =20 @@ -806,6 +829,7 @@ fpga_mgr_register_full(struct device *parent, const str= uct fpga_manager_info *in =20 mgr->name =3D info->name; mgr->mops =3D info->mops; + mgr->owner =3D info->mops->owner; mgr->priv =3D info->priv; mgr->compat_id =3D info->compat_id; =20 diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index 54f63459efd6..eaf6e072dbc0 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. * * 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 + * @owner: owner module. * @priv: low level driver private date */ struct fpga_manager { @@ -210,6 +213,7 @@ struct fpga_manager { enum fpga_mgr_states state; struct fpga_compat_id *compat_id; const struct fpga_manager_ops *mops; + struct module *owner; void *priv; }; =20 --=20 2.42.0 From nobody Wed Dec 17 19:03:25 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA64CC61D97 for ; Wed, 22 Nov 2023 14:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343820AbjKVOda (ORCPT ); Wed, 22 Nov 2023 09:33:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232084AbjKVOd1 (ORCPT ); Wed, 22 Nov 2023 09:33:27 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47BED6C for ; Wed, 22 Nov 2023 06:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700663600; 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=shPFiNnieBfc+nA1jRG7H+c1jqVnxbi/cSpxWrKoPIY=; b=M/II50x+i9VfzwQTqiR0aN9PNXO8hTqTkni2IzW2s20wcZdZ6NF7siQKfEZsAbWqfOPPE1 MmxqKsdVKsZ7hKsTH7ej3vnjpjj4VL7Z/I+VL+e/L+65ANLaCg1bgk2lbAg2wXVYxVIkkF bgAYxqI/7mF4F0fBZ/VGamkFkUpQyWQ= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-cPW8qKA6OYGIRJmtOCx-Nw-1; Wed, 22 Nov 2023 09:33:18 -0500 X-MC-Unique: cPW8qKA6OYGIRJmtOCx-Nw-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-41e172143c3so18645331cf.1 for ; Wed, 22 Nov 2023 06:33:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700663595; x=1701268395; 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=shPFiNnieBfc+nA1jRG7H+c1jqVnxbi/cSpxWrKoPIY=; b=nh3ThuFykczIgjLG4YXR0DhDNgtMyPVXxvsHHRXKgQZeo6Lj1KPkRI2fpeS6XT7n51 FtvArDqeRCNK4c97/OCU/SHqzDpUG1zql3oq3TNv3HSSO1EKLG41tgMz8y55yYjCrTZ/ 1hpDNZszPfnpqpFJHrWLyHY/MASewwh6Her51Jx+PZbzU9NKDNUrPMVTAdjO0adxFwqr baBPYGe+lWBOE8q4/wncpu3Eds/aHpYApnwoAaCGreSgf4IwtFPLNvDOVH0DCP5YwXiq LCtWKhacwxagbptxaKlRvq5Qu17AotKz16yP5h7h8yisArKINDk5X+3pc6AVSPo0U58z bNgQ== X-Gm-Message-State: AOJu0Ywkm7TjicY3VqzKCo/Ng+ooMXKW7tIyDmWS6vKPkoZKpNuFhZPV 9aVFn4M/k6lds9g8OlRuL4cTvC8F8ou3xyf7gc4tZvszjLIuYkFmVwR+njvolMLCFxDQLy7YYvM txIX2kzVYa+6DxQNNMMsI03Sn+TqHnjg= X-Received: by 2002:a05:622a:400c:b0:423:83a1:7bbf with SMTP id cf12-20020a05622a400c00b0042383a17bbfmr1127399qtb.28.1700663594743; Wed, 22 Nov 2023 06:33:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFV9BlytQs81yJF+crBKuitlDdNCMdUFK9qjRxbV/xMqx4YvOghdpr9UcA3xpf4yEHJXbAFSg== X-Received: by 2002:a05:622a:400c:b0:423:83a1:7bbf with SMTP id cf12-20020a05622a400c00b0042383a17bbfmr1127366qtb.28.1700663594488; Wed, 22 Nov 2023 06:33:14 -0800 (PST) Received: from klayman.redhat.com (net-2-34-24-178.cust.vodafonedsl.it. [2.34.24.178]) by smtp.gmail.com with ESMTPSA id v7-20020ac87487000000b0041950c7f6d8sm4430101qtq.60.2023.11.22.06.33.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 06:33:14 -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 2/2] fpga: set owner of fpga_manager_ops for existing low-level modules Date: Wed, 22 Nov 2023 15:32:52 +0100 Message-ID: <20231122143252.181680-3-marpagan@redhat.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231122143252.181680-1-marpagan@redhat.com> References: <20231122143252.181680-1-marpagan@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.42.0