Bug 466422 - RHEL5.3: Modify SATA IDE mode quirk
RHEL5.3: Modify SATA IDE mode quirk
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.3
All Linux
high Severity high
: rc
: ---
Assigned To: David Milburn
Martin Jenner
: Regression
: 469140 (view as bug list)
Depends On: 432652
Blocks: 364381
  Show dependency treegraph
 
Reported: 2008-10-10 03:39 EDT by Shane Huang
Modified: 2010-10-23 01:06 EDT (History)
18 users (show)

See Also:
Fixed In Version: RHBA-2008-0314
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 14:50:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Force IDE mode to AHCI mode at S3 resume (848 bytes, patch)
2008-10-10 03:39 EDT, Shane Huang
no flags Details | Diff

  None (edit)
Description Shane Huang 2008-10-10 03:39:28 EDT
Created attachment 319985 [details]
Force IDE mode to AHCI mode at S3 resume

+++ This bug was initially created as a clone of Bug #432652 +++

AMD chipset dev, team has been moving towards unifying SB600/700/800 support.
This patch was approved by Jeff Garzik and is necessary to initialize ans set
SATA mode correctly.

http://marc.info/?l=linux-pci&m=120193321032703&w=2

--- Additional comment from bnagendr@redhat.com on 2008-02-18 12:32:21 EDT ---

This patch is a bug fix and will affect future SBs.

The bug is S3 resume failed when you put SATA disk 2nd port and set SATA
type as native IDE. The root cause is we have not correctly set
operating mode when resume. 

Is this sufficient to push it into R5.2?


--- Additional comment from rpacheco@redhat.com on 2008-02-18 14:20:52 EDT ---

We have an HP dx2450 with the SB700 that can be used for validation.

--- Additional comment from peterm@redhat.com on 2008-02-18 14:29:06 EDT ---

The system is in my office ready for testing.

--- Additional comment from bnagendr@redhat.com on 2008-02-18 16:35:45 EDT ---

Created an attachment (id=295210)
Proposed SATA IDE patch to fix resume issue

The patch for RHEL5.2 will have to include the pci_fixups_resume and
resume_early implementation.   I've attached the backport I have come 
up with so far.   


--- Additional comment from bnagendr@redhat.com on 2008-02-18 16:39:08 EDT ---

Shane, 

Please look through this patch for completeness and provide the upstream patch 
set that adds the resume and resume_early implementation. Once I have the 
complete back port done I would ask you to test on RHEL5 as well.

Also, do we need resume_early and it's counterpart suspend_late?  Or does the 
latter have no bearing to the chipset resume issue?

Ideally we want the smallest patch set necessary to fix the issue.

Regards,
Bhavana

--- Additional comment from bnagendr@redhat.com on 2008-03-14 14:30:16 EDT ---

Russ, please add the master tracker.  Just when we thought we were done with R5.2...

--- Additional comment from mjenner@redhat.com on 2008-03-14 17:08:30 EDT ---

Need the usual bullet items answered for an exception request post beta kernel:

1) business justification
2) patch status, is patch upstream
3) the intended patch attached to the bz or a clear pointer to said
4) current testing status
5) test plan

QE Can't ack without this data.


--- Additional comment from crane.cai@amd.com on 2008-03-16 21:04:38 EDT ---

Hi Bhavana,
This backport of PCI_RESUME_FIXUP is well.

(In reply to comment #5)
> Shane, 
> 
> Please look through this patch for completeness and provide the upstream patch 
> set that adds the resume and resume_early implementation. Once I have the 
> complete back port done I would ask you to test on RHEL5 as well.
> 
> Also, do we need resume_early and it's counterpart suspend_late?  Or does the 
> latter have no bearing to the chipset resume issue?
> 
> Ideally we want the smallest patch set necessary to fix the issue.
> 
> Regards,
> Bhavana



--- Additional comment from shane.huang@amd.com on 2008-03-17 04:12:02 EDT ---

upstream commit:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-
2.6.git;a=commit;h=05a7d22b9f02e7fe8fb5ff972b46743948139b3c


--- Additional comment from richard.zhao@amd.com on 2008-03-21 04:39:45 EDT ---

Created an attachment (id=298778)
ahci driver side fix patch

1) business justification
   We found the s3 resume failed issue exists in RHEL 5.2 beta. The patch is
for AMD SB600/SB700, which is already be seen in market. So it's very urgent
for us to have it be supported in RHEL5.2.

2) patch status, is patch upstream
   Upstream has accepted the patch, see Comment#9.

3) the intended patch attached to the bz or a clear pointer to said
   If we use the upstream patch, we needs back port pci_fixups_resume. But when
we back port it, we find it involve too much of power management subsystem
(resume_early). So I think it's better for redhat to back port
pci_fixups_resume.
   If pci_fixups_resume will not be back ported, we can also fix the issue on
ahci driver side. Please see the attached ahci driver side fix patch.

4) current testing status
   ahci driver side fix patch is under test by AMD QA, and will be finished in
next week.
5) test plan
   Do acpi test to check whether the issue is fixed.

--- Additional comment from bnagendr@redhat.com on 2008-03-21 11:09:39 EDT ---

Thanks Richard for the answering Martin's bulleted items.   

I want to clarify the patch that we want in RHEL5.2 a bit more.  We are
sensitive to the fact that R5.2 is post beta and want to make the least lines 
of change that would still fix the issue but not introduce a massive change.  
The upstream patch as is will need (as Richard described) resume early 
changes in the PM subsystems.  Instead we have chosen to use the existing 
AHCI resume function and adding the relevant code to that function. 

The brew build is being tested at AMD
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=1222747

The 32-bit test have completed with successful results.  The 64-bit test results
will be available Monday.  I will submit the patch to RHML after the 64-bit
results are in as well.

If there are any more questions please let us know.

--- Additional comment from bnagendr@redhat.com on 2008-03-24 15:28:40 EDT ---

Posted to RHML on Mar 24.

--- Additional comment from bnagendr@redhat.com on 2008-03-24 15:30:25 EDT ---

Both 32-bit and 64-bit test results are done and the brew build works for all
SATA ports, both native IDE and Legacy IDE.    Please provide the BZ ACKs.

--- Additional comment from dzickus@redhat.com on 2008-04-02 12:09:14 EDT ---

in kernel-2.6.18-88.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5

--- Additional comment from errata-xmlrpc@redhat.com on 2008-05-21 11:09:26 EDT ---


An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0314.html
Comment 1 Shane Huang 2008-10-10 03:43:45 EDT
REOPEN this bug for RHEL5.3 because RedHat lost this bug during the update
to sata driver, which leads to S3 resume failure again!

The patch has been attached, which was generated with kernel 2.6.18-118,
please add it ASAP. Thanks
Comment 2 Russell Doty 2008-10-10 10:45:39 EDT
Updated flags.
Comment 3 RHEL Product and Program Management 2008-10-10 10:59:19 EDT
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 4 Shane Huang 2008-10-14 01:51:14 EDT
RHEL5.3 Alpha released last week uses kernel -118, which contains the bug.
I wonder whether this bug will be fixed by RHEL5.3 Beta to be released this month?
Thanks
Comment 5 Shane Huang 2008-10-19 23:25:25 EDT
Jeff and Russell,
There is no update to this BZ these days, are you going to add the patch
to RHEL5.3 Beta? So that our QA can verify it with Beta.

Thanks
Shane
Comment 6 Shane Huang 2008-10-29 04:15:58 EDT
Issue #234266 has been created on RedHat Issue Tracker for this bug.
please check it.
Comment 7 Wade Mealing 2008-10-30 19:27:32 EDT
*** Bug 469140 has been marked as a duplicate of this bug. ***
Comment 8 Shane Huang 2008-11-13 01:49:44 EST
This patch is still missing in RHEL5.3 Snapshot2 (kernel -122),
neither the next version kernel -123, please pursue it further.
Comment 9 David Milburn 2008-11-13 20:25:31 EST
Hello Shane,

Would you please do a quick test with kernel-2.6.18-123.el5.bz466422.1? 
When updating the RHEL5.3 ahci driver I did not carry forward Bhavana's 
ahci changes that went into RHEL5.2, sorry about that. Thanks.

http://people.redhat.com/dmilburn/
Comment 10 David Milburn 2008-11-14 06:53:53 EST
Shane,

Also, do we need check for other device IDs besides 0x4380 and 0x4390,
the ahci driver supports other SB700/800 devices? Can you please provide
more details, why do we not need to check for 0x4391 thru 0x4395? 

Thanks,
David
Comment 11 Shane Huang 2008-11-16 22:57:20 EST
Hi David,

Please take a look to drivers/pci/quirks.c
static void __devinit quirk_amd_ide_mode(struct pci_dev *pdev)
{
	/* set sb600/sb700/sb800 sata to ahci mode */
	u8 tmp;
 
	pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp);
	if (tmp == 0x01) {
		pci_read_config_byte(pdev, 0x40, &tmp);
		pci_write_config_byte(pdev, 0x40, tmp|1);
		pci_write_config_byte(pdev, 0x9, 1);
		pci_write_config_byte(pdev, 0xa, 6);
		pci_write_config_byte(pdev, 0x40, tmp);

		pdev->class = PCI_CLASS_STORAGE_SATA_AHCI;
		printk(KERN_INFO "PCI: set SATA to AHCI mode\n");
	}
}

DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_amd_ide_mode);
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP700_SATA, quirk_amd_ide_mode);


This function above forces SB600/SB700 IDE mode(0x4380/0x4390) into AHCI
mode to use ahci driver. But the "force" will get lost at ACPI S3 resume,
that's why we need to create this BZ and and the fixup patch for S3 resume.

As to 0x4391~4395, they are not IDE mode, which need NOT the fixup at S3
resume of course.

Thanks,
Comment 12 Shane Huang 2008-11-17 01:59:37 EST
David,

kernel-2.6.18-123.el5.bz466422.1 can work on my SB700 platform,
please help to add the patch to RHEL5.3 kernel.


Thanks
Comment 13 David Milburn 2008-11-17 11:12:43 EST
Thank you Shane, I have submitted for internal review.
Comment 19 Don Zickus 2008-12-02 17:19:21 EST
in kernel-2.6.18-125.el5
You can download this test kernel from http://people.redhat.com/dzickus/el5
Comment 20 Shane Huang 2008-12-03 03:20:17 EST
Verified with kernel-2.6.18-125.el5, thanks.
Comment 23 errata-xmlrpc 2009-01-20 14:50:53 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2009-0225.html

Note You need to log in before you can comment on or make changes to this bug.