Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7050967
dt-bindings: input: mediatek,mt6779-keypad: update maintainer
Apr 25, 2022
525f447
scsi: target: Fix incorrect use of cpumask_t
zoumingzhe May 16, 2022
e4920d4
Input: ili210x - fix reset timing
May 18, 2022
b26ff91
Input: ili210x - use one common reset implementation
May 18, 2022
d5d92b6
scsi: ufs: core: Fix referencing invalid rsp field
Daejun7Park May 19, 2022
0ae065a
perf build: Fix check for btf__load_from_kernel_by_id() in libbpf
acmel May 20, 2022
92d579e
perf stat: Fix and validate CPU map inputs in synthetic PERF_RECORD_S…
captain5050 May 19, 2022
451ed80
perf test: Fix "all PMU test" to skip hv_24x7/hv_gpci tests on powerpc
athira-rajeev May 20, 2022
01b28e4
perf regs x86: Fix arch__intr_reg_mask() for the hybrid platform
May 18, 2022
caaaa55
perf test: Avoid shell test description infinite loop
captain5050 May 17, 2022
f8ac1c4
perf bench numa: Address compiler error on s390
May 20, 2022
cfd7092
perf test session topology: Fix test to skip the test in guest enviro…
athira-rajeev May 11, 2022
8994e97
perf test bpf: Skip test if clang is not present
athira-rajeev May 11, 2022
51d0bf9
perf session: Fix Intel LBR callstack entries and nr print message
May 17, 2022
36ed2da
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
torvalds May 21, 2022
4c493b1
Merge tag 'input-for-v5.18-rc7' of git://git.kernel.org/pub/scm/linux…
torvalds May 21, 2022
eaea45f
Merge tag 'perf-tools-fixes-for-v5.18-2022-05-21' of git://git.kernel…
torvalds May 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: Mediatek's Keypad Controller device tree bindings

maintainers:
- Fengping Yu <fengping.yu@mediatek.com>
- Mattijs Korpershoek <mkorpershoek@baylibre.com>

allOf:
- $ref: "/schemas/input/matrix-keymap.yaml#"
Expand Down
20 changes: 8 additions & 12 deletions drivers/input/touchscreen/ili210x.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,15 +756,12 @@ static int ili251x_firmware_reset(struct i2c_client *client)
return ili251x_firmware_busy(client);
}

static void ili251x_hardware_reset(struct device *dev)
static void ili210x_hardware_reset(struct gpio_desc *reset_gpio)
{
struct i2c_client *client = to_i2c_client(dev);
struct ili210x *priv = i2c_get_clientdata(client);

/* Reset the controller */
gpiod_set_value_cansleep(priv->reset_gpio, 1);
usleep_range(10000, 15000);
gpiod_set_value_cansleep(priv->reset_gpio, 0);
gpiod_set_value_cansleep(reset_gpio, 1);
usleep_range(12000, 15000);
gpiod_set_value_cansleep(reset_gpio, 0);
msleep(300);
}

Expand All @@ -773,6 +770,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
const char *buf, size_t count)
{
struct i2c_client *client = to_i2c_client(dev);
struct ili210x *priv = i2c_get_clientdata(client);
const char *fwname = ILI251X_FW_FILENAME;
const struct firmware *fw;
u16 ac_end, df_end;
Expand Down Expand Up @@ -803,7 +801,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,

dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname);

ili251x_hardware_reset(dev);
ili210x_hardware_reset(priv->reset_gpio);

error = ili251x_firmware_reset(client);
if (error)
Expand Down Expand Up @@ -858,7 +856,7 @@ static ssize_t ili210x_firmware_update_store(struct device *dev,
error = count;

exit:
ili251x_hardware_reset(dev);
ili210x_hardware_reset(priv->reset_gpio);
dev_dbg(dev, "Firmware update ended, error=%i\n", error);
enable_irq(client->irq);
kfree(fwbuf);
Expand Down Expand Up @@ -951,9 +949,7 @@ static int ili210x_i2c_probe(struct i2c_client *client,
if (error)
return error;

usleep_range(50, 100);
gpiod_set_value_cansleep(reset_gpio, 0);
msleep(100);
ili210x_hardware_reset(reset_gpio);
}

priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
Expand Down
19 changes: 7 additions & 12 deletions drivers/scsi/ufs/ufshpb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,13 @@ void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
struct utp_hpb_rsp *rsp_field = &lrbp->ucd_rsp_ptr->hr;
int data_seg_len;

data_seg_len = be32_to_cpu(lrbp->ucd_rsp_ptr->header.dword_2)
& MASK_RSP_UPIU_DATA_SEG_LEN;

/* If data segment length is zero, rsp_field is not valid */
if (!data_seg_len)
return;

if (unlikely(lrbp->lun != rsp_field->lun)) {
struct scsi_device *sdev;
bool found = false;
Expand Down Expand Up @@ -1288,18 +1295,6 @@ void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
return;
}

data_seg_len = be32_to_cpu(lrbp->ucd_rsp_ptr->header.dword_2)
& MASK_RSP_UPIU_DATA_SEG_LEN;

/* To flush remained rsp_list, we queue the map_work task */
if (!data_seg_len) {
if (!ufshpb_is_general_lun(hpb->lun))
return;

ufshpb_kick_map_work(hpb);
return;
}

BUILD_BUG_ON(sizeof(struct utp_hpb_rsp) != UTP_HPB_RSP_SIZE);

if (!ufshpb_is_hpb_rsp_valid(hba, lrbp, rsp_field))
Expand Down
32 changes: 22 additions & 10 deletions drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3596,10 +3596,7 @@ static int iscsit_send_reject(
void iscsit_thread_get_cpumask(struct iscsi_conn *conn)
{
int ord, cpu;
cpumask_t conn_allowed_cpumask;

cpumask_and(&conn_allowed_cpumask, iscsit_global->allowed_cpumask,
cpu_online_mask);
cpumask_var_t conn_allowed_cpumask;

/*
* bitmap_id is assigned from iscsit_global->ts_bitmap from
Expand All @@ -3609,13 +3606,28 @@ void iscsit_thread_get_cpumask(struct iscsi_conn *conn)
* iSCSI connection's RX/TX threads will be scheduled to
* execute upon.
*/
cpumask_clear(conn->conn_cpumask);
ord = conn->bitmap_id % cpumask_weight(&conn_allowed_cpumask);
for_each_cpu(cpu, &conn_allowed_cpumask) {
if (ord-- == 0) {
cpumask_set_cpu(cpu, conn->conn_cpumask);
return;
if (!zalloc_cpumask_var(&conn_allowed_cpumask, GFP_KERNEL)) {
ord = conn->bitmap_id % cpumask_weight(cpu_online_mask);
for_each_online_cpu(cpu) {
if (ord-- == 0) {
cpumask_set_cpu(cpu, conn->conn_cpumask);
return;
}
}
} else {
cpumask_and(conn_allowed_cpumask, iscsit_global->allowed_cpumask,
cpu_online_mask);

cpumask_clear(conn->conn_cpumask);
ord = conn->bitmap_id % cpumask_weight(conn_allowed_cpumask);
for_each_cpu(cpu, conn_allowed_cpumask) {
if (ord-- == 0) {
cpumask_set_cpu(cpu, conn->conn_cpumask);
free_cpumask_var(conn_allowed_cpumask);
return;
}
}
free_cpumask_var(conn_allowed_cpumask);
}
/*
* This should never be reached..
Expand Down
24 changes: 14 additions & 10 deletions drivers/target/iscsi/iscsi_target_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,23 +1137,27 @@ static ssize_t lio_target_wwn_cpus_allowed_list_show(
static ssize_t lio_target_wwn_cpus_allowed_list_store(
struct config_item *item, const char *page, size_t count)
{
int ret;
int ret = -ENOMEM;
char *orig;
cpumask_t new_allowed_cpumask;
cpumask_var_t new_allowed_cpumask;

if (!zalloc_cpumask_var(&new_allowed_cpumask, GFP_KERNEL))
goto out;

orig = kstrdup(page, GFP_KERNEL);
if (!orig)
return -ENOMEM;
goto out_free_cpumask;

cpumask_clear(&new_allowed_cpumask);
ret = cpulist_parse(orig, &new_allowed_cpumask);
ret = cpulist_parse(orig, new_allowed_cpumask);
if (!ret)
cpumask_copy(iscsit_global->allowed_cpumask,
new_allowed_cpumask);

kfree(orig);
if (ret != 0)
return ret;

cpumask_copy(iscsit_global->allowed_cpumask, &new_allowed_cpumask);
return count;
out_free_cpumask:
free_cpumask_var(new_allowed_cpumask);
out:
return ret ? ret : count;
}

CONFIGFS_ATTR(lio_target_wwn_, cpus_allowed_list);
Expand Down
1 change: 1 addition & 0 deletions tools/build/Makefile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ FEATURE_TESTS_EXTRA := \
llvm-version \
clang \
libbpf \
libbpf-btf__load_from_kernel_by_id \
libpfm4 \
libdebuginfod \
clang-bpf-co-re
Expand Down
4 changes: 4 additions & 0 deletions tools/build/feature/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ FILES= \
test-lzma.bin \
test-bpf.bin \
test-libbpf.bin \
test-libbpf-btf__load_from_kernel_by_id.bin \
test-get_cpuid.bin \
test-sdt.bin \
test-cxx.bin \
Expand Down Expand Up @@ -287,6 +288,9 @@ $(OUTPUT)test-bpf.bin:
$(OUTPUT)test-libbpf.bin:
$(BUILD) -lbpf

$(OUTPUT)test-libbpf-btf__load_from_kernel_by_id.bin:
$(BUILD) -lbpf

$(OUTPUT)test-sdt.bin:
$(BUILD)

Expand Down
7 changes: 7 additions & 0 deletions tools/build/feature/test-libbpf-btf__load_from_kernel_by_id.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include <bpf/libbpf.h>

int main(void)
{
return btf__load_from_kernel_by_id(20151128, NULL);
}
7 changes: 7 additions & 0 deletions tools/perf/Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,16 @@ ifndef NO_LIBELF
ifeq ($(feature-libbpf), 1)
EXTLIBS += -lbpf
$(call detected,CONFIG_LIBBPF_DYNAMIC)

$(call feature_check,libbpf-btf__load_from_kernel_by_id)
ifeq ($(feature-libbpf-btf__load_from_kernel_by_id), 1)
CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
endif
else
dummy := $(error Error: No libbpf devel library found, please install libbpf-devel);
endif
else
CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
endif
endif

Expand Down
12 changes: 12 additions & 0 deletions tools/perf/arch/x86/util/perf_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "../../../util/perf_regs.h"
#include "../../../util/debug.h"
#include "../../../util/event.h"
#include "../../../util/pmu.h"
#include "../../../util/pmu-hybrid.h"

const struct sample_reg sample_reg_masks[] = {
SMPL_REG(AX, PERF_REG_X86_AX),
Expand Down Expand Up @@ -284,12 +286,22 @@ uint64_t arch__intr_reg_mask(void)
.disabled = 1,
.exclude_kernel = 1,
};
struct perf_pmu *pmu;
int fd;
/*
* In an unnamed union, init it here to build on older gcc versions
*/
attr.sample_period = 1;

if (perf_pmu__has_hybrid()) {
/*
* The same register set is supported among different hybrid PMUs.
* Only check the first available one.
*/
pmu = list_first_entry(&perf_pmu__hybrid_pmus, typeof(*pmu), hybrid_list);
attr.config |= (__u64)pmu->type << PERF_PMU_TYPE_SHIFT;
}

event_attr_init(&attr);

fd = sys_perf_event_open(&attr, 0, -1, -1, 0);
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/bench/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ static int __bench_numa(const char *name)
"GB/sec,", "total-speed", "GB/sec total speed");

if (g->p.show_details >= 2) {
char tname[14 + 2 * 10 + 1];
char tname[14 + 2 * 11 + 1];
struct thread_data *td;
for (p = 0; p < g->p.nr_proc; p++) {
for (t = 0; t < g->p.nr_threads; t++) {
Expand Down
10 changes: 6 additions & 4 deletions tools/perf/tests/bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ static int __test__bpf(int idx)

ret = test_llvm__fetch_bpf_obj(&obj_buf, &obj_buf_sz,
bpf_testcase_table[idx].prog_id,
true, NULL);
false, NULL);
if (ret != TEST_OK || !obj_buf || !obj_buf_sz) {
pr_debug("Unable to get BPF object, %s\n",
bpf_testcase_table[idx].msg_compile_fail);
if (idx == 0)
if ((idx == 0) || (ret == TEST_SKIP))
return TEST_SKIP;
else
return TEST_FAIL;
Expand Down Expand Up @@ -364,9 +364,11 @@ static int test__bpf_prologue_test(struct test_suite *test __maybe_unused,
static struct test_case bpf_tests[] = {
#ifdef HAVE_LIBBPF_SUPPORT
TEST_CASE("Basic BPF filtering", basic_bpf_test),
TEST_CASE("BPF pinning", bpf_pinning),
TEST_CASE_REASON("BPF pinning", bpf_pinning,
"clang isn't installed or environment missing BPF support"),
#ifdef HAVE_BPF_PROLOGUE
TEST_CASE("BPF prologue generation", bpf_prologue_test),
TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test,
"clang isn't installed or environment missing BPF support"),
#else
TEST_CASE_REASON("BPF prologue generation", bpf_prologue_test, "not compiled in"),
#endif
Expand Down
8 changes: 6 additions & 2 deletions tools/perf/tests/builtin-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,17 @@ static const char *shell_test__description(char *description, size_t size,
{
FILE *fp;
char filename[PATH_MAX];
int ch;

path__join(filename, sizeof(filename), path, name);
fp = fopen(filename, "r");
if (!fp)
return NULL;

/* Skip shebang */
while (fgetc(fp) != '\n');
do {
ch = fgetc(fp);
} while (ch != EOF && ch != '\n');

description = fgets(description, size, fp);
fclose(fp);
Expand Down Expand Up @@ -417,7 +420,8 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width,
.priv = &st,
};

if (!perf_test__matches(test_suite.desc, curr, argc, argv))
if (test_suite.desc == NULL ||
!perf_test__matches(test_suite.desc, curr, argc, argv))
continue;

st.file = ent->d_name;
Expand Down
10 changes: 10 additions & 0 deletions tools/perf/tests/shell/stat_all_pmu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
set -e

for p in $(perf list --raw-dump pmu); do
# In powerpc, skip the events for hv_24x7 and hv_gpci.
# These events needs input values to be filled in for
# core, chip, partition id based on system.
# Example: hv_24x7/CPM_ADJUNCT_INST,domain=?,core=?/
# hv_gpci/event,partition_id=?/
# Hence skip these events for ppc.
if echo "$p" |grep -Eq 'hv_24x7|hv_gpci' ; then
echo "Skipping: Event '$p' in powerpc"
continue
fi
echo "Testing $p"
result=$(perf stat -e "$p" true 2>&1)
if ! echo "$result" | grep -q "$p" && ! echo "$result" | grep -q "<not supported>" ; then
Expand Down
11 changes: 11 additions & 0 deletions tools/perf/tests/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ static int check_cpu_topology(char *path, struct perf_cpu_map *map)
&& strncmp(session->header.env.arch, "aarch64", 7))
return TEST_SKIP;

/*
* In powerpc pSeries platform, not all the topology information
* are exposed via sysfs. Due to restriction, detail like
* physical_package_id will be set to -1. Hence skip this
* test if physical_package_id returns -1 for cpu from perf_cpu_map.
*/
if (strncmp(session->header.env.arch, "powerpc", 7)) {
if (cpu__get_socket_id(perf_cpu_map__cpu(map, 0)) == -1)
return TEST_SKIP;
}

TEST_ASSERT_VAL("Session header CPU map not set", session->header.env.cpu);

for (i = 0; i < session->header.env.nr_cpus_avail; i++) {
Expand Down
4 changes: 3 additions & 1 deletion tools/perf/util/bpf-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#include "record.h"
#include "util/synthetic-events.h"

struct btf * __weak btf__load_from_kernel_by_id(__u32 id)
#ifndef HAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
struct btf *btf__load_from_kernel_by_id(__u32 id)
{
struct btf *btf;
#pragma GCC diagnostic push
Expand All @@ -32,6 +33,7 @@ struct btf * __weak btf__load_from_kernel_by_id(__u32 id)

return err ? ERR_PTR(err) : btf;
}
#endif

int __weak bpf_prog_load(enum bpf_prog_type prog_type,
const char *prog_name __maybe_unused,
Expand Down
Loading