Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2180562ybv; Fri, 21 Feb 2020 10:25:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyBbqktAPs8Ec7lbeZPvaNpiEfL7b0GbzMcUOzNcMiGAkQDvR6BQnKV/KjVzS8Yx9SRzRXu X-Received: by 2002:a05:6808:24e:: with SMTP id m14mr3143994oie.168.1582309501095; Fri, 21 Feb 2020 10:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582309501; cv=none; d=google.com; s=arc-20160816; b=CPZd6qB86W9l20Fk+RQ9oJm/lLUwg6XBRFmhDOqCsmQKO6+6zgIaLTM8NOlk+PQvV8 3IltRLwkjJnyqbw7HxT2XMoWfpvlAM1KBOuWm7MyiuY4yZ20rOO3UBKc56nJanPU8g7q VDGTJMshuV8/ngylMGTBUYk3pXL5DEeeXWWgs/cBt6cQxxbvwq7z574uPdgY8T/Lnqww 1cokKtVsHlkdtkF6l9ytlwNc13tMkGbVjnoqyFGzdqPfgAWg5rnrM/fd3akcJfB1uMxt KX6sPuKM0YJS2xoAGvERJjnCBJRMNE70PXUuzkvddCyOVOHyFlPq3/lluxcJU1DJr4Bh gSNA== 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; bh=el0ksJbOaCzUgbQQlOdxCAczDgGJZ08IsAkqI71psIE=; b=o5l8vpNEkN3yqN0JuXYfiY5vmbVbTzPwTRsOMNOFyfeuJVcNcQp4hSaUYFktzsAo2W ifHf778EBGFVlTFSmByfuN9bxtmoDAcc9KiWvPHcQyPt0AjnNofyZq2484oZAXD4QAYs IzrAHJYfWTg+Ks//6eiBF+lWgnAT+ALdsVtVZa30/6rHaBCIoRzkkdAajhngCqPA9MRJ G8LSroPvVRHjo6GVuj80TcKhm5A7rk551l3ukn6Btarnn23gVz9GCeImlNw0nh5sJs1u tG//asVDprPjz8AYs0yJ/rgZCD/Vc07a0R/sbe/rXb48FPLVznAakIrrjRD+edRJFR/i PIOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=JJd2icL1; 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 b5si2347641ots.78.2020.02.21.10.24.48; Fri, 21 Feb 2020 10:25:01 -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=JJd2icL1; 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 S1727966AbgBUSXd (ORCPT + 99 others); Fri, 21 Feb 2020 13:23:33 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50654 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbgBUSXc (ORCPT ); Fri, 21 Feb 2020 13:23:32 -0500 Received: by mail-wm1-f67.google.com with SMTP id a5so2757769wmb.0 for ; Fri, 21 Feb 2020 10:23:31 -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=el0ksJbOaCzUgbQQlOdxCAczDgGJZ08IsAkqI71psIE=; b=JJd2icL1qjAUrXOYho8MTDEJu+K4IobYWsBZeg0w/qRU4Rs1SfWnWRv0Vo09VjqD8X UUdtVwRy2eNM7ZZ5gGp5d4+KME3tnAciw2KQZWZ+H1lGcdWYIXyOYQR/ziz5xaGCD19L gwVfS8Z2Eij1tCyGwa+maXTsvzgfh9scgHCfk= 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=el0ksJbOaCzUgbQQlOdxCAczDgGJZ08IsAkqI71psIE=; b=UEYBoBw8s8KOxdY1q+8A+qsCQzP8vYImPmSv4bJv6g6FF1qGw6QN0Yowj8lwdMIo9Y V2mDLmko5ly705ADUkfo3ip5DDYgkbOMueUNltxSCIY4mt4roGXRGmbq2wYg76JNjTtY NtLMDgBemBHWRK+kFY1Yt9IcNlrHxTYTyLGVr8Bq9vDdV1Dn4yHZ32Ly4SU81SL5gQAO b8gou9o1IrbBMXY7l7Zll4uRc9bYdQdH94yygxLlQ0on9Af8vsnh45YGf7vATqEC+GyW QOhZYXYvYF7JuCk8ArIjSbAZzaGeF2FUpUj2WwyrKGF/rCNt0LXVAtHnZeY6+5SPc6P8 7dBQ== X-Gm-Message-State: APjAAAV8ys2NUQnQ1ICk6j/n6yZ8jnwfGWe3ljvmiY7RKuT2YEOMii7f +zo5VEmZgmrvhM4j5Jmk5E0Vsg== X-Received: by 2002:a1c:f713:: with SMTP id v19mr4959041wmh.113.1582309410725; Fri, 21 Feb 2020 10:23:30 -0800 (PST) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id f8sm4696963wru.12.2020.02.21.10.23.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Feb 2020 10:23:27 -0800 (PST) Subject: Re: [PATCH 2/7] firmware: add offset to request_firmware_into_buf To: Arnd Bergmann Cc: Luis Chamberlain , Takashi Iwai , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , Bjorn Andersson , Shuah Khan , "Rafael J . Wysocki" , "linux-kernel@vger.kernel.org" , linux-arm-msm , Linux FS-devel Mailing List , BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , "open list:KERNEL SELFTEST FRAMEWORK" References: <20190822192451.5983-1-scott.branden@broadcom.com> <20190822192451.5983-3-scott.branden@broadcom.com> <10461fcf-9eca-32b6-0f9d-23c63b3f3442@broadcom.com> <93b8285a-e5eb-d4a4-545d-426bbbeb8008@broadcom.com> <20191011133120.GP16384@42.do-not-panic.com> From: Scott Branden Message-ID: Date: Fri, 21 Feb 2020 10:23:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-02-21 12:44 a.m., Arnd Bergmann wrote: > On Fri, Feb 21, 2020 at 1:11 AM Scott Branden > wrote: >> On 2019-10-11 6:31 a.m., Luis Chamberlain wrote: >>> On Tue, Aug 27, 2019 at 12:40:02PM +0200, Takashi Iwai wrote: >>>> On Mon, 26 Aug 2019 19:24:22 +0200, >>>> Scott Branden wrote: >>>>> I will admit I am not familiar with every subtlety of PCI >>>>> accesses. Any comments to the Valkyrie driver in this patch series are >>>>> appreciated. >>>>> But not all drivers need to work on all architectures. I can add a >>>>> depends on x86 64bit architectures to the driver to limit it to such. >>>> But it's an individual board on PCIe, and should work no matter which >>>> architecture is? Or is this really exclusive to x86? >>> Poke Scott. >> Yes, this is exclusive to x86. >> In particular, 64-bit x86 server class machines with PCIe gen3 support. >> There is no reason for these PCIe boards to run in other lower end >> machines or architectures. > It doesn't really matter that much what you expect your customers to > do with your product, or what works a particular machine today, drivers > should generally be written in a portable manner anyway and use > the documented APIs. memcpy() into an __iomem pointer is not > portable and while it probably works on any x86 machine today, please > just don't do it. If you use 'sparse' to check your code, that would normally > result in an address space warning, unless you add __force and a > long comment explaining why you cannot just use memcpy_to_io() > instead. At that point, you are already better off usingn memcpy_to_io() ;-) We don't want to allocate to intermediate memory and do another memcpy just to write to pcie. I will have to look into the linux request_firmware_info_buf code and detect whether the buf being request to is in kernel or io memory and perform the operation there.  Hopefully such is possible. > > Arnd