Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp460656iog; Fri, 24 Jun 2022 07:23:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vdJndImyMv4QFYnW+grQIlvydjQvFjqRqHMoDmSPrJrmubAKsTJsQchB64Z2U9kFBAXCkC X-Received: by 2002:a17:906:f84:b0:711:eda5:db31 with SMTP id q4-20020a1709060f8400b00711eda5db31mr12930218ejj.397.1656080590412; Fri, 24 Jun 2022 07:23:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656080590; cv=none; d=google.com; s=arc-20160816; b=nASLHuJCYYmvpZy5sOk6q254sGdDhxdnWdICUhOfh+GjtBkE65iV8BHECjg6lGOY95 S/lH9tlxpukDwtUggkeixawdjqhzQzfA1CK50mv1tjUYhH0w5+pTNsuwCns29Gbm+wgW LsiWYKILsvvz4UVxxDgVyk/SS3nWZKdc1ZlVsK1mfhnSQi5p4UEJK00PBfjFT+6bhfF7 fWA7qsIXnGTSDudY7ucSlKHtyB9WJU/sj+KSTsLygi+M1J+Vezl0ebWNzeNQKJksS0Gz Aanyk5F/S/kyhyKaZSG2+BBsuaa6CIJAU32Bzn9i6tKYSjoE68RXO9bhzqzEseB4oy9j 2gbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d2Nx0BOBB6ekdm1U7bh3Zno30OffMdY3lMdwn3cLPcc=; b=h59p90PEewrZLNQrOajoSFgkNXdKXGbmBVCR00pCbYOBw6A5U2pcPJ88IXfETz+ycr 9/BJZRH81NIxH1LNBBCyIyaZBqpQb3iscyPi2Xo0n+4pHsP4Pa/3SYSyUw5ZAjfEq7uL jlvdwwAj76CBPpio4LIujbaX1CP4mMzvv8OpXm3VJQdh8i7ecE+JOvPdQlmrXfl0MkMU 5SFWHxGo0CjrAyJ8SZqUY6yr2xczSWltqAJwMl2VzMHhCxLSU5BHVXPSub8SE2KKN5cJ Ji2tqc6QdkDKz+L+FJew2gXMwx98mwM8xRrYZTqaTtRKlIkmpeDq7jg4FcJosoB88SCw wqHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PKJY/ZqW"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c13-20020a170906528d00b007262b342ff2si2594708ejm.53.2022.06.24.07.22.46; Fri, 24 Jun 2022 07:23:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="PKJY/ZqW"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232466AbiFXOVy (ORCPT + 99 others); Fri, 24 Jun 2022 10:21:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbiFXOVv (ORCPT ); Fri, 24 Jun 2022 10:21:51 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A439C562DF for ; Fri, 24 Jun 2022 07:21:50 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id bo5so2711489pfb.4 for ; Fri, 24 Jun 2022 07:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d2Nx0BOBB6ekdm1U7bh3Zno30OffMdY3lMdwn3cLPcc=; b=PKJY/ZqW6QWjUEvVKvlgmRXCPCKacIUVkYU5gyGwsmqSq3O7KRGzo0mBEGeWO7+8ho 1hy30InZQVN1m/ELaQQE/bv8C/p7Fo8PQCf77qX2gP6NF+rzQqiRHVvl53gljwNgfLG3 U4a7pLdloEnAW1lmnlhsARkHq2IW3K3AT9bqgDADEHNqQq7k7WW+LamIPr46IU5x03Z5 Tf9rcx1tqWQxZWoPzNlt7PglTDNI3fXN1g6QgQQengyaHVeSWOlwxZeBWJHqyKw914XR tTtfafREtkDf/9PoKWw69uiZK/eubDtoNFDC5X7Vd8rNWMuJZdCkMcgOv7mQuQ5V9pnt B1lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d2Nx0BOBB6ekdm1U7bh3Zno30OffMdY3lMdwn3cLPcc=; b=gGHan6RCW7Tyirbsbvt4R3TF++ZUHScbEqYXAxhpw5Q1Fex4r8UBPgZJf0EgP8/vc8 SpMb9ZIFVu8WGbOx5e4rjt5CP5gAJ7fSGMKga2plijO5tq9KvYvzI3sq6Kz49jAYzfO8 H+XKkqp+FsQkHPN84qTTKnCwqbkeTQQUCcryDcVkLkdD5XgMgO1TNienLuBpNxWBURp5 KhjIi0QlZPVOggsAkPFssYpSQ2oQCBSXcoDoZR23SwdPSzoaNLajKuX4hhYOlyOeC7i5 cetPlDlLrNDg/PRmKSk7rpFnjlbvCTpeg6WQ/wgO9E2ldkzOw8GQiSlhXm8Re1UIrgME Equg== X-Gm-Message-State: AJIora9LykVjOX/BS18EsEQPphcTAnrlZXtYcXtJGla9Fm7cmeETjViv G+rvqUtEnitP9qhvrrhZguXa1w== X-Received: by 2002:a63:8c5e:0:b0:40c:95c6:7069 with SMTP id q30-20020a638c5e000000b0040c95c67069mr12361332pgn.148.1656080510066; Fri, 24 Jun 2022 07:21:50 -0700 (PDT) Received: from localhost.localdomain ([199.101.192.196]) by smtp.gmail.com with ESMTPSA id jd12-20020a170903260c00b0016a15842cf5sm1868877plb.121.2022.06.24.07.21.44 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2022 07:21:49 -0700 (PDT) From: Zhangfei Gao To: Greg Kroah-Hartman , Arnd Bergmann , Herbert Xu , jean-philippe , Wangzhou , Jonathan Cameron Cc: acc@openeuler.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux.dev, Zhangfei Gao , Yang Shen Subject: [PATCH v2 1/2] uacce: Handle parent driver module removal Date: Fri, 24 Jun 2022 22:21:21 +0800 Message-Id: <20220624142122.30528-2-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220624142122.30528-1-zhangfei.gao@linaro.org> References: <20220624142122.30528-1-zhangfei.gao@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Change cdev owner to parent driver owner, which blocks rmmod parent driver module once fd is opened. Signed-off-by: Yang Shen Signed-off-by: Zhangfei Gao --- drivers/misc/uacce/uacce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index 281c54003edc..f82f2dd30e76 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -484,7 +484,7 @@ int uacce_register(struct uacce_device *uacce) return -ENOMEM; uacce->cdev->ops = &uacce_fops; - uacce->cdev->owner = THIS_MODULE; + uacce->cdev->owner = uacce->parent->driver->owner; return cdev_device_add(uacce->cdev, &uacce->dev); } -- 2.36.1