From patchwork Thu Mar 26 22:44:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 184935 Delivered-To: patches@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp616616ilr; Thu, 26 Mar 2020 15:45:04 -0700 (PDT) X-Received: by 2002:a63:5fd8:: with SMTP id t207mr10479230pgb.186.1585262704628; Thu, 26 Mar 2020 15:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585262704; cv=none; d=google.com; s=arc-20160816; b=QljQxn4FXPHI/Hi5tx7Eg3bL1wZao76I9OonHXP2pr5KM4EHN1oVaZPYAhUJ7gzUXP zZ2spCpuqu3w2snyCTDc1TPo74dEtWa6HAnRUEtkip0muvMEiHIRWChmtEhM9DBWCO4w sMj6zY9thHhpQIksZHEYEP9R04WRGKrURxY3D8ynGQBTZVS3CONHhN71ADfIUL8cXq2z q+jS2loV+jGYgIDYRw1C5CBR7xn/Q11uEvsUa6VyWDJ0hdnL4H2Zx+8HYIHFu1jkXsm2 Wqkm7IJOPad5WOOUVTIVvo3pTSMZqLCHs9gXWCc6DXQmobcqGHfiGzUTcFDniBWE0hBS PkuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z3g/2X3xqKE2E6bsoNbDYiNdI89O/pvEeLJlm/o2OpE=; b=cNRc9344gr3vAMFtASGqSIAX+bQF8WrK6Hef7tfZXDDvqOeRFDxYS3kKKC5Zy6u+ev Y2xAfyZYv5kbh55Gu7y5zS5v+5ng+IOFRcULNM1Ir4X2PztmpTlAP02sJAj2F6vAs09s eqzuimLyzNFl3BJmo3aWeRUsBmsb+bC93h80RFRb5nezMBqJUEL99Cl2iXBNGZKppEU6 vXxjeUCqeQ1ahaA1y4XkZ/cMFO3WgRdnYkQ52KilSNqouLyZNoV6LUzmEAZ9sn1GJVQ8 xWtTddiumM0tv7wMKO33qQ1T1HZOTVnMVHkfIWL3VLSVFE9sb/2gFO9znlGLYbmkRU+U S+Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xrz876FM; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i62sor4828047pfg.79.2020.03.26.15.45.04 for (Google Transport Security); Thu, 26 Mar 2020 15:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xrz876FM; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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; bh=z3g/2X3xqKE2E6bsoNbDYiNdI89O/pvEeLJlm/o2OpE=; b=Xrz876FMDozNGuIjV9RUCVbds29I/2Zmat9NHRrib4AsLtTtobMA/SSi7hjLncf2yA lqmiEa+GyH/VnRNlyHRoY6r/ULU9/llEgod1gbjGx7uDvyD7RMdeq+8czV/BMgZPuJcE oNQ0ye+dyQceMh07rv+amQjd810I+l0IR6ncwGE8ffkO0ZRSA/2EULHQOppY53VSu3kM FlkLV6LETgkJt8BiO23uay777rqryr5JLwfYLKGBbEwMzwRAYpoTinIzgoYxUqSHnvfR PJ1cfEsNaVBuKQ2uBTGdjF2QAP0HbfzB+TgJCQp4WT+WZiQjjbXamMlRP2PfzisA2pwu TH7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z3g/2X3xqKE2E6bsoNbDYiNdI89O/pvEeLJlm/o2OpE=; b=edt/F1tEzhuDU2Nln9F5m7bO61mWZd60CUP+urNtaiCFXpbPO9YFI3etpDPxHzwhaW EGHZ4Rit1fDEdDCdkYxxvLvd5o0fuQ0qJDvHSZ7t4aceELkV2FRwDef5/vHygw5CRupP j0aHTCRyg14nTnwz7yZTmTsZiJxT94hPAf7AyHW5H2qqd43xDKMCljeqrFa9HQVzMMYI 31gz8IwIeyvQLjTqZpjFpWeCwMh/yVbU/RtRA3gHGDTbU2rQKsCk/SeppoihFfM/OnNW Nb9DnUBt57+8VE/O/qAaDiH6Y5nScUUKbwZ2W3m5N592Sc6zq11TBGy4awAYGjy0jSXV E3GQ== X-Gm-Message-State: ANhLgQ3NWs4dx1duXlAGkyMET4yHzDR/8fRaWKA4uZwCIcajfsC9Gand 2CMJg9+8DkkLCYJ5h+7dvYqlblwb X-Google-Smtp-Source: ADFU+vtoCJXf8vwmtr6xsj2U3JR2F9hMCFfeXD53husYpJJuJFDNBaKMd5A71q5bsoMe9Y++eXFZAA== X-Received: by 2002:a62:3086:: with SMTP id w128mr11394896pfw.63.1585262704003; Thu, 26 Mar 2020 15:45:04 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g10sm2592788pfk.90.2020.03.26.15.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 15:45:03 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Todd Kjos , Saravana Kannan , Andy Gross , Bjorn Andersson , Rajendra Nayak , linux-arm-msm@vger.kernel.org Subject: [PATCH v3 1/3] soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module Date: Thu, 26 Mar 2020 22:44:57 +0000 Message-Id: <20200326224459.105170-2-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326224459.105170-1-john.stultz@linaro.org> References: <20200326224459.105170-1-john.stultz@linaro.org> This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38) So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Feedback would be appreciated! Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Acked-by: Saravana Kannan Signed-off-by: John Stultz --- v2: * Fix MODULE_LICENSE to be GPL v2 as suggested by Bjorn * Leave initcall as core_initcall, since that switches to module_initcall only when built as a module, also suggested by Bjorn * Add module tags taken from Rajendra's earlier patch --- drivers/soc/qcom/Kconfig | 4 ++-- drivers/soc/qcom/rpmpd.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index d0a73e76d563..af774555b9d2 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -123,8 +123,8 @@ config QCOM_RPMHPD for the voltage rail. config QCOM_RPMPD - bool "Qualcomm RPM Power domain driver" - depends on QCOM_SMD_RPM=y + tristate "Qualcomm RPM Power domain driver" + depends on QCOM_SMD_RPM help QCOM RPM Power domain driver to support power-domains with performance states. The driver communicates a performance state diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index 2b1834c5609a..22fe94c03e79 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -226,6 +227,7 @@ static const struct of_device_id rpmpd_match_table[] = { { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc }, { } }; +MODULE_DEVICE_TABLE(of, rpmpd_match_table); static int rpmpd_send_enable(struct rpmpd *pd, bool enable) { @@ -422,3 +424,7 @@ static int __init rpmpd_init(void) return platform_driver_register(&rpmpd_driver); } core_initcall(rpmpd_init); + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPM Power Domain Driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:qcom-rpmpd"); From patchwork Thu Mar 26 22:44:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 184936 Delivered-To: patches@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp616631ilr; Thu, 26 Mar 2020 15:45:05 -0700 (PDT) X-Received: by 2002:a17:902:fe97:: with SMTP id x23mr10551597plm.167.1585262705467; Thu, 26 Mar 2020 15:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585262705; cv=none; d=google.com; s=arc-20160816; b=fU8uLQ3qXMYq5y/LiKQHpWB2lQ5/a+1o5NAyudgEAMmuDVEp2VfHDDiGx2RZEF3g+v YXWoTuYeE6kPx3si/hc2+TBJK4tmwwxbbm5ykgSQDgdCkd6dz7HAZ3vwlqUdvzQLSBf8 272XWXS/wB5EeJ8duTp/2/7wLMCZIW8GWitosvBRGhxFsdbA/4hIVeRwkGuaDeD3mtj5 3XUaqYIeSnVqbsWOFh4A3i6fr4SYAENfCsaT84k6gAqyDq7IENnNEHw6ii5bVHWEEwvN cKa0XHSVBTUCYj/Y7spoekGCqDY3lddQKqIGxWMzk/qaIGVZzZLTD42IBcGk5cglNB1O anUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BibBtGLwvmKQbx0thQsTKW+m6NhfuyqCvXSj60tccDo=; b=tAJlhU/k3WorYCEDPAzE2W6TiU/rXKUfqRnB3c9HpzdPmqv4MkC4OaXTrka5QdBY98 ti9fgy3KG15sH23A/unEonIb8Iw8lkMubs/UUVYrwFdiPDdLnnunPqgEcFimQWtePBr+ kS1HDJZxl3v7eUBPTxQ21sF2NK3dbMIk1MySMZBixERXM/JsMnZfTEBOYi0nNF7pWdQS b0uEfpVtArJUFsA6RXF+J3VWmEHkmgDjvPfQAiYfU5LJnRAptyNmijfSaoo088C5nw/H NoLnb4BKN529qZOL3Z8t5c2XVbbWBnWzG1Znvs+WoSJAeVFgX6qSmBGvrwHSHGFsP6u1 SNNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=flZpKzNJ; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id y14sor4827393pfp.36.2020.03.26.15.45.05 for (Google Transport Security); Thu, 26 Mar 2020 15:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=flZpKzNJ; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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; bh=BibBtGLwvmKQbx0thQsTKW+m6NhfuyqCvXSj60tccDo=; b=flZpKzNJcKTxocpBQsnbos0dcK3aTkIvYGIK9dtTslwcM1iiJ1s0l8VJhBlBLG8UQ6 I/3J/RcTYzwclhVvm5EYqR/ZzX09Kh/SxlvtdomLiMb4PQlqY1/ROIUCrxYdNGUHP/6p oDEfMDj32AHSQGD0IPXy4cC2zDHC6wH1EzS5T1Zej6ehS5fTjqwrjxmsfUeotYtcH0H/ WCqTEoyC5Wqc2ghhQV0GM5GoLw9o2Omrx1xtAb9WlAjy7RukGMNbXYGynHB0h/TiVxnE Jlr0yYuGZo6VPMKx8aZiGnMWRwfWYclIexDl7oKyEAlyRhkwYGd4JZe3ufZXEEqYDeQ7 yQjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BibBtGLwvmKQbx0thQsTKW+m6NhfuyqCvXSj60tccDo=; b=L+7FqjbIu5CbXqee+BA5gbKGOTMwncFCdYj68Y6KtAOpCNxIlIsiaLM7Fwa7n4ySJ4 DgbDFYk3vd2bIrnQ1/MKTFxT9xymsV4BH/tfW52qY2Nw8tNB39M66argzEXxWO4iB0u7 80L9TwEa6qkoCa5XMbYa70A9l2diyshTaj87UKSIs9q5YjmuUjffSf/aa76eG8mNxDbK B4Pcm5tvLjKXx2OfcNeWeTPJr2MOUCeNUZCgOSJxFnaxnP6kJkmHPtierxsVvRt9SDwR 68Ln585Hmxn/94C3aIDn9ub5RrhZTKzJKHf4xLGBboqziBbxr7rCdAc+JUnE9/P9AQza D2FA== X-Gm-Message-State: ANhLgQ33MHXkZjcYKypPGgR9QL9CwCfHGFakbHLQ/TmKCyMGIpASTiKB ug0p+CVOTY3z6hP0CswhkS68LQAm X-Google-Smtp-Source: ADFU+vsJ1o2UHUr5ZHKd/XXcN8AZhYuiYsHkoVFN14N8MhOoYypiyukKcfGgQMCKoQycbMrNm8DnWg== X-Received: by 2002:a63:a55d:: with SMTP id r29mr11142296pgu.248.1585262705086; Thu, 26 Mar 2020 15:45:05 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g10sm2592788pfk.90.2020.03.26.15.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 15:45:04 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Todd Kjos , Saravana Kannan , Andy Gross , Bjorn Andersson , Rajendra Nayak , linux-arm-msm@vger.kernel.org Subject: [PATCH v3 2/3] soc: qcom: rpmh: Allow RPMH driver to be loaded as a module Date: Thu, 26 Mar 2020 22:44:58 +0000 Message-Id: <20200326224459.105170-3-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326224459.105170-1-john.stultz@linaro.org> References: <20200326224459.105170-1-john.stultz@linaro.org> This patch allow the rpmh driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but the rpmh driver is fairly core to the system, so once its loaded with almost anythign else to get the system to go, the dependencies are not likely to ever also be removed. So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Feedback would be appreciated! Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Signed-off-by: John Stultz --- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index af774555b9d2..ac91eaf810f7 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -104,7 +104,7 @@ config QCOM_RMTFS_MEM Say y here if you intend to boot the modem remoteproc. config QCOM_RPMH - bool "Qualcomm RPM-Hardened (RPMH) Communication" + tristate "Qualcomm RPM-Hardened (RPMH) Communication" depends on ARCH_QCOM && ARM64 || COMPILE_TEST help Support for communication with the hardened-RPM blocks in diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index e278fc11fe5c..30585d98fdf1 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -679,6 +680,8 @@ static const struct of_device_id rpmh_drv_match[] = { { .compatible = "qcom,rpmh-rsc", }, { } }; +MODULE_DEVICE_TABLE(of, rpmh_drv_match); + static struct platform_driver rpmh_driver = { .probe = rpmh_rsc_probe, @@ -693,3 +696,6 @@ static int __init rpmh_driver_init(void) return platform_driver_register(&rpmh_driver); } arch_initcall(rpmh_driver_init); + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPMh Driver"); +MODULE_LICENSE("GPL v2"); From patchwork Thu Mar 26 22:44:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 184937 Delivered-To: patches@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp616647ilr; Thu, 26 Mar 2020 15:45:06 -0700 (PDT) X-Received: by 2002:a17:90a:1b42:: with SMTP id q60mr2583067pjq.84.1585262706629; Thu, 26 Mar 2020 15:45:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585262706; cv=none; d=google.com; s=arc-20160816; b=VWcAZj2pv7q85FwjkZn7RNrYbTmqAJVcxoPjqvqXNGitDd5Id5pCopY6UgY+ALQodL up4gsQ8F83q8+5ZqnqxmAKYW9HgG8h/EOyWT4FAZ+kNSobwdQDxOYXStCXpZ1V5jaF4c iCYGcZ5OxBq4p/wLZxeXopvbtbd6jAupnTNBVZYc9uSeKeAdUmgshkkVzUhrq6rhcT6Y 7C0ouUKdO8l6XeLndfmwaF71UUul4CAmP/JN5fBOVdjfxhE1GiJtoqdxUROMZ1P608j0 EDBQ6fiB90nlQBMB+/eodSeo3L2rmsXCvTZlTbd3SL3cNdtLvJgudKzNbuOeGkN/Y/Pp Qzkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uXFWCA6HsRoFU7UHbCkibQyhhxiptzgR3ncwTu65yOs=; b=azsbXrd05d5JYjyvEceeaZz4VL46EUyKiVcw5c/P88kriVwJuRUSy5BGGgs5jryyqA dsN2MloAbL/3m7v5jLWcKOaw3TMOHDXgQdet5Ceyfr9Dmw45mBtBpGluuJWV8Kcg8M7M lYcAmf4HxBwgntpkFV0qxinfuTcE45t4HaNmyTSzO7A4v9k4ZdXNlQb+rOUB7/KedyCs RVwf8gLgyxln+7chJ0Mnjax3KxCwZatpeoO/V8hZZLBqNJiyfaux4p4es9TQgNud+HPO b6sUZehPABr2Ie1Z1g98DkHP+tFepqfV4fzNfcpbVuVhv+/kA7cUXfGgifDggom7BmH5 HunA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b6EBDV5D; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id i64sor4608043pgd.58.2020.03.26.15.45.06 for (Google Transport Security); Thu, 26 Mar 2020 15:45:06 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b6EBDV5D; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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; bh=uXFWCA6HsRoFU7UHbCkibQyhhxiptzgR3ncwTu65yOs=; b=b6EBDV5D14KVHV3wD3Ol5xWcqk/VSycmLNDdgJZ9srR1xMjA8/P+83qr06g+dwDBF3 tpkK0HVrqwYlyhyNs/6Fb9jrYz1YUFN1U7dIz0f2lGUMngq8+meZbD8zi0FnI1x2ZtmN 1NWQpNJL3NrsmF2m+TgTg8rdjT0TVisGMeu9gwy2G1GFTZHLc7kKDbJT2g0kdR4dBT1K G/YP2FpEUoY6ZLU2tq9MsyfKtUB3dyAVMgzesmCp+jCzo7yLR7Vu2OCfOFWCzzioei41 GEZmdwuTUB+wOIx8RY0OI4BaDASpGUy6JVpuOmO70/NECorFsuLdy/35S5QODhrSfwKD o/Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uXFWCA6HsRoFU7UHbCkibQyhhxiptzgR3ncwTu65yOs=; b=F+ZLpjW4ilkEhWGbsvRNIhPy9fYdJAK+SzYDi1kO3YJG5DTIULsS9VJFgbj+R+XaqP C9evlWbZpkVFcudDByVU3xEVoJoA2H7vHotBJIpdjCJ09ve9N7jc/FVFIxjk23hEy/Li snNJmgu7TgGjj+rpkLF6tNzOQHtNPsU5YfNE5B9xnefPr6Qgc1zvUrZKCdUEWPRDLERr kgWlcA9l8BGmP9gb2nE6MMGCghLbubMejfLXCbBvT5b1nQ7IEZeR/nl9Vzinbh4Z7Ggc KZEf/pSZGxswmDf8aBicAZVO4JL1IAXlCxD0QFQx0GrEKORexK4E/vRYj3UESY3YBE1b e/ZA== X-Gm-Message-State: ANhLgQ2mJh1/f0hEd0kDJKwaJF7+AEBBSaa9FdrHcBK5J4c85vs4UCbI bXI50Q0sMyeLM4T0oq3Z/AME6Kdd X-Google-Smtp-Source: ADFU+vu9KGqoAE4crBP4wJCZ1UO5CXpzN5sdzapPizXKKa7HM9pL5RtmXtBOe7hYseU2KlJwcR0Mww== X-Received: by 2002:a63:60d:: with SMTP id 13mr10693526pgg.151.1585262706292; Thu, 26 Mar 2020 15:45:06 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id g10sm2592788pfk.90.2020.03.26.15.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 15:45:05 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Todd Kjos , Saravana Kannan , Andy Gross , Bjorn Andersson , Rajendra Nayak , linux-arm-msm@vger.kernel.org Subject: [PATCH v3 3/3] soc: qcom: rpmhpd: Allow RPMHPD driver to be loaded as a module Date: Thu, 26 Mar 2020 22:44:59 +0000 Message-Id: <20200326224459.105170-4-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200326224459.105170-1-john.stultz@linaro.org> References: <20200326224459.105170-1-john.stultz@linaro.org> This patch allow the rpmhpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded. Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? So making it a permenent module at least improves things slightly over requiring it to be a built in driver. Feedback would be appreciated! Cc: Todd Kjos Cc: Saravana Kannan Cc: Andy Gross Cc: Bjorn Andersson Cc: Rajendra Nayak Cc: linux-arm-msm@vger.kernel.org Signed-off-by: John Stultz --- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmhpd.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig index ac91eaf810f7..ffc04285840b 100644 --- a/drivers/soc/qcom/Kconfig +++ b/drivers/soc/qcom/Kconfig @@ -114,7 +114,7 @@ config QCOM_RPMH help apply the aggregated state on the resource. config QCOM_RPMHPD - bool "Qualcomm RPMh Power domain driver" + tristate "Qualcomm RPMh Power domain driver" depends on QCOM_RPMH && QCOM_COMMAND_DB help QCOM RPMh Power domain driver to support power-domains with diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c index 4d264d0672c4..0bb12d5870a7 100644 --- a/drivers/soc/qcom/rpmhpd.c +++ b/drivers/soc/qcom/rpmhpd.c @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -189,6 +190,7 @@ static const struct of_device_id rpmhpd_match_table[] = { { .compatible = "qcom,sm8150-rpmhpd", .data = &sm8150_desc }, { } }; +MODULE_DEVICE_TABLE(of, rpmhpd_match_table); static int rpmhpd_send_corner(struct rpmhpd *pd, int state, unsigned int corner, bool sync) @@ -460,3 +462,6 @@ static int __init rpmhpd_init(void) return platform_driver_register(&rpmhpd_driver); } core_initcall(rpmhpd_init); + +MODULE_DESCRIPTION("Qualcomm Technologies, Inc. RPMh Power Domain Driver"); +MODULE_LICENSE("GPL v2");