Skip to content

Commit 0dbf877

Browse files
committed
Rebuild rocky8_10 with kernel-4.18.0-553.40.1.el8_10
Rebuild_History BUILDABLE Rebuilding Kernel from rpm changelog with Fuzz Limit: 87.50% Number of commits in upstream range v4.18~1..master: 524209 Number of commits in rpm: 17 Number of commits matched with upstream: 11 (64.71%) Number of commits in upstream but not in rpm: 524198 Number of commits NOT found in upstream: 6 (35.29%) Rebuilding Kernel on Branch rocky8_10_rebuild_kernel-4.18.0-553.40.1.el8_10 for kernel-4.18.0-553.40.1.el8_10 Clean Cherry Picks: 5 (45.45%) Empty Cherry Picks: 6 (54.55%) _______________________________ Full Details Located here: ciq/ciq_backports/kernel-4.18.0-553.40.1.el8_10/rebuild.details.txt Includes: * git commit header above * Empty Commits with upstream SHA * RPM ChangeLog Entries that could not be matched Individual Empty Commit failures contained in the same containing directory. The git message for empty commits will have the path for the failed commit. File names are the first 8 characters of the upstream SHA
1 parent 8643975 commit 0dbf877

18 files changed

+254
-49901
lines changed

Makefile.rhelver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RHEL_MINOR = 10
1212
#
1313
# Use this spot to avoid future merge conflicts.
1414
# Do not trim this comment.
15-
RHEL_RELEASE = 553.37.1
15+
RHEL_RELEASE = 553.40.1
1616

1717
#
1818
# ZSTREAM

arch/s390/include/asm/pci.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ struct zpci_bus {
108108
struct list_head resources;
109109
struct list_head bus_next;
110110
struct resource bus_resource;
111-
int pchid;
111+
int topo; /* TID if topo_is_tid, PCHID otherwise */
112112
int domain_nr;
113-
bool multifunction;
113+
u8 multifunction : 1;
114+
u8 topo_is_tid : 1;
114115
enum pci_bus_speed max_bus_speed;
115116
};
116117

@@ -129,6 +130,8 @@ struct zpci_dev {
129130
u16 vfn; /* virtual function number */
130131
u16 pchid; /* physical channel ID */
131132
u16 maxstbl; /* Maximum store block size */
133+
u16 rid; /* RID as supplied by firmware */
134+
u16 tid; /* Topology for which RID is valid */
132135
u8 pfgid; /* function group ID */
133136
u8 pft; /* pci function type */
134137
u8 port;
@@ -139,7 +142,8 @@ struct zpci_dev {
139142
u8 is_physfn : 1;
140143
u8 util_str_avail : 1;
141144
u8 irqs_registered : 1;
142-
u8 reserved : 2;
145+
u8 tid_avail : 1;
146+
u8 reserved : 1;
143147
unsigned int devfn; /* DEVFN part of the RID*/
144148

145149
struct mutex lock;
@@ -215,12 +219,14 @@ extern struct airq_iv *zpci_aif_sbv;
215219
----------------------------------------------------------------------------- */
216220
/* Base stuff */
217221
struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state);
222+
int zpci_add_device(struct zpci_dev *zdev);
218223
int zpci_enable_device(struct zpci_dev *);
219224
int zpci_disable_device(struct zpci_dev *);
220225
int zpci_scan_configured_device(struct zpci_dev *zdev, u32 fh);
221226
int zpci_deconfigure_device(struct zpci_dev *zdev);
222227
void zpci_device_reserved(struct zpci_dev *zdev);
223228
bool zpci_is_device_configured(struct zpci_dev *zdev);
229+
int zpci_scan_devices(void);
224230

225231
int zpci_hot_reset_device(struct zpci_dev *zdev);
226232
int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64, u8 *);
@@ -231,7 +237,7 @@ void zpci_update_fh(struct zpci_dev *zdev, u32 fh);
231237
/* CLP */
232238
int rhel8_clp_rescan_pci_devices_simple(void);
233239
int clp_setup_writeback_mio(void);
234-
int clp_scan_pci_devices(void);
240+
int clp_scan_pci_devices(struct list_head *scan_list);
235241
int clp_query_pci_fn(struct zpci_dev *zdev);
236242
int clp_enable_fh(struct zpci_dev *zdev, u32 *fh, u8 nr_dma_as);
237243
int clp_disable_fh(struct zpci_dev *zdev, u32 *fh);

arch/s390/include/asm/pci_clp.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ struct clp_req_query_pci {
107107
struct clp_rsp_query_pci {
108108
struct clp_rsp_hdr hdr;
109109
u16 vfn; /* virtual fn number */
110-
u16 : 3;
110+
u16 : 2;
111+
u16 tid_avail : 1;
111112
u16 rid_avail : 1;
112113
u16 is_physfn : 1;
113114
u16 reserved1 : 1;
@@ -127,8 +128,9 @@ struct clp_rsp_query_pci {
127128
u64 edma; /* end dma as */
128129
#define ZPCI_RID_MASK_DEVFN 0x00ff
129130
u16 rid; /* BUS/DEVFN PCI address */
130-
u16 reserved0;
131-
u32 reserved[10];
131+
u32 reserved0;
132+
u16 tid;
133+
u32 reserved[9];
132134
u32 uid; /* user defined id */
133135
u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */
134136
u32 reserved2[16];

arch/s390/pci/pci.c

Lines changed: 77 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/seq_file.h>
2828
#include <linux/jump_label.h>
2929
#include <linux/pci.h>
30+
#include <linux/list_sort.h>
3031

3132
#include <asm/isc.h>
3233
#include <asm/airq.h>
@@ -859,8 +860,9 @@ int zpci_hot_reset_device(struct zpci_dev *zdev)
859860
* @fh: Current Function Handle of the device to be created
860861
* @state: Initial state after creation either Standby or Configured
861862
*
862-
* Creates a new zpci device and adds it to its, possibly newly created, zbus
863-
* as well as zpci_list.
863+
* Allocates a new struct zpci_dev and queries the platform for its details.
864+
* If successful the device can subsequently be added to the zPCI subsystem
865+
* using zpci_add_device().
864866
*
865867
* Returns: the zdev on success or an error pointer otherwise
866868
*/
@@ -869,7 +871,6 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state)
869871
struct zpci_dev *zdev;
870872
int rc;
871873

872-
zpci_dbg(1, "add fid:%x, fh:%x, c:%d\n", fid, fh, state);
873874
zdev = kzalloc(sizeof(*zdev), GFP_KERNEL);
874875
if (!zdev)
875876
return ERR_PTR(-ENOMEM);
@@ -884,10 +885,33 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state)
884885
goto error;
885886
zdev->state = state;
886887

887-
kref_init(&zdev->kref);
888888
mutex_init(&zdev->lock);
889889
mutex_init(&zdev->kzdev_lock);
890890

891+
return zdev;
892+
893+
error:
894+
zpci_dbg(0, "crt fid:%x, rc:%d\n", fid, rc);
895+
kfree(zdev);
896+
return ERR_PTR(rc);
897+
}
898+
899+
/**
900+
* zpci_add_device() - Add a previously created zPCI device to the zPCI subsystem
901+
* @zdev: The zPCI device to be added
902+
*
903+
* A struct zpci_dev is added to the zPCI subsystem and to a virtual PCI bus creating
904+
* a new one as necessary. A hotplug slot is created and events start to be handled.
905+
* If successful from this point on zpci_zdev_get() and zpci_zdev_put() must be used.
906+
* If adding the struct zpci_dev fails the device was not added and should be freed.
907+
*
908+
* Return: 0 on success, or an error code otherwise
909+
*/
910+
int zpci_add_device(struct zpci_dev *zdev)
911+
{
912+
int rc;
913+
914+
zpci_dbg(1, "add fid:%x, fh:%x, c:%d\n", zdev->fid, zdev->fh, zdev->state);
891915
rc = zpci_init_iommu(zdev);
892916
if (rc)
893917
goto error;
@@ -896,18 +920,17 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state)
896920
if (rc)
897921
goto error_destroy_iommu;
898922

923+
kref_init(&zdev->kref);
899924
spin_lock(&zpci_list_lock);
900925
list_add_tail(&zdev->entry, &zpci_list);
901926
spin_unlock(&zpci_list_lock);
902-
903-
return zdev;
927+
return 0;
904928

905929
error_destroy_iommu:
906930
zpci_destroy_iommu(zdev);
907931
error:
908-
zpci_dbg(0, "add fid:%x, rc:%d\n", fid, rc);
909-
kfree(zdev);
910-
return ERR_PTR(rc);
932+
zpci_dbg(0, "add fid:%x, rc:%d\n", zdev->fid, rc);
933+
return rc;
911934
}
912935

913936
bool zpci_is_device_configured(struct zpci_dev *zdev)
@@ -1168,6 +1191,50 @@ bool zpci_is_enabled(void)
11681191
return s390_pci_initialized;
11691192
}
11701193

1194+
static int zpci_cmp_rid(void *priv, struct list_head *a,
1195+
struct list_head *b)
1196+
{
1197+
struct zpci_dev *za = container_of(a, struct zpci_dev, entry);
1198+
struct zpci_dev *zb = container_of(b, struct zpci_dev, entry);
1199+
1200+
/*
1201+
* PCI functions without RID available maintain original order
1202+
* between themselves but sort before those with RID.
1203+
*/
1204+
if (za->rid == zb->rid)
1205+
return za->rid_available > zb->rid_available;
1206+
/*
1207+
* PCI functions with RID sort by RID ascending.
1208+
*/
1209+
return za->rid > zb->rid;
1210+
}
1211+
1212+
static void zpci_add_devices(struct list_head *scan_list)
1213+
{
1214+
struct zpci_dev *zdev, *tmp;
1215+
1216+
list_sort(NULL, scan_list, &zpci_cmp_rid);
1217+
list_for_each_entry_safe(zdev, tmp, scan_list, entry) {
1218+
list_del_init(&zdev->entry);
1219+
if (zpci_add_device(zdev))
1220+
kfree(zdev);
1221+
}
1222+
}
1223+
1224+
int zpci_scan_devices(void)
1225+
{
1226+
LIST_HEAD(scan_list);
1227+
int rc;
1228+
1229+
rc = clp_scan_pci_devices(&scan_list);
1230+
if (rc)
1231+
return rc;
1232+
1233+
zpci_add_devices(&scan_list);
1234+
zpci_bus_scan_busses();
1235+
return 0;
1236+
}
1237+
11711238
static int __init pci_base_init(void)
11721239
{
11731240
int rc;
@@ -1201,10 +1268,9 @@ static int __init pci_base_init(void)
12011268
if (rc)
12021269
goto out_dma;
12031270

1204-
rc = clp_scan_pci_devices();
1271+
rc = zpci_scan_devices();
12051272
if (rc)
12061273
goto out_find;
1207-
zpci_bus_scan_busses();
12081274

12091275
s390_pci_initialized = 1;
12101276
return 0;

arch/s390/pci/pci_bus.c

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,16 @@ void zpci_bus_scan_busses(void)
173173
mutex_unlock(&zbus_list_lock);
174174
}
175175

176+
static bool zpci_bus_is_multifunction_root(struct zpci_dev *zdev)
177+
{
178+
return !s390_pci_no_rid && zdev->rid_available &&
179+
zpci_is_device_configured(zdev) &&
180+
!zdev->vfn;
181+
}
182+
176183
/* zpci_bus_create_pci_bus - Create the PCI bus associated with this zbus
177184
* @zbus: the zbus holding the zdevices
178-
* @fr: PCI root function that will determine the bus's domain, and bus speeed
185+
* @fr: PCI root function that will determine the bus's domain, and bus speed
179186
* @ops: the pci operations
180187
*
181188
* The PCI function @fr determines the domain (its UID), multifunction property
@@ -193,7 +200,7 @@ static int zpci_bus_create_pci_bus(struct zpci_bus *zbus, struct zpci_dev *fr, s
193200
return domain;
194201

195202
zbus->domain_nr = domain;
196-
zbus->multifunction = fr->rid_available;
203+
zbus->multifunction = zpci_bus_is_multifunction_root(fr);
197204
zbus->max_bus_speed = fr->max_bus_speed;
198205

199206
/*
@@ -237,13 +244,15 @@ static void zpci_bus_put(struct zpci_bus *zbus)
237244
kref_put(&zbus->kref, zpci_bus_release);
238245
}
239246

240-
static struct zpci_bus *zpci_bus_get(int pchid)
247+
static struct zpci_bus *zpci_bus_get(int topo, bool topo_is_tid)
241248
{
242249
struct zpci_bus *zbus;
243250

244251
mutex_lock(&zbus_list_lock);
245252
list_for_each_entry(zbus, &zbus_list, bus_next) {
246-
if (pchid == zbus->pchid) {
253+
if (!zbus->multifunction)
254+
continue;
255+
if (topo_is_tid == zbus->topo_is_tid && topo == zbus->topo) {
247256
kref_get(&zbus->kref);
248257
goto out_unlock;
249258
}
@@ -254,15 +263,16 @@ static struct zpci_bus *zpci_bus_get(int pchid)
254263
return zbus;
255264
}
256265

257-
static struct zpci_bus *zpci_bus_alloc(int pchid)
266+
static struct zpci_bus *zpci_bus_alloc(int topo, bool topo_is_tid)
258267
{
259268
struct zpci_bus *zbus;
260269

261270
zbus = kzalloc(sizeof(*zbus), GFP_KERNEL);
262271
if (!zbus)
263272
return NULL;
264273

265-
zbus->pchid = pchid;
274+
zbus->topo = topo;
275+
zbus->topo_is_tid = topo_is_tid;
266276
INIT_LIST_HEAD(&zbus->bus_next);
267277
mutex_lock(&zbus_list_lock);
268278
list_add_tail(&zbus->bus_next, &zbus_list);
@@ -297,19 +307,22 @@ static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev)
297307
{
298308
int rc = -EINVAL;
299309

310+
if (zbus->multifunction) {
311+
if (!zdev->rid_available) {
312+
WARN_ONCE(1, "rid_available not set for multifunction\n");
313+
return rc;
314+
}
315+
zdev->devfn = zdev->rid & ZPCI_RID_MASK_DEVFN;
316+
}
317+
300318
if (zbus->function[zdev->devfn]) {
301319
pr_err("devfn %04x is already assigned\n", zdev->devfn);
302320
return rc;
303321
}
304-
305322
zdev->zbus = zbus;
306323
zbus->function[zdev->devfn] = zdev;
307324
zpci_nb_devices++;
308325

309-
if (zbus->multifunction && !zdev->rid_available) {
310-
WARN_ONCE(1, "rid_available not set for multifunction\n");
311-
goto error;
312-
}
313326
rc = zpci_init_slot(zdev);
314327
if (rc)
315328
goto error;
@@ -326,23 +339,20 @@ static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev)
326339

327340
int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops)
328341
{
342+
bool topo_is_tid = zdev->tid_avail;
329343
struct zpci_bus *zbus = NULL;
330-
int rc = -EBADF;
344+
int topo, rc = -EBADF;
331345

332346
if (zpci_nb_devices == ZPCI_NR_DEVICES) {
333347
pr_warn("Adding PCI function %08x failed because the configured limit of %d is reached\n",
334348
zdev->fid, ZPCI_NR_DEVICES);
335349
return -ENOSPC;
336350
}
337351

338-
if (zdev->devfn >= ZPCI_FUNCTIONS_PER_BUS)
339-
return -EINVAL;
340-
341-
if (!s390_pci_no_rid && zdev->rid_available)
342-
zbus = zpci_bus_get(zdev->pchid);
343-
352+
topo = topo_is_tid ? zdev->tid : zdev->pchid;
353+
zbus = zpci_bus_get(topo, topo_is_tid);
344354
if (!zbus) {
345-
zbus = zpci_bus_alloc(zdev->pchid);
355+
zbus = zpci_bus_alloc(topo, topo_is_tid);
346356
if (!zbus)
347357
return -ENOMEM;
348358
}

0 commit comments

Comments
 (0)