Skip to contentSkip to conversation

make sym53c8xx.c and ncr53c8xx.c call pci_enable_device (241p11)

PATCH In review Rasmus Andersen 3 participants 4 messages Jan 29, 2001 – Jan 31, 2001 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make sym53c8xx.c and ncr53c8xx.c call pci_enable_device (241p11)

Hi.

The following patch makes drivers/scsi/sym53c8xx.c and (by way of sym53c8xx_comm.h::sym53c8xx__detect) ncr53c8xx.c do a pci_enable_device after finding a device.

It applies against ac12 and 241p11.

Comments?

drivers/scsi/sym53c8xx.c +2 -0
@@ -13294,6 +13294,8 @@
 			++j;
 			continue;
 		}
+		if (pci_enable_device(pcidev))
+			continue;
 		/* Some HW as the HP LH4 may report twice PCI devices */
 		for (i = 0; i < count ; i++) {
 			if (devtbl[i].slot.bus	     == PciBusNumber(pcidev) && 
drivers/scsi/sym53c8xx_comm.h +2 -0
@@ -2754,6 +2754,8 @@
 			++j;
 			continue;
 		}
+		if (pci_enable_device(pcidev))
+			continue;
 		/* Some HW as the HP LH4 may report twice PCI devices */
 		for (i = 0; i < count ; i++) {
 			if (devtbl[i].slot.bus	     == PciBusNumber(pcidev) && 
Signature · 8 lines
Regards,
        Rasmus([email protected])

When C++ is your hammer, everything looks like a thumb.      Steven M. Haflich
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#1 lore raw

You missed that SYMBIOS devices can be attached by RAID firmware and, that, in such situation, the kernel should avoid tampering the SYMBIOS device. The [ncr|sym]53c8xx drivers are aware of that, and donnot attach SYMBIOS devices owned by RAID.

If the pci_enable_device() thing is to be added to the drivers, it must preferently be placed after the checking against RAID attachement.

(look for 0x52414944 in the driver source which is the signature tested by the drivers, or look into beta SYM-2).

Gérard.

Quoted 42 lines · Rasmus Andersen

Hi.

The following patch makes drivers/scsi/sym53c8xx.c and (by way of sym53c8xx_comm.h::sym53c8xx__detect) ncr53c8xx.c do a pci_enable_device after finding a device.

It applies against ac12 and 241p11.

Comments?

drivers/scsi/sym53c8xx.c +2 -0
@@ -13294,6 +13294,8 @@
 			++j;
 			continue;
 		}
+		if (pci_enable_device(pcidev))
+			continue;
 		/* Some HW as the HP LH4 may report twice PCI devices */
 		for (i = 0; i < count ; i++) {
 			if (devtbl[i].slot.bus	     == PciBusNumber(pcidev) && 
drivers/scsi/sym53c8xx_comm.h +2 -0
@@ -2754,6 +2754,8 @@
 			++j;
 			continue;
 		}
+		if (pci_enable_device(pcidev))
+			continue;
 		/* Some HW as the HP LH4 may report twice PCI devices */
 		for (i = 0; i < count ; i++) {
 			if (devtbl[i].slot.bus	     == PciBusNumber(pcidev) && 
Signature · 8 lines
-- 
Regards,
        Rasmus([email protected])

When C++ is your hammer, everything looks like a thumb.      Steven M. Haflich
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw

Re: [PATCH] make sym53c8xx.c and ncr53c8xx.c call pci_enable_device

Quoted 2 lines

If the pci_enable_device() thing is to be added to the drivers, it must preferently be placed after the checking against RAID attachement.

You cant check the signature until the device has been enabled. Maybe you could poke the LSI guys and find out how windows PnP stuff handles this.

I think the proposed change is ok because if the board is enabled then the enabling code won't touch it.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw

Re: [PATCH] make sym53c8xx.c and ncr53c8xx.c call pci_enable_device

Quoted 5 lines · Alan Cox
Quoted 2 lines

If the pci_enable_device() thing is to be added to the drivers, it must preferently be placed after the checking against RAID attachement.

You cant check the signature until the device has been enabled. Maybe you could poke the LSI guys and find out how windows PnP stuff handles this.

Personnaly I donnot need to know how windows handle this in order to figure out how it should be properly handled.

In theory, the signature should be checked prior to any change in the device configuration space. But since PCI BIOS assigning of resource windows is complete mess-up, the O/S has to probe BAR sizes. The probing of BAR sizes does not seem to harm. This done, given that it is possible then to first check the signature and to leave quiet the device if it is owned by RAID, there is no valuable reason to still tamper the device for nothing if it is not to be attached.

Quoted 2 lines

I think the proposed change is ok because if the board is enabled then the enabling code won't touch it.

Can you swear that the code will never change ?

Anyway, the current code at least enables response to IO and to MEM based on existing BARs. This probably does not harm but this should be done on behalf of the software driver and based on actually _used_ resources. On the other hand, the complex enabling of IRQ is really something we want to avoid in situation where it is not actually useful.

End of story, since moving pci_enable_device() in its preferred place as I suggested is an obvious minute change.

Gérard.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/