login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
March
»
21
Re: [PATCH 5/16] PCI slot: Use list_head for pci slot list (Not for mainline!)
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Alex Chiang
Subject:
Re: [PATCH 5/16] PCI slot: Use list_head for pci slot list (Not for mainline!)
Date: Friday, March 21, 2008 - 11:40 am
* Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>:
quoted text
> To make code simple, we should use list_head for physical slot list on > the bus.
Merged, thanks. /ac
quoted text
> > Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> > > --- > drivers/acpi/pci_slot.c | 9 ++++++--- > drivers/pci/probe.c | 1 + > drivers/pci/slot.c | 17 ++++++----------- > include/linux/pci.h | 4 ++-- > 4 files changed, 15 insertions(+), 16 deletions(-) > > Index: linux-2.6.25-rc6/drivers/pci/probe.c > =================================================================== > --- linux-2.6.25-rc6.orig/drivers/pci/probe.c > +++ linux-2.6.25-rc6/drivers/pci/probe.c > @@ -384,6 +384,7 @@ static struct pci_bus * pci_alloc_bus(vo > INIT_LIST_HEAD(&b->node); > INIT_LIST_HEAD(&b->children); > INIT_LIST_HEAD(&b->devices); > + INIT_LIST_HEAD(&b->slots); > } > return b; > } > Index: linux-2.6.25-rc6/drivers/pci/slot.c > =================================================================== > --- linux-2.6.25-rc6.orig/drivers/pci/slot.c > +++ linux-2.6.25-rc6/drivers/pci/slot.c > @@ -69,18 +69,12 @@ static int create_sysfs_files(struct pci > > static void pci_slot_release(struct kobject *kobj) > { > - struct pci_slot **pprev; > struct pci_slot *slot = to_pci_slot(kobj); > > dbg("%s: releasing pci_slot on %x:%d\n", __func__, > slot->bus->number, slot->number); > > - for (pprev = &slot->bus->slot; *pprev; pprev = &(*pprev)->next) { > - if (*pprev == slot) { > - *pprev = slot->next; > - break; > - } > - } > + list_del(&slot->list); > > if (slot->release) > slot->release(slot); > @@ -107,11 +101,12 @@ int pci_slot_add_hotplug(struct pci_bus > /* This slot should have already been created, so look for it. If > * we can't find it, return -EEXIST. > */ > - for (slot = parent->slot; slot; slot = slot->next) > + list_for_each_entry(slot, &parent->slots, list) { > if (slot->number == slot_nr) { > found = 1; > break; > } > + } > > if (!found) { > dbg("%s: slot not found\n", __func__); > @@ -143,7 +138,7 @@ struct pci_slot *pci_create_slot(struct > down_write(&pci_bus_sem); > > /* If we've already created this slot, bump refcount and return. */ > - for (slot = parent->slot; slot; slot = slot->next) { > + list_for_each_entry(slot, &parent->slots, list) { > if (slot->number == slot_nr) { > kobject_get(&slot->kobj); > dbg("%s: bumped refcount to %d on %x:%d\n", > @@ -175,8 +170,8 @@ struct pci_slot *pci_create_slot(struct > if (err) > goto unregister; > > - slot->next = parent->slot; > - parent->slot = slot; > + INIT_LIST_HEAD(&slot->list); > + list_add(&slot->list, &parent->slots); > > dbg("%s: created pci_slot on %x:%d\n", > __func__, parent->number, slot_nr); > Index: linux-2.6.25-rc6/include/linux/pci.h > =================================================================== > --- linux-2.6.25-rc6.orig/include/linux/pci.h > +++ linux-2.6.25-rc6/include/linux/pci.h > @@ -131,7 +131,7 @@ struct pci_cap_saved_state { > /* pci_slot represents a physical slot */ > struct pci_slot { > struct pci_bus *bus; /* The bus this slot is on */ > - struct pci_slot *next; /* Next slot on this bus */ > + struct list_head list; /* node in list of slots on this bus */ > struct hotplug_slot *hotplug; /* Hotplug info (migrate over time) */ > unsigned char number; /* PCI_SLOT(pci_dev->devfn) */ > struct kobject kobj; > @@ -269,7 +269,7 @@ struct pci_bus { > struct list_head children; /* list of child buses */ > struct list_head devices; /* list of devices on this bus */ > struct pci_dev *self; /* bridge device as seen by parent */ > - struct pci_slot *slot; /* First physical slot on this bus */ > + struct list_head slots; /* list of slots on this bus */ > struct resource *resource[PCI_BUS_NUM_RESOURCES]; > /* address space routed to this bus */ > > Index: linux-2.6.25-rc6/drivers/acpi/pci_slot.c > =================================================================== > --- linux-2.6.25-rc6.orig/drivers/acpi/pci_slot.c > +++ linux-2.6.25-rc6/drivers/acpi/pci_slot.c > @@ -117,15 +117,18 @@ unregister_slot(acpi_handle handle, u32 > { > int device; > unsigned long sun; > - struct pci_slot *slot; > + struct pci_slot *slot, *tmp; > struct pci_bus *pci_bus = context; > > if (check_slot(handle, &device, &sun)) > return AE_OK; > > - for (slot = pci_bus->slot; slot; slot = slot->next) { > - if (slot->number == device) > + /* FIXME - Need pci_bus_sem to be held */ > + list_for_each_entry_safe(slot, tmp, &pci_bus->slots, list) { > + if (slot->number == device) { > pci_destroy_slot(slot); > + break; > + } > } > > return AE_OK; > >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Alex Chiang
, (Tue Mar 18, 2:05 pm)
[PATCH 1/3] Construct one fakephp slot per pci slot
, Alex Chiang
, (Tue Mar 18, 2:08 pm)
[PATCH 2/3] Introduce pci_slot
, Alex Chiang
, (Tue Mar 18, 2:09 pm)
[PATCH 3/3] ACPI PCI slot detection driver
, Alex Chiang
, (Tue Mar 18, 2:09 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Matthew Wilcox
, (Tue Mar 18, 5:55 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Alex Chiang
, (Tue Mar 18, 6:52 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Kenji Kaneshige
, (Tue Mar 18, 7:24 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Kenji Kaneshige
, (Tue Mar 18, 7:34 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Kenji Kaneshige
, (Thu Mar 20, 9:07 pm)
[PATCH 1/16][BUG] Export kobject_rename for pci_hotplug_c ...
, Kenji Kaneshige
, (Thu Mar 20, 9:09 pm)
[PATCH 2/16] ACPI pci_slot: Fix dmi table for Fujitsu PRI ...
, Kenji Kaneshige
, (Thu Mar 20, 9:10 pm)
[PATCH 3/16][BUG] ACPI pci_slot: Fix _STA evaluation (Not ...
, Kenji Kaneshige
, (Thu Mar 20, 9:11 pm)
[PATCH 4/16][BUG] PCI slot: Add missing semaphore for slo ...
, Kenji Kaneshige
, (Thu Mar 20, 9:12 pm)
[PATCH 5/16] PCI slot: Use list_head for pci slot list (N ...
, Kenji Kaneshige
, (Thu Mar 20, 9:13 pm)
[PATCH 6/16][BUG] ACPI pci_slot: Fix slot removal path (N ...
, Kenji Kaneshige
, (Thu Mar 20, 9:14 pm)
[PATCH 7/16][BUG] PCI slot: Remove compiler warnings (Not ...
, Kenji Kaneshige
, (Thu Mar 20, 9:14 pm)
[PATCH 8/16][BUG] PCI slot: Fix invalid memory access (No ...
, Kenji Kaneshige
, (Thu Mar 20, 9:15 pm)
[PATCH 9/16] PCI slot: Remove unused slot member from pci ...
, Kenji Kaneshige
, (Thu Mar 20, 9:16 pm)
[PATCH 10/16] PCI slot: Replace dbg with pr_debug (Not for ...
, Kenji Kaneshige
, (Thu Mar 20, 9:17 pm)
[PATCH 11/16] PCI slot: Remove useless release handler (No ...
, Kenji Kaneshige
, (Thu Mar 20, 9:18 pm)
[PATCH 12/16] PCI slot: Use .default_attrs for address fil ...
, Kenji Kaneshige
, (Thu Mar 20, 9:19 pm)
[PATCH 13/16] PCI slot: Fix return value of pci_create_slo ...
, Kenji Kaneshige
, (Thu Mar 20, 9:23 pm)
[PATCH 14/16] PCI slot: Change return value of pci_destroy ...
, Kenji Kaneshige
, (Thu Mar 20, 9:26 pm)
[PATCH 15/16] PCI slot: Trivial cleanups for slot.c (Not f ...
, Kenji Kaneshige
, (Thu Mar 20, 9:26 pm)
[PATCH 16/16][BUG] PCI hotplug core: add missing lock for ...
, Kenji Kaneshige
, (Thu Mar 20, 9:27 pm)
Re: [PATCH 0/3, v10] PCI, ACPI: Physical PCI slot objects
, Alex Chiang
, (Fri Mar 21, 8:53 am)
Re: [PATCH 1/16][BUG] Export kobject_rename for pci_hotpl ...
, Alex Chiang
, (Fri Mar 21, 8:56 am)
Re: [PATCH 2/16] ACPI pci_slot: Fix dmi table for Fujitsu ...
, Alex Chiang
, (Fri Mar 21, 9:04 am)
Re: [PATCH 1/16][BUG] Export kobject_rename for pci_hotpl ...
, Greg KH
, (Fri Mar 21, 9:15 am)
Re: [PATCH 3/16][BUG] ACPI pci_slot: Fix _STA evaluation ( ...
, Alex Chiang
, (Fri Mar 21, 9:17 am)
Re: [PATCH 1/16][BUG] Export kobject_rename for pci_hotpl ...
, Alex Chiang
, (Fri Mar 21, 9:45 am)
Re: [PATCH 4/16][BUG] PCI slot: Add missing semaphore for ...
, Alex Chiang
, (Fri Mar 21, 9:57 am)
Re: [PATCH 5/16] PCI slot: Use list_head for pci slot lis ...
, Alex Chiang
, (Fri Mar 21, 11:40 am)
Re: [PATCH 9/16] PCI slot: Remove unused slot member from ...
, Matthew Wilcox
, (Fri Mar 21, 12:30 pm)
Re: [PATCH 10/16] PCI slot: Replace dbg with pr_debug (Not ...
, Matthew Wilcox
, (Fri Mar 21, 12:30 pm)
Re: [PATCH 12/16] PCI slot: Use .default_attrs for address ...
, Matthew Wilcox
, (Fri Mar 21, 12:32 pm)
Re: [PATCH 14/16] PCI slot: Change return value of pci_des ...
, Matthew Wilcox
, (Fri Mar 21, 12:32 pm)
Re: [PATCH 15/16] PCI slot: Trivial cleanups for slot.c (N ...
, Matthew Wilcox
, (Fri Mar 21, 12:33 pm)
Re: [PATCH 6/16][BUG] ACPI pci_slot: Fix slot removal pat ...
, Alex Chiang
, (Fri Mar 21, 12:42 pm)
Re: [PATCH 7/16][BUG] PCI slot: Remove compiler warnings ( ...
, Alex Chiang
, (Fri Mar 21, 1:01 pm)
Re: [PATCH 8/16][BUG] PCI slot: Fix invalid memory access ...
, Alex Chiang
, (Fri Mar 21, 1:01 pm)
Re: [PATCH 10/16] PCI slot: Replace dbg with pr_debug (Not ...
, Alex Chiang
, (Fri Mar 21, 1:02 pm)
Re: [PATCH 9/16] PCI slot: Remove unused slot member from ...
, Alex Chiang
, (Mon Mar 24, 1:29 pm)
Re: [PATCH 11/16] PCI slot: Remove useless release handler ...
, Alex Chiang
, (Mon Mar 24, 8:08 pm)
Re: [PATCH 12/16] PCI slot: Use .default_attrs for address ...
, Alex Chiang
, (Mon Mar 24, 8:31 pm)
Re: [PATCH 13/16] PCI slot: Fix return value of pci_create ...
, Alex Chiang
, (Mon Mar 24, 8:31 pm)
Re: [PATCH 14/16] PCI slot: Change return value of pci_des ...
, Alex Chiang
, (Mon Mar 24, 8:31 pm)
Re: [PATCH 15/16] PCI slot: Trivial cleanups for slot.c (N ...
, Alex Chiang
, (Mon Mar 24, 8:31 pm)
Re: [PATCH 16/16][BUG] PCI hotplug core: add missing lock ...
, Alex Chiang
, (Mon Mar 24, 8:31 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mel Gorman
Re: [PATCH 1/4] vmstat: remove zone->lock from walk_zones_in_node
Guenter Roeck
Re: [lm-sensors] Location for thermal drivers
David Woodhouse
Re: RFC: Moving firmware blobs out of the kernel.
Siddha, Suresh B
Re: [PATCH 2.6.21 review I] [11/25] x86: default to physical mode on hotplug CPU k...
Peter Zijlstra
Re: [patch 4/6] mm: merge populate and nopage into fault (fixes nonlinear)
git-commits-head
:
Linux Kernel Mailing List
[MIPS] Fix potential latency problem due to non-atomic cpu_wait.
Linux Kernel Mailing List
USB: rename USB_SPEED_VARIABLE to USB_SPEED_WIRELESS
Linux Kernel Mailing List
lib/vsprintf.c: fix bug omitting minus sign of numbers (module_param)
Linux Kernel Mailing List
[Bluetooth] Initiate authentication during connection establishment
Linux Kernel Mailing List
[POWERPC] 4xx: Add ppc40x_defconfig
linux-netdev
:
MERCEDES
Your mail id has won 950,000.00 in the MERCEDES Benz Online Promo.for claims send:
David Miller
Re: [PATCH] xen/netfront: do not mark packets of length < MSS as GSO
David Miller
Re: skb_segment() questions
Shan Wei
[RFC PATCH net-next 2/5]IPv6:netfilter: Send an ICMPv6 "Fragment Reassembly Timeou...
Stanislaw Gruszka
[PATCH 1/4] bnx2x: use smp_mb() to keep ordering of read write operations
git
:
Nicolas Sebrecht
git-svn died of signal 11 (was "3 failures on test t9100 (svn)")
Junio C Hamano
Re: [PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
Martin Langhoff
Re: [PATCH] GIT commit statistics.
Alexandre Julliard
[PATCH] gitweb: Put back shortlog instead of graphiclog in the project list.
Josh Triplett
[PATCH 2/2] Add url.<base>.pushInsteadOf: URL rewriting for push only
openbsd-misc
:
Taisto Qvist XX
Re: AMD GEODE LX-800 just works with kernel from install42.iso and kernelpanics wi...
Nico Meijer
Re: gOS Develop Kit with VIA pc-1 Processor Platform VIA C7-D
Andreas Bihlmaier
Re: jetway board sensors (Fintek F71805F)
admin
Drive a 2009 car from R799p/m
Antti Harri
Re: how to create a sha256 hash
Colocation donated by:
Syndicate