Re: new PCI quirk for Toshiba Satellite?

From: Stefan Richter (stefanr_at_s5r6.in-berlin.de)
Date: 10/21/05

  • Next message: Stefan Jones: "Re: [BUG][2.6.13.4] Memoryleak - idr_layer_cache slab - inotify?"
    Date:	Fri, 21 Oct 2005 22:13:07 +0200
    To: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-pci@atrey.karlin.mff.cuni.cz
    
    

    Jesse Barnes wrote:
    > Stefan, is a PCI quirk addition possible or do we have to use
    > dmi_check_system in the ohci driver itself (since we have to reprogram
    > the cache line size in addition to the other registers)?

    I am not familiar with the PCI subsystem, thus cannot advise how to
    handle it best nor wanted to post a patch myself (yet).

    [...]
    >> .callback = ohci1394_toshiba_reprogram_config,
    >> .ident = "Toshiba PSM4 based laptop",
    >> .matches = {
    >> DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
    >> DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"),
    >> },
    >> .driver_data = &tosh_data;

    It seems to me, using the .callback and .driver_data doesn't make it
    cleaner and leaner.

    > But then what about the dev->current_state = 4? Is that necessary?

    It is necessary; at least if the workaround resides in ohci1394.
    Otherwise the controller won't come back after a suspend/ resume cycle.
    (See Rob's post from February,
    http://marc.theaimsgroup.com/?m=110786495210243 ) Maybe there is another
    way to do that if the workaround was moved to pci/quirks.c.

    [...]
    > + if (toshiba) {
    > + dev->current_state = 4;
    > + pci_read_config_word(dev, PCI_CACHE_LINE_SIZE, &toshiba_data);
    > + }
    > +
    > if (pci_enable_device(dev))
    > FAIL(-ENXIO, "Failed to enable OHCI hardware");
    > pci_set_master(dev);
    >
    > + if (toshiba) {
    > + mdelay(10);
    > + pci_write_config_word(dev, PCI_CACHE_LINE_SIZE, toshiba_data);
    [...]

    pci_set_master(dev) can be moved below the second part of the Toshiba
    workaround. That means AFAIU, the 2nd part of the Toshiba workaround can
    be moved out of ohci1394 into pci_fixup_device() which is called from
    pci_enable_device(), to be called as a DECLARE_PCI_FIXUP_ENABLE hook.

    The first part of the workaround, i.e. caching the cache line size, for
    example by means of a static variable, would have to go into an
    _FIXUP_EARLY, _FIXUP_HEADER, or _FIXUP_FINAL hook. I am not sure yet
    about which type of hook to use.

    Furthermore, everything which belongs to the workaround should IMO be
    enclosed by #ifdef SOME_SENSIBLE_MACRO. This avoids kernel bloat for any
    target which is surely not a Toshiba laptop. Rob used an #if
    defined(__i386__).

    -- 
    Stefan Richter
    -=====-=-=-= =-=- =-=-=
    http://arcgraph.de/sr/
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Stefan Jones: "Re: [BUG][2.6.13.4] Memoryleak - idr_layer_cache slab - inotify?"

    Relevant Pages

    • Re: Flush SMB Cache on Windows Vista?
      ... I don't think that would be a viable workaround for us. ... the SMB cache on Windows Vista when SMB 2.0 is used for Windows ... Call _access or GetFileAttributes. ...
      (microsoft.public.win32.programmer.networks)
    • Re: Flush SMB Cache on Windows Vista?
      ... fileserver, but I imagine similar behavior would occur in Win2008 if there aren't enough CALs installed on the server. ... I don't think that would be a viable workaround for us. ... the SMB cache on Windows Vista when SMB 2.0 is used for Windows ... Call _access or GetFileAttributes. ...
      (microsoft.public.win32.programmer.networks)
    • Re: Deployed Support
      ... Some hosts also cache pages ... One other workaround is to make the browser think you are passing a variable in your links ... We push out updates for our website but the ...
      (microsoft.public.frontpage.programming)
    • Re: [SLE] Why its silly to file a bug report to Novell
      ... I helped deducing the workaround, ... Was Marcus there with Stefan? ... analyze the core file, and could finally reproduce. ... ATM is a BIOS bug, where we cannot do anything ATM (the intel driver ...
      (SuSE)
    • Re: Linux machines dieing in swap storms
      ... happily hack my kernels with a workaround if need be. ... page cache and buffer cache is really low and swap is full... ... watermark and only reclaimimn non-cache if it's below another ...
      (Linux-Kernel)