Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp833999ybz; Wed, 29 Apr 2020 10:11:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJbYX4ArMneze+IJIL7nHrhPg2UCdB8PeUTcZCnEcD2VvA/ATtZBhPYxr7XUemvNC4NA8AH X-Received: by 2002:a17:906:2d4a:: with SMTP id e10mr3697955eji.222.1588180289775; Wed, 29 Apr 2020 10:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588180289; cv=none; d=google.com; s=arc-20160816; b=PQPHayS8EWzi8HTWrqRz/YFQio0OGG7GbtiBmb68UMSPnWdfYTW27WR5jVlmPvEZP7 lSVDkmVaOwm+tWS1RWLoN0c7eyG60SBUIpfRrORZ6GLZrlMbvXHrcv9Fcbo+0mQ+/wQA URcmOxPk5byvYLkLfBouJC6fX/Vvh4fbHZmfqQMdsQBuokv52C00Ot0G05MgaBCwQmCi jw1gHtTreac56wjzefNc/fo658XLU1Lr02lCJdLo12QrPIdYypybWnCY/YH4OcZHrTuJ GeyoUS/UMHjeKBWZQpBXh0ajY3ljvxlSEiQPy7Bc4txLTnEf/A+giAvBll0EEH48pqb9 kbnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=XRf8GObyFyiu0kikag+9wy7ttN3b1p/9KRQUdGvi0B8=; b=M0+AALV4vts8hIqWdLpDxpQlEI2xQUYHqR2ZHrm84I0OWX2kVD9JuafRI3CpShfHuq O3u/PXU/T/bNqSK3fVOxmT7qTSSf/29UHrDM3c+AOPrGMcVHs4mYIgVa977KJ0u+XKw2 QmINXTnGC59emwUI6tmU4tnSLewHVqCPyxPl17ESjVGjGdbBkrbL+rvfwjGh64XxxosD bepcbch4LkRCztTpPmN5TSH+G81edmo2+x607+WWVcfMPExjYWVdll288QVMJGShHX8W aQjyEHJyjKwPhDyI8Ktq6uNF2ziwWHNQs0KkDCyC1JDuiqCNa+r1yvdwr8VO0isEQVep JduQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=dFhGW0VU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l25si3572516edw.288.2020.04.29.10.11.02; Wed, 29 Apr 2020 10:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=dFhGW0VU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726844AbgD2RJc (ORCPT + 99 others); Wed, 29 Apr 2020 13:09:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726774AbgD2RJb (ORCPT ); Wed, 29 Apr 2020 13:09:31 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92353C035493 for ; Wed, 29 Apr 2020 10:09:31 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id q124so1293292pgq.13 for ; Wed, 29 Apr 2020 10:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=XRf8GObyFyiu0kikag+9wy7ttN3b1p/9KRQUdGvi0B8=; b=dFhGW0VUHxp3OA589kT5FEsTI0gcW9DZ9PSljRlxhccRour0WECCxKllvJJbOjgqls QGiR2/d3lgSmvsGENz1m/eNxyxrzop0FmghlK1zgmY+ibt3KYeSqqjL1ByoEaqRYUWMX PMN7i6IYACVz2agI2sR0lM/b6AImqlOllicSw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XRf8GObyFyiu0kikag+9wy7ttN3b1p/9KRQUdGvi0B8=; b=ubEUvJGt+9HirCpKMigVda/XX7MwoVLTIXurncpaLwJnFZmGVQEgPyq1d0Sle6Bp5G FV+tfMTTsuA+OVxARK7fpLuNHclRJkVXNu6UFGyA0TQ3qQow+M2YaHW0Z644P/EFel+u s3oUkeU4J8sXMFO45zNaTUFMEQs/C0Nh7IB9by+k21H2Y6uEUHkPhcCzy5Fr5L9yZcw/ K9efBMMYvRB469wkK5l2N5Hd9On96gl8ouW8FxX/fHmI4aEdKtvhfhiqEMZlPhVlzUHM Gonte6CJYS63N7MQ5OK+Vlsd56SADui5Tqpk5jjr3UpVNXHFNoCaEQ0sOM+kPH73jAYy CayQ== X-Gm-Message-State: AGi0PuZFEZyyhz8nBuAZ4jivXBMum+HfB94hVEpyIzx2qP2X/miApanZ Uoa18jGUkQ9EBbFbtkknVfdSGQ== X-Received: by 2002:aa7:943c:: with SMTP id y28mr36128122pfo.171.1588180170916; Wed, 29 Apr 2020 10:09:30 -0700 (PDT) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id y63sm1574456pfg.138.2020.04.29.10.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2020 10:09:29 -0700 (PDT) From: Scott Branden To: Luis Chamberlain , Greg Kroah-Hartman , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann Cc: "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 , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross , Scott Branden Subject: [PATCH v4 0/7] firmware: add partial read support in request_firmware_into_buf Date: Wed, 29 Apr 2020 10:09:07 -0700 Message-Id: <20200429170914.30976-1-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds partial read support in request_firmware_into_buf. In order to accept the enhanced API it has been requested that kernel selftests and upstreamed driver utilize the API enhancement and so are included in this patch series. Also in this patch series is the addition of a new Broadcom VK driver utilizing the new request_firmware_into_buf enhanced API. Changes from v3: - fix sparse warnings - fix printf format specifiers for size_t - fix 32-bit cross-compiling reports 32-bit shifts - use readl/writel,_relaxed to access pci ioremap memory, removed memory barriers and volatile keyword with such change - driver optimizations for interrupt/poll functionalities Changes from v2: - remove unnecessary code and mutex locks in lib/test_firmware.c - remove VK_IOCTL_ACCESS_BAR support from driver and use pci sysfs instead - remove bitfields - remove Kconfig default m - adjust formatting and some naming based on feedback - fix error handling conditions - use appropriate return codes - use memcpy_toio instead of direct access to PCIE bar Scott Branden (7): fs: introduce kernel_pread_file* support firmware: add offset to request_firmware_into_buf test_firmware: add partial read support for request_firmware_into_buf firmware: test partial file reads of request_firmware_into_buf bcm-vk: add bcm_vk UAPI misc: bcm-vk: add Broadcom VK driver MAINTAINERS: bcm-vk: add maintainer for Broadcom VK Driver MAINTAINERS | 7 + drivers/base/firmware_loader/firmware.h | 5 + drivers/base/firmware_loader/main.c | 52 +- drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/bcm-vk/Kconfig | 29 + drivers/misc/bcm-vk/Makefile | 12 + drivers/misc/bcm-vk/bcm_vk.h | 412 +++++ drivers/misc/bcm-vk/bcm_vk_dev.c | 1211 ++++++++++++++ drivers/misc/bcm-vk/bcm_vk_legacy.c | 89 ++ drivers/misc/bcm-vk/bcm_vk_msg.c | 1414 +++++++++++++++++ drivers/misc/bcm-vk/bcm_vk_msg.h | 195 +++ drivers/misc/bcm-vk/bcm_vk_sg.c | 271 ++++ drivers/misc/bcm-vk/bcm_vk_sg.h | 60 + drivers/misc/bcm-vk/bcm_vk_tty.c | 352 ++++ drivers/soc/qcom/mdt_loader.c | 7 +- fs/exec.c | 96 +- include/linux/firmware.h | 8 +- include/linux/fs.h | 20 + include/uapi/linux/misc/bcm_vk.h | 99 ++ lib/test_firmware.c | 144 +- .../selftests/firmware/fw_filesystem.sh | 80 + 22 files changed, 4516 insertions(+), 49 deletions(-) create mode 100644 drivers/misc/bcm-vk/Kconfig create mode 100644 drivers/misc/bcm-vk/Makefile create mode 100644 drivers/misc/bcm-vk/bcm_vk.h create mode 100644 drivers/misc/bcm-vk/bcm_vk_dev.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_legacy.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_msg.h create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.c create mode 100644 drivers/misc/bcm-vk/bcm_vk_sg.h create mode 100644 drivers/misc/bcm-vk/bcm_vk_tty.c create mode 100644 include/uapi/linux/misc/bcm_vk.h -- 2.17.1