OSDN Git Service

dev_freq: devfreq_spdm: make cci_clk optional indicator
authorDavid Dai <daidavid1@codeaurora.org>
Wed, 25 May 2016 21:37:00 +0000 (14:37 -0700)
committerKyle Yan <kyan@codeaurora.org>
Wed, 29 Jun 2016 22:12:37 +0000 (15:12 -0700)
Enable dev_freq SPDM support in order to increase BIMC
vote based on bus rejection rate. Make cci_clk an optional
property as it's not always a relevant indicator of cpu performance.

CRs-Fixed: 1025515
Change-Id: I713cc396c8d563735981547e0dc18a63f6f15180
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Documentation/devicetree/bindings/devfreq/devfreq-spdm.txt
drivers/devfreq/devfreq_spdm.c
drivers/devfreq/governor_spdm_bw_hyp.c

index 16303f7..1f0d0a0 100644 (file)
@@ -6,9 +6,6 @@ hardware to measure the traffic status of configured master ports on the bus.
 
 Required properties:
 -compatible:                   Must be "qcom,devfreq_spdm"
--clock-names:                  Clocks used to measure current bus frequency.
-                               Expected names are "cci_clk"
--clocks:                       References to named clocks
 -qcom,spdm-client:             Client id of the port being monitored
 -qcom,bw-upstep:               Initial up vote size in MB/s
 -qcom,bw-dwnstep:              Initial down vote size in MB/s
@@ -31,6 +28,11 @@ Required properties:
 -qcom,up-step-multp:           used to increase rate of growth on up votes
 -qcom,spdm-interval:           down-vote polling interval
 
+Optional properties:
+-clock-names:                  Clocks used to measure current bus frequency.
+                               Expected names are "cci_clk"
+-clocks:                       References to named clocks
+
 Example:
 devfreq_spdm_cpu {
        compatible = "qcom,devfreq_spdm";
index f8ef5ed..8e35570 100644 (file)
@@ -70,7 +70,12 @@ static int change_bw(struct device *dev, unsigned long *freq, u32 flags)
 update_thresholds:
        desc.arg[0] = SPDM_CMD_ENABLE;
        desc.arg[1] = data->spdm_client;
-       desc.arg[2] = (clk_get_rate(data->cci_clk)) / 1000;
+
+       if (data->cci_clk)
+               desc.arg[2] = (clk_get_rate(data->cci_clk)) / 1000;
+       else
+               desc.arg[2] = 0;
+
        ext_status = spdm_ext_call(&desc, 3);
        if (ext_status)
                pr_err("External command %u failed with error %u",
@@ -339,8 +344,7 @@ static int probe(struct platform_device *pdev)
 
        data->cci_clk = clk_get(&pdev->dev, "cci_clk");
        if (IS_ERR(data->cci_clk)) {
-               ret = PTR_ERR(data->cci_clk);
-               goto no_clock;
+               data->cci_clk = NULL;
        }
 
        data->profile =
@@ -376,7 +380,6 @@ static int probe(struct platform_device *pdev)
 no_spdm_device:
        devm_kfree(&pdev->dev, data->profile);
 no_profile:
-no_clock:
        msm_bus_scale_unregister_client(data->bus_scale_client_id);
 no_bus_scaling:
        devm_kfree(&pdev->dev, data->config_data.ports);
index e5e1799..cd068a3 100644 (file)
@@ -361,7 +361,7 @@ static int probe(struct platform_device *pdev)
 
        *irq = platform_get_irq_byname(pdev, "spdm-irq");
        ret = request_threaded_irq(*irq, isr, threaded_isr,
-                                  IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
+                                  IRQF_ONESHOT,
                                   spdm_hyp_gov.name, pdev);
        if (ret)
                goto no_irq;