linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: L H <swdevgid@gmail.com>
To: jg1.han@samsung.com, amurray@embedded-bits.co.uk
Cc: linux-pci <linux-pci@vger.kernel.org>
Subject: designware: Safety of sharing iATU entries between cfg0 & mem, cfg1 & I/O?
Date: Fri, 10 Oct 2014 09:21:23 -0500	[thread overview]
Message-ID: <CAA8O7Cqry5=n0SLNB2+cfhQDMch2ujkCwJ95nfEtDjJ4gn2ndA@mail.gmail.com> (raw)

Can someone please explain how the sharing of iATUs between cfg0 and
mem accesses, and cfg1 and I/O accesses can operate safely with
concurrent operations?

I read in dw_pcie_[rd|wr]_other_conf() that the code invokes the
dw_pcie_prog_viewport_XXXX() functions to reprogram the iATU entries.
Both cfg0 and memory regions are mapped alternately by
PCIE_ATU_REGION_INDEX0, and both cfg1 and I/O regions are mapped
alternately by PCIE_ATU_REGION_INDEX1.  I noted in the git log that a
previously coded lock was deemed unnecessary and removed around config
operations, but I haven't identified any logic that protects the
possibility of a driver say performing a memory operation while
another is issuing a config.  It would seem to me that there's a small
window of opportunity that the driver performing a memory operation
could have its iATU entry pulled out from underneath it if
concurrently another driver was performing a config operation.

Is there something higher up the call stack, or scheduling-wise, that
prevents this from occurring?

thanks,
LH

                 reply	other threads:[~2014-10-10 14:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAA8O7Cqry5=n0SLNB2+cfhQDMch2ujkCwJ95nfEtDjJ4gn2ndA@mail.gmail.com' \
    --to=swdevgid@gmail.com \
    --cc=amurray@embedded-bits.co.uk \
    --cc=jg1.han@samsung.com \
    --cc=linux-pci@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).