public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Kent Yoder <key@austin.ibm.com>
Cc: linux-kernel@vger.kernel.org, marcelo@conectiva.com.br
Subject: Re: [PATCH] IBM Lanstreamer bugfixes (round 3)
Date: Mon, 04 Mar 2002 14:10:16 -0500	[thread overview]
Message-ID: <3C83C698.25D28157@mandrakesoft.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0203041230180.11370-100000@janetreno.austin.ibm.com>

Kent Yoder wrote:
>   Ok, hopefully below is the section you were referring to:
> 
> -------
> 
>   pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cls);
>   cls <<= 2;
>   if (cls != SMP_CACHE_BYTES) {
>          printk(KERN_INFO "  PCI cache line size set incorrectly "
>                 "(%i bytes) by BIOS/FW, ", cls);
>          if (cls > SMP_CACHE_BYTES)
>                 printk("expecting %i\n", SMP_CACHE_BYTES);
>          else {
>                 printk("correcting to %i\n", SMP_CACHE_BYTES);
>                 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
>                                       SMP_CACHE_BYTES >> 2);
>          }
>   }

this gets cache line size correct

>   /* Turn off Fast B2B enable */
>   pcr &= ~PCI_COMMAND_FAST_BACK;
>   /* Turn on SERR# enable and others */
>   pcr |= (PCI_COMMAND_SERR | PCI_COMMAND_INVALIDATE | PCI_COMMAND_PARITY |
>           PCI_COMMAND_IO   | PCI_COMMAND_MEMORY);
> 
>   pci_write_config_word (pdev, PCI_COMMAND, pcr);
>   pci_read_config_word (pdev, PCI_COMMAND, &pcr);

You only need to worry about the PCI_COMMAND_INVALIDATE bit here, unless
your chip requires other setup, or you care to handle PCI hard errors in
the driver.

>  Out of curiosity, does it in fact make sense to use memory write and
> invalidate and set cache line size to 0 in some cases?  This seems to go
> against the PCI spec, which, if I'm reading it correctly, says that memory
> write and invalidate is the same as a memory write, but it guarantees that
> at least 1 cache line will be written.  So, setting cacheline size =0 would
> negate this effect(?)

The rule is, never ever enable MWI if cache line size is zero.

MWI -does- make a difference in performance, though you may need to
check lanstreamer docs to see if there is a chip-specific MWI bit you
need to enable, over and above the PCI_COMMAND bit.

	Jeff


-- 
Jeff Garzik      |
Building 1024    |
MandrakeSoft     | Choose life.

  reply	other threads:[~2002-03-04 19:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-15 21:44 [PATCH] IBM Lanstreamer bugfixes (round 3) Kent Yoder
2002-02-16 11:12 ` Jeff Garzik
2002-03-04 16:51   ` Kent Yoder
2002-03-04 17:04     ` Jeff Garzik
2002-03-04 17:27       ` David Dillow
2002-03-04 17:46         ` Jeff Garzik
2002-03-04 18:45           ` David Dillow
2002-03-04 18:52             ` Jeff Garzik
2002-03-04 19:02               ` David Dillow
2002-03-04 19:12                 ` Jeff Garzik
2002-03-04 18:58       ` Kent Yoder
2002-03-04 19:10         ` Jeff Garzik [this message]
2002-03-05 14:59           ` pjd
2002-03-05 15:37           ` Kent Yoder
  -- strict thread matches above, loose matches on Subject: below --
2002-02-04 17:16 Kent Yoder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C83C698.25D28157@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=key@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox