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

Merge tag 'powerpc-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix build error in vdso32 when building 64-bit with COMPAT=y and -Os

- Fix build error in pseries EEH when CONFIG_DEBUG_FS is not set

Thanks to Christophe Leroy, Narayana Murty N, Christian Zigotzky, and
Ritesh Harjani.

* tag 'powerpc-6.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/pseries/eeh: move pseries_eeh_err_inject() outside CONFIG_DEBUG_FS block
powerpc/vdso32: Fix use of crtsavres for PPC64

+100 -100
+99 -99
arch/powerpc/kernel/eeh.c
··· 1574 1574 } 1575 1575 #endif /* CONFIG_PROC_FS */ 1576 1576 1577 + static int eeh_break_device(struct pci_dev *pdev) 1578 + { 1579 + struct resource *bar = NULL; 1580 + void __iomem *mapped; 1581 + u16 old, bit; 1582 + int i, pos; 1583 + 1584 + /* Do we have an MMIO BAR to disable? */ 1585 + for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { 1586 + struct resource *r = &pdev->resource[i]; 1587 + 1588 + if (!r->flags || !r->start) 1589 + continue; 1590 + if (r->flags & IORESOURCE_IO) 1591 + continue; 1592 + if (r->flags & IORESOURCE_UNSET) 1593 + continue; 1594 + 1595 + bar = r; 1596 + break; 1597 + } 1598 + 1599 + if (!bar) { 1600 + pci_err(pdev, "Unable to find Memory BAR to cause EEH with\n"); 1601 + return -ENXIO; 1602 + } 1603 + 1604 + pci_err(pdev, "Going to break: %pR\n", bar); 1605 + 1606 + if (pdev->is_virtfn) { 1607 + #ifndef CONFIG_PCI_IOV 1608 + return -ENXIO; 1609 + #else 1610 + /* 1611 + * VFs don't have a per-function COMMAND register, so the best 1612 + * we can do is clear the Memory Space Enable bit in the PF's 1613 + * SRIOV control reg. 1614 + * 1615 + * Unfortunately, this requires that we have a PF (i.e doesn't 1616 + * work for a passed-through VF) and it has the potential side 1617 + * effect of also causing an EEH on every other VF under the 1618 + * PF. Oh well. 1619 + */ 1620 + pdev = pdev->physfn; 1621 + if (!pdev) 1622 + return -ENXIO; /* passed through VFs have no PF */ 1623 + 1624 + pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); 1625 + pos += PCI_SRIOV_CTRL; 1626 + bit = PCI_SRIOV_CTRL_MSE; 1627 + #endif /* !CONFIG_PCI_IOV */ 1628 + } else { 1629 + bit = PCI_COMMAND_MEMORY; 1630 + pos = PCI_COMMAND; 1631 + } 1632 + 1633 + /* 1634 + * Process here is: 1635 + * 1636 + * 1. Disable Memory space. 1637 + * 1638 + * 2. Perform an MMIO to the device. This should result in an error 1639 + * (CA / UR) being raised by the device which results in an EEH 1640 + * PE freeze. Using the in_8() accessor skips the eeh detection hook 1641 + * so the freeze hook so the EEH Detection machinery won't be 1642 + * triggered here. This is to match the usual behaviour of EEH 1643 + * where the HW will asynchronously freeze a PE and it's up to 1644 + * the kernel to notice and deal with it. 1645 + * 1646 + * 3. Turn Memory space back on. This is more important for VFs 1647 + * since recovery will probably fail if we don't. For normal 1648 + * the COMMAND register is reset as a part of re-initialising 1649 + * the device. 1650 + * 1651 + * Breaking stuff is the point so who cares if it's racy ;) 1652 + */ 1653 + pci_read_config_word(pdev, pos, &old); 1654 + 1655 + mapped = ioremap(bar->start, PAGE_SIZE); 1656 + if (!mapped) { 1657 + pci_err(pdev, "Unable to map MMIO BAR %pR\n", bar); 1658 + return -ENXIO; 1659 + } 1660 + 1661 + pci_write_config_word(pdev, pos, old & ~bit); 1662 + in_8(mapped); 1663 + pci_write_config_word(pdev, pos, old); 1664 + 1665 + iounmap(mapped); 1666 + 1667 + return 0; 1668 + } 1669 + 1670 + int eeh_pe_inject_mmio_error(struct pci_dev *pdev) 1671 + { 1672 + return eeh_break_device(pdev); 1673 + } 1674 + 1577 1675 #ifdef CONFIG_DEBUG_FS 1578 1676 1579 1677 ··· 1823 1725 .read = eeh_debugfs_dev_usage, 1824 1726 }; 1825 1727 1826 - static int eeh_debugfs_break_device(struct pci_dev *pdev) 1827 - { 1828 - struct resource *bar = NULL; 1829 - void __iomem *mapped; 1830 - u16 old, bit; 1831 - int i, pos; 1832 - 1833 - /* Do we have an MMIO BAR to disable? */ 1834 - for (i = 0; i <= PCI_STD_RESOURCE_END; i++) { 1835 - struct resource *r = &pdev->resource[i]; 1836 - 1837 - if (!r->flags || !r->start) 1838 - continue; 1839 - if (r->flags & IORESOURCE_IO) 1840 - continue; 1841 - if (r->flags & IORESOURCE_UNSET) 1842 - continue; 1843 - 1844 - bar = r; 1845 - break; 1846 - } 1847 - 1848 - if (!bar) { 1849 - pci_err(pdev, "Unable to find Memory BAR to cause EEH with\n"); 1850 - return -ENXIO; 1851 - } 1852 - 1853 - pci_err(pdev, "Going to break: %pR\n", bar); 1854 - 1855 - if (pdev->is_virtfn) { 1856 - #ifndef CONFIG_PCI_IOV 1857 - return -ENXIO; 1858 - #else 1859 - /* 1860 - * VFs don't have a per-function COMMAND register, so the best 1861 - * we can do is clear the Memory Space Enable bit in the PF's 1862 - * SRIOV control reg. 1863 - * 1864 - * Unfortunately, this requires that we have a PF (i.e doesn't 1865 - * work for a passed-through VF) and it has the potential side 1866 - * effect of also causing an EEH on every other VF under the 1867 - * PF. Oh well. 1868 - */ 1869 - pdev = pdev->physfn; 1870 - if (!pdev) 1871 - return -ENXIO; /* passed through VFs have no PF */ 1872 - 1873 - pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_SRIOV); 1874 - pos += PCI_SRIOV_CTRL; 1875 - bit = PCI_SRIOV_CTRL_MSE; 1876 - #endif /* !CONFIG_PCI_IOV */ 1877 - } else { 1878 - bit = PCI_COMMAND_MEMORY; 1879 - pos = PCI_COMMAND; 1880 - } 1881 - 1882 - /* 1883 - * Process here is: 1884 - * 1885 - * 1. Disable Memory space. 1886 - * 1887 - * 2. Perform an MMIO to the device. This should result in an error 1888 - * (CA / UR) being raised by the device which results in an EEH 1889 - * PE freeze. Using the in_8() accessor skips the eeh detection hook 1890 - * so the freeze hook so the EEH Detection machinery won't be 1891 - * triggered here. This is to match the usual behaviour of EEH 1892 - * where the HW will asynchronously freeze a PE and it's up to 1893 - * the kernel to notice and deal with it. 1894 - * 1895 - * 3. Turn Memory space back on. This is more important for VFs 1896 - * since recovery will probably fail if we don't. For normal 1897 - * the COMMAND register is reset as a part of re-initialising 1898 - * the device. 1899 - * 1900 - * Breaking stuff is the point so who cares if it's racy ;) 1901 - */ 1902 - pci_read_config_word(pdev, pos, &old); 1903 - 1904 - mapped = ioremap(bar->start, PAGE_SIZE); 1905 - if (!mapped) { 1906 - pci_err(pdev, "Unable to map MMIO BAR %pR\n", bar); 1907 - return -ENXIO; 1908 - } 1909 - 1910 - pci_write_config_word(pdev, pos, old & ~bit); 1911 - in_8(mapped); 1912 - pci_write_config_word(pdev, pos, old); 1913 - 1914 - iounmap(mapped); 1915 - 1916 - return 0; 1917 - } 1918 - 1919 1728 static ssize_t eeh_dev_break_write(struct file *filp, 1920 1729 const char __user *user_buf, 1921 1730 size_t count, loff_t *ppos) ··· 1834 1829 if (IS_ERR(pdev)) 1835 1830 return PTR_ERR(pdev); 1836 1831 1837 - ret = eeh_debugfs_break_device(pdev); 1832 + ret = eeh_break_device(pdev); 1838 1833 pci_dev_put(pdev); 1839 1834 1840 1835 if (ret < 0) ··· 1848 1843 .write = eeh_dev_break_write, 1849 1844 .read = eeh_debugfs_dev_usage, 1850 1845 }; 1851 - 1852 - int eeh_pe_inject_mmio_error(struct pci_dev *pdev) 1853 - { 1854 - return eeh_debugfs_break_device(pdev); 1855 - } 1856 1846 1857 1847 static ssize_t eeh_dev_can_recover(struct file *filp, 1858 1848 const char __user *user_buf,
+1 -1
arch/powerpc/lib/crtsavres.S
··· 46 46 47 47 .section ".text" 48 48 49 - #ifndef CONFIG_PPC64 49 + #ifndef __powerpc64__ 50 50 51 51 /* Routines for saving integer registers, called by the compiler. */ 52 52 /* Called with r11 pointing to the stack header word of the caller of the */