* [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures
@ 2006-09-15 14:34 Alan Cox
2006-09-18 19:01 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Alan Cox @ 2006-09-15 14:34 UTC (permalink / raw)
To: James.Bottomley, linux-scsi
Signed-off-by: Alan Cox <alan@redhat.com>
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c
--- linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-11 17:00:17.000000000 +0100
+++ linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-14 16:50:25.000000000 +0100
@@ -9194,7 +9194,7 @@
for (i = 0; i < ARRAY_SIZE(aic_pdevs); i++)
{
pdev = NULL;
- while ((pdev = pci_find_device(aic_pdevs[i].vendor_id,
+ while ((pdev = pci_get_device(aic_pdevs[i].vendor_id,
aic_pdevs[i].device_id,
pdev))) {
if (pci_enable_device(pdev))
@@ -9651,6 +9651,9 @@
*/
aic7xxx_configure_bugs(temp_p);
+ /* Hold a pci device reference */
+ pci_dev_get(temp_p->pdev);
+
if ( list_p == NULL )
{
list_p = current_p = temp_p;
@@ -10987,8 +10990,10 @@
if(!p->pdev)
release_region(p->base, MAXREG - MINREG);
#ifdef CONFIG_PCI
- else
+ else {
pci_release_regions(p->pdev);
+ pci_dev_put(p->pdev);
+ }
#endif
prev = NULL;
next = first_aic7xxx;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/BusLogic.c linux-2.6.18-rc6-mm1/drivers/scsi/BusLogic.c
--- linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/BusLogic.c 2006-09-11 17:00:17.000000000 +0100
+++ linux-2.6.18-rc6-mm1/drivers/scsi/BusLogic.c 2006-09-14 16:59:39.000000000 +0100
@@ -662,7 +662,7 @@
particular standard ISA I/O Address need not be probed.
*/
PrimaryProbeInfo->IO_Address = 0;
- while ((PCI_Device = pci_find_device(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, PCI_Device)) != NULL) {
+ while ((PCI_Device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, PCI_Device)) != NULL) {
struct BusLogic_HostAdapter *HostAdapter = PrototypeHostAdapter;
struct BusLogic_PCIHostAdapterInformation PCIHostAdapterInformation;
enum BusLogic_ISACompatibleIOPort ModifyIOAddressRequest;
@@ -762,7 +762,7 @@
PrimaryProbeInfo->Bus = Bus;
PrimaryProbeInfo->Device = Device;
PrimaryProbeInfo->IRQ_Channel = IRQ_Channel;
- PrimaryProbeInfo->PCI_Device = PCI_Device;
+ PrimaryProbeInfo->PCI_Device = pci_dev_get(PCI_Device);
PCIMultiMasterCount++;
} else if (BusLogic_ProbeInfoCount < BusLogic_MaxHostAdapters) {
struct BusLogic_ProbeInfo *ProbeInfo = &BusLogic_ProbeInfoList[BusLogic_ProbeInfoCount++];
@@ -773,7 +773,7 @@
ProbeInfo->Bus = Bus;
ProbeInfo->Device = Device;
ProbeInfo->IRQ_Channel = IRQ_Channel;
- ProbeInfo->PCI_Device = PCI_Device;
+ ProbeInfo->PCI_Device = pci_dev_get(PCI_Device);
NonPrimaryPCIMultiMasterCount++;
PCIMultiMasterCount++;
} else
@@ -823,7 +823,7 @@
noting the PCI bus location and assigned IRQ Channel.
*/
PCI_Device = NULL;
- while ((PCI_Device = pci_find_device(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC, PCI_Device)) != NULL) {
+ while ((PCI_Device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC, PCI_Device)) != NULL) {
unsigned char Bus;
unsigned char Device;
unsigned int IRQ_Channel;
@@ -850,7 +850,7 @@
ProbeInfo->Bus = Bus;
ProbeInfo->Device = Device;
ProbeInfo->IRQ_Channel = IRQ_Channel;
- ProbeInfo->PCI_Device = PCI_Device;
+ ProbeInfo->PCI_Device = pci_dev_get(PCI_Device);
break;
}
}
@@ -874,7 +874,7 @@
/*
Interrogate PCI Configuration Space for any FlashPoint Host Adapters.
*/
- while ((PCI_Device = pci_find_device(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT, PCI_Device)) != NULL) {
+ while ((PCI_Device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT, PCI_Device)) != NULL) {
unsigned char Bus;
unsigned char Device;
unsigned int IRQ_Channel;
@@ -923,7 +923,7 @@
ProbeInfo->Bus = Bus;
ProbeInfo->Device = Device;
ProbeInfo->IRQ_Channel = IRQ_Channel;
- ProbeInfo->PCI_Device = PCI_Device;
+ ProbeInfo->PCI_Device = pci_dev_get(PCI_Device);
FlashPointCount++;
} else
BusLogic_Warning("BusLogic: Too many Host Adapters " "detected\n", NULL);
@@ -1890,6 +1890,7 @@
*/
if (HostAdapter->MailboxSpace)
pci_free_consistent(HostAdapter->PCI_Device, HostAdapter->MailboxSize, HostAdapter->MailboxSpace, HostAdapter->MailboxSpaceHandle);
+ pci_dev_put(HostAdapter->PCI_Device);
HostAdapter->MailboxSpace = NULL;
HostAdapter->MailboxSpaceHandle = 0;
HostAdapter->MailboxSize = 0;
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/dpt_i2o.c linux-2.6.18-rc6-mm1/drivers/scsi/dpt_i2o.c
--- linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/dpt_i2o.c 2006-09-11 17:00:17.000000000 +0100
+++ linux-2.6.18-rc6-mm1/drivers/scsi/dpt_i2o.c 2006-09-14 16:40:17.000000000 +0100
@@ -184,7 +184,7 @@
PINFO("Detecting Adaptec I2O RAID controllers...\n");
/* search for all Adatpec I2O RAID cards */
- while ((pDev = pci_find_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) {
+ while ((pDev = pci_get_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) {
if(pDev->device == PCI_DPT_DEVICE_ID ||
pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){
if(adpt_install_hba(sht, pDev) ){
@@ -192,8 +192,11 @@
PERROR("Will not try to detect others.\n");
return hba_count-1;
}
+ pci_dev_get(pDev);
}
}
+ if (pDev)
+ pci_dev_put(pDev);
/* In INIT state, Activate IOPs */
for (pHba = hba_chain; pHba; pHba = pHba->next) {
@@ -1075,6 +1078,7 @@
}
}
}
+ pci_dev_put(pHba->pDev);
kfree(pHba);
if(hba_count <= 0){
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures
2006-09-15 14:34 [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures Alan Cox
@ 2006-09-18 19:01 ` Christoph Hellwig
2006-09-18 19:45 ` Alan Cox
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Christoph Hellwig @ 2006-09-18 19:01 UTC (permalink / raw)
To: Alan Cox; +Cc: James.Bottomley, linux-scsi
On Fri, Sep 15, 2006 at 03:34:32PM +0100, Alan Cox wrote:
> Signed-off-by: Alan Cox <alan@redhat.com>
>
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c
> --- linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-11 17:00:17.000000000 +0100
> +++ linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-14 16:50:25.000000000 +0100
> @@ -9194,7 +9194,7 @@
> for (i = 0; i < ARRAY_SIZE(aic_pdevs); i++)
> {
> pdev = NULL;
> - while ((pdev = pci_find_device(aic_pdevs[i].vendor_id,
> + while ((pdev = pci_get_device(aic_pdevs[i].vendor_id,
> aic_pdevs[i].device_id,
NACK. This doesn't help us forward at all. In case you have
the hardware please do a full conversion to the real pci probing API.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures
2006-09-18 19:01 ` Christoph Hellwig
@ 2006-09-18 19:45 ` Alan Cox
2006-09-19 2:10 ` Doug Ledford
2006-09-19 8:32 ` Hannes Reinecke
2 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2006-09-18 19:45 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: James.Bottomley, linux-scsi
Ar Llu, 2006-09-18 am 20:01 +0100, ysgrifennodd Christoph Hellwig:
> NACK. This doesn't help us forward at all. In case you have
> the hardware please do a full conversion to the real pci probing API.
Then please mark every SCSI user of pci_find_device() as && BROKEN and
delete them in 6 months because I want to remove pci_find_device because
its a hazard. The patch I proposed ensures the driver doesn't crash the
box iterating the list unsafely. If you won't accept safe iteration the
driver should be deleted.
I guess the other alternative would be to add !HOTPLUG to all the
offenders and remove pci_find_device if hotplug is enabled.
Be honest - nobody is ever going to convert that driver or the other
ancient scsi drivers or the serial drivers to the pci module API even if
you play political games NAKing other fixes to try and make it happen.
James - what would you prefer - removal, && BROKEN, && !HOTPLUG or at
least fixing one thing that needs a fix ?
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures
2006-09-18 19:01 ` Christoph Hellwig
2006-09-18 19:45 ` Alan Cox
@ 2006-09-19 2:10 ` Doug Ledford
2006-09-19 8:32 ` Hannes Reinecke
2 siblings, 0 replies; 5+ messages in thread
From: Doug Ledford @ 2006-09-19 2:10 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Alan Cox, James.Bottomley, linux-scsi
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
On Mon, 2006-09-18 at 20:01 +0100, Christoph Hellwig wrote:
> On Fri, Sep 15, 2006 at 03:34:32PM +0100, Alan Cox wrote:
> > Signed-off-by: Alan Cox <alan@redhat.com>
> >
> > diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c
> > --- linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-11 17:00:17.000000000 +0100
> > +++ linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-14 16:50:25.000000000 +0100
> > @@ -9194,7 +9194,7 @@
> > for (i = 0; i < ARRAY_SIZE(aic_pdevs); i++)
> > {
> > pdev = NULL;
> > - while ((pdev = pci_find_device(aic_pdevs[i].vendor_id,
> > + while ((pdev = pci_get_device(aic_pdevs[i].vendor_id,
> > aic_pdevs[i].device_id,
>
> NACK. This doesn't help us forward at all. In case you have
> the hardware please do a full conversion to the real pci probing API.
OMG, does anyone still use that thing?
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: CFBFF194
http://people.redhat.com/dledford
Infiniband specific RPMs available at
http://people.redhat.com/dledford/Infiniband
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures
2006-09-18 19:01 ` Christoph Hellwig
2006-09-18 19:45 ` Alan Cox
2006-09-19 2:10 ` Doug Ledford
@ 2006-09-19 8:32 ` Hannes Reinecke
2 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2006-09-19 8:32 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Alan Cox, James.Bottomley, linux-scsi
Christoph Hellwig wrote:
> On Fri, Sep 15, 2006 at 03:34:32PM +0100, Alan Cox wrote:
>> Signed-off-by: Alan Cox <alan@redhat.com>
>>
>> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c
>> --- linux.vanilla-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-11 17:00:17.000000000 +0100
>> +++ linux-2.6.18-rc6-mm1/drivers/scsi/aic7xxx_old.c 2006-09-14 16:50:25.000000000 +0100
>> @@ -9194,7 +9194,7 @@
>> for (i = 0; i < ARRAY_SIZE(aic_pdevs); i++)
>> {
>> pdev = NULL;
>> - while ((pdev = pci_find_device(aic_pdevs[i].vendor_id,
>> + while ((pdev = pci_get_device(aic_pdevs[i].vendor_id,
>> aic_pdevs[i].device_id,
>
> NACK. This doesn't help us forward at all. In case you have
> the hardware please do a full conversion to the real pci probing API.
>
Ceterum censeo.
Why can't we just remove this driver? It pretty much obsoleted by now, or?
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux Products GmbH S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-19 8:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-15 14:34 [PATCH] scsi: Switch some more scsi drivers to pci_get_device and refcounted pci structures Alan Cox
2006-09-18 19:01 ` Christoph Hellwig
2006-09-18 19:45 ` Alan Cox
2006-09-19 2:10 ` Doug Ledford
2006-09-19 8:32 ` Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox