Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1050641imm; Fri, 8 Jun 2018 09:12:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIbhx8aUGgJnjPQTD6hMUWP+f0HSjOIId3PET6NdN4COe4cSugEVnVGlWkCIIIxI8StcmuP X-Received: by 2002:a17:902:543:: with SMTP id 61-v6mr7281766plf.47.1528474332747; Fri, 08 Jun 2018 09:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528474332; cv=none; d=google.com; s=arc-20160816; b=HAwM4qKIqPS/2rkOMCE93rZZrk6lzCkNyxsrfJUjMUEXH1n5pbu4x/B1eL/ZfYw2jK nTCRIMJmRmuVR07yczqr/+DJL5HeEVa+6SW2wTkRGFdzVa/5Jqxsv8ntL67eGtPyK+5D fPlMJm78TfxVsCPtKLa01wjkjtphaNd+9QVBPpusXwpzFDLJE3zstX2Ru6fcS1fyz84O JOz7ECJA2pm36QXm8Hi3KQg6JVfXF5/Tz2BPAiSjSeGhJWu2L8poZdlLLxrYUe8ZZO5Q wkm+AybDqpged4uJtdc5eKhd3W3LUpZai24knJwPwros22CkmEIS2sogypsGUF1X8p/+ 5vNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=pJ0t2vdRs/M9bCBtLpJpa7YF/2TnOMrTgAp3/2gKr7I=; b=Ng4Ee8Zj6bJke5W4/oZ2XD54qp8WoMuWowKUIVTTdXd06/RzEgsnHTQ4SNKS2j5fyi k1gNsEI99ueYz3VNSNY4TAJzpBWTqgheJGym1/HO6HDAxPlylFWuBcMVDd0LLkO1I+li rzGlfxA6EDqFqzsMgwDI1rnuowke+5TcH1acwFNlWL4dllkYJtdt7kvTt6gMBfqy7qO6 ggf4KC2VM7tI5B99nLLYP44UVev6aInVsAZBdtp6rI+QVAJwJimHsbdLxJrJ6eSv4VKa W9jOeCw0XZSkD8nP5tnOHawGqNSVCSXNUr/BtwC+lgFkZ/PZBw56P2MatE41uynBsXQx 72xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SDAYJC8u; dkim=pass header.i=@codeaurora.org header.s=default header.b=Npt8vMru; 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 w28-v6si19071744pge.329.2018.06.08.09.11.58; Fri, 08 Jun 2018 09:12:12 -0700 (PDT) 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=pass header.i=@codeaurora.org header.s=default header.b=SDAYJC8u; dkim=pass header.i=@codeaurora.org header.s=default header.b=Npt8vMru; 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 S1752676AbeFHQKk (ORCPT + 99 others); Fri, 8 Jun 2018 12:10:40 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57942 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbeFHQKj (ORCPT ); Fri, 8 Jun 2018 12:10:39 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E6A3B608C9; Fri, 8 Jun 2018 16:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528474238; bh=sfu+Yx/2pXQkzZRmia9D5zoeuv/OOxoIDYzRsx7mP0Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=SDAYJC8ufKghUctIvNH35srb7nZ5aFJpZYE5QSEPo7fJFExYQ4REqfRclk/U1D77A j1SLwHegik700lw+3ZPFUIzVmPf/wLt3xzF4lgXALQrZohtOvl1szDkzZJyZu8fcJA oqolVdLB159h98VxVkMHb6h6NSO6n8DCJLMy8Jss= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.106] (cpe-174-109-247-98.nc.res.rr.com [174.109.247.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5F894606FA; Fri, 8 Jun 2018 16:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528474237; bh=sfu+Yx/2pXQkzZRmia9D5zoeuv/OOxoIDYzRsx7mP0Q=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Npt8vMru8N9BrOOWjDiPmd5wM9OkRlkL1QGUVzXT3RLs6Gc94P7Rh8gYSELGGgjXS db3CdLl56lV2MnuYGj8eDG8gEcIxw294sQhVuzFVi1uUcxicFy/wr4NMrSEIa1+4YM RzpkrOI1MvnS7RQIdTG7DeCiWQYK2StVBlFrRcc8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5F894606FA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH] scsi: ipr: fix build on 32-bit architectures To: Arnd Bergmann Cc: Brian King , "James E.J. Bottomley" , "Martin K. Petersen" , Kees Cook , Hannes Reinecke , Souptick Joarder , Wen Xiong , Bart Van Assche , linux-scsi , Linux Kernel Mailing List , Will Deacon References: <20180608144617.2900894-1-arnd@arndb.de> <04758f3a-0f03-4fe9-6eb8-10ebb2430a98@codeaurora.org> From: Sinan Kaya Message-ID: <830c2468-293c-385c-0b91-c96bedae4d4a@codeaurora.org> Date: Fri, 8 Jun 2018 12:10:35 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/8/2018 11:47 AM, Arnd Bergmann wrote: > On Fri, Jun 8, 2018 at 5:27 PM, Sinan Kaya wrote: >> +Will, >> [snip] >> So, it is difficult to judge how this barrier has been used without an >> expert opinion. >> >> Changing >> >> wmb() + writel() >> >> to >> >> wmb() + writel_relaxed() >> >> is safer than dropping the wmb() altogether. > > If the wmb() was not just about the writeq() then I would argue your patch > description was misleading. We certainly shouldn't replace random writeq() > calls with writeq_relaxed() just because we can show that the driver has > a barrier in front of it. > > In particular, the ipr_mask_and_clear_interrupts() function has multiple > writeq() or writel() calls, and even a readl() and your patch only changes > one of them, which seems like a rather pointless exercise as the function > still fully synchronizes the I/O multiple times. You are right, I only searched wmb() + writel() combinations. Changed only the places where I found issues. We were given a direction to go to eliminating barriers direction as you already noted. I just wanted to highlight the difficulty of wholesale dropping of wmb() without careful inspection. [1] [2] We certainly need a better patch that covers all use cases. Your patch is a step in the good direction. We just need some attention from the maintainer that we are not actually breaking something. > >> Will Deacon should probably look at why writeq_relaxed is missing on some ARM >> arches too. >> >> Drivers shouldn't worry about write derivatives. > > This driver defines writeq() itself for architectures that don't have it, but > it doesn't define writeq_relaxed() and doesn't include > linux/io-64-nonatomic-lo-hi.h > or linux/io-64-nonatomic-hi-lo.h. It seems that it needs a different behavior > from all other drivers here, storing the upper 32 bits into the lower > address and > the lower 32 bits into the upper address. I don't think there is a consensus about using these includes in the community. I bumped into this issue before and came up with an include you pointed. I didn't get too much enthusiasm from the maintainer. Why are we pushing the responsibility into the drivers? I'd think that architecture should take care of this. Is there a portability issue that I'm missing from some architecture I never heart of? (I work on Little-Endian machines most of the time) [1] https://patchwork.kernel.org/patch/10301861/ [2] https://www.mail-archive.com/netdev@vger.kernel.org/msg227443.html > > Arnd > -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.