Skip to contentSkip to conversation

linux-next: manual merge of the pci tree with the pci-current tree

PATCH Mark Brown 3 participants 3 messages Oct 9 – Oct 13

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

Today's linux-next merge of the pci tree got a conflict in:

drivers/pci/pcie/aer.c

between commit:

79c168e2aa957 ("PCI/AER: Skip error recovery on false alarms")

from the pci-current tree and commit:

d4c842c3af5bc ("PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing")

from the pci tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

drivers/pci/pcie/aer.c +0 -0
diff --cc drivers/pci/pcie/aer.c
index 922a726a52a50,c376c3adbefd2..0000000000000
@@@ -1373,16 -1370,9 +1372,15 @@@ static void aer_recover_work_func(struc
  					   entry.domain, entry.bus,
  					   PCI_SLOT(entry.devfn),
  					   PCI_FUNC(entry.devfn));
- 			continue;
- 		}
- 		pci_print_aer(pdev, entry.severity, entry.regs);
+ 		else
+ 			pci_print_aer(pdev, entry.severity, entry.regs);
  
 +		regs = entry.regs;
 +		if (entry.severity == AER_CORRECTABLE)
 +			err = regs->cor_status & ~regs->cor_mask;
 +		else
 +			err = regs->uncor_status & ~regs->uncor_mask;
 +
  		/*
  		 * Memory for aer_capability_regs(entry.regs) is being
  		 * allocated from the ghes_estatus_pool to protect it from
@@@ -1393,15 -1383,15 +1391,21 @@@
  		ghes_estatus_pool_region_free((unsigned long)entry.regs,
  					    sizeof(struct aer_capability_regs));
  
- 		if (err) {
- 			if (entry.severity == AER_NONFATAL)
- 				pcie_do_recovery(pdev, pci_channel_io_normal,
- 						 aer_root_reset);
- 			else if (entry.severity == AER_FATAL)
- 				pcie_do_recovery(pdev, pci_channel_io_frozen,
- 						 aer_root_reset);
+ 		if (pdev) {
 -			if (entry.severity == AER_NONFATAL)
 -				pcie_do_recovery(pdev, pci_channel_io_normal,
 -						 aer_root_reset);
 -			else if (entry.severity == AER_FATAL)
 -				pcie_do_recovery(pdev, pci_channel_io_frozen,
 -						 aer_root_reset);
++			if (err) {
++				if (entry.severity == AER_NONFATAL)
++					pcie_do_recovery(pdev,
++							 pci_channel_io_normal,
++							 aer_root_reset);
++				else if (entry.severity == AER_FATAL)
++					pcie_do_recovery(pdev,
++							 pci_channel_io_frozen,
++							 aer_root_reset);
++				}
++			}
++
+ 			pci_dev_put(pdev);
  		}
- 		pci_dev_put(pdev);
  	}
  }
  
#1 lore raw
Quoted 26 lines · Mark Brown

Today's linux-next merge of the pci tree got a conflict in:

drivers/pci/pcie/aer.c

between commit:

79c168e2aa957 ("PCI/AER: Skip error recovery on false alarms")

from the pci-current tree and commit:

d4c842c3af5bc ("PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing")

from the pci tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

drivers/pci/pcie/aer.c +0 -0
diff --cc drivers/pci/pcie/aer.c
index 922a726a52a50,c376c3adbefd2..0000000000000

drivers/pci/pcie/aer.c

Quoted 2 lines
drivers/pci/pcie/aer.c +0 -0
@@@ -1393,15 -1383,15 +1391,21 @@@
                ghes_estatus_pool_region_free((unsigned long)entry.regs,
                                            sizeof(struct aer_capability_regs));

While your resolution looks correct to me, it can be shortened by inserting

    if (!pdev)
            continue;

here, avoiding the need for breaking long lines.

Quoted 22 lines
drivers/pci/pcie/aer.c +8 -7
-               if (err) {
-                       if (entry.severity == AER_NONFATAL)
-                               pcie_do_recovery(pdev, pci_channel_io_normal,
-                                                aer_root_reset);
-                       else if (entry.severity == AER_FATAL)
-                               pcie_do_recovery(pdev, pci_channel_io_frozen,
-                                                aer_root_reset);
+               if (pdev) {
 -                      if (entry.severity == AER_NONFATAL)
 -                              pcie_do_recovery(pdev, pci_channel_io_normal,
 -                                               aer_root_reset);
 -                      else if (entry.severity == AER_FATAL)
 -                              pcie_do_recovery(pdev, pci_channel_io_frozen,
 -                                               aer_root_reset);
++                      if (err) {
++                              if (entry.severity == AER_NONFATAL)
++                                      pcie_do_recovery(pdev,
++                                                       pci_channel_io_normal,
++                                                       aer_root_reset);
++                              else if (entry.severity == AER_FATAL)
++                                      pcie_do_recovery(pdev,

drivers/pci/pcie/aer.c

Quoted 10 lines
drivers/pci/pcie/aer.c +6 -1
++                                                       pci_channel_io_frozen,
++                                                       aer_root_reset);
++                              }
++                      }
++
+                       pci_dev_put(pdev);
                }
-               pci_dev_put(pdev);
        }
  }

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 33 lines · Geert Uytterhoeven
Quoted 26 lines · Mark Brown

Today's linux-next merge of the pci tree got a conflict in:

drivers/pci/pcie/aer.c

between commit:

79c168e2aa957 ("PCI/AER: Skip error recovery on false alarms")

from the pci-current tree and commit:

d4c842c3af5bc ("PCI/AER: Fix memory leak in aer_recover_work_func() when pci_dev is missing")

from the pci tree.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

drivers/pci/pcie/aer.c +0 -0
diff --cc drivers/pci/pcie/aer.c
index 922a726a52a50,c376c3adbefd2..0000000000000

drivers/pci/pcie/aer.c

Quoted 2 lines
drivers/pci/pcie/aer.c +0 -0
@@@ -1393,15 -1383,15 +1391,21 @@@
                ghes_estatus_pool_region_free((unsigned long)entry.regs,
                                            sizeof(struct aer_capability_regs));

While your resolution looks correct to me, it can be shortened by inserting

Quoted 4 lines
    if (!pdev)
            continue;

here, avoiding the need for breaking long lines.

Actually the resolution I would have preferred is:

		if (pdev && err) {
			if (entry.severity == AER_NONFATAL)
				pcie_do_recovery(pdev, pci_channel_io_normal,
						aer_root_reset);
			else if (entry.severity == AER_FATAL)
				pcie_do_recovery(pdev, pci_channel_io_frozen,
						aer_root_reset);
		}
		pci_dev_put(pdev);

I.e. change the if-condition to "if (pdev && err)" and keep the pci_dev_put(pdev) outside the if-clause.

This was documented in my patch submission:

https://lore.kernel.org/r/0552ed277e40a288e0157af799257ee6ec722534.1791460615.git.lukas@wunner.de/

Thanks,

Lukas