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 03:41:04 -0700 Message-ID: <20190807104104.GA18773@infradead.org> References: <20190807025640.682-1-tao.zhou1@amd.com> <20190807070834.GA24792@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: 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 08:53:25AM +0000, Koenig, Christian wrote: > Am 07.08.19 um 09:08 schrieb Christoph Hellwig: > > On Wed, Aug 07, 2019 at 10:56:40AM +0800, Tao Zhou wrote: > >> readq/writeq are not supported on all architectures > > NAK. You must not use atomic_* on __iomem (MMIO) memory. > > Well then what's the right thing to do here? > > 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. If it doesn't provide them atomic64* is not going to be atomic vs the I/O device either. And that is on top of the fact that for various architectures you can't simply use plain loads and stores on MMIO memory to start with, which is why we have the special accessors and the __iomem annotation. 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 20995C32751 for ; Wed, 7 Aug 2019 10:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EA7D321E6A for ; Wed, 7 Aug 2019 10:41:07 +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="M4APjbqJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728834AbfHGKlH (ORCPT ); Wed, 7 Aug 2019 06:41:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34072 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728592AbfHGKlH (ORCPT ); Wed, 7 Aug 2019 06:41:07 -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=fgf3H+Zny8XhFzIqJuO3eRIYcYBD/cE5mEO7YezNCWA=; b=M4APjbqJ0KcEZaaq7eaKKLLjB 3qR1Ix9nfDpAOsONHfaWUoJNlSIz6ncmztBvkszadaXMzImR35TurTfE4ZsO3HVfvg3Zc3sZ8Lm6Q VMzkk7QbX82KOBsYvylli2YuzzzNlvH+L8rqN7zIk01shyDTscwPjDSow9Q8+dEb3Fd6coTSfSYxN FsLJ7EgIGqjtte30NHp0ZrpoOmk3JIm4Eh34LPCmzfq9X6IIiVv4hC6MQ3xxEayzpTTz1mNkMg70z F4xwiMvPQe6gbgl3/FAdL9YPBeihfcwAEDwdKGVVBkthGgtAu3audlX+JiWolwHbnOMYohTaoVpEv FUBctJ4lQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hvJNQ-0006tJ-Sh; Wed, 07 Aug 2019 10:41:04 +0000 Date: Wed, 7 Aug 2019 03:41:04 -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: <20190807104104.GA18773@infradead.org> References: <20190807025640.682-1-tao.zhou1@amd.com> <20190807070834.GA24792@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 08:53:25AM +0000, Koenig, Christian wrote: > Am 07.08.19 um 09:08 schrieb Christoph Hellwig: > > On Wed, Aug 07, 2019 at 10:56:40AM +0800, Tao Zhou wrote: > >> readq/writeq are not supported on all architectures > > NAK. You must not use atomic_* on __iomem (MMIO) memory. > > Well then what's the right thing to do here? > > 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. If it doesn't provide them atomic64* is not going to be atomic vs the I/O device either. And that is on top of the fact that for various architectures you can't simply use plain loads and stores on MMIO memory to start with, which is why we have the special accessors and the __iomem annotation. 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,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 705F6C433FF for ; Wed, 7 Aug 2019 10:41:07 +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 4469F21E70 for ; Wed, 7 Aug 2019 10:41:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rFbK0KQo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4469F21E70 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=mrSWkv3sxDOYDx5gYUQDUuvtgY3h1JqbcJDPXq+FnSs=; b=rFbK0KQoFWbnt2 hx5yHYFhslZSeLiFsJZwBGOyNuAjqoxrhkpvjDRO4WBYvkjOE34eeJZHQ/mk36VnPmyDzSoGiOyV/ 9iwtcf/Bwar2BGMJdwHhJD7kWDouWvzOfpS4UG34JzAeW5XToyjCXLUyvDK3KDvjgunw8f43suYir 5cugGsyn1mVXYSeZEeDyVS9NYgulX/38icwwOTf2YjC/DsPTMOCNG/mmdy09ukSSWL2pVp3rHAoRz XGw7qQTBuW82xXJYWW/nXLf8cP/xVwEiozp4H3a3VB3ByAOoSD7Xf5u7rQ5y5J90gjgZP+uefqVVp oaLgMdAqYMBo5cpcw8+A==; 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 1hvJNS-0006tf-Lf; Wed, 07 Aug 2019 10:41:06 +0000 Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hvJNQ-0006tJ-Sh; Wed, 07 Aug 2019 10:41:04 +0000 Date: Wed, 7 Aug 2019 03:41:04 -0700 From: Christoph Hellwig To: "Koenig, Christian" Subject: Re: [PATCH] drm/amdgpu: replace readq/writeq with atomic64 operations Message-ID: <20190807104104.GA18773@infradead.org> References: <20190807025640.682-1-tao.zhou1@amd.com> <20190807070834.GA24792@infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 08:53:25AM +0000, Koenig, Christian wrote: > Am 07.08.19 um 09:08 schrieb Christoph Hellwig: > > On Wed, Aug 07, 2019 at 10:56:40AM +0800, Tao Zhou wrote: > >> readq/writeq are not supported on all architectures > > NAK. You must not use atomic_* on __iomem (MMIO) memory. > > Well then what's the right thing to do here? > > 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. If it doesn't provide them atomic64* is not going to be atomic vs the I/O device either. And that is on top of the fact that for various architectures you can't simply use plain loads and stores on MMIO memory to start with, which is why we have the special accessors and the __iomem annotation. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel