Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1237424imm; Fri, 8 Jun 2018 12:22:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIhnjMhVJRWJIL8uBvC+o5sOMlAW7vQDVfB8hnoxv5doz9Um5E/Dq4R4WI6qDJN77pRP+Lt X-Received: by 2002:a63:7a03:: with SMTP id v3-v6mr6213335pgc.285.1528485743999; Fri, 08 Jun 2018 12:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528485743; cv=none; d=google.com; s=arc-20160816; b=k7NwNUr6Brn3HgnUT/4Qe3L5FurERbS6vBsdu/fX8U2eODvb+my4wWwTHlyvYho0Kw qTBW/Y9xApW7uJP0RrvUmEdrFikA6DAKVt5BlrEWvnbWVgjPyvv70QsKQ85o9G8EMTL1 NV3brWEzF/KORGZylCcf4FOd3ZOGOrFHyDXSYt2VhozlowYwRu0IUcQUH80EPgj6pQui qwQZKchhBVWLRSgJ1K3EDnIpqHzB7qC7376S1TBND+AcvikP5n49+2FZLiwV4CIoOXuG DmQHY46FWZPSf6q+G07cYxVSUbhwTkIa9ozgH1nmweNunUV8We1AmegQt+LoXO9TiVAT 86+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject:arc-authentication-results; bh=QX7WrTPYjQWahmdYiInArIZ7FSK2AqKRSgMzyVsy1zQ=; b=PHSwlCm4maa4gyvyzIHOPDGTRi3K2PcRH5FQStQWt6Y6tF3U7RGMMM60lZ95ChVfpn 5MQuRnyqbywccGFtI6Jcj8n96kBEPyqykofVGp4oYzA9WULp3qDFNMWAU5vJI2v4RYOL ojArsuZtRyYdCVZfOa4dC5AWhX1c4dlLSK6l13LPLtQx6Yk9sdnpdj2qfB/D64Vr2Kjq SWUyUkvIjnmho/UnIbF265Q69f4L1mMY3IHRVMbiq5y8Hv+y58qj3YgNobPzNRK9UL7l h7RbA3L5TBummwpDpB9iaFiXI42gztq2H+jb3ZhYOsovuSRlZF5uh1ZApbIBPFCqwKMM uHnQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9-v6si16596454pgf.222.2018.06.08.12.22.09; Fri, 08 Jun 2018 12:22:23 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753133AbeFHTUo (ORCPT + 99 others); Fri, 8 Jun 2018 15:20:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52176 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753096AbeFHTUh (ORCPT ); Fri, 8 Jun 2018 15:20:37 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w58JJvVk091497 for ; Fri, 8 Jun 2018 15:20:37 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jfw7mx285-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 08 Jun 2018 15:20:36 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jun 2018 13:20:35 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 8 Jun 2018 13:20:31 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w58JKU1U8782186 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 8 Jun 2018 12:20:30 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13F9A6E050; Fri, 8 Jun 2018 13:20:30 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A4616E04C; Fri, 8 Jun 2018 13:20:29 -0600 (MDT) Received: from oc6034535106.ibm.com (unknown [9.10.86.185]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 8 Jun 2018 13:20:29 -0600 (MDT) Subject: Re: [PATCH] scsi: ipr: fix build on 32-bit architectures To: Sinan Kaya , 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> <830c2468-293c-385c-0b91-c96bedae4d4a@codeaurora.org> From: Brian King Date: Fri, 8 Jun 2018 14:20:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <830c2468-293c-385c-0b91-c96bedae4d4a@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 18060819-0016-0000-0000-000008ED81CB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009153; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01044101; UDB=6.00534603; IPR=6.00823139; MB=3.00021536; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-08 19:20:34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060819-0017-0000-0000-00003F2F6E02 Message-Id: <07a50fe0-0378-769a-f4eb-d39ac543dc95@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-08_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806080212 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/08/2018 11:10 AM, Sinan Kaya wrote: > 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. To be clear here, we are talking about two code paths that are not in the performance path, so attempting to performance optimize them to use lighter weight mmio accessors isn't exactly critical. I'm fine with the replacement patch from Arnd. Thanks Arnd! Acked-by: Brian King > >> >>> 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) The attributes of the adapter hardware can have an impact here. The ipr hardware, for example, depends on the upper 4 bytes to be written first, then the lower 4 bytes to be written second, and its the act of writing the lower 4 bytes that triggers the adapter hardware to read the value and take action on it. Thanks, Brian -- Brian King Power Linux I/O IBM Linux Technology Center