Received: by 10.223.185.116 with SMTP id b49csp3517820wrg; Mon, 26 Feb 2018 01:05:17 -0800 (PST) X-Google-Smtp-Source: AH8x224DMGXkxE2YfMOi/uj5Dq7FhkfQNEz4o5rLIr9q7mqCt8UK05KKET1Wd+Z4n487RmhotwGW X-Received: by 10.98.74.67 with SMTP id x64mr9918524pfa.135.1519635917145; Mon, 26 Feb 2018 01:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519635917; cv=none; d=google.com; s=arc-20160816; b=iUVESfcyvA6JctY8CTWEkhrItDBtYrVfWh6haI0/MrRd4mx2DbRcpjd+HJJcR2D6Yn aO75wpjtBOSxp4phQ1h4KeG2ld+RzoJ987kQcthRds+byHLgBQb15J0rYY1EUmjBeECA af5KKgozg0sBXvEBxoboaiD+faEO+QzMd3B9Dx7XRm3wzuIxNuCnVUFArHVHFcjgMxyw UsorZeW3XEHHQ/vea/QQhzW2rjHG6DMhx6qT3AfVzRKzeGjbJb5gFCMiyILfb5P9UJF4 32QeDG4ivUSsldmiR9QFULjeZ1AQ0kp4XaGX+eIyl2xV7BAzAkwJzeLW6FgUujm9x5Hx oXhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=NtVa7w0GUbqSGvvgXNqgycwp88hx35ZcDeBXtyj6T44=; b=zVsVJVQ6574nIjjW7aL4RZeR7gsjbSEu/ZrmOVPjydXLZgkgoZ5gDq23hZpul8+bpg bXQJMFXlpOWINqMPeOUv8TpzCrjHl93ifdXpZ+/GAUcTzyU/sp7FAfHm+HHbVJstmsyi FTkXu2kHkLbKAseJ3pBnL6kikHitZMpLxE2opJFt9Y18swnCnPOkFLBOX4aLOFmFs2PL yMSrq/etYh/FNmucqEsRUT3Ae+cA1Zg4C63hcu1jVmI/cCm9IDYXMsFODsCaIUni/nGj NKmoGBI2CmtwW1sjxQ1q+PrzJtULAQgnmAf3rbCzOHq/REp0xcey546ugYEVAFTTQvGv nkaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oJK4teO6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si6481595pfg.246.2018.02.26.01.05.02; Mon, 26 Feb 2018 01:05:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oJK4teO6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752134AbeBZJEB (ORCPT + 99 others); Mon, 26 Feb 2018 04:04:01 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:43220 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751562AbeBZJD7 (ORCPT ); Mon, 26 Feb 2018 04:03:59 -0500 Received: by mail-qt0-f194.google.com with SMTP id d26so17931504qtk.10; Mon, 26 Feb 2018 01:03:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NtVa7w0GUbqSGvvgXNqgycwp88hx35ZcDeBXtyj6T44=; b=oJK4teO6yE4ykKBCg/rDiBTF3VfKYOKmfKwXNszNm2pXzD509FRR1vdid7hQg3GuFy jgjoUqxaSJTTgxRPFY/0YX7HwEr/F1crDRkWeW3d6o3Reu/cOaJNXjZmPcZXepoFflQn 6ZaYVso+WmiqdP2FBjNC6PguRNiclHT+FspdTgRJKkjLO+28WhQ+aajwCB7NJwBpZdya xp+vbKAWHbdOieXnFC7gHZC3OznFzsk8uXImtYf7SL+WiiYNgTscZology99+UQSOcOQ NErzoBe61EjGPLYcpVHDBShLjmNLurpy+Xo3R3qxF7PSzFNd3+gxa8jIfrZUr+1zgBNh O1dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NtVa7w0GUbqSGvvgXNqgycwp88hx35ZcDeBXtyj6T44=; b=i+PLhCgyzzIWktGLnKT39oFbXjbM64Jxlq0V8Gprh7v+AJJnHNEWM/Epeb80S7p7aM LhzBJwfqpjfZorPOSVYxtavQVNV/W//GESmV9Dh160G5KxD0qnrnPcmSXpNIpW2mKZ02 IqS1nIj0Rxcl1Q3VPRfa+//S1QaGJmL4Afeom/w9WuG/80bUCPJoqbUYoQycOM8TyH45 t5WLl7sPfEbvdfJIOzCvrjxpYgX4XDSFEwTBcRVELW9o2IzjD7zLJqPtU3TATGNl+abN IiZ2FJnaVbqpW5SFPhtK9Yg2K1s31Fs1dezB62yZLZr4FdV2lqOXcINQwnwdhHOgNVCy GkdA== X-Gm-Message-State: APf1xPA1yV5XulUqZnq4rFWDwKr5ZACUVmhhLd1ixwEbR7mqw9x3QFM+ eK3j0SaEICLk5TCeWi0AStz+9FrpJdduLmmwdNI= X-Received: by 10.200.19.202 with SMTP id i10mr16359708qtj.132.1519635838685; Mon, 26 Feb 2018 01:03:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.198.17 with HTTP; Mon, 26 Feb 2018 01:03:58 -0800 (PST) In-Reply-To: References: <20180223153700.2186058-1-arnd@arndb.de> From: Arnd Bergmann Date: Mon, 26 Feb 2018 10:03:58 +0100 X-Google-Sender-Auth: U5__SxifWfle6AtdgfKmD8mvcVk Message-ID: Subject: Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq To: Johannes Thumshirn Cc: James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" , Hannes Reinecke , linux-scsi , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 25, 2018 at 11:02 AM, Johannes Thumshirn wrote: > Arnd Bergmann writes: >> 32-bit architectures generally cannot use writeq(), so we now get a build >> failure for the lpfc driver: >> >> drivers/scsi/lpfc/lpfc_sli.c: In function 'lpfc_sli4_wq_put': >> drivers/scsi/lpfc/lpfc_sli.c:145:4: error: implicit declaration of function 'writeq'; did you mean 'writeb'? [-Werror=implicit-function-declaration] > Hi Arnd, > why can't we use the writeq() from 'io-64-nonatomic-lo-hi.h'? I always > thought these are compat versions for 32 Bit archs and even asked James > to do so, what's why he did the change in the first place. That could work as well, if someone can figure out what the correct incantation is that works on big-endian 32-bit architectures. I think the simplest version that works everywhere would be lo_hi_writeq(__le32_to_cpup(__le32 __force *)p) | (u64)__le32_to_cpup(__le32 __force *)p +1) << 32)); but this is ugly as hell and makes my head spin. I definitely would't want that applied without being tested properly first on a variety of architectures. There are three variants that I'd prefer over that: - use memcpy_toio() and change the x86 implementation to guarantee aligned word aligned accesses on the output if at all possible (which seems to be a good idea anyway) - use a loop around __raw_writeq()/__raw_writel() depending on CONFIG_64BIT - add generic memcpy_toio_32() and memcpy_toio_64() helpers in linux/io.h and use those. Arnd