LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* GAK!!!! Re: PCI: AMD SATA IDE mode quirk
[not found] <200802220059.m1M0xgjZ022717@hera.kernel.org>
@ 2008-02-22 9:48 ` Alan Cox
2008-02-22 10:02 ` Alan Cox
2008-02-25 22:53 ` Jeff Garzik
0 siblings, 2 replies; 6+ messages in thread
From: Alan Cox @ 2008-02-22 9:48 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: torvalds, jeff
> Signed-off-by: Crane Cai <crane.cai@amd.com>
> Acked-by: Jeff Garzik <jeff@garzik.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Vomitted-upon-by: Alan Cox <alan@redhat.com>
> - 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))
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAK!!!! Re: PCI: AMD SATA IDE mode quirk
2008-02-22 9:48 ` GAK!!!! Re: PCI: AMD SATA IDE mode quirk Alan Cox
@ 2008-02-22 10:02 ` Alan Cox
2008-02-22 10:34 ` Jiri Slaby
2008-02-25 22:53 ` Jeff Garzik
1 sibling, 1 reply; 6+ messages in thread
From: Alan Cox @ 2008-02-22 10:02 UTC (permalink / raw)
To: Alan Cox; +Cc: Linux Kernel Mailing List, torvalds, jeff
On Fri, 22 Feb 2008 09:48:28 +0000
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> > Signed-off-by: Crane Cai <crane.cai@amd.com>
> > Acked-by: Jeff Garzik <jeff@garzik.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> Vomitted-upon-by: Alan Cox <alan@redhat.com>
>
> > - 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))
or better yet
((pdev->class & 0xFF00) == 0x0100)
;)
--
Gnome #3319
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAK!!!! Re: PCI: AMD SATA IDE mode quirk
2008-02-22 10:02 ` Alan Cox
@ 2008-02-22 10:34 ` Jiri Slaby
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Slaby @ 2008-02-22 10:34 UTC (permalink / raw)
To: Alan Cox; +Cc: Linux Kernel Mailing List, torvalds, jeff
On 02/22/2008 11:02 AM, Alan Cox wrote:
> On Fri, 22 Feb 2008 09:48:28 +0000
> Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
>>> Signed-off-by: Crane Cai <crane.cai@amd.com>
>>> Acked-by: Jeff Garzik <jeff@garzik.org>
>>> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>> Vomitted-upon-by: Alan Cox <alan@redhat.com>
>>
>>> - 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))
>
> or better yet
>
> ((pdev->class & 0xFF00) == 0x0100)
Isn't it what was there before the change:
>>> - if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) {
>>> - u8 tmp;
and there was some reason to change it?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAK!!!! Re: PCI: AMD SATA IDE mode quirk
2008-02-22 9:48 ` GAK!!!! Re: PCI: AMD SATA IDE mode quirk Alan Cox
2008-02-22 10:02 ` Alan Cox
@ 2008-02-25 22:53 ` Jeff Garzik
2008-02-26 2:15 ` Crane Cai
2008-02-26 12:45 ` Alan Cox
1 sibling, 2 replies; 6+ messages in thread
From: Jeff Garzik @ 2008-02-25 22:53 UTC (permalink / raw)
To: Alan Cox; +Cc: Linux Kernel Mailing List, torvalds, Cai, Crane
Alan Cox wrote:
>> Signed-off-by: Crane Cai <crane.cai@amd.com>
>> Acked-by: Jeff Garzik <jeff@garzik.org>
>> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> Vomitted-upon-by: Alan Cox <alan@redhat.com>
>
>> - 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))
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAK!!!! Re: PCI: AMD SATA IDE mode quirk
2008-02-25 22:53 ` Jeff Garzik
@ 2008-02-26 2:15 ` Crane Cai
2008-02-26 12:45 ` Alan Cox
1 sibling, 0 replies; 6+ messages in thread
From: Crane Cai @ 2008-02-26 2:15 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Alan Cox, Linux Kernel Mailing List, torvalds
在 2008-02-26Tue的 06:53 +0800,Jeff Garzik写道:
> Alan Cox wrote:
> >> Signed-off-by: Crane Cai <crane.cai@amd.com>
> >> Acked-by: Jeff Garzik <jeff@garzik.org>
> >> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> >
> > Vomitted-upon-by: Alan Cox <alan@redhat.com>
> >
> >> - 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))
>
> 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
pdev->class is also quirked when resume. We need to reread PCI
configuation on resume.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: GAK!!!! Re: PCI: AMD SATA IDE mode quirk
2008-02-25 22:53 ` Jeff Garzik
2008-02-26 2:15 ` Crane Cai
@ 2008-02-26 12:45 ` Alan Cox
1 sibling, 0 replies; 6+ messages in thread
From: Alan Cox @ 2008-02-26 12:45 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Linux Kernel Mailing List, torvalds, Cai, Crane
> 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.
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-02-26 12:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200802220059.m1M0xgjZ022717@hera.kernel.org>
2008-02-22 9:48 ` GAK!!!! Re: PCI: AMD SATA IDE mode quirk Alan Cox
2008-02-22 10:02 ` Alan Cox
2008-02-22 10:34 ` Jiri Slaby
2008-02-25 22:53 ` Jeff Garzik
2008-02-26 2:15 ` Crane Cai
2008-02-26 12:45 ` Alan Cox
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).