* Re: PROBLEM: 2.5.3 DAC960 won't compile
2002-02-01 23:54 PROBLEM: 2.5.3 DAC960 won't compile Brak
@ 2002-02-02 3:21 ` Evgeniy Polyakov
2002-02-02 9:56 ` Jens Axboe
2002-02-02 3:42 ` Evgeniy Polyakov
1 sibling, 1 reply; 4+ messages in thread
From: Evgeniy Polyakov @ 2002-02-02 3:21 UTC (permalink / raw)
To: Brak; +Cc: linux-kernel, Leonard N. Zubkoff, Dave Jones
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
On Fri, 1 Feb 2002 17:54:18 -0600 (CST)
Brak <brak@waste.org> wrote:
>
> When compiling the 2.5.3 kernel it errors out on the DAC960
>
I hope this patch will help you.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for complete details.
So, this patch may broke things...
;)
Good luck.
> --
> -brak
Evgeniy Polyakov ( s0mbre ).
[-- Attachment #2: drivers_block_DAC960.diff --]
[-- Type: application/octet-stream, Size: 8940 bytes --]
--- ./linux.orig/drivers/block/DAC960.c Tue Jan 1 04:56:19 2002
+++ ./linux/drivers/block/DAC960.c Sat Feb 2 06:13:08 2002
@@ -306,9 +306,9 @@
static void DAC960_WaitForCommand(DAC960_Controller_T *Controller)
{
- spin_unlock_irq(&Controller->RequestQueue->queue_lock);
+ spin_unlock_irq(Controller->RequestQueue->queue_lock);
__wait_event(Controller->CommandWaitQueue, Controller->FreeCommands);
- spin_lock_irq(&Controller->RequestQueue->queue_lock);
+ spin_lock_irq(Controller->RequestQueue->queue_lock);
}
@@ -1944,8 +1944,9 @@
/*
Initialize the I/O Request Queue.
*/
+ spin_lock_init(Controller->queue_lock);
RequestQueue = BLK_DEFAULT_QUEUE(MajorNumber);
- blk_init_queue(RequestQueue, DAC960_RequestFunction);
+ blk_init_queue(RequestQueue, DAC960_RequestFunction, Controller->queue_lock);
RequestQueue->queuedata = Controller;
blk_queue_max_hw_segments(RequestQueue,
Controller->DriverScatterGatherLimit);
@@ -1957,9 +1958,6 @@
Initialize the Disk Partitions array, Partition Sizes array, Block Sizes
array, and Max Sectors per Request array.
*/
- for (MinorNumber = 0; MinorNumber < DAC960_MinorCount; MinorNumber++)
- Controller->MaxSectorsPerRequest[MinorNumber] =
- Controller->MaxBlocksPerCommand;
Controller->GenericDiskInfo.part = Controller->DiskPartitions;
Controller->GenericDiskInfo.sizes = Controller->PartitionSizes;
blksize_size[MajorNumber] = Controller->BlockSizes;
@@ -2066,10 +2064,11 @@
{
if (Controller->FirmwareType == DAC960_V1_Controller)
{
+ Controller->KernelDevice = mk_kdev(DAC960_MajorNumber(controller->ControllerNumber),
+ DAC960_MinorNumber(LogicalDriveNumber, 0));
if (LogicalDriveNumber > Controller->LogicalDriveCount - 1) return;
register_disk(&Controller->GenericDiskInfo,
- DAC960_KernelDevice(Controller->ControllerNumber,
- LogicalDriveNumber, 0),
+ Controller->KernelDevice,
DAC960_MaxPartitions,
&DAC960_BlockDeviceOperations,
Controller->V1.LogicalDriveInformation
@@ -2080,9 +2079,9 @@
DAC960_V2_LogicalDeviceInfo_T *LogicalDeviceInfo =
Controller->V2.LogicalDeviceInformation[LogicalDriveNumber];
if (LogicalDeviceInfo == NULL) return;
+
register_disk(&Controller->GenericDiskInfo,
- DAC960_KernelDevice(Controller->ControllerNumber,
- LogicalDriveNumber, 0),
+ Controller->KernelDevice,
DAC960_MaxPartitions,
&DAC960_BlockDeviceOperations,
LogicalDeviceInfo->ConfigurableDeviceSize);
@@ -2742,17 +2741,17 @@
if (bio_data(BufferHeader) == LastDataEndPointer)
{
ScatterGatherList[SegmentNumber-1].SegmentByteCount +=
- bio_size(BufferHeader);
- LastDataEndPointer += bio_size(BufferHeader);
+ BufferHeader->bi_size;
+ LastDataEndPointer += BufferHeader->bi_size;
}
else
{
ScatterGatherList[SegmentNumber].SegmentDataPointer =
Virtual_to_Bus32(bio_data(BufferHeader));
ScatterGatherList[SegmentNumber].SegmentByteCount =
- bio_size(BufferHeader);
+ BufferHeader->bi_zize;
LastDataEndPointer = bio_data(BufferHeader) +
- bio_size(BufferHeader);
+ BufferHeader->bi_size;
if (SegmentNumber++ > Controller->DriverScatterGatherLimit)
panic("DAC960: Scatter/Gather Segment Overflow\n");
}
@@ -2833,17 +2832,17 @@
if (bio_data(BufferHeader) == LastDataEndPointer)
{
ScatterGatherList[SegmentNumber-1].SegmentByteCount +=
- bio_size(BufferHeader);
- LastDataEndPointer += bio_size(BufferHeader);
+ BufferHeader->bi_size;
+ LastDataEndPointer += BufferHeader->bi_size;
}
else
{
ScatterGatherList[SegmentNumber].SegmentDataPointer =
Virtual_to_Bus64(bio_data(BufferHeader));
ScatterGatherList[SegmentNumber].SegmentByteCount =
- bio_size(BufferHeader);
+ BufferHeader->bi_size;
LastDataEndPointer = bio_data(BufferHeader) +
- bio_size(BufferHeader);
+ BufferHeader->bi_size;
if (SegmentNumber++ > Controller->DriverScatterGatherLimit)
panic("DAC960: Scatter/Gather Segment Overflow\n");
}
@@ -2945,7 +2944,7 @@
if (SuccessfulIO)
set_bit(BIO_UPTODATE, &BufferHeader->bi_flags);
blk_finished_io(bio_sectors(BufferHeader));
- BufferHeader->bi_end_io(BufferHeader);
+ BufferHeader->bi_end_io(BufferHeader, bio_sectors(BufferHeader));
}
@@ -3061,7 +3060,7 @@
Command->CommandType = DAC960_WriteRetryCommand;
CommandMailbox->Type5.CommandOpcode = DAC960_V1_Write;
}
- Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ Command->BlockCount = (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
CommandMailbox->Type5.LD.TransferLength = Command->BlockCount;
CommandMailbox->Type5.BusAddress =
Virtual_to_Bus32(bio_data(BufferHeader));
@@ -3110,9 +3109,9 @@
DAC960_V1_CommandMailbox_T *CommandMailbox =
&Command->V1.CommandMailbox;
Command->BlockNumber +=
- bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BlockCount =
- bio_size(NextBufferHeader) >> DAC960_BlockSizeBits;
+ (NextBufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BufferHeader = NextBufferHeader;
CommandMailbox->Type5.LD.TransferLength = Command->BlockCount;
CommandMailbox->Type5.LogicalBlockAddress = Command->BlockNumber;
@@ -4158,7 +4157,7 @@
if (CommandType == DAC960_ReadCommand)
Command->CommandType = DAC960_ReadRetryCommand;
else Command->CommandType = DAC960_WriteRetryCommand;
- Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ Command->BlockCount = (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
CommandMailbox->SCSI_10.CommandControlBits
.AdditionalScatterGatherListMemory = false;
CommandMailbox->SCSI_10.DataTransferSize =
@@ -4214,9 +4213,9 @@
if (NextBufferHeader != NULL)
{
Command->BlockNumber +=
- bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BlockCount =
- bio_size(NextBufferHeader) >> DAC960_BlockSizeBits;
+ (NextBufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BufferHeader = NextBufferHeader;
CommandMailbox->SCSI_10.DataTransferSize =
Command->BlockCount << DAC960_BlockSizeBits;
@@ -5299,7 +5298,7 @@
DAC960_ComputeGenericDiskInfo(Controller);
DAC960_RegisterDisk(Controller, LogicalDriveNumber);
}
- if (Controller->GenericDiskInfo.sizes[MINOR(Inode->i_rdev)] == 0)
+ if (Controller->GenericDiskInfo.sizes[minor(Inode->i_rdev)] == 0)
return -ENXIO;
/*
Increment Controller and Logical Drive Usage Counts.
@@ -5536,11 +5535,11 @@
while (Controller->V1.DirectCommandActive[DCDB.Channel]
[DCDB.TargetID])
{
- spin_unlock_irq(&Controller->RequestQueue->queue_lock);
+ spin_unlock_irq(Controller->RequestQueue->queue_lock);
__wait_event(Controller->CommandWaitQueue,
!Controller->V1.DirectCommandActive
[DCDB.Channel][DCDB.TargetID]);
- spin_lock_irq(&Controller->RequestQueue->queue_lock);
+ spin_lock_irq(Controller->RequestQueue->queue_lock);
}
Controller->V1.DirectCommandActive[DCDB.Channel]
[DCDB.TargetID] = true;
--- ./linux.orig/drivers/block/DAC960.h Fri Jan 4 00:51:36 2002
+++ ./linux/drivers/block/DAC960.h Sat Feb 2 05:54:00 2002
@@ -2363,6 +2363,7 @@
boolean SuppressEnclosureMessages;
Timer_T MonitoringTimer;
GenericDiskInfo_T GenericDiskInfo;
+ KernelDevice_T KernelDevice;
DAC960_Command_T *FreeCommands;
unsigned char *CombinedStatusBuffer;
unsigned char *CurrentStatusBuffer;
@@ -2508,7 +2509,7 @@
void DAC960_AcquireControllerLock(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_lock_irqsave(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_lock_irqsave(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
@@ -2520,7 +2521,7 @@
void DAC960_ReleaseControllerLock(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_unlock_irqrestore(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_unlock_irqrestore(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
@@ -2557,7 +2558,7 @@
void DAC960_AcquireControllerLockIH(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_lock_irqsave(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_lock_irqsave(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
@@ -2570,7 +2571,7 @@
void DAC960_ReleaseControllerLockIH(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_unlock_irqrestore(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_unlock_irqrestore(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: PROBLEM: 2.5.3 DAC960 won't compile
2002-02-01 23:54 PROBLEM: 2.5.3 DAC960 won't compile Brak
2002-02-02 3:21 ` Evgeniy Polyakov
@ 2002-02-02 3:42 ` Evgeniy Polyakov
1 sibling, 0 replies; 4+ messages in thread
From: Evgeniy Polyakov @ 2002-02-02 3:42 UTC (permalink / raw)
To: brak; +Cc: linux-kernel, lnz, davej
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
> On Fri, 1 Feb 2002 17:54:18 -0600 (CST)
> Brak <brak@waste.org> wrote:
>
> >
> > When compiling the 2.5.3 kernel it errors out on the DAC960
> >
Ooops, a little mistake.
There is no one now.
Good luck.
> > --
> > -brak
Evgeniy Polyakov ( s0mbre ).
[-- Attachment #2: drivers_block_DAC960.diff --]
[-- Type: application/octet-stream, Size: 8954 bytes --]
--- ./linux.orig/drivers/block/DAC960.c Tue Jan 1 04:56:19 2002
+++ ./linux/drivers/block/DAC960.c Sat Feb 2 06:13:08 2002
@@ -306,9 +306,9 @@
static void DAC960_WaitForCommand(DAC960_Controller_T *Controller)
{
- spin_unlock_irq(&Controller->RequestQueue->queue_lock);
+ spin_unlock_irq(Controller->RequestQueue->queue_lock);
__wait_event(Controller->CommandWaitQueue, Controller->FreeCommands);
- spin_lock_irq(&Controller->RequestQueue->queue_lock);
+ spin_lock_irq(Controller->RequestQueue->queue_lock);
}
@@ -1944,8 +1944,9 @@
/*
Initialize the I/O Request Queue.
*/
+ spin_lock_init(Controller->queue_lock);
RequestQueue = BLK_DEFAULT_QUEUE(MajorNumber);
- blk_init_queue(RequestQueue, DAC960_RequestFunction);
+ blk_init_queue(RequestQueue, DAC960_RequestFunction, Controller->RequestQueue->queue_lock);
RequestQueue->queuedata = Controller;
blk_queue_max_hw_segments(RequestQueue,
Controller->DriverScatterGatherLimit);
@@ -1957,9 +1958,6 @@
Initialize the Disk Partitions array, Partition Sizes array, Block Sizes
array, and Max Sectors per Request array.
*/
- for (MinorNumber = 0; MinorNumber < DAC960_MinorCount; MinorNumber++)
- Controller->MaxSectorsPerRequest[MinorNumber] =
- Controller->MaxBlocksPerCommand;
Controller->GenericDiskInfo.part = Controller->DiskPartitions;
Controller->GenericDiskInfo.sizes = Controller->PartitionSizes;
blksize_size[MajorNumber] = Controller->BlockSizes;
@@ -2066,10 +2064,11 @@
{
if (Controller->FirmwareType == DAC960_V1_Controller)
{
+ Controller->KernelDevice = mk_kdev(DAC960_MajorNumber(controller->ControllerNumber),
+ DAC960_MinorNumber(LogicalDriveNumber, 0));
if (LogicalDriveNumber > Controller->LogicalDriveCount - 1) return;
register_disk(&Controller->GenericDiskInfo,
- DAC960_KernelDevice(Controller->ControllerNumber,
- LogicalDriveNumber, 0),
+ Controller->KernelDevice,
DAC960_MaxPartitions,
&DAC960_BlockDeviceOperations,
Controller->V1.LogicalDriveInformation
@@ -2080,9 +2079,9 @@
DAC960_V2_LogicalDeviceInfo_T *LogicalDeviceInfo =
Controller->V2.LogicalDeviceInformation[LogicalDriveNumber];
if (LogicalDeviceInfo == NULL) return;
+
register_disk(&Controller->GenericDiskInfo,
- DAC960_KernelDevice(Controller->ControllerNumber,
- LogicalDriveNumber, 0),
+ Controller->KernelDevice,
DAC960_MaxPartitions,
&DAC960_BlockDeviceOperations,
LogicalDeviceInfo->ConfigurableDeviceSize);
@@ -2742,17 +2741,17 @@
if (bio_data(BufferHeader) == LastDataEndPointer)
{
ScatterGatherList[SegmentNumber-1].SegmentByteCount +=
- bio_size(BufferHeader);
- LastDataEndPointer += bio_size(BufferHeader);
+ BufferHeader->bi_size;
+ LastDataEndPointer += BufferHeader->bi_size;
}
else
{
ScatterGatherList[SegmentNumber].SegmentDataPointer =
Virtual_to_Bus32(bio_data(BufferHeader));
ScatterGatherList[SegmentNumber].SegmentByteCount =
- bio_size(BufferHeader);
+ BufferHeader->bi_zize;
LastDataEndPointer = bio_data(BufferHeader) +
- bio_size(BufferHeader);
+ BufferHeader->bi_size;
if (SegmentNumber++ > Controller->DriverScatterGatherLimit)
panic("DAC960: Scatter/Gather Segment Overflow\n");
}
@@ -2833,17 +2832,17 @@
if (bio_data(BufferHeader) == LastDataEndPointer)
{
ScatterGatherList[SegmentNumber-1].SegmentByteCount +=
- bio_size(BufferHeader);
- LastDataEndPointer += bio_size(BufferHeader);
+ BufferHeader->bi_size;
+ LastDataEndPointer += BufferHeader->bi_size;
}
else
{
ScatterGatherList[SegmentNumber].SegmentDataPointer =
Virtual_to_Bus64(bio_data(BufferHeader));
ScatterGatherList[SegmentNumber].SegmentByteCount =
- bio_size(BufferHeader);
+ BufferHeader->bi_size;
LastDataEndPointer = bio_data(BufferHeader) +
- bio_size(BufferHeader);
+ BufferHeader->bi_size;
if (SegmentNumber++ > Controller->DriverScatterGatherLimit)
panic("DAC960: Scatter/Gather Segment Overflow\n");
}
@@ -2945,7 +2944,7 @@
if (SuccessfulIO)
set_bit(BIO_UPTODATE, &BufferHeader->bi_flags);
blk_finished_io(bio_sectors(BufferHeader));
- BufferHeader->bi_end_io(BufferHeader);
+ BufferHeader->bi_end_io(BufferHeader, bio_sectors(BufferHeader));
}
@@ -3061,7 +3060,7 @@
Command->CommandType = DAC960_WriteRetryCommand;
CommandMailbox->Type5.CommandOpcode = DAC960_V1_Write;
}
- Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ Command->BlockCount = (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
CommandMailbox->Type5.LD.TransferLength = Command->BlockCount;
CommandMailbox->Type5.BusAddress =
Virtual_to_Bus32(bio_data(BufferHeader));
@@ -3110,9 +3109,9 @@
DAC960_V1_CommandMailbox_T *CommandMailbox =
&Command->V1.CommandMailbox;
Command->BlockNumber +=
- bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BlockCount =
- bio_size(NextBufferHeader) >> DAC960_BlockSizeBits;
+ (NextBufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BufferHeader = NextBufferHeader;
CommandMailbox->Type5.LD.TransferLength = Command->BlockCount;
CommandMailbox->Type5.LogicalBlockAddress = Command->BlockNumber;
@@ -4158,7 +4157,7 @@
if (CommandType == DAC960_ReadCommand)
Command->CommandType = DAC960_ReadRetryCommand;
else Command->CommandType = DAC960_WriteRetryCommand;
- Command->BlockCount = bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ Command->BlockCount = (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
CommandMailbox->SCSI_10.CommandControlBits
.AdditionalScatterGatherListMemory = false;
CommandMailbox->SCSI_10.DataTransferSize =
@@ -4214,9 +4213,9 @@
if (NextBufferHeader != NULL)
{
Command->BlockNumber +=
- bio_size(BufferHeader) >> DAC960_BlockSizeBits;
+ (BufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BlockCount =
- bio_size(NextBufferHeader) >> DAC960_BlockSizeBits;
+ (NextBufferHeader->bi_size) >> DAC960_BlockSizeBits;
Command->BufferHeader = NextBufferHeader;
CommandMailbox->SCSI_10.DataTransferSize =
Command->BlockCount << DAC960_BlockSizeBits;
@@ -5299,7 +5298,7 @@
DAC960_ComputeGenericDiskInfo(Controller);
DAC960_RegisterDisk(Controller, LogicalDriveNumber);
}
- if (Controller->GenericDiskInfo.sizes[MINOR(Inode->i_rdev)] == 0)
+ if (Controller->GenericDiskInfo.sizes[minor(Inode->i_rdev)] == 0)
return -ENXIO;
/*
Increment Controller and Logical Drive Usage Counts.
@@ -5536,11 +5535,11 @@
while (Controller->V1.DirectCommandActive[DCDB.Channel]
[DCDB.TargetID])
{
- spin_unlock_irq(&Controller->RequestQueue->queue_lock);
+ spin_unlock_irq(Controller->RequestQueue->queue_lock);
__wait_event(Controller->CommandWaitQueue,
!Controller->V1.DirectCommandActive
[DCDB.Channel][DCDB.TargetID]);
- spin_lock_irq(&Controller->RequestQueue->queue_lock);
+ spin_lock_irq(Controller->RequestQueue->queue_lock);
}
Controller->V1.DirectCommandActive[DCDB.Channel]
[DCDB.TargetID] = true;
--- ./linux.orig/drivers/block/DAC960.h Fri Jan 4 00:51:36 2002
+++ ./linux/drivers/block/DAC960.h Sat Feb 2 05:54:00 2002
@@ -2363,6 +2363,7 @@
boolean SuppressEnclosureMessages;
Timer_T MonitoringTimer;
GenericDiskInfo_T GenericDiskInfo;
+ KernelDevice_T KernelDevice;
DAC960_Command_T *FreeCommands;
unsigned char *CombinedStatusBuffer;
unsigned char *CurrentStatusBuffer;
@@ -2508,7 +2509,7 @@
void DAC960_AcquireControllerLock(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_lock_irqsave(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_lock_irqsave(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
@@ -2520,7 +2521,7 @@
void DAC960_ReleaseControllerLock(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_unlock_irqrestore(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_unlock_irqrestore(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
@@ -2557,7 +2558,7 @@
void DAC960_AcquireControllerLockIH(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_lock_irqsave(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_lock_irqsave(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
@@ -2570,7 +2571,7 @@
void DAC960_ReleaseControllerLockIH(DAC960_Controller_T *Controller,
ProcessorFlags_T *ProcessorFlags)
{
- spin_unlock_irqrestore(&Controller->RequestQueue->queue_lock, *ProcessorFlags);
+ spin_unlock_irqrestore(Controller->RequestQueue->queue_lock, *ProcessorFlags);
}
^ permalink raw reply [flat|nested] 4+ messages in thread