From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations Date: Wed, 7 Aug 2019 06:00:43 -0700 Message-ID: <20190807130043.GA6023@infradead.org> References: <20190807025640.682-1-tao.zhou1@amd.com> <20190807070834.GA24792@infradead.org> <20190807104104.GA18773@infradead.org> <18cd9fa5-2d87-2f41-b5fa-927b9790287d@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <18cd9fa5-2d87-2f41-b5fa-927b9790287d@amd.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: "Koenig, Christian" Cc: "linux-arm-kernel@lists.infradead.org" , "kernel-build-reports@lists.linaro.org" , "Zhou1, Tao" , "amd-gfx@lists.freedesktop.org" , Christoph Hellwig , "broonie@kernel.org" , "linux-next@vger.kernel.org" , "Deucher, Alexander" , "akpm@linux-foundation.org" , "Li, Dennis" , "Zhang, Hawking" List-Id: amd-gfx.lists.freedesktop.org On Wed, Aug 07, 2019 at 10:55:01AM +0000, Koenig, Christian wrote: > >> Essentially writeq/readq doesn't seems to be available on all > >> architectures either. > > writeq/readq are provided whenever the CPU actually supports 64-bit > > atomic loads and stores. > > Is there a config option which we can make the driver depend on? > > I mean that ARM doesn't support 64bit atomic loads and stores on MMIO is > quite a boomer for us. The model is to cheack if readq/writeq are defined, and if not to include the one of io-64-nonatomic-hi-lo.h or io-64-nonatomic-lo-hi.h. The reason for that is that hardware is supposed to be able to deal with two 32-bit writes, but it depends on the hardware if the lower or upper half is what commits the write. The only 32-bit platform that claims support for readq/writeq is sh, and I have doubts if that actually works as expected. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF7F4C32751 for ; Wed, 7 Aug 2019 13:00:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9145021E6B for ; Wed, 7 Aug 2019 13:00:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Ab/3WIfZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387944AbfHGNAq (ORCPT ); Wed, 7 Aug 2019 09:00:46 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36386 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387801AbfHGNAq (ORCPT ); Wed, 7 Aug 2019 09:00:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OZyBmQgI8Oh6YprDHrt4RkjNg4MFHRyORK6zRT+ks5c=; b=Ab/3WIfZYR7HVsss4h5mc6Jzi KqDIiPKJOaZHXwuVH0HBIPzlkuAm+MyAsVeNrVCx6od2jt6qU+vb4dw97MeJVWJ2NHJMEqpROnzSy Dff74FQhzT0o9xuyeABC3I/B56W1TOhG3J+WfG5fa1zNABrVt+VORMXBWdot4tP6fvyGirmt0Usyw mOGXvpaS/J1kFR2PuQ1xVsnYOTFnNR6BGr9FazwCf7jY4tKwZWElQ/PBW6S3BTOxyvN8HIwBiGR94 d/5y9CUSFrNZNgnlP29Uvr+vrTIiyAOyUGN8PLw+SwCahmQVqlT34YADR0tmAo0rnjp+g4gSOczMs YYGRqN/wg==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hvLYZ-0003Jq-N1; Wed, 07 Aug 2019 13:00:43 +0000 Date: Wed, 7 Aug 2019 06:00:43 -0700 From: Christoph Hellwig To: "Koenig, Christian" Cc: Christoph Hellwig , "Zhou1, Tao" , "amd-gfx@lists.freedesktop.org" , "Deucher, Alexander" , "Zhang, Hawking" , "Li, Dennis" , "broonie@kernel.org" , "akpm@linux-foundation.org" , "linux-next@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "kernel-build-reports@lists.linaro.org" Subject: Re: [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations Message-ID: <20190807130043.GA6023@infradead.org> References: <20190807025640.682-1-tao.zhou1@amd.com> <20190807070834.GA24792@infradead.org> <20190807104104.GA18773@infradead.org> <18cd9fa5-2d87-2f41-b5fa-927b9790287d@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18cd9fa5-2d87-2f41-b5fa-927b9790287d@amd.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-next-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org On Wed, Aug 07, 2019 at 10:55:01AM +0000, Koenig, Christian wrote: > >> Essentially writeq/readq doesn't seems to be available on all > >> architectures either. > > writeq/readq are provided whenever the CPU actually supports 64-bit > > atomic loads and stores. > > Is there a config option which we can make the driver depend on? > > I mean that ARM doesn't support 64bit atomic loads and stores on MMIO is > quite a boomer for us. The model is to cheack if readq/writeq are defined, and if not to include the one of io-64-nonatomic-hi-lo.h or io-64-nonatomic-lo-hi.h. The reason for that is that hardware is supposed to be able to deal with two 32-bit writes, but it depends on the hardware if the lower or upper half is what commits the write. The only 32-bit platform that claims support for readq/writeq is sh, and I have doubts if that actually works as expected. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA89EC433FF for ; Wed, 7 Aug 2019 13:00:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CA2421BE3 for ; Wed, 7 Aug 2019 13:00:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ShC3o65w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CA2421BE3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=a22nq2mCEW/EU/FlJUEKvWHDBu6IwMhz9rTGCy+8jFA=; b=ShC3o65wBn6ZID 0RpmOXjdk/85cbtl/riV1GjpdYJqmEQcn99a3LUQmN7j79fZQ8rA78Q6arUCiGyy8QI/tGij2jOcX tEj7SaeYdM+/na+HfWuHvbtTUozpd53PTAVrH43CE7gyQAzav8k2NzWLyvhpWbLNgU3sTRRZE3IAb OCRrBDw1gg3BqE8IyxzKrihasGqdDI53b1I2A2xC7Re76a61WDtVuDLZAqEkHsbwsxZJLOGcsjmA4 46OUDOmpJdemuZHLuP6CAqTXJtoOMdjXR+XV2CuFxYiscdaO7XUZudcp4mWCsURlqI5KdR8VO05h/ DNeZqzEESFQLBk62TNTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hvLYc-0003KD-1z; Wed, 07 Aug 2019 13:00:46 +0000 Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hvLYZ-0003Jq-N1; Wed, 07 Aug 2019 13:00:43 +0000 Date: Wed, 7 Aug 2019 06:00:43 -0700 From: Christoph Hellwig To: "Koenig, Christian" Subject: Re: [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations Message-ID: <20190807130043.GA6023@infradead.org> References: <20190807025640.682-1-tao.zhou1@amd.com> <20190807070834.GA24792@infradead.org> <20190807104104.GA18773@infradead.org> <18cd9fa5-2d87-2f41-b5fa-927b9790287d@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <18cd9fa5-2d87-2f41-b5fa-927b9790287d@amd.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arm-kernel@lists.infradead.org" , "kernel-build-reports@lists.linaro.org" , "Zhou1, Tao" , "amd-gfx@lists.freedesktop.org" , Christoph Hellwig , "broonie@kernel.org" , "linux-next@vger.kernel.org" , "Deucher, Alexander" , "akpm@linux-foundation.org" , "Li, Dennis" , "Zhang, Hawking" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 07, 2019 at 10:55:01AM +0000, Koenig, Christian wrote: > >> Essentially writeq/readq doesn't seems to be available on all > >> architectures either. > > writeq/readq are provided whenever the CPU actually supports 64-bit > > atomic loads and stores. > > Is there a config option which we can make the driver depend on? > > I mean that ARM doesn't support 64bit atomic loads and stores on MMIO is > quite a boomer for us. The model is to cheack if readq/writeq are defined, and if not to include the one of io-64-nonatomic-hi-lo.h or io-64-nonatomic-lo-hi.h. The reason for that is that hardware is supposed to be able to deal with two 32-bit writes, but it depends on the hardware if the lower or upper half is what commits the write. The only 32-bit platform that claims support for readq/writeq is sh, and I have doubts if that actually works as expected. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel