Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp5371352ybl; Tue, 27 Aug 2019 03:42:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3+MrEKyablRSSbddb57nYvA80u2purVPDyGfXUIhQj57+t8WSTV8ZacXpFeULqA+tiA2M X-Received: by 2002:a17:90a:250c:: with SMTP id j12mr24584269pje.96.1566902567271; Tue, 27 Aug 2019 03:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566902567; cv=none; d=google.com; s=arc-20160816; b=hD01D2eV/zb+d2rty5WmYvF3lvJSDr/CuF+IgeyX57gzk/uwcRATo+8+lgbtIRb3Ja kC+P1vkIPGJBMo0ebJdY2IkUo0UrXbC1np2rDkD62tg1IywAtc5+LXSd6yJEkLLLTlFc PJwzHc2D4g3mbHHG43R3lhlA4UCgE3ogDSh32u2lCWHncSoEssaKne97Bot433+OTyh0 wQOCN/Zcp7VLNvKHHqgyKRhZWBYOz42Jg2bPJa3K/ZUauYK+fo0DMu2cG53niAMVgqP9 4nl0FDTSw42Kvlu4vMaM9va6Dt10Ee3p9Tglc8twE5KZjtmLPpUvXl4U81BUAWwrM63d Y9+w== 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:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=sSMu4gPQ9ffwCdPfPj7DylZLOFhf0KlUO1AeIg4sEmU=; b=ZNiys4bN7bgJuk8XIBHagmG3G6bd9mgI59S8I0Wgroa0xjwTrqkS8mTAZ+DEyN2JsX oy2ozTHUdzAbiv3xqwzXjmsFUbEFouXyws+MbriFlHoYRvSNC53IZHXjvK4Ko1hgkN+B OV4u3yDPzaC52WZ4EfOCcGef3L8Q6aJbXv0b5r/1p4/qwq4bwYljkIdG1e5LWcX5EI46 9I+5eDVnJzpysJJAGw0tIHNOeVBBOXcBvNmjZ8f6GJa8lMS13TYsmw424v1yWVzukfN9 WKoLZvu4r+cUzemIwIhQBu0FFwueKfsXROhOWdzSYMh47ZIJCzf9j/rLXvAjbAIYquA7 x7yQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si13158747pfg.55.2019.08.27.03.42.31; Tue, 27 Aug 2019 03:42:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728938AbfH0KkG (ORCPT + 99 others); Tue, 27 Aug 2019 06:40:06 -0400 Received: from mx2.suse.de ([195.135.220.15]:52496 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725793AbfH0KkF (ORCPT ); Tue, 27 Aug 2019 06:40:05 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 32A1FAFD4; Tue, 27 Aug 2019 10:40:03 +0000 (UTC) Date: Tue, 27 Aug 2019 12:40:02 +0200 Message-ID: From: Takashi Iwai To: Scott Branden Cc: Luis Chamberlain , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , linux-kselftest@vger.kernel.org Subject: Re: [PATCH 2/7] firmware: add offset to request_firmware_into_buf In-Reply-To: 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> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Aug 2019 19:24:22 +0200, Scott Branden wrote: > > Hi Takashi, > > On 2019-08-26 10:12 a.m., Takashi Iwai wrote: > > On Mon, 26 Aug 2019 17:41:40 +0200, > > Scott Branden wrote: > >> HI Takashi, > >> > >> On 2019-08-26 8:20 a.m., Takashi Iwai wrote: > >>> On Fri, 23 Aug 2019 21:44:42 +0200, > >>> Scott Branden wrote: > >>>> Hi Takashi, > >>>> > >>>> Thanks for review.  comments below. > >>>> > >>>> On 2019-08-23 3:05 a.m., Takashi Iwai wrote: > >>>>> On Thu, 22 Aug 2019 21:24:46 +0200, > >>>>> Scott Branden wrote: > >>>>>> Add offset to request_firmware_into_buf to allow for portions > >>>>>> of firmware file to be read into a buffer. Necessary where firmware > >>>>>> needs to be loaded in portions from file in memory constrained systems. > >>>>> AFAIU, this won't work with the fallback user helper, right? > >>>> Seems to work fine in the fw_run_tests.sh with fallbacks. > >>> But how? You patch doesn't change anything about the fallback loading > >>> mechanism. > >> Correct - I didn't change any of the underlying mechanisms, > >> so however request_firmware_into_buf worked before it still does. > >>> Or, if the expected behavior is to load the whole content > >>> and then copy a part, what's the merit of this API? > >> The merit of the API is that the entire file is not copied into a buffer. > >> In my use case, the buffer is a memory region in PCIe space that isn't > >> even large enough for the whole file.  So the only way to get the file > >> is to read it > >> in portions. > > BTW: does the use case above mean that the firmware API directly > > writes onto the given PCI iomem region? If so, I'm not sure whether > > it would work as expected on all architectures. There must be a > > reason of the presence of iomem-related API like memcpy_toio()... > Yes, we access the PCI region directly in the driver and thus also > through request_firmware_into_buf. Then you really need to access via the standard APIs for iomem. The normal memory copy would work only on some architectures like x86. > 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? thanks, Takashi