Skip to contentSkip to conversation

ACARD SCSI driver update for Linux kernel v2.6

DISCUSSION jameshsu 2 participants 3 messages Jan 14, 2005 – Jan 19, 2005 SCSI

lore
Share & tools
lore

jameshsu

author
#0 lore raw

Hi all,

We, Acard, total understand what you suggest. (including advise from Christoph, James B. and Alan.)
Therefore, we modify the internal code to create this patch file from kernel v2.6.10.
However, as you see this is the smallest patch files which could be generated. (Sorry, unable to meet your expetation)
The reason is : this driver could supports ATP870 as well as mutiples of Acard's chipsets. (this includes ATP880(AEC67160) & ATP885(AEC67162)). This is why the patch files is huge than what you expected.
We did not make any change for ATP870(AEC6712) on this rev.. Besides, we reverse following codes according to all of your suggestions. Please review and let me know if this is feasible. Welcome to any of question you may have.
Thanks for your help!

Best regards,

Manager,Engineering Testing Dept.
ACARD TECHNOLOGY CORP.
Taipei Hsien,Taiwan
6F No78,Sec 1,Kwang Fu Road,Sang Chung,
(02)8512-2290 x 2311(O),(02)8512-1524(FAX)

----- Original Message -----
From: "jameshsu" <[email protected]>
To: "Alan Cox" <[email protected]>
Cc: <[email protected]>; <[email protected]>; "EdwardLian" <[email protected]>; "Jason Wu" <[email protected]>
Sent: Friday, January 07, 2005 6:05 PM
Subject: Re: Fw: ACARD SCSI driver update for Linux kernel v2.6

Quoted 6 lines

Hi Alan,

We are in the process to modify the driver in order to meet your suggests. Following change has been made.
1) Put it back for originator's copyrights to the file.
2) Go back to build up/modify driver from kernel 2.6.10. according to

James

Quoted 57 lines

Bottomley's suggestions
3) use new header

     <scsi/scsi.h>
    <scsi/scsi_host.h>
    <scsi/scsi_device.h>
    <scsi/scsi_cmnd.h>)

4) enable .max_sectors = 128
5) Either modify or remove all following declare:

(quoted diff) +2 -0
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
+static irqreturn_t atp885_intr_handle(int irq, void *dev_id, struct

pt_regs *regs)

(quoted diff) +2 -0
+#else
+static void atp885_intr_handle(int irq, void *dev_id, struct pt_regs

*regs)

(quoted diff) +3 -0
+#endif
 
+static struct Scsi_Host *atp_host[MAX_ADAPTER];
+static int host_index = 0;

6) Reversals of some of improvements like hotplug pci made outside - Addition of support for the AEC67160Acard
7) more.....
New driver will be submit around 1-2 week later.
During these period, if you have more suggestions, please let us know ASAP while testing.
Again, Thanks for your help!

James Hsu,
Manager,Engineering Testing Dept.
ACARD TECHNOLOGY CORP.
Taipei Hsien,Taiwan
6F No78,Sec 1,Kwang Fu Road,Sang Chung,
(02)8512-2290 x 2311(O),(02)8512-1524(FAX)

----- Original Message -----
From: "Alan Cox" <[email protected]>
To: "jameshsu" <[email protected]>
Cc: <[email protected]>
Sent: Friday, January 07, 2005 7:10 AM
Subject: Re: Fw: ACARD SCSI driver update for Linux kernel v2.6

Quoted 14 lines

The trouble with the patch as is, is that it mixes up

- Reversals of improvements like hotplug pci made outside Acard
- Addition of support for the AEC67160
- Other unknown improvements Acard may have made

In order for this to be useful we need to be able to see just the changes that are important.

I can easily see for example the new PCI identifiers but not the other needed changes. In order to do that I really need either a description of the relevant changes or those changes versus the existing 2.6 driver tree.

Quoted 8 lines
Quoted 4 lines

Any help welcomed.

Alan

New driver will be submit around 1-2 week later.
During these period, if you have more suggestions, please let us know ASAP while testing.

In general life for us and you is easier if you submit changes as you make them in small chunks. E.g. submit the new PCI ID asap, submit small fixes you think are needed in the driver ASAP, etc..

Small patches are much easier review, and and you get obviously correct pieces out ASAP.

1.Add pci device id AEC67162 0x808a

		    AEC67160   0x8080
		    AEC67160S  0x8081

2.Add some structure in atp_unit,because AEC67162 was dual channel LVD160 SCSI adapter.

3.Add some function about AEC67162, is885() tscam_885().

4.In probe function,interrupt function,queuecommand function,send_s870 function
,add some access register action about AEC67162.

#1 lore raw
Quoted 6 lines · jameshsu

We, Acard, total understand what you suggest. (including advise from Christoph, James B. and Alan.)
Therefore, we modify the internal code to create this patch file from kernel v2.6.10.
However, as you see this is the smallest patch files which could be generated. (Sorry, unable to meet your expetation)

Quoted 8 lines

The reason is : this driver could supports ATP870 as well as mutiples of Acard's chipsets. (this includes ATP880(AEC67160) & ATP885(AEC67162)). This is why the patch files is huge than what you expected.
We did not make any change for ATP870(AEC6712) on this rev.. Besides, we reverse following codes according to all of your suggestions. Please review and let me know if this is feasible. Welcome to any of question you may have.
Thanks for your help!

The change to pci.ids needs to be handled through pciids.sourceforge.net

----

I really don't like the:
+ atp_dev.ioport[0] = base_io + 0x80;
+ atp_dev.ioport[1] = base_io + 0xc0;

Just record base_io in your atp_dev. I don't like the way this patch turns everything into a 2-d array ... surely there has to be a better way to do it than this?

----

+ if (dev->dev_id == ATP885_DEVID) {

+                       tmpcip += 2;
+                       outb(0x06, tmpcip);
+                       tmpcip -= 2;

would be much better written as:

		if (dev->dev_id == ATP885_DEVID)
			outb(0x06, tmpcip+2);

(hmm, this seems to be common coding style throughout the driver ...)

----

- if (pci_set_dma_mask(dev, 0xFFFFFFFFUL)) {
- printk(KERN_ERR "atp870u: 32bit DMA mask required but not availa
ble.\n");
- return -EIO;
- }
+ if (!pci_set_dma_mask(pdev, 0xFFFFFFUL)) {
+ printk(KERN_INFO "atp870u: use 32bit DMA mask.\n");
+ } else {
+ printk(KERN_ERR "atp870u: DMA mask required but not available.\
n");
+ return -EIO;
+ }

You've actually set a 24-bit DMA mask there. Should use the symbolic constant DMA_32BIT_MASK anyway.

----

+ { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP885_DEVID) },

Please use the PCI_DEVICE_ID_ name instead

----

Signature · 6 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
author
#2 lore raw

Hi all,

We are in the process to make some change to meet your expectation ASAP. (e.g. (1) 2-d array => 1-d array (2) meet common coding style (3) 32-bit DMA mask instead (4) PCI new device entry applied (5) use the PCI_DEVICE_ID_ name instead)
However, this is the revision we are sure it's working. Therefore, if this is possible, can you patch this file for v2.6.10 this time.
Within 1-2 week from now, we will submit another patch file to fix above syntax issues if working smoothly.
In the mean time, we also in the process to submit the new device entry (ATP880[AEC67160] LVD160 1 channel /ATP885[AEC67162] LVD160 2 channel) under Artop Electronics Corp.
Thanks for your help!

Best regards,

James
----- Original Message -----
From: "Matthew Wilcox" <[email protected]>
To: "jameshsu" <[email protected]>
Cc: "Alan Cox" <[email protected]>; <[email protected]>; "Christoph Hellwig" <[email protected]>; "Jason Wu" <[email protected]>; "EdwardLian" <[email protected]>; <[email protected]>
Sent: Saturday, January 15, 2005 1:44 AM
Subject: Re: Fw: ACARD SCSI driver update for Linux kernel v2.6

Quoted 4 lines · jameshsu
Quoted 3 lines

We, Acard, total understand what you suggest. (including advise from Christoph, James B. and Alan.)
Therefore, we modify the internal code to create this patch file from

kernel

Quoted 5 lines
Quoted 5 lines

v2.6.10.
However, as you see this is the smallest patch files which could be generated. (Sorry, unable to meet your expetation)
The reason is : this driver could supports ATP870 as well as mutiples of Acard's chipsets. (this includes ATP880(AEC67160) & ATP885(AEC67162)).

This

Quoted 3 lines
Quoted 3 lines

is why the patch files is huge than what you expected.
We did not make any change for ATP870(AEC6712) on this rev.. Besides, we reverse following codes according to all of your suggestions. Please

review

Quoted 32 lines
Quoted 3 lines

and let me know if this is feasible. Welcome to any of question you may have.
Thanks for your help!

The change to pci.ids needs to be handled through pciids.sourceforge.net

----

I really don't like the:

(quoted diff) +2 -0
+               atp_dev.ioport[0] = base_io + 0x80;
+               atp_dev.ioport[1] = base_io + 0xc0;

Just record base_io in your atp_dev. I don't like the way this patch turns everything into a 2-d array ... surely there has to be a better way to do it than this?

----

(quoted diff) +4 -0
+               if (dev->dev_id == ATP885_DEVID) {
+                       tmpcip += 2;
+                       outb(0x06, tmpcip);
+                       tmpcip -= 2;

would be much better written as:

if (dev->dev_id == ATP885_DEVID)
outb(0x06, tmpcip+2);

(hmm, this seems to be common coding style throughout the driver ...)

----

Review

Quoted 2 lines
(quoted diff) +0 -2
-       if (pci_set_dma_mask(dev, 0xFFFFFFFFUL)) {
-               printk(KERN_ERR "atp870u: 32bit DMA mask required but not

availa

Review

Quoted 7 lines

ble.\n");

(quoted diff) +4 -2
-               return -EIO;
-       }
+        if (!pci_set_dma_mask(pdev, 0xFFFFFFUL)) {
+                printk(KERN_INFO "atp870u: use 32bit DMA mask.\n");
+        } else {
+                printk(KERN_ERR "atp870u: DMA mask required but not

available.\

Quoted 10 lines

n");

(quoted diff) +2 -0
+                return -EIO;
+        }

You've actually set a 24-bit DMA mask there. Should use the symbolic constant DMA_32BIT_MASK anyway.

----

+ { PCI_DEVICE(PCI_VENDOR_ID_ARTOP,

              },
Quoted 15 lines

Please use the PCI_DEVICE_ID_ name instead

----

--
"Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain