Received: by 10.223.185.116 with SMTP id b49csp2230012wrg; Sat, 24 Feb 2018 14:26:00 -0800 (PST) X-Google-Smtp-Source: AH8x225tffCXVqiSHzRKQ/CGxQc9dZ3oTCwoq/XcazvVBko9GJpJKfSIOANgbB0n43Ws9zOZBmMl X-Received: by 10.98.223.143 with SMTP id d15mr5995084pfl.208.1519511160264; Sat, 24 Feb 2018 14:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519511160; cv=none; d=google.com; s=arc-20160816; b=HCT56JzoIAsD6PjEdMioI3jxcbLfAO+6EsW4VYElErdp+0Op1Ix98RpX97MyEKhB1w fLybqg11qCgPttT/wDEzxci76z0+J80k7rZRaHm6YQO2MrTZ/od9y+6y9LX3nsvIlAdl IMxXyC89VhLwXfUEI12+yhzwaiBFK3nZYRH/Jl3SqzAt5zahx4m5zjpJmng8DNErkWUu A67S4a+QYbx4OzUl1AmLV7TIkz/aggM4yq2vwT7yBJ0JXEi4of5KXTE3KorSa8/QEISv Sy4F1ZJU5VkFUERpiRMN/qYxxpTe6Ap/YZz/BsuQAFKj+1nGGNlHh8dnMNoS2BLYJkUw sl4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=oqvP/UI5GWduf5uNNKdaAgpp3aqrauonIxloSpiE9hw=; b=Oh9ZF4txCda6fhAe7C8g7UGxqP9zVv+N8V9z39M43Eat9MdFqamiSIKMaIWVmqPm/3 brNXCudphH6Ir7NRSkmVsdvz3KCuAxEmYDtWY0JvIiHUMVc8C7ZiDSHLPCRQ5vLphnPk s1prloYgLbPAmUb7kP73EYlugF9E0vC5SZgBngpFrtUmpB5uilBpOrb5gzMpk2H1XB4a 2ICBOE0C6zCMMA7uZj6xcFELg/Q23EJqCkkE4tb+iYSv9DsqdWYSjP7WVVzuUcZOZjSV lCz8qTPWm51fY7C5XblBYKiWK8XoN2UyIvavqTjOl8m0S0Wx1CXkS7pI9F6NEeofCu5z /x/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ZrleraFM; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12-v6si4103019plg.607.2018.02.24.14.25.44; Sat, 24 Feb 2018 14:26:00 -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=pass header.i=@broadcom.com header.s=google header.b=ZrleraFM; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751545AbeBXWZG (ORCPT + 99 others); Sat, 24 Feb 2018 17:25:06 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:37513 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751399AbeBXWZE (ORCPT ); Sat, 24 Feb 2018 17:25:04 -0500 Received: by mail-oi0-f66.google.com with SMTP id f186so8223124oig.4 for ; Sat, 24 Feb 2018 14:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=oqvP/UI5GWduf5uNNKdaAgpp3aqrauonIxloSpiE9hw=; b=ZrleraFMc2HGZmeOHhMchX62gqCyESTzuRCdULsgJEkv2UdzfrlX9NymikqPwz7eGo XQQeDh7JEmzhqY6XT9IV7bwd/MZvdeKmASxI+gQ1JdbH33b+Xb6P+/xEElchVuTqlu1r xCJQL4vR5jxEgXalW77GNm4K4XcIQFr/q9hEI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=oqvP/UI5GWduf5uNNKdaAgpp3aqrauonIxloSpiE9hw=; b=VD3Z+L0LFK21ymEl3l6YNXIkTuOEKZ20gL3MDaWP3ltE1E7DuZ7XFEKYcGypfAqoBD 95yOy2rqrJMlPx+B9Pkm+vZYe4Lqo317QgwAOjnoAEEc+t75sxj3+lboKlCoFIJQy4I2 f3kUtKuk//rVDd85e/1GsVd8ObTGWfA0urJnP6eFVHFD4c1YDfcttI3iqEVGNPe5V2Jf eqOsKPNZQIchGFbilEfK8eXziy2XfV5RdGcnPth5PrJu130HlwimQ5cB9F5vAFegjFmg 2F24R7m+HP4sef6Gm5op+ZQPAEeqZ830zsxc/cW7J65YWgnZwcVY1akpBOxHOBXC9OfJ xc+Q== X-Gm-Message-State: APf1xPC+EmFQeX6I9zwf+NPaN4KSXMjO10pB64tRAd65so+P0DiRuxGW bZiKL2PplAMluYY1qoGYMVHP0mXbE0s= X-Received: by 10.202.9.19 with SMTP id 19mr3917942oij.152.1519511103934; Sat, 24 Feb 2018 14:25:03 -0800 (PST) Received: from [192.168.1.89] (ip68-4-112-38.oc.oc.cox.net. [68.4.112.38]) by smtp.gmail.com with ESMTPSA id 96sm2678462otj.17.2018.02.24.14.25.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Feb 2018 14:25:02 -0800 (PST) Subject: Re: [PATCH] scsi: lpfc: use memcpy_toio instead of writeq To: Arnd Bergmann , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Hannes Reinecke , Johannes Thumshirn , linux-scsi , Linux Kernel Mailing List References: <20180223153700.2186058-1-arnd@arndb.de> From: James Smart Message-ID: <36e88521-f064-895e-de46-45236e43a8d4@broadcom.com> Date: Sat, 24 Feb 2018 14:24:59 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org About to post a patch to fix. Rather than fidgeting with the copy routine, I want to go back to what we originally proposed - writeq() on 64bit, writel() on 32-bit. -- james On 2/23/2018 1:02 PM, Arnd Bergmann wrote: > On Fri, Feb 23, 2018 at 4:36 PM, Arnd Bergmann wrote: >> @@ -138,12 +137,10 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe) >> if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) >> bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id); >> lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size); >> - if (q->dpp_enable && q->phba->cfg_enable_dpp) { >> + if (q->dpp_enable && q->phba->cfg_enable_dpp) >> /* write to DPP aperture taking advatage of Combined Writes */ >> - tmp = (uint8_t *)wqe; >> - for (i = 0; i < q->entry_size; i += sizeof(uint64_t)) >> - writeq(*((uint64_t *)(tmp + i)), q->dpp_regaddr + i); >> - } >> + memcpy_toio(tmp, q->dpp_regaddr, q->entry_size); >> + >> /* ensure WQE bcopy and DPP flushed before doorbell write */ >> wmb(); >> > Not sure where we are with the question of whether memcpy_toio > is a good replacement or not, but further build testing showed that > my patch was completely broken in more than one way: > > I mixed up the source and destination arguments, and I used > the uninitialized 'tmp' instead of 'wqe'. Don't try this patch. > > Arnd