Skip to content

Commit

Permalink
s390/pci: rename lock member in struct zpci_dev
Browse files Browse the repository at this point in the history
Since this guards only the Function Measurement Block, rename from
generic lock to fmb_lock in preparation to introduce another lock
that guards the state member

Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
  • Loading branch information
Gerd Bayer authored and Heiko Carstens committed Feb 20, 2024
1 parent 29f6fe1 commit 0d48566
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/s390/include/asm/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ struct zpci_dev {
u8 reserved : 2;
unsigned int devfn; /* DEVFN part of the RID*/

struct mutex lock;
u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */
u32 uid; /* user defined id */
u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */
Expand Down Expand Up @@ -170,6 +169,7 @@ struct zpci_dev {
u64 dma_mask; /* DMA address space mask */

/* Function measurement block */
struct mutex fmb_lock;
struct zpci_fmb *fmb;
u16 fmb_update; /* update interval */
u16 fmb_length;
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state)
zdev->state = state;

kref_init(&zdev->kref);
mutex_init(&zdev->lock);
mutex_init(&zdev->fmb_lock);
mutex_init(&zdev->kzdev_lock);

rc = zpci_init_iommu(zdev);
Expand Down
10 changes: 5 additions & 5 deletions arch/s390/pci/pci_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ static int pci_perf_show(struct seq_file *m, void *v)
if (!zdev)
return 0;

mutex_lock(&zdev->lock);
mutex_lock(&zdev->fmb_lock);
if (!zdev->fmb) {
mutex_unlock(&zdev->lock);
mutex_unlock(&zdev->fmb_lock);
seq_puts(m, "FMB statistics disabled\n");
return 0;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ static int pci_perf_show(struct seq_file *m, void *v)
}

pci_sw_counter_show(m);
mutex_unlock(&zdev->lock);
mutex_unlock(&zdev->fmb_lock);
return 0;
}

Expand All @@ -148,7 +148,7 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,
if (rc)
return rc;

mutex_lock(&zdev->lock);
mutex_lock(&zdev->fmb_lock);
switch (val) {
case 0:
rc = zpci_fmb_disable_device(zdev);
Expand All @@ -157,7 +157,7 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf,
rc = zpci_fmb_enable_device(zdev);
break;
}
mutex_unlock(&zdev->lock);
mutex_unlock(&zdev->fmb_lock);
return rc ? rc : count;
}

Expand Down

0 comments on commit 0d48566

Please sign in to comment.