diff mbox series

Question about unit test for acpi_nfit_notify().

Message ID 20181107021245.amegu3dwawlwyxob@gabell (mailing list archive)
State New, archived
Headers show
Series Question about unit test for acpi_nfit_notify(). | expand

Commit Message

Masayoshi Mizuma Nov. 7, 2018, 2:12 a.m. UTC
Let me ask a question about unit test for acpi_nfit_notify().

The unit test was introduced by commit c14a868a5a14 ("tools/testing/nvdimm:
unit test for acpi_nfit_notify()"), however, it seems that it doesn't
work currently. When I road the nfit_test.ko, I got the following
message.

  nfit_test nfit_test.0: failed to evaluate _FIT

That is because the 2nd argument of __acpi_nfit_notify(), nfit_test,
isn't allocated as nfit_test_resource structure, so
__wrap_acpi_evaluate_object() doesn't do anything, just call
acpi_evaluate_object(). The nfit_test is passed to acpi_evaluate_object()
as the 1st argument, handle. The nfit_test isn't useful for the
handle, so I got the error message.

nfit_test->_fit is allocated as nfit_test_resource structure,
so I thought it is fixed by the change look like as following.


However, if so, obj, which is allocated before calling __acpi_nfit_notify(),
gets meaningless...

I would like to fix this issue but I'm confusing now... Am I missing
something? I would applicate if someone could help.

Thanks!
Masa
diff mbox series

Patch

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index cffc2c5a778d..3bae4a879f5f 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -2670,7 +2670,7 @@  static int nfit_test_probe(struct platform_device *pdev)
        obj->buffer.length = nfit_test->nfit_size;
        obj->buffer.pointer = nfit_test->nfit_buf;
        *(nfit_test->_fit) = obj;
-       __acpi_nfit_notify(&pdev->dev, nfit_test, 0x80);
+       __acpi_nfit_notify(&pdev->dev, nfit_test->_fit, 0x80);

        /* associate dimm devices with nfit_mem data for notification testing */
        mutex_lock(&acpi_desc->init_mutex);