linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases)
       [not found] <3F0EED9B.4080502@enib.fr>
@ 2003-07-11 17:08 ` Alan Cox
  2003-07-11 21:04   ` xi
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2003-07-11 17:08 UTC (permalink / raw)
  To: xi; +Cc: Linux Kernel Mailing List

On Gwe, 2003-07-11 at 18:02, xi wrote:
> Now I have done some investigations, and I think I have found the 
> problem: It has appeared between kernel-2.4.18-pre9 and kernel-2.4.18-rc1
> If I am not wrong, between these two versions, Alan Cox did a change in 
> drivers/pci/quirks.c and this is this change which cause the problem.

As I read the documentation the other change is also required in this
situation to avoid a chipset lockup. It might be worth you rechecking
the AMD errata docs for 762/768 again to be sure I didnt screw up and
there are not newer rules for other revisions. 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases)
  2003-07-11 17:08 ` AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases) Alan Cox
@ 2003-07-11 21:04   ` xi
  2003-07-11 21:37     ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: xi @ 2003-07-11 21:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alan Cox

Alan Cox wrote:
> On Gwe, 2003-07-11 at 18:02, xi wrote:
> 
>>Now I have done some investigations, and I think I have found the 
>>problem: It has appeared between kernel-2.4.18-pre9 and kernel-2.4.18-rc1
>>If I am not wrong, between these two versions, Alan Cox did a change in 
>>drivers/pci/quirks.c and this is this change which cause the problem.
> 
> 
> As I read the documentation the other change is also required in this
> situation to avoid a chipset lockup. It might be worth you rechecking
> the AMD errata docs for 762/768 again to be sure I didnt screw up and
> there are not newer rules for other revisions. 
> 

Ok, I have rechecked the errata docs. I have not found any 
recommandation change for PCI compliance configuration registers.

And one interesting thing:
in the AMD762 datasheet (24462.pdf) page 231 (Recommanded BIOS 
settings), I can see this: "Numerical Values shown with h or b are 
preferred settings." ; and AMD recommand this:
-> set bits 2 and 1 of register 0x4C to "0b"
-> set bits 23 and 3 respectively to "0b" and "1b"

I can confirm that these settings works much more better, even if they 
don't exactly follow PCI specs. And I don't think this is specific to my 
  cards since I have tested others.
Furthermore, my AMD762 is revision B1 (just before the last one: C0), 
and my AMD768 revision is B2, the last one.

Would you accept I make a patch which doesn't make any change in these 
registers at least up to AMD762 revision B1 (ie keeping recommanded 
values from AMD) ?
Or could you propose an other solution ?


Regards,
					Xavier

-- 
E-mail:
ctrl.alt.sup@free.fr xizard@chez.com
Please no longer use xizard@enib.fr, this e-mail will be removed soon.

Homepage:
http://xizard.free.fr
http://www.chez.com/xizard/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases)
  2003-07-11 21:04   ` xi
@ 2003-07-11 21:37     ` Alan Cox
  2003-07-12  5:08       ` [PATCH] " xi
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Cox @ 2003-07-11 21:37 UTC (permalink / raw)
  To: xi; +Cc: Linux Kernel Mailing List

On Gwe, 2003-07-11 at 22:04, xi wrote:
> And one interesting thing:
> in the AMD762 datasheet (24462.pdf) page 231 (Recommanded BIOS 
> settings), I can see this: "Numerical Values shown with h or b are 
> preferred settings." ; and AMD recommand this:
> -> set bits 2 and 1 of register 0x4C to "0b"
> -> set bits 23 and 3 respectively to "0b" and "1b"
> 
> I can confirm that these settings works much more better, even if they 
> don't exactly follow PCI specs. And I don't think this is specific to my 
>   cards since I have tested others.
> Furthermore, my AMD762 is revision B1 (just before the last one: C0), 
> and my AMD768 revision is B2, the last one.
> 
> Would you accept I make a patch which doesn't make any change in these 
> registers at least up to AMD762 revision B1 (ie keeping recommanded 
> values from AMD) ?

Lets try the AMD recommended settings. My old doc doesnt seem to have
those. I'll by happy to trial the patch in -ac and see if it plays up
the usual suspects for PCI spec violations (tg3 and i2o)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases)
  2003-07-11 21:37     ` Alan Cox
@ 2003-07-12  5:08       ` xi
  2003-07-13  8:13         ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: xi @ 2003-07-12  5:08 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

Alan Cox wrote:
> On Gwe, 2003-07-11 at 22:04, xi wrote:
> 
>>And one interesting thing:
>>in the AMD762 datasheet (24462.pdf) page 231 (Recommanded BIOS 
>>settings), I can see this: "Numerical Values shown with h or b are 
>>preferred settings." ; and AMD recommand this:
>>-> set bits 2 and 1 of register 0x4C to "0b"
>>-> set bits 23 and 3 respectively to "0b" and "1b"
>>
>>I can confirm that these settings works much more better, even if they 
>>don't exactly follow PCI specs. And I don't think this is specific to my 
>>  cards since I have tested others.
>>Furthermore, my AMD762 is revision B1 (just before the last one: C0), 
>>and my AMD768 revision is B2, the last one.
>>
>>Would you accept I make a patch which doesn't make any change in these 
>>registers at least up to AMD762 revision B1 (ie keeping recommanded 
>>values from AMD) ?
> 
> 
> Lets try the AMD recommended settings. My old doc doesnt seem to have
> those. I'll by happy to trial the patch in -ac and see if it plays up
> the usual suspects for PCI spec violations (tg3 and i2o)
> 

Ok, I provide two patchs with different behaviour:

* patch_AMD762_PCI_compliance_set_by_bios.diff : lets the BIOS decide 
about PCI configuration

* patch_AMD762_PCI_default_AMD_settings.diff : follow AMD 
recommendations but not PCI specs.

Patch are against drivers/pci/quirks.c from 2.4.22-pre4

Regards,
				Xavier

-- 
E-mail:
ctrl.alt.sup@free.fr xizard@chez.com
Please no longer use xizard@enib.fr, this e-mail will be removed soon.

Homepage:
http://xizard.free.fr
http://www.chez.com/xizard/

[-- Attachment #2: patch_AMD762_PCI_compliance_set_by_bios.diff --]
[-- Type: text/plain, Size: 1411 bytes --]

--- quirks_original.c	2003-07-12 01:58:17.000000000 +0000
+++ quirks.c	2003-07-12 04:40:57.000000000 +0000
@@ -464,22 +464,23 @@
  * Following the PCI ordering rules is optional on the AMD762. I'm not
  * sure what the designers were smoking but let's not inhale...
  *
- * To be fair to AMD, it follows the spec by default, its BIOS people
- * who turn it off!
+ * In fact, AMD even recommends to don't follow PCI standards
+ * in the section "Recommended BIOS settings" of the datasheet
  */
  
 static void __init quirk_amd_ordering(struct pci_dev *dev)
 {
-	u32 pcic;
-	pci_read_config_dword(dev, 0x4C, &pcic);
-	if((pcic&6)!=6)
+	u32 pcic1,pcic2;
+
+	pci_read_config_dword(dev, 0x4C, &pcic1);
+	pci_read_config_dword(dev, 0x84, &pcic2);
+
+	if((pcic1&6)!=6 || (pcic2&(1<<23))!=(1<<23))
 	{
-		pcic |= 6;
-		printk(KERN_WARNING "BIOS failed to enable PCI standards compliance, fixing this error.\n");
-		pci_write_config_dword(dev, 0x4C, pcic);
-		pci_read_config_dword(dev, 0x84, &pcic);
-		pcic |= (1<<23);	/* Required in this mode */
-		pci_write_config_dword(dev, 0x84, pcic);
+		/* The AMD762 doesn't follow PCI standards, but it seems to work better in this mode !
+		   In order to be fully PCI standards compliant, we should :
+		   set bit 1 and 2 of register 0x4C ; set bit 23 and clear bit 3 of register 0x84 */
+		printk(KERN_WARNING "BIOS didn't enabled PCI standards compliance.\n");
 	}
 }
 

[-- Attachment #3: patch_AMD762_PCI_default_AMD_settings.diff --]
[-- Type: text/plain, Size: 1146 bytes --]

--- quirks_original.c	2003-07-12 01:58:17.000000000 +0000
+++ quirks.c	2003-07-12 04:44:02.000000000 +0000
@@ -464,23 +464,24 @@
  * Following the PCI ordering rules is optional on the AMD762. I'm not
  * sure what the designers were smoking but let's not inhale...
  *
- * To be fair to AMD, it follows the spec by default, its BIOS people
- * who turn it off!
+ * In fact, AMD even recommends to don't follow PCI standards
+ * in the section "Recommended BIOS settings" of the datasheet
  */
  
 static void __init quirk_amd_ordering(struct pci_dev *dev)
 {
 	u32 pcic;
+
+	printk(KERN_WARNING "Setting AMD recommended values for PCI bus. It isn't fully PCI standards compliant\n");
+
 	pci_read_config_dword(dev, 0x4C, &pcic);
-	if((pcic&6)!=6)
-	{
-		pcic |= 6;
-		printk(KERN_WARNING "BIOS failed to enable PCI standards compliance, fixing this error.\n");
+	pcic &= ~((u32)6);
 		pci_write_config_dword(dev, 0x4C, pcic);
+
 		pci_read_config_dword(dev, 0x84, &pcic);
-		pcic |= (1<<23);	/* Required in this mode */
+	pcic &= ~((u32)(1<<23));
+	pcic |= (1<<3);
 		pci_write_config_dword(dev, 0x84, pcic);
-	}
 }
 
 #ifdef CONFIG_X86_IO_APIC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases)
  2003-07-12  5:08       ` [PATCH] " xi
@ 2003-07-13  8:13         ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2003-07-13  8:13 UTC (permalink / raw)
  To: xi; +Cc: Linux Kernel Mailing List

On Sad, 2003-07-12 at 06:08, xi wrote:
> * patch_AMD762_PCI_compliance_set_by_bios.diff : lets the BIOS decide 
> about PCI configuration

Breaks i2o with a 1004 BIOS on the ASUS dual athlon setup
> 
> * patch_AMD762_PCI_default_AMD_settings.diff : follow AMD 
> recommendations but not PCI specs.

Looks better



^ permalink raw reply	[flat|nested] 6+ messages in thread

* AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases)
@ 2003-07-11 16:54 xi
  0 siblings, 0 replies; 6+ messages in thread
From: xi @ 2003-07-11 16:54 UTC (permalink / raw)
  To: linux-kernel

Hello,

I wrote some month ago about a problem with last kernel release. The 
thread is accessible here: 
http://marc.theaimsgroup.com/?l=linux-kernel&m=103875989402489&w=2
To sum-up the problem: I have a tyan tiger MPX with AMD762 and AMD768 
chipsets. With latest kernel releases, every time I listen music and 
that something appens on my screen (moving a window, watching a movie) 
the sound stutter. The problem occurs whatever the soundcard and the 
graphic card is. But the problem didn't occured with older kernel 
releases like 2.4.8. I received tons of advices, but none was working.

Now I have done some investigations, and I think I have found the 
problem: It has appeared between kernel-2.4.18-pre9 and kernel-2.4.18-rc1
If I am not wrong, between these two versions, Alan Cox did a change in 
drivers/pci/quirks.c and this is this change which cause the problem.

*** Before the change we got:

static void __init quirk_amd_ordering(struct pci_dev *dev)
{
           u32 pcic;

           pci_read_config_dword(dev, 0x42, &pcic);
           if((pcic&2)==0)
           {
                   pcic |= 2;
                   printk(KERN_WARNING "BIOS disabled PCI ordering 
compliance, so we enabled it again.\n");
                   pci_write_config_dword(dev, 0x42, pcic);
           }
}


*** After the change we got:

/*
    * Following the PCI ordering rules is optional on the AMD762. I'm not
    * sure what the designers were smoking but let's not inhale...
    *
    * To be fair to AMD, it follows the spec by default, its BIOS people
    * who turn it off!
    */
static void __init quirk_amd_ordering(struct pci_dev *dev)
{
	u32 pcic;
	pci_read_config_dword(dev, 0x4C, &pcic);
	if((pcic&6)!=6)
	{
		pcic |= 6;
		printk(KERN_WARNING "BIOS failed to enable PCI standards compliance, 
fixing this error.\n");
		pci_write_config_dword(dev, 0x4C, pcic);
		pci_read_config_dword(dev, 0x84, &pcic);
		pcic |= (1<<23);        /* Required in this mode */
		pci_write_config_dword(dev, 0x84, pcic);
	}*/
}



Continuing my investigations, I have looked at the AMD762 datasheet. The 
new code which is intented to follow the PCI standards causes my 
problem! In fact with this code the system becomes completly slow, quite 
unusable.

I like the comment for the fix, but I have an other version :-)
I think AMD didn't follow the PCI specs by default (and no it's not bios 
people who turned it off, it's AMD!) because their chipsed is bogus and 
didn't work well (at all) following the specs !

I may be wrong but I don't think so. What do you think?



As for the fix, I propose to remove the quirk_amd_ordering function, or 
at least allow to don't use it. In fact the old kernels (before 
2.4.18-rc1) worked fine for me because they didn't contained this 
workaround. Old kernels contained a workaround, but it was IMHO false 
because it changed reserved and probably unassigned registers (0x42).
And note that due to this problem, I am using kernel-2.4.8 for about a 
year now, with 6 of the 7 PCI and AGP slots used, and I didn't noticed 
any instability.



I hope I was clear, and I really would like to see this problem solved.

Regards,
					Xavier IZARD

P.S. I have also tested the 2.4.22-pre4 kernel, but as it contains the 
same code, the problem is still here.


-- 
E-mail:
ctrl.alt.sup@free.fr xizard@chez.com
Please no longer use xizard@enib.fr, this e-mail will be removed soon.

Homepage:
http://xizard.free.fr
http://www.chez.com/xizard/





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-07-13  8:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3F0EED9B.4080502@enib.fr>
2003-07-11 17:08 ` AMD760MPX: bogus chispset ? (was PROBLEM: sound is stutter, sizzle with lasts kernel releases) Alan Cox
2003-07-11 21:04   ` xi
2003-07-11 21:37     ` Alan Cox
2003-07-12  5:08       ` [PATCH] " xi
2003-07-13  8:13         ` Alan Cox
2003-07-11 16:54 xi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).