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

Configure Feed

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

Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
"A set of small fixes mostly in the irq drivers area:

- Make the tango irq chip work correctly, which requires a new
function in the generiq irq chip implementation

- A set of updates to the GIC-V3 ITS driver removing a bogus BUG_ON()
and parsing the VCPU table size correctly"

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
genirq: generic chip: remove irq_gc_mask_disable_reg_and_ack()
irqchip/tango: Use irq_gc_mask_disable_and_ack_set
genirq: generic chip: Add irq_gc_mask_disable_and_ack_set()
irqchip/gic-v3-its: Add missing changes to support 52bit physical address
irqchip/gic-v3-its: Fix the incorrect parsing of VCPU table size
irqchip/gic-v3-its: Fix the incorrect BUG_ON in its_init_vpe_domain()
DT: arm,gic-v3: Update the ITS size in the examples

+52 -18
+3 -3
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt
··· 99 99 compatible = "arm,gic-v3-its"; 100 100 msi-controller; 101 101 #msi-cells = <1>; 102 - reg = <0x0 0x2c200000 0 0x200000>; 102 + reg = <0x0 0x2c200000 0 0x20000>; 103 103 }; 104 104 }; 105 105 ··· 124 124 compatible = "arm,gic-v3-its"; 125 125 msi-controller; 126 126 #msi-cells = <1>; 127 - reg = <0x0 0x2c200000 0 0x200000>; 127 + reg = <0x0 0x2c200000 0 0x20000>; 128 128 }; 129 129 130 130 gic-its@2c400000 { 131 131 compatible = "arm,gic-v3-its"; 132 132 msi-controller; 133 133 #msi-cells = <1>; 134 - reg = <0x0 0x2c400000 0 0x200000>; 134 + reg = <0x0 0x2c400000 0 0x20000>; 135 135 }; 136 136 137 137 ppi-partitions {
+33 -10
drivers/irqchip/irq-gic-v3-its.c
··· 107 107 108 108 #define ITS_ITT_ALIGN SZ_256 109 109 110 + /* The maximum number of VPEID bits supported by VLPI commands */ 111 + #define ITS_MAX_VPEID_BITS (16) 112 + #define ITS_MAX_VPEID (1 << (ITS_MAX_VPEID_BITS)) 113 + 110 114 /* Convert page order to size in bytes */ 111 115 #define PAGE_ORDER_TO_SIZE(o) (PAGE_SIZE << (o)) 112 116 ··· 312 308 313 309 static void its_encode_itt(struct its_cmd_block *cmd, u64 itt_addr) 314 310 { 315 - its_mask_encode(&cmd->raw_cmd[2], itt_addr >> 8, 50, 8); 311 + its_mask_encode(&cmd->raw_cmd[2], itt_addr >> 8, 51, 8); 316 312 } 317 313 318 314 static void its_encode_valid(struct its_cmd_block *cmd, int valid) ··· 322 318 323 319 static void its_encode_target(struct its_cmd_block *cmd, u64 target_addr) 324 320 { 325 - its_mask_encode(&cmd->raw_cmd[2], target_addr >> 16, 50, 16); 321 + its_mask_encode(&cmd->raw_cmd[2], target_addr >> 16, 51, 16); 326 322 } 327 323 328 324 static void its_encode_collection(struct its_cmd_block *cmd, u16 col) ··· 362 358 363 359 static void its_encode_vpt_addr(struct its_cmd_block *cmd, u64 vpt_pa) 364 360 { 365 - its_mask_encode(&cmd->raw_cmd[3], vpt_pa >> 16, 50, 16); 361 + its_mask_encode(&cmd->raw_cmd[3], vpt_pa >> 16, 51, 16); 366 362 } 367 363 368 364 static void its_encode_vpt_size(struct its_cmd_block *cmd, u8 vpt_size) ··· 1482 1478 u64 val = its_read_baser(its, baser); 1483 1479 u64 esz = GITS_BASER_ENTRY_SIZE(val); 1484 1480 u64 type = GITS_BASER_TYPE(val); 1481 + u64 baser_phys, tmp; 1485 1482 u32 alloc_pages; 1486 1483 void *base; 1487 - u64 tmp; 1488 1484 1489 1485 retry_alloc_baser: 1490 1486 alloc_pages = (PAGE_ORDER_TO_SIZE(order) / psz); ··· 1500 1496 if (!base) 1501 1497 return -ENOMEM; 1502 1498 1499 + baser_phys = virt_to_phys(base); 1500 + 1501 + /* Check if the physical address of the memory is above 48bits */ 1502 + if (IS_ENABLED(CONFIG_ARM64_64K_PAGES) && (baser_phys >> 48)) { 1503 + 1504 + /* 52bit PA is supported only when PageSize=64K */ 1505 + if (psz != SZ_64K) { 1506 + pr_err("ITS: no 52bit PA support when psz=%d\n", psz); 1507 + free_pages((unsigned long)base, order); 1508 + return -ENXIO; 1509 + } 1510 + 1511 + /* Convert 52bit PA to 48bit field */ 1512 + baser_phys = GITS_BASER_PHYS_52_to_48(baser_phys); 1513 + } 1514 + 1503 1515 retry_baser: 1504 - val = (virt_to_phys(base) | 1516 + val = (baser_phys | 1505 1517 (type << GITS_BASER_TYPE_SHIFT) | 1506 1518 ((esz - 1) << GITS_BASER_ENTRY_SIZE_SHIFT) | 1507 1519 ((alloc_pages - 1) << GITS_BASER_PAGES_SHIFT) | ··· 1602 1582 1603 1583 static bool its_parse_indirect_baser(struct its_node *its, 1604 1584 struct its_baser *baser, 1605 - u32 psz, u32 *order) 1585 + u32 psz, u32 *order, u32 ids) 1606 1586 { 1607 1587 u64 tmp = its_read_baser(its, baser); 1608 1588 u64 type = GITS_BASER_TYPE(tmp); 1609 1589 u64 esz = GITS_BASER_ENTRY_SIZE(tmp); 1610 1590 u64 val = GITS_BASER_InnerShareable | GITS_BASER_RaWaWb; 1611 - u32 ids = its->device_ids; 1612 1591 u32 new_order = *order; 1613 1592 bool indirect = false; 1614 1593 ··· 1699 1680 continue; 1700 1681 1701 1682 case GITS_BASER_TYPE_DEVICE: 1683 + indirect = its_parse_indirect_baser(its, baser, 1684 + psz, &order, 1685 + its->device_ids); 1702 1686 case GITS_BASER_TYPE_VCPU: 1703 1687 indirect = its_parse_indirect_baser(its, baser, 1704 - psz, &order); 1688 + psz, &order, 1689 + ITS_MAX_VPEID_BITS); 1705 1690 break; 1706 1691 } 1707 1692 ··· 2574 2551 2575 2552 static int its_vpe_id_alloc(void) 2576 2553 { 2577 - return ida_simple_get(&its_vpeid_ida, 0, 1 << 16, GFP_KERNEL); 2554 + return ida_simple_get(&its_vpeid_ida, 0, ITS_MAX_VPEID, GFP_KERNEL); 2578 2555 } 2579 2556 2580 2557 static void its_vpe_id_free(u16 id) ··· 2874 2851 return -ENOMEM; 2875 2852 } 2876 2853 2877 - BUG_ON(entries != vpe_proxy.dev->nr_ites); 2854 + BUG_ON(entries > vpe_proxy.dev->nr_ites); 2878 2855 2879 2856 raw_spin_lock_init(&vpe_proxy.lock); 2880 2857 vpe_proxy.next_victim = 0;
+1 -1
drivers/irqchip/irq-tango.c
··· 141 141 for (i = 0; i < 2; i++) { 142 142 ct[i].chip.irq_ack = irq_gc_ack_set_bit; 143 143 ct[i].chip.irq_mask = irq_gc_mask_disable_reg; 144 - ct[i].chip.irq_mask_ack = irq_gc_mask_disable_reg_and_ack; 144 + ct[i].chip.irq_mask_ack = irq_gc_mask_disable_and_ack_set; 145 145 ct[i].chip.irq_unmask = irq_gc_unmask_enable_reg; 146 146 ct[i].chip.irq_set_type = tangox_irq_set_type; 147 147 ct[i].chip.name = gc->domain->name;
+1 -1
include/linux/irq.h
··· 1009 1009 void irq_gc_unmask_enable_reg(struct irq_data *d); 1010 1010 void irq_gc_ack_set_bit(struct irq_data *d); 1011 1011 void irq_gc_ack_clr_bit(struct irq_data *d); 1012 - void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); 1012 + void irq_gc_mask_disable_and_ack_set(struct irq_data *d); 1013 1013 void irq_gc_eoi(struct irq_data *d); 1014 1014 int irq_gc_set_wake(struct irq_data *d, unsigned int on); 1015 1015
+2
include/linux/irqchip/arm-gic-v3.h
··· 372 372 #define GITS_BASER_ENTRY_SIZE_SHIFT (48) 373 373 #define GITS_BASER_ENTRY_SIZE(r) ((((r) >> GITS_BASER_ENTRY_SIZE_SHIFT) & 0x1f) + 1) 374 374 #define GITS_BASER_ENTRY_SIZE_MASK GENMASK_ULL(52, 48) 375 + #define GITS_BASER_PHYS_52_to_48(phys) \ 376 + (((phys) & GENMASK_ULL(47, 16)) | (((phys) >> 48) & 0xf) << 12) 375 377 #define GITS_BASER_SHAREABILITY_SHIFT (10) 376 378 #define GITS_BASER_InnerShareable \ 377 379 GIC_BASER_SHAREABILITY(GITS_BASER, InnerShareable)
+12 -3
kernel/irq/generic-chip.c
··· 135 135 } 136 136 137 137 /** 138 - * irq_gc_mask_disable_reg_and_ack - Mask and ack pending interrupt 138 + * irq_gc_mask_disable_and_ack_set - Mask and ack pending interrupt 139 139 * @d: irq_data 140 + * 141 + * This generic implementation of the irq_mask_ack method is for chips 142 + * with separate enable/disable registers instead of a single mask 143 + * register and where a pending interrupt is acknowledged by setting a 144 + * bit. 145 + * 146 + * Note: This is the only permutation currently used. Similar generic 147 + * functions should be added here if other permutations are required. 140 148 */ 141 - void irq_gc_mask_disable_reg_and_ack(struct irq_data *d) 149 + void irq_gc_mask_disable_and_ack_set(struct irq_data *d) 142 150 { 143 151 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 144 152 struct irq_chip_type *ct = irq_data_get_chip_type(d); 145 153 u32 mask = d->mask; 146 154 147 155 irq_gc_lock(gc); 148 - irq_reg_writel(gc, mask, ct->regs.mask); 156 + irq_reg_writel(gc, mask, ct->regs.disable); 157 + *ct->mask_cache &= ~mask; 149 158 irq_reg_writel(gc, mask, ct->regs.ack); 150 159 irq_gc_unlock(gc); 151 160 }