Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1907306pxb; Sun, 10 Jan 2021 16:04:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxnRwk0sjLmHXrqZRnuMe2j8lCBi54vyefmCqn+zfOKVRR/3QisPZOZpKKOdOF/iYKm2yAw X-Received: by 2002:a17:906:d209:: with SMTP id w9mr8937325ejz.211.1610323484125; Sun, 10 Jan 2021 16:04:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610323484; cv=none; d=google.com; s=arc-20160816; b=VkNUi0ZMIPPkbZhuWSH71gY5YHt8B+Y1tLRM2BEX85qEpWZB2oe+sZtgS6War3wcj/ nKZzRUHe1mwPSWJh4dc9TxbgSzPNkbOSR8UTGjNvpB3M4yhWcJxhfYCamT8kEE7gRhYk tsQ+cM+wirUrv8pToISdjXJAeqfNKYXnmKTV0L/dWPCWFxxtsJgov0zy+lEjPqAQSc89 xRbYdhDD+FBnm61vWp8bJcTNNP1GqiVUrh42w4/ga+qhGe9MNCGAKsiTMyb58fbIstH0 as8EeAKBZ5b9cOmdjctXFnqzqfJ5cKRV35XqcgA+eSrOcUx9WG3CQqtjmVJxBHaQ/gFZ BWLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:dkim-signature:dkim-signature; bh=YHDGpMsoVWO7Mu0PPN8KuDaFtz6YykcCQ780RW5/qxw=; b=g1y2mg/xriZgl7uCubc93cgEFC2VIGzg5UXchu4ERNZrBg6bPFm06D8St5Z5n4Bf+I v0LSPJ0hJMGkU77MvdkziBC2Cb3FWN+1dSIIlafyWRhO4OWTTXu+hOZEarLehJU7HPTs pB2xa/PkyuxbUmlQoHr7swNn3BtEsBBJ1GAWyFMMGMDOwnopD8ZQMgiCJ9Omj5v0hUor 9OfwNNpEbbVIt6fpNMwbzOOqPJheLnZqP3LwJKgZ22SD9m1YBB82gCseICZGLGAqx8rW 54kMziZ8bZhc3BTyUGJMPVgfrmcLNes32QnkdfeW2oYea2QUBQ6OLmRi8DBrxLTgp21P hLkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm1 header.b=ZaAILfvy; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="pF4fPa/U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e19si6230822edy.553.2021.01.10.16.04.18; Sun, 10 Jan 2021 16:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm1 header.b=ZaAILfvy; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b="pF4fPa/U"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726709AbhAKAD1 (ORCPT + 99 others); Sun, 10 Jan 2021 19:03:27 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:36779 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbhAKAD0 (ORCPT ); Sun, 10 Jan 2021 19:03:26 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 3A5AB5C0066; Sun, 10 Jan 2021 19:02:39 -0500 (EST) Received: from imap2 ([10.202.2.52]) by compute3.internal (MEProxy); Sun, 10 Jan 2021 19:02:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=YHDGpMsoVWO7Mu0PPN8KuDaFtz6Yykc CQ780RW5/qxw=; b=ZaAILfvy5ecridk++cJ0nJ4K/Oni0M8gbBt8H5IDOnlfeNj Mo8nq31+IJ6ROeQTNBMDqquGNuY+ixPvPF/EfCRvnYbi+StHMb5u4owS1IbLcwaJ fGuGk6UTarTg8YOaqBC7OK8njZueBAATPZn/Gyy/IkKAKR6i1BztxNwh4uaR0kVm 3k+cccwP4SAMBs/Y8qD11DGqN7BN7OJVic/ai9BRuSvucrBpykivqaZOFos9k7pK zX2TylMK/eIBVoJ34tdtJMQiUgeyMXIMTuXUX6mZs5bV1y1r699ghSY3Xqw8VaqL vOFflD7nbINSIZWHwpJZotyTrA3elFBJrzie/XA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=YHDGpM soVWO7Mu0PPN8KuDaFtz6YykcCQ780RW5/qxw=; b=pF4fPa/UWkHXKr5pNhdG9q vBaanS0z8zTNwimmVCAM2By+ADYxx9v48FWNh7Fr/Rtgbug5jGsRqdaiRUWH7/jB 6I52/g8iDiUMS1yihvqSerhNlGvHsYF4+exRfoAAr7d09yjJ6WlDaFBEZ7Y0XSS6 xflDyUncnOYvA2k20kdwUKXVKPKO5+11/cNiRTI+59gTAfYM96auf0uLGmplIQxH eTXKvAOMrB1bn1Xdn6Tg/DcHjiZughf2N5wi5bKhv0OogEjnboCcOSpyyZxYcOBn 55vSjGv+SzYB4a+48+TSXdPuZKRmcAqFGZkx1piqJGMpHhwp6VsUQ45bYfDREAmQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdehtddgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreerjeenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecuggftrf grthhtvghrnhepuddttdekueeggedvtddtueekiedutdfguedutdefieeuteefieelteet vddthfeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvgifsegrjhdrihgurdgruh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id D610CE00BF; Sun, 10 Jan 2021 19:02:36 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-45-g4839256-fm-20210104.001-g48392560 Mime-Version: 1.0 Message-Id: <6f341a22-f5ce-4c38-9f42-358124468821@www.fastmail.com> In-Reply-To: References: <20201218035338.1130849-1-andrew@aj.id.au> <20201218035338.1130849-5-andrew@aj.id.au> Date: Mon, 11 Jan 2021 10:32:15 +1030 From: "Andrew Jeffery" To: "Adrian Hunter" , linux-mmc Cc: "Ulf Hansson" , "Rob Herring" , "Joel Stanley" , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, "Ryan Chen" Subject: =?UTF-8?Q?Re:_[PATCH_v6_4/6]_mmc:_sdhci-of-aspeed:_Add_KUnit_tests_for_p?= =?UTF-8?Q?hase_calculations?= Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 6 Jan 2021, at 00:17, Adrian Hunter wrote: > On 18/12/20 5:53 am, Andrew Jeffery wrote: > > Converting degrees of phase to logic delays is irritating to test on > > hardware, so lets exercise the function using KUnit. > > > > Signed-off-by: Andrew Jeffery > > --- > > drivers/mmc/host/Kconfig | 14 ++++ > > drivers/mmc/host/Makefile | 1 + > > drivers/mmc/host/sdhci-of-aspeed-test.c | 100 ++++++++++++++++++++++++ > > 3 files changed, 115 insertions(+) > > create mode 100644 drivers/mmc/host/sdhci-of-aspeed-test.c > > > > diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig > > index 596f32637315..d6f00d1d6251 100644 > > --- a/drivers/mmc/host/Kconfig > > +++ b/drivers/mmc/host/Kconfig > > @@ -168,6 +168,20 @@ config MMC_SDHCI_OF_ASPEED > > > > If unsure, say N. > > > > +config MMC_SDHCI_OF_ASPEED_TEST > > + bool "Tests for the ASPEED SDHCI driver" > > + depends on MMC_SDHCI_OF_ASPEED && KUNIT=y > > + help > > + Enable KUnit tests for the ASPEED SDHCI driver. Select this > > + option only if you will boot the kernel for the purpose of running > > + unit tests (e.g. under UML or qemu). > > + > > + The KUnit tests generally exercise parts of the driver that do not > > + directly touch the hardware, for example, the phase correction > > + calculations. > > + > > + If unsure, say N. > > + > > config MMC_SDHCI_OF_AT91 > > tristate "SDHCI OF support for the Atmel SDMMC controller" > > depends on MMC_SDHCI_PLTFM > > diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile > > index 451c25fc2c69..3ee59d5802cf 100644 > > --- a/drivers/mmc/host/Makefile > > +++ b/drivers/mmc/host/Makefile > > @@ -90,6 +90,7 @@ obj-$(CONFIG_MMC_SDHCI_DOVE) += sdhci-dove.o > > obj-$(CONFIG_MMC_SDHCI_TEGRA) += sdhci-tegra.o > > obj-$(CONFIG_MMC_SDHCI_OF_ARASAN) += sdhci-of-arasan.o > > obj-$(CONFIG_MMC_SDHCI_OF_ASPEED) += sdhci-of-aspeed.o > > +obj-$(CONFIG_MMC_SDHCI_OF_ASPEED_TEST) += sdhci-of-aspeed-test.o > > obj-$(CONFIG_MMC_SDHCI_OF_AT91) += sdhci-of-at91.o > > obj-$(CONFIG_MMC_SDHCI_OF_ESDHC) += sdhci-of-esdhc.o > > obj-$(CONFIG_MMC_SDHCI_OF_HLWD) += sdhci-of-hlwd.o > > diff --git a/drivers/mmc/host/sdhci-of-aspeed-test.c b/drivers/mmc/host/sdhci-of-aspeed-test.c > > new file mode 100644 > > index 000000000000..fb79b278fb81 > > --- /dev/null > > +++ b/drivers/mmc/host/sdhci-of-aspeed-test.c > > @@ -0,0 +1,100 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > +/* Copyright (C) 2020 IBM Corp. */ > > + > > +#include > > + > > +#include "sdhci-of-aspeed.c" > > I am not sure including like that is advisable. Yeah I wasn't convinced by it either, but I was just running the tests under qemu and they did what I expected. > Did you consider instead > doing it the other way around i.e. adding an include to the bottom of > sdhci-of-aspeed.c? No, I didn't. I'll switch to this approach. Thanks! Andrew