From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752833AbdLGQQY (ORCPT ); Thu, 7 Dec 2017 11:16:24 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:24060 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbdLGQQS (ORCPT ); Thu, 7 Dec 2017 11:16:18 -0500 Subject: Re: [PATCH v9 1/8] drm/tilcdc: ensure nonatomic iowrite64 is not used To: Logan Gunthorpe , , , , CC: Arnd Bergmann , Greg Kroah-Hartman , Andy Shevchenko , =?UTF-8?Q?Horia_Geant=c4=83?= , Tomi Valkeinen , David Airlie References: <20171205233058.5365-1-logang@deltatee.com> <20171205233058.5365-2-logang@deltatee.com> From: Jyri Sarha Message-ID: <3f3ad132-3b53-0f80-ffe7-3617e3cb78e2@ti.com> Date: Thu, 7 Dec 2017 18:15:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171205233058.5365-2-logang@deltatee.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-GB Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/06/17 01:30, Logan Gunthorpe wrote: > 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 > Reviewed-by: Andy Shevchenko > Cc: Jyri Sarha > Cc: Arnd Bergmann > Cc: Tomi Valkeinen > Cc: David Airlie I guess it is about time for me to pick this up for the next pull request. Thanks, Jyri > --- > 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(); > -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki