From owner-freebsd-arm@FreeBSD.ORG Mon Oct 7 20:36:19 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4EFAECD9; Mon, 7 Oct 2013 20:36:19 +0000 (UTC) (envelope-from zbodek@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61A242147; Mon, 7 Oct 2013 20:36:18 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id c11so7890971wgh.30 for ; Mon, 07 Oct 2013 13:36:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=FlVYaZZeloUadN3cx21BoJN+DCt5HL06Hb6/609+ZF0=; b=09dRTNBY66t4wKCEi1AVSB2jlEz1lSd5pkQ3TG0zTRzSvJdOjWEOS8X3sOrggJgLcg r4Ab1G4aDFzZOR0ZGh6gUvXu9+szEUqO7YSOBtPpiVVUyTxP5RAYNDnv4TndhilJLfmN xtVgRrIzUYs6uyR6mtiCPa2l7reOtTH1c1jsCo2UF1pRmnQrj48vIuHxauzuqk/ALFj6 +diljGJAvPRrp/fNHTUpKbGdM/PLbeeIFoOOgDtkp8GiS1P5XYxIFSKHbBiIX88hAnnN C0gYxiwBPGLXvaxYfjnMO26cpS+rk3jHtBneu0a+CjUxapTNuSR0Qu3Ko1oby+Lv3uWm 6U6g== MIME-Version: 1.0 X-Received: by 10.194.63.228 with SMTP id j4mr7512079wjs.34.1381178176735; Mon, 07 Oct 2013 13:36:16 -0700 (PDT) Sender: zbodek@gmail.com Received: by 10.216.160.70 with HTTP; Mon, 7 Oct 2013 13:36:16 -0700 (PDT) In-Reply-To: References: Date: Mon, 7 Oct 2013 22:36:16 +0200 X-Google-Sender-Auth: uyj11NzTjbvpMumKmM39MjLoboc Message-ID: Subject: Re: Changes to UART ns8250 From: Zbigniew Bodek To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-arm@freebsd.org" , freebsd-current , "freebsd-embedded@freebsd.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2013 20:36:19 -0000 Hello Adrian, Thank you for your remarks. Please check my answers in-line. Best regards Zbigniew Bodek 2013/10/7 Adrian Chadd > Hi, > > You should add: > > * a loop counter, to break out after a while; > [ZBB] In general as long as UART is busy we cannot proceed but if the timeout occurs we could return an error. Do you agree? > * a DELAY(1) or something. > [ZBB] DELAY is also a busy wait after all. The reasonable solution might be to use ns8250_delay() to get the transmission time and use it for timeout from the first point. I would DELAY(1) in each loop and decrement value acquired from ns8250_delay(). The loop should break during that time or we return an error. What do you think? > > > > -adrian > > > > On 7 October 2013 12:54, Zbigniew Bodek wrote: > >> Hello. >> >> I would like to present a patch for ns8250 serial that I would like to >> commit in the near future (if there are no objections). >> >> The patch is fixing newest DesignWare UART with busy detection. >> During frequency divisors configuration when UART is busy transferring or >> receiving data, line control register manipulation will not take effect. >> Therefore, we will not set divisor latch access bit and we will corrupt >> LCR >> instead of configuring divisors. >> It is necessary to wait until UART finishes all transfers to proceed with >> the configuration. >> >> This was detected on Armada XP as UART fails on this issue 100/100 >> attempts. >> The patch was tested by kevlo@ and me and it works on our Armada XP - >> based >> systems. >> >> Please send your comment or remarks if there are any. >> >> Best regards >> Zbigniew Bodek >> >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org >> " >> > >