* Re: TMSCSIM [2.6] (was: Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6)
[not found] <Pine.LNX.4.44.0311242223130.2874-200000@poirot.grange>
@ 2003-11-24 22:33 ` Guennadi Liakhovetski
2003-11-25 20:58 ` TMSCSIM [2.6] Chiaki
0 siblings, 1 reply; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-24 22:33 UTC (permalink / raw)
To: linux-scsi
[-- Attachment #1: Type: TEXT/PLAIN, Size: 466 bytes --]
Didn't pass uncompressed through - bigger than 100K? Attaching compressed.
On Mon, 24 Nov 2003, Guennadi Liakhovetski wrote:
> Ghm, here's the patch. But I decided not to compress it, just send it as
> attachment, instead of inlining it - after all, this is how it should be
> done, isn't it?:-)
>
> And - now it includes one more fix - replaced deprecated check_region()
> with request_region() - noticed by Ishikawa, Chiaki.
Guennadi
---
Guennadi Liakhovetski
[-- Attachment #2: Type: APPLICATION/octet-stream, Size: 16996 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-24 22:33 ` TMSCSIM [2.6] (was: Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6) Guennadi Liakhovetski
@ 2003-11-25 20:58 ` Chiaki
2003-11-25 21:16 ` Chiaki
2003-11-25 22:26 ` Guennadi Liakhovetski
0 siblings, 2 replies; 28+ messages in thread
From: Chiaki @ 2003-11-25 20:58 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi
Guennadi Liakhovetski wrote:
> Didn't pass uncompressed through - bigger than 100K? Attaching compressed.
>
> On Mon, 24 Nov 2003, Guennadi Liakhovetski wrote:
>
>
>>Ghm, here's the patch. But I decided not to compress it, just send it as
>>attachment, instead of inlining it - after all, this is how it should be
>>done, isn't it?:-)
>>
>>And - now it includes one more fix - replaced deprecated check_region()
>>with request_region() - noticed by Ishikawa, Chiaki.
Hello,
Thank you for the renewed patch.
I am using TEKRAM dc390. I use tmscsim driver as a module.
There is a PD/CD combo on the dc390 scsi bus. (PD is
a somewhat outdated optomagnetic drive. The drive has
two LUNs, one for CD, and one for PD. PD side is recognized as
rewritable removable media at least under 2.4.22.)
With the modified tmscsim driver under 2.6.0-test10,
(the bzipped patch submitted to linux-scsi worked without rejection)
I got a panic after module insertion during booting.
tmscsim is mentioned in /etc/modules and so inserted automatically
during booting.
(More background: related stuff I can think of.
kernel 2.6.0-test10.
tmscsim ... used as module
sr ... module as sr_mod
event mechanism enabled in the kernel.
gcc 3.3 used...)
Here is the panic message left on the screen which I scribbed down
manually.
... anything above is scrolled and disappeared but I saw the
module insertion began. ...
esi: ef63a2f0 edi: 00000001 ebp: c03a5e4c esp: c03a5e3c
ds: 007b es: 007b ss: 0068
Process swapper (pid:0, threadinfo = c03a4000, task=c0338680)
Stack: 00000000 ef63a2f0 efc617c0 ef5e92c0 c0ea5e8c f09451d1 ef63a2f0
ef63a2f0
ef5e92c0 ef5e92c0 c03a5ea4 f09451d1 ef63a2f0 4f89f21d 00000021
00000001
cc000092 ef63a2f0 efc617c0 ef63a208 c03a5ec4 f0946e36 ef63a208
ef5e92c0
Call trace:
[<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
[<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
[<f0946e36>] dc390_SRBdone+0x306/0x5b0 [tmscsim]
[<f09472f3>] dc390_RequestSense+0x53/0x90 [tmscsim]
[<f0946714>] dc390_Disconnect+0x104/0x160 [tmscsim]
[<f094574a>] do_DC390_Interrupt:0x28d/0x350 [tmscsim]
[<c025dc88>] scsi_softirq+0xe8/0x240
[<c010da4b>] handle_IRQ_event:0x3b/0x70
[<c010e060>] do_IRQ+0x140/0x390
[<c0105000>] _stext+0x0/0xf0
[<c010c0ec>] common_interrupt:0x18/0x20
[<c0105000>] _stext+0x0/0xf0
[<c0108ea6>] default_idel+0x26/0x30
[<c0108f24>] cpu_idle+0x34/0x40
[<c03a6797>] start_kernel+0x1e7/0x270
[<c03a6480>] unknown_bootoption+0x0/0x100
Code: 0f 0b 28 00 77 9d 94 f0 eb c5 0f 0b 25 00 77 9d 94 f0 eb e8
<0> Kernel panic: Fatal exception in interrupt
In interrupt handler --- not syncing
OBSERVATION:
alt sysreq magic key combination worked.
I could run emergency sync and reboot.
From the kernel panic message, and the call trace, it looks to
me that the interrupt is recursively entered somehow.
(Or unexpected interrupt came in.)
So what next?
I can enable debugging macro if necessary and re-try.
Or, I can disable tmscsim module insertion during booting,
and try "insmod tmscsim" after the kernel is up and running and
see if it makes difference.
(Under 2.6.0-test9, and manually fixed patched tmscsim files (due to
whitespace problems of the patch), I could insert the tmscsim module
but "insmod tmscsim" took unusually long time, but eventually
returned. However, /proc/scsi/ didn't show the 2nd LUN of the
PD/CD combo I have on dc390 bus. Maybe it was a problem of
insertion of sr_mod due to my misconfiguration of module set up
for 2.6.0-testXX which I believe is now corrected.
Since immediately
afterward when I tried automatic insertion of dc390 during booting,
I got a similar panic which I reported above, I didn't pursue
the insertion testing after the kernel is up and running.
I thought fixing the panic of auto insertion needs to be handled first.
But maybe I should re-try under test10 if this gives more insight.)
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-25 20:58 ` TMSCSIM [2.6] Chiaki
@ 2003-11-25 21:16 ` Chiaki
2003-11-25 22:26 ` Guennadi Liakhovetski
1 sibling, 0 replies; 28+ messages in thread
From: Chiaki @ 2003-11-25 21:16 UTC (permalink / raw)
To: linux-scsi; +Cc: Chiaki, Guennadi Liakhovetski
Chiaki wrote:
> Guennadi Liakhovetski wrote:
>
>> Didn't pass uncompressed through - bigger than 100K? Attaching
>> compressed.
>>
>> On Mon, 24 Nov 2003, Guennadi Liakhovetski wrote:
>>
>>
>>> Ghm, here's the patch. But I decided not to compress it, just send it as
>>> attachment, instead of inlining it - after all, this is how it should be
>>> done, isn't it?:-)
>>>
>>> And - now it includes one more fix - replaced deprecated check_region()
>>> with request_region() - noticed by Ishikawa, Chiaki.
>
>
> Hello,
>
> Thank you for the renewed patch.
>
> I am using TEKRAM dc390. I use tmscsim driver as a module.
> There is a PD/CD combo on the dc390 scsi bus. (PD is
> a somewhat outdated optomagnetic drive. The drive has
> two LUNs, one for CD, and one for PD. PD side is recognized as
> rewritable removable media at least under 2.4.22.)
>
> With the modified tmscsim driver under 2.6.0-test10,
> (the bzipped patch submitted to linux-scsi worked without rejection)
> I got a panic after module insertion during booting.
> tmscsim is mentioned in /etc/modules and so inserted automatically
> during booting.
>
> (More background: related stuff I can think of.
> kernel 2.6.0-test10.
> tmscsim ... used as module
> sr ... module as sr_mod
> event mechanism enabled in the kernel.
> gcc 3.3 used...)
I should add that the PD/CD combo drive has only
one drive mechanism.
The drive detects the media and decides to
operate either as CD or PD drive at a time.
LUN 0 ... PD drive
LUN 1 ... CD drive
If I insert PD media, LUN 0 acts ad PD drive and
LUN 1 reports that CD is absent.
If I have CD media inside, then LUN 0 reports
that no writable media is inside and LUN 1 acts
as CD drive with media inside.
I have a CD media inside the combo drive and
so it is possible that the media detection might
play a role here (PD media is missing and
so the LUN0 reports no media inside.).
>
> Here is the panic message left on the screen which I scribbed down
> manually.
>
> ... anything above is scrolled and disappeared but I saw the
> module insertion began. ...
> esi: ef63a2f0 edi: 00000001 ebp: c03a5e4c esp: c03a5e3c
> ds: 007b es: 007b ss: 0068
>
> Process swapper (pid:0, threadinfo = c03a4000, task=c0338680)
>
> Stack: 00000000 ef63a2f0 efc617c0 ef5e92c0 c0ea5e8c f09451d1 ef63a2f0
> ef63a2f0
> ef5e92c0 ef5e92c0 c03a5ea4 f09451d1 ef63a2f0 4f89f21d 00000021
> 00000001
> cc000092 ef63a2f0 efc617c0 ef63a208 c03a5ec4 f0946e36 ef63a208
> ef5e92c0
>
> Call trace:
> [<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
> [<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
> [<f0946e36>] dc390_SRBdone+0x306/0x5b0 [tmscsim]
> [<f09472f3>] dc390_RequestSense+0x53/0x90 [tmscsim]
> [<f0946714>] dc390_Disconnect+0x104/0x160 [tmscsim]
> [<f094574a>] do_DC390_Interrupt:0x28d/0x350 [tmscsim]
> [<c025dc88>] scsi_softirq+0xe8/0x240
> [<c010da4b>] handle_IRQ_event:0x3b/0x70
> [<c010e060>] do_IRQ+0x140/0x390
> [<c0105000>] _stext+0x0/0xf0
> [<c010c0ec>] common_interrupt:0x18/0x20
> [<c0105000>] _stext+0x0/0xf0
> [<c0108ea6>] default_idel+0x26/0x30
> [<c0108f24>] cpu_idle+0x34/0x40
> [<c03a6797>] start_kernel+0x1e7/0x270
> [<c03a6480>] unknown_bootoption+0x0/0x100
>
> Code: 0f 0b 28 00 77 9d 94 f0 eb c5 0f 0b 25 00 77 9d 94 f0 eb e8
>
> <0> Kernel panic: Fatal exception in interrupt
> In interrupt handler --- not syncing
>
>
>
>
> OBSERVATION:
>
> alt sysreq magic key combination worked.
> I could run emergency sync and reboot.
>
> From the kernel panic message, and the call trace, it looks to
> me that the interrupt is recursively entered somehow.
> (Or unexpected interrupt came in.)
>
>
> So what next?
> I can enable debugging macro if necessary and re-try.
>
> Or, I can disable tmscsim module insertion during booting,
> and try "insmod tmscsim" after the kernel is up and running and
> see if it makes difference.
>
> (Under 2.6.0-test9, and manually fixed patched tmscsim files (due to
> whitespace problems of the patch), I could insert the tmscsim module
> but "insmod tmscsim" took unusually long time, but eventually
> returned. However, /proc/scsi/ didn't show the 2nd LUN of the
> PD/CD combo I have on dc390 bus. Maybe it was a problem of
> insertion of sr_mod due to my misconfiguration of module set up
> for 2.6.0-testXX which I believe is now corrected.
> Since immediately
> afterward when I tried automatic insertion of dc390 during booting,
> I got a similar panic which I reported above, I didn't pursue
> the insertion testing after the kernel is up and running.
> I thought fixing the panic of auto insertion needs to be handled first.
> But maybe I should re-try under test10 if this gives more insight.)
>
>
>
>
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-25 20:58 ` TMSCSIM [2.6] Chiaki
2003-11-25 21:16 ` Chiaki
@ 2003-11-25 22:26 ` Guennadi Liakhovetski
2003-11-25 22:44 ` Chiaki
2003-11-27 19:13 ` Chiaki
1 sibling, 2 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-25 22:26 UTC (permalink / raw)
To: Chiaki; +Cc: Guennadi Liakhovetski, linux-scsi
On Wed, 26 Nov 2003, Chiaki wrote:
> I am using TEKRAM dc390. I use tmscsim driver as a module.
> There is a PD/CD combo on the dc390 scsi bus. (PD is
> a somewhat outdated optomagnetic drive. The drive has
> two LUNs, one for CD, and one for PD. PD side is recognized as
> rewritable removable media at least under 2.4.22.)
>
> With the modified tmscsim driver under 2.6.0-test10,
> (the bzipped patch submitted to linux-scsi worked without rejection)
> I got a panic after module insertion during booting.
> tmscsim is mentioned in /etc/modules and so inserted automatically
> during booting.
>
> (More background: related stuff I can think of.
> kernel 2.6.0-test10.
> tmscsim ... used as module
> sr ... module as sr_mod
> event mechanism enabled in the kernel.
> gcc 3.3 used...)
>
> Here is the panic message left on the screen which I scribbed down
> manually.
>
> ... anything above is scrolled and disappeared but I saw the
> module insertion began. ...
> esi: ef63a2f0 edi: 00000001 ebp: c03a5e4c esp: c03a5e3c
> ds: 007b es: 007b ss: 0068
>
> Process swapper (pid:0, threadinfo = c03a4000, task=c0338680)
>
> Stack: 00000000 ef63a2f0 efc617c0 ef5e92c0 c0ea5e8c f09451d1 ef63a2f0
> ef63a2f0
> ef5e92c0 ef5e92c0 c03a5ea4 f09451d1 ef63a2f0 4f89f21d 00000021
> 00000001
> cc000092 ef63a2f0 efc617c0 ef63a208 c03a5ec4 f0946e36 ef63a208
> ef5e92c0
>
> Call trace:
> [<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
> [<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
> [<f0946e36>] dc390_SRBdone+0x306/0x5b0 [tmscsim]
> [<f09472f3>] dc390_RequestSense+0x53/0x90 [tmscsim]
> [<f0946714>] dc390_Disconnect+0x104/0x160 [tmscsim]
> [<f094574a>] do_DC390_Interrupt:0x28d/0x350 [tmscsim]
> [<c025dc88>] scsi_softirq+0xe8/0x240
> [<c010da4b>] handle_IRQ_event:0x3b/0x70
> [<c010e060>] do_IRQ+0x140/0x390
> [<c0105000>] _stext+0x0/0xf0
> [<c010c0ec>] common_interrupt:0x18/0x20
> [<c0105000>] _stext+0x0/0xf0
> [<c0108ea6>] default_idel+0x26/0x30
> [<c0108f24>] cpu_idle+0x34/0x40
> [<c03a6797>] start_kernel+0x1e7/0x270
> [<c03a6480>] unknown_bootoption+0x0/0x100
>
> Code: 0f 0b 28 00 77 9d 94 f0 eb c5 0f 0b 25 00 77 9d 94 f0 eb e8
>
> <0> Kernel panic: Fatal exception in interrupt
> In interrupt handler --- not syncing
Aha, now that's getting interesting - or I was started to feel borref
already:-) A couple of things, that would definitely help:
1) is this the only computer you have? If you had another one - could you
attach a serial console and get a complete Oops?
2) gcc-3.3 could be ok, but I don't really feel quite secure about it...
If we don't find an obvious bug somewhere, I'll ask you to try recompile
it with 2.95.3, ok?
3) are you sure you copied the Oops exactly from the terminal? It didn't
get into /var/log/messages, I presume. Some things in that Oops above look
a bit strange... E.g. the double
I'll try to think about it a bit, but without a complete and exact Oops it
is a bit difficult, also, that the code, generated by your 3.3 seems to be
very different, from what 2.95.3 produces. Your .config (bzipped) could be
useful too. I guess, you have the multiple LUNs option enabled, I'll try
that too, but my hardware is very different from what you have there -
just a AM53C974 and a single hard-drive on it.
Thanks
Guennadi
> OBSERVATION:
>
> alt sysreq magic key combination worked.
> I could run emergency sync and reboot.
>
> From the kernel panic message, and the call trace, it looks to
> me that the interrupt is recursively entered somehow.
> (Or unexpected interrupt came in.)
>
>
> So what next?
> I can enable debugging macro if necessary and re-try.
>
> Or, I can disable tmscsim module insertion during booting,
> and try "insmod tmscsim" after the kernel is up and running and
> see if it makes difference.
>
> (Under 2.6.0-test9, and manually fixed patched tmscsim files (due to
> whitespace problems of the patch), I could insert the tmscsim module
> but "insmod tmscsim" took unusually long time, but eventually
> returned. However, /proc/scsi/ didn't show the 2nd LUN of the
> PD/CD combo I have on dc390 bus. Maybe it was a problem of
> insertion of sr_mod due to my misconfiguration of module set up
> for 2.6.0-testXX which I believe is now corrected.
> Since immediately
> afterward when I tried automatic insertion of dc390 during booting,
> I got a similar panic which I reported above, I didn't pursue
> the insertion testing after the kernel is up and running.
> I thought fixing the panic of auto insertion needs to be handled first.
> But maybe I should re-try under test10 if this gives more insight.)
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-25 22:26 ` Guennadi Liakhovetski
@ 2003-11-25 22:44 ` Chiaki
2003-11-27 19:13 ` Chiaki
1 sibling, 0 replies; 28+ messages in thread
From: Chiaki @ 2003-11-25 22:44 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi
Guennadi Liakhovetski wrote:
> On Wed, 26 Nov 2003, Chiaki wrote:
>
>
>>I am using TEKRAM dc390. I use tmscsim driver as a module.
>>There is a PD/CD combo on the dc390 scsi bus. (PD is
>>a somewhat outdated optomagnetic drive. The drive has
>>two LUNs, one for CD, and one for PD. PD side is recognized as
>>rewritable removable media at least under 2.4.22.)
>>
>>With the modified tmscsim driver under 2.6.0-test10,
>>(the bzipped patch submitted to linux-scsi worked without rejection)
>>I got a panic after module insertion during booting.
>>tmscsim is mentioned in /etc/modules and so inserted automatically
>>during booting.
>>
>>(More background: related stuff I can think of.
>> kernel 2.6.0-test10.
>> tmscsim ... used as module
>> sr ... module as sr_mod
>> event mechanism enabled in the kernel.
>> gcc 3.3 used...)
>>
>>Here is the panic message left on the screen which I scribbed down
>>manually.
>>
>> ... anything above is scrolled and disappeared but I saw the
>> module insertion began. ...
>>esi: ef63a2f0 edi: 00000001 ebp: c03a5e4c esp: c03a5e3c
>>ds: 007b es: 007b ss: 0068
>>
>>Process swapper (pid:0, threadinfo = c03a4000, task=c0338680)
>>
>>Stack: 00000000 ef63a2f0 efc617c0 ef5e92c0 c0ea5e8c f09451d1 ef63a2f0
>>ef63a2f0
>> ef5e92c0 ef5e92c0 c03a5ea4 f09451d1 ef63a2f0 4f89f21d 00000021
>>00000001
>> cc000092 ef63a2f0 efc617c0 ef63a208 c03a5ec4 f0946e36 ef63a208
>>ef5e92c0
>>
>>Call trace:
>> [<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
>> [<f09451d1>] dc390_StartSCCSI+0x41/0x330 [tmscsim]
>> [<f0946e36>] dc390_SRBdone+0x306/0x5b0 [tmscsim]
>> [<f09472f3>] dc390_RequestSense+0x53/0x90 [tmscsim]
>> [<f0946714>] dc390_Disconnect+0x104/0x160 [tmscsim]
>> [<f094574a>] do_DC390_Interrupt:0x28d/0x350 [tmscsim]
>> [<c025dc88>] scsi_softirq+0xe8/0x240
>> [<c010da4b>] handle_IRQ_event:0x3b/0x70
>> [<c010e060>] do_IRQ+0x140/0x390
>> [<c0105000>] _stext+0x0/0xf0
>> [<c010c0ec>] common_interrupt:0x18/0x20
>> [<c0105000>] _stext+0x0/0xf0
>> [<c0108ea6>] default_idel+0x26/0x30
>> [<c0108f24>] cpu_idle+0x34/0x40
>> [<c03a6797>] start_kernel+0x1e7/0x270
>> [<c03a6480>] unknown_bootoption+0x0/0x100
>>
>>Code: 0f 0b 28 00 77 9d 94 f0 eb c5 0f 0b 25 00 77 9d 94 f0 eb e8
>>
>><0> Kernel panic: Fatal exception in interrupt
>> In interrupt handler --- not syncing
>
>
> Aha, now that's getting interesting - or I was started to feel borref
> already:-) A couple of things, that would definitely help:
>
Hi,
> 1) is this the only computer you have? If you had another one - could you
> attach a serial console and get a complete Oops?
I will try this later today.
> 2) gcc-3.3 could be ok, but I don't really feel quite secure about it...
> If we don't find an obvious bug somewhere, I'll ask you to try recompile
> it with 2.95.3, ok?
No problem. I will try this also.
> 3) are you sure you copied the Oops exactly from the terminal? It didn't
> get into /var/log/messages, I presume. Some things in that Oops above look
> a bit strange... E.g. the double
As far as manual copying goes, I did my best.
Indeed, I noticed the duplicate lines and I thought that was quite strange!
I suspect that it might lead to the cause of the problem.
> I'll try to think about it a bit, but without a complete and exact Oops it
> is a bit difficult, also, that the code, generated by your 3.3 seems to be
> very different, from what 2.95.3 produces. Your .config (bzipped) could be
> useful too. I guess, you have the multiple LUNs option enabled, I'll try
> that too, but my hardware is very different from what you have there -
> just a AM53C974 and a single hard-drive on it.
>
I will try to capture the complete oops and
send it as well as the .config file together.
Yes, my hardware is a rather quirky kind for home use
and it has found a few problems in the kernel and driver before.
I will get back with the information
hopefully in 24 hours.
>>OBSERVATION:
>>
>> alt sysreq magic key combination worked.
>> I could run emergency sync and reboot.
>>
>> From the kernel panic message, and the call trace, it looks to
>> me that the interrupt is recursively entered somehow.
>> (Or unexpected interrupt came in.)
>>
>>
>>So what next?
>>I can enable debugging macro if necessary and re-try.
>>
>>Or, I can disable tmscsim module insertion during booting,
>>and try "insmod tmscsim" after the kernel is up and running and
>>see if it makes difference.
>>
>>(Under 2.6.0-test9, and manually fixed patched tmscsim files (due to
>>whitespace problems of the patch), I could insert the tmscsim module
>>but "insmod tmscsim" took unusually long time, but eventually
>>returned. However, /proc/scsi/ didn't show the 2nd LUN of the
>>PD/CD combo I have on dc390 bus. Maybe it was a problem of
>>insertion of sr_mod due to my misconfiguration of module set up
>>for 2.6.0-testXX which I believe is now corrected.
>>Since immediately
>>afterward when I tried automatic insertion of dc390 during booting,
>>I got a similar panic which I reported above, I didn't pursue
>>the insertion testing after the kernel is up and running.
>>I thought fixing the panic of auto insertion needs to be handled first.
>>But maybe I should re-try under test10 if this gives more insight.)
>
>
>
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-25 22:26 ` Guennadi Liakhovetski
2003-11-25 22:44 ` Chiaki
@ 2003-11-27 19:13 ` Chiaki
2003-11-27 22:05 ` Guennadi Liakhovetski
2003-11-27 22:43 ` TMSCSIM [2.6] (cards) Guennadi Liakhovetski
1 sibling, 2 replies; 28+ messages in thread
From: Chiaki @ 2003-11-27 19:13 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 8310 bytes --]
Hi,
Here is the record of messages shown during boot using
serial console when the module loading of tmscsim fails
under 2.6.0-test10.
(Sorry, I am still using gcc 3.3. One step at a time.)
It seems that the system triggered a bug detection code in the
dma-mapping code.
LUN 1 connected to dc390 is now being scanned
as far as the message is correct, but maybe during the scan
and handling of CDROM, the system crashed?
The reason I suspect this is that I don't see the "lun 1"
message line, following the
"Type: CD-ROM ANSI SCSI revision: 02"
line in the log. For "lun 0",
"Attached scsi removable disk sdc at scsi1, channel 0, id 5, lun 0
Attached scsi generic sg2 at scsi1, channel 0, id 5, lun 0, type 7"
followed immediately after the detection.
I wonder if anyone has SCSI CDROM driver as a module,
namely sr_mod, up and running under 2.6.0-testXX series.
From the log, I excerpted interesting part and show it below here. The
full log is attached together with my config.
--- except from the log starts here
Loading modules...
hpfs
warning: process `update' used the obsolete bdflush system call
Fix your initscripts?
nls_cp437
sg
Attached scsi generic sg0 at scsi0, channel 0, id 4, lun 0, type 0
Attached scsi generic sg1 at scsi0, channel 0, id 6, lun 0, type 0
sr_mod
tmscsim
PCI: Found IRQ 11 for device 0000:00:0d.0
PCI: Sharing IRQ 11 with 0000:00:0f.0
DC390: 1 adapters found
scsi1 : Tekram DC390/AM53C974 V2.0f 2000-12-20
DC390: Target 5: Sync transfer 5.0 MHz, Offset 8
Vendor: MATSHITA Model: PD-1 LF-1000 Rev: A111
Type: Optical Device ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi1, channel 0, id 5, lun 0
Attached scsi generic sg2 at scsi1, channel 0, id 5, lun 0, type 7
Vendor: MATSHITA Model: PD-1 LF-1000 Rev: A111
Type: CD-ROM ANSI SCSI revision: 02
------------[ cut here ]------------
kernel BUG at include/asm/dma-mapping.h:40!
invalid operand: 0000 [#1]
CPU: 0
EIP: 0060:[<f09445c1>] Not tainted
EFLAGS: 00010046
EIP is at dc390_pci_map+0xc1/0x140 [tmscsim]
eax: 00000000 ebx: 00000000 ecx: c0404e00 edx: 00000000
esi: ef62a2f0 edi: 00000001 ebp: c03a5e4c esp: c03a5e3c
ds: 007b es: 007b ss: 0068
Process swapper (pid: 0, threadinfo=c03a4000 task=c0338680)
Stack: 00000000 ef62a2f0 efc61940 efc99380 c03a5e8c f09451d1 ef62a2f0
ef62a2f0
efc99380 efc99380 c03a5ea4 f09451d1 ef62a2f0 982b34e5 0000001e
00000001
cc000092 ef62a2f0 efc61940 ef62a208 c03a5ec4 f0946e36 ef62a208
efc99380
Call Trace:
[<f09451d1>] dc390_StartSCSI+0x41/0x330 [tmscsim]
[<f09451d1>] dc390_StartSCSI+0x41/0x330 [tmscsim]
[<f0946e36>] dc390_SRBdone+0x306/0x5b0 [tmscsim]
[<f09472f3>] dc390_RequestSense+0x53/0x90 [tmscsim]
[<f0946714>] dc390_Disconnect+0x104/0x160 [tmscsim]
[<f094574d>] do_DC390_Interrupt+0x28d/0x350 [tmscsim]
[<c0113f4c>] timer_interrupt+0x8c/0x260
[<c025dc88>] scsi_softirq+0xe8/0x240
[<c010da4b>] handle_IRQ_event+0x3b/0x70
[<c010e060>] do_IRQ+0x140/0x390
[<c0105000>] _stext+0x0/0xf0
[<c010c0ec>] common_interrupt+0x18/0x20
[<c0105000>] _stext+0x0/0xf0
[<c0108ea6>] default_idle+0x26/0x30
[<c0108f24>] cpu_idle+0x34/0x40
[<c03a6797>] start_kernel+0x1e7/0x270
[<c03a6480>] unknown_bootoption+0x0/0x100
Code: 0f 0b 28 00 77 9d 94 f0 eb c5 0f 0b 25 00 77 9d 94 f0 eb a8
<0>Kernel panic: Fatal exception in interrupt
In interrupt handler - not syncing
<6>SysRq : Emergency Sync
SysRq : Resetting
--- except from the log ends
dma_mapping_on:40 is the following line.
31 static inline int
32 dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
33 enum dma_data_direction direction)
34 {
35 int i;
36
37 BUG_ON(direction == DMA_NONE);
38
39 for (i = 0; i < nents; i++ ) {
=> 40 BUG_ON(!sg[i].page);
41
42 sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset;
43 }
44
45 flush_write_buffers();
46 return nents;
47 }
PS: Note on serial console setup with loadlin.
I studied the excellent guide posted to linux-kernel in August
regarding how to set up the serial console.
However, I am using LOADLIN and this boot utiltiy seems to
require a certain modification to the setup mentioned in the post.
(The post assumed "lilo").
--- quote from the post and my comment ---
> Your need a NULL modem serial cable available
> from any computer store.
>
> Install uucp - I use on the HOST :
>
> uucp-1.06.1-33.7.2.
>
> Also , LILO is broken on some machines and ignores
> serial input so make sure you use at least
>
> lilo-21.6-71
>
> On the TARGET
>
> 1. Connect the serial ports together ( COM1->COM1 ) with
> the serial cable .
>
> 2. Modify LILO to use serial line on the TARGET
> add to lilo.conf:
> append="console=ttyS0,9600n8 console=tty0 "
> serial=0,9600N8
>
> Run lilo
CI's comment starts here: I needed to change this part for loadlin
and kernel 2.4.22 as follows. [I tested the serial
console setup under 2.4.22 and it took me a long time to set this up.]
I needed to omit console=tty0 portion for testing the setup under 2.4.22.
If the second console= part is present, the initial portion shown
on the screen namely,
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
... omitted ..
disappeared somewhere and not seen on the CRT of the original PC
nor on the serial console screen. They simply disappeared and
so the setup was useless! (All I got was the login prompt: after a while.)
Under 2.4.22, if I remove the later command options, and use a command
line like this, (omitting console=tty0 serial=0,9600N8. serial=
... must be a command option to "lilo" itself.)
loadlin lin2422.ip6 root=/dev/sda6 ro vga=3 scsihosts=sym53c8xx:tmscsim
console=ttyS0,9600n8
I DID get a partial portion of the messages originally shown on the
original PC on the serial console, but only partially. ONLY the
messages AFTER `init' starts are shown on serial console. So
"BIOS-provided ..." message lines and those many lines that follow
until `init' starts are not shown. Why? I have no idea.
The second best solution for me then is to add
"kern.*[tab]/dev/console" and hope that syslogd will pickup kernel
messages and show it explicitly under /dev/console which is now turned
into /dev/ttyS0 in the step 4 below. (But this may not work well if
the system gets hung BEFORE `init' starts and syslogd is active.
Also, even if such messages like "BIOS -provided ..." are shown using
syslogd, then they are shown AFTER init starts and syslogd daemon
starts. So their position in the recorded message on the serial
console is a little strange.)
However, it turns out 2.6.0-test10 handles the kernel message
output to serial console in a slightly different manner, and
"BIOS-provided ..." messages and all lines that follow are dumped to serial
console immediately without any problem after
my setup [ step 4 below included ].
Again I have no idea why, but as you can see in
the attached log, the serial console for message dumping purposes
seems to work just fine with 2.6.0-test10. (In any case,
/etc/syslog.conf DID have kern.* /dev/ttyS0 for the log.)
> 3. Add to /etc/inittab on the HOST
>
> S0:s12345:respawn:/sbin/agetty 9600 ttyS0
>
> 4. To see ALL THE CONSOLE MESSAGES during boot on the TARGET
>
> mv /dev/console /dev/console.org
> ln /dev/ttyS0 /dev/console
CI's comment: This had to be done AFTER disabling devfs and rebooting
2.4.22 on my PC.
(for obvious reasons to those who use devfs. /dev directory
after devfsd is invoked is a "virtual directory" and mv and other
modifications are NOT allowed.)
> 5. Start uucp on the HOST:
>
> cu -l /dev/ttyS0 -s 9600
>
My second PC is a window98 PC. I disabled the TTY ports
on that PC long time ago, and so it took me a while
to enable the tty ports, and configure it under win98.
Hyperterminal happily tries to open non-functioning com1 and
com2 ports and simply crashed under that platform and so
it took me a while to figure out that the tty ports were not
configured at all!
> 6. Boot your target
>
> ///
>
> John Donnelly AT HP DOT com
--- end quote ---
Hope this helps.
Ishikawa, Chiaki
[-- Attachment #2: bug-log.zip --]
[-- Type: application/zip, Size: 11337 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-27 19:13 ` Chiaki
@ 2003-11-27 22:05 ` Guennadi Liakhovetski
2003-11-28 1:41 ` Chiaki
2003-11-27 22:43 ` TMSCSIM [2.6] (cards) Guennadi Liakhovetski
1 sibling, 1 reply; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-27 22:05 UTC (permalink / raw)
To: Chiaki; +Cc: Guennadi Liakhovetski, linux-scsi, Thorsten Leemhuis
Please, try this:
diff -u linux-2.6.0-test10/drivers/scsi/scsiiom.c~ linux-2.6.0-test10/drivers/scsi/scsiiom.c
--- linux-2.6.0-test10/drivers/scsi/scsiiom.c~ Mon Nov 24 23:47:29 2003
+++ linux-2.6.0-test10/drivers/scsi/scsiiom.c Thu Nov 27 23:02:35 2003
@@ -1749,7 +1749,7 @@
pSRB->AdaptStatus = 0;
pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
- pcmd = pSRB->pcmd;
+// pcmd = pSRB->pcmd;
/* We are called from SRBdone, original PCI mapping has been removed
* already, new one is set up from StartSCSI */
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-27 22:05 ` Guennadi Liakhovetski
@ 2003-11-28 1:41 ` Chiaki
2003-11-28 7:33 ` Guennadi Liakhovetski
2003-11-28 20:25 ` Guennadi Liakhovetski
0 siblings, 2 replies; 28+ messages in thread
From: Chiaki @ 2003-11-28 1:41 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi, Thorsten Leemhuis
Guennadi Liakhovetski wrote:
> Please, try this:
>
> diff -u linux-2.6.0-test10/drivers/scsi/scsiiom.c~ linux-2.6.0-test10/drivers/scsi/scsiiom.c
> --- linux-2.6.0-test10/drivers/scsi/scsiiom.c~ Mon Nov 24 23:47:29 2003
> +++ linux-2.6.0-test10/drivers/scsi/scsiiom.c Thu Nov 27 23:02:35 2003
> @@ -1749,7 +1749,7 @@
> pSRB->AdaptStatus = 0;
> pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
>
> - pcmd = pSRB->pcmd;
> +// pcmd = pSRB->pcmd;
>
> /* We are called from SRBdone, original PCI mapping has been removed
> * already, new one is set up from StartSCSI */
>
> Guennadi
> ---
> Guennadi Liakhovetski
>
I am afraid that it didn't solve the problem.
I got the same kernel bug triggered at the same place.
I will try gcc 2.9x.y next to see if it makes a difference
and also it seems that test11 is out and so it will be tested as well.
Thank you again for your attention.
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-28 1:41 ` Chiaki
@ 2003-11-28 7:33 ` Guennadi Liakhovetski
2003-11-29 1:55 ` Chiaki
2003-11-28 20:25 ` Guennadi Liakhovetski
1 sibling, 1 reply; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-28 7:33 UTC (permalink / raw)
To: Chiaki; +Cc: linux-scsi, Thorsten Leemhuis, gl
On Fri, 28 Nov 2003, Chiaki wrote:
> I am afraid that it didn't solve the problem.
> I got the same kernel bug triggered at the same place.
Ok, then, please, try this one (on the top of yesterday's):
diff -u linux/drivers/scsi/scsiiom.c~ linux/drivers/scsi/scsiiom.c
--- linux/drivers/scsi/scsiiom.c~ Thu Nov 27 23:02:35 2003
+++ linux/drivers/scsi/scsiiom.c Fri Nov 28 08:29:40 2003
@@ -1439,7 +1439,7 @@
goto ckc_e;
}
SET_RES_DRV(pcmd->result,DRIVER_SENSE);
-// pcmd->use_sg = pSRB->SavedSGCount;
+ pcmd->use_sg = pSRB->SavedSGCount;
//pSRB->ScsiCmdLen = (UCHAR) (pSRB->Segment1[0] >> 8);
DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n", pcmd->pid, pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun));
pSRB->SGIndex = 0;
@@ -1734,22 +1734,22 @@
static void __inline__
dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
{
-// PSCSICMD pcmd;
+ PSCSICMD pcmd;
+
+ pcmd = pSRB->pcmd;
REMOVABLEDEBUG(printk (KERN_INFO "DC390: RequestSense (Cmd %02x, Id %02x, LUN %02x)\n",\
- pSRB->pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
+ pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
pSRB->SRBFlag |= AUTO_REQSENSE;
//pSRB->Segment0[0] = (UINT) pSRB->CmdBlock[0];
//pSRB->Segment0[1] = (UINT) pSRB->CmdBlock[4];
- //pSRB->Segment1[0] = ((UINT)(pSRB->pcmd->cmd_len) << 8) + pSRB->SGcount;
+ //pSRB->Segment1[0] = ((UINT)(pcmd->cmd_len) << 8) + pSRB->SGcount;
//pSRB->Segment1[1] = pSRB->TotalXferredLen;
- pSRB->SavedSGCount = pSRB->SGcount;
+ pSRB->SavedSGCount = pcmd->use_sg;
pSRB->SavedTotXLen = pSRB->TotalXferredLen;
pSRB->AdaptStatus = 0;
pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
-
-// pcmd = pSRB->pcmd;
/* We are called from SRBdone, original PCI mapping has been removed
* already, new one is set up from StartSCSI */
Thanks
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-28 7:33 ` Guennadi Liakhovetski
@ 2003-11-29 1:55 ` Chiaki
2003-11-29 9:46 ` Guennadi Liakhovetski
0 siblings, 1 reply; 28+ messages in thread
From: Chiaki @ 2003-11-29 1:55 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi, Thorsten Leemhuis, gl
Guennadi Liakhovetski wrote:
> On Fri, 28 Nov 2003, Chiaki wrote:
>
>
>>I am afraid that it didn't solve the problem.
>>I got the same kernel bug triggered at the same place.
>
>
> Ok, then, please, try this one (on the top of yesterday's):
>
> diff -u linux/drivers/scsi/scsiiom.c~ linux/drivers/scsi/scsiiom.c
> --- linux/drivers/scsi/scsiiom.c~ Thu Nov 27 23:02:35 2003
> +++ linux/drivers/scsi/scsiiom.c Fri Nov 28 08:29:40 2003
> @@ -1439,7 +1439,7 @@
> goto ckc_e;
> }
> SET_RES_DRV(pcmd->result,DRIVER_SENSE);
> -// pcmd->use_sg = pSRB->SavedSGCount;
> + pcmd->use_sg = pSRB->SavedSGCount;
> //pSRB->ScsiCmdLen = (UCHAR) (pSRB->Segment1[0] >> 8);
> DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n", pcmd->pid, pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun));
> pSRB->SGIndex = 0;
> @@ -1734,22 +1734,22 @@
> static void __inline__
> dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
> {
> -// PSCSICMD pcmd;
> + PSCSICMD pcmd;
> +
> + pcmd = pSRB->pcmd;
>
> REMOVABLEDEBUG(printk (KERN_INFO "DC390: RequestSense (Cmd %02x, Id %02x, LUN %02x)\n",\
> - pSRB->pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
> + pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
>
> pSRB->SRBFlag |= AUTO_REQSENSE;
> //pSRB->Segment0[0] = (UINT) pSRB->CmdBlock[0];
> //pSRB->Segment0[1] = (UINT) pSRB->CmdBlock[4];
> - //pSRB->Segment1[0] = ((UINT)(pSRB->pcmd->cmd_len) << 8) + pSRB->SGcount;
> + //pSRB->Segment1[0] = ((UINT)(pcmd->cmd_len) << 8) + pSRB->SGcount;
> //pSRB->Segment1[1] = pSRB->TotalXferredLen;
> - pSRB->SavedSGCount = pSRB->SGcount;
> + pSRB->SavedSGCount = pcmd->use_sg;
> pSRB->SavedTotXLen = pSRB->TotalXferredLen;
> pSRB->AdaptStatus = 0;
> pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
> -
> -// pcmd = pSRB->pcmd;
>
> /* We are called from SRBdone, original PCI mapping has been removed
> * already, new one is set up from StartSCSI */
>
(My mail feed from linux-scsi list was flakey for the last 24 hours, and
Guennadi Liakohovetski kindly sent me scsiiom.c file entirely after my
asking for it.)
Hi,
A good news, and a strange observation (not fatal I think...).
I applied the latest patch to scsiiom.c: actually I used the source
file you kindly sent me.
Also, I disabled kernel preemption after reading your post.
From my .config:
# CONFIG_PREEMPT is not set
Also, please note that I upgraded to 2.6.0-test11.
(I am still using gcc 3.3.2)
Now the tmscsim module loaded without a problem!
Attached is the initial portion of the message recorded during booting.
The PD drive at lun 0, and CD drive at lun 1 are both recognized, and
I later could mount a joliet CD and list its directory using "ls -R"
and so the driver seems to work fine more or less!
A strange observation is this. The very first time after I set up the
new kernel and tmscsim module and tried to run 2.6.0-test11, the
module Oopsed again.
But at that time, I was not using serial console :-(
[I thought if the new patch worked for someone else, it might work for
me.]
I looked at the address where Oops occurred on the screen.
It was slightly different from the one reported earlier. Obviously,
the patch changed the absolute addresses. However, the symptoms (stack
trace, with a duplication.) was essentially the same from the report I
gave earlier.
However, after this, when I tried the serial console booting afresh, the
system worked withtout a hitch. The attached log was recorded at the time.
Afterward, I also tried the CRT-console booting again. The
system worked just fine this time around. Hmm...
So there *could* be a timing related race or somthing that might
trigger a problem in a rare situation.
On the other hand, since the problem occurred only at the very first
time so far, it may be due to a setup error : like the object file was
not copied correctly although I think that is highly unlikely due to
the nature of "make bzImage; make modules; make modules_install".
Anyway, I will report to you if such an error occurs again. (Well, I
am not using 2.6.0-testXX regularly, but will try to exercise the new
kernel test versions now and then. Oh, maybe I should test HP DAT
drive, too.).
(The single isolated failure could be even related to my rather
lengthy loadlin command line. MS-DOS command.com ignores characters
after 128(?) characters and that may have played a role: I shortened
my loadlin command line just in case. I could also use
@additional.bat construct to avoid this, but not used it so far.).
So many variables to eliminate from the equation, so to speak.
Anyway, here is the successful log: again, I tried to remove Japanese
characters from it.
Linux version 2.6.0-test11 (root@duron) (gcc ... 3.3.2 (Debian)) #4 Sat
Nov 29 09:11:21 JST 2003
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000002fff0000 (usable)
BIOS-e820: 000000002fff0000 - 000000002fff3000 (ACPI NVS)
BIOS-e820: 000000002fff3000 - 0000000030000000 (ACPI data)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
767MB LOWMEM available.
On node 0 totalpages: 196592
DMA zone: 4096 pages, LIFO batch:1
Normal zone: 192496 pages, LIFO batch:16
HighMem zone: 0 pages, LIFO batch:1
DMI 2.2 present.
Building zonelist for node : 0
Kernel command line: root=/dev/sda6 ro scsihosts=sym53c8xx:tmscsim
console=ttyS0
,9600n8 BOOT_IMAGE=260t9
Initializing CPU#0
PID hash table entries: 4096 (order 12: 32768 bytes)
Detected 1535.151 MHz processor.
Console: colour VGA+ 80x28
Memory: 774720k/786368k available (1888k kernel code, 10880k reserved,
703k data
, 136k init, 0k highmem)
Calibrating delay loop... 3022.84 BogoMIPS
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 256K (64 bytes/line)
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: AMD Athlon(tm) XP 1800+ stepping 02
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
POSIX conformance testing by UNIFIX
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfb690, last bus=1
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
Linux Plug and Play Support v0.97 (c) Adam Belay
PnPBIOS: Scanning system for PnP BIOS support...
PnPBIOS: Found PnP BIOS installation structure at 0xc00fc030
PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xc060, dseg 0xf0000
PnPBIOS: 14 nodes reported by PnP BIOS; 14 recorded by driver
SCSI subsystem initialized
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI: Using IRQ router VIA [1106/0686] at 0000:00:07.0
Machine check exception polling timer started.
ikconfig 0.7 with /proc/config*
devfs: v1.22 (20021013) Richard Gooch (rgooch@atnf.csiro.au)
devfs: devfs_debug: 0x0
devfs: boot_options: 0x0
Initializing Cryptographic API
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
pty: 256 Unix98 ptys configured
Real Time Clock Driver v1.12
Linux agpgart interface v0.100 (c) Dave Jones
agpgart: Detected AMD 761 chipset
agpgart: Maximum main memory to use for agp memory: 690M
agpgart: AGP aperture is 64M @ 0xf0000000
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
Using anticipatory io scheduler
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
Intel(R) PRO/100 Network Driver - version 2.3.30-k1
Copyright (c) 2003 Intel Corporation
PCI: Found IRQ 11 for device 0000:00:0f.0
PCI: Sharing IRQ 11 with 0000:00:0d.0
e100: eth0: Intel(R) PRO/100 Network Connection
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: IDE controller at PCI slot 0000:00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci0000:00:07.1
ide0: BM-DMA at 0xb400-0xb407, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xb408-0xb40f, BIOS settings: hdc:DMA, hdd:pio
hda: ST320423A, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdc: MATSHITA CR-583, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
HPT370A: IDE controller at PCI slot 0000:00:13.0
PCI: Found IRQ 5 for device 0000:00:13.0
HPT370A: chipset revision 4
HPT37X: using 33MHz PCI clock
HPT370A: 100% native mode on irq 5
ide2: BM-DMA at 0xe400-0xe407, BIOS settings: hde:pio, hdf:pio
ide3: BM-DMA at 0xe408-0xe40f, BIOS settings: hdg:pio, hdh:pio
hda: max request size: 128KiB
hda: 40011300 sectors (20485 MB) w/512KiB Cache, CHS=39693/16/63, UDMA(66)
/dev/ide/host0/bus0/target0/lun0: p1 p2 < p5 p6 p7 p8 p9 p10 p11 p12
p13 p14 >
PCI: Found IRQ 10 for device 0000:00:0b.0
PCI: Sharing IRQ 10 with 0000:00:07.2
PCI: Sharing IRQ 10 with 0000:00:07.3
PCI: Sharing IRQ 10 with 0000:00:08.0
sym0: <895> rev 0x1 at pci 0000:00:0b.0 irq 10
sym0: Tekram NVRAM, ID 7, Fast-40, SE, parity checking
sym0: SCSI BUS has been reset.
sym0: SCSI BUS mode change from SE to SE.
sym0: SCSI BUS has been reset.
scsi0 : sym-2.1.18b
Vendor: HITACHI Model: DK318H-91WS Rev: B2BQ
Type: Direct-Access ANSI SCSI revision: 02
sym0:4:0: tagged command queuing enabled, command queue depth 16.
Vendor: IBM Model: DNES-318350Y Rev: SA60
Type: Direct-Access ANSI SCSI revision: 03
sym0:6:0: tagged command queuing enabled, command queue depth 16.
sym0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 31)
sym0:6:0:phase change 2-3 12@2fc5cf60 resid=11.
sym0:4: FAST-20 WIDE SCSI 40.0 MB/s ST (50.0 ns, offset 15)
SCSI device sda: 17773980 512-byte hdwr sectors (9100 MB)
SCSI device sda: drive cache: write through
/dev/scsi/host0/bus0/target4/lun0: p1 < p5 p6 p7 p8 >
Attached scsi disk sda at scsi0, channel 0, id 4, lun 0
SCSI device sdb: 35566501 512-byte hdwr sectors (18210 MB)
SCSI device sdb: drive cache: write through
/dev/scsi/host0/bus0/target6/lun0: p1 < p5 p6 p7 >
Attached scsi disk sdb at scsi0, channel 0, id 6, lun 0
mice: PS/2 mouse device common for all mice
input: PS/2 Logitech Mouse on isa0060/serio1
serio: i8042 AUX port at 0x60,0x64 irq 12
input: AT Translated Set 2 keyboard on isa0060/serio0
serio: i8042 KBD port at 0x60,0x64 irq 1
I2O Core - (C) Copyright 1999 Red Hat Software
I2O: Event thread created as pid 12
i2o: Checking for PCI I2O controllers...
I2O configuration manager v 0.04.
(C) Copyright 1999 Red Hat Software
NET: Registered protocol family 2
IP: routing cache hash table of 2048 buckets, 64Kbytes
TCP: Hash tables configured (established 262144 bind 37449)
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 136k freed
INIT: version 2.84 booting
Loading /etc/console/boottime.kmap.gz
Activating swap.
Adding 2000052k swap on /dev/hda12. Priority:-1 extents:1
Checking root file system...
fsck 1.34-WIP (21-May-2003)
/dev/sda6: clean, 212160/895840 files, 1634625/1791484 blocks
/etc/isapnp.conf:20 -- Fatal - Error occurred executing request 'ISOLATE
PRESERV
E' --- further action aborted
System time was Sat Nov 29 00:58:21 UTC 2003.
Setting the System Clock using the Hardware Clock as reference...
System Clock set. System local time is now Sat Nov 29 09:58:23 JST 2003.
Calculating module dependencies... done.
Loading modules...
hpfs
warning: process `update' used the obsolete bdflush system call
Fix your initscripts?
nls_cp437
sg
Attached scsi generic sg0 at scsi0, channel 0, id 4, lun 0, type 0
Attached scsi generic sg1 at scsi0, channel 0, id 6, lun 0, type 0
sr_mod
tmscsim
PCI: Found IRQ 11 for device 0000:00:0d.0
PCI: Sharing IRQ 11 with 0000:00:0f.0
DC390: 1 adapters found
scsi1 : Tekram DC390/AM53C974 V2.0f 2000-12-20
DC390: Target 5: Sync transfer 5.0 MHz, Offset 8
Vendor: MATSHITA Model: PD-1 LF-1000 Rev: A111
Type: Optical Device ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi1, channel 0, id 5, lun 0
Attached scsi generic sg2 at scsi1, channel 0, id 5, lun 0, type 7
Vendor: MATSHITA Model: PD-1 LF-1000 Rev: A111
Type: CD-ROM ANSI SCSI revision: 02
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.12
Attached scsi generic sg3 at scsi1, channel 0, id 5, lun 1, type 5
ide-cd
hdc: ATAPI 8X CD-ROM drive, 128kB Cache, DMA
radeon
[drm] Initialized radeon 1.9.0 20020828 on minor 0
ecc
FATAL: Module ecc not found.
ipv6
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
All modules loaded.
Checking all file systems...
fsck 1.34-WIP (21-May-2003)
/dev/sdb5: clean, 167104/770048 files, 1449390/1537272 blocks
/dev/hda11: clean, 13/250368 files, 455595/500015 blocks
/dev/hda10: clean, 12/250368 files, 129092/500015 blocks
Setting kernel variables..
Mounting local filesystems...
/dev/sdb5 on /u2 type ext2 (rw)
mount: none already mounted or /dev/pts busy
mount: according to mtab, devpts is already mounted on /dev/pts
mount: fs type shm not supported by kernel
/dev/hda11 on /dos-vmware-dir type ext2 (rw)
/dev/hda10 on /dos-vmware-2-dir type ext2 (rw)
/dev/hda1 on /dos-c-drive type vfat (rw)
... omitted ...
Later from the command line.
ishikawa@duron$ cat /proc/scsi/
device_info scsi sg sym53c8xx tmscsim
ishikawa@duron$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 04 Lun: 00
Vendor: HITACHI Model: DK318H-91WS Rev: B2BQ
Type: Direct-Access ANSI SCSI revision: 02
Host: scsi0 Channel: 00 Id: 06 Lun: 00
Vendor: IBM Model: DNES-318350Y Rev: SA60
Type: Direct-Access ANSI SCSI revision: 03
Host: scsi1 Channel: 00 Id: 05 Lun: 00
Vendor: MATSHITA Model: PD-1 LF-1000 Rev: A111
Type: Optical Device ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 05 Lun: 01
Vendor: MATSHITA Model: PD-1 LF-1000 Rev: A111
Type: CD-ROM ANSI SCSI revision: 02
ishikawa@duron$ cat /proc/scsi/tmscsim/1
Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0f 2000-12-20
SCSI Host Nr 1, DC390 Adapter Nr 0
IOPortBase 0xcc00, IRQ 11
MaxID 7, MaxLUN 8, AdapterID 7, SelTimeout 250 ms, DelayReset 3 s
TagMaxNum 16, Status 0x00, ACBFlag 0x00, GlitchEater 24 ns
Statistics: Cmnds 28, Cmnds not sent directly 0, Out of SRB conds 0
Lost arbitrations 0, Sel. connected 0, Connected: No
Nr of attached devices: 4, Nr of DCBs: 2
Map of attached LUNs: 00 00 00 00 00 03 00 00
Idx ID LUN Prty Sync DsCn SndS TagQ NegoPeriod SyncSpeed SyncOffs MaxCmd
00 05 00 Yes Yes Yes Yes No 200 ns 5.0 M 08 01
01 05 01 Yes Yes Yes Yes No 200 ns 5.0 M 08 01
Commands in Queues: Query: 0:
ishikawa@duron$ ls /dev/cdrom*
/dev/cdrom@
ishikawa@duron$ ls -l /dev/cdroms
ishikawa@duron$ ls -l /dev/sr*
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr0 -> scd0
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr1 -> scd1
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr2 -> scd2
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr3 -> scd3
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr4 -> scd4
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr5 -> scd5
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr6 -> scd6
lrwxrwxrwx 1 root root 4 2000-11-24 05:31 /dev/sr7 -> scd7
ishikawa@duron$ dmesg | grep sr
sr0: scsi-1 drive
Attached scsi CD-ROM sr0 at scsi1, channel 0, id 5, lun 1
ishikawa@duron$ su
Password:
duron:/home/ishikawa# mount /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
duron:/home/ishikawa# ls -l /mnt
2992
dr-xr-xr-x 1 root root 2048 2003-05-07 14:25 DATA
-r-xr-xr-x 1 root root 3061340 2003-05-07 14:25 prog.exe
... later I could recursively list DATA ...
Thank you agai for your help.
PS: now that the driver seems to be in better shape, you might want to
bump the driver version number reported in the banner,
"Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0f
2000-12-20".
The new version banner will help you and users in keeping track of the new
drivers which will solve problems encountered in the future versions
of 2.6.x kernel. Numbering probably should be coordinated with
Kurt Garloff.
PPS: also someone might want to run
indent -kr -i8
on the source files after the cleanup (or before cleanup).
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-29 1:55 ` Chiaki
@ 2003-11-29 9:46 ` Guennadi Liakhovetski
2003-11-29 9:58 ` Guennadi Liakhovetski
` (3 more replies)
0 siblings, 4 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-29 9:46 UTC (permalink / raw)
To: Chiaki; +Cc: linux-scsi, Thorsten Leemhuis, gl
On Sat, 29 Nov 2003, Chiaki wrote:
> Also, I disabled kernel preemption after reading your post.
> From my .config:
> # CONFIG_PREEMPT is not set
Ok, then it worked (except for that misterious first try). Can you switch
preemption on again, so we can check for sure that it's my last
modification, that fixed your problem and not switching preemption off.
> I looked at the address where Oops occurred on the screen.
> It was slightly different from the one reported earlier. Obviously,
> the patch changed the absolute addresses. However, the symptoms (stack
> trace, with a duplication.) was essentially the same from the report I
> gave earlier.
That is very strange. Let's keep an eye on this...
> So there *could* be a timing related race or somthing that might
> trigger a problem in a rare situation.
You load the driver always on boot, right? So, consitions are always more
or less the same...
> kernel test versions now and then. Oh, maybe I should test HP DAT
> drive, too.).
Yes, please do. Thorsten still has problems burning CDs on a tmscsim
attached CDRW. You don't have one to test, do you?
> PS: now that the driver seems to be in better shape, you might want to
> bump the driver version number reported in the banner,
> "Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0f
> 2000-12-20".
Yep. Kurt, Christian, shall I increment the version number (2.0g / 2.1a?),
adding a Changelog entry? Also, how shall it be maintained now, until it
is included in the stock 2.6 (hopefully)? Is there a linux-scsi tree,
where this driver could be merged in, or just an ftp site, where the patch
could be uploaded? I am not using BK (don't think it would make much sense
with a 56K modem dial-up:-)).
> PPS: also someone might want to run
> indent -kr -i8
> on the source files after the cleanup (or before cleanup).
No, wouldn't do that. It would unnecessarily blow the patch up...
Although, I didn't really follow the original indentation everywhere, but
I wouldn't chenge it all just for the sake of it. The patch already has
more than enough "non-functionality-related" modifications.
Thanks
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-29 9:46 ` Guennadi Liakhovetski
@ 2003-11-29 9:58 ` Guennadi Liakhovetski
2003-11-29 13:06 ` Matthias Andree
` (2 subsequent siblings)
3 siblings, 0 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-29 9:58 UTC (permalink / raw)
To: linux-scsi; +Cc: gl
> Yep. Kurt, Christian, shall I increment the version number (2.0g / 2.1a?),
Oops, apologize, I certainly meant to address Christoph Hellwig, sorry.
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-29 9:46 ` Guennadi Liakhovetski
2003-11-29 9:58 ` Guennadi Liakhovetski
@ 2003-11-29 13:06 ` Matthias Andree
2003-11-29 20:37 ` Guennadi Liakhovetski
2003-11-29 18:11 ` Kurt Garloff
2003-11-30 5:27 ` Chiaki
3 siblings, 1 reply; 28+ messages in thread
From: Matthias Andree @ 2003-11-29 13:06 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: Chiaki, linux-scsi, Thorsten Leemhuis, gl
Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
>> PS: now that the driver seems to be in better shape, you might want to
>> bump the driver version number reported in the banner,
>> "Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0f
>> 2000-12-20".
>
> Yep. Kurt, Christian, shall I increment the version number (2.0g / 2.1a?),
> adding a Changelog entry? Also, how shall it be maintained now, until it
> is included in the stock 2.6 (hopefully)? Is there a linux-scsi tree,
> where this driver could be merged in, or just an ftp site, where the patch
> could be uploaded? I am not using BK (don't think it would make much sense
> with a 56K modem dial-up:-)).
Guennadi,
Please bump the version, I'd choose 2.0f-gl1 (where gl are your initials
and 1 is the first "release" you deem stable).
If some maintainer (Kurt? 2.6-SCSI-bugfixes maintainer?) wants a
different version, he shall have the last word and can still choose a
different version string.
Thanks,
--
Matthias Andree
Encrypt your mail: my GnuPG key ID is 0x052E7D95
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-29 13:06 ` Matthias Andree
@ 2003-11-29 20:37 ` Guennadi Liakhovetski
0 siblings, 0 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-29 20:37 UTC (permalink / raw)
To: Matthias Andree; +Cc: Chiaki, linux-scsi, Thorsten Leemhuis, gl
On Sat, 29 Nov 2003, Matthias Andree wrote:
> Please bump the version, I'd choose 2.0f-gl1 (where gl are your initials
> and 1 is the first "release" you deem stable).
Yeah-yeah, I know what "gl" means - as well as anybody living / working in
Germany does:-) It's one of favorite jokes in the company, I am working
for (see my working email address in the CC-list).
> If some maintainer (Kurt? 2.6-SCSI-bugfixes maintainer?) wants a
> different version, he shall have the last word and can still choose a
> different version string.
Ok, version string is one of the smallest problems, the real question is -
what to do with the patch? Just post it to the list, so that one of
maintainers could pick it up and include in his / her tree?
Also, would be nice if somebody could test this driver on a highmem-PC,
and on non i386 platforms...
Well, it has been fun. I guess, I could try to fill in those "TODOs" Kurt
has inserted in the code. But that will be for -gl2. Otherwise, there are
quite a few more SCSI drivers, depending on BROKEN. Do any of them need
fixing and currently have nobody to do the work or they are there just
waiting to be removed? Anyway, I don't have any of that hardware at
hand...
Thanks
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-29 9:46 ` Guennadi Liakhovetski
2003-11-29 9:58 ` Guennadi Liakhovetski
2003-11-29 13:06 ` Matthias Andree
@ 2003-11-29 18:11 ` Kurt Garloff
2003-11-29 18:36 ` James Bottomley
2003-11-29 21:19 ` Guennadi Liakhovetski
2003-11-30 5:27 ` Chiaki
3 siblings, 2 replies; 28+ messages in thread
From: Kurt Garloff @ 2003-11-29 18:11 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: Chiaki, Linux SCSI list, Thorsten Leemhuis, gl
[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]
On Sat, Nov 29, 2003 at 10:46:24AM +0100, Guennadi Liakhovetski wrote:
> > PS: now that the driver seems to be in better shape, you might want to
> > bump the driver version number reported in the banner,
> > "Tekram DC390/AM53C974 PCI SCSI Host Adapter, Driver Version 2.0f
> > 2000-12-20".
>
> Yep. Kurt, Christian, shall I increment the version number (2.0g / 2.1a?),
> adding a Changelog entry? Also, how shall it be maintained now, until it
> is included in the stock 2.6 (hopefully)? Is there a linux-scsi tree,
> where this driver could be merged in, or just an ftp site, where the patch
> could be uploaded? I am not using BK (don't think it would make much sense
> with a 56K modem dial-up:-)).
Well, 2.1a seems a reasonable version number.
Please add a changelog entry. You should get the credits for doing all
the work for porting the driver! Thanks again!
I can put it for download on my site;
we should try to push it into 2.6.0/1, of course.
> No, wouldn't do that. It would unnecessarily blow the patch up...
I wouldn't do it either.
Then better have two patches, one doing only functional changes, one
only changing formatting.
Regards,
--
Kurt Garloff <kurt@garloff.de> [Koeln, DE]
Physics:Plasma modeling <garloff@plasimo.phys.tue.nl> [TU Eindhoven, NL]
Linux:SCSI, Security <garloff@suse.de> [SUSE Nuernberg, DE]
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-29 18:11 ` Kurt Garloff
@ 2003-11-29 18:36 ` James Bottomley
2003-11-29 21:19 ` Guennadi Liakhovetski
1 sibling, 0 replies; 28+ messages in thread
From: James Bottomley @ 2003-11-29 18:36 UTC (permalink / raw)
To: Kurt Garloff
Cc: Guennadi Liakhovetski, Chiaki, Linux SCSI list, Thorsten Leemhuis,
gl
On Sat, 2003-11-29 at 12:11, Kurt Garloff wrote:
> I can put it for download on my site;
> we should try to push it into 2.6.0/1, of course.
It's too late for 2.6.0, I'm afraid. I'll keep it in the queue for
scsi-misc-2.7.
I anticipate the driver updates gate opening again before 2.7 begins, so
it may be able to go into 2.6.1 or later, but that depends on Andrew's
policy.
James
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-29 18:11 ` Kurt Garloff
2003-11-29 18:36 ` James Bottomley
@ 2003-11-29 21:19 ` Guennadi Liakhovetski
1 sibling, 0 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-29 21:19 UTC (permalink / raw)
To: Kurt Garloff; +Cc: Chiaki, Linux SCSI list, Thorsten Leemhuis, gl
[-- Attachment #1: Type: TEXT/PLAIN, Size: 482 bytes --]
On Sat, 29 Nov 2003, Kurt Garloff wrote:
> Well, 2.1a seems a reasonable version number.
> Please add a changelog entry. You should get the credits for doing all
> the work for porting the driver! Thanks again!
...with the help from you and others - in code improvement and testing!
> I can put it for download on my site;
> we should try to push it into 2.6.0/1, of course.
Attached is the current version of the patch.
Thanks again to all
Guennadi
---
Guennadi Liakhovetski
[-- Attachment #2: Type: APPLICATION/octet-stream, Size: 18066 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-29 9:46 ` Guennadi Liakhovetski
` (2 preceding siblings ...)
2003-11-29 18:11 ` Kurt Garloff
@ 2003-11-30 5:27 ` Chiaki
3 siblings, 0 replies; 28+ messages in thread
From: Chiaki @ 2003-11-30 5:27 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi, Thorsten Leemhuis, gl
Guennadi Liakhovetski wrote:
> On Sat, 29 Nov 2003, Chiaki wrote:
>
>
>>Also, I disabled kernel preemption after reading your post.
>> From my .config:
>> # CONFIG_PREEMPT is not set
>
>
> Ok, then it worked (except for that misterious first try). Can you switch
> preemption on again, so we can check for sure that it's my last
> modification, that fixed your problem and not switching preemption off.
>
Hello,
I recompiled the kernel with preemption enabled this time.
tmscsim module loaded successfully.
So it was your patch that corrected the problem.
Thank you again!
PS: As for indentation, as others suggested,
- functional patch.
- incorporation into the main tree.
- possible indentation patch afterward.
seems to be the best steps to follow.
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-28 1:41 ` Chiaki
2003-11-28 7:33 ` Guennadi Liakhovetski
@ 2003-11-28 20:25 ` Guennadi Liakhovetski
2003-11-29 11:03 ` Thorsten Leemhuis
1 sibling, 1 reply; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-28 20:25 UTC (permalink / raw)
To: Chiaki; +Cc: linux-scsi, Thorsten Leemhuis
Further to your tests, Thorsten: just tried cdecord v. 2.00.3 under 2.4.21
and (the same command) under 2.6.0-test7. Worked under 2.4, failed under
2.6. However, I tried it with an ATAPI CDRW, but still, it indicates, that
cdrecord is still not quite functional under 2.6. I did get some error
messages under 2.4:
Error: Illegal request -- (Sense key=0x05)
which, presumably, means some unsupported command, but still it worked. I
should look through LKML archives regarding cdrecord under 2.6, or anybody
can give a short info?
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-28 20:25 ` Guennadi Liakhovetski
@ 2003-11-29 11:03 ` Thorsten Leemhuis
2003-11-29 12:43 ` Thorsten Leemhuis
0 siblings, 1 reply; 28+ messages in thread
From: Thorsten Leemhuis @ 2003-11-29 11:03 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: Chiaki, linux-scsi
[Hi linux-scsi, I mailed with Guennadi in private before as I tried the
driver before it was posted to the list]
Am Fr, den 28.11.2003 schrieb Guennadi Liakhovetski um 21:25:
> Further to your tests, Thorsten: just tried cdecord v. 2.00.3 under 2.4.21
> and (the same command) under 2.6.0-test7. Worked under 2.4, failed under
> 2.6. However, I tried it with an ATAPI CDRW, but still, it indicates, that
> cdrecord is still not quite functional under 2.6. I did get some error
> messages under 2.4:
>
> Error: Illegal request -- (Sense key=0x05)
>
> which, presumably, means some unsupported command, but still it worked. I
> should look through LKML archives regarding cdrecord under 2.6, or anybody
> can give a short info?
PEBKAC
I just found the problem, was my fault -- the module sg was not loaded,
in 2.4 this was done automatically. Will have to check my
module-configuration...
Will try to burn now. Sorry for the noise.
CU
thl
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-29 11:03 ` Thorsten Leemhuis
@ 2003-11-29 12:43 ` Thorsten Leemhuis
0 siblings, 0 replies; 28+ messages in thread
From: Thorsten Leemhuis @ 2003-11-29 12:43 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: Chiaki, linux-scsi
Am Sa, den 29.11.2003 schrieb Thorsten Leemhuis um 12:03:
> [Hi linux-scsi, I mailed with Guennadi in private before as I tried the
> driver before it was posted to the list]
>
> Am Fr, den 28.11.2003 schrieb Guennadi Liakhovetski um 21:25:
> > Further to your tests, Thorsten: just tried cdecord v. 2.00.3 under 2.4.21
> > and (the same command) under 2.6.0-test7. Worked under 2.4, failed under
> > 2.6. However, I tried it with an ATAPI CDRW, but still, it indicates, that
> > cdrecord is still not quite functional under 2.6. I did get some error
> > messages under 2.4:
> >
> > Error: Illegal request -- (Sense key=0x05)
> >
> > which, presumably, means some unsupported command, but still it worked. I
> > should look through LKML archives regarding cdrecord under 2.6, or anybody
> > can give a short info?
>
> PEBKAC
>
> I just found the problem, was my fault -- the module sg was not loaded,
> in 2.4 this was done automatically. Will have to check my
> module-configuration...
>
> Will try to burn now. Sorry for the noise.
Burning went fine without problems, a bit-wise compare was fine.
Tried to scan, there the machine locks up. But this happens in 2.4 also,
maybe it's hardware-problem. From my point of view I think investigating
further here is lost time.
Thanks for your work Guennadi!
CU
thl
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6] (cards)
2003-11-27 19:13 ` Chiaki
2003-11-27 22:05 ` Guennadi Liakhovetski
@ 2003-11-27 22:43 ` Guennadi Liakhovetski
2003-11-28 1:45 ` Chiaki
2003-11-29 18:14 ` Kurt Garloff
1 sibling, 2 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-27 22:43 UTC (permalink / raw)
To: linux-scsi
Hi
What are the best (for testing) tmscsim-supported cards (tekram (t) /
dawicontrol / ...)? My on-board am53c974 is way too simple... Or does the
probability of getting bugs depend of what devices hang on it?
Thanks
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6] (cards)
2003-11-27 22:43 ` TMSCSIM [2.6] (cards) Guennadi Liakhovetski
@ 2003-11-28 1:45 ` Chiaki
2003-11-29 18:14 ` Kurt Garloff
1 sibling, 0 replies; 28+ messages in thread
From: Chiaki @ 2003-11-28 1:45 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi
Guennadi Liakhovetski wrote:
> Hi
>
> What are the best (for testing) tmscsim-supported cards (tekram (t) /
> dawicontrol / ...)? My on-board am53c974 is way too simple... Or does the
> probability of getting bugs depend of what devices hang on it?
>
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski
>
>
I have been using TEKRAM dc390 for some years with good result.
If I recall correctly, Kurt Garloff used dawicontrol card during
early debugging sessions with me on the driver.
I DO suspect that the different
devices on the bus may trigger different bugs.
Does someone use SCSI CDROM with DC390 as I do?
Maybe such person might want to test this driver under 2.6.0-testXX.
--
int main(void){int j=2003;/*(c)2003 cishikawa. */
char t[] ="<CI> @abcdefghijklmnopqrstuvwxyz.,\n\"";
char *i ="g>qtCIuqivb,gCwe\np@.ietCIuqi\"tqkvv is>dnamz";
while(*i)((j+=strchr(t,*i++)-(int)t),(j%=sizeof t-1),
(putchar(t[j])));return 0;}/* under GPL */
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6] (cards)
2003-11-27 22:43 ` TMSCSIM [2.6] (cards) Guennadi Liakhovetski
2003-11-28 1:45 ` Chiaki
@ 2003-11-29 18:14 ` Kurt Garloff
1 sibling, 0 replies; 28+ messages in thread
From: Kurt Garloff @ 2003-11-29 18:14 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
Guennadi,
On Thu, Nov 27, 2003 at 11:43:03PM +0100, Guennadi Liakhovetski wrote:
> What are the best (for testing) tmscsim-supported cards (tekram (t) /
> dawicontrol / ...)?
Dawi2974, TekramDC390(T), onboard 53c974/79c974 chipsets.
I doubt you can easily find new hardware with this chipset nowadays ...
> My on-board am53c974 is way too simple...
They are all the same ...
> Or does the
> probability of getting bugs depend of what devices hang on it?
Yep. Scanners did tend to trigger bugs in the driver in the past.
Regards,
--
Kurt Garloff <garloff@suse.de> Cologne, DE
SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
[parent not found: <1069954227.1667.1.camel@work.thl.home>]
* Re: TMSCSIM [2.6]
[not found] <1069954227.1667.1.camel@work.thl.home>
@ 2003-11-28 9:05 ` Guennadi Liakhovetski
0 siblings, 0 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-28 9:05 UTC (permalink / raw)
To: Thorsten Leemhuis; +Cc: linux-scsi, Chiaki Ishikawa
Sorry, you'll eventually get this patch twice - couldn't send from home
(provider busy:-().
Also, could you try compiling it without preemption (don't know, uf you,
Torsten, have it on too). Not that I suspected a bug there - rather
tmscsim's incompatibility with it (although I also have it on).
I think, also, it would make it easier for me, if we agree on the same key
configuea-options for the testing - no SMP, no preemption and the
following hacking options on:
CONFIG_DEBUG_KERNEL
CONFIG_MAGIC_SYSRQ
CONFIG_FRAME_POINTER
Not sure if there are any other options in the kernel, that will change
macros / inlines? And the 2.95.3. compiler, please. I want to try to make
our binaries compatible, so, that I can follow your backtrace on my
compiled binaries. Also, the CPU optimisation could be important. Should
we agree on some minimum common CPU, say, Pentium Classic? But, anyway,
try the patch below first.
Guennadi
---------------------------------
Guennadi Liakhovetski, Ph.D.
DSA Daten- und Systemtechnik GmbH
Pascalstr. 28
D-52076 Aachen
Germany
diff -u linux/drivers/scsi/scsiiom.c~ linux/drivers/scsi/scsiiom.c
--- linux/drivers/scsi/scsiiom.c~ Thu Nov 27 23:02:35 2003
+++ linux/drivers/scsi/scsiiom.c Fri Nov 28 08:29:40 2003
@@ -1439,7 +1439,7 @@
goto ckc_e;
}
SET_RES_DRV(pcmd->result,DRIVER_SENSE);
-// pcmd->use_sg = pSRB->SavedSGCount;
+ pcmd->use_sg = pSRB->SavedSGCount;
//pSRB->ScsiCmdLen = (UCHAR) (pSRB->Segment1[0] >> 8);
DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n", pcmd->pid, pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun));
pSRB->SGIndex = 0;
@@ -1734,22 +1734,22 @@
static void __inline__
dc390_RequestSense( PACB pACB, PDCB pDCB, PSRB pSRB )
{
-// PSCSICMD pcmd;
+ PSCSICMD pcmd;
+
+ pcmd = pSRB->pcmd;
REMOVABLEDEBUG(printk (KERN_INFO "DC390: RequestSense (Cmd %02x, Id %02x, LUN %02x)\n",\
- pSRB->pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
+ pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
pSRB->SRBFlag |= AUTO_REQSENSE;
//pSRB->Segment0[0] = (UINT) pSRB->CmdBlock[0];
//pSRB->Segment0[1] = (UINT) pSRB->CmdBlock[4];
- //pSRB->Segment1[0] = ((UINT)(pSRB->pcmd->cmd_len) << 8) + pSRB->SGcount;
+ //pSRB->Segment1[0] = ((UINT)(pcmd->cmd_len) << 8) + pSRB->SGcount;
//pSRB->Segment1[1] = pSRB->TotalXferredLen;
- pSRB->SavedSGCount = pSRB->SGcount;
+ pSRB->SavedSGCount = pcmd->use_sg;
pSRB->SavedTotXLen = pSRB->TotalXferredLen;
pSRB->AdaptStatus = 0;
pSRB->TargetStatus = 0; /* CHECK_CONDITION<<1; */
-
-// pcmd = pSRB->pcmd;
/* We are called from SRBdone, original PCI mapping has been removed
* already, new one is set up from StartSCSI */
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6] (was: Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6)
@ 2003-11-22 23:27 Guennadi Liakhovetski
2003-11-23 20:26 ` TMSCSIM [2.6] Matthias Andree
0 siblings, 1 reply; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-22 23:27 UTC (permalink / raw)
To: linux-scsi
The appended patch is an attempt to fix the tmscsim driver for 2.6. Tested
only on an on-board AM53C974 controller so far.
Thanks
Guennadi
---
Guennadi Liakhovetski
diff -ur linux-2.6.0-test7.arm/drivers/scsi/dc390.h linux-2.6.0-test7/drivers/scsi/dc390.h
--- linux-2.6.0-test7.arm/drivers/scsi/dc390.h Sat Aug 9 06:33:17 2003
+++ linux-2.6.0-test7/drivers/scsi/dc390.h Thu Nov 13 21:41:12 2003
@@ -36,14 +36,10 @@
extern int DC390_detect(Scsi_Host_Template *psht);
extern int DC390_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *));
extern int DC390_abort(Scsi_Cmnd *cmd);
-extern int DC390_reset(Scsi_Cmnd *cmd, unsigned int resetFlags);
+extern int DC390_reset(Scsi_Cmnd *cmd);
extern int DC390_bios_param(struct scsi_device *sdev, struct block_device *dev,
sector_t capacity, int geom[]);
-#ifdef MODULE
static int DC390_release(struct Scsi_Host *);
-#else
-# define DC390_release NULL
-#endif
#endif /* DC390_H */
diff -ur linux-2.6.0-test7.arm/drivers/scsi/scsiiom.c linux-2.6.0-test7/drivers/scsi/scsiiom.c
--- linux-2.6.0-test7.arm/drivers/scsi/scsiiom.c Sat Aug 9 06:31:55 2003
+++ linux-2.6.0-test7/drivers/scsi/scsiiom.c Sat Nov 22 23:54:15 2003
@@ -5,9 +5,6 @@
* Bus Master Host Adapter *
***********************************************************************/
/* $Id: scsiiom.c,v 2.55.2.17 2000/12/20 00:39:37 garloff Exp $ */
-
-#error Please convert me to Documentation/DMA-mapping.txt
-
static void __inline__
dc390_freetag (PDCB pDCB, PSRB pSRB)
{
@@ -36,9 +33,12 @@
}
if (time_before (jiffies, pACB->pScsiHost->last_reset))
{
- DEBUG0(printk ("DC390: We were just reset and don't accept commands yet!\n");)
+ DEBUG0(printk ("DC390: We were just reset and don't accept commands yet!\n"));
return 1;
}
+ /* KG: Moved pci mapping here */
+ dc390_pci_map(pSRB);
+ /* TODO: error handling */
DC390_write8 (Scsi_Dest_ID, pDCB->TargetID);
DC390_write8 (Sync_Period, pDCB->SyncPeriod);
DC390_write8 (Sync_Offset, pDCB->SyncOffset);
@@ -47,8 +47,9 @@
DC390_write8 (CtrlReg4, pDCB->CtrlR4);
DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); /* Flush FIFO */
DEBUG1(printk (KERN_INFO "DC390: Start SCSI command: %02x (Sync:%02x)\n",\
- pSRB->pcmd->cmnd[0], pDCB->SyncMode);)
- disc_allowed = pDCB->DevMode & EN_DISCONNECT_; try_sync_nego = 0;
+ pSRB->pcmd->cmnd[0], pDCB->SyncMode));
+ disc_allowed = pDCB->DevMode & EN_DISCONNECT_;
+ try_sync_nego = 0;
/* Don't disconnect on AUTO_REQSENSE, cause it might be an
* Contingent Allegiance Condition (6.6), where no tags should be used.
* All other have to be allowed to disconnect to prevent Incorrect
@@ -78,13 +79,13 @@
DC390_write8 (ScsiFifo, SIMPLE_QUEUE_TAG);
pDCB->TagMask |= (1 << tag_no); pSRB->TagNumber = tag_no;
DC390_write8 (ScsiFifo, tag_no);
- DEBUG1(printk (KERN_DEBUG "DC390: Select w/DisCn for Cmd %li (SRB %p), Using Tag %02x\n", pSRB->pcmd->pid, pSRB, tag_no);)
+ DEBUG1(printk (KERN_DEBUG "DC390: Select w/DisCn for Cmd %li (SRB %p), Using Tag %02x\n", pSRB->pcmd->pid, pSRB, tag_no));
cmd = SEL_W_ATN3;
}
else /* No TagQ */
{
// no_tag:
- DEBUG1(printk (KERN_DEBUG "DC390: Select w%s/DisCn for Cmd %li (SRB %p), No TagQ\n", (disc_allowed?"":"o"), pSRB->pcmd->pid, pSRB);)
+ DEBUG1(printk (KERN_DEBUG "DC390: Select w%s/DisCn for Cmd %li (SRB %p), No TagQ\n", (disc_allowed?"":"o"), pSRB->pcmd->pid, pSRB));
};
pSRB->SRBState = SRB_START_;
@@ -92,7 +93,7 @@
if (try_sync_nego)
{
UCHAR Sync_Off = pDCB->SyncOffset;
- DEBUG0(printk (KERN_INFO "DC390: NEW Sync Nego code triggered (%i %i)\n", pDCB->TargetID, pDCB->TargetLUN);)
+ DEBUG0(printk (KERN_INFO "DC390: NEW Sync Nego code triggered (%i %i)\n", pDCB->TargetID, pDCB->TargetLUN));
pSRB->MsgOutBuf[0] = EXTENDED_MESSAGE;
pSRB->MsgOutBuf[1] = 3;
pSRB->MsgOutBuf[2] = EXTENDED_SDTR;
@@ -116,7 +117,7 @@
DC390_write8 (ScsiFifo, 0);
DC390_write8 (ScsiFifo, sizeof(pSRB->pcmd->sense_buffer));
DC390_write8 (ScsiFifo, 0);
- DEBUG1(printk (KERN_DEBUG "DC390: AutoReqSense !\n");)
+ DEBUG1(printk (KERN_DEBUG "DC390: AutoReqSense !\n"));
}
else /* write cmnd to bus */
{
@@ -127,15 +128,15 @@
};
}
DEBUG0(if (pACB->pActiveDCB) \
- printk (KERN_WARNING "DC390: ActiveDCB != 0\n");)
+ printk (KERN_WARNING "DC390: ActiveDCB != 0\n"));
DEBUG0(if (pDCB->pActiveSRB) \
- printk (KERN_WARNING "DC390: ActiveSRB != 0\n");)
+ printk (KERN_WARNING "DC390: ActiveSRB != 0\n"));
//DC390_write8 (DMA_Cmd, DMA_IDLE_CMD);
if (DC390_read8 (Scsi_Status) & INTERRUPT)
{
dc390_freetag (pDCB, pSRB);
DEBUG0(printk ("DC390: Interrupt during Start SCSI (pid %li, target %02i-%02i)\n",
- pSRB->pcmd->pid, pSRB->pcmd->target, pSRB->pcmd->lun);)
+ pSRB->pcmd->pid, pSRB->pcmd->device->id, pSRB->pcmd->device->lun));
pSRB->SRBState = SRB_READY;
//DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD);
pACB->SelLost++;
@@ -158,13 +159,13 @@
{
PSRB pSRB;
UCHAR dstate;
- DEBUG0(USHORT pstate;PDEVDECL1;)
+ DEBUG0(USHORT pstate;PDEVDECL1);
- DEBUG0(PDEVSET1;)
- DEBUG0(PCI_READ_CONFIG_WORD (PDEV, PCI_STATUS, &pstate);)
+ DEBUG0(PDEVSET1);
+ DEBUG0(PCI_READ_CONFIG_WORD (PDEV, PCI_STATUS, &pstate));
DEBUG0(if (pstate & (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY))\
{ printk(KERN_WARNING "DC390: PCI state = %04x!\n", pstate); \
- PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));};)
+ PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));});
dstate = DC390_read8 (DMA_Status);
@@ -183,7 +184,7 @@
{
do
{
- DEBUG1(printk (KERN_DEBUG "DC390: read residual bytes ... \n");)
+ DEBUG1(printk (KERN_DEBUG "DC390: read residual bytes ... \n"));
dstate = DC390_read8 (DMA_Status);
residual = DC390_read8 (CtcReg_Low) | DC390_read8 (CtcReg_Mid) << 8 |
DC390_read8 (CtcReg_High) << 16;
@@ -210,10 +211,10 @@
}
dc390_laststatus &= ~0xff000000; dc390_laststatus |= dstate << 24;
return dstate;
-};
+}
#endif
-void __inline__
+static irqreturn_t __inline__
DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
{
PACB pACB, pACB2;
@@ -226,37 +227,37 @@
#if DMA_INT
UCHAR dstatus;
#endif
- DC390_AFLAGS DC390_IFLAGS //DC390_DFLAGS
+ DC390_AFLAGS DC390_IFLAGS; //DC390_DFLAGS
pACB = (PACB)dev_id;
for (pACB2 = dc390_pACB_start; (pACB2 && pACB2 != pACB); pACB2 = pACB2->pNextACB);
if (!pACB2)
{
printk ("DC390: IRQ called with foreign dev_id %p!\n", pACB);
- return;
+ return IRQ_NONE;
}
//DC390_LOCK_DRV;
sstatus = DC390_read8 (Scsi_Status);
if( !(sstatus & INTERRUPT) )
- { /*DC390_UNLOCK_DRV;*/ return; };
+ { /*DC390_UNLOCK_DRV;*/ return IRQ_NONE; };
- DEBUG1(printk (KERN_DEBUG "sstatus=%02x,", sstatus);)
+ DEBUG1(printk (KERN_DEBUG "sstatus=%02x,", sstatus));
#if DMA_INT
- DC390_LOCK_IO;
+ DC390_LOCK_IO(pACB->pScsiHost);
DC390_LOCK_ACB;
dstatus = dc390_dma_intr (pACB);
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO;
+ DC390_UNLOCK_IO(pACB->pScsiHost);
- DEBUG1(printk (KERN_DEBUG "dstatus=%02x,", dstatus);)
+ DEBUG1(printk (KERN_DEBUG "dstatus=%02x,", dstatus));
if (! (dstatus & SCSI_INTERRUPT))
{
- DEBUG0(printk (KERN_WARNING "DC390 Int w/o SCSI actions (only DMA?)\n");)
+ DEBUG0(printk (KERN_WARNING "DC390 Int w/o SCSI actions (only DMA?)\n"));
//DC390_UNLOCK_DRV;
- return;
+ return IRQ_NONE;
};
#else
//DC390_write32 (DMA_ScsiBusCtrl, WRT_ERASE_DMA_STAT | EN_INT_ON_PCI_ABORT);
@@ -264,14 +265,14 @@
//DC390_write32 (DMA_ScsiBusCtrl, EN_INT_ON_PCI_ABORT);
#endif
- DC390_LOCK_IO;
+ DC390_LOCK_IO(pACB->pScsiHost);
DC390_LOCK_ACB;
//DC390_UNLOCK_DRV_NI; /* Allow _other_ CPUs to process IRQ (useful for shared IRQs) */
istate = DC390_read8 (Intern_State);
istatus = DC390_read8 (INT_Status); /* This clears Scsi_Status, Intern_State and INT_Status ! */
- DEBUG1(printk (KERN_INFO "Istatus(Res,Inv,Dis,Serv,Succ,ReS,SelA,Sel)=%02x,",istatus);)
+ DEBUG1(printk (KERN_INFO "Istatus(Res,Inv,Dis,Serv,Succ,ReS,SelA,Sel)=%02x,",istatus));
dc390_laststatus &= ~0x00ffffff;
dc390_laststatus |= /* dstatus<<24 | */ sstatus<<16 | istate<<8 | istatus;
@@ -325,13 +326,13 @@
dc390_EnableMsgOut_Abort (pACB, pSRB);
phase = pSRB->ScsiPhase;
- DEBUG1(printk (KERN_INFO "DC390: [%i]%s(0) (%02x)\n", phase, dc390_p0_str[phase], sstatus);)
+ DEBUG1(printk (KERN_INFO "DC390: [%i]%s(0) (%02x)\n", phase, dc390_p0_str[phase], sstatus));
stateV = (void *) dc390_phase0[phase];
( *stateV )( pACB, pSRB, &sstatus );
pSRB->ScsiPhase = sstatus & 7;
phase = (UCHAR) sstatus & 7;
- DEBUG1(printk (KERN_INFO "DC390: [%i]%s(1) (%02x)\n", phase, dc390_p1_str[phase], sstatus);)
+ DEBUG1(printk (KERN_INFO "DC390: [%i]%s(1) (%02x)\n", phase, dc390_p1_str[phase], sstatus));
stateV = (void *) dc390_phase1[phase];
( *stateV )( pACB, pSRB, &sstatus );
goto unlock;
@@ -340,17 +341,19 @@
unlock:
//DC390_LOCK_DRV_NI;
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO;
+ DC390_UNLOCK_IO(pACB->pScsiHost);
//DC390_UNLOCK_DRV; /* Restore initial flags */
+ return IRQ_HANDLED;
}
-void
-do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t do_DC390_Interrupt( int irq, void *dev_id, struct pt_regs *regs)
{
- DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq);)
+ irqreturn_t ret;
+ DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq));
/* Locking is done in DC390_Interrupt */
- DC390_Interrupt(irq, dev_id, regs);
- DEBUG1(printk (".. IRQ returned\n");)
+ ret = DC390_Interrupt(irq, dev_id, regs);
+ DEBUG1(printk (".. IRQ returned\n"));
+ return ret;
}
void
@@ -381,8 +384,8 @@
pSRB->pSegmentList++;
psgl = pSRB->pSegmentList;
- pSRB->SGBusAddr = virt_to_bus( psgl->address );
- pSRB->SGToBeXferLen = (ULONG) psgl->length;
+ pSRB->SGBusAddr = cpu_to_le32(pci_dma_lo32(sg_dma_address(psgl)));
+ pSRB->SGToBeXferLen = cpu_to_le32(sg_dma_len(psgl));
}
else
pSRB->SGToBeXferLen = 0;
@@ -433,8 +436,8 @@
dc390_laststatus &= ~0xff000000; dc390_laststatus |= dstate << 24;
DEBUG1(ResidCnt = ((ULONG) DC390_read8 (CtcReg_High) << 16) \
+ ((ULONG) DC390_read8 (CtcReg_Mid) << 8) \
- + ((ULONG) DC390_read8 (CtcReg_Low));)
- DEBUG1(printk (KERN_DEBUG "Count_2_Zero (ResidCnt=%i,ToBeXfer=%li),", ResidCnt, pSRB->SGToBeXferLen);)
+ + ((ULONG) DC390_read8 (CtcReg_Low)));
+ DEBUG1(printk (KERN_DEBUG "Count_2_Zero (ResidCnt=%i,ToBeXfer=%li),", ResidCnt, pSRB->SGToBeXferLen));
DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */
@@ -445,8 +448,8 @@
pSRB->pSegmentList++;
psgl = pSRB->pSegmentList;
- pSRB->SGBusAddr = virt_to_bus( psgl->address );
- pSRB->SGToBeXferLen = (ULONG) psgl->length;
+ pSRB->SGBusAddr = cpu_to_le32(pci_dma_lo32(sg_dma_address(psgl)));
+ pSRB->SGToBeXferLen = cpu_to_le32(sg_dma_len(psgl));
}
else
pSRB->SGToBeXferLen = 0;
@@ -457,7 +460,7 @@
bval = DC390_read8 (Current_Fifo);
while( bval & 0x1f )
{
- DEBUG1(printk (KERN_DEBUG "Check for residuals,");)
+ DEBUG1(printk (KERN_DEBUG "Check for residuals,"));
if( (bval & 0x1f) == 1 )
{
for(i=0; i < 0x100; i++)
@@ -488,7 +491,7 @@
//DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD); /* | DMA_INT */
dc390_laststatus &= ~0xff000000; dc390_laststatus |= bval << 24;
- DEBUG1(printk (KERN_DEBUG "Blast: Read %i times DMA_Status %02x", 0xa000-i, bval);)
+ DEBUG1(printk (KERN_DEBUG "Blast: Read %i times DMA_Status %02x", 0xa000-i, bval));
ResidCnt = (UINT) DC390_read8 (CtcReg_High);
ResidCnt <<= 8;
ResidCnt |= (UINT) DC390_read8 (CtcReg_Mid);
@@ -510,7 +513,7 @@
pSRB->SGToBeXferLen--;
}
DEBUG1(printk (KERN_DEBUG "Xfered: %li, Total: %li, Remaining: %li\n", xferCnt,\
- pSRB->TotalXferredLen, pSRB->SGToBeXferLen);)
+ pSRB->TotalXferredLen, pSRB->SGToBeXferLen));
}
}
@@ -579,7 +582,7 @@
{
pSRB->MsgOutBuf[0] = MESSAGE_REJECT;
pSRB->MsgCnt = 1; DC390_ENABLE_MSGOUT;
- DEBUG0 (printk (KERN_INFO "DC390: Reject message\n");)
+ DEBUG0 (printk (KERN_INFO "DC390: Reject message\n"));
}
/* abort command */
@@ -724,57 +727,55 @@
/* handle RESTORE_PTR */
+/* I presume, this command is already mapped, so, have to remap. */
static void
dc390_restore_ptr (PACB pACB, PSRB pSRB)
{
- PSGL psgl;
- pSRB->TotalXferredLen = 0;
- pSRB->SGIndex = 0;
- if( pSRB->pcmd->use_sg )
- {
- pSRB->SGcount = (UCHAR) pSRB->pcmd->use_sg;
- pSRB->pSegmentList = (PSGL) pSRB->pcmd->request_buffer;
- psgl = pSRB->pSegmentList;
- while (pSRB->TotalXferredLen + (ULONG) psgl->length < pSRB->Saved_Ptr)
- {
- pSRB->TotalXferredLen += (ULONG) psgl->length;
- pSRB->SGIndex++;
- if( pSRB->SGIndex < pSRB->SGcount )
+ Scsi_Cmnd* pcmd = pSRB->pcmd;
+ PSGL psgl;
+ pSRB->TotalXferredLen = 0;
+ pSRB->SGIndex = 0;
+ if (pcmd->use_sg) {
+ pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
+ psgl = pSRB->pSegmentList;
+ //dc390_pci_sync(pSRB);
+
+ while (pSRB->TotalXferredLen + (ULONG) psgl->length < pSRB->Saved_Ptr)
+ {
+ pSRB->TotalXferredLen += (ULONG) psgl->length;
+ pSRB->SGIndex++;
+ if( pSRB->SGIndex < pSRB->SGcount )
{
- pSRB->pSegmentList++;
- psgl = pSRB->pSegmentList;
-
- pSRB->SGBusAddr = virt_to_bus( psgl->address );
- pSRB->SGToBeXferLen = (ULONG) psgl->length;
+ pSRB->pSegmentList++;
+ psgl = pSRB->pSegmentList;
+ pSRB->SGBusAddr = cpu_to_le32(pci_dma_lo32(sg_dma_address(psgl)));
+ pSRB->SGToBeXferLen = cpu_to_le32(sg_dma_len(psgl));
}
- else
- pSRB->SGToBeXferLen = 0;
+ else
+ pSRB->SGToBeXferLen = 0;
}
- pSRB->SGToBeXferLen -= (pSRB->Saved_Ptr - pSRB->TotalXferredLen);
- pSRB->SGBusAddr += (pSRB->Saved_Ptr - pSRB->TotalXferredLen);
- printk (KERN_INFO "DC390: Pointer restored. Segment %i, Total %li, Bus %08lx\n", pSRB->SGIndex, pSRB->Saved_Ptr, pSRB->SGBusAddr);
- }
- else if( pSRB->pcmd->request_buffer )
- {
+ pSRB->SGToBeXferLen -= (pSRB->Saved_Ptr - pSRB->TotalXferredLen);
+ pSRB->SGBusAddr += (pSRB->Saved_Ptr - pSRB->TotalXferredLen);
+ printk (KERN_INFO "DC390: Pointer restored. Segment %i, Total %li, Bus %08lx\n",
+ pSRB->SGIndex, pSRB->Saved_Ptr, pSRB->SGBusAddr);
+
+ } else if(pcmd->request_buffer) {
+ //dc390_pci_sync(pSRB);
+
+ pSRB->Segmentx.length = pcmd->request_bufflen - pSRB->Saved_Ptr;
pSRB->SGcount = 1;
pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
- pSRB->Segmentx.address = (PUCHAR) pSRB->pcmd->request_buffer + pSRB->Saved_Ptr;
- pSRB->Segmentx.length = pSRB->pcmd->request_bufflen - pSRB->Saved_Ptr;
- printk (KERN_INFO "DC390: Pointer restored. Total %li, Bus %p\n",
- pSRB->Saved_Ptr, pSRB->Segmentx.address);
- }
- else
- {
+ } else {
pSRB->SGcount = 0;
printk (KERN_INFO "DC390: RESTORE_PTR message for Transfer without Scatter-Gather ??\n");
- };
+ }
pSRB->TotalXferredLen = pSRB->Saved_Ptr;
};
/* According to the docs, the AM53C974 reads the message and
- * generates a Succesful Operation IRQ before asserting ACK for
+ * generates a Successful Operation IRQ before asserting ACK for
* the last byte (how does it know whether it's the last ?) */
/* The old code handled it in another way, indicating, that on
* every message byte an IRQ is generated and every byte has to
@@ -811,7 +812,7 @@
/* Msg complete ? */
if (dc390_MsgIn_complete (pSRB->MsgInBuf, pACB->MsgLen))
{
- DEBUG0 (printk (KERN_INFO "DC390: MsgIn:"); dc390_printMsg (pSRB->MsgInBuf, pACB->MsgLen);)
+ DEBUG0 (printk (KERN_INFO "DC390: MsgIn:"); dc390_printMsg (pSRB->MsgInBuf, pACB->MsgLen));
/* Now eval the msg */
switch (pSRB->MsgInBuf[0])
{
@@ -853,7 +854,7 @@
break;
// The device might want to restart transfer with a RESTORE
case RESTORE_POINTERS:
- DEBUG0(printk ("DC390: RESTORE POINTER message received ... try to handle\n");)
+ DEBUG0(printk ("DC390: RESTORE POINTER message received ... try to handle\n"));
dc390_restore_ptr (pACB, pSRB);
break;
@@ -864,7 +865,7 @@
/* Clear counter and MsgIn state */
pSRB->SRBState &= ~SRB_MSGIN;
pACB->MsgLen = 0;
- };
+ }
*psstatus = SCSI_NOP0;
DC390_write8 (ScsiCmd, MSG_ACCEPTED_CMD);
@@ -895,12 +896,12 @@
if( !pSRB->SGToBeXferLen )
{
psgl = pSRB->pSegmentList;
- pSRB->SGBusAddr = virt_to_bus( psgl->address );
- pSRB->SGToBeXferLen = (ULONG) psgl->length;
- DEBUG1(printk (KERN_DEBUG " DC390: Next SG segment.");)
+ pSRB->SGBusAddr = cpu_to_le32(pci_dma_lo32(sg_dma_address(psgl)));
+ pSRB->SGToBeXferLen = cpu_to_le32(sg_dma_len(psgl));
+ DEBUG1(printk (KERN_DEBUG " DC390: Next SG segment."));
}
lval = pSRB->SGToBeXferLen;
- DEBUG1(printk (KERN_DEBUG " DC390: Start transfer: %li bytes (address %08lx)\n", lval, pSRB->SGBusAddr);)
+ DEBUG1(printk (KERN_DEBUG " DC390: Start transfer: %li bytes (address %08lx)\n", lval, pSRB->SGBusAddr));
DC390_write8 (CtcReg_Low, (UCHAR) lval);
lval >>= 8;
DC390_write8 (CtcReg_Mid, (UCHAR) lval);
@@ -916,9 +917,9 @@
DC390_write8 (ScsiCmd, DMA_COMMAND+INFO_XFER_CMD);
DC390_write8 (DMA_Cmd, DMA_START_CMD | ioDir | DMA_INT);
- //DEBUG1(DC390_write32 (DMA_ScsiBusCtrl, WRT_ERASE_DMA_STAT | EN_INT_ON_PCI_ABORT);)
- //DEBUG1(printk (KERN_DEBUG "DC390: DMA_Status: %02x\n", DC390_read8 (DMA_Status));)
- //DEBUG1(DC390_write32 (DMA_ScsiBusCtrl, EN_INT_ON_PCI_ABORT);)
+ //DEBUG1(DC390_write32 (DMA_ScsiBusCtrl, WRT_ERASE_DMA_STAT | EN_INT_ON_PCI_ABORT));
+ //DEBUG1(printk (KERN_DEBUG "DC390: DMA_Status: %02x\n", DC390_read8 (DMA_Status)));
+ //DEBUG1(DC390_write32 (DMA_ScsiBusCtrl, EN_INT_ON_PCI_ABORT));
}
else /* xfer pad */
{
@@ -926,9 +927,9 @@
{
pSRB->AdaptStatus = H_OVER_UNDER_RUN;
pSRB->SRBStatus |= OVER_RUN;
- DEBUG0(printk (KERN_WARNING " DC390: Overrun -");)
+ DEBUG0(printk (KERN_WARNING " DC390: Overrun -"));
}
- DEBUG0(printk (KERN_WARNING " Clear transfer pad \n");)
+ DEBUG0(printk (KERN_WARNING " Clear transfer pad \n"));
DC390_write8 (CtcReg_Low, 0);
DC390_write8 (CtcReg_Mid, 0);
DC390_write8 (CtcReg_High, 0);
@@ -981,7 +982,7 @@
DC390_write8 (ScsiFifo, bval);
DC390_write8 (ScsiFifo, sizeof(pSRB->pcmd->sense_buffer));
DC390_write8 (ScsiFifo, bval);
- DEBUG0(printk(KERN_DEBUG "DC390: AutoReqSense (CmndPhase)!\n");)
+ DEBUG0(printk(KERN_DEBUG "DC390: AutoReqSense (CmndPhase)!\n"));
}
pSRB->SRBState = SRB_COMMAND;
DC390_write8 (ScsiCmd, INFO_XFER_CMD);
@@ -1111,7 +1112,7 @@
PSRB pSRB, psrb;
UCHAR i, cnt;
- DEBUG0(printk(KERN_INFO "DISC,");)
+ DEBUG0(printk(KERN_INFO "DISC,"));
if (!pACB->Connected) printk(KERN_ERR "DC390: Disconnect not-connected bus?\n");
pACB->Connected = 0;
@@ -1120,7 +1121,7 @@
{
int j = 400;
DEBUG0(printk(KERN_ERR "ACB:%p->ActiveDCB:%p IOPort:%04x IRQ:%02x !\n",\
- pACB, pDCB, pACB->IOPortBase, pACB->IRQLevel);)
+ pACB, pDCB, pACB->IOPortBase, pACB->IRQLevel));
while (--j) udelay (1000);
DC390_read8 (INT_Status); /* Reset Pending INT */
DC390_write8 (ScsiCmd, EN_SEL_RESEL);
@@ -1194,12 +1195,12 @@
PSRB pSRB;
UCHAR id, lun;
- DEBUG0(printk(KERN_INFO "RSEL,");)
+ DEBUG0(printk(KERN_INFO "RSEL,"));
pACB->Connected = 1;
pDCB = pACB->pActiveDCB;
if( pDCB )
{ /* Arbitration lost but Reselection won */
- DEBUG0(printk ("DC390: (ActiveDCB != 0: Arb. lost but resel. won)!\n");)
+ DEBUG0(printk ("DC390: (ActiveDCB != 0: Arb. lost but resel. won)!\n"));
pSRB = pDCB->pActiveSRB;
if( !( pACB->scan_devices ) )
{
@@ -1211,7 +1212,7 @@
}
/* Get ID */
lun = DC390_read8 (ScsiFifo);
- DEBUG0(printk ("Dev %02x,", lun);)
+ DEBUG0(printk ("Dev %02x,", lun));
if (!(lun & (1 << pACB->pScsiHost->this_id)))
printk (KERN_ERR "DC390: Reselection must select host adapter: %02x!\n", lun);
else
@@ -1221,7 +1222,7 @@
lun = DC390_read8 (ScsiFifo);
if (!(lun & IDENTIFY_BASE)) printk (KERN_ERR "DC390: Resel: Expect identify message!\n");
lun &= 7;
- DEBUG0(printk ("(%02i-%i),", id, lun);)
+ DEBUG0(printk ("(%02i-%i),", id, lun));
pDCB = dc390_findDCB (pACB, id, lun);
if (!pDCB)
{
@@ -1262,7 +1263,7 @@
}
}
- DEBUG1(printk (KERN_DEBUG "Resel SRB(%p): TagNum (%02x)\n", pSRB, pSRB->TagNumber);)
+ DEBUG1(printk (KERN_DEBUG "Resel SRB(%p): TagNum (%02x)\n", pSRB, pSRB->TagNumber));
pSRB->ScsiPhase = SCSI_NOP0;
DC390_write8 (Scsi_Dest_ID, pDCB->TargetID);
DC390_write8 (Sync_Period, pDCB->SyncPeriod);
@@ -1282,7 +1283,7 @@
if (pDCB->GoingSRBCnt > 1)
{
DCBDEBUG(printk (KERN_INFO "DC390: Driver won't free DCB (ID %i, LUN %i): 0x%08x because of SRBCnt %i\n",\
- pDCB->TargetID, pDCB->TargetLUN, (int)pDCB, pDCB->GoingSRBCnt);)
+ pDCB->TargetID, pDCB->TargetLUN, (int)pDCB, pDCB->GoingSRBCnt));
return;
};
pACB->DCBmap[pDCB->TargetID] &= ~(1 << pDCB->TargetLUN);
@@ -1304,7 +1305,7 @@
}
DCBDEBUG(printk (KERN_INFO "DC390: Driver about to free DCB (ID %i, LUN %i): %p\n",\
- pDCB->TargetID, pDCB->TargetLUN, pDCB);)
+ pDCB->TargetID, pDCB->TargetLUN, pDCB));
if (pDCB == pACB->pActiveDCB) pACB->pActiveDCB = 0;
if (pDCB == pACB->pLinkDCB) pACB->pLinkDCB = pDCB->pNextDCB;
if (pDCB == pACB->pDCBRunRobin) pACB->pDCBRunRobin = pDCB->pNextDCB;
@@ -1366,14 +1367,18 @@
PSGL ptr2;
ULONG swlval;
- pcmd = pSRB->pcmd; DCB_removed = 0;
+ pcmd = pSRB->pcmd;
+ /* KG: Moved pci_unmap here */
+ dc390_pci_unmap(pSRB);
+
+ DCB_removed = 0;
status = pSRB->TargetStatus;
ptr = (PSCSI_INQDATA) (pcmd->request_buffer);
if( pcmd->use_sg )
- ptr = (PSCSI_INQDATA) (((PSGL) ptr)->address);
+ ptr = (PSCSI_INQDATA) sg_dma_address((PSGL) ptr);
DEBUG0(printk (" SRBdone (%02x,%08x), SRB %p, pid %li\n", status, pcmd->result,\
- pSRB, pcmd->pid);)
+ pSRB, pcmd->pid));
if(pSRB->SRBFlag & AUTO_REQSENSE)
{ /* Last command was a Request Sense */
pSRB->SRBFlag &= ~AUTO_REQSENSE;
@@ -1415,7 +1420,7 @@
else
pcmd->result = MK_RES_LNX(DRIVER_SENSE,DID_OK,0,CHECK_CONDITION);
REMOVABLEDEBUG(printk(KERN_INFO "Cmd=%02x,Result=%08x,XferL=%08x\n",pSRB->pcmd->cmnd[0],\
- (UINT) pcmd->result, (UINT) pSRB->TotalXferredLen);)
+ (UINT) pcmd->result, (UINT) pSRB->TotalXferredLen));
goto ckc_e;
}
else /* Retry */
@@ -1430,24 +1435,17 @@
{
pcmd->result = MK_RES_LNX(DRIVER_SENSE,DID_OK,0,CHECK_CONDITION);
REMOVABLEDEBUG(printk(KERN_INFO "Cmd=%02x, Result=%08x, XferL=%08x\n",pSRB->pcmd->cmnd[0],\
- (UINT) pcmd->result, (UINT) pSRB->TotalXferredLen);)
+ (UINT) pcmd->result, (UINT) pSRB->TotalXferredLen));
goto ckc_e;
}
SET_RES_DRV(pcmd->result,DRIVER_SENSE);
- pSRB->SGcount = (UCHAR) pSRB->SavedSGCount;
+ pcmd->use_sg = pSRB->SavedSGCount;
//pSRB->ScsiCmdLen = (UCHAR) (pSRB->Segment1[0] >> 8);
- DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n", pcmd->pid, pcmd->cmnd[0], pcmd->target, pcmd->lun);)
+ DEBUG0 (printk ("DC390: RETRY pid %li (%02x), target %02i-%02i\n", pcmd->pid, pcmd->cmnd[0], pcmd->device->id, pcmd->device->lun));
pSRB->SGIndex = 0;
pSRB->TotalXferredLen = 0;
pSRB->SGToBeXferLen = 0;
- if( pcmd->use_sg )
- pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
- else if( pcmd->request_buffer )
- {
- pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
- pSRB->Segmentx.address = (PUCHAR) pcmd->request_buffer;
- pSRB->Segmentx.length = pcmd->request_bufflen;
- }
+
if( dc390_StartSCSI( pACB, pDCB, pSRB ) ) {
dc390_Going_to_Waiting ( pDCB, pSRB );
dc390_waiting_timer (pACB, HZ/5);
@@ -1460,7 +1458,7 @@
if( status_byte(status) == CHECK_CONDITION )
{
REMOVABLEDEBUG(printk (KERN_INFO "DC390: Check_Condition (Cmd %02x, Id %02x, LUN %02x)\n",\
- pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN);)
+ pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
if( (pSRB->SGIndex < pSRB->SGcount) && (pSRB->SGcount) && (pSRB->SGToBeXferLen) )
{
bval = pSRB->SGcount;
@@ -1472,7 +1470,7 @@
ptr2++;
}
REMOVABLEDEBUG(printk(KERN_INFO "XferredLen=%08x,NotXferLen=%08x\n",\
- (UINT) pSRB->TotalXferredLen, (UINT) swlval);)
+ (UINT) pSRB->TotalXferredLen, (UINT) swlval));
}
dc390_RequestSense( pACB, pDCB, pSRB );
return;
@@ -1515,14 +1513,6 @@
pSRB->SGIndex = 0;
pSRB->TotalXferredLen = 0;
pSRB->SGToBeXferLen = 0;
- if( pcmd->use_sg )
- pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
- else if( pcmd->request_buffer )
- {
- pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
- pSRB->Segmentx.address = (PUCHAR) pcmd->request_buffer;
- pSRB->Segmentx.length = pcmd->request_bufflen;
- }
if( dc390_StartSCSI( pACB, pDCB, pSRB ) ) {
dc390_Going_to_Waiting ( pDCB, pSRB );
dc390_waiting_timer (pACB, HZ/5);
@@ -1637,7 +1627,7 @@
/* Add to free list */
dc390_Free_insert (pACB, pSRB);
- DEBUG0(printk (KERN_DEBUG "DC390: SRBdone: done pid %li\n", pcmd->pid);)
+ DEBUG0(printk (KERN_DEBUG "DC390: SRBdone: done pid %li\n", pcmd->pid));
DC390_UNLOCK_ACB_NI;
pcmd->scsi_done (pcmd);
DC390_LOCK_ACB_NI;
@@ -1677,7 +1667,7 @@
/* ReleaseSRB( pDCB, pSRB ); */
- DEBUG0(printk (KERN_DEBUG "DC390: DoingSRB_Done: done pid %li\n", pcmd->pid);)
+ DEBUG0(printk (KERN_DEBUG "DC390: DoingSRB_Done: done pid %li\n", pcmd->pid));
DC390_UNLOCK_ACB_NI;
pcmd->scsi_done( pcmd );
DC390_LOCK_ACB_NI;
@@ -1712,7 +1702,7 @@
dc390_ScsiRstDetect( PACB pACB )
{
printk ("DC390: Rst_Detect: laststat = %08x\n", dc390_laststatus);
- //DEBUG0(printk(KERN_INFO "RST_DETECT,");)
+ //DEBUG0(printk(KERN_INFO "RST_DETECT,"));
if (timer_pending (&pACB->Waiting_Timer)) del_timer (&pACB->Waiting_Timer);
DC390_write8 (DMA_Cmd, DMA_IDLE_CMD);
@@ -1747,7 +1737,7 @@
PSCSICMD pcmd;
REMOVABLEDEBUG(printk (KERN_INFO "DC390: RequestSense (Cmd %02x, Id %02x, LUN %02x)\n",\
- pSRB->pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN);)
+ pSRB->pcmd->cmnd[0], pDCB->TargetID, pDCB->TargetLUN));
pSRB->SRBFlag |= AUTO_REQSENSE;
//pSRB->Segment0[0] = (UINT) pSRB->CmdBlock[0];
@@ -1761,10 +1751,8 @@
pcmd = pSRB->pcmd;
- pSRB->Segmentx.address = (PUCHAR) &(pcmd->sense_buffer);
- pSRB->Segmentx.length = sizeof(pcmd->sense_buffer);
- pSRB->pSegmentList = &pSRB->Segmentx;
- pSRB->SGcount = 1;
+ /* We are called from SRBdone, original PCI mapping has been removed
+ * already, new one is set up from StartSCSI */
pSRB->SGIndex = 0;
//pSRB->CmdBlock[0] = REQUEST_SENSE;
Only in linux-2.6.0-test7/drivers/scsi/: scsiiom.c~
diff -ur linux-2.6.0-test7.arm/drivers/scsi/tmscsim.c linux-2.6.0-test7/drivers/scsi/tmscsim.c
--- linux-2.6.0-test7.arm/drivers/scsi/tmscsim.c Sat Aug 9 06:42:57 2003
+++ linux-2.6.0-test7/drivers/scsi/tmscsim.c Sat Nov 22 23:38:56 2003
@@ -178,33 +178,36 @@
//#define DC390_REMOVABLEDEBUG
//#define DC390_LOCKDEBUG
+//#define NOP do{}while(0)
+#define C_NOP
+
/* Debug definitions */
#ifdef DC390_DEBUG0
-# define DEBUG0(x) x;
+# define DEBUG0(x) x
#else
-# define DEBUG0(x)
+# define DEBUG0(x) C_NOP
#endif
#ifdef DC390_DEBUG1
-# define DEBUG1(x) x;
+# define DEBUG1(x) x
#else
-# define DEBUG1(x)
+# define DEBUG1(x) C_NOP
#endif
#ifdef DC390_DCBDEBUG
-# define DCBDEBUG(x) x;
+# define DCBDEBUG(x) x
#else
-# define DCBDEBUG(x)
+# define DCBDEBUG(x) C_NOP
#endif
#ifdef DC390_PARSEDEBUG
-# define PARSEDEBUG(x) x;
+# define PARSEDEBUG(x) x
#else
-# define PARSEDEBUG(x)
+# define PARSEDEBUG(x) C_NOP
#endif
#ifdef DC390_REMOVABLEDEBUG
-# define REMOVABLEDEBUG(x) x;
+# define REMOVABLEDEBUG(x) x
#else
-# define REMOVABLEDEBUG(x)
+# define REMOVABLEDEBUG(x) C_NOP
#endif
-#define DCBDEBUG1(x)
+#define DCBDEBUG1(x) C_NOP
/* Includes */
#include <linux/module.h>
@@ -226,6 +229,7 @@
#include <linux/version.h>
#include <linux/blkdev.h>
#include <linux/timer.h>
+#include <linux/interrupt.h>
#include "scsi.h"
#include "hosts.h"
@@ -262,18 +266,7 @@
#endif
#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,93)
-# define USE_SPINLOCKS 1
-# define NEW_PCI 1
-#else
-# undef NEW_PCI
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,30)
-# define USE_SPINLOCKS 2
-# endif
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,99)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,99) && defined(MODULE)
static struct pci_device_id tmscsim_pci_tbl[] = {
{
.vendor = PCI_VENDOR_ID_AMD,
@@ -286,143 +279,42 @@
MODULE_DEVICE_TABLE(pci, tmscsim_pci_tbl);
#endif
-#ifdef USE_SPINLOCKS
-
-# if USE_SPINLOCKS == 3 /* both */
-
-# if defined (CONFIG_SMP)
-# define DC390_LOCKA_INIT { spinlock_t __unlocked = SPIN_LOCK_UNLOCKED; pACB->lock = __unlocked; };
-# else
-# define DC390_LOCKA_INIT
-# endif
- spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
-
-# define DC390_AFLAGS unsigned long aflags;
-# define DC390_IFLAGS unsigned long iflags;
-# define DC390_DFLAGS unsigned long dflags;
-
-# define DC390_LOCK_IO spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags)
-# define DC390_UNLOCK_IO spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags)
-
-# define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)
-# define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
-# define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
-# define DC390_UNLOCK_DRV_NI spin_unlock (&dc390_drvlock)
-
-# define DC390_LOCK_ACB spin_lock_irqsave (&(pACB->lock), aflags)
-# define DC390_UNLOCK_ACB spin_unlock_irqrestore (&(pACB->lock), aflags)
-# define DC390_LOCK_ACB_NI spin_lock (&(pACB->lock))
-# define DC390_UNLOCK_ACB_NI spin_unlock (&(pACB->lock))
-//# define DC390_LOCKA_INIT spin_lock_init (&(pACB->lock))
-
-# else
-
-# if USE_SPINLOCKS == 2 /* adapter specific locks */
-
-# if defined (CONFIG_SMP)
-# define DC390_LOCKA_INIT { spinlock_t __unlocked = SPIN_LOCK_UNLOCKED; pACB->lock = __unlocked; };
-# else
-# define DC390_LOCKA_INIT
-# endif
- spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
-# define DC390_AFLAGS unsigned long aflags;
-# define DC390_IFLAGS
-# define DC390_DFLAGS unsigned long dflags;
-# define DC390_LOCK_IO(dev) /* spin_lock_irqsave (&io_request_lock, iflags) */
-# define DC390_UNLOCK_IO(dev) /* spin_unlock_irqrestore (&io_request_lock, iflags) */
-# define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)
-# define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
-# define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
-# define DC390_UNLOCK_DRV_NI spin_unlock (&dc390_drvlock)
-# define DC390_LOCK_ACB spin_lock_irqsave (&(pACB->lock), aflags)
-# define DC390_UNLOCK_ACB spin_unlock_irqrestore (&(pACB->lock), aflags)
-# define DC390_LOCK_ACB_NI spin_lock (&(pACB->lock))
-# define DC390_UNLOCK_ACB_NI spin_unlock (&(pACB->lock))
-//# define DC390_LOCKA_INIT spin_lock_init (&(pACB->lock))
-
-# else /* USE_SPINLOCKS == 1: global lock io_request_lock */
-
-# define DC390_AFLAGS
-# define DC390_IFLAGS unsigned long iflags;
-# define DC390_DFLAGS unsigned long dflags;
- spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
-# define DC390_LOCK_IO(dev) spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags)
-# define DC390_UNLOCK_IO(dev) spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags)
-# define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)
-# define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
-# define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
-# define DC390_UNLOCK_DRV_NI spin_unlock (&dc390_drvlock)
-# define DC390_LOCK_ACB /* DC390_LOCK_IO */
-# define DC390_UNLOCK_ACB /* DC390_UNLOCK_IO */
-# define DC390_LOCK_ACB_NI /* spin_lock (&(pACB->lock)) */
-# define DC390_UNLOCK_ACB_NI /* spin_unlock (&(pACB->lock)) */
-# define DC390_LOCKA_INIT /* DC390_LOCKA_INIT */
-
-# endif /* 2 */
-# endif /* 3 */
-
-#else /* USE_SPINLOCKS undefined */
-
-# define DC390_AFLAGS unsigned long aflags;
-# define DC390_IFLAGS unsigned long iflags;
-# define DC390_DFLAGS unsigned long dflags;
-# define DC390_LOCK_IO save_flags (iflags); cli ()
-# define DC390_UNLOCK_IO restore_flags (iflags)
-# define DC390_LOCK_DRV save_flags (dflags); cli ()
-# define DC390_UNLOCK_DRV restore_flags (dflags)
-# define DC390_LOCK_DRV_NI
-# define DC390_UNLOCK_DRV_NI
-# define DC390_LOCK_ACB save_flags (aflags); cli ()
-# define DC390_UNLOCK_ACB restore_flags (aflags)
-# define DC390_LOCK_ACB_NI
-# define DC390_UNLOCK_ACB_NI
-# define DC390_LOCKA_INIT
-#endif /* def */
+#define USE_SPINLOCKS 1
+#define NEW_PCI 1
+#define DC390_AFLAGS
+#define DC390_IFLAGS unsigned long iflags
+#define DC390_DFLAGS unsigned long dflags
+spinlock_t dc390_drvlock = SPIN_LOCK_UNLOCKED;
+#define DC390_LOCK_IO(dev) spin_lock_irqsave (((struct Scsi_Host *)dev)->host_lock, iflags)
+#define DC390_UNLOCK_IO(dev) spin_unlock_irqrestore (((struct Scsi_Host *)dev)->host_lock, iflags)
+#define DC390_LOCK_DRV spin_lock_irqsave (&dc390_drvlock, dflags)
+#define DC390_UNLOCK_DRV spin_unlock_irqrestore (&dc390_drvlock, dflags)
+#define DC390_LOCK_DRV_NI spin_lock (&dc390_drvlock)
+#define DC390_UNLOCK_DRV_NI spin_unlock (&dc390_drvlock)
+#define DC390_LOCK_ACB /* DC390_LOCK_IO */
+#define DC390_UNLOCK_ACB /* DC390_UNLOCK_IO */
+#define DC390_LOCK_ACB_NI /* spin_lock (&(pACB->lock)) */
+#define DC390_UNLOCK_ACB_NI /* spin_unlock (&(pACB->lock)) */
+#define DC390_LOCKA_INIT /* DC390_LOCKA_INIT */
/* These macros are used for uniform access to 2.0.x and 2.1.x PCI config space*/
-#ifdef NEW_PCI
-# define PDEV pdev
-# define PDEVDECL struct pci_dev *pdev
-# define PDEVDECL0 struct pci_dev *pdev = NULL
-# define PDEVDECL1 struct pci_dev *pdev
-# define PDEVSET pACB->pdev=pdev
-# define PDEVSET1 pdev=pACB->pdev
-# define PCI_WRITE_CONFIG_BYTE(pd, rv, bv) pci_write_config_byte (pd, rv, bv)
-# define PCI_READ_CONFIG_BYTE(pd, rv, bv) pci_read_config_byte (pd, rv, bv)
-# define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pci_write_config_word (pd, rv, bv)
-# define PCI_READ_CONFIG_WORD(pd, rv, bv) pci_read_config_word (pd, rv, bv)
-# define PCI_BUS_DEV pdev->bus->number, pdev->devfn
-# define PCI_PRESENT (1)
-# define PCI_SET_MASTER pci_set_master (pdev)
-# define PCI_FIND_DEVICE(vend, id) (pdev = pci_find_device (vend, id, pdev))
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,10)
-# define PCI_GET_IO_AND_IRQ io_port = pci_resource_start (pdev, 0); irq = pdev->irq
-#else
-# define PCI_GET_IO_AND_IRQ io_port = pdev->base_address[0] & PCI_BASE_ADDRESS_IO_MASK; irq = pdev->irq
-#endif
-#else
-# include <linux/bios32.h>
-# define PDEV pbus, pdevfn
-# define PDEVDECL UCHAR pbus, UCHAR pdevfn
-# define PDEVDECL0 UCHAR pbus = 0; UCHAR pdevfn = 0; USHORT pci_index = 0; int error
-# define PDEVDECL1 UCHAR pbus; UCHAR pdevfn /*; USHORT pci_index */
-# define PDEVSET pACB->pbus=pbus; pACB->pdevfn=pdevfn /*; pACB->pci_index=pci_index */
-# define PDEVSET1 pbus=pACB->pbus; pdevfn=pACB->pdevfn /*; pci_index=pACB->pci_index */
-# define PCI_WRITE_CONFIG_BYTE(pd, rv, bv) pcibios_write_config_byte (pd, rv, bv)
-# define PCI_READ_CONFIG_BYTE(pd, rv, bv) pcibios_read_config_byte (pd, rv, bv)
-# define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pcibios_write_config_word (pd, rv, bv)
-# define PCI_READ_CONFIG_WORD(pd, rv, bv) pcibios_read_config_word (pd, rv, bv)
-# define PCI_BUS_DEV pbus, pdevfn
-# define PCI_PRESENT pcibios_present ()
-# define PCI_SET_MASTER dc390_set_master (pbus, pdevfn)
-# define PCI_FIND_DEVICE(vend, id) (!pcibios_find_device (vend, id, pci_index++, &pbus, &pdevfn))
-# define PCI_GET_IO_AND_IRQ error = pcibios_read_config_dword (pbus, pdevfn, PCI_BASE_ADDRESS_0, &io_port); \
- error |= pcibios_read_config_byte (pbus, pdevfn, PCI_INTERRUPT_LINE, &irq); \
- io_port &= 0xfffe; \
- if (error) { printk (KERN_ERR "DC390_detect: Error reading PCI config registers!\n"); continue; }
-#endif
+#define PDEV pdev
+#define PDEVDECL struct pci_dev *pdev
+#define PDEVDECL0 struct pci_dev *pdev = NULL
+#define PDEVDECL1 struct pci_dev *pdev
+#define PDEVSET pACB->pdev=pdev
+#define PDEVSET1 pdev=pACB->pdev
+#define PCI_WRITE_CONFIG_BYTE(pd, rv, bv) pci_write_config_byte (pd, rv, bv)
+#define PCI_READ_CONFIG_BYTE(pd, rv, bv) pci_read_config_byte (pd, rv, bv)
+#define PCI_WRITE_CONFIG_WORD(pd, rv, bv) pci_write_config_word (pd, rv, bv)
+#define PCI_READ_CONFIG_WORD(pd, rv, bv) pci_read_config_word (pd, rv, bv)
+#define PCI_BUS_DEV pdev->bus->number, pdev->devfn
+#define PCI_PRESENT (1)
+#define PCI_SET_MASTER pci_set_master (pdev)
+#define PCI_FIND_DEVICE(vend, id) (pdev = pci_find_device (vend, id, pdev))
+#define PCI_GET_IO_AND_IRQ do{io_port = pci_resource_start (pdev, 0); irq = pdev->irq;} while(0)
#include "tmscsim.h"
@@ -457,16 +349,14 @@
static void __inline__ dc390_InvalidCmd( PACB pACB );
static void __inline__ dc390_EnableMsgOut_Abort (PACB, PSRB);
static void dc390_remove_dev (PACB pACB, PDCB pDCB);
-void do_DC390_Interrupt( int, void *, struct pt_regs *);
+irqreturn_t do_DC390_Interrupt( int, void *, struct pt_regs *);
int dc390_initAdapter( PSH psh, ULONG io_port, UCHAR Irq, UCHAR index );
void dc390_initDCB( PACB pACB, PDCB *ppDCB, UCHAR id, UCHAR lun);
void dc390_updateDCB (PACB pACB, PDCB pDCB);
-#ifdef MODULE
- static int DC390_release(struct Scsi_Host *host);
- static int dc390_shutdown (struct Scsi_Host *host);
-#endif
+static int DC390_release(struct Scsi_Host *host);
+static int dc390_shutdown (struct Scsi_Host *host);
//static PSHT dc390_pSHT_start = NULL;
@@ -609,7 +499,7 @@
ptr[id<<2] = (UCHAR)tmscsim[2]; /* EE_MODE1 */
if (tmscsim[1] != -2)
ptr[(id<<2) + 1] = (UCHAR)tmscsim[1]; /* EE_Speed */
- };
+ }
}
/* Handle "-1" case */
@@ -641,7 +531,7 @@
{
int i;
PARSEDEBUG(printk(KERN_INFO "DC390: setup %08x %08x %08x %08x %08x %08x\n", tmscsim[0],\
- tmscsim[1], tmscsim[2], tmscsim[3], tmscsim[4], tmscsim[5]);)
+ tmscsim[1], tmscsim[2], tmscsim[3], tmscsim[4], tmscsim[5]));
for (i = 0; i < 6; i++)
{
if (tmscsim[i] < 0 || tmscsim[i] > 255)
@@ -652,7 +542,7 @@
if (tmscsim[1] > 7) tmscsim[1] = 4;
if (tmscsim[4] > 5) tmscsim[4] = 4;
if (tmscsim[5] > 180) tmscsim[5] = 180;
-};
+}
#endif
/* Override defaults on cmdline:
@@ -669,12 +559,12 @@
{
printk (KERN_NOTICE "DC390: ignore extra params!\n");
im = 6;
- };
+ }
for (i = 0; i < im; i++)
tmscsim[i] = ints[i+1];
/* dc390_checkparams (); */
return 1;
-};
+}
#ifndef MODULE
__setup("tmscsim=", dc390_setup);
#endif
@@ -688,11 +578,11 @@
{
printk (KERN_NOTICE "DC390: ignore extra params!\n");
im = 6;
- };
+ }
for (i = 0; i < im; i++)
tmscsim[i] = ints[i+1];
/* dc390_checkparams (); */
-};
+}
#endif
@@ -787,7 +677,7 @@
{
char interpd [] = {1,3,5,10,16,30,60,120};
dc390_eepromBuf[index][EE_DELAY] = interpd [dc390_eepromBuf[index][EE_DELAY]];
-};
+}
static UCHAR __init dc390_CheckEEpromCheckSum( PDEVDECL, UCHAR index )
{
@@ -822,14 +712,14 @@
if (pDCB == pACB->pLinkDCB)
{
DCBDEBUG(printk (KERN_WARNING "DC390: DCB not found (DCB=%p, DCBmap[%2x]=%2x)\n",
- pDCB, id, pACB->DCBmap[id]);)
+ pDCB, id, pACB->DCBmap[id]));
return 0;
}
- };
+ }
DCBDEBUG1( printk (KERN_DEBUG "DCB %p (%02x,%02x) found.\n", \
- pDCB, pDCB->TargetID, pDCB->TargetLUN);)
+ pDCB, pDCB->TargetID, pDCB->TargetLUN));
return pDCB;
-};
+}
/* Queueing philosphy:
* There are a couple of lists:
@@ -858,39 +748,37 @@
if (q == queue) return 0;
}
return q;
-};
+}
#endif
/* Append to Query List */
static void dc390_Query_append( PSCSICMD cmd, PACB pACB )
{
- DEBUG0(printk ("DC390: Append cmd %li to Query\n", cmd->pid);)
- if( !pACB->QueryCnt )
- pACB->pQueryHead = cmd;
- else
- pACB->pQueryTail->next = cmd;
+ dc390_cmd_scp_t *cmdq = (dc390_cmd_scp_t *)&cmd->SCp;
+
+ DEBUG0(printk ("DC390: Append cmd %li to Query\n", cmd->pid));
- pACB->pQueryTail = cmd;
- pACB->QueryCnt++;
- pACB->CmdOutOfSRB++;
- cmd->next = NULL;
+ list_add_tail(&cmdq->list, &pACB->cmdq);
+ pACB->QueryCnt++;
+ pACB->CmdOutOfSRB++;
}
/* Return next cmd from Query list */
static PSCSICMD dc390_Query_get ( PACB pACB )
{
- PSCSICMD pcmd;
-
- pcmd = pACB->pQueryHead;
- if (!pcmd) return pcmd;
- DEBUG0(printk ("DC390: Get cmd %li from Query\n", pcmd->pid);)
- pACB->pQueryHead = pcmd->next;
- pcmd->next = NULL;
- if (!pACB->pQueryHead) pACB->pQueryTail = NULL;
- pACB->QueryCnt--;
- return( pcmd );
+ PSCSICMD pcmd;
+ dc390_cmd_scp_t *cmdq;
+ if (list_empty(&pACB->cmdq))
+ return NULL;
+
+ pcmd = (PSCSICMD) list_entry(pACB->cmdq.next, struct scsi_cmnd_list, scp.list);
+ DEBUG0(printk ("DC390: Get cmd %li from Query\n", pcmd->pid));
+ cmdq = (dc390_cmd_scp_t *)&pcmd->SCp;
+ list_del(&cmdq->list);
+ pACB->QueryCnt--;
+ return pcmd;
}
@@ -900,7 +788,7 @@
PSRB pSRB;
pSRB = pACB->pFreeSRB;
- DEBUG0(printk ("DC390: Get Free SRB %p\n", pSRB);)
+ DEBUG0(printk ("DC390: Get Free SRB %p\n", pSRB));
if( pSRB )
{
pACB->pFreeSRB = pSRB->pNextSRB;
@@ -913,7 +801,7 @@
/* Insert SRB oin top of free list */
static __inline__ void dc390_Free_insert (PACB pACB, PSRB pSRB)
{
- DEBUG0(printk ("DC390: Free SRB %p\n", pSRB);)
+ DEBUG0(printk ("DC390: Free SRB %p\n", pSRB));
pSRB->pNextSRB = pACB->pFreeSRB;
pACB->pFreeSRB = pSRB;
}
@@ -922,7 +810,7 @@
/* Inserts a SRB to the top of the Waiting list */
static __inline__ void dc390_Waiting_insert ( PDCB pDCB, PSRB pSRB )
{
- DEBUG0(printk ("DC390: Insert pSRB %p cmd %li to Waiting\n", pSRB, pSRB->pcmd->pid);)
+ DEBUG0(printk ("DC390: Insert pSRB %p cmd %li to Waiting\n", pSRB, pSRB->pcmd->pid));
pSRB->pNextSRB = pDCB->pWaitingSRB;
if (!pDCB->pWaitingSRB)
pDCB->pWaitLast = pSRB;
@@ -934,7 +822,7 @@
/* Queue SRB to waiting list */
static __inline__ void dc390_Waiting_append ( PDCB pDCB, PSRB pSRB)
{
- DEBUG0(printk ("DC390: Append pSRB %p cmd %li to Waiting\n", pSRB, pSRB->pcmd->pid);)
+ DEBUG0(printk ("DC390: Append pSRB %p cmd %li to Waiting\n", pSRB, pSRB->pcmd->pid));
if( pDCB->pWaitingSRB )
pDCB->pWaitLast->pNextSRB = pSRB;
else
@@ -949,7 +837,7 @@
static __inline__ void dc390_Going_append (PDCB pDCB, PSRB pSRB)
{
pDCB->GoingSRBCnt++;
- DEBUG0(printk("DC390: Append SRB %p to Going\n", pSRB);)
+ DEBUG0(printk("DC390: Append SRB %p to Going\n", pSRB));
/* Append to the list of Going commands */
if( pDCB->pGoingSRB )
pDCB->pGoingLast->pNextSRB = pSRB;
@@ -959,11 +847,11 @@
pDCB->pGoingLast = pSRB;
/* No next one in sent list */
pSRB->pNextSRB = NULL;
-};
+}
static __inline__ void dc390_Going_remove (PDCB pDCB, PSRB pSRB)
{
- DEBUG0(printk("DC390: Remove SRB %p from Going\n", pSRB);)
+ DEBUG0(printk("DC390: Remove SRB %p from Going\n", pSRB));
if (pSRB == pDCB->pGoingSRB)
pDCB->pGoingSRB = pSRB->pNextSRB;
else
@@ -978,12 +866,12 @@
pDCB->pGoingLast = psrb;
}
pDCB->GoingSRBCnt--;
-};
+}
/* Moves SRB from Going list to the top of Waiting list */
static void dc390_Going_to_Waiting ( PDCB pDCB, PSRB pSRB )
{
- DEBUG0(printk(KERN_INFO "DC390: Going_to_Waiting (SRB %p) pid = %li\n", pSRB, pSRB->pcmd->pid);)
+ DEBUG0(printk(KERN_INFO "DC390: Going_to_Waiting (SRB %p) pid = %li\n", pSRB, pSRB->pcmd->pid));
/* Remove SRB from Going */
dc390_Going_remove (pDCB, pSRB);
/* Insert on top of Waiting */
@@ -995,7 +883,7 @@
static __inline__ void dc390_Waiting_to_Going ( PDCB pDCB, PSRB pSRB )
{
/* Remove from waiting list */
- DEBUG0(printk("DC390: Remove SRB %p from head of Waiting\n", pSRB);)
+ DEBUG0(printk("DC390: Remove SRB %p from head of Waiting\n", pSRB));
pDCB->pWaitingSRB = pSRB->pNextSRB;
if( !pDCB->pWaitingSRB ) pDCB->pWaitLast = NULL;
pDCB->WaitSRBCnt--;
@@ -1068,14 +956,14 @@
void DC390_waiting_timed_out (unsigned long ptr)
{
PACB pACB = (PACB)ptr;
- DC390_IFLAGS
- DC390_AFLAGS
- DEBUG0(printk ("DC390: Debug: Waiting queue woken up by timer!\n");)
- DC390_LOCK_IO(pACB.pScsiHost);
+ DC390_IFLAGS;
+ DC390_AFLAGS;
+ DEBUG0(printk ("DC390: Debug: Waiting queue woken up by timer!\n"));
+ DC390_LOCK_IO(pACB->pScsiHost);
DC390_LOCK_ACB;
dc390_Waiting_process (pACB);
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO(pACB.pScsiHost);
+ DC390_UNLOCK_IO(pACB->pScsiHost);
}
/***********************************************************************
@@ -1116,9 +1004,79 @@
else {
dc390_Waiting_insert (pDCB, pSRB);
dc390_waiting_timer (pACB, HZ/5);
- };
+ }
}
+
+/* Create pci mapping */
+static int dc390_pci_map (PSRB pSRB)
+{
+ int error = 0;
+ Scsi_Cmnd *pcmd = pSRB->pcmd;
+ struct pci_dev *pdev = pSRB->pSRBDCB->pDCBACB->pdev;
+ dc390_cmd_scp_t* cmdp = ((dc390_cmd_scp_t*)(&pcmd->SCp));
+ /* Map sense buffer */
+ if (pSRB->SRBFlag & AUTO_REQSENSE) {
+ sg_dma_address(&pSRB->Segmentx) = cmdp->saved_dma_handle =
+ pci_map_page(pdev, virt_to_page(pcmd->sense_buffer),
+ (unsigned long)pcmd->sense_buffer & ~PAGE_MASK, sizeof(pcmd->sense_buffer),
+ DMA_FROM_DEVICE);
+ pSRB->Segmentx.length = sizeof(pcmd->sense_buffer);
+ pSRB->SGcount = 1;
+ pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
+ DEBUG1(printk("%s(): Mapped sense buffer %p at %x\n", __FUNCTION__, pcmd->sense_buffer, cmdp->saved_dma_handle));
+ /* Make SG list */
+ } else if (pcmd->use_sg) {
+ pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
+ pSRB->SGcount = pci_map_sg(pdev, pSRB->pSegmentList,
+ pcmd->use_sg,
+ scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+ /* TODO: error handling */
+ if (!pSRB->SGcount)
+ error = 1;
+ DEBUG1(printk("%s(): Mapped SG %p with %d (%d) elements\n", __FUNCTION__, pcmd->request_buffer, pSRB->SGcount, pcmd->use_sg));
+ /* Map single segment */
+ } else if (pcmd->request_buffer && pcmd->request_bufflen) {
+ sg_dma_address(&pSRB->Segmentx) = cmdp->saved_dma_handle =
+ pci_map_page(pdev, virt_to_page(pcmd->request_buffer),
+ (unsigned long)pcmd->request_buffer & ~PAGE_MASK,
+ pcmd->request_bufflen, scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+ /* TODO: error handling */
+ pSRB->Segmentx.length = pcmd->request_bufflen;
+ pSRB->SGcount = 1;
+ pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
+ DEBUG1(printk("%s(): Mapped request buffer %p at %x\n", __FUNCTION__, pcmd->request_buffer, cmdp->saved_dma_handle));
+ /* No mapping !? */
+ } else
+ pSRB->SGcount = 0;
+ return error;
+}
+
+/* Remove pci mapping */
+static void dc390_pci_unmap (PSRB pSRB)
+{
+ Scsi_Cmnd* pcmd = pSRB->pcmd;
+ struct pci_dev *pdev = pSRB->pSRBDCB->pDCBACB->pdev;
+ dc390_cmd_scp_t* cmdp = ((dc390_cmd_scp_t*)(&pcmd->SCp));
+
+ if (pSRB->SRBFlag) {
+ pci_unmap_page(pdev, cmdp->saved_dma_handle,
+ sizeof(pcmd->sense_buffer), DMA_FROM_DEVICE);
+ DEBUG1(printk("%s(): Unmapped sense buffer at %x\n", __FUNCTION__, cmdp->saved_dma_handle));
+ } else if (pcmd->use_sg) {
+ pci_unmap_sg(pdev, pcmd->request_buffer, pcmd->use_sg,
+ scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+ DEBUG1(printk("%s(): Unmapped SG at %p with %d elements\n", __FUNCTION__, pcmd->request_buffer, pcmd->use_sg));
+ } else if (pcmd->request_buffer && pcmd->request_bufflen) {
+ pci_unmap_page(pdev,
+ cmdp->saved_dma_handle,
+ pcmd->request_bufflen,
+ scsi_to_pci_dma_dir(pcmd->sc_data_direction));
+ DEBUG1(printk("%s(): Unmapped request buffer at %x\n", __FUNCTION__, cmdp->saved_dma_handle));
+ }
+}
+
+
/***********************************************************************
* Function: static void dc390_BuildSRB (Scsi_Cmd *pcmd, PDCB pDCB,
* PSRB pSRB)
@@ -1134,21 +1092,6 @@
//pSRB->ScsiCmdLen = pcmd->cmd_len;
//memcpy (pSRB->CmdBlock, pcmd->cmnd, pcmd->cmd_len);
- if( pcmd->use_sg )
- {
- pSRB->SGcount = (UCHAR) pcmd->use_sg;
- pSRB->pSegmentList = (PSGL) pcmd->request_buffer;
- }
- else if( pcmd->request_buffer )
- {
- pSRB->SGcount = 1;
- pSRB->pSegmentList = (PSGL) &pSRB->Segmentx;
- pSRB->Segmentx.address = (PUCHAR) pcmd->request_buffer;
- pSRB->Segmentx.length = pcmd->request_bufflen;
- }
- else
- pSRB->SGcount = 0;
-
pSRB->SGIndex = 0;
pSRB->AdaptStatus = 0;
pSRB->TargetStatus = 0;
@@ -1166,7 +1109,8 @@
pSRB->ScsiPhase = 0;
pSRB->EndMessage = 0;
pSRB->TagNumber = 255;
-};
+ /* KG: deferred PCI mapping to dc390_StartSCSI */
+}
/* Put cmnd from Query to Waiting list and send next Waiting cmnd */
static void dc390_Query_to_Waiting (PACB pACB)
@@ -1183,7 +1127,7 @@
pSRB = dc390_Free_get ( pACB );
if (!pSRB) return;
pcmd = dc390_Query_get ( pACB );
- if (!pcmd) { dc390_Free_insert (pACB, pSRB); return; }; /* should not happen */
+ if (!pcmd) { dc390_Free_insert (pACB, pSRB); return; } /* should not happen */
pDCB = dc390_findDCB (pACB, pcmd->device->id, pcmd->device->lun);
if (!pDCB)
{
@@ -1193,7 +1137,7 @@
DC390_UNLOCK_ACB_NI;
pcmd->done (pcmd);
DC390_LOCK_ACB_NI;
- };
+ }
dc390_BuildSRB (pcmd, pDCB, pSRB);
dc390_Waiting_append ( pDCB, pSRB );
}
@@ -1222,13 +1166,13 @@
{
PDCB pDCB;
PSRB pSRB;
- DC390_AFLAGS
PACB pACB = (PACB) cmd->device->host->hostdata;
+ DC390_AFLAGS;
DEBUG0(/* if(pACB->scan_devices) */ \
- printk(KERN_INFO "DC390: Queue Cmd=%02x,Tgt=%d,LUN=%d (pid=%li)\n",\
- cmd->cmnd[0],cmd->device->id,cmd->device->lun,cmd->pid);)
+ printk(KERN_INFO "DC390: Queue Cmd=%02x,Tgt=%d,LUN=%d (pid=%li), buffer=%p\n",\
+ cmd->cmnd[0],cmd->device->id,cmd->device->lun,cmd->pid, cmd->buffer));
DC390_LOCK_ACB;
@@ -1274,7 +1218,7 @@
done (cmd);
return (0);
#endif
- };
+ }
}
else if( !(pACB->scan_devices) && !(pACB->DCBmap[cmd->device->id] & (1 << cmd->device->lun)) )
@@ -1301,7 +1245,7 @@
done (cmd);
return (0);
#endif
- };
+ }
}
pACB->Cmds++;
@@ -1312,14 +1256,14 @@
if( pACB->QueryCnt ) /* Unsent commands ? */
{
- DEBUG0(printk ("DC390: QueryCnt != 0\n");)
+ DEBUG0(printk ("DC390: QueryCnt != 0\n"));
dc390_Query_append ( cmd, pACB );
dc390_Waiting_process (pACB);
}
else if (pDCB->pWaitingSRB)
{
pSRB = dc390_Free_get ( pACB );
- DEBUG0(if (!pSRB) printk ("DC390: No free SRB but Waiting\n"); else printk ("DC390: Free SRB w/ Waiting\n");)
+ DEBUG0(if (!pSRB) printk ("DC390: No free SRB but Waiting\n"); else printk ("DC390: Free SRB w/ Waiting\n"));
if (!pSRB) dc390_Query_append (cmd, pACB);
else
{
@@ -1331,7 +1275,7 @@
else
{
pSRB = dc390_Free_get ( pACB );
- DEBUG0(if (!pSRB) printk ("DC390: No free SRB w/o Waiting\n"); else printk ("DC390: Free SRB w/o Waiting\n");)
+ DEBUG0(if (!pSRB) printk ("DC390: No free SRB w/o Waiting\n"); else printk ("DC390: Free SRB w/o Waiting\n"));
if (!pSRB)
{
dc390_Query_append (cmd, pACB);
@@ -1341,11 +1285,11 @@
{
dc390_BuildSRB (cmd, pDCB, pSRB);
dc390_SendSRB (pACB, pSRB);
- };
- };
+ }
+ }
DC390_UNLOCK_ACB;
- DEBUG1(printk (KERN_DEBUG " ... command (pid %li) queued successfully.\n", cmd->pid);)
+ DEBUG1(printk (KERN_DEBUG " ... command (pid %li) queued successfully.\n", cmd->pid));
return(0);
}
@@ -1480,7 +1424,7 @@
sector_t capacity, int geom[])
{
return scsicam_bios_param (bdev, capacity, geom);
-};
+}
#endif
@@ -1496,7 +1440,7 @@
pSRB->TotalXferredLen, pSRB->SGToBeXferLen, pSRB->SRBState,
pSRB->ScsiPhase);
printk ("DC390: AdpaterStatus: %02x, SRB Status %02x\n", pSRB->AdaptStatus, pSRB->SRBStatus);
- };
+ }
printk ("DC390: Status of last IRQ (DMA/SC/Int/IRQ): %08x\n", dc390_laststatus);
printk ("DC390: Register dump: SCSI block:\n");
printk ("DC390: XferCnt Cmd Stat IntS IRQS FFIS Ctl1 Ctl2 Ctl3 Ctl4\n");
@@ -1512,7 +1456,7 @@
printk ("DC390: FIFO:");
while (DC390_read8(Current_Fifo) & 0x1f) printk (" %02x", DC390_read8(ScsiFifo));
printk ("\n");
- };
+ }
printk ("DC390: Register dump: DMA engine:\n");
printk ("DC390: Cmd STrCnt SBusA WrkBC WrkAC Stat SBusCtrl\n");
printk ("DC390: %02x %08x %08x %08x %08x %02x %08x\n",
@@ -1523,7 +1467,7 @@
PDEVSET1; PCI_READ_CONFIG_WORD(PDEV, PCI_STATUS, &pstat);
printk ("DC390: Register dump: PCI Status: %04x\n", pstat);
printk ("DC390: In case of driver trouble read linux/Documentation/scsi/tmscsim.txt\n");
-};
+}
/***********************************************************************
@@ -1543,11 +1487,10 @@
PDCB pDCB;
PSRB pSRB, psrb;
UINT count, i;
- PSCSICMD pcmd;
int status;
//ULONG sbac;
- DC390_AFLAGS
PACB pACB = (PACB) cmd->device->host->hostdata;
+ DC390_AFLAGS;
DC390_LOCK_ACB;
@@ -1557,33 +1500,16 @@
/* First scan Query list */
if( pACB->QueryCnt )
{
- pcmd = pACB->pQueryHead;
- if( pcmd == cmd )
- {
- /* Found: Dequeue */
- pACB->pQueryHead = pcmd->next;
- pcmd->next = NULL;
- if (cmd == pACB->pQueryTail) pACB->pQueryTail = NULL;
- pACB->QueryCnt--;
- status = SCSI_ABORT_SUCCESS;
- goto ABO_X;
- }
- for( count = pACB->QueryCnt, i=0; i<count-1; i++)
- {
- if( pcmd->next == cmd )
- {
- pcmd->next = cmd->next;
- cmd->next = NULL;
- if (cmd == pACB->pQueryTail) pACB->pQueryTail = NULL;
- pACB->QueryCnt--;
- status = SCSI_ABORT_SUCCESS;
- goto ABO_X;
- }
- else
- {
- pcmd = pcmd->next;
- }
- }
+ struct scsi_cmnd_list *t, *pcmd_l;
+ list_for_each_entry_safe(pcmd_l, t, &pACB->cmdq, scp.list)
+ if( (struct scsi_cmnd*)pcmd_l == cmd )
+ {
+ /* Found: Dequeue */
+ list_del(&pcmd_l->scp.list);
+ pACB->QueryCnt--;
+ status = SCSI_ABORT_SUCCESS;
+ goto ABO_X;
+ }
}
pDCB = dc390_findDCB (pACB, cmd->device->id, cmd->device->lun);
@@ -1624,7 +1550,7 @@
IN_WAIT:
dc390_Free_insert (pACB, pSRB);
pDCB->WaitSRBCnt--;
- cmd->next = NULL;
+ INIT_LIST_HEAD((struct list_head*)&cmd->SCp);
status = SCSI_ABORT_SUCCESS;
goto ABO_X;
}
@@ -1677,7 +1603,7 @@
//udelay (10000);
//DC390_read8 (INT_Status);
//DC390_write8 (ScsiCmd, EN_SEL_RESEL);
- };
+ }
sbac = DC390_read32 (DMA_ScsiBusCtrl);
if (sbac & SCSI_BUSY)
{ /* clear BSY, SEL and ATN */
@@ -1695,7 +1621,7 @@
DC390_write8 (ScsiCmd, NOP_CMD);
sbac = DC390_read32 (DMA_ScsiBusCtrl);
printk ("%08lx\n", sbac);
- };
+ }
#endif
dc390_lastabortedpid = cmd->pid;
DC390_UNLOCK_ACB;
@@ -1781,11 +1707,11 @@
* Returns : 0 on success.
***********************************************************************/
-int DC390_reset (Scsi_Cmnd *cmd, unsigned int resetFlags)
+int DC390_reset (Scsi_Cmnd *cmd)
{
UCHAR bval;
- DC390_AFLAGS
PACB pACB = (PACB) cmd->device->host->hostdata;
+ DC390_AFLAGS;
printk(KERN_INFO "DC390: RESET ... ");
@@ -1841,10 +1767,11 @@
pDCB = kmalloc (sizeof(DC390_DCB), GFP_ATOMIC);
DCBDEBUG(printk (KERN_INFO "DC390: alloc mem for DCB (ID %i, LUN %i): %p\n" \
- id, lun, pDCB);)
+ id, lun, pDCB));
- *ppDCB = pDCB; pDCB2 = 0;
+ *ppDCB = pDCB;
if (!pDCB) return;
+ pDCB2 = 0;
if( pACB->DCBCnt == 0 )
{
pACB->pLinkDCB = pDCB;
@@ -1853,7 +1780,7 @@
else
{
pACB->pLastDCB->pNextDCB = pDCB;
- };
+ }
pACB->DCBCnt++;
@@ -1925,21 +1852,21 @@
} else {
pDCB->SyncMode &= ~EN_TAG_QUEUEING;
pDCB->MaxCommand = 1;
- };
+ }
if( pDCB->DevMode & SYNC_NEGO_ )
pDCB->SyncMode |= SYNC_ENABLE;
else {
pDCB->SyncMode &= ~(SYNC_NEGO_DONE | SYNC_ENABLE);
pDCB->SyncOffset &= ~0x0f;
- };
+ }
//if (! (pDCB->DevMode & EN_DISCONNECT_)) pDCB->SyncMode &= ~EN_ATN_STOP;
pDCB->CtrlR1 = pACB->pScsiHost->this_id;
if( pDCB->DevMode & PARITY_CHK_ )
pDCB->CtrlR1 |= PARITY_ERR_REPO;
-};
+}
/***********************************************************************
@@ -1956,8 +1883,8 @@
{
dc390_updateDCB (pACB, pDCB);
pDCB = pDCB->pNextDCB;
- };
-};
+ }
+}
/***********************************************************************
@@ -2003,7 +1930,7 @@
{
PACB pACB;
UCHAR i;
- DC390_AFLAGS
+ DC390_AFLAGS;
psh->can_queue = MAX_CMD_QUEUE;
psh->cmd_per_lun = MAX_CMD_PER_LUN;
@@ -2021,15 +1948,13 @@
psh->last_reset = jiffies;
pACB = (PACB) psh->hostdata;
- DC390_LOCKA_INIT;
- DC390_LOCK_ACB;
pACB->pScsiHost = psh;
pACB->IOPortBase = (USHORT) io_port;
pACB->IRQLevel = Irq;
DEBUG0(printk (KERN_INFO "DC390: Adapter index %i, ID %i, IO 0x%08x, IRQ 0x%02x\n", \
- index, psh->this_id, (int)io_port, Irq);)
+ index, psh->this_id, (int)io_port, Irq));
psh->max_id = 8;
@@ -2045,7 +1970,7 @@
pACB->pFreeSRB = pACB->SRB_array;
pACB->SRBCount = MAX_SRB_CNT;
pACB->QueryCnt = 0;
- pACB->pQueryHead = NULL;
+ INIT_LIST_HEAD(&pACB->cmdq);
pACB->AdapterIndex = index;
pACB->status = 0;
psh->this_id = dc390_eepromBuf[index][EE_ADAPT_SCSI_ID];
@@ -2119,7 +2044,7 @@
dc390_pACB_current->pNextACB = pACB;
dc390_pACB_current = pACB;
pACB->pNextACB = NULL;
- };
+ }
DC390_write8 (CtrlReg1, DIS_INT_ON_SCSI_RST | psh->this_id); /* Disable SCSI bus reset interrupt */
@@ -2133,7 +2058,7 @@
for( i=0; i<(500 + 1000*dc390_eepromBuf[pACB->AdapterIndex][EE_DELAY]); i++ )
udelay(1000);
*/
- };
+ }
pACB->ACBFlag = 0;
DC390_read8 (INT_Status); /* Reset Pending INT */
@@ -2176,7 +2101,7 @@
{
PSH psh;
PACB pACB;
- DC390_AFLAGS
+ DC390_AFLAGS;
if (dc390_CheckEEpromCheckSum (PDEV, index))
{
@@ -2224,20 +2149,18 @@
}
#endif
- DEBUG0(printk(KERN_INFO "DC390: pSH = %8x,", (UINT) psh);)
- DEBUG0(printk(" Index %02i,", index);)
+ DEBUG0(printk(KERN_INFO "DC390: pSH = %8x, Index %02i\n", (UINT) psh, index));
dc390_initACB( psh, io_port, Irq, index );
- pACB = (PACB) psh->hostdata;
PDEVSET;
if( !dc390_initAdapter( psh, io_port, Irq, index ) )
{
- DEBUG0(printk("\nDC390: pACB = %8x, pDCBmap = %8x, pSRB_array = %8x\n",\
- (UINT) pACB, (UINT) pACB->DCBmap, (UINT) pACB->SRB_array);)
+ DEBUG0(printk("DC390: pACB = %8x, pDCBmap = %8x, pSRB_array = %8x\n",\
+ (UINT) pACB, (UINT) pACB->DCBmap, (UINT) pACB->SRB_array));
DEBUG0(printk("DC390: ACB size= %4x, DCB size= %4x, SRB size= %4x\n",\
- sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) );)
+ sizeof(DC390_ACB), sizeof(DC390_DCB), sizeof(DC390_SRB) ));
DC390_UNLOCK_ACB;
return (0);
@@ -2288,7 +2211,7 @@
PCI_WRITE_CONFIG_BYTE(PDEV, PCI_LATENCY_TIMER, 64);
}
-};
+}
#endif /* ! NEW_PCI */
static void __init dc390_set_pci_cfg (PDEVDECL)
@@ -2298,7 +2221,7 @@
cmd |= PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_IO;
PCI_WRITE_CONFIG_WORD (PDEV, PCI_COMMAND, cmd);
PCI_WRITE_CONFIG_WORD (PDEV, PCI_STATUS, (PCI_STATUS_SIG_SYSTEM_ERROR | PCI_STATUS_DETECTED_PARITY));
-};
+}
int __init DC390_detect (Scsi_Host_Template *psht)
@@ -2306,10 +2229,7 @@
PDEVDECL0;
UCHAR irq;
UINT io_port;
- //DC390_IFLAGS
- DC390_DFLAGS
- DC390_LOCK_DRV;
//dc390_pSHT_start = psht;
dc390_pACB_start = NULL;
@@ -2320,17 +2240,15 @@
if (pci_enable_device (pdev))
continue;
#endif
- //DC390_LOCK_IO; /* Remove this when going to new eh */
PCI_GET_IO_AND_IRQ;
- DEBUG0(printk(KERN_INFO "DC390(%i): IO_PORT=%04x,IRQ=%x\n", dc390_adapterCnt, (UINT) io_port, irq);)
+ DEBUG0(printk(KERN_INFO "DC390(%i): IO_PORT=%04x,IRQ=%x\n", dc390_adapterCnt, (UINT) io_port, irq));
if( !DC390_init(psht, io_port, irq, PDEV, dc390_adapterCnt))
{
PCI_SET_MASTER;
dc390_set_pci_cfg (PDEV);
dc390_adapterCnt++;
- };
- //DC390_UNLOCK_IO; /* Remove when going to new eh */
+ }
}
else
printk (KERN_ERR "DC390: No PCI BIOS found!\n");
@@ -2342,7 +2260,6 @@
psht->proc_dir = &DC390_proc_scsi_tmscsim;
#endif
printk(KERN_INFO "DC390: %i adapters found\n", dc390_adapterCnt);
- DC390_UNLOCK_DRV;
return( dc390_adapterCnt );
}
@@ -2368,17 +2285,17 @@
{
pDCB->DevMode &= ~(SYNC_NEGO_ | TAG_QUEUEING_ | EN_DISCONNECT_ );
dc390_updateDCB (pACB, pDCB);
- };
- };
+ }
+ }
kfree (cmd);
-};
+}
void dc390_inquiry (PACB pACB, PDCB pDCB)
{
char* buffer;
Scsi_Cmnd* cmd;
cmd = kmalloc (sizeof(Scsi_Cmnd) + 256, GFP_ATOMIC);
- if (!cmd) { printk ("DC390: kmalloc failed in inquiry!\n"); return; };
+ if (!cmd) { printk ("DC390: kmalloc failed in inquiry!\n"); return; }
buffer = (char*)cmd + sizeof(Scsi_Cmnd);
memset (cmd, 0, sizeof(Scsi_Cmnd) + 256);
@@ -2401,13 +2318,13 @@
cmd->scsi_done = dc390_inquiry_done;
cmd->timeout_per_command = HZ;
- cmd->request.rq_status = RQ_SCSI_BUSY;
+ cmd->request->rq_status = RQ_SCSI_BUSY;
pDCB->SyncMode &= ~SYNC_NEGO_DONE;
printk (KERN_INFO "DC390: Queue INQUIRY command to dev ID %02x LUN %02x\n",
pDCB->TargetID, pDCB->TargetLUN);
DC390_queue_command (cmd, dc390_inquiry_done);
-};
+}
/***********************************************************************
* Functions: dc390_sendstart(), dc390_sendstart_done()
@@ -2422,14 +2339,14 @@
printk (KERN_INFO "DC390: SENDSTART (ID %02x LUN %02x) returned %08x\n",
cmd->device->id, cmd->device->lun, cmd->result);
kfree (cmd);
-};
+}
void dc390_sendstart (PACB pACB, PDCB pDCB)
{
char* buffer;
Scsi_Cmnd* cmd;
cmd = kmalloc (sizeof(Scsi_Cmnd) + 256, GFP_ATOMIC);
- if (!cmd) { printk ("DC390: kmalloc failed in sendstart!\n"); return; };
+ if (!cmd) { printk ("DC390: kmalloc failed in sendstart!\n"); return; }
buffer = (char*)cmd + sizeof(Scsi_Cmnd);
memset (cmd, 0, sizeof(Scsi_Cmnd) + 256);
@@ -2452,13 +2369,13 @@
cmd->scsi_done = dc390_sendstart_done;
cmd->timeout_per_command = 5*HZ;
- cmd->request.rq_status = RQ_SCSI_BUSY;
+ cmd->request->rq_status = RQ_SCSI_BUSY;
pDCB->SyncMode &= ~SYNC_NEGO_DONE;
printk (KERN_INFO "DC390: Queue SEND_START command to dev ID %02x LUN %02x\n",
pDCB->TargetID, pDCB->TargetLUN);
DC390_queue_command (cmd, dc390_sendstart_done);
-};
+}
/********************************************************************
* Function: dc390_set_info()
@@ -2476,7 +2393,7 @@
if (*p0 == *pos) return -1;
*pos = strsep (buffer, " \t\n:=,;.");
return 0;
-};
+}
#define SCANF(buffer, pos, p0, var, min, max) \
if (dc390_scanf (&buffer, &pos, &p0, &var)) goto einv; \
@@ -2493,12 +2410,12 @@
}
*pos = strsep (buffer, " \t\n:=,;");
return 0;
-};
+}
-#define YESNO(buffer, pos, var, bmask) \
-if (dc390_yesno (&buffer, &pos, &var, bmask)) goto einv; \
-else dc390_updateDCB (pACB, pDCB); \
-if (!p) goto ok
+#define YESNO(buffer, pos, var, bmask) \
+ if (dc390_yesno (&buffer, &pos, &var, bmask)) goto einv; \
+ else dc390_updateDCB (pACB, pDCB); \
+ if (!pos) goto ok
static int dc390_search (char** buffer, char** pos, char** p0, char* var, char* txt, int max, int scale, char* ign)
{
@@ -2519,7 +2436,7 @@
}
return 0;
-};
+}
#define SEARCH(buffer, pos, p0, var, txt, max) \
if (dc390_search (&buffer, &pos, &p0, (PUCHAR)(&var), txt, max, 100, "")) goto einv2; \
@@ -2545,7 +2462,7 @@
else *c++ = *p++;
*c = 0;
return _prstr;
-};
+}
#endif
int dc390_set_info (char *buffer, int length, PACB pACB)
@@ -2555,16 +2472,16 @@
int dum = 0;
char dev;
PDCB pDCB = pACB->pLinkDCB;
- DC390_IFLAGS
- DC390_AFLAGS
+ DC390_IFLAGS;
+ DC390_AFLAGS;
pos[length] = 0;
- DC390_LOCK_IO(pACB.pScsiHost);
+ DC390_LOCK_IO(pACB->pScsiHost);
DC390_LOCK_ACB;
/* UPPERCASE */
/* Don't use kernel toupper, because of 2.0.x bug: ctmp unexported */
while (*pos)
- { if (*pos >='a' && *pos <= 'z') *pos = *pos + 'A' - 'a'; pos++; };
+ { if (*pos >='a' && *pos <= 'z') *pos = *pos + 'A' - 'a'; pos++; }
/* Remove WS */
pos = strsep (&buffer, " \t:\n=,;");
@@ -2589,7 +2506,7 @@
if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
if (!*pos) goto einv;
- PARSEDEBUG(printk (KERN_INFO "DC390: config line %i %i %i:\"%s\"\n", dev, id, lun, prstr (pos, &buffer[length]));)
+ PARSEDEBUG(printk (KERN_INFO "DC390: config line %i %i %i:\"%s\"\n", dev, id, lun, prstr (pos, &buffer[length])));
pDCB = pACB->pLinkDCB;
for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
/* Sanity Check */
@@ -2598,14 +2515,14 @@
printk (KERN_ERR "DC390: no such device: Idx=%02i ID=%02i LUN=%02i\n",
dev, id, lun);
goto einv2;
- };
+ }
if (pDCB->pWaitingSRB || pDCB->pGoingSRB)
{
printk ("DC390: Cannot change dev (%i-%i) cfg: Pending requests\n",
pDCB->TargetID, pDCB->TargetLUN);
goto einv;
- };
+ }
olddevmode = pDCB->DevMode;
YESNO (buffer, pos, pDCB->DevMode, PARITY_CHK_);
@@ -2634,9 +2551,9 @@
pDCB->NegoPeriod = dum >> 2;
if (pDCB->NegoPeriod != olddevmode) needs_inquiry++;
if (!pos) goto ok;
- if (memcmp (pos, "NS", 2) == 0) pos = strsep (*pos, " \t\n:=,;.");
+ if (memcmp (pos, "NS", 2) == 0) pos = strsep (&pos, " \t\n:=,;.");
}
- else pos = strsep (*pos, " \t\n:=,;.");
+ else pos = strsep (&pos, " \t\n:=,;.");
if (!*pos) goto ok;
/* Sync Speed in MHz */
@@ -2654,13 +2571,13 @@
for (; p0-pos > 1; p0--) dum /= 10;
pDCB->NegoPeriod = (100000/(100*dumold + dum)) >> 2;
if (pDCB->NegoPeriod < 19) pDCB->NegoPeriod = 19;
- pos = strsep (*pos, " \t\n:=,;");
+ pos = strsep (&pos, " \t\n:=,;");
if (!*pos) goto ok;
- };
- if (*pos == 'M') pos = strsep (*pos, " \t\n:=,;");
+ }
+ if (*pos == 'M') pos = strsep (&pos, " \t\n:=,;");
if (pDCB->NegoPeriod != olddevmode) needs_inquiry++;
}
- else pos = strsep (*pos, " \t\n:=,;");
+ else pos = strsep (&pos, " \t\n:=,;");
/* dc390_updateDCB (pACB, pDCB); */
if (!*pos) goto ok;
@@ -2672,7 +2589,7 @@
pDCB->SyncOffset = dum;
if (pDCB->SyncOffset > olddevmode) needs_inquiry++;
}
- else pos = strsep (*pos, " \t\n:=,;");
+ else pos = strsep (&pos, " \t\n:=,;");
if (!*pos) goto ok;
dc390_updateDCB (pACB, pDCB);
@@ -2685,13 +2602,13 @@
pDCB->MaxCommand = dum;
else printk (KERN_INFO "DC390: Can't set MaxCmd larger than one without Tag Queueing!\n");
}
- else pos = strsep (*pos, " \t\n:=,;");
+ else pos = strsep (&pos, " \t\n:=,;");
}
else
{
char* p1 = pos; UCHAR dum, newadaptid;
- PARSEDEBUG(printk (KERN_INFO "DC390: chg adapt cfg \"%s\"\n", prstr (pos, &buffer[length]));)
+ PARSEDEBUG(printk (KERN_INFO "DC390: chg adapt cfg \"%s\"\n", prstr (pos, &buffer[length])));
dum = GLITCH_TO_NS (pACB->glitch_cfg);
/* Adapter setting */
SEARCH (buffer, pos, p0, pACB->pScsiHost->max_id, "MAXID", 8);
@@ -2722,15 +2639,15 @@
ok:
DC390_UNLOCK_ACB;
if (needs_inquiry)
- { dc390_updateDCB (pACB, pDCB); dc390_inquiry (pACB, pDCB); };
- DC390_UNLOCK_IO(pACB.pScsiHost);
+ { dc390_updateDCB (pACB, pDCB); dc390_inquiry (pACB, pDCB); }
+ DC390_UNLOCK_IO(pACB->pScsiHost);
return (length);
einv2:
pos = p0;
einv:
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO(pACB.pScsiHost);
+ DC390_UNLOCK_IO(pACB->pScsiHost);
printk (KERN_WARNING "DC390: parse error near \"%s\"\n", (pos? pos: "NULL"));
return (-EINVAL);
@@ -2741,22 +2658,22 @@
/* cmd.host = pACB->pScsiHost; */
printk (KERN_WARNING "DC390: Driver reset requested!\n");
DC390_UNLOCK_ACB;
- DC390_reset (&cmd, 0);
- DC390_UNLOCK_IO(pACB.pScsiHost);
- };
+ DC390_reset (&cmd);
+ DC390_UNLOCK_IO(pACB->pScsiHost);
+ }
return (length);
dump:
{
dc390_dumpinfo (pACB, 0, 0);
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO(pACB.pScsiHost);
+ DC390_UNLOCK_IO(pACB->pScsiHost);
}
return (length);
inquiry:
{
- pos = strsep (*pos, " \t\n.:;="); if (!*pos) goto einv;
+ pos = strsep (&pos, " \t\n.:;="); if (!*pos) goto einv;
dev = simple_strtoul (pos, &p0, 10);
if (dev >= pACB->DCBCnt) goto einv_dev;
for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
@@ -2764,13 +2681,13 @@
dev, pDCB->TargetID, pDCB->TargetLUN);
DC390_UNLOCK_ACB;
dc390_inquiry (pACB, pDCB);
- DC390_UNLOCK_IO(pACB.pScsiHost);
- };
+ DC390_UNLOCK_IO(pACB->pScsiHost);
+ }
return (length);
remove:
{
- pos = strsep (*pos, " \t\n.:;="); if (!*pos) goto einv;
+ pos = strsep (&pos, " \t\n.:;="); if (!*pos) goto einv;
dev = simple_strtoul (pos, &p0, 10);
if (dev >= pACB->DCBCnt) goto einv_dev;
for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
@@ -2779,29 +2696,29 @@
/* TO DO: We should make sure no pending commands are left */
dc390_remove_dev (pACB, pDCB);
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO(pACB.pScsiHost);
- };
+ DC390_UNLOCK_IO(pACB->pScsiHost);
+ }
return (length);
add:
{
int id, lun;
- pos = strsep (*pos, " \t\n.:;=");
+ pos = strsep (&pos, " \t\n.:;=");
if (*pos) { SCANF (buffer, pos, p0, id, 0, 7); } else goto einv;
if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
pDCB = dc390_findDCB (pACB, id, lun);
- if (pDCB) { printk ("DC390: ADD: Device already existing\n"); goto einv; };
+ if (pDCB) { printk ("DC390: ADD: Device already existing\n"); goto einv; }
dc390_initDCB (pACB, &pDCB, id, lun);
DC390_UNLOCK_ACB;
dc390_inquiry (pACB, pDCB);
- DC390_UNLOCK_IO(pACB.pScsiHost);
- };
+ DC390_UNLOCK_IO(pACB->pScsiHost);
+ }
return (length);
start:
{
int id, lun;
- pos = strsep (*pos, " \t\n.:;=");
+ pos = strsep (&pos, " \t\n.:;=");
if (*pos) { SCANF (buffer, pos, p0, id, 0, 7); } else goto einv;
if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
pDCB = dc390_findDCB (pACB, id, lun);
@@ -2810,18 +2727,16 @@
DC390_UNLOCK_ACB;
dc390_sendstart (pACB, pDCB);
dc390_inquiry (pACB, pDCB);
- DC390_UNLOCK_IO(pACB.pScsiHost);
- };
+ DC390_UNLOCK_IO(pACB->pScsiHost);
+ }
return (length);
einv_dev:
printk (KERN_WARNING "DC390: Ignore cmnd to invalid Dev(Idx) %i. Valid range: 0 - %i.\n",
dev, pACB->DCBCnt - 1);
DC390_UNLOCK_ACB;
- DC390_UNLOCK_IO(pACB.pScsiHost);
+ DC390_UNLOCK_IO(pACB->pScsiHost);
return (-EINVAL);
-
-
}
#undef SEARCH
@@ -2860,10 +2775,10 @@
{
int dev, spd, spd1;
char *pos = buffer;
+ struct scsi_cmnd_list *cl;
PACB pACB;
PDCB pDCB;
- PSCSICMD pcmd;
- DC390_AFLAGS
+ DC390_AFLAGS;
pACB = dc390_pACB_start;
@@ -2932,8 +2847,8 @@
pDCB = pDCB->pNextDCB;
}
SPRINTF ("Commands in Queues: Query: %li:", pACB->QueryCnt);
- for (pcmd = pACB->pQueryHead; pcmd; pcmd = pcmd->next)
- SPRINTF (" %li", pcmd->pid);
+ list_for_each_entry(cl, &pACB->cmdq, scp.list)
+ SPRINTF (" %li", ((struct scsi_cmnd*)cl)->pid);
if (timer_pending(&pACB->Waiting_Timer)) SPRINTF ("Waiting queue timer running\n");
else SPRINTF ("\n");
pDCB = pACB->pLinkDCB;
@@ -2983,8 +2898,6 @@
#undef YESNO
#undef SPRINTF
-#ifdef MODULE
-
/***********************************************************************
* Function : static int dc390_shutdown (struct Scsi_Host *host)
*
@@ -3024,17 +2937,17 @@
{
nDCB = pDCB->pNextDCB;
DCBDEBUG(printk (KERN_INFO "DC390: Free DCB (ID %i, LUN %i): %p\n",\
- pDCB->TargetID, pDCB->TargetLUN, pDCB);)
+ pDCB->TargetID, pDCB->TargetLUN, pDCB));
//kfree (pDCB);
dc390_remove_dev (pACB, pDCB);
pDCB = nDCB;
} while (pDCB && pACB->pLinkDCB);
-};
+}
int DC390_release (struct Scsi_Host *host)
{
- DC390_AFLAGS DC390_IFLAGS
+ DC390_AFLAGS DC390_IFLAGS;
PACB pACB = (PACB)(host->hostdata);
DC390_LOCK_IO(host);
@@ -3045,7 +2958,7 @@
if (host->irq != SCSI_IRQ_NONE)
{
- DEBUG0(printk(KERN_INFO "DC390: Free IRQ %i\n",host->irq);)
+ DEBUG0(printk(KERN_INFO "DC390: Free IRQ %i\n",host->irq));
free_irq (host->irq, pACB);
}
@@ -3055,17 +2968,16 @@
DC390_UNLOCK_IO(host);
return( 1 );
}
-#endif /* def MODULE */
-static Scsi_Host_Template driver_template = DC390_T;
+static Scsi_Host_Template driver_template = {
.proc_name = "tmscsim",
.proc_info = DC390_proc_info,
.name = DC390_BANNER " V" DC390_VERSION,
.detect = DC390_detect,
.release = DC390_release,
.queuecommand = DC390_queue_command,
- .abort = DC390_abort,
- .reset = DC390_reset,
+ .eh_abort_handler = DC390_abort,
+ .eh_bus_reset_handler = DC390_reset,
.bios_param = DC390_bios_param,
.can_queue = 42,
.this_id = 7,
diff -ur linux-2.6.0-test7.arm/drivers/scsi/tmscsim.h linux-2.6.0-test7/drivers/scsi/tmscsim.h
--- linux-2.6.0-test7.arm/drivers/scsi/tmscsim.h Sat Aug 9 06:40:56 2003
+++ linux-2.6.0-test7/drivers/scsi/tmscsim.h Sat Nov 22 23:40:35 2003
@@ -24,6 +24,8 @@
#define END_SCAN 2
+#define pci_dma_lo32(a) (a & 0xffffffff)
+
typedef u8 UCHAR; /* 8 bits */
typedef u16 USHORT; /* 16 bits */
typedef u32 UINT; /* 32 bits */
@@ -213,8 +215,7 @@
/* 0x2c: */
ULONG QueryCnt;
-PSCSICMD pQueryHead;
-PSCSICMD pQueryTail;
+struct list_head cmdq;
/* 0x38: */
UCHAR msgin123[4];
@@ -400,6 +401,20 @@
/*;----SCSI MSG BYTE*/ /* see scsi/scsi.h */ /* One is missing ! */
#define ABORT_TAG 0x0d
+
+/*
+ * SISC query queue
+ */
+typedef struct {
+ struct list_head list;
+ dma_addr_t saved_dma_handle;
+} dc390_cmd_scp_t;
+
+struct scsi_cmnd_list
+{
+ char dummy[offsetof(struct scsi_cmnd, SCp)];
+ dc390_cmd_scp_t scp;
+};
/*
** Inquiry Data format
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: TMSCSIM [2.6]
2003-11-22 23:27 TMSCSIM [2.6] (was: Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6) Guennadi Liakhovetski
@ 2003-11-23 20:26 ` Matthias Andree
2003-11-23 20:53 ` Guennadi Liakhovetski
2003-11-23 23:29 ` Kurt Garloff
0 siblings, 2 replies; 28+ messages in thread
From: Matthias Andree @ 2003-11-23 20:26 UTC (permalink / raw)
To: Guennadi Liakhovetski; +Cc: linux-scsi
Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
> @@ -47,8 +47,9 @@
> DC390_write8 (CtrlReg4, pDCB->CtrlR4);
> DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); /* Flush FIFO */
> DEBUG1(printk (KERN_INFO "DC390: Start SCSI command: %02x (Sync:%02x)\n",\
> - pSRB->pcmd->cmnd[0], pDCB->SyncMode);)
> - disc_allowed = pDCB->DevMode & EN_DISCONNECT_; try_sync_nego = 0;
> + pSRB->pcmd->cmnd[0], pDCB->SyncMode));
> + disc_allowed = pDCB->DevMode & EN_DISCONNECT_;
> + try_sync_nego = 0;
> /* Don't disconnect on AUTO_REQSENSE, cause it might be an
> * Contingent Allegiance Condition (6.6), where no tags should be used.
> * All other have to be allowed to disconnect to prevent Incorrect
Out if interest: Why "try_sync_nego = 0"?
--
Matthias Andree
Encrypt your mail: my GnuPG key ID is 0x052E7D95
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-23 20:26 ` TMSCSIM [2.6] Matthias Andree
@ 2003-11-23 20:53 ` Guennadi Liakhovetski
2003-11-23 23:29 ` Kurt Garloff
1 sibling, 0 replies; 28+ messages in thread
From: Guennadi Liakhovetski @ 2003-11-23 20:53 UTC (permalink / raw)
To: Matthias Andree; +Cc: linux-scsi
On Sun, 23 Nov 2003, Matthias Andree wrote:
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
>
> > @@ -47,8 +47,9 @@
> > DC390_write8 (CtrlReg4, pDCB->CtrlR4);
> > DC390_write8 (ScsiCmd, CLEAR_FIFO_CMD); /* Flush FIFO */
> > DEBUG1(printk (KERN_INFO "DC390: Start SCSI command: %02x (Sync:%02x)\n",\
> > - pSRB->pcmd->cmnd[0], pDCB->SyncMode);)
> > - disc_allowed = pDCB->DevMode & EN_DISCONNECT_; try_sync_nego = 0;
> > + pSRB->pcmd->cmnd[0], pDCB->SyncMode));
> > + disc_allowed = pDCB->DevMode & EN_DISCONNECT_;
> > + try_sync_nego = 0;
> > /* Don't disconnect on AUTO_REQSENSE, cause it might be an
> > * Contingent Allegiance Condition (6.6), where no tags should be used.
> > * All other have to be allowed to disconnect to prevent Incorrect
>
> Out if interest: Why "try_sync_nego = 0"?
No idea. I didn't change it - just broke the line. Actually, such
changes shouldn't go into patches, but it goes almost automatic, you
know:-(
Guennadi
---
Guennadi Liakhovetski
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: TMSCSIM [2.6]
2003-11-23 20:26 ` TMSCSIM [2.6] Matthias Andree
2003-11-23 20:53 ` Guennadi Liakhovetski
@ 2003-11-23 23:29 ` Kurt Garloff
1 sibling, 0 replies; 28+ messages in thread
From: Kurt Garloff @ 2003-11-23 23:29 UTC (permalink / raw)
To: Matthias Andree; +Cc: Guennadi Liakhovetski, linux-scsi
[-- Attachment #1: Type: text/plain, Size: 546 bytes --]
Hi Matthias,
On Sun, Nov 23, 2003 at 09:26:02PM +0100, Matthias Andree wrote:
> Out if interest: Why "try_sync_nego = 0"?
It's just the default for this variable.
It's later set to 1 if we're issueing an INQUIRY or if we're talking to
LUN0, the target did report to support SyncTransfers and the Sync
Negotiation has not beend done yet and we're issueing a REQUEST_SENSE.
Regards,
--
Kurt Garloff <garloff@suse.de> Cologne, DE
SUSE LINUX AG, Nuernberg, DE SUSE Labs (Head)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2003-11-30 5:27 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.44.0311242223130.2874-200000@poirot.grange>
2003-11-24 22:33 ` TMSCSIM [2.6] (was: Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6) Guennadi Liakhovetski
2003-11-25 20:58 ` TMSCSIM [2.6] Chiaki
2003-11-25 21:16 ` Chiaki
2003-11-25 22:26 ` Guennadi Liakhovetski
2003-11-25 22:44 ` Chiaki
2003-11-27 19:13 ` Chiaki
2003-11-27 22:05 ` Guennadi Liakhovetski
2003-11-28 1:41 ` Chiaki
2003-11-28 7:33 ` Guennadi Liakhovetski
2003-11-29 1:55 ` Chiaki
2003-11-29 9:46 ` Guennadi Liakhovetski
2003-11-29 9:58 ` Guennadi Liakhovetski
2003-11-29 13:06 ` Matthias Andree
2003-11-29 20:37 ` Guennadi Liakhovetski
2003-11-29 18:11 ` Kurt Garloff
2003-11-29 18:36 ` James Bottomley
2003-11-29 21:19 ` Guennadi Liakhovetski
2003-11-30 5:27 ` Chiaki
2003-11-28 20:25 ` Guennadi Liakhovetski
2003-11-29 11:03 ` Thorsten Leemhuis
2003-11-29 12:43 ` Thorsten Leemhuis
2003-11-27 22:43 ` TMSCSIM [2.6] (cards) Guennadi Liakhovetski
2003-11-28 1:45 ` Chiaki
2003-11-29 18:14 ` Kurt Garloff
[not found] <1069954227.1667.1.camel@work.thl.home>
2003-11-28 9:05 ` TMSCSIM [2.6] Guennadi Liakhovetski
2003-11-22 23:27 TMSCSIM [2.6] (was: Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6) Guennadi Liakhovetski
2003-11-23 20:26 ` TMSCSIM [2.6] Matthias Andree
2003-11-23 20:53 ` Guennadi Liakhovetski
2003-11-23 23:29 ` Kurt Garloff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox