public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "andriy.shevchenko@linux.intel.com" <andriy.shevchenko@linux.intel.com>
To: Kartik Rajput <kkartik@nvidia.com>
Cc: Jon Hunter <jonathanh@nvidia.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"robert.marko@sartura.hr" <robert.marko@sartura.hr>,
	"arnd@kernel.org" <arnd@kernel.org>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"geert+renesas@glider.be" <geert+renesas@glider.be>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"jirislaby@kernel.org" <jirislaby@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"hvilleneuve@dimonoff.com" <hvilleneuve@dimonoff.com>,
	"schnelle@linux.ibm.com" <schnelle@linux.ibm.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] serial: tegra-utc: Add driver for Tegra UART Trace Controller (UTC)
Date: Thu, 13 Feb 2025 12:57:34 +0200	[thread overview]
Message-ID: <Z63QHvayYRS0U8Ln@smile.fi.intel.com> (raw)
In-Reply-To: <88a54c9bf88dac0a3316224b08d0e2378e8fc6f0.camel@nvidia.com>

On Thu, Feb 13, 2025 at 10:11:36AM +0000, Kartik Rajput wrote:
> On Thu, 2025-02-13 at 11:55 +0200, andriy.shevchenko@linux.intel.com
> wrote:
> > On Thu, Feb 13, 2025 at 09:05:36AM +0000, Kartik Rajput wrote:
> > > On Wed, 2025-02-12 at 17:09 +0200, Andy Shevchenko wrote:
> > > > On Wed, Feb 12, 2025 at 04:11:32PM +0530, Kartik Rajput wrote:

...

> > > > > +     for (i = 0; i < len; i++) {
> > > > > +             if (!nbcon_enter_unsafe(wctxt))
> > > > > +                     break;
> > > > > +
> > > > > +             read_poll_timeout_atomic(tegra_utc_tx_readl, val,
> > > > > !(val & TEGRA_UTC_FIFO_FULL),
> > > > > +                                      0, USEC_PER_SEC, false,
> > > > > tup,
> > > > > TEGRA_UTC_FIFO_STATUS);
> > > > 
> > > > No error check?
> > > 
> > > I'm not sure about this. The case where the TX FIFO doesn't clear
> > > up,
> > > even after polling for 1 second, is highly unlikely, especially
> > > since
> > > there's no flow control involved here. Even if that did happen,
> > > writing
> > > to the TX FIFO should just result in an overflow, which is probably
> > > acceptable in this scenario.
> > 
> > Perhaps a warning (debug?) message in such a case?
> 
> I would prefer avoiding any prints in this function, as we are writing
> debug messages to the UART HW here.

Not every printf() goes to UART, but to your point the NBCON should solve that
issue to some extent. Of course, if the HW in a broken (unrecoverable) state,
nothing won't help.

> > > > > +             uart_console_write(&tup->port, wctxt->outbuf + i,
> > > > > 1,
> > > > > tegra_utc_console_putchar);
> > > > > +
> > > > > +             if (!nbcon_exit_unsafe(wctxt))
> > > > > +                     break;
> > > > > +     }

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-02-13 10:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 10:41 [PATCH v3 0/2] Add support for Tegra UART Trace Controller (UTC) client Kartik Rajput
2025-02-12 10:41 ` [PATCH v3 1/2] dt-bindings: serial: Add bindings for nvidia,tegra264-utc Kartik Rajput
2025-02-13  7:41   ` Krzysztof Kozlowski
2025-02-12 10:41 ` [PATCH v3 2/2] serial: tegra-utc: Add driver for Tegra UART Trace Controller (UTC) Kartik Rajput
2025-02-12 15:09   ` Andy Shevchenko
2025-02-13  7:38     ` Jiri Slaby
2025-02-13  8:09       ` Andy Shevchenko
2025-02-13  9:05     ` Kartik Rajput
2025-02-13  9:55       ` andriy.shevchenko
2025-02-13 10:11         ` Kartik Rajput
2025-02-13 10:57           ` andriy.shevchenko [this message]
2025-02-13 12:28             ` Kartik Rajput

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z63QHvayYRS0U8Ln@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=jirislaby@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kkartik@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robert.marko@sartura.hr \
    --cc=robh@kernel.org \
    --cc=schnelle@linux.ibm.com \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox