[PATCH 16/42]: PCI: PCI Error reporting callbacks

linas linas at austin.ibm.com
Tue Nov 8 04:55:41 EST 2005


On Mon, Nov 07, 2005 at 10:25:39AM +1100, Paul Mackerras was heard to remark:
> Greg KH writes:
> 
> > > +enum pcierr_result {
> > > +	PCIERR_RESULT_NONE=0,        /* no result/none/not supported in device driver */
> > > +	PCIERR_RESULT_CAN_RECOVER=1, /* Device driver can recover without slot reset */
> > > +	PCIERR_RESULT_NEED_RESET,    /* Device driver wants slot to be reset. */
> > > +	PCIERR_RESULT_DISCONNECT,    /* Device has completely failed, is unrecoverable */
> > > +	PCIERR_RESULT_RECOVERED,     /* Device driver is fully recovered and operational */
> > > +};
> > 
> > No, do not create new types of error or return codes.  Use the standard
> > -EFOO values.  You can document what they should each return, and mean,
> > but do not create new codes.
> 
> Actually, these are not error or return codes, but rather requested
> actions 

Yes. 

> (maybe somewhat misnamed).  

As to naming, my mind went blank on coming up with a good name,
and the results was a poor name.

I now note that "EDAC" ("Error Detection ad Correction") is now taken.

How about "PECS" ("PCI Error Correction System") ? 

I guess "PCI Error Detection And Recovery System" (PEDERAST) might
have an inappropriate set of connotations.

> We can map them on to -EFOO values
> but it will be rather strained (-ECONNRESET for "please reset the
> slot", anyone? :).

Yes, that would only lead to confusion.

> > Also, you create an enum, but yet do not use it in your function
> > callback definition, which means you really didn't want to create it in
> > the first place...
> 
> Yes, they could be #defines.

In one incarnation, they were #defines.  The enum was supposed to be 
the return value of the error notification callbacks.  

I can prepare a new patch: would you prefer:

1) lose typing: #defines and int return value?

2) strong typing: enum and enum return value?

I often prefer strong typing.

And do you want a patch now, or later?

--linas




More information about the Linuxppc64-dev mailing list