LoongArch fixes for v6.19-rc6
-----BEGIN PGP SIGNATURE----- iQJKBAABCAA0FiEEzOlt8mkP+tbeiYy5AoYrw/LiJnoFAmlq+z4WHGNoZW5odWFj YWlAa2VybmVsLm9yZwAKCRAChivD8uImeuiPEACvL76/lHI+5aww1PfokzjCdQYk /ked1m/3BmLhufqFvLDhraLTA/6rFF7j2KdHm2RESIS6bk/YaN7RMh9iAGpN+APu /pF0ppPMPuvpJGdWuWSPvTdwCMuA5ksvMl+CPRthSYqsQ42d1h5alirWOkbtLTW7 EMmgnMZAL6VHnyiWHjMn86BCkvC/2DHyvtC7WsMh1LNa6Cqlcu/sxaMC73sBf9qZ FbB5dziLXjpkJp7QIJH0KbrRhtw8CzCbW4xuwJO2u/dR+9Xl3LT9HD8/aYa11aXE Q9QW3M7d1h8+cJIbdrTjLqSCV49hwPC4YpA5d4ElFcJJF68gpMfBs+ZLzLc5OkK3 mapw0dMWlXbkOEAC0dq0NIf3jpIgVdlaZQcC6jFNNiAgWnQv+qqfvvtw7A/bK3K+ xwM+wcSpMe0zEmxFKz4xhDJ3PdMvgyrSBkcItgcdiEd107fLskYHuMUzHPMwh6oA uGJ+4u0sCXLFubhjhkQGgTyUbk/cgOBcCAnqv0gTQfcTdF0fCLuSFcpUjtunq9wu AqKxr3kA4YkMW7uG2pliCJyUL1/jV2kIMhekxJN2Q8WQPhZ6antSUQhJZDOl8xj2 QRaoprMZ/uUmH2vMmGMiO+7TTglDH8DrkVWdqo4kxZjvnIcXzkBs0bAvFdzo3mlS Mozpbd+D8LdURSMjhA== =0h8y -----END PGP SIGNATURE----- Merge tag 'loongarch-fixes-6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson Pull LoongArch fixes from Huacai Chen: "Remove redundant code in head.S, fix PMU counter allocation for mixed- type event groups, fix a lot of dts build warnings, and fix kvm_device memory leaks" * tag 'loongarch-fixes-6.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: KVM: Fix kvm_device leak in kvm_pch_pic_destroy() LoongArch: KVM: Fix kvm_device leak in kvm_eiointc_destroy() LoongArch: KVM: Fix kvm_device leak in kvm_ipi_destroy() LoongArch: dts: loongson-2k1000: Fix i2c-gpio node names LoongArch: dts: loongson-2k2000: Add default interrupt controller address cells LoongArch: dts: loongson-2k1000: Add default interrupt controller address cells LoongArch: dts: loongson-2k0500: Add default interrupt controller address cells LoongArch: dts: Describe PCI sideband IRQ through interrupt-extended LoongArch: Fix PMU counter allocation for mixed-type event groups LoongArch: Remove redundant code in head.S
This commit is contained in:
commit
47622aa8b6
|
|
@ -131,6 +131,7 @@
|
|||
reg-names = "main", "isr0";
|
||||
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <2>;
|
||||
|
|
@ -149,6 +150,7 @@
|
|||
reg-names = "main", "isr0";
|
||||
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <4>;
|
||||
|
|
@ -164,6 +166,7 @@
|
|||
compatible = "loongson,ls2k0500-eiointc";
|
||||
reg = <0x0 0x1fe11600 0x0 0xea00>;
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <3>;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
};
|
||||
|
||||
/* i2c of the dvi eeprom edid */
|
||||
i2c-gpio-0 {
|
||||
i2c-0 {
|
||||
compatible = "i2c-gpio";
|
||||
scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
};
|
||||
|
||||
/* i2c of the eeprom edid */
|
||||
i2c-gpio-1 {
|
||||
i2c-1 {
|
||||
compatible = "i2c-gpio";
|
||||
scl-gpios = <&gpio0 33 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
sda-gpios = <&gpio0 32 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
|
||||
|
|
@ -114,6 +114,7 @@
|
|||
<0x0 0x1fe01140 0x0 0x8>;
|
||||
reg-names = "main", "isr0", "isr1";
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <2>;
|
||||
|
|
@ -131,6 +132,7 @@
|
|||
<0x0 0x1fe01148 0x0 0x8>;
|
||||
reg-names = "main", "isr0", "isr1";
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <3>;
|
||||
|
|
@ -437,54 +439,47 @@
|
|||
|
||||
gmac0: ethernet@3,0 {
|
||||
reg = <0x1800 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc0 12 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<&liointc0 13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "macirq", "eth_lpi";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gmac1: ethernet@3,1 {
|
||||
reg = <0x1900 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<15 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc0 14 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<&liointc0 15 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "macirq", "eth_lpi";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ehci0: usb@4,1 {
|
||||
reg = <0x2100 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc1>;
|
||||
interrupts = <18 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc1 18 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ohci0: usb@4,2 {
|
||||
reg = <0x2200 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc1>;
|
||||
interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc1 19 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
display@6,0 {
|
||||
reg = <0x3000 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc0 28 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
hda@7,0 {
|
||||
reg = <0x3800 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <4 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc0 4 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sata: sata@8,0 {
|
||||
reg = <0x4000 0x0 0x0 0x0 0x0>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&liointc0 19 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@
|
|||
reg = <0x0 0x1fe01400 0x0 0x64>;
|
||||
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <2>;
|
||||
|
|
@ -140,6 +141,7 @@
|
|||
compatible = "loongson,ls2k2000-eiointc";
|
||||
reg = <0x0 0x1fe01600 0x0 0xea00>;
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <1>;
|
||||
interrupt-parent = <&cpuintc>;
|
||||
interrupts = <3>;
|
||||
|
|
@ -149,6 +151,7 @@
|
|||
compatible = "loongson,pch-pic-1.0";
|
||||
reg = <0x0 0x10000000 0x0 0x400>;
|
||||
interrupt-controller;
|
||||
#address-cells = <0>;
|
||||
#interrupt-cells = <2>;
|
||||
loongson,pic-base-vec = <0>;
|
||||
interrupt-parent = <&eiointc>;
|
||||
|
|
@ -291,65 +294,57 @@
|
|||
|
||||
gmac0: ethernet@3,0 {
|
||||
reg = <0x1800 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&pic 12 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<&pic 13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "macirq", "eth_lpi";
|
||||
interrupt-parent = <&pic>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gmac1: ethernet@3,1 {
|
||||
reg = <0x1900 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<15 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&pic 14 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<&pic 15 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "macirq", "eth_lpi";
|
||||
interrupt-parent = <&pic>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gmac2: ethernet@3,2 {
|
||||
reg = <0x1a00 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<18 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&pic 17 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<&pic 18 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "macirq", "eth_lpi";
|
||||
interrupt-parent = <&pic>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
xhci0: usb@4,0 {
|
||||
reg = <0x2000 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <48 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts-extended = <&pic 48 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
xhci1: usb@19,0 {
|
||||
reg = <0xc800 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts-extended = <&pic 22 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
display@6,1 {
|
||||
reg = <0x3100 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts-extended = <&pic 28 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
i2s@7,0 {
|
||||
reg = <0x3800 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <78 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<79 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupts-extended = <&pic 78 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<&pic 79 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "tx", "rx";
|
||||
interrupt-parent = <&pic>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
sata: sata@8,0 {
|
||||
reg = <0x4000 0x0 0x0 0x0 0x0>;
|
||||
interrupts = <16 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts-extended = <&pic 16 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -126,14 +126,6 @@ SYM_CODE_START(smpboot_entry)
|
|||
LONG_LI t1, CSR_STFILL
|
||||
csrxchg t0, t1, LOONGARCH_CSR_IMPCTL1
|
||||
#endif
|
||||
/* Enable PG */
|
||||
li.w t0, 0xb0 # PLV=0, IE=0, PG=1
|
||||
csrwr t0, LOONGARCH_CSR_CRMD
|
||||
li.w t0, 0x04 # PLV=0, PIE=1, PWE=0
|
||||
csrwr t0, LOONGARCH_CSR_PRMD
|
||||
li.w t0, 0x00 # FPE=0, SXE=0, ASXE=0, BTE=0
|
||||
csrwr t0, LOONGARCH_CSR_EUEN
|
||||
|
||||
la.pcrel t0, cpuboot_data
|
||||
ld.d sp, t0, CPU_BOOT_STACK
|
||||
ld.d tp, t0, CPU_BOOT_TINFO
|
||||
|
|
|
|||
|
|
@ -626,6 +626,18 @@ static const struct loongarch_perf_event *loongarch_pmu_map_cache_event(u64 conf
|
|||
return pev;
|
||||
}
|
||||
|
||||
static inline bool loongarch_pmu_event_requires_counter(const struct perf_event *event)
|
||||
{
|
||||
switch (event->attr.type) {
|
||||
case PERF_TYPE_HARDWARE:
|
||||
case PERF_TYPE_HW_CACHE:
|
||||
case PERF_TYPE_RAW:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static int validate_group(struct perf_event *event)
|
||||
{
|
||||
struct cpu_hw_events fake_cpuc;
|
||||
|
|
@ -633,15 +645,18 @@ static int validate_group(struct perf_event *event)
|
|||
|
||||
memset(&fake_cpuc, 0, sizeof(fake_cpuc));
|
||||
|
||||
if (loongarch_pmu_alloc_counter(&fake_cpuc, &leader->hw) < 0)
|
||||
if (loongarch_pmu_event_requires_counter(leader) &&
|
||||
loongarch_pmu_alloc_counter(&fake_cpuc, &leader->hw) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
for_each_sibling_event(sibling, leader) {
|
||||
if (loongarch_pmu_alloc_counter(&fake_cpuc, &sibling->hw) < 0)
|
||||
if (loongarch_pmu_event_requires_counter(sibling) &&
|
||||
loongarch_pmu_alloc_counter(&fake_cpuc, &sibling->hw) < 0)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (loongarch_pmu_alloc_counter(&fake_cpuc, &event->hw) < 0)
|
||||
if (loongarch_pmu_event_requires_counter(event) &&
|
||||
loongarch_pmu_alloc_counter(&fake_cpuc, &event->hw) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -679,6 +679,7 @@ static void kvm_eiointc_destroy(struct kvm_device *dev)
|
|||
kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &eiointc->device);
|
||||
kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &eiointc->device_vext);
|
||||
kfree(eiointc);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static struct kvm_device_ops kvm_eiointc_dev_ops = {
|
||||
|
|
|
|||
|
|
@ -459,6 +459,7 @@ static void kvm_ipi_destroy(struct kvm_device *dev)
|
|||
ipi = kvm->arch.ipi;
|
||||
kvm_io_bus_unregister_dev(kvm, KVM_IOCSR_BUS, &ipi->device);
|
||||
kfree(ipi);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static struct kvm_device_ops kvm_ipi_dev_ops = {
|
||||
|
|
|
|||
|
|
@ -475,6 +475,7 @@ static void kvm_pch_pic_destroy(struct kvm_device *dev)
|
|||
/* unregister pch pic device and free it's memory */
|
||||
kvm_io_bus_unregister_dev(kvm, KVM_MMIO_BUS, &s->device);
|
||||
kfree(s);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
static struct kvm_device_ops kvm_pch_pic_dev_ops = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue