2002-07-18 15:38:25

by Dale Amon

[permalink] [raw]
Subject: 2.5.26 : drivers/scsi/BusLogic.c

>As noted below, Frank Davis suggests I fire this back into the
>list for discussion.
>
>On Thu, Jul 18, 2002 at 11:04:17AM -0400, Frank Davis wrote:
>
>>Dale,
>> Here's what I know....
>>not all architectures define an 'address' variable in the struct
>>scatterlist, so some archs will compile with no problems, others won't.
>>If you're using a i386, there isn't an address variable. Here's what I
>>suggest....email linux-kernel with the problem report for 2.5.26, and
>>explain what I have stated above. I could have a bunch of #ifdef for
>>each arch, but thats plain crazy. I'd be interested in what some other
>>developers suggest. Sorry, I couldn't provide you a patch.
>>
>>Regards,
>>Frank
>>

BusLogic.c:32: #error Please convert me to Documentation/DMA-mapping.txt
BusLogic.c: In function `BusLogic_DetectHostAdapter':
BusLogic.c:2841: warning: long unsigned int format, BusLogic_IO_Address_T arg (arg 2)
BusLogic.c: In function `BusLogic_QueueCommand':
BusLogic.c:3415: structure has no member named `address'
BusLogic.c: In function `BusLogic_BIOSDiskParameters':
BusLogic.c:4141: warning: implicit declaration of function `scsi_bios_ptable'
BusLogic.c:4141: warning: assignment makes pointer from integer without a cast
make[2]: *** [BusLogic.o] Error 1


2002-07-18 15:56:55

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

On Thu, 18 Jul 2002, Dale Amon wrote:

> BusLogic.c:32: #error Please convert me to Documentation/DMA-mapping.txt
> BusLogic.c: In function `BusLogic_DetectHostAdapter':
> BusLogic.c:2841: warning: long unsigned int format, BusLogic_IO_Address_T arg (arg 2)
> BusLogic.c: In function `BusLogic_QueueCommand':
> BusLogic.c:3415: structure has no member named `address'
> BusLogic.c: In function `BusLogic_BIOSDiskParameters':
> BusLogic.c:4141: warning: implicit declaration of function `scsi_bios_ptable'
> BusLogic.c:4141: warning: assignment makes pointer from integer without a cast
> make[2]: *** [BusLogic.o] Error 1

I'm having a look at this, but there seem to be quite a number of
hindrances. Hopefully i'll have something before next release.

Cheers,
Zwane Mwaikambo

--
function.linuxpower.ca

2002-07-18 16:58:00

by James Bottomley

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

> BusLogic.c:32: #error Please convert me to Documentation/
> DMA-mapping.txt BusLogic.c: In function `BusLogic_DetectHostAdapter':
> BusLogic.c:2841: warning: long unsigned int format,
> BusLogic_IO_Address_T arg (arg 2) BusLogic.c: In function
> `BusLogic_QueueCommand': BusLogic.c:3415: structure has no member
> named `address' BusLogic.c: In function `BusLogic_BIOSDiskParameters':
> BusLogic.c:4141: warning: implicit declaration of function
> `scsi_bios_ptable' BusLogic.c:4141: warning: assignment makes pointer
> from integer without a cast make[2]: *** [BusLogic.o] Error 1

I have a single MCA Buslogic card on my shelf. Assuming it hasn't got bitrot,
I may be able to look at this soon.

In the meantime, if you want to try, the trick looks to be to use
pci_map_single in BusLogic_CreateInitialCCBs; but then set up a reverse
mapping table for them in BusLogic_InitializeCCBs so that Bus_to_Virtual will
still work (its only use is to convert bus physical CCB addresses into CPU
virtual ones).

Next, in BusLogic_QueueCommand you need to use pci_map_single for non-sg
transformations, and pci_map_sg for sg plus in the loop over segments, use the
macros

sg_dma_address(&ScatterList[Segment]) in place of ScatterList[Segment].address
sg_dma_len(&ScatterList[Segment]) in place ofScatterList[Segment].length

Initially, don't worry about unmapping, but this should get the thing working.

There are probably other places in the driver I've missed (like sense
buffers), but that should be the core of the necessary changes.

I'm off on holiday for 10 days, so I'll only be getting email sporadically, if
at all.

James


2002-07-18 23:21:15

by Doug Ledford

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

On Thu, Jul 18, 2002 at 12:00:02PM -0500, James Bottomley wrote:
> In the meantime, if you want to try, the trick looks to be to use
> pci_map_single in BusLogic_CreateInitialCCBs; but then set up a reverse
> mapping table for them in BusLogic_InitializeCCBs so that Bus_to_Virtual will
> still work (its only use is to convert bus physical CCB addresses into CPU
> virtual ones).
>
> Next, in BusLogic_QueueCommand you need to use pci_map_single for non-sg
> transformations, and pci_map_sg for sg plus in the loop over segments, use the
> macros
>
> sg_dma_address(&ScatterList[Segment]) in place of ScatterList[Segment].address
> sg_dma_len(&ScatterList[Segment]) in place ofScatterList[Segment].length
>
> Initially, don't worry about unmapping, but this should get the thing working.
>
> There are probably other places in the driver I've missed (like sense
> buffers), but that should be the core of the necessary changes.

There are. I'm currently writing a patch (hopefully a first test version
will be out in an hour or so). It's not quite as easy as it looks at
first mainly because this driver supports PCI, EISA, VLB, MCA, and ISA
cards :-/

--
Doug Ledford <[email protected]> 919-754-3700 x44233
Red Hat, Inc.
1801 Varsity Dr.
Raleigh, NC 27606

2002-07-19 01:00:46

by Doug Ledford

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

On Thu, Jul 18, 2002 at 06:16:28PM +0200, Zwane Mwaikambo wrote:
> On Thu, 18 Jul 2002, Dale Amon wrote:
>
> > BusLogic.c:32: #error Please convert me to Documentation/DMA-mapping.txt
> > BusLogic.c: In function `BusLogic_DetectHostAdapter':
> > BusLogic.c:2841: warning: long unsigned int format, BusLogic_IO_Address_T arg (arg 2)
> > BusLogic.c: In function `BusLogic_QueueCommand':
> > BusLogic.c:3415: structure has no member named `address'
> > BusLogic.c: In function `BusLogic_BIOSDiskParameters':
> > BusLogic.c:4141: warning: implicit declaration of function `scsi_bios_ptable'
> > BusLogic.c:4141: warning: assignment makes pointer from integer without a cast
> > make[2]: *** [BusLogic.o] Error 1
>
> I'm having a look at this, but there seem to be quite a number of
> hindrances. Hopefully i'll have something before next release.

Attached you will find a patch that compiles cleanly, but is totally
untested. Testing would be appreciated. I suspect FlashPoint controllers
*might* have a problem, but MultiMaster (or whatever they are called)
should work properly. WARNING: This could eat a filesystem, it's totally
untested DMA mapping code and I have *no* BusLogic controllers to do any
sort of verifications with. The brave at heart are needed to let me know
if this thing works ;-)

--
Doug Ledford <[email protected]> 919-754-3700 x44233
Red Hat, Inc.
1801 Varsity Dr.
Raleigh, NC 27606


Attachments:
(No filename) (1.42 kB)
BusLogic.patch (17.15 kB)
Download all attachments

2002-07-19 01:16:36

by Doug Ledford

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

There was a bug in the patch I sent through last. This patch should be
applied on top of the last one to solve a memory leak on unloading of the
module.



--
Doug Ledford <[email protected]> 919-754-3700 x44233
Red Hat, Inc.
1801 Varsity Dr.
Raleigh, NC 27606


Attachments:
(No filename) (304.00 B)
BusLogic-2.patch (930.00 B)
Download all attachments

2002-07-19 07:12:21

by Michael G. Janicki

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

On Thu, 18 Jul 2002, Doug Ledford wrote:

> There was a bug in the patch I sent through last. This patch should be
> applied on top of the last one to solve a memory leak on unloading of the
> module.

All I had available was a 2.4.19-rc2, but your patch applies,
with offsets, against it. 2 non-critical failed hunks were simple
enough by hand.

Builds, boots, runs -- has survived 2 bonnie++ runs and normal
user load for the last few hours with no problems. I've been
avoiding use of 2.5 on this box, but if you need to see this against
2.5.26, let me know and I can convert this box this weekend.

System is SMP, dual PCI BusLogic BT-958's, 2.4.19-rc2 with
O(1) scheduler patch and your BusLogic DMA patch. BusLogic
is non-module, the boot disk hangs off the first adapter. Let
me know if you need specific testing.

Mike

--
Michael Janicki
Key: http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0x9D6FAE1A
Fingerprint: A153 DFC7 8B49 7E97 67B2 3DCE DA3F 3CC5 9D6F AE1A


2002-07-19 08:20:19

by Zwane Mwaikambo

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

On Thu, 18 Jul 2002, Doug Ledford wrote:

> Attached you will find a patch that compiles cleanly, but is totally
> untested. Testing would be appreciated. I suspect FlashPoint controllers
> *might* have a problem, but MultiMaster (or whatever they are called)
> should work properly. WARNING: This could eat a filesystem, it's totally
> untested DMA mapping code and I have *no* BusLogic controllers to do any
> sort of verifications with. The brave at heart are needed to let me know
> if this thing works ;-)

Boots and is in multiuser right now =) I'll thrash it about right now and
see if anything falls over. However i commented out scsi_mark_host_reset,
but it doesn't seem to be defined anywhere.

Thanks,
Zwane

scsi: ***** BusLogic SCSI Driver Version 2.1.16 of 18 July 2002 *****
scsi: Copyright 1995-1998 by Leonard N. Zubkoff <[email protected]>
scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host
Adapter
scsi0: Firmware Version: 5.07B, I/O Address: 0x1080, IRQ Channel:
11/Level
scsi0: PCI Bus: 0, Device: 16, Address: 0xFD000000, Host Adapter SCSI
ID: 7
scsi0: Parity Checking: Enabled, Extended Translation: Enabled
scsi0: Synchronous Negotiation: Ultra, Wide Negotiation: Enabled
scsi0: Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled
scsi0: Scatter/Gather Limit: 128 of 8192 segments, Mailboxes: 211
scsi0: Driver Queue Depth: 211, Host Adapter Queue Depth: 192
scsi0: Tagged Queue Depth: Automatic, Untagged Queue Depth: 3
scsi0: Error Recovery Strategy: Default, SCSI Bus Reset: Enabled
scsi0: *** BusLogic BT-958 Initialized Successfully ***
scsi0 : BusLogic BT-958

--
function.linuxpower.ca



2002-07-19 14:27:19

by John Stoffel

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c


Doug> There are. I'm currently writing a patch (hopefully a first
Doug> test version will be out in an hour or so). It's not quite as
Doug> easy as it looks at first mainly because this driver supports
Doug> PCI, EISA, VLB, MCA, and ISA cards :-/

I've got a PCI BusLogic SCSI card at home I've been unable to use for
a while on 2.4, so I'm really interested in this patch.

Maybe it's time to break out old the EISA, VLB, MCA and ISA support
into their own modules/sections? I think the PCI version will be the
most in demand.

Thanks though for your work!

John

2002-07-20 15:06:47

by Dale Amon

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

Doug: Found your patch. I was waiting on the wrong thread. Compiling
as we speak, will give it a good thrashing with a kernel build or some
such when it's done and will let you know the result.


2002-07-25 14:25:08

by Dale Amon

[permalink] [raw]
Subject: Re: 2.5.26 : drivers/scsi/BusLogic.c

Doug, did your Buslogic patches make it into the latest kernel?
I'll probably be testing it later today and t'would be nice
to know...