Skip to contentSkip to conversation

dec_esp.c repair mmu_sglist breakage

PATCH In review Florian Lohoff 3 participants 4 messages Sep 28, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dec_esp.c repair mmu_sglist breakage

Hi,
through the whole issue of the mmu_sglist confusion and the broken reimplantation of mmu_sglist the dec_esp broke. Here is a fix to really remove the mmu_sglist and use scatterlist instead. With this the Decstation on this desk at least finds its partitions again and does not crash.

I vote for removal of the struct mmu_sglist as at least it now breaks on compile time and not confusion at runtime.

Flo

Index: drivers/scsi/dec_esp.c
===================================================================
RCS file: /home/cvs/linux/drivers/scsi/dec_esp.c,v retrieving revision 1.10.2.3

scsi/dec_esp.c +6 -6
diff -u -r1.10.2.3 dec_esp.c
@@ -443,13 +443,13 @@
 
 static void dma_mmu_get_scsi_sgl(struct NCR_ESP *esp, Scsi_Cmnd * sp)
 {
-    int sz = sp->SCp.buffers_residual;
-    struct mmu_sglist *sg = (struct mmu_sglist *) sp->SCp.buffer;
+	int sz = sp->SCp.buffers_residual;
+	struct scatterlist *sg = sp->SCp.buffer;
 
-    while (sz >= 0) {
-		sg[sz].dvma_addr = PHYSADDR(sg[sz].addr);
-	sz--;
-    }
+	while (sz >= 0) {
+		sg[sz].dma_address = PHYSADDR(sg[sz].address);
+		sz--;
+	}
 	sp->SCp.ptr = (char *) ((unsigned long) sp->SCp.buffer->dma_address);
 }
 

Index: include/asm-mips/scatterlist.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/scatterlist.h,v retrieving revision 1.4.2.3

asm-mips/scatterlist.h +0 -7
diff -u -r1.4.2.3 scatterlist.h
@@ -10,13 +10,6 @@
 	unsigned int length;
 };
 
-struct mmu_sglist {
-	char *addr;
-	char *__dont_touch;
-	unsigned int len;
-	dma_addr_t dvma_addr;
-};
-
 #define ISA_DMA_THRESHOLD (0x00ffffff)
 
 #endif /* __ASM_SCATTERLIST_H */
Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
                        Heisenberg may have been here.
#1 lore raw
Quoted 5 lines · Florian Lohoff

through the whole issue of the mmu_sglist confusion and the broken reimplantation of mmu_sglist the dec_esp broke. Here is a fix to really remove the mmu_sglist and use scatterlist instead. With this the Decstation on this desk at least finds its partitions again and does not crash.

I tested the patch on my DS 5000/150 and it works there, too. Could you please check it into the cvs? Without it the kernel is de facto unusable on DECstations.

Regards,
Karsten

Signature · 4 lines
#include <standard_disclaimer>
Nach Paragraph 28 Abs. 3 Bundesdatenschutzgesetz widerspreche ich der Nutzung
oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder
Meinungsforschung.
#2 lore raw
Quoted 7 lines · Karsten Merker
Quoted 5 lines

through the whole issue of the mmu_sglist confusion and the broken reimplantation of mmu_sglist the dec_esp broke. Here is a fix to really remove the mmu_sglist and use scatterlist instead. With this the Decstation on this desk at least finds its partitions again and does not crash.

I tested the patch on my DS 5000/150 and it works there, too.

Thanks for the report -- since I have no means to test the SCSI driver I
was going to ask people for testing to have another confirmation. I'm not sure why it got broken (I'll check the details to find out) as the changes were to revert to the original behaviour, but since struct mmu_sglist got deprecated, I'm happy to see an update to struct scatterlist. Since the change works for both of you, I'm checking it in now.

Quoted 2 lines

Could you please check it into the cvs? Without it the kernel is de facto unusable on DECstations.

Well, it depends on the actual configuration -- I haven't noticed
anything wrong. ;-)

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#3 lore raw
Quoted 8 lines · Maciej W. Rozycki
Quoted 6 lines · Karsten Merker
Quoted 5 lines

through the whole issue of the mmu_sglist confusion and the broken reimplantation of mmu_sglist the dec_esp broke. Here is a fix to really remove the mmu_sglist and use scatterlist instead. With this the Decstation on this desk at least finds its partitions again and does not crash.

Quoted 6 lines
Quoted 1 line

I tested the patch on my DS 5000/150 and it works there, too.

Thanks for the report -- since I have no means to test the SCSI driver I
was going to ask people for testing to have another confirmation. I'm not sure why it got broken (I'll check the details to find out) as the changes were to revert to the original behaviour, but since struct mmu_sglist got

It wasnt reverted - The problem was that the original Framework NCR53C9x and dec_esp.c used the different structs which were not the same (Order changed) after the change so it broke.

Quoted 2 lines

deprecated, I'm happy to see an update to struct scatterlist. Since the change works for both of you, I'm checking it in now.

Flo

Signature · 2 lines
Florian Lohoff                  [email protected]             +49-5201-669912
                        Heisenberg may have been here.