public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: hammer hsieh <hammerh0314@gmail.com>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	robh+dt@kernel.org, linux-serial@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	p.zabel@pengutronix.de, wells.lu@sunplus.com,
	"hammer.hsieh" <hammer.hsieh@sunplus.com>
Subject: Re: [PATCH v7 2/2] serial:sunplus-uart:Add Sunplus SoC UART Driver
Date: Tue, 8 Feb 2022 12:31:21 +0100	[thread overview]
Message-ID: <YgJUiegS2Cc9MyHc@kroah.com> (raw)
In-Reply-To: <CAOX-t569-0aTu73eGSY3k+btAuVgueRY91Jd5b9kbpjmxPp+Dw@mail.gmail.com>

On Tue, Feb 08, 2022 at 07:16:52PM +0800, hammer hsieh wrote:
> Jiri Slaby <jirislaby@kernel.org> 於 2022年2月8日 週二 下午2:27寫道:
> >
> > Hi,
> >
> > On 07. 02. 22, 6:58, Hammer Hsieh wrote:
> > > +static void sunplus_shutdown(struct uart_port *port)
> > > +{
> > > +     unsigned long flags;
> > > +     unsigned int isc;
> > > +
> > > +     spin_lock_irqsave(&port->lock, flags);
> > > +
> > > +     isc = readl(port->membase + SUP_UART_ISC);
> > > +     isc &= ~(SUP_UART_ISC_RXM | SUP_UART_ISC_TXM);
> >
> > Is this correct? I mean: will the SUP_UART_ISC read contain the control
> > bits, not only status bits?
> >
> 
> I assume reviewers don't like writel(0,xxx).
> So I use definition to let the code easy to read.
> The purpose is to clear all interrupt.
> Bit[3:0] status bit only for read, write 1 or 0 no effect.
> 
> > > +     writel(isc, port->membase + SUP_UART_ISC);
> > > +
> > > +     spin_unlock_irqrestore(&port->lock, flags);
> > > +
> > > +     free_irq(port->irq, port);
> >
> > I am still waiting for explanation why this is safe with respect to
> > posted writes.
> >
> 
> Actually I'm not IC designer, not expert for bus design.
> About data incoherence issue between memory bus and peripheral bus.
> In case of AXI bus, use non-posted write can avoid data incoherence issue.
> What if in case of posted write:
> Send a specific command after last write command.
> SDCTRL identify specific command, means previous write command done.
> Then send interrupt signal to interrupt controller.
> And then interrupt controller send done signal to Master.
> Master receive done signal, means write command done.
> Then issue a interrupt or proceed next write command.

But how does the kernel know when the write is completed?  The kernel
seems to ignore that here entirely, so the write could actually complete
seconds later, which would not be a good thing, right?

Traditionally, we want to ensure that a write() completes, so on some
busses, we have to do a read to ensure that the write made it to the
hardware before we can continue on.  That is not happening here which is
why Jiri keeps bringing it up.  It looks broken to us, and you need to
document it somewhere (in the changelog?  In the top of the file?) as to
why this is not needed.

thanks,

greg k-h

  reply	other threads:[~2022-02-08 11:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07  5:57 [PATCH v7 0/2] Add UART driver for Suplus SP7021 SoC Hammer Hsieh
2022-02-07  5:58 ` [PATCH v7 1/2] dt-bindings:serial:Add bindings doc for Sunplus SoC UART Driver Hammer Hsieh
2022-02-07  5:58 ` [PATCH v7 2/2] serial:sunplus-uart:Add " Hammer Hsieh
2022-02-07  7:18   ` Greg KH
2022-02-07 11:28     ` hammer hsieh
2022-02-08  6:27   ` Jiri Slaby
2022-02-08 11:16     ` hammer hsieh
2022-02-08 11:31       ` Greg KH [this message]
2022-02-09 10:53         ` hammer hsieh

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=YgJUiegS2Cc9MyHc@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hammer.hsieh@sunplus.com \
    --cc=hammerh0314@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=wells.lu@sunplus.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