arch/powerpc/platforms/powernv/eeh-powernv.c:1454:12: error: stack frame size of 3024 bytes in function 'pnv_eeh_next_error'

From: kernel test robot
Date: Sun May 02 2021 - 23:38:36 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9ccce092fc64d19504fa54de4fd659e279cc92e7
commit: 3b70464aa78917e88c1d4bfc2100c344c0eda8e0 powerpc/powernv: Staticify functions without prototypes
date: 8 months ago
config: powerpc64-randconfig-r026-20210430 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8f5a2a5836cc8e4c1def2bdeb022e7b496623439)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3b70464aa78917e88c1d4bfc2100c344c0eda8e0
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 3b70464aa78917e88c1d4bfc2100c344c0eda8e0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

>> arch/powerpc/platforms/powernv/eeh-powernv.c:1454:12: error: stack frame size of 3024 bytes in function 'pnv_eeh_next_error' [-Werror,-Wframe-larger-than=]
static int pnv_eeh_next_error(struct eeh_pe **pe)
^
1 error generated.


vim +/pnv_eeh_next_error +1454 arch/powerpc/platforms/powernv/eeh-powernv.c

2a485ad7c88ddf Gavin Shan 2015-02-16 1443
29310e5e860697 Gavin Shan 2013-06-20 1444 /**
01f3bfb7804ae2 Gavin Shan 2015-02-16 1445 * pnv_eeh_next_error - Retrieve next EEH error to handle
29310e5e860697 Gavin Shan 2013-06-20 1446 * @pe: Affected PE
29310e5e860697 Gavin Shan 2013-06-20 1447 *
2a485ad7c88ddf Gavin Shan 2015-02-16 1448 * The function is expected to be called by EEH core while it gets
2a485ad7c88ddf Gavin Shan 2015-02-16 1449 * special EEH event (without binding PE). The function calls to
2a485ad7c88ddf Gavin Shan 2015-02-16 1450 * OPAL APIs for next error to handle. The informational error is
2a485ad7c88ddf Gavin Shan 2015-02-16 1451 * handled internally by platform. However, the dead IOC, dead PHB,
2a485ad7c88ddf Gavin Shan 2015-02-16 1452 * fenced PHB and frozen PE should be handled by EEH core eventually.
29310e5e860697 Gavin Shan 2013-06-20 1453 */
01f3bfb7804ae2 Gavin Shan 2015-02-16 @1454 static int pnv_eeh_next_error(struct eeh_pe **pe)
29310e5e860697 Gavin Shan 2013-06-20 1455 {
29310e5e860697 Gavin Shan 2013-06-20 1456 struct pci_controller *hose;
2a485ad7c88ddf Gavin Shan 2015-02-16 1457 struct pnv_phb *phb;
2a485ad7c88ddf Gavin Shan 2015-02-16 1458 struct eeh_pe *phb_pe, *parent_pe;
2a485ad7c88ddf Gavin Shan 2015-02-16 1459 __be64 frozen_pe_no;
2a485ad7c88ddf Gavin Shan 2015-02-16 1460 __be16 err_type, severity;
2a485ad7c88ddf Gavin Shan 2015-02-16 1461 long rc;
2a485ad7c88ddf Gavin Shan 2015-02-16 1462 int state, ret = EEH_NEXT_ERR_NONE;
2a485ad7c88ddf Gavin Shan 2015-02-16 1463
2a485ad7c88ddf Gavin Shan 2015-02-16 1464 /*
79231448c929cc Alistair Popple 2015-05-15 1465 * While running here, it's safe to purge the event queue. The
79231448c929cc Alistair Popple 2015-05-15 1466 * event should still be masked.
2a485ad7c88ddf Gavin Shan 2015-02-16 1467 */
2a485ad7c88ddf Gavin Shan 2015-02-16 1468 eeh_remove_event(NULL, false);
29310e5e860697 Gavin Shan 2013-06-20 1469
29310e5e860697 Gavin Shan 2013-06-20 1470 list_for_each_entry(hose, &hose_list, list_node) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1471 /*
2a485ad7c88ddf Gavin Shan 2015-02-16 1472 * If the subordinate PCI buses of the PHB has been
2a485ad7c88ddf Gavin Shan 2015-02-16 1473 * removed or is exactly under error recovery, we
2a485ad7c88ddf Gavin Shan 2015-02-16 1474 * needn't take care of it any more.
2a485ad7c88ddf Gavin Shan 2015-02-16 1475 */
29310e5e860697 Gavin Shan 2013-06-20 1476 phb = hose->private_data;
2a485ad7c88ddf Gavin Shan 2015-02-16 1477 phb_pe = eeh_phb_pe_get(hose);
2a485ad7c88ddf Gavin Shan 2015-02-16 1478 if (!phb_pe || (phb_pe->state & EEH_PE_ISOLATED))
2a485ad7c88ddf Gavin Shan 2015-02-16 1479 continue;
2a485ad7c88ddf Gavin Shan 2015-02-16 1480
2a485ad7c88ddf Gavin Shan 2015-02-16 1481 rc = opal_pci_next_error(phb->opal_id,
2a485ad7c88ddf Gavin Shan 2015-02-16 1482 &frozen_pe_no, &err_type, &severity);
2a485ad7c88ddf Gavin Shan 2015-02-16 1483 if (rc != OPAL_SUCCESS) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1484 pr_devel("%s: Invalid return value on "
2a485ad7c88ddf Gavin Shan 2015-02-16 1485 "PHB#%x (0x%lx) from opal_pci_next_error",
2a485ad7c88ddf Gavin Shan 2015-02-16 1486 __func__, hose->global_number, rc);
2a485ad7c88ddf Gavin Shan 2015-02-16 1487 continue;
2a485ad7c88ddf Gavin Shan 2015-02-16 1488 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1489
2a485ad7c88ddf Gavin Shan 2015-02-16 1490 /* If the PHB doesn't have error, stop processing */
2a485ad7c88ddf Gavin Shan 2015-02-16 1491 if (be16_to_cpu(err_type) == OPAL_EEH_NO_ERROR ||
2a485ad7c88ddf Gavin Shan 2015-02-16 1492 be16_to_cpu(severity) == OPAL_EEH_SEV_NO_ERROR) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1493 pr_devel("%s: No error found on PHB#%x\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1494 __func__, hose->global_number);
2a485ad7c88ddf Gavin Shan 2015-02-16 1495 continue;
2a485ad7c88ddf Gavin Shan 2015-02-16 1496 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1497
2a485ad7c88ddf Gavin Shan 2015-02-16 1498 /*
2a485ad7c88ddf Gavin Shan 2015-02-16 1499 * Processing the error. We're expecting the error with
2a485ad7c88ddf Gavin Shan 2015-02-16 1500 * highest priority reported upon multiple errors on the
2a485ad7c88ddf Gavin Shan 2015-02-16 1501 * specific PHB.
2a485ad7c88ddf Gavin Shan 2015-02-16 1502 */
2a485ad7c88ddf Gavin Shan 2015-02-16 1503 pr_devel("%s: Error (%d, %d, %llu) on PHB#%x\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1504 __func__, be16_to_cpu(err_type),
2a485ad7c88ddf Gavin Shan 2015-02-16 1505 be16_to_cpu(severity), be64_to_cpu(frozen_pe_no),
2a485ad7c88ddf Gavin Shan 2015-02-16 1506 hose->global_number);
2a485ad7c88ddf Gavin Shan 2015-02-16 1507 switch (be16_to_cpu(err_type)) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1508 case OPAL_EEH_IOC_ERROR:
2a485ad7c88ddf Gavin Shan 2015-02-16 1509 if (be16_to_cpu(severity) == OPAL_EEH_SEV_IOC_DEAD) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1510 pr_err("EEH: dead IOC detected\n");
2a485ad7c88ddf Gavin Shan 2015-02-16 1511 ret = EEH_NEXT_ERR_DEAD_IOC;
2a485ad7c88ddf Gavin Shan 2015-02-16 1512 } else if (be16_to_cpu(severity) == OPAL_EEH_SEV_INF) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1513 pr_info("EEH: IOC informative error "
2a485ad7c88ddf Gavin Shan 2015-02-16 1514 "detected\n");
2a485ad7c88ddf Gavin Shan 2015-02-16 1515 pnv_eeh_get_and_dump_hub_diag(hose);
2a485ad7c88ddf Gavin Shan 2015-02-16 1516 ret = EEH_NEXT_ERR_NONE;
2a485ad7c88ddf Gavin Shan 2015-02-16 1517 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1518
29310e5e860697 Gavin Shan 2013-06-20 1519 break;
2a485ad7c88ddf Gavin Shan 2015-02-16 1520 case OPAL_EEH_PHB_ERROR:
2a485ad7c88ddf Gavin Shan 2015-02-16 1521 if (be16_to_cpu(severity) == OPAL_EEH_SEV_PHB_DEAD) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1522 *pe = phb_pe;
2a485ad7c88ddf Gavin Shan 2015-02-16 1523 pr_err("EEH: dead PHB#%x detected, "
2a485ad7c88ddf Gavin Shan 2015-02-16 1524 "location: %s\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1525 hose->global_number,
2a485ad7c88ddf Gavin Shan 2015-02-16 1526 eeh_pe_loc_get(phb_pe));
2a485ad7c88ddf Gavin Shan 2015-02-16 1527 ret = EEH_NEXT_ERR_DEAD_PHB;
2a485ad7c88ddf Gavin Shan 2015-02-16 1528 } else if (be16_to_cpu(severity) ==
2a485ad7c88ddf Gavin Shan 2015-02-16 1529 OPAL_EEH_SEV_PHB_FENCED) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1530 *pe = phb_pe;
2a485ad7c88ddf Gavin Shan 2015-02-16 1531 pr_err("EEH: Fenced PHB#%x detected, "
2a485ad7c88ddf Gavin Shan 2015-02-16 1532 "location: %s\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1533 hose->global_number,
2a485ad7c88ddf Gavin Shan 2015-02-16 1534 eeh_pe_loc_get(phb_pe));
2a485ad7c88ddf Gavin Shan 2015-02-16 1535 ret = EEH_NEXT_ERR_FENCED_PHB;
2a485ad7c88ddf Gavin Shan 2015-02-16 1536 } else if (be16_to_cpu(severity) == OPAL_EEH_SEV_INF) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1537 pr_info("EEH: PHB#%x informative error "
2a485ad7c88ddf Gavin Shan 2015-02-16 1538 "detected, location: %s\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1539 hose->global_number,
2a485ad7c88ddf Gavin Shan 2015-02-16 1540 eeh_pe_loc_get(phb_pe));
2a485ad7c88ddf Gavin Shan 2015-02-16 1541 pnv_eeh_get_phb_diag(phb_pe);
2a485ad7c88ddf Gavin Shan 2015-02-16 1542 pnv_pci_dump_phb_diag_data(hose, phb_pe->data);
2a485ad7c88ddf Gavin Shan 2015-02-16 1543 ret = EEH_NEXT_ERR_NONE;
29310e5e860697 Gavin Shan 2013-06-20 1544 }
29310e5e860697 Gavin Shan 2013-06-20 1545
2a485ad7c88ddf Gavin Shan 2015-02-16 1546 break;
2a485ad7c88ddf Gavin Shan 2015-02-16 1547 case OPAL_EEH_PE_ERROR:
2a485ad7c88ddf Gavin Shan 2015-02-16 1548 /*
2a485ad7c88ddf Gavin Shan 2015-02-16 1549 * If we can't find the corresponding PE, we
2a485ad7c88ddf Gavin Shan 2015-02-16 1550 * just try to unfreeze.
2a485ad7c88ddf Gavin Shan 2015-02-16 1551 */
2a485ad7c88ddf Gavin Shan 2015-02-16 1552 if (pnv_eeh_get_pe(hose,
2a485ad7c88ddf Gavin Shan 2015-02-16 1553 be64_to_cpu(frozen_pe_no), pe)) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1554 pr_info("EEH: Clear non-existing PHB#%x-PE#%llx\n",
0f36db77643b6f Gavin Shan 2015-05-12 1555 hose->global_number, be64_to_cpu(frozen_pe_no));
2a485ad7c88ddf Gavin Shan 2015-02-16 1556 pr_info("EEH: PHB location: %s\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1557 eeh_pe_loc_get(phb_pe));
79cd95200035fb Gavin Shan 2015-05-12 1558
79cd95200035fb Gavin Shan 2015-05-12 1559 /* Dump PHB diag-data */
79cd95200035fb Gavin Shan 2015-05-12 1560 rc = opal_pci_get_phb_diag_data2(phb->opal_id,
5cb1f8fdddb747 Russell Currey 2017-06-14 1561 phb->diag_data, phb->diag_data_size);
79cd95200035fb Gavin Shan 2015-05-12 1562 if (rc == OPAL_SUCCESS)
79cd95200035fb Gavin Shan 2015-05-12 1563 pnv_pci_dump_phb_diag_data(hose,
5cb1f8fdddb747 Russell Currey 2017-06-14 1564 phb->diag_data);
79cd95200035fb Gavin Shan 2015-05-12 1565
79cd95200035fb Gavin Shan 2015-05-12 1566 /* Try best to clear it */
2a485ad7c88ddf Gavin Shan 2015-02-16 1567 opal_pci_eeh_freeze_clear(phb->opal_id,
d63e51b31e0b65 Gavin Shan 2016-08-02 1568 be64_to_cpu(frozen_pe_no),
2a485ad7c88ddf Gavin Shan 2015-02-16 1569 OPAL_EEH_ACTION_CLEAR_FREEZE_ALL);
2a485ad7c88ddf Gavin Shan 2015-02-16 1570 ret = EEH_NEXT_ERR_NONE;
2a485ad7c88ddf Gavin Shan 2015-02-16 1571 } else if ((*pe)->state & EEH_PE_ISOLATED ||
2a485ad7c88ddf Gavin Shan 2015-02-16 1572 eeh_pe_passed(*pe)) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1573 ret = EEH_NEXT_ERR_NONE;
2a485ad7c88ddf Gavin Shan 2015-02-16 1574 } else {
2a485ad7c88ddf Gavin Shan 2015-02-16 1575 pr_err("EEH: Frozen PE#%x "
2a485ad7c88ddf Gavin Shan 2015-02-16 1576 "on PHB#%x detected\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1577 (*pe)->addr,
2a485ad7c88ddf Gavin Shan 2015-02-16 1578 (*pe)->phb->global_number);
2a485ad7c88ddf Gavin Shan 2015-02-16 1579 pr_err("EEH: PE location: %s, "
2a485ad7c88ddf Gavin Shan 2015-02-16 1580 "PHB location: %s\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1581 eeh_pe_loc_get(*pe),
2a485ad7c88ddf Gavin Shan 2015-02-16 1582 eeh_pe_loc_get(phb_pe));
2a485ad7c88ddf Gavin Shan 2015-02-16 1583 ret = EEH_NEXT_ERR_FROZEN_PE;
2a485ad7c88ddf Gavin Shan 2015-02-16 1584 }
29310e5e860697 Gavin Shan 2013-06-20 1585
2a485ad7c88ddf Gavin Shan 2015-02-16 1586 break;
2a485ad7c88ddf Gavin Shan 2015-02-16 1587 default:
2a485ad7c88ddf Gavin Shan 2015-02-16 1588 pr_warn("%s: Unexpected error type %d\n",
2a485ad7c88ddf Gavin Shan 2015-02-16 1589 __func__, be16_to_cpu(err_type));
2a485ad7c88ddf Gavin Shan 2015-02-16 1590 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1591
2a485ad7c88ddf Gavin Shan 2015-02-16 1592 /*
2a485ad7c88ddf Gavin Shan 2015-02-16 1593 * EEH core will try recover from fenced PHB or
2a485ad7c88ddf Gavin Shan 2015-02-16 1594 * frozen PE. In the time for frozen PE, EEH core
2a485ad7c88ddf Gavin Shan 2015-02-16 1595 * enable IO path for that before collecting logs,
2a485ad7c88ddf Gavin Shan 2015-02-16 1596 * but it ruins the site. So we have to dump the
2a485ad7c88ddf Gavin Shan 2015-02-16 1597 * log in advance here.
2a485ad7c88ddf Gavin Shan 2015-02-16 1598 */
2a485ad7c88ddf Gavin Shan 2015-02-16 1599 if ((ret == EEH_NEXT_ERR_FROZEN_PE ||
2a485ad7c88ddf Gavin Shan 2015-02-16 1600 ret == EEH_NEXT_ERR_FENCED_PHB) &&
2a485ad7c88ddf Gavin Shan 2015-02-16 1601 !((*pe)->state & EEH_PE_ISOLATED)) {
e762bb891a294a Sam Bobroff 2018-09-12 1602 eeh_pe_mark_isolated(*pe);
2a485ad7c88ddf Gavin Shan 2015-02-16 1603 pnv_eeh_get_phb_diag(*pe);
2a485ad7c88ddf Gavin Shan 2015-02-16 1604
2a485ad7c88ddf Gavin Shan 2015-02-16 1605 if (eeh_has_flag(EEH_EARLY_DUMP_LOG))
2a485ad7c88ddf Gavin Shan 2015-02-16 1606 pnv_pci_dump_phb_diag_data((*pe)->phb,
2a485ad7c88ddf Gavin Shan 2015-02-16 1607 (*pe)->data);
2a485ad7c88ddf Gavin Shan 2015-02-16 1608 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1609
2a485ad7c88ddf Gavin Shan 2015-02-16 1610 /*
2a485ad7c88ddf Gavin Shan 2015-02-16 1611 * We probably have the frozen parent PE out there and
2a485ad7c88ddf Gavin Shan 2015-02-16 1612 * we need have to handle frozen parent PE firstly.
2a485ad7c88ddf Gavin Shan 2015-02-16 1613 */
2a485ad7c88ddf Gavin Shan 2015-02-16 1614 if (ret == EEH_NEXT_ERR_FROZEN_PE) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1615 parent_pe = (*pe)->parent;
2a485ad7c88ddf Gavin Shan 2015-02-16 1616 while (parent_pe) {
2a485ad7c88ddf Gavin Shan 2015-02-16 1617 /* Hit the ceiling ? */
2a485ad7c88ddf Gavin Shan 2015-02-16 1618 if (parent_pe->type & EEH_PE_PHB)
2a485ad7c88ddf Gavin Shan 2015-02-16 1619 break;
2a485ad7c88ddf Gavin Shan 2015-02-16 1620
2a485ad7c88ddf Gavin Shan 2015-02-16 1621 /* Frozen parent PE ? */
2a485ad7c88ddf Gavin Shan 2015-02-16 1622 state = eeh_ops->get_state(parent_pe, NULL);
34a286a4ac576d Sam Bobroff 2018-03-19 1623 if (state > 0 && !eeh_state_active(state))
2a485ad7c88ddf Gavin Shan 2015-02-16 1624 *pe = parent_pe;
2a485ad7c88ddf Gavin Shan 2015-02-16 1625
2a485ad7c88ddf Gavin Shan 2015-02-16 1626 /* Next parent level */
2a485ad7c88ddf Gavin Shan 2015-02-16 1627 parent_pe = parent_pe->parent;
2a485ad7c88ddf Gavin Shan 2015-02-16 1628 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1629
2a485ad7c88ddf Gavin Shan 2015-02-16 1630 /* We possibly migrate to another PE */
e762bb891a294a Sam Bobroff 2018-09-12 1631 eeh_pe_mark_isolated(*pe);
2a485ad7c88ddf Gavin Shan 2015-02-16 1632 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1633
2a485ad7c88ddf Gavin Shan 2015-02-16 1634 /*
2a485ad7c88ddf Gavin Shan 2015-02-16 1635 * If we have no errors on the specific PHB or only
2a485ad7c88ddf Gavin Shan 2015-02-16 1636 * informative error there, we continue poking it.
2a485ad7c88ddf Gavin Shan 2015-02-16 1637 * Otherwise, we need actions to be taken by upper
2a485ad7c88ddf Gavin Shan 2015-02-16 1638 * layer.
2a485ad7c88ddf Gavin Shan 2015-02-16 1639 */
2a485ad7c88ddf Gavin Shan 2015-02-16 1640 if (ret > EEH_NEXT_ERR_INF)
2a485ad7c88ddf Gavin Shan 2015-02-16 1641 break;
2a485ad7c88ddf Gavin Shan 2015-02-16 1642 }
2a485ad7c88ddf Gavin Shan 2015-02-16 1643
79231448c929cc Alistair Popple 2015-05-15 1644 /* Unmask the event */
b8d65e9662b1ff Alistair Popple 2015-07-30 1645 if (ret == EEH_NEXT_ERR_NONE && eeh_enabled())
79231448c929cc Alistair Popple 2015-05-15 1646 enable_irq(eeh_event_irq);
79231448c929cc Alistair Popple 2015-05-15 1647
2a485ad7c88ddf Gavin Shan 2015-02-16 1648 return ret;
29310e5e860697 Gavin Shan 2013-06-20 1649 }
29310e5e860697 Gavin Shan 2013-06-20 1650

:::::: The code at line 1454 was first introduced by commit
:::::: 01f3bfb7804ae20aaf66884cf537f7dc2cdc1671 powerpc/powernv: Shorten EEH function names

:::::: TO: Gavin Shan <gwshan@xxxxxxxxxxxxxxxxxx>
:::::: CC: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip