GAK!!!! Re: PCI: AMD SATA IDE mode quirk
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines
Signed-off-by Crane Cai <[email protected]>Acked-by Jeff Garzik <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
Review
Quoted 7 lines
(quoted diff) +4
-2- if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp; + /* set sb600/sb700/sb800 sata to ahci mode */ + u8 tmp; + pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); + if (tmp == 0x01) {
CLASS_DEVICE is cached in pdev->class so why not simply do:
if (pdev->class & (1 << 8))
Quoted 11 lines · On Fri, 22 Feb 2008 09:48:28 +0000 Alan Cox <[email protected]> wrote:
Quoted 3 lines
Signed-off-by Crane Cai <[email protected]>Acked-by Jeff Garzik <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Vomitted-upon-by Alan Cox <[email protected]>Quoted 5 lines
(quoted diff) +2
-2- if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp; + /* set sb600/sb700/sb800 sata to ahci mode */ + u8 tmp;
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); + if (tmp == 0x01) {
CLASS_DEVICEis cached inpdev->classso why not simply do:if (pdev->class & (1 << 8))
or better yet
((pdev->class & 0xFF00) == 0x0100)
;)
--
Gnome #3319
Quoted 17 lines · Alan Cox
Quoted 14 lines · On Fri, 22 Feb 2008 09:48:28 +0000 Alan Cox <[email protected]> wrote:
Quoted 3 lines
Signed-off-by Crane Cai <[email protected]>Acked-by Jeff Garzik <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Vomitted-upon-by Alan Cox <[email protected]>Review
Quoted 7 lines
(quoted diff) +4
-2- if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp; + /* set sb600/sb700/sb800 sata to ahci mode */ + u8 tmp; + pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); + if (tmp == 0x01) {
CLASS_DEVICEis cached inpdev->classso why not simply do:
Quoted 5 lines
Quoted 1 line
if (pdev->class & (1 << 8))or better yet
((pdev->class & 0xFF00) == 0x0100)
Isn't it what was there before the change:
Quoted 2 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +0
-2- if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp;
and there was some reason to change it?
Quoted 11 lines · Alan Cox
Quoted 3 lines
Signed-off-by Crane Cai <[email protected]>Acked-by Jeff Garzik <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Vomitted-upon-by Alan Cox <[email protected]>Quoted 5 lines
(quoted diff) +2
-2- if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp; + /* set sb600/sb700/sb800 sata to ahci mode */ + u8 tmp;
Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); + if (tmp == 0x01) {
CLASS_DEVICEis cached inpdev->classso why not simply do:if (pdev->class & (1 << 8))
I agree. I [obviously] missed this when I ack'd, mainly ack'ing the overall change.
BIOS certainly may modify that PCI config register, but that's before the kernel boots. So, using pdev->class is fine.
Jeff
Quoted 19 lines · 在 2008-02-26Tue的 06:53 +0800,Jeff Garzik写道:
Quoted 11 lines · Alan Cox
Quoted 3 lines
Signed-off-by Crane Cai <[email protected]>Acked-by Jeff Garzik <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Vomitted-upon-by Alan Cox <[email protected]>Quoted 5 lines
(quoted diff) +2
-2- if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - u8 tmp; + /* set sb600/sb700/sb800 sata to ahci mode */ + u8 tmp;Quoted 6 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &tmp); + if (tmp == 0x01) {
CLASS_DEVICEis cached inpdev->classso why not simply do:if (pdev->class & (1 << 8))
Quoted 7 lines
I agree. I [obviously] missed this when I ack'd, mainly ack'ing the overall change.
BIOS certainly may modify that PCI config register, but that's before the kernel boots. So, using
pdev->classis fine.Jeff
pdev->class is also quirked when resume. We need to reread PCI configuation on resume.
Quoted 5 lines
I agree. I [obviously] missed this when I ack'd, mainly ack'ing the overall change.
BIOS certainly may modify that PCI config register, but that's before the kernel boots. So, using
pdev->classis fine.
I don't think the resume quirk is needed either as the core PCI save/restore code rewrites the PCI registers so should be rewriting the class back on resume as well.