dmaengine: qcom_hidma: correct overriding message
authorSinan Kaya <okaya@codeaurora.org>
Sun, 16 Jul 2017 14:30:37 +0000 (10:30 -0400)
committerVinod Koul <vinod.koul@intel.com>
Wed, 19 Jul 2017 04:08:55 +0000 (09:38 +0530)
A false overriding information is being presented during boot
under this scenario.

1. First object checks for kernel command line value against zero.
2. It doesn't find it, it sets the command line variable to the
value coming from ACPI/DT.
3. Second object is being probed.
4. Second object sees that the value of kernel command line
override is non-zero, it prints an overriding message even though
value matches ACPI/DT value.

hidma-mgmt QCOM8060:03: overriding max-write-burst-bytes: 1024

Add an additional check to verify that kernel command line value
is different from the ACPI/DT value.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/qcom/hidma_mgmt.c

index 5a0991bc4787fd4d63a3e81958f9f0c9d2a0575c..d51cd34c8267965227725e2adeb96156fc18daea 100644 (file)
@@ -227,7 +227,8 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
                goto out;
        }
 
-       if (max_write_request) {
+       if (max_write_request &&
+                       (max_write_request != mgmtdev->max_write_request)) {
                dev_info(&pdev->dev, "overriding max-write-burst-bytes: %d\n",
                        max_write_request);
                mgmtdev->max_write_request = max_write_request;
@@ -240,7 +241,8 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "max-read-burst-bytes missing\n");
                goto out;
        }
-       if (max_read_request) {
+       if (max_read_request &&
+                       (max_read_request != mgmtdev->max_read_request)) {
                dev_info(&pdev->dev, "overriding max-read-burst-bytes: %d\n",
                        max_read_request);
                mgmtdev->max_read_request = max_read_request;
@@ -253,7 +255,8 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "max-write-transactions missing\n");
                goto out;
        }
-       if (max_wr_xactions) {
+       if (max_wr_xactions &&
+                       (max_wr_xactions != mgmtdev->max_wr_xactions)) {
                dev_info(&pdev->dev, "overriding max-write-transactions: %d\n",
                        max_wr_xactions);
                mgmtdev->max_wr_xactions = max_wr_xactions;
@@ -266,7 +269,8 @@ static int hidma_mgmt_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "max-read-transactions missing\n");
                goto out;
        }
-       if (max_rd_xactions) {
+       if (max_rd_xactions &&
+                       (max_rd_xactions != mgmtdev->max_rd_xactions)) {
                dev_info(&pdev->dev, "overriding max-read-transactions: %d\n",
                        max_rd_xactions);
                mgmtdev->max_rd_xactions = max_rd_xactions;