Messages in this thread | | | Date | Sat, 7 Nov 1998 00:04:31 +0100 (CET) | From | Andrea Arcangeli <> | Subject | Re: [PARPORT] [patch] lp needed testers [Re: lp fix against pre-2.1.127-7] |
| |
On Fri, 6 Nov 1998, Philip Blundell wrote:
>>+ * Obsoleted the CAREFUL flag since a printer that doesn' t work with >>+ * CAREFUL will block a bit after in lp_check_status(). > >Can you explain this a bit more?
I' ll try.
Suppose that you fail in lp_char() now because LP_NO_ERROR() returned 0.
Removing LP_NO_ERROR() lp doesn't care about the error lines, but the first time that your printer will exit with 0 from lp_char() (and first or before that will happens), lp will block in lp_error() and so you would send to me a bugreport anyway ;->.
>>+ /* >>+ * Be sure that the CPU doesn' t reorder instructions. >>+ * I am not sure if it' s needed also before an outb(). >>+ * If not tell me ;-). -arca >>+ */ >>+ mb(); > >An mb() stops the *compiler* from re-ordering things. It doesn't generate any
Maybe I am interpreting things wrong, this piece of code is from asm-i386/system.h:
/* * Force strict CPU ordering. * And yes, this is required on UP too when we're talking * to devices. */ #define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
This on i386, other arch could not need this. barrier() instead avoid the _compiler_ to reorder things.
I also remeber this issue on linux-kernel some time ago (when Linus suggested people to use cpuid to implement mb(), but maybe I have understood things wrong...).
[..] >Did adding this mb() fix a problem?
No but I thought it was the right thing to do there.
Andrea Arcangeli
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |