Skip to content

Commit 5af82ba

Browse files
author
CKI KWF Bot
committed
Merge: mei: Updates to 6.17
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1583 Description: updates for mei JIRA: https://issues.redhat.com/browse/RHEL-113185 Build Info: 69105234 Tested: Successful platform test results on Intel (intel-pantherlake-h-03) system. Signed-off-by: Steve Best <sbest@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents 6218499 + 84bda56 commit 5af82ba

File tree

16 files changed

+136
-281
lines changed

16 files changed

+136
-281
lines changed

drivers/misc/mei/bus-fixup.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -463,14 +463,14 @@ static void mei_nfc(struct mei_cl_device *cldev)
463463
if (IS_ERR(cl)) {
464464
ret = PTR_ERR(cl);
465465
cl = NULL;
466-
dev_err(bus->dev, "nfc hook alloc failed %d\n", ret);
466+
dev_err(&cldev->dev, "nfc hook alloc failed %d\n", ret);
467467
goto out;
468468
}
469469

470470
me_cl = mei_me_cl_by_uuid(bus, &mei_nfc_info_guid);
471471
if (!me_cl) {
472472
ret = -ENOTTY;
473-
dev_err(bus->dev, "Cannot find nfc info %d\n", ret);
473+
dev_err(&cldev->dev, "Cannot find nfc info %d\n", ret);
474474
goto out;
475475
}
476476

@@ -496,13 +496,13 @@ static void mei_nfc(struct mei_cl_device *cldev)
496496
goto disconnect;
497497
}
498498

499-
dev_dbg(bus->dev, "nfc radio %s\n", radio_name);
499+
dev_dbg(&cldev->dev, "nfc radio %s\n", radio_name);
500500
strscpy(cldev->name, radio_name, sizeof(cldev->name));
501501

502502
disconnect:
503503
mutex_lock(&bus->device_lock);
504504
if (mei_cl_disconnect(cl) < 0)
505-
dev_err(bus->dev, "Can't disconnect the NFC INFO ME\n");
505+
dev_err(&cldev->dev, "Can't disconnect the NFC INFO ME\n");
506506

507507
mei_cl_flush_queues(cl, NULL);
508508

@@ -515,7 +515,7 @@ static void mei_nfc(struct mei_cl_device *cldev)
515515
if (ret)
516516
cldev->do_match = 0;
517517

518-
dev_dbg(bus->dev, "end of fixup match = %d\n", cldev->do_match);
518+
dev_dbg(&cldev->dev, "end of fixup match = %d\n", cldev->do_match);
519519
}
520520

521521
/**

drivers/misc/mei/bus.c

Lines changed: 24 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ ssize_t __mei_cl_send_timeout(struct mei_cl *cl, const u8 *buf, size_t length, u
145145
* @cl: host client
146146
* @buf: buffer to receive
147147
* @length: buffer length
148-
* @mode: io mode
149148
* @vtag: virtual tag
149+
* @mode: io mode
150150
* @timeout: recv timeout, 0 for infinite timeout
151151
*
152152
* Return: read size in bytes of < 0 on error
@@ -323,28 +323,6 @@ ssize_t mei_cldev_recv_vtag(struct mei_cl_device *cldev, u8 *buf, size_t length,
323323
}
324324
EXPORT_SYMBOL_GPL(mei_cldev_recv_vtag);
325325

326-
/**
327-
* mei_cldev_recv_nonblock_vtag - non block client receive with vtag (read)
328-
*
329-
* @cldev: me client device
330-
* @buf: buffer to receive
331-
* @length: buffer length
332-
* @vtag: virtual tag
333-
*
334-
* Return:
335-
* * read size in bytes
336-
* * -EAGAIN if function will block.
337-
* * < 0 on other error
338-
*/
339-
ssize_t mei_cldev_recv_nonblock_vtag(struct mei_cl_device *cldev, u8 *buf,
340-
size_t length, u8 *vtag)
341-
{
342-
struct mei_cl *cl = cldev->cl;
343-
344-
return __mei_cl_recv(cl, buf, length, vtag, MEI_CL_IO_RX_NONBLOCK, 0);
345-
}
346-
EXPORT_SYMBOL_GPL(mei_cldev_recv_nonblock_vtag);
347-
348326
/**
349327
* mei_cldev_recv_timeout - client receive with timeout (read)
350328
*
@@ -438,23 +416,6 @@ ssize_t mei_cldev_recv(struct mei_cl_device *cldev, u8 *buf, size_t length)
438416
}
439417
EXPORT_SYMBOL_GPL(mei_cldev_recv);
440418

441-
/**
442-
* mei_cldev_recv_nonblock - non block client receive (read)
443-
*
444-
* @cldev: me client device
445-
* @buf: buffer to receive
446-
* @length: buffer length
447-
*
448-
* Return: read size in bytes of < 0 on error
449-
* -EAGAIN if function will block.
450-
*/
451-
ssize_t mei_cldev_recv_nonblock(struct mei_cl_device *cldev, u8 *buf,
452-
size_t length)
453-
{
454-
return mei_cldev_recv_nonblock_vtag(cldev, buf, length, NULL);
455-
}
456-
EXPORT_SYMBOL_GPL(mei_cldev_recv_nonblock);
457-
458419
/**
459420
* mei_cl_bus_rx_work - dispatch rx event for a bus device
460421
*
@@ -640,19 +601,6 @@ void mei_cldev_set_drvdata(struct mei_cl_device *cldev, void *data)
640601
}
641602
EXPORT_SYMBOL_GPL(mei_cldev_set_drvdata);
642603

643-
/**
644-
* mei_cldev_uuid - return uuid of the underlying me client
645-
*
646-
* @cldev: mei client device
647-
*
648-
* Return: me client uuid
649-
*/
650-
const uuid_le *mei_cldev_uuid(const struct mei_cl_device *cldev)
651-
{
652-
return mei_me_cl_uuid(cldev->me_cl);
653-
}
654-
EXPORT_SYMBOL_GPL(mei_cldev_uuid);
655-
656604
/**
657605
* mei_cldev_ver - return protocol version of the underlying me client
658606
*
@@ -927,14 +875,14 @@ int mei_cldev_disable(struct mei_cl_device *cldev)
927875
mei_cl_bus_vtag_free(cldev);
928876

929877
if (!mei_cl_is_connected(cl)) {
930-
dev_dbg(bus->dev, "Already disconnected\n");
878+
dev_dbg(&cldev->dev, "Already disconnected\n");
931879
err = 0;
932880
goto out;
933881
}
934882

935883
err = mei_cl_disconnect(cl);
936884
if (err < 0)
937-
dev_err(bus->dev, "Could not disconnect from the ME client\n");
885+
dev_err(&cldev->dev, "Could not disconnect from the ME client\n");
938886

939887
out:
940888
/* Flush queues and remove any pending read unless we have mapped DMA */
@@ -987,7 +935,7 @@ ssize_t mei_cldev_send_gsc_command(struct mei_cl_device *cldev,
987935
cl = cldev->cl;
988936
bus = cldev->bus;
989937

990-
dev_dbg(bus->dev, "client_id %u, fence_id %u\n", client_id, fence_id);
938+
dev_dbg(&cldev->dev, "client_id %u, fence_id %u\n", client_id, fence_id);
991939

992940
if (!bus->hbm_f_gsc_supported)
993941
return -EOPNOTSUPP;
@@ -1035,11 +983,11 @@ ssize_t mei_cldev_send_gsc_command(struct mei_cl_device *cldev,
1035983
/* send the message to GSC */
1036984
ret = __mei_cl_send(cl, (u8 *)ext_hdr, buf_sz, 0, MEI_CL_IO_SGL);
1037985
if (ret < 0) {
1038-
dev_err(bus->dev, "__mei_cl_send failed, returned %zd\n", ret);
986+
dev_err(&cldev->dev, "__mei_cl_send failed, returned %zd\n", ret);
1039987
goto end;
1040988
}
1041989
if (ret != buf_sz) {
1042-
dev_err(bus->dev, "__mei_cl_send returned %zd instead of expected %zd\n",
990+
dev_err(&cldev->dev, "__mei_cl_send returned %zd instead of expected %zd\n",
1043991
ret, buf_sz);
1044992
ret = -EIO;
1045993
goto end;
@@ -1049,7 +997,7 @@ ssize_t mei_cldev_send_gsc_command(struct mei_cl_device *cldev,
1049997
ret = __mei_cl_recv(cl, (u8 *)&rx_msg, sizeof(rx_msg), NULL, MEI_CL_IO_SGL, 0);
1050998

1051999
if (ret != sizeof(rx_msg)) {
1052-
dev_err(bus->dev, "__mei_cl_recv returned %zd instead of expected %zd\n",
1000+
dev_err(&cldev->dev, "__mei_cl_recv returned %zd instead of expected %zd\n",
10531001
ret, sizeof(rx_msg));
10541002
if (ret >= 0)
10551003
ret = -EIO;
@@ -1058,13 +1006,13 @@ ssize_t mei_cldev_send_gsc_command(struct mei_cl_device *cldev,
10581006

10591007
/* check rx_msg.client_id and rx_msg.fence_id match the ones we send */
10601008
if (rx_msg.client_id != client_id || rx_msg.fence_id != fence_id) {
1061-
dev_err(bus->dev, "received client_id/fence_id %u/%u instead of %u/%u sent\n",
1009+
dev_err(&cldev->dev, "received client_id/fence_id %u/%u instead of %u/%u sent\n",
10621010
rx_msg.client_id, rx_msg.fence_id, client_id, fence_id);
10631011
ret = -EFAULT;
10641012
goto end;
10651013
}
10661014

1067-
dev_dbg(bus->dev, "gsc command: successfully written %u bytes\n", rx_msg.written);
1015+
dev_dbg(&cldev->dev, "gsc command: successfully written %u bytes\n", rx_msg.written);
10681016
ret = rx_msg.written;
10691017

10701018
end:
@@ -1208,7 +1156,7 @@ static ssize_t name_show(struct device *dev, struct device_attribute *a,
12081156
{
12091157
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12101158

1211-
return scnprintf(buf, PAGE_SIZE, "%s", cldev->name);
1159+
return sysfs_emit(buf, "%s", cldev->name);
12121160
}
12131161
static DEVICE_ATTR_RO(name);
12141162

@@ -1218,7 +1166,7 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *a,
12181166
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12191167
const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
12201168

1221-
return sprintf(buf, "%pUl", uuid);
1169+
return sysfs_emit(buf, "%pUl", uuid);
12221170
}
12231171
static DEVICE_ATTR_RO(uuid);
12241172

@@ -1228,7 +1176,7 @@ static ssize_t version_show(struct device *dev, struct device_attribute *a,
12281176
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12291177
u8 version = mei_me_cl_ver(cldev->me_cl);
12301178

1231-
return sprintf(buf, "%02X", version);
1179+
return sysfs_emit(buf, "%02X", version);
12321180
}
12331181
static DEVICE_ATTR_RO(version);
12341182

@@ -1239,8 +1187,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
12391187
const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
12401188
u8 version = mei_me_cl_ver(cldev->me_cl);
12411189

1242-
return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:%02X:",
1243-
cldev->name, uuid, version);
1190+
return sysfs_emit(buf, "mei:%s:%pUl:%02X:", cldev->name, uuid, version);
12441191
}
12451192
static DEVICE_ATTR_RO(modalias);
12461193

@@ -1250,7 +1197,7 @@ static ssize_t max_conn_show(struct device *dev, struct device_attribute *a,
12501197
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12511198
u8 maxconn = mei_me_cl_max_conn(cldev->me_cl);
12521199

1253-
return sprintf(buf, "%d", maxconn);
1200+
return sysfs_emit(buf, "%d", maxconn);
12541201
}
12551202
static DEVICE_ATTR_RO(max_conn);
12561203

@@ -1260,7 +1207,7 @@ static ssize_t fixed_show(struct device *dev, struct device_attribute *a,
12601207
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12611208
u8 fixed = mei_me_cl_fixed(cldev->me_cl);
12621209

1263-
return sprintf(buf, "%d", fixed);
1210+
return sysfs_emit(buf, "%d", fixed);
12641211
}
12651212
static DEVICE_ATTR_RO(fixed);
12661213

@@ -1270,7 +1217,7 @@ static ssize_t vtag_show(struct device *dev, struct device_attribute *a,
12701217
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12711218
bool vt = mei_me_cl_vt(cldev->me_cl);
12721219

1273-
return sprintf(buf, "%d", vt);
1220+
return sysfs_emit(buf, "%d", vt);
12741221
}
12751222
static DEVICE_ATTR_RO(vtag);
12761223

@@ -1280,7 +1227,7 @@ static ssize_t max_len_show(struct device *dev, struct device_attribute *a,
12801227
struct mei_cl_device *cldev = to_mei_cl_device(dev);
12811228
u32 maxlen = mei_me_cl_max_len(cldev->me_cl);
12821229

1283-
return sprintf(buf, "%u", maxlen);
1230+
return sysfs_emit(buf, "%u", maxlen);
12841231
}
12851232
static DEVICE_ATTR_RO(max_len);
12861233

@@ -1353,10 +1300,16 @@ static void mei_dev_bus_put(struct mei_device *bus)
13531300
static void mei_cl_bus_dev_release(struct device *dev)
13541301
{
13551302
struct mei_cl_device *cldev = to_mei_cl_device(dev);
1303+
struct mei_device *mdev = cldev->cl->dev;
1304+
struct mei_cl *cl;
13561305

13571306
mei_cl_flush_queues(cldev->cl, NULL);
13581307
mei_me_cl_put(cldev->me_cl);
13591308
mei_dev_bus_put(cldev->bus);
1309+
1310+
list_for_each_entry(cl, &mdev->file_list, link)
1311+
WARN_ON(cl == cldev->cl);
1312+
13601313
kfree(cldev->cl);
13611314
kfree(cldev);
13621315
}
@@ -1451,7 +1404,7 @@ static int mei_cl_bus_dev_add(struct mei_cl_device *cldev)
14511404
{
14521405
int ret;
14531406

1454-
dev_dbg(cldev->bus->dev, "adding %pUL:%02X\n",
1407+
dev_dbg(&cldev->dev, "adding %pUL:%02X\n",
14551408
mei_me_cl_uuid(cldev->me_cl),
14561409
mei_me_cl_ver(cldev->me_cl));
14571410
ret = device_add(&cldev->dev);

drivers/misc/mei/client.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -271,28 +271,6 @@ void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid)
271271
up_write(&dev->me_clients_rwsem);
272272
}
273273

274-
/**
275-
* mei_me_cl_rm_by_uuid_id - remove all me clients matching client id
276-
*
277-
* @dev: the device structure
278-
* @uuid: me client uuid
279-
* @id: me client id
280-
*
281-
* Locking: called under "dev->device_lock" lock
282-
*/
283-
void mei_me_cl_rm_by_uuid_id(struct mei_device *dev, const uuid_le *uuid, u8 id)
284-
{
285-
struct mei_me_client *me_cl;
286-
287-
dev_dbg(dev->dev, "remove %pUl %d\n", uuid, id);
288-
289-
down_write(&dev->me_clients_rwsem);
290-
me_cl = __mei_me_cl_by_uuid_id(dev, uuid, id);
291-
__mei_me_cl_del(dev, me_cl);
292-
mei_me_cl_put(me_cl);
293-
up_write(&dev->me_clients_rwsem);
294-
}
295-
296274
/**
297275
* mei_me_cl_rm_all - remove all me clients
298276
*

drivers/misc/mei/client.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ struct mei_me_client *mei_me_cl_by_id(struct mei_device *dev, u8 client_id);
2929
struct mei_me_client *mei_me_cl_by_uuid_id(struct mei_device *dev,
3030
const uuid_le *uuid, u8 client_id);
3131
void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid);
32-
void mei_me_cl_rm_by_uuid_id(struct mei_device *dev,
33-
const uuid_le *uuid, u8 id);
3432
void mei_me_cl_rm_all(struct mei_device *dev);
3533

3634
/**

drivers/misc/mei/hbm.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ int mei_hbm_cl_notify_req(struct mei_device *dev,
510510

511511
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
512512
if (ret)
513-
dev_err(dev->dev, "notify request failed: ret = %d\n", ret);
513+
cl_err(dev, cl, "notify request failed: ret = %d\n", ret);
514514

515515
return ret;
516516
}
@@ -626,7 +626,7 @@ int mei_hbm_cl_dma_map_req(struct mei_device *dev, struct mei_cl *cl)
626626

627627
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
628628
if (ret)
629-
dev_err(dev->dev, "dma map request failed: ret = %d\n", ret);
629+
cl_err(dev, cl, "dma map request failed: ret = %d\n", ret);
630630

631631
return ret;
632632
}
@@ -654,7 +654,7 @@ int mei_hbm_cl_dma_unmap_req(struct mei_device *dev, struct mei_cl *cl)
654654

655655
ret = mei_hbm_write_message(dev, &mei_hdr, &req);
656656
if (ret)
657-
dev_err(dev->dev, "dma unmap request failed: ret = %d\n", ret);
657+
cl_err(dev, cl, "dma unmap request failed: ret = %d\n", ret);
658658

659659
return ret;
660660
}
@@ -679,10 +679,10 @@ static void mei_hbm_cl_dma_map_res(struct mei_device *dev,
679679
return;
680680

681681
if (res->status) {
682-
dev_err(dev->dev, "cl dma map failed %d\n", res->status);
682+
cl_err(dev, cl, "cl dma map failed %d\n", res->status);
683683
cl->status = -EFAULT;
684684
} else {
685-
dev_dbg(dev->dev, "cl dma map succeeded\n");
685+
cl_dbg(dev, cl, "cl dma map succeeded\n");
686686
cl->dma_mapped = 1;
687687
cl->status = 0;
688688
}
@@ -709,10 +709,10 @@ static void mei_hbm_cl_dma_unmap_res(struct mei_device *dev,
709709
return;
710710

711711
if (res->status) {
712-
dev_err(dev->dev, "cl dma unmap failed %d\n", res->status);
712+
cl_err(dev, cl, "cl dma unmap failed %d\n", res->status);
713713
cl->status = -EFAULT;
714714
} else {
715-
dev_dbg(dev->dev, "cl dma unmap succeeded\n");
715+
cl_dbg(dev, cl, "cl dma unmap succeeded\n");
716716
cl->dma_mapped = 0;
717717
cl->status = 0;
718718
}

drivers/misc/mei/hw-me-regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117

118118
#define MEI_DEV_ID_LNL_M 0xA870 /* Lunar Lake Point M */
119119

120+
#define MEI_DEV_ID_PTL_H 0xE370 /* Panther Lake H */
120121
#define MEI_DEV_ID_PTL_P 0xE470 /* Panther Lake P */
121122

122123
/*

0 commit comments

Comments
 (0)