Re: [PATCH 1/2] [PCI] Check that MWI bit really did get set



On Mon, 16 Oct 2006 01:02:40 +0100
Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:

Ar Sul, 2006-10-15 am 16:18 -0700, ysgrifennodd Andrew Morton:
No. If pci_set_mwi() detects an unexpected error then the driver should
take some action: report it, recover from it, fail to load, etc. If the
driver fails to do any of this then it's a buggy driver.

Wrong and there are several drivers in the kernel that are proof of
this.

Let me restore the words from my earlier email which you removed so that
you could say that:

For you the driver author to make assumptions about what's happening
inside pci_set_mwi() is a layering violation. Maybe the bridge got
hot-unplugged. Maybe the attempt to set MWI caused some synchronous PCI
error. For example, take a look at the various implementations of
pci_ops.read() around the place - various of them can fail for various
reasons.


You, the driver author _do not know_ what pci_set_mwi() does at present, on
all platforms, nor do you know what it does in the future. For you the

You don't care. It isn't an error for set_mwi to fail. In fact the only
reason set_mwi even needs to bother with a return code is that some
chips want you to set other config private to the device if it is
available and active.


Let me restore the words from my earlier email which you removed which
address that:

Now it could be that an appropriate solution is to make pci_set_mwi()
return only 0 or 1, and to generate a warning from within pci_set_mwi()
if some unexpected error happens. In which case it is legitimate for
callers to not check for errors.


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



Relevant Pages

  • Re: BDA driver, question about get properties from node
    ... Can you put the breakpoint in the driver ... Do they fail? ... > // Input pin to Output pin Topology Joints ... >>> IN PKSPROPERTY pKSProperty, ...
    (microsoft.public.development.device.drivers)
  • Re: [PATCH] Driver core: Dont ignore bus_attach_device() retval
    ... Alan Stern wrote: ... let's see why bus_attach_devicemight fail: ... It would be okay to fail in this case, because the driver would not have ... well act the same way when multithreaded probing isn't used. ...
    (Linux-Kernel)
  • Re: ADM851X USB-LAN-Adapter driver
    ... no instrument no spam DOT com> wrote: ... Windows CE 4.2 driver worked with, then there's something wrong with your ... LQRP: LM_ReceiveCompleteCE fail! ...
    (microsoft.public.windowsce.platbuilder)
  • Re: [PATCH] Driver core: Dont ignore bus_attach_device() retval
    ... It would be okay to fail in this case, because the driver would not have ... Having an unbound device is okay. ... Maybe ignoring all probe errors would be best here? ...
    (Linux-Kernel)
  • Re: Cannot restore registry
    ... | feature, follow these steps: ... When the Windows Advanced Options menu appears, ... | Feature: Device Driver Roll Back ... | Feature: System Restore ...
    (microsoft.public.windowsxp.configuration_manage)