From patchwork Wed Nov 7 02:12:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masayoshi Mizuma X-Patchwork-Id: 10671753 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B6BE14BD for ; Wed, 7 Nov 2018 02:12:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF28E2B710 for ; Wed, 7 Nov 2018 02:12:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED7BC2B745; Wed, 7 Nov 2018 02:12:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SUBJ_OBFU_PUNCT_FEW autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A660A2B772 for ; Wed, 7 Nov 2018 02:12:51 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 61EB921189FB2; Tue, 6 Nov 2018 18:12:51 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::732; helo=mail-qk1-x732.google.com; envelope-from=msys.mizuma@gmail.com; receiver=linux-nvdimm@lists.01.org Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8CD61211575F2 for ; Tue, 6 Nov 2018 18:12:49 -0800 (PST) Received: by mail-qk1-x732.google.com with SMTP id o89so19821114qko.0 for ; Tue, 06 Nov 2018 18:12:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=/4I7fX4fE1+ALYZv872k0AIvKwfUEuxwsih8pp6vnn8=; b=Ii0xxeICPmMgxZZl4XpLiOkCp0HOQ26W5Ln8/7kWgsBMHs7FdiSZBZ2uaQ/Va0DaUo AqprGPmE7lFgeImBcr5Or14HRgVC3cXO4DfOpm7TLTzg+I/p6grJpylrvZhicr+PSpia B3qygDvDTvnVGzYy98/fVct6HPYJFdzZCLeifzuSVo/hvVfenV8CrEZlBFfaMVUJ7s6L aD5y/7cO/MNkgJlYgPC1SKDBP/wmF26FnToN9jbfp2FCmouHoV5sydvJ9yJKGGkl6XHw 5WniNP1A+VdfFr8XszYm1XNFj1Kye6bT/dIVwNXVVFTTRz9msL7EKum9ye/cQDCxqnqy +CyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=/4I7fX4fE1+ALYZv872k0AIvKwfUEuxwsih8pp6vnn8=; b=DWtaNy9PCGsKUEwXr1kz4y+xiSj8WqJpMn8yP0kn0oVx73JSV3CLzduuJivGmwp++d gXa+YQsg51Nx5c4eScYffRB15UzZ21DE5LPArK1hf5bFz2BpGOJCe/a2kRCvG1UZP1Ra +T9eC1iHOim4j7y39pM9gpsxPrVF+hJoh/c555XvD1TcpxwV/trhrgck7Nmz0nBBPRjv mBaId1FwLTCxMv87vSt+Cl/CqNzp1mKRHRvbBYCHA7gYgWjVZSRMgORoyCLytMoe88Jx obtl8k6y9R6KPRdH7m7ixZqqemyuV/WlI/GBzsvP5DXd14FAKrDNCUSv5kJcYEKkK/oB KCBQ== X-Gm-Message-State: AGRZ1gJF779O5zcIO3mT66jF/Y1169We19VBuWuSgcIu4lcxor82GJqk 6fmV30EzyiJ41JYW42Jgw/eZRko= X-Google-Smtp-Source: AJdET5cvnySwSNb+mwQNeRXHjP0t4r1g+cX3fgk9DSAQvdc7GSjkZDGryXpR+Vjciyxs2VogFWp2dA== X-Received: by 2002:a37:65c5:: with SMTP id z188mr6746qkb.306.1541556768244; Tue, 06 Nov 2018 18:12:48 -0800 (PST) Received: from gabell ([2601:18f:600:d880:c1f1:36c5:d40:1949]) by smtp.gmail.com with ESMTPSA id b8sm27174008qka.79.2018.11.06.18.12.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Nov 2018 18:12:47 -0800 (PST) Date: Tue, 6 Nov 2018 21:12:46 -0500 From: Masayoshi Mizuma To: linux-nvdimm@lists.01.org Subject: Question about unit test for acpi_nfit_notify(). Message-ID: <20181107021245.amegu3dwawlwyxob@gabell> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP 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 --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);