Skip to contentSkip to conversation

x86: reboot_fixup_32.c add missing pci_dev_put

PATCH In review Xiaotian Feng 3 participants 8 messages Nov 27, 2009 – Dec 3, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: reboot_fixup_32.c add missing pci_dev_put

pci_get_device increments reference count to the found pci device, that should be decremented using pci_dev_put.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc H. Peter Anvin <[email protected]>
---
 arch/x86/kernel/reboot_fixups_32.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/reboot_fixups_32.c +1 -0
index 61a8377..201eab6 100644
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
 			continue;
 
 		cur->reboot_fixup(dev);
+		pci_dev_put(dev);
 	}
 }
 
Signature · 1 line
1.6.5.2
#1 lore raw

arch/x86/kernel/reboot_fixups_32.c void mach_reboot_fixups(void) · line 83

Quoted 9 lines · Xiaotian Feng

pci_get_device increments reference count to the found pci device, that should be decremented using pci_dev_put.

+++ b/arch/x86/kernel/reboot_fixups_32.c

arch/x86/kernel/reboot_fixups_32.c +1 -0
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
 			continue;
 
 		cur->reboot_fixup(dev);
+		pci_dev_put(dev);

Does this matter in practice? We are about to reboot. (but if it's cleaner to do it like this or if there's some real bug fixed by this then please spell it out in the changelog.)

Ingo

#2 lore raw
Quoted 10 lines · Ingo Molnar
Quoted 7 lines · Xiaotian Feng

pci_get_device increments reference count to the found pci device, that should be decremented using pci_dev_put.

+++ b/arch/x86/kernel/reboot_fixups_32.c

arch/x86/kernel/reboot_fixups_32.c +0 -0
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
 			continue;
 
Quoted 7 lines

arch/x86/kernel/reboot_fixups_32.c void mach_reboot_fixups(void) · line 83

Quoted 2 lines
arch/x86/kernel/reboot_fixups_32.c +1 -0
 		cur->reboot_fixup(dev);
+		pci_dev_put(dev);

Does this matter in practice? We are about to reboot. (but if it's cleaner to do it like this or if there's some real bug fixed by this then please spell it out in the changelog.)

Even if it doesn't actually matter, doing things cleanly makes it easier to handle failure scenarios, possibly that are discovered in the future.

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#3 lore raw
Quoted 19 lines · H. Peter Anvin
Quoted 10 lines · Ingo Molnar
Quoted 7 lines · Xiaotian Feng

pci_get_device increments reference count to the found pci device, that should be decremented using pci_dev_put.

+++ b/arch/x86/kernel/reboot_fixups_32.c

arch/x86/kernel/reboot_fixups_32.c +0 -0
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
 			continue;
 
Quoted 7 lines

arch/x86/kernel/reboot_fixups_32.c void mach_reboot_fixups(void) · line 83

Quoted 2 lines
arch/x86/kernel/reboot_fixups_32.c +1 -0
 		cur->reboot_fixup(dev);
+		pci_dev_put(dev);

Does this matter in practice? We are about to reboot. (but if it's cleaner to do it like this or if there's some real bug fixed by this then please spell it out in the changelog.)

Quoted 3 lines

Even if it doesn't actually matter, doing things cleanly makes it easier to handle failure scenarios, possibly that are discovered in the future.

certainly - but it would be nice to know whether there's any other reason for this but cleanliness/consistency.

Ingo

author
#4 lore raw
Quoted 22 lines · Ingo Molnar
Quoted 19 lines · H. Peter Anvin
Quoted 17 lines · Ingo Molnar

arch/x86/kernel/reboot_fixups_32.c void mach_reboot_fixups(void) · line 83

Quoted 9 lines · Xiaotian Feng

pci_get_device increments reference count to the found pci device, that should be decremented using pci_dev_put.

+++ b/arch/x86/kernel/reboot_fixups_32.c

arch/x86/kernel/reboot_fixups_32.c +1 -0
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
  			continue;
 
  		cur->reboot_fixup(dev);
+		pci_dev_put(dev);

Does this matter in practice? We are about to reboot. (but if it's cleaner to do it like this or if there's some real bug fixed by this then please spell it out in the changelog.)

Quoted 6 lines
Quoted 3 lines

Even if it doesn't actually matter, doing things cleanly makes it easier to handle failure scenarios, possibly that are discovered in the future.

certainly - but it would be nice to know whether there's any other reason for this but cleanliness/consistency.

Just for consistency:-) pci_get_device will increase the ref count of found device, then we should use pci_dev_put to decrease the ref count although we're going to reset soon. I should point out this in my changelog, sorry for the unclear changelog.

Quoted 3 lines

Ingo

#5 lore raw
Quoted 2 lines · Danny Feng

I should point out this in my changelog, sorry for the unclear changelog.

Please re-send it with a better changelog.

Thanks,

Ingo

#6 lore raw

PATCH 1/1 x86/trivial: add pci_dev_put in reboot_fixup_32.c for consistency

pci_get_device will increase the ref count of found device. Although we're going to reset soon, we should use pci_dev_put to decrease the ref count for consistency.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Yinghai Lu <[email protected]>
---
 arch/x86/kernel/reboot_fixups_32.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/reboot_fixups_32.c +1 -0
index 61a8377..201eab6 100644
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
 			continue;
 
 		cur->reboot_fixup(dev);
+		pci_dev_put(dev);
 	}
 }
 
Signature · 1 line
1.5.5.6
#7 lore raw

[tip:x86/reboot] x86/reboot: Add pci_dev_put in reboot_fixup_32.c for consistency

Commit-ID:  57fea8f7ab67ef42b7f84999e49e47f8717a2d5b
Gitweb:     http://git.kernel.org/tip/57fea8f7ab67ef42b7f84999e49e47f8717a2d5b
Author:     Xiaotian Feng <[email protected]>
AuthorDate: Thu, 3 Dec 2009 19:06:40 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 3 Dec 2009 12:17:55 +0100

x86/reboot: Add pci_dev_put in reboot_fixup_32.c for consistency

pci_get_device will increase the ref count of found device. Although we're going to reset soon, we should use pci_dev_put to decrease the ref count for consistency.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/reboot_fixups_32.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/reboot_fixups_32.c +1 -0
index 61a8377..201eab6 100644
@@ -80,6 +80,7 @@ void mach_reboot_fixups(void)
 			continue;
 
 		cur->reboot_fixup(dev);
+		pci_dev_put(dev);
 	}
 }