https://github.com/torvalds/linux
Revision 5bb017d4b97a0f135f43ef77091b7edcce4dcee6 authored by Thomas Richter on 20 April 2022, 06:29:21 UTC, committed by Arnaldo Carvalho de Melo on 22 April 2022, 21:39:34 UTC
Test case 71 'Convert perf time to TSC' is not supported on s390.

Subtest 71.1 is skipped with the correct message, but subtest 71.2 is
not skipped and fails.

The root cause is function evlist__open() called from
test__perf_time_to_tsc().  evlist__open() returns -ENOENT because the
event cycles:u is not supported by the selected PMU, for example
platform s390 on z/VM or an x86_64 virtual machine.

The PMU driver returns -ENOENT in this case. This error is leads to the
failure.

Fix this by returning TEST_SKIP on -ENOENT.

Output before:
 71: Convert perf time to TSC:
 71.1: TSC support:             Skip (This architecture does not support)
 71.2: Perf time to TSC:        FAILED!

Output after:
 71: Convert perf time to TSC:
 71.1: TSC support:             Skip (This architecture does not support)
 71.2: Perf time to TSC:        Skip (perf_read_tsc_conversion is not supported)

This also happens on an x86_64 virtual machine:
   # uname -m
   x86_64
   $ ./perf test -F 71
    71: Convert perf time to TSC  :
    71.1: TSC support             : Ok
    71.2: Perf time to TSC        : FAILED!
   $

Committer testing:

Continues to work on x86_64:

  $ perf test 71
   71: Convert perf time to TSC    :
   71.1: TSC support               : Ok
   71.2: Perf time to TSC          : Ok
  $

Fixes: 290fa68bdc458863 ("perf test tsc: Fix error message when not supported")
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Chengdong Li <chengdongli@tencent.com>
Cc: chengdongli@tencent.com
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20220420062921.1211825-1-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent ccb17ca
Raw File
Tip revision: 5bb017d4b97a0f135f43ef77091b7edcce4dcee6 authored by Thomas Richter on 20 April 2022, 06:29:21 UTC
perf test: Fix error message for test case 71 on s390, where it is not supported
Tip revision: 5bb017d
hid-macally.c
// SPDX-License-Identifier: GPL-2.0+
/*
 *  HID driver for quirky Macally devices
 *
 *  Copyright (c) 2019 Alex Henrie <alexhenrie24@gmail.com>
 */

#include <linux/hid.h>
#include <linux/module.h>

#include "hid-ids.h"

MODULE_AUTHOR("Alex Henrie <alexhenrie24@gmail.com>");
MODULE_DESCRIPTION("Macally devices");
MODULE_LICENSE("GPL");

/*
 * The Macally ikey keyboard says that its logical and usage maximums are both
 * 101, but the power key is 102 and the equals key is 103
 */
static __u8 *macally_report_fixup(struct hid_device *hdev, __u8 *rdesc,
				 unsigned int *rsize)
{
	if (*rsize >= 60 && rdesc[53] == 0x65 && rdesc[59] == 0x65) {
		hid_info(hdev,
			"fixing up Macally ikey keyboard report descriptor\n");
		rdesc[53] = rdesc[59] = 0x67;
	}
	return rdesc;
}

static const struct hid_device_id macally_id_table[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_SOLID_YEAR,
			 USB_DEVICE_ID_MACALLY_IKEY_KEYBOARD) },
	{ }
};
MODULE_DEVICE_TABLE(hid, macally_id_table);

static struct hid_driver macally_driver = {
	.name			= "macally",
	.id_table		= macally_id_table,
	.report_fixup		= macally_report_fixup,
};

module_hid_driver(macally_driver);
back to top