linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Logan Gunthorpe <logang@deltatee.com>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-ntb@googlegroups.com, linux-crypto@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Arnd Bergmann" <arnd@arndb.de>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Horia Geantă" <horia.geanta@nxp.com>,
	"Logan Gunthorpe" <logang@deltatee.com>,
	"Jyri Sarha" <jsarha@ti.com>,
	"Tomi Valkeinen" <tomi.valkeinen@ti.com>,
	"David Airlie" <airlied@linux.ie>
Subject: [PATCH v10 1/8] drm/tilcdc: ensure nonatomic iowrite64 is not used
Date: Thu,  4 Jan 2018 12:16:38 -0700	[thread overview]
Message-ID: <20180104191645.10006-2-logang@deltatee.com> (raw)
In-Reply-To: <20180104191645.10006-1-logang@deltatee.com>

Add a check to ensure iowrite64 is only used if it is atomic.

It was decided in [1] that the tilcdc driver should not be using an
atomic operation (so it was left out of this patchset). However, it turns
out that through the drm code, a nonatomic header is actually included:

include/linux/io-64-nonatomic-lo-hi.h
is included from include/drm/drm_os_linux.h:9:0,
            from include/drm/drmP.h:74,
            from include/drm/drm_modeset_helper.h:26,
            from include/drm/drm_atomic_helper.h:33,
            from drivers/gpu/drm/tilcdc/tilcdc_crtc.c:19:

And thus, without this change, this patchset would inadvertantly
change the behaviour of the tilcdc driver.

[1] lkml.kernel.org/r/CAK8P3a2HhO_zCnsTzq7hmWSz5La5Thu19FWZpun16iMnyyNreQ@mail.gmail.com

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jyri Sarha <jsarha@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: David Airlie <airlied@linux.ie>
---
 drivers/gpu/drm/tilcdc/tilcdc_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_regs.h b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
index 9d528c0a67a4..5048ebb86835 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_regs.h
+++ b/drivers/gpu/drm/tilcdc/tilcdc_regs.h
@@ -133,7 +133,7 @@ static inline void tilcdc_write64(struct drm_device *dev, u32 reg, u64 data)
 	struct tilcdc_drm_private *priv = dev->dev_private;
 	volatile void __iomem *addr = priv->mmio + reg;
 
-#ifdef iowrite64
+#if defined(iowrite64) && !defined(iowrite64_is_nonatomic)
 	iowrite64(data, addr);
 #else
 	__iowmb();
-- 
2.11.0

  parent reply	other threads:[~2018-01-04 19:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 19:16 [PATCH v10 0/8] Add io{read|write}64 to io-64-atomic headers Logan Gunthorpe
2018-01-04 19:16 ` Logan Gunthorpe
2018-01-04 19:16 ` Logan Gunthorpe [this message]
2018-01-04 19:16   ` [PATCH v10 1/8] drm/tilcdc: ensure nonatomic iowrite64 is not used Logan Gunthorpe
2018-01-04 19:16 ` [PATCH v10 2/8] powerpc: io.h: move iomap.h include so that it can use readq/writeq defs Logan Gunthorpe
2018-01-04 19:16 ` [PATCH v10 3/8] powerpc: iomap.c: introduce io{read|write}64_{lo_hi|hi_lo} Logan Gunthorpe
2018-01-04 19:16   ` Logan Gunthorpe
2018-01-04 19:16 ` [PATCH v10 4/8] iomap: " Logan Gunthorpe
2018-01-04 19:16   ` Logan Gunthorpe
2018-01-04 19:16 ` [PATCH v10 5/8] io-64-nonatomic: add io{read|write}64[be]{_lo_hi|_hi_lo} macros Logan Gunthorpe
2018-01-04 19:16   ` Logan Gunthorpe
2018-01-04 19:16 ` [PATCH v10 6/8] ntb: ntb_hw_intel: use io-64-nonatomic instead of in-driver hacks Logan Gunthorpe
2018-01-04 19:16   ` Logan Gunthorpe
2018-01-04 19:16 ` [PATCH v10 7/8] crypto: caam: cleanup CONFIG_64BIT ifdefs when using io{read|write}64 Logan Gunthorpe
2018-01-04 19:16   ` Logan Gunthorpe
2018-01-05  8:01   ` Horia Geantă
2018-01-05  8:01     ` Horia Geantă
2018-01-04 19:16 ` [PATCH v10 8/8] ntb: ntb_hw_switchtec: Cleanup 64bit IO defines to use the common header Logan Gunthorpe

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=20180104191645.10006-2-logang@deltatee.com \
    --to=logang@deltatee.com \
    --cc=airlied@linux.ie \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=horia.geanta@nxp.com \
    --cc=jsarha@ti.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-ntb@googlegroups.com \
    --cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).