nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* Question about unit test for acpi_nfit_notify().
@ 2018-11-07  2:12 Masayoshi Mizuma
  0 siblings, 0 replies; only message in thread
From: Masayoshi Mizuma @ 2018-11-07  2:12 UTC (permalink / raw)
  To: linux-nvdimm

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.

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);

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
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-07  2:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-07  2:12 Question about unit test for acpi_nfit_notify() Masayoshi Mizuma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).