Skip to contentSkip to conversation

sis5513 fix for SiS962 chipset

PATCH In review Thomas Gleixner 3 participants 10 messages Sep 10, 2004 – Sep 13, 2004 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sis5513 fix for SiS962 chipset

Hi,

1. If the fake 5513 id bit is not set by the BIOS we must have the 5518 id in the device table.

2. If the register remapping is not set by the BIOS then the enable bit check in ide_pci_setup_ports will fail. It's safe to switch to the remapping mode here. Keeping the not remapped mode would need quite big changes AFAICS.

Works with 2.4.27 and 2.6.8. Please apply.

tglx
________________________________________________________________________
SCO: Linux does not exist
Linux: SCO's claim does not exist
Wallstreet: SCO does not exist for long
________________________________________________________________________

diff -urN linux-2.6.8.1.org/drivers/ide/pci/sis5513.c linux-2.6.8.1/drivers/ide/pci/sis5513.c
--- linux-2.6.8.1.org/drivers/ide/pci/sis5513.c 2004-08-14
12:55:32.000000000 +0200
+++ linux-2.6.8.1/drivers/ide/pci/sis5513.c 2004-09-10
15:50:50.000000000 +0200
@@ -788,6 +788,15 @@
if (trueid == 0x5518) {
printk(KERN_INFO "SIS5513: SiS 962/963 MuTIOL IDE UDMA133
controller\n");
chipset_family = ATA_133;
+
+ /* Check for 5513 compability mapping
+ * We must use this, else the port enabled code will fail,
+ * as it expects the enablebits at 0x4a.
+ */
+ if (!(idemisc & 0x40000000)) {
+ pci_write_config_dword(dev, 0x54, idemisc | 0x40000000);
+ printk (KERN_INFO "SIS5513: Switching to 5513 register
mapping\n");
+ }
}
}

@@ -963,6 +972,7 @@

static struct pci_device_id sis5513_pci_tbl[] = {
{ PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, PCI_ANY_ID, PCI_ANY_ID, 0,
0, 0},
+ { PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5518, PCI_ANY_ID, PCI_ANY_ID, 0,
0, 0},
{ 0, },
};
MODULE_DEVICE_TABLE(pci, sis5513_pci_tbl);

#1 lore raw

Thomas Gleixner wrote the following on 09/10/2004 04:29 PM :

Quoted 11 lines

Hi,

1. If the fake 5513 id bit is not set by the BIOS we must have the 5518 id in the device table.

2. If the register remapping is not set by the BIOS then the enable bit check in ide_pci_setup_ports will fail. It's safe to switch to the remapping mode here. Keeping the not remapped mode would need quite big changes AFAICS.

I was worried about these when 5518 was introduced but couldn't test on the hardware I had at hand and nobody reported hitting this so it went under the carpet. What hardware did you use to test ?

Signature · 7 lines
Lionel Bouton - inet6
---------------------------------------------------------------------
  o              Siege social: 51, rue de Verdun - 92158 Suresnes
 /      _ __ _   Acces Bureaux: 33 rue Benoit Malon - 92150 Suresnes
/ /\  /_  / /_   France
\/  \/_  / /_/   Tel. +33 (0) 1 41 44 85 36
 Inetsys S.A.    Fax  +33 (0) 1 46 97 20 10
#2 lore raw
Quoted 7 lines · Lionel Bouton

Thomas Gleixner wrote the following on 09/10/2004 04:29 PM :

Quoted 5 lines

Hi,

1. If the fake 5513 id bit is not set by the BIOS we must have the 5518 id in the device table.

Quoted 8 lines
Quoted 4 lines

2. If the register remapping is not set by the BIOS then the enable bit check in ide_pci_setup_ports will fail. It's safe to switch to the remapping mode here. Keeping the not remapped mode would need quite big changes AFAICS.

I was worried about these when 5518 was introduced but couldn't test on the hardware I had at hand and nobody reported hitting this so it went under the carpet. What hardware did you use to test ?

Compact PCI ICP-P4 from Inova Computers.

They have not set the 5513 fake id bit and the remapping bit isn't set either. I did thorough testing both on 2.4 and 2.6 and encountered no problems yet. I suspect there are more boards around with similar settings.

tglx

#3 lore raw

Thomas Gleixner wrote the following on 09/10/2004 05:06 PM :

Quoted 13 lines · Lionel Bouton
Quoted 7 lines

[...]

What hardware did you use to test ?

Compact PCI ICP-P4 from Inova Computers.

I see it's not really a cutting-edge design (2002). Apparently nobody seemed to care about Linux IDE performance before :-|

#4 lore raw
Quoted 2 lines · Lionel Bouton

I see it's not really a cutting-edge design (2002). Apparently nobody seemed to care about Linux IDE performance before :-|

The chipset was often used in Notebooks. I just checked one of them and it has both the 5513 fake bits set, so I never noticed. :)
I think most developers were following the recommended settings in the manual, but some obviously did not.

tglx

#5 lore raw
In reply to Lionel Bouton
Quoted 11 lines · Lionel Bouton

Thomas Gleixner wrote the following on 09/10/2004 05:06 PM :

Quoted 9 lines · Lionel Bouton
Quoted 7 lines

[...]

What hardware did you use to test ?

Quoted 7 lines
Quoted 4 lines

Compact PCI ICP-P4 from Inova Computers.

I see it's not really a cutting-edge design (2002). Apparently nobody seemed to care about Linux IDE performance before :-|

Yep. :/ Lionel, can I push this fix upstream?

Could somebody enlighten me what exactly 'remapping mode' does?

Bartlomiej

#6 lore raw
Quoted 5 lines · Bartlomiej Zolnierkiewicz

Yep. :/ Lionel, can I push this fix upstream?

Could somebody enlighten me what exactly 'remapping mode' does?

Bartlomiej

The 5518 version of the IDE controller has a config bit which (re)maps the main config registers to 5513 compatible offsets. So the 5513 code can be used with some minor tweaks. If you don't use the remapping you have to modify / rewrite quite a portion of the code in order to get it working with the 5518 chip version.

tglx

#7 lore raw
In reply to Bartlomiej Zolnierkiewicz

Bartlomiej Zolnierkiewicz wrote the following on 09/10/2004 11:21 PM :

Quoted 7 lines
Quoted 3 lines

I see it's not really a cutting-edge design (2002). Apparently nobody seemed to care about Linux IDE performance before :-|

Yep. :/ Lionel, can I push this fix upstream?

Please do.

In fact I think I'm only a speed bumper here. There's so little work to do on the sis5513 driver now that I don't follow IDE work closely anymore and must refresh my memories even for such simple patches. I believe there are people around more fit than me for sis5513 maintenance. With SATA, sis5513.c will soon be considered legacy code. I don't think a dedicated maintainer is usefull anymore, seems to me it would be better handled by someone with a broader view of IDE chipsets than me.

Any volunteeer ?

Lionel.

#8 lore raw
Quoted 7 lines · Lionel Bouton

Bartlomiej Zolnierkiewicz wrote the following on 09/10/2004 11:21 PM :

Quoted 5 lines
Quoted 4 lines

I see it's not really a cutting-edge design (2002). Apparently nobody seemed to care about Linux IDE performance before :-|

Quoted 5 lines
Quoted 3 lines

Yep. :/ Lionel, can I push this fix upstream?

Please do.

OK, will do.

Quoted 4 lines

In fact I think I'm only a speed bumper here. There's so little work to do on the sis5513 driver now that I don't follow IDE work closely anymore and must refresh my memories even for such simple patches. I believe there are people around more fit than me for sis5513 maintenance.

I'm not aware of any such person...

Quoted 3 lines

With SATA, sis5513.c will soon be considered legacy code. I don't think a dedicated maintainer is usefull anymore, seems to me it would be better handled by someone with a broader view of IDE chipsets than me.

Dedicated maintainers are very useful even for legacy drivers. This way the subsystem maintainer doesn't have to worry about every fscking driver (less bugs, faster development). :-)

If you really want to give up maintainership of sis5513 please send a patch to Linus+me removing you from MAINTAINERS file.

Anyway, thanks for all your hard work on sis5513 driver.

#9 lore raw

Bartlomiej Zolnierkiewicz wrote the following on 09/11/2004 06:02 PM :

Quoted 8 lines
Quoted 3 lines

In fact I think I'm only a speed bumper here. There's so little work to do on the sis5513 driver now that I don't follow IDE work closely anymore and must refresh my memories even for such simple patches. I believe there are people around more fit than me for sis5513 maintenance.

I'm not aware of any such person...

Vojtech seemed quite proficient at sis5513.c hacking :-)

Quoted 7 lines

Dedicated maintainers are very useful even for legacy drivers. This way the subsystem maintainer doesn't have to worry about every fscking driver (less bugs, faster development). :-)

Ok, if you think a dedicated maintainer is the way to go, I'll continue to review occasional patches. In fact I enjoy doing this from time to time, I was merely worried about not being the best fit for the job anymore.

Regards,

Lionel.