Christoph Egger
2009-Jul-28 14:07 UTC
[Xen-devel] [PATCH] xen: more robust serial port driver
Hi! Attached patch adds a check if the fifo is usable before we actually use it. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Jul-28 14:15 UTC
Re: [Xen-devel] [PATCH] xen: more robust serial port driver
On 28/07/2009 15:07, "Christoph Egger" <Christoph.Egger@amd.com> wrote:> > Attached patch adds a check if the fifo is usable before we > actually use it.I count that at least the first two chunks and the initialisation of tx_fifo_size are unnecessary. Might this be the case for the udelay(100) as well? And what kinds of systems have these broken UARTs that half-advertise a broken/non-existent FIFO? -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2009-Jul-28 14:47 UTC
Re: [Xen-devel] [PATCH] xen: more robust serial port driver
On Tuesday 28 July 2009 16:15:42 Keir Fraser wrote:> On 28/07/2009 15:07, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > > Attached patch adds a check if the fifo is usable before we > > actually use it. > > I count that at least the first two chunks and the initialisation of > tx_fifo_size are unnecessary.First hunk: It looks suspicious returning a value of type void. Second hunk and initialization of tx_fifo_size: If you are sure these initializations are duplicates, then they are unnecessary.> Might this be the case for the udelay(100) as > well?No. This ensures, that the write takes effect before the read happens.> And what kinds of systems have these broken UARTs that half-advertise > a broken/non-existent FIFO?The original ns16550 has a broken FIFO. The ns16450 has no FIFO. There are simulators which simulate those old things instead of a ns16550a. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2009-Jul-28 14:58 UTC
Re: [Xen-devel] [PATCH] xen: more robust serial port driver
On 28/07/2009 15:47, "Christoph Egger" <Christoph.Egger@amd.com> wrote:>> Might this be the case for the udelay(100) as >> well? > > No. This ensures, that the write takes effect before the read happens.Can a read really overtake a write in this case? Seriously?>> And what kinds of systems have these broken UARTs that half-advertise >> a broken/non-existent FIFO? > > The original ns16550 has a broken FIFO. The ns16450 has no FIFO. > There are simulators which simulate those old things instead of a ns16550a.Hm, well, okay, the actual one line core of this patch actually seems okay to me. It''s all the rest I want to drop on the floor. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Christoph Egger
2009-Jul-28 15:03 UTC
Re: [Xen-devel] [PATCH] xen: more robust serial port driver
On Tuesday 28 July 2009 16:58:41 Keir Fraser wrote:> On 28/07/2009 15:47, "Christoph Egger" <Christoph.Egger@amd.com> wrote: > >> Might this be the case for the udelay(100) as > >> well? > > > > No. This ensures, that the write takes effect before the read happens. > > Can a read really overtake a write in this case? Seriously?In real world this can happen on embedded devices, Xen doesn''t support. In simulators, things may differ from real hw.> >> And what kinds of systems have these broken UARTs that half-advertise > >> a broken/non-existent FIFO? > > > > The original ns16550 has a broken FIFO. The ns16450 has no FIFO. > > There are simulators which simulate those old things instead of a > > ns16550a. > > Hm, well, okay, the actual one line core of this patch actually seems okay > to me. It''s all the rest I want to drop on the floor.Oh, I just noticed that there''s a missing ''__init'' in the function definition of check_existence. Please add it. Tnx. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel