Skip to content

Commit e07cd2f

Browse files
committed
Merge tag 'char-misc-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some small char and misc driver fixes for 5.11-rc3. The majority here are fixes for the habanalabs drivers, but also in here are: - crypto driver fix - pvpanic driver fix - updated font file - interconnect driver fixes All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (26 commits) Fonts: font_ter16x32: Update font with new upstream Terminus release misc: pvpanic: Check devm_ioport_map() for NULL speakup: Add github repository URL and bug tracker MAINTAINERS: Update Georgi's email address crypto: asym_tpm: correct zero out potential secrets habanalabs: Fix memleak in hl_device_reset interconnect: imx8mq: Use icc_sync_state interconnect: imx: Remove a useless test interconnect: imx: Add a missing of_node_put after of_device_is_available interconnect: qcom: fix rpmh link failures habanalabs: fix order of status check habanalabs: register to pci shutdown callback habanalabs: add validation cs counter, fix misplaced counters habanalabs/gaudi: retry loading TPC f/w on -EINTR habanalabs: adjust pci controller init to new firmware habanalabs: update comment in hl_boot_if.h habanalabs/gaudi: enhance reset message habanalabs: full FW hard reset support habanalabs/gaudi: disable CGM at HW initialization habanalabs: Revise comment to align with mirror list name ...
2 parents 0653161 + 384b77f commit e07cd2f

File tree

21 files changed

+322
-217
lines changed

21 files changed

+322
-217
lines changed

MAINTAINERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9240,7 +9240,7 @@ F: tools/testing/selftests/sgx/*
92409240
K: \bSGX_
92419241

92429242
INTERCONNECT API
9243-
M: Georgi Djakov <georgi.djakov@linaro.org>
9243+
M: Georgi Djakov <djakov@kernel.org>
92449244
92459245
S: Maintained
92469246
F: Documentation/devicetree/bindings/interconnect/
@@ -16709,6 +16709,8 @@ M: Samuel Thibault <[email protected]>
1670916709
1671016710
S: Odd Fixes
1671116711
W: http://www.linux-speakup.org/
16712+
W: https://github.com/linux-speakup/speakup
16713+
B: https://github.com/linux-speakup/speakup/issues
1671216714
F: drivers/accessibility/speakup/
1671316715

1671416716
SPEAR CLOCK FRAMEWORK SUPPORT

crypto/asymmetric_keys/asym_tpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf)
354354
memcpy(cur, e, sizeof(e));
355355
cur += sizeof(e);
356356
/* Zero parameters to satisfy set_pub_key ABI. */
357-
memset(cur, 0, SETKEY_PARAMS_SIZE);
357+
memzero_explicit(cur, SETKEY_PARAMS_SIZE);
358358

359359
return cur - buf;
360360
}

drivers/interconnect/imx/imx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ static int imx_icc_node_init_qos(struct icc_provider *provider,
9696
return -ENODEV;
9797
}
9898
/* Allow scaling to be disabled on a per-node basis */
99-
if (!dn || !of_device_is_available(dn)) {
99+
if (!of_device_is_available(dn)) {
100100
dev_warn(dev, "Missing property %s, skip scaling %s\n",
101101
adj->phandle_name, node->name);
102+
of_node_put(dn);
102103
return 0;
103104
}
104105

drivers/interconnect/imx/imx8mq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <linux/module.h>
99
#include <linux/platform_device.h>
10+
#include <linux/interconnect-provider.h>
1011
#include <dt-bindings/interconnect/imx8mq.h>
1112

1213
#include "imx.h"
@@ -94,6 +95,7 @@ static struct platform_driver imx8mq_icc_driver = {
9495
.remove = imx8mq_icc_remove,
9596
.driver = {
9697
.name = "imx8mq-interconnect",
98+
.sync_state = icc_sync_state,
9799
},
98100
};
99101

drivers/interconnect/qcom/Kconfig

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,23 @@ config INTERCONNECT_QCOM_QCS404
4242
This is a driver for the Qualcomm Network-on-Chip on qcs404-based
4343
platforms.
4444

45+
config INTERCONNECT_QCOM_RPMH_POSSIBLE
46+
tristate
47+
default INTERCONNECT_QCOM
48+
depends on QCOM_RPMH || (COMPILE_TEST && !QCOM_RPMH)
49+
depends on QCOM_COMMAND_DB || (COMPILE_TEST && !QCOM_COMMAND_DB)
50+
depends on OF || COMPILE_TEST
51+
help
52+
Compile-testing RPMH drivers is possible on other platforms,
53+
but in order to avoid link failures, drivers must not be built-in
54+
when QCOM_RPMH or QCOM_COMMAND_DB are loadable modules
55+
4556
config INTERCONNECT_QCOM_RPMH
4657
tristate
4758

4859
config INTERCONNECT_QCOM_SC7180
4960
tristate "Qualcomm SC7180 interconnect driver"
50-
depends on INTERCONNECT_QCOM
51-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
61+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
5262
select INTERCONNECT_QCOM_RPMH
5363
select INTERCONNECT_QCOM_BCM_VOTER
5464
help
@@ -57,8 +67,7 @@ config INTERCONNECT_QCOM_SC7180
5767

5868
config INTERCONNECT_QCOM_SDM845
5969
tristate "Qualcomm SDM845 interconnect driver"
60-
depends on INTERCONNECT_QCOM
61-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
70+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
6271
select INTERCONNECT_QCOM_RPMH
6372
select INTERCONNECT_QCOM_BCM_VOTER
6473
help
@@ -67,8 +76,7 @@ config INTERCONNECT_QCOM_SDM845
6776

6877
config INTERCONNECT_QCOM_SM8150
6978
tristate "Qualcomm SM8150 interconnect driver"
70-
depends on INTERCONNECT_QCOM
71-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
79+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
7280
select INTERCONNECT_QCOM_RPMH
7381
select INTERCONNECT_QCOM_BCM_VOTER
7482
help
@@ -77,8 +85,7 @@ config INTERCONNECT_QCOM_SM8150
7785

7886
config INTERCONNECT_QCOM_SM8250
7987
tristate "Qualcomm SM8250 interconnect driver"
80-
depends on INTERCONNECT_QCOM
81-
depends on (QCOM_RPMH && QCOM_COMMAND_DB && OF) || COMPILE_TEST
88+
depends on INTERCONNECT_QCOM_RPMH_POSSIBLE
8289
select INTERCONNECT_QCOM_RPMH
8390
select INTERCONNECT_QCOM_BCM_VOTER
8491
help

drivers/misc/habanalabs/common/command_submission.c

Lines changed: 58 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,11 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx,
472472
cntr = &hdev->aggregated_cs_counters;
473473

474474
cs = kzalloc(sizeof(*cs), GFP_ATOMIC);
475-
if (!cs)
475+
if (!cs) {
476+
atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
477+
atomic64_inc(&cntr->out_of_mem_drop_cnt);
476478
return -ENOMEM;
479+
}
477480

478481
cs->ctx = ctx;
479482
cs->submitted = false;
@@ -486,6 +489,8 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx,
486489

487490
cs_cmpl = kmalloc(sizeof(*cs_cmpl), GFP_ATOMIC);
488491
if (!cs_cmpl) {
492+
atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
493+
atomic64_inc(&cntr->out_of_mem_drop_cnt);
489494
rc = -ENOMEM;
490495
goto free_cs;
491496
}
@@ -513,6 +518,8 @@ static int allocate_cs(struct hl_device *hdev, struct hl_ctx *ctx,
513518
cs->jobs_in_queue_cnt = kcalloc(hdev->asic_prop.max_queues,
514519
sizeof(*cs->jobs_in_queue_cnt), GFP_ATOMIC);
515520
if (!cs->jobs_in_queue_cnt) {
521+
atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
522+
atomic64_inc(&cntr->out_of_mem_drop_cnt);
516523
rc = -ENOMEM;
517524
goto free_fence;
518525
}
@@ -562,7 +569,7 @@ void hl_cs_rollback_all(struct hl_device *hdev)
562569
for (i = 0 ; i < hdev->asic_prop.completion_queues_count ; i++)
563570
flush_workqueue(hdev->cq_wq[i]);
564571

565-
/* Make sure we don't have leftovers in the H/W queues mirror list */
572+
/* Make sure we don't have leftovers in the CS mirror list */
566573
list_for_each_entry_safe(cs, tmp, &hdev->cs_mirror_list, mirror_node) {
567574
cs_get(cs);
568575
cs->aborted = true;
@@ -764,11 +771,14 @@ static int hl_cs_sanity_checks(struct hl_fpriv *hpriv, union hl_cs_args *args)
764771

765772
static int hl_cs_copy_chunk_array(struct hl_device *hdev,
766773
struct hl_cs_chunk **cs_chunk_array,
767-
void __user *chunks, u32 num_chunks)
774+
void __user *chunks, u32 num_chunks,
775+
struct hl_ctx *ctx)
768776
{
769777
u32 size_to_copy;
770778

771779
if (num_chunks > HL_MAX_JOBS_PER_CS) {
780+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
781+
atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
772782
dev_err(hdev->dev,
773783
"Number of chunks can NOT be larger than %d\n",
774784
HL_MAX_JOBS_PER_CS);
@@ -777,11 +787,16 @@ static int hl_cs_copy_chunk_array(struct hl_device *hdev,
777787

778788
*cs_chunk_array = kmalloc_array(num_chunks, sizeof(**cs_chunk_array),
779789
GFP_ATOMIC);
780-
if (!*cs_chunk_array)
790+
if (!*cs_chunk_array) {
791+
atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
792+
atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt);
781793
return -ENOMEM;
794+
}
782795

783796
size_to_copy = num_chunks * sizeof(struct hl_cs_chunk);
784797
if (copy_from_user(*cs_chunk_array, chunks, size_to_copy)) {
798+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
799+
atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
785800
dev_err(hdev->dev, "Failed to copy cs chunk array from user\n");
786801
kfree(*cs_chunk_array);
787802
return -EFAULT;
@@ -797,6 +812,7 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
797812
struct hl_device *hdev = hpriv->hdev;
798813
struct hl_cs_chunk *cs_chunk_array;
799814
struct hl_cs_counters_atomic *cntr;
815+
struct hl_ctx *ctx = hpriv->ctx;
800816
struct hl_cs_job *job;
801817
struct hl_cs *cs;
802818
struct hl_cb *cb;
@@ -805,7 +821,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
805821
cntr = &hdev->aggregated_cs_counters;
806822
*cs_seq = ULLONG_MAX;
807823

808-
rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks);
824+
rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks,
825+
hpriv->ctx);
809826
if (rc)
810827
goto out;
811828

@@ -832,17 +849,17 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
832849
rc = validate_queue_index(hdev, chunk, &queue_type,
833850
&is_kernel_allocated_cb);
834851
if (rc) {
835-
atomic64_inc(&hpriv->ctx->cs_counters.parsing_drop_cnt);
836-
atomic64_inc(&cntr->parsing_drop_cnt);
852+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
853+
atomic64_inc(&cntr->validation_drop_cnt);
837854
goto free_cs_object;
838855
}
839856

840857
if (is_kernel_allocated_cb) {
841858
cb = get_cb_from_cs_chunk(hdev, &hpriv->cb_mgr, chunk);
842859
if (!cb) {
843860
atomic64_inc(
844-
&hpriv->ctx->cs_counters.parsing_drop_cnt);
845-
atomic64_inc(&cntr->parsing_drop_cnt);
861+
&ctx->cs_counters.validation_drop_cnt);
862+
atomic64_inc(&cntr->validation_drop_cnt);
846863
rc = -EINVAL;
847864
goto free_cs_object;
848865
}
@@ -856,8 +873,7 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
856873
job = hl_cs_allocate_job(hdev, queue_type,
857874
is_kernel_allocated_cb);
858875
if (!job) {
859-
atomic64_inc(
860-
&hpriv->ctx->cs_counters.out_of_mem_drop_cnt);
876+
atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
861877
atomic64_inc(&cntr->out_of_mem_drop_cnt);
862878
dev_err(hdev->dev, "Failed to allocate a new job\n");
863879
rc = -ENOMEM;
@@ -891,7 +907,7 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
891907

892908
rc = cs_parser(hpriv, job);
893909
if (rc) {
894-
atomic64_inc(&hpriv->ctx->cs_counters.parsing_drop_cnt);
910+
atomic64_inc(&ctx->cs_counters.parsing_drop_cnt);
895911
atomic64_inc(&cntr->parsing_drop_cnt);
896912
dev_err(hdev->dev,
897913
"Failed to parse JOB %d.%llu.%d, err %d, rejecting the CS\n",
@@ -901,8 +917,8 @@ static int cs_ioctl_default(struct hl_fpriv *hpriv, void __user *chunks,
901917
}
902918

903919
if (int_queues_only) {
904-
atomic64_inc(&hpriv->ctx->cs_counters.parsing_drop_cnt);
905-
atomic64_inc(&cntr->parsing_drop_cnt);
920+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
921+
atomic64_inc(&cntr->validation_drop_cnt);
906922
dev_err(hdev->dev,
907923
"Reject CS %d.%llu because only internal queues jobs are present\n",
908924
cs->ctx->asid, cs->sequence);
@@ -1042,7 +1058,7 @@ static int hl_cs_ctx_switch(struct hl_fpriv *hpriv, union hl_cs_args *args,
10421058
}
10431059

10441060
static int cs_ioctl_extract_signal_seq(struct hl_device *hdev,
1045-
struct hl_cs_chunk *chunk, u64 *signal_seq)
1061+
struct hl_cs_chunk *chunk, u64 *signal_seq, struct hl_ctx *ctx)
10461062
{
10471063
u64 *signal_seq_arr = NULL;
10481064
u32 size_to_copy, signal_seq_arr_len;
@@ -1052,6 +1068,8 @@ static int cs_ioctl_extract_signal_seq(struct hl_device *hdev,
10521068

10531069
/* currently only one signal seq is supported */
10541070
if (signal_seq_arr_len != 1) {
1071+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1072+
atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
10551073
dev_err(hdev->dev,
10561074
"Wait for signal CS supports only one signal CS seq\n");
10571075
return -EINVAL;
@@ -1060,13 +1078,18 @@ static int cs_ioctl_extract_signal_seq(struct hl_device *hdev,
10601078
signal_seq_arr = kmalloc_array(signal_seq_arr_len,
10611079
sizeof(*signal_seq_arr),
10621080
GFP_ATOMIC);
1063-
if (!signal_seq_arr)
1081+
if (!signal_seq_arr) {
1082+
atomic64_inc(&ctx->cs_counters.out_of_mem_drop_cnt);
1083+
atomic64_inc(&hdev->aggregated_cs_counters.out_of_mem_drop_cnt);
10641084
return -ENOMEM;
1085+
}
10651086

10661087
size_to_copy = chunk->num_signal_seq_arr * sizeof(*signal_seq_arr);
10671088
if (copy_from_user(signal_seq_arr,
10681089
u64_to_user_ptr(chunk->signal_seq_arr),
10691090
size_to_copy)) {
1091+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1092+
atomic64_inc(&hdev->aggregated_cs_counters.validation_drop_cnt);
10701093
dev_err(hdev->dev,
10711094
"Failed to copy signal seq array from user\n");
10721095
rc = -EFAULT;
@@ -1153,23 +1176,28 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
11531176
struct hl_device *hdev = hpriv->hdev;
11541177
struct hl_cs_compl *sig_waitcs_cmpl;
11551178
u32 q_idx, collective_engine_id = 0;
1179+
struct hl_cs_counters_atomic *cntr;
11561180
struct hl_fence *sig_fence = NULL;
11571181
struct hl_ctx *ctx = hpriv->ctx;
11581182
enum hl_queue_type q_type;
11591183
struct hl_cs *cs;
11601184
u64 signal_seq;
11611185
int rc;
11621186

1187+
cntr = &hdev->aggregated_cs_counters;
11631188
*cs_seq = ULLONG_MAX;
11641189

1165-
rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks);
1190+
rc = hl_cs_copy_chunk_array(hdev, &cs_chunk_array, chunks, num_chunks,
1191+
ctx);
11661192
if (rc)
11671193
goto out;
11681194

11691195
/* currently it is guaranteed to have only one chunk */
11701196
chunk = &cs_chunk_array[0];
11711197

11721198
if (chunk->queue_index >= hdev->asic_prop.max_queues) {
1199+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1200+
atomic64_inc(&cntr->validation_drop_cnt);
11731201
dev_err(hdev->dev, "Queue index %d is invalid\n",
11741202
chunk->queue_index);
11751203
rc = -EINVAL;
@@ -1181,6 +1209,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
11811209
q_type = hw_queue_prop->type;
11821210

11831211
if (!hw_queue_prop->supports_sync_stream) {
1212+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1213+
atomic64_inc(&cntr->validation_drop_cnt);
11841214
dev_err(hdev->dev,
11851215
"Queue index %d does not support sync stream operations\n",
11861216
q_idx);
@@ -1190,6 +1220,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
11901220

11911221
if (cs_type == CS_TYPE_COLLECTIVE_WAIT) {
11921222
if (!(hw_queue_prop->collective_mode == HL_COLLECTIVE_MASTER)) {
1223+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1224+
atomic64_inc(&cntr->validation_drop_cnt);
11931225
dev_err(hdev->dev,
11941226
"Queue index %d is invalid\n", q_idx);
11951227
rc = -EINVAL;
@@ -1200,12 +1232,14 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
12001232
}
12011233

12021234
if (cs_type == CS_TYPE_WAIT || cs_type == CS_TYPE_COLLECTIVE_WAIT) {
1203-
rc = cs_ioctl_extract_signal_seq(hdev, chunk, &signal_seq);
1235+
rc = cs_ioctl_extract_signal_seq(hdev, chunk, &signal_seq, ctx);
12041236
if (rc)
12051237
goto free_cs_chunk_array;
12061238

12071239
sig_fence = hl_ctx_get_fence(ctx, signal_seq);
12081240
if (IS_ERR(sig_fence)) {
1241+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1242+
atomic64_inc(&cntr->validation_drop_cnt);
12091243
dev_err(hdev->dev,
12101244
"Failed to get signal CS with seq 0x%llx\n",
12111245
signal_seq);
@@ -1223,6 +1257,8 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
12231257
container_of(sig_fence, struct hl_cs_compl, base_fence);
12241258

12251259
if (sig_waitcs_cmpl->type != CS_TYPE_SIGNAL) {
1260+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1261+
atomic64_inc(&cntr->validation_drop_cnt);
12261262
dev_err(hdev->dev,
12271263
"CS seq 0x%llx is not of a signal CS\n",
12281264
signal_seq);
@@ -1270,8 +1306,11 @@ static int cs_ioctl_signal_wait(struct hl_fpriv *hpriv, enum hl_cs_type cs_type,
12701306
else if (cs_type == CS_TYPE_COLLECTIVE_WAIT)
12711307
rc = hdev->asic_funcs->collective_wait_create_jobs(hdev, ctx,
12721308
cs, q_idx, collective_engine_id);
1273-
else
1309+
else {
1310+
atomic64_inc(&ctx->cs_counters.validation_drop_cnt);
1311+
atomic64_inc(&cntr->validation_drop_cnt);
12741312
rc = -EINVAL;
1313+
}
12751314

12761315
if (rc)
12771316
goto free_cs_object;

0 commit comments

Comments
 (0)