public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/scsi/BusLogic.c: No resource probing before pci_enable_device (241p11)
@ 2001-01-29 21:48 Rasmus Andersen
  2001-01-30  4:51 ` Leonard N. Zubkoff
  0 siblings, 1 reply; 3+ messages in thread
From: Rasmus Andersen @ 2001-01-29 21:48 UTC (permalink / raw)
  To: lnz; +Cc: linux-kernel, linux-scsi

Hi.

The following patch makes drivers/scsi/BusLogic.c wait with probing
pdev->irq and pdev->resource[] until we call pci_enable_device. This
is recommended due to hot-plug considerations (according to Jeff Garzik).

It applies against ac12 and 241p11.

Comments?


--- linux-ac12-clean/drivers/scsi/BusLogic.c	Sat Jan 27 21:16:24 2001
+++ linux-ac12/drivers/scsi/BusLogic.c	Sat Jan 27 21:32:33 2001
@@ -770,15 +770,19 @@
       BusLogic_ModifyIOAddressRequest_T ModifyIOAddressRequest;
       unsigned char Bus = PCI_Device->bus->number;
       unsigned char Device = PCI_Device->devfn >> 3;
-      unsigned int IRQ_Channel = PCI_Device->irq;
-      unsigned long BaseAddress0 = pci_resource_start(PCI_Device, 0);
-      unsigned long BaseAddress1 = pci_resource_start(PCI_Device, 1);
-      BusLogic_IO_Address_T IO_Address = BaseAddress0;
-      BusLogic_PCI_Address_T PCI_Address = BaseAddress1;
+      unsigned int IRQ_Channel;
+      unsigned long BaseAddress0;
+      unsigned long BaseAddress1;
+      BusLogic_IO_Address_T IO_Address;
+      BusLogic_PCI_Address_T PCI_Address;
 
       if (pci_enable_device(PCI_Device))
       	continue;
       
+      IRQ_Channel = PCI_Device->irq;
+      IO_Address  = BaseAddress0 = pci_resource_start(PCI_Device, 0);
+      PCI_Address = BaseAddress1 = pci_resource_start(PCI_Device, 1);
+
       if (pci_resource_flags(PCI_Device, 0) & IORESOURCE_MEM)
 	{
 	  BusLogic_Error("BusLogic: Base Address0 0x%X not I/O for "

-- 
Regards,
        Rasmus(rasmus@jaquet.dk)

"The obvious mathematical breakthrough would be development of an easy way
to factor large prime numbers." 
  -- Bill Gates, The Road Ahead, Viking Penguin (1995)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/scsi/BusLogic.c: No resource probing before pci_enable_device (241p11)
@ 2001-01-30 14:58 rakesh rakesh
  0 siblings, 0 replies; 3+ messages in thread
From: rakesh rakesh @ 2001-01-30 14:58 UTC (permalink / raw)
  To: Rasmus Andersen, lnz; +Cc: linux-kernel, linux-scsi

hi List,
What I can make out from the below statement is that
its better to first enable the device and then
allocate the resources for that.Since from the hot
pluggable point of view if the device is not enabled
,then it does not mean anything to allocate the
resources for it.It would be simply wasting the
resources which serves no good purpose.
If my understanding is incorrect or if there are few
more important  issues attached from the Hot-pluggable
point of view,then please let me know.

Thanks

--- Rasmus Andersen <rasmus@jaquet.dk> wrote:
> Hi.
> 
> The following patch makes drivers/scsi/BusLogic.c
> wait with probing
> pdev->irq and pdev->resource[] until we call
> pci_enable_device. This
> is recommended due to hot-plug considerations
> (according to Jeff Garzik).
> 
> It applies against ac12 and 241p11.
> 
> Comments?
> 
> 
> --- linux-ac12-clean/drivers/scsi/BusLogic.c	Sat Jan
> 27 21:16:24 2001
> +++ linux-ac12/drivers/scsi/BusLogic.c	Sat Jan 27
> 21:32:33 2001
> @@ -770,15 +770,19 @@
>        BusLogic_ModifyIOAddressRequest_T
> ModifyIOAddressRequest;
>        unsigned char Bus = PCI_Device->bus->number;
>        unsigned char Device = PCI_Device->devfn >>
> 3;
> -      unsigned int IRQ_Channel = PCI_Device->irq;
> -      unsigned long BaseAddress0 =
> pci_resource_start(PCI_Device, 0);
> -      unsigned long BaseAddress1 =
> pci_resource_start(PCI_Device, 1);
> -      BusLogic_IO_Address_T IO_Address =
> BaseAddress0;
> -      BusLogic_PCI_Address_T PCI_Address =
> BaseAddress1;
> +      unsigned int IRQ_Channel;
> +      unsigned long BaseAddress0;
> +      unsigned long BaseAddress1;
> +      BusLogic_IO_Address_T IO_Address;
> +      BusLogic_PCI_Address_T PCI_Address;
>  
>        if (pci_enable_device(PCI_Device))
>        	continue;
>        
> +      IRQ_Channel = PCI_Device->irq;
> +      IO_Address  = BaseAddress0 =
> pci_resource_start(PCI_Device, 0);
> +      PCI_Address = BaseAddress1 =
> pci_resource_start(PCI_Device, 1);
> +
>        if (pci_resource_flags(PCI_Device, 0) &
> IORESOURCE_MEM)
>  	{
>  	  BusLogic_Error("BusLogic: Base Address0 0x%X not
> I/O for "
> 
> -- 
> Regards,
>         Rasmus(rasmus@jaquet.dk)
> 
> "The obvious mathematical breakthrough would be
> development of an easy way
> to factor large prime numbers." 
>   -- Bill Gates, The Road Ahead, Viking Penguin
> (1995)
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org

--- Rasmus Andersen <rasmus@jaquet.dk> wrote:


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-01-30 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-29 21:48 [PATCH] drivers/scsi/BusLogic.c: No resource probing before pci_enable_device (241p11) Rasmus Andersen
2001-01-30  4:51 ` Leonard N. Zubkoff
  -- strict thread matches above, loose matches on Subject: below --
2001-01-30 14:58 rakesh rakesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox