Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 's390-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Heiko Carstens:

- disable preemption when accessing local per-cpu variables in the new
counter set driver

- fix by a factor of four increased steal time due to missing
cputime_to_nsecs() conversion

- fix PCI device structure leak

* tag 's390-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/pci: fix leak of PCI device structure
s390/vtime: fix increased steal time accounting
s390/cpumf: disable preemption when accessing per-cpu variable

+36 -20
+1 -1
arch/s390/include/asm/pci.h
··· 202 202 ----------------------------------------------------------------------------- */ 203 203 /* Base stuff */ 204 204 int zpci_create_device(u32 fid, u32 fh, enum zpci_state state); 205 - void zpci_remove_device(struct zpci_dev *zdev); 205 + void zpci_remove_device(struct zpci_dev *zdev, bool set_error); 206 206 int zpci_enable_device(struct zpci_dev *); 207 207 int zpci_disable_device(struct zpci_dev *); 208 208 int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64);
+2 -1
arch/s390/kernel/perf_cpum_cf_diag.c
··· 968 968 */ 969 969 static size_t cf_diag_needspace(unsigned int sets) 970 970 { 971 - struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events); 971 + struct cpu_cf_events *cpuhw = get_cpu_ptr(&cpu_cf_events); 972 972 size_t bytes = 0; 973 973 int i; 974 974 ··· 984 984 sizeof(((struct s390_ctrset_cpudata *)0)->no_sets)); 985 985 debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__, 986 986 bytes); 987 + put_cpu_ptr(&cpu_cf_events); 987 988 return bytes; 988 989 } 989 990
+1 -1
arch/s390/kernel/vtime.c
··· 214 214 avg_steal = S390_lowcore.avg_steal_timer / 2; 215 215 if ((s64) steal > 0) { 216 216 S390_lowcore.steal_timer = 0; 217 - account_steal_time(steal); 217 + account_steal_time(cputime_to_nsecs(steal)); 218 218 avg_steal += steal; 219 219 } 220 220 S390_lowcore.avg_steal_timer = avg_steal;
+24 -4
arch/s390/pci/pci.c
··· 682 682 } 683 683 EXPORT_SYMBOL_GPL(zpci_disable_device); 684 684 685 - void zpci_remove_device(struct zpci_dev *zdev) 685 + /* zpci_remove_device - Removes the given zdev from the PCI core 686 + * @zdev: the zdev to be removed from the PCI core 687 + * @set_error: if true the device's error state is set to permanent failure 688 + * 689 + * Sets a zPCI device to a configured but offline state; the zPCI 690 + * device is still accessible through its hotplug slot and the zPCI 691 + * API but is removed from the common code PCI bus, making it 692 + * no longer available to drivers. 693 + */ 694 + void zpci_remove_device(struct zpci_dev *zdev, bool set_error) 686 695 { 687 696 struct zpci_bus *zbus = zdev->zbus; 688 697 struct pci_dev *pdev; 689 698 699 + if (!zdev->zbus->bus) 700 + return; 701 + 690 702 pdev = pci_get_slot(zbus->bus, zdev->devfn); 691 703 if (pdev) { 692 - if (pdev->is_virtfn) 693 - return zpci_iov_remove_virtfn(pdev, zdev->vfn); 704 + if (set_error) 705 + pdev->error_state = pci_channel_io_perm_failure; 706 + if (pdev->is_virtfn) { 707 + zpci_iov_remove_virtfn(pdev, zdev->vfn); 708 + /* balance pci_get_slot */ 709 + pci_dev_put(pdev); 710 + return; 711 + } 694 712 pci_stop_and_remove_bus_device_locked(pdev); 713 + /* balance pci_get_slot */ 714 + pci_dev_put(pdev); 695 715 } 696 716 } 697 717 ··· 785 765 struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); 786 766 787 767 if (zdev->zbus->bus) 788 - zpci_remove_device(zdev); 768 + zpci_remove_device(zdev, false); 789 769 790 770 switch (zdev->state) { 791 771 case ZPCI_FN_STATE_ONLINE:
+6 -12
arch/s390/pci/pci_event.c
··· 76 76 static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) 77 77 { 78 78 struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); 79 - struct pci_dev *pdev = NULL; 80 79 enum zpci_state state; 80 + struct pci_dev *pdev; 81 81 int ret; 82 - 83 - if (zdev && zdev->zbus->bus) 84 - pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); 85 82 86 83 zpci_err("avail CCDF:\n"); 87 84 zpci_err_hex(ccdf, sizeof(*ccdf)); ··· 121 124 case 0x0303: /* Deconfiguration requested */ 122 125 if (!zdev) 123 126 break; 124 - if (pdev) 125 - zpci_remove_device(zdev); 127 + zpci_remove_device(zdev, false); 126 128 127 129 ret = zpci_disable_device(zdev); 128 130 if (ret) ··· 136 140 case 0x0304: /* Configured -> Standby|Reserved */ 137 141 if (!zdev) 138 142 break; 139 - if (pdev) { 140 - /* Give the driver a hint that the function is 141 - * already unusable. */ 142 - pdev->error_state = pci_channel_io_perm_failure; 143 - zpci_remove_device(zdev); 144 - } 143 + /* Give the driver a hint that the function is 144 + * already unusable. 145 + */ 146 + zpci_remove_device(zdev, true); 145 147 146 148 zdev->fh = ccdf->fh; 147 149 zpci_disable_device(zdev);
+2 -1
drivers/pci/hotplug/s390_pci_hpc.c
··· 93 93 pci_dev_put(pdev); 94 94 return -EBUSY; 95 95 } 96 + pci_dev_put(pdev); 96 97 97 - zpci_remove_device(zdev); 98 + zpci_remove_device(zdev, false); 98 99 99 100 rc = zpci_disable_device(zdev); 100 101 if (rc)