From 7d205183c6a344847fc56a84dc87b49f31b7dc9f Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 26 Feb 2016 20:52:04 +0000 Subject: Branched f24 --- freed-ora/current/f24/.gitignore | 8 + ...ice-property-always-check-for-fwnode-type.patch | 51 + ...2-device-property-rename-helper-functions.patch | 87 + ...erty-refactor-built-in-properties-support.patch | 236 + ...device-property-keep-single-value-inplace.patch | 123 + ...erty-helper-macros-for-property-entry-cre.patch | 84 + ...ce-property-improve-readability-of-macros.patch | 80 + ...erty-return-EINVAL-when-property-isn-t-fo.patch | 65 + ...erty-Fallback-to-secondary-fwnode-if-prim.patch | 188 + ...-property-Take-a-copy-of-the-property-set.patch | 247 + ...-platform-Add-support-for-built-in-device.patch | 112 + ...-Do-not-overwrite-secondary-fwnode-with-N.patch | 47 + ...opagate-device-properties-to-sub-devices-.patch | 69 + ...pss-Add-support-for-passing-device-proper.patch | 112 + ...pss-Pass-SDA-hold-time-to-I2C-host-contro.patch | 138 + ...pss-Pass-HSUART-configuration-via-propert.patch | 55 + ...are-Convert-to-use-unified-device-propert.patch | 106 + .../f24/ACPI-Limit-access-to-custom_method.patch | 31 + freed-ora/current/f24/ARM-tegra-usb-no-reset.patch | 28 + .../current/f24/Add-EFI-signature-data-types.patch | 57 + ...-EFI-signature-blob-parser-and-key-loader.patch | 179 + ...to-automatically-enforce-module-signature.patch | 186 + .../current/f24/Add-secure_modules-call.patch | 63 + ...-sysrq-option-to-disable-secure-boot-mode.patch | 246 + ...uch-enable-palm-rejection-if-device-imple.patch | 41 + ...tics-pin-3-touches-when-the-firmware-repo.patch | 47 + .../f24/KEYS-Add-a-system-blacklist-keyring.patch | 105 + .../Kbuild-Add-an-option-to-enable-GCC-VTA.patch | 89 + ...Import-certificates-from-UEFI-Secure-Boot.patch | 186 + ...DSIGN-Support-not-importing-certs-from-db.patch | 84 + freed-ora/current/f24/Makefile | 123 + freed-ora/current/f24/Makefile.config | 129 + freed-ora/current/f24/Makefile.release | 83 + ...wn-BAR-access-when-module-security-is-ena.patch | 118 + freed-ora/current/f24/PatchList.txt | 52 + freed-ora/current/f24/README.txt | 82 + ...v-mem-and-dev-kmem-when-module-loading-is.patch | 42 + freed-ora/current/f24/TODO | 10 + ...-acpi_rsdp-kernel-parameter-when-module-l.patch | 39 + freed-ora/current/f24/alua_fix.patch | 41 + .../amd-xgbe-a0-Add-support-for-XGBE-on-A0.patch | 10362 +++++++++++++ ...gbe-phy-a0-Add-support-for-XGBE-PHY-on-A0.patch | 1861 +++ .../current/f24/arm-i.MX6-Utilite-device-dtb.patch | 62 + .../current/f24/arm64-acpi-drop-expert-patch.patch | 21 + ...-needing-console-to-enable-serial-console.patch | 46 + ...strict-debugfs-interface-when-module-load.patch | 54 + .../current/f24/ath9k-rx-dma-stop-check.patch | 38 + freed-ora/current/f24/config-arm-generic | 409 + freed-ora/current/f24/config-arm64 | 182 + freed-ora/current/f24/config-armv7 | 648 + freed-ora/current/f24/config-armv7-generic | 913 ++ freed-ora/current/f24/config-armv7-lpae | 83 + freed-ora/current/f24/config-debug | 128 + freed-ora/current/f24/config-generic | 5788 ++++++++ freed-ora/current/f24/config-i686-PAE | 8 + freed-ora/current/f24/config-local | 2 + freed-ora/current/f24/config-no-extra | 27 + freed-ora/current/f24/config-nodebug | 129 + freed-ora/current/f24/config-powerpc64 | 109 + freed-ora/current/f24/config-powerpc64-generic | 383 + freed-ora/current/f24/config-powerpc64le | 6 + freed-ora/current/f24/config-powerpc64p7 | 3 + freed-ora/current/f24/config-s390x | 298 + freed-ora/current/f24/config-x86-32-generic | 222 + freed-ora/current/f24/config-x86-generic | 599 + freed-ora/current/f24/config-x86_64-generic | 214 + freed-ora/current/f24/cpupower.config | 3 + freed-ora/current/f24/cpupower.service | 13 + freed-ora/current/f24/crash-driver.patch | 506 + freed-ora/current/f24/criu-no-expert.patch | 32 + freed-ora/current/f24/deblob-4.4 | 3174 ++++ freed-ora/current/f24/deblob-check | 8580 +++++++++++ freed-ora/current/f24/deblob-main | 311 + freed-ora/current/f24/die-floppy-die.patch | 29 + .../f24/disable-i8042-check-on-apple-mac.patch | 62 + .../f24/drm-i915-hush-check-crtc-state.patch | 32 + ...15-shut-up-gen8-SDE-irq-dmesg-noise-again.patch | 68 + .../current/f24/drm-i915-turn-off-wc-mmaps.patch | 21 + .../drm-udl-Use-unlocked-gem-unreferencing.patch | 58 + .../current/f24/efi-Add-EFI_SECURE_BOOT-bit.patch | 43 + ...e-secure-boot-if-shim-is-in-insecure-mode.patch | 58 + ...EFI_SECURE_BOOT_SIG_ENFORCE-depend-on-EFI.patch | 30 + freed-ora/current/f24/filter-aarch64.sh | 14 + freed-ora/current/f24/filter-armv7hl.sh | 14 + freed-ora/current/f24/filter-i686.sh | 14 + freed-ora/current/f24/filter-modules.sh | 143 + freed-ora/current/f24/filter-ppc64.sh | 14 + freed-ora/current/f24/filter-ppc64le.sh | 14 + freed-ora/current/f24/filter-ppc64p7.sh | 14 + freed-ora/current/f24/filter-s390x.sh | 12 + freed-ora/current/f24/filter-x86_64.sh | 12 + ...op-WARN-from-usermodehelper_read_trylock-.patch | 89 + freed-ora/current/f24/freedo.patch | 14677 +++++++++++++++++++ freed-ora/current/f24/gitrev | 1 + ...e-Disable-in-a-signed-modules-environment.patch | 39 + ...top-Add-Lenovo-ideapad-Y700-17ISK-to-no_h.patch | 40 + .../current/f24/input-kill-stupid-messages.patch | 30 + freed-ora/current/f24/kbuild-AFTER_LINK.patch | 126 + freed-ora/current/f24/kernel.spec | 3841 +++++ ...le-at-runtime-if-the-kernel-enforces-modu.patch | 44 + ...uefi-copy-secure_boot-flag-in-boot-params.patch | 30 + ...-Make-CPUMASK_OFFSTACK-usable-without-deb.patch | 34 + .../current/f24/linux-libre-4.4-gnu.tar.xz.sign | 7 + .../current/f24/linux-libre-4.4-gnu.xdelta.xz | Bin 0 -> 111596 bytes .../current/f24/linux-libre-4.4-gnu.xdelta.xz.sign | 7 + .../f24/lis3-improve-handling-of-null-rate.patch | 75 + freed-ora/current/f24/merge.pl | 66 + ...Ensure-that-the-whole-MFD-is-built-into-a.patch | 28 + freed-ora/current/f24/mod-extra.list | 193 + freed-ora/current/f24/mod-extra.sh | 80 + freed-ora/current/f24/mod-sign.sh | 36 + freed-ora/current/f24/no-pcspkr-modalias.patch | 22 + ...g-capable-wrt-a-process-requires-mapped-u.patch | 108 + freed-ora/current/f24/rebase-notes.txt | 3 + freed-ora/current/f24/scripts/allarchconfig.sh | 16 + freed-ora/current/f24/scripts/bumpspecfile.py | 76 + freed-ora/current/f24/scripts/check-TODO.sh | 27 + freed-ora/current/f24/scripts/check-configs.pl | 83 + freed-ora/current/f24/scripts/combine.sh | 34 + freed-ora/current/f24/scripts/configcommon.pl | 82 + freed-ora/current/f24/scripts/configdiff.pl | 76 + freed-ora/current/f24/scripts/cross-aarch64 | 3 + freed-ora/current/f24/scripts/cross-arm | 3 + freed-ora/current/f24/scripts/fast-x86_64 | 3 + .../current/f24/scripts/generate-git-snapshot.sh | 32 + freed-ora/current/f24/scripts/grab-logs.sh | 16 + freed-ora/current/f24/scripts/newpatch.sh | 21 + freed-ora/current/f24/scripts/rediffall.pl | 64 + freed-ora/current/f24/scripts/sort-config | 226 + ...sd_revalidate_disk-prevent-NULL-ptr-deref.patch | 39 + freed-ora/current/f24/silence-fbcon-logo.patch | 52 + freed-ora/current/f24/sources | 2 + ...ix-crash-on-detecting-device-with-invalid.patch | 49 + ...hdog-Disable-watchdog-on-virtual-machines.patch | 79 + freed-ora/current/f24/x509.genkey | 16 + ...wn-IO-port-access-when-module-security-is.patch | 72 + ...t-MSR-access-when-module-loading-is-restr.patch | 44 + ...-Don-t-disable-PCI_COMMAND-on-PCI-device-.patch | 48 + 138 files changed, 60474 insertions(+) create mode 100644 freed-ora/current/f24/.gitignore create mode 100644 freed-ora/current/f24/0001-device-property-always-check-for-fwnode-type.patch create mode 100644 freed-ora/current/f24/0002-device-property-rename-helper-functions.patch create mode 100644 freed-ora/current/f24/0003-device-property-refactor-built-in-properties-support.patch create mode 100644 freed-ora/current/f24/0004-device-property-keep-single-value-inplace.patch create mode 100644 freed-ora/current/f24/0005-device-property-helper-macros-for-property-entry-cre.patch create mode 100644 freed-ora/current/f24/0006-device-property-improve-readability-of-macros.patch create mode 100644 freed-ora/current/f24/0007-device-property-return-EINVAL-when-property-isn-t-fo.patch create mode 100644 freed-ora/current/f24/0008-device-property-Fallback-to-secondary-fwnode-if-prim.patch create mode 100644 freed-ora/current/f24/0009-device-property-Take-a-copy-of-the-property-set.patch create mode 100644 freed-ora/current/f24/0010-driver-core-platform-Add-support-for-built-in-device.patch create mode 100644 freed-ora/current/f24/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch create mode 100644 freed-ora/current/f24/0012-mfd-core-propagate-device-properties-to-sub-devices-.patch create mode 100644 freed-ora/current/f24/0013-mfd-intel-lpss-Add-support-for-passing-device-proper.patch create mode 100644 freed-ora/current/f24/0014-mfd-intel-lpss-Pass-SDA-hold-time-to-I2C-host-contro.patch create mode 100644 freed-ora/current/f24/0015-mfd-intel-lpss-Pass-HSUART-configuration-via-propert.patch create mode 100644 freed-ora/current/f24/0016-i2c-designware-Convert-to-use-unified-device-propert.patch create mode 100644 freed-ora/current/f24/ACPI-Limit-access-to-custom_method.patch create mode 100644 freed-ora/current/f24/ARM-tegra-usb-no-reset.patch create mode 100644 freed-ora/current/f24/Add-EFI-signature-data-types.patch create mode 100644 freed-ora/current/f24/Add-an-EFI-signature-blob-parser-and-key-loader.patch create mode 100644 freed-ora/current/f24/Add-option-to-automatically-enforce-module-signature.patch create mode 100644 freed-ora/current/f24/Add-secure_modules-call.patch create mode 100644 freed-ora/current/f24/Add-sysrq-option-to-disable-secure-boot-mode.patch create mode 100644 freed-ora/current/f24/HID-multitouch-enable-palm-rejection-if-device-imple.patch create mode 100644 freed-ora/current/f24/Input-synaptics-pin-3-touches-when-the-firmware-repo.patch create mode 100644 freed-ora/current/f24/KEYS-Add-a-system-blacklist-keyring.patch create mode 100644 freed-ora/current/f24/Kbuild-Add-an-option-to-enable-GCC-VTA.patch create mode 100644 freed-ora/current/f24/MODSIGN-Import-certificates-from-UEFI-Secure-Boot.patch create mode 100644 freed-ora/current/f24/MODSIGN-Support-not-importing-certs-from-db.patch create mode 100644 freed-ora/current/f24/Makefile create mode 100644 freed-ora/current/f24/Makefile.config create mode 100644 freed-ora/current/f24/Makefile.release create mode 100644 freed-ora/current/f24/PCI-Lock-down-BAR-access-when-module-security-is-ena.patch create mode 100644 freed-ora/current/f24/PatchList.txt create mode 100644 freed-ora/current/f24/README.txt create mode 100644 freed-ora/current/f24/Restrict-dev-mem-and-dev-kmem-when-module-loading-is.patch create mode 100644 freed-ora/current/f24/TODO create mode 100644 freed-ora/current/f24/acpi-Ignore-acpi_rsdp-kernel-parameter-when-module-l.patch create mode 100644 freed-ora/current/f24/alua_fix.patch create mode 100644 freed-ora/current/f24/amd-xgbe-a0-Add-support-for-XGBE-on-A0.patch create mode 100644 freed-ora/current/f24/amd-xgbe-phy-a0-Add-support-for-XGBE-PHY-on-A0.patch create mode 100644 freed-ora/current/f24/arm-i.MX6-Utilite-device-dtb.patch create mode 100644 freed-ora/current/f24/arm64-acpi-drop-expert-patch.patch create mode 100644 freed-ora/current/f24/arm64-avoid-needing-console-to-enable-serial-console.patch create mode 100644 freed-ora/current/f24/asus-wmi-Restrict-debugfs-interface-when-module-load.patch create mode 100644 freed-ora/current/f24/ath9k-rx-dma-stop-check.patch create mode 100644 freed-ora/current/f24/config-arm-generic create mode 100644 freed-ora/current/f24/config-arm64 create mode 100644 freed-ora/current/f24/config-armv7 create mode 100644 freed-ora/current/f24/config-armv7-generic create mode 100644 freed-ora/current/f24/config-armv7-lpae create mode 100644 freed-ora/current/f24/config-debug create mode 100644 freed-ora/current/f24/config-generic create mode 100644 freed-ora/current/f24/config-i686-PAE create mode 100644 freed-ora/current/f24/config-local create mode 100644 freed-ora/current/f24/config-no-extra create mode 100644 freed-ora/current/f24/config-nodebug create mode 100644 freed-ora/current/f24/config-powerpc64 create mode 100644 freed-ora/current/f24/config-powerpc64-generic create mode 100644 freed-ora/current/f24/config-powerpc64le create mode 100644 freed-ora/current/f24/config-powerpc64p7 create mode 100644 freed-ora/current/f24/config-s390x create mode 100644 freed-ora/current/f24/config-x86-32-generic create mode 100644 freed-ora/current/f24/config-x86-generic create mode 100644 freed-ora/current/f24/config-x86_64-generic create mode 100644 freed-ora/current/f24/cpupower.config create mode 100644 freed-ora/current/f24/cpupower.service create mode 100644 freed-ora/current/f24/crash-driver.patch create mode 100644 freed-ora/current/f24/criu-no-expert.patch create mode 100755 freed-ora/current/f24/deblob-4.4 create mode 100755 freed-ora/current/f24/deblob-check create mode 100755 freed-ora/current/f24/deblob-main create mode 100644 freed-ora/current/f24/die-floppy-die.patch create mode 100644 freed-ora/current/f24/disable-i8042-check-on-apple-mac.patch create mode 100644 freed-ora/current/f24/drm-i915-hush-check-crtc-state.patch create mode 100644 freed-ora/current/f24/drm-i915-shut-up-gen8-SDE-irq-dmesg-noise-again.patch create mode 100644 freed-ora/current/f24/drm-i915-turn-off-wc-mmaps.patch create mode 100644 freed-ora/current/f24/drm-udl-Use-unlocked-gem-unreferencing.patch create mode 100644 freed-ora/current/f24/efi-Add-EFI_SECURE_BOOT-bit.patch create mode 100644 freed-ora/current/f24/efi-Disable-secure-boot-if-shim-is-in-insecure-mode.patch create mode 100644 freed-ora/current/f24/efi-Make-EFI_SECURE_BOOT_SIG_ENFORCE-depend-on-EFI.patch create mode 100644 freed-ora/current/f24/filter-aarch64.sh create mode 100644 freed-ora/current/f24/filter-armv7hl.sh create mode 100644 freed-ora/current/f24/filter-i686.sh create mode 100755 freed-ora/current/f24/filter-modules.sh create mode 100644 freed-ora/current/f24/filter-ppc64.sh create mode 100644 freed-ora/current/f24/filter-ppc64le.sh create mode 100644 freed-ora/current/f24/filter-ppc64p7.sh create mode 100644 freed-ora/current/f24/filter-s390x.sh create mode 100644 freed-ora/current/f24/filter-x86_64.sh create mode 100644 freed-ora/current/f24/firmware-Drop-WARN-from-usermodehelper_read_trylock-.patch create mode 100644 freed-ora/current/f24/freedo.patch create mode 100644 freed-ora/current/f24/gitrev create mode 100644 freed-ora/current/f24/hibernate-Disable-in-a-signed-modules-environment.patch create mode 100644 freed-ora/current/f24/ideapad-laptop-Add-Lenovo-ideapad-Y700-17ISK-to-no_h.patch create mode 100644 freed-ora/current/f24/input-kill-stupid-messages.patch create mode 100644 freed-ora/current/f24/kbuild-AFTER_LINK.patch create mode 100644 freed-ora/current/f24/kernel.spec create mode 100644 freed-ora/current/f24/kexec-Disable-at-runtime-if-the-kernel-enforces-modu.patch create mode 100644 freed-ora/current/f24/kexec-uefi-copy-secure_boot-flag-in-boot-params.patch create mode 100644 freed-ora/current/f24/lib-cpumask-Make-CPUMASK_OFFSTACK-usable-without-deb.patch create mode 100644 freed-ora/current/f24/linux-libre-4.4-gnu.tar.xz.sign create mode 100644 freed-ora/current/f24/linux-libre-4.4-gnu.xdelta.xz create mode 100644 freed-ora/current/f24/linux-libre-4.4-gnu.xdelta.xz.sign create mode 100644 freed-ora/current/f24/lis3-improve-handling-of-null-rate.patch create mode 100755 freed-ora/current/f24/merge.pl create mode 100644 freed-ora/current/f24/mfd-wm8994-Ensure-that-the-whole-MFD-is-built-into-a.patch create mode 100644 freed-ora/current/f24/mod-extra.list create mode 100755 freed-ora/current/f24/mod-extra.sh create mode 100755 freed-ora/current/f24/mod-sign.sh create mode 100644 freed-ora/current/f24/no-pcspkr-modalias.patch create mode 100644 freed-ora/current/f24/ptrace-being-capable-wrt-a-process-requires-mapped-u.patch create mode 100644 freed-ora/current/f24/rebase-notes.txt create mode 100755 freed-ora/current/f24/scripts/allarchconfig.sh create mode 100755 freed-ora/current/f24/scripts/bumpspecfile.py create mode 100755 freed-ora/current/f24/scripts/check-TODO.sh create mode 100644 freed-ora/current/f24/scripts/check-configs.pl create mode 100755 freed-ora/current/f24/scripts/combine.sh create mode 100644 freed-ora/current/f24/scripts/configcommon.pl create mode 100644 freed-ora/current/f24/scripts/configdiff.pl create mode 100755 freed-ora/current/f24/scripts/cross-aarch64 create mode 100755 freed-ora/current/f24/scripts/cross-arm create mode 100755 freed-ora/current/f24/scripts/fast-x86_64 create mode 100755 freed-ora/current/f24/scripts/generate-git-snapshot.sh create mode 100755 freed-ora/current/f24/scripts/grab-logs.sh create mode 100755 freed-ora/current/f24/scripts/newpatch.sh create mode 100644 freed-ora/current/f24/scripts/rediffall.pl create mode 100755 freed-ora/current/f24/scripts/sort-config create mode 100644 freed-ora/current/f24/scsi-sd_revalidate_disk-prevent-NULL-ptr-deref.patch create mode 100644 freed-ora/current/f24/silence-fbcon-logo.patch create mode 100644 freed-ora/current/f24/sources create mode 100644 freed-ora/current/f24/usbvision-fix-crash-on-detecting-device-with-invalid.patch create mode 100644 freed-ora/current/f24/watchdog-Disable-watchdog-on-virtual-machines.patch create mode 100644 freed-ora/current/f24/x509.genkey create mode 100644 freed-ora/current/f24/x86-Lock-down-IO-port-access-when-module-security-is.patch create mode 100644 freed-ora/current/f24/x86-Restrict-MSR-access-when-module-loading-is-restr.patch create mode 100644 freed-ora/current/f24/xen-pciback-Don-t-disable-PCI_COMMAND-on-PCI-device-.patch (limited to 'freed-ora/current') diff --git a/freed-ora/current/f24/.gitignore b/freed-ora/current/f24/.gitignore new file mode 100644 index 000000000..d3ce51643 --- /dev/null +++ b/freed-ora/current/f24/.gitignore @@ -0,0 +1,8 @@ +.svn +clog +*.bz2 +*.xz +*.rpm +*.orig +kernel-[234].*/ +perf-man-*.tar.gz diff --git a/freed-ora/current/f24/0001-device-property-always-check-for-fwnode-type.patch b/freed-ora/current/f24/0001-device-property-always-check-for-fwnode-type.patch new file mode 100644 index 000000000..c62956b73 --- /dev/null +++ b/freed-ora/current/f24/0001-device-property-always-check-for-fwnode-type.patch @@ -0,0 +1,51 @@ +From e3f9e299bf94298ddd8beb63c0786a4d7766dc86 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:29 +0200 +Subject: [PATCH 01/16] device property: always check for fwnode type + +Currently the property accessors unconditionally fall back to built-in property +set as a last resort. Make this strict and return an error in case the type of +fwnode is unknown. + +This is actually a follow up to the commit 4fa7508e9f1c (device property: +Return -ENXIO if there is no suitable FW interface). + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index 1325ff2..09e488d 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -135,8 +135,9 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) + return of_property_read_bool(to_of_node(fwnode), propname); + else if (is_acpi_node(fwnode)) + return !acpi_node_prop_get(fwnode, propname, NULL); +- +- return !!pset_prop_get(to_pset(fwnode), propname); ++ else if (is_pset(fwnode)) ++ return !!pset_prop_get(to_pset(fwnode), propname); ++ return false; + } + EXPORT_SYMBOL_GPL(fwnode_property_present); + +@@ -494,9 +495,10 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, + else if (is_acpi_node(fwnode)) + return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, + val, 1); +- +- return pset_prop_read_array(to_pset(fwnode), propname, +- DEV_PROP_STRING, val, 1); ++ else if (is_pset(fwnode)) ++ return pset_prop_read_array(to_pset(fwnode), propname, ++ DEV_PROP_STRING, val, 1); ++ return -ENXIO; + } + EXPORT_SYMBOL_GPL(fwnode_property_read_string); + +-- +2.5.0 + diff --git a/freed-ora/current/f24/0002-device-property-rename-helper-functions.patch b/freed-ora/current/f24/0002-device-property-rename-helper-functions.patch new file mode 100644 index 000000000..08045e518 --- /dev/null +++ b/freed-ora/current/f24/0002-device-property-rename-helper-functions.patch @@ -0,0 +1,87 @@ +From 61f5e294b89a90e8520c9eaf9a4af787db8911ea Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:30 +0200 +Subject: [PATCH 02/16] device property: rename helper functions + +To be in align with the rest of fwnode types we rename the built-in property +set ones, i.e. + is_pset() -> is_pset_node() + to_pset() -> to_pset_node() + +There is no functional change. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 22 +++++++++++----------- + 1 file changed, 11 insertions(+), 11 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index 09e488d..2e01f3f 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -37,14 +37,14 @@ void device_add_property_set(struct device *dev, struct property_set *pset) + } + EXPORT_SYMBOL_GPL(device_add_property_set); + +-static inline bool is_pset(struct fwnode_handle *fwnode) ++static inline bool is_pset_node(struct fwnode_handle *fwnode) + { + return fwnode && fwnode->type == FWNODE_PDATA; + } + +-static inline struct property_set *to_pset(struct fwnode_handle *fwnode) ++static inline struct property_set *to_pset_node(struct fwnode_handle *fwnode) + { +- return is_pset(fwnode) ? ++ return is_pset_node(fwnode) ? + container_of(fwnode, struct property_set, fwnode) : NULL; + } + +@@ -135,8 +135,8 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) + return of_property_read_bool(to_of_node(fwnode), propname); + else if (is_acpi_node(fwnode)) + return !acpi_node_prop_get(fwnode, propname, NULL); +- else if (is_pset(fwnode)) +- return !!pset_prop_get(to_pset(fwnode), propname); ++ else if (is_pset_node(fwnode)) ++ return !!pset_prop_get(to_pset_node(fwnode), propname); + return false; + } + EXPORT_SYMBOL_GPL(fwnode_property_present); +@@ -323,8 +323,8 @@ EXPORT_SYMBOL_GPL(device_property_match_string); + else if (is_acpi_node(_fwnode_)) \ + _ret_ = acpi_node_prop_read(_fwnode_, _propname_, _proptype_, \ + _val_, _nval_); \ +- else if (is_pset(_fwnode_)) \ +- _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \ ++ else if (is_pset_node(_fwnode_)) \ ++ _ret_ = pset_prop_read_array(to_pset_node(_fwnode_), _propname_, \ + _proptype_, _val_, _nval_); \ + else \ + _ret_ = -ENXIO; \ +@@ -465,8 +465,8 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, + else if (is_acpi_node(fwnode)) + return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, + val, nval); +- else if (is_pset(fwnode)) +- return pset_prop_read_array(to_pset(fwnode), propname, ++ else if (is_pset_node(fwnode)) ++ return pset_prop_read_array(to_pset_node(fwnode), propname, + DEV_PROP_STRING, val, nval); + return -ENXIO; + } +@@ -495,8 +495,8 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, + else if (is_acpi_node(fwnode)) + return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, + val, 1); +- else if (is_pset(fwnode)) +- return pset_prop_read_array(to_pset(fwnode), propname, ++ else if (is_pset_node(fwnode)) ++ return pset_prop_read_array(to_pset_node(fwnode), propname, + DEV_PROP_STRING, val, 1); + return -ENXIO; + } +-- +2.5.0 + diff --git a/freed-ora/current/f24/0003-device-property-refactor-built-in-properties-support.patch b/freed-ora/current/f24/0003-device-property-refactor-built-in-properties-support.patch new file mode 100644 index 000000000..459a74e49 --- /dev/null +++ b/freed-ora/current/f24/0003-device-property-refactor-built-in-properties-support.patch @@ -0,0 +1,236 @@ +From 318a1971826103ecf560875b17236dd4a93e8c88 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:31 +0200 +Subject: [PATCH 03/16] device property: refactor built-in properties support + +Instead of using the type and nval fields we will use length (in bytes) of the +value. The sanity check is done in the accessors. + +The built-in property accessors are split in the same way such as device tree. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 150 ++++++++++++++++++++++++++++++++++------------- + include/linux/property.h | 8 +-- + 2 files changed, 113 insertions(+), 45 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index 2e01f3f..86834bd 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -63,45 +63,107 @@ static struct property_entry *pset_prop_get(struct property_set *pset, + return NULL; + } + +-static int pset_prop_read_array(struct property_set *pset, const char *name, +- enum dev_prop_type type, void *val, size_t nval) ++static void *pset_prop_find(struct property_set *pset, const char *propname, ++ size_t length) + { + struct property_entry *prop; +- unsigned int item_size; ++ void *pointer; + +- prop = pset_prop_get(pset, name); ++ prop = pset_prop_get(pset, propname); ++ if (!prop) ++ return ERR_PTR(-EINVAL); ++ pointer = prop->value.raw_data; ++ if (!pointer) ++ return ERR_PTR(-ENODATA); ++ if (length > prop->length) ++ return ERR_PTR(-EOVERFLOW); ++ return pointer; ++} ++ ++static int pset_prop_read_u8_array(struct property_set *pset, ++ const char *propname, ++ u8 *values, size_t nval) ++{ ++ void *pointer; ++ size_t length = nval * sizeof(*values); ++ ++ pointer = pset_prop_find(pset, propname, length); ++ if (IS_ERR(pointer)) ++ return PTR_ERR(pointer); ++ ++ memcpy(values, pointer, length); ++ return 0; ++} ++ ++static int pset_prop_read_u16_array(struct property_set *pset, ++ const char *propname, ++ u16 *values, size_t nval) ++{ ++ void *pointer; ++ size_t length = nval * sizeof(*values); ++ ++ pointer = pset_prop_find(pset, propname, length); ++ if (IS_ERR(pointer)) ++ return PTR_ERR(pointer); ++ ++ memcpy(values, pointer, length); ++ return 0; ++} ++ ++static int pset_prop_read_u32_array(struct property_set *pset, ++ const char *propname, ++ u32 *values, size_t nval) ++{ ++ void *pointer; ++ size_t length = nval * sizeof(*values); ++ ++ pointer = pset_prop_find(pset, propname, length); ++ if (IS_ERR(pointer)) ++ return PTR_ERR(pointer); ++ ++ memcpy(values, pointer, length); ++ return 0; ++} ++ ++static int pset_prop_read_u64_array(struct property_set *pset, ++ const char *propname, ++ u64 *values, size_t nval) ++{ ++ void *pointer; ++ size_t length = nval * sizeof(*values); ++ ++ pointer = pset_prop_find(pset, propname, length); ++ if (IS_ERR(pointer)) ++ return PTR_ERR(pointer); ++ ++ memcpy(values, pointer, length); ++ return 0; ++} ++ ++static int pset_prop_count_elems_of_size(struct property_set *pset, ++ const char *propname, size_t length) ++{ ++ struct property_entry *prop; ++ ++ prop = pset_prop_get(pset, propname); + if (!prop) +- return -ENODATA; +- +- if (prop->type != type) +- return -EPROTO; +- +- if (!val) +- return prop->nval; +- +- if (prop->nval < nval) +- return -EOVERFLOW; +- +- switch (type) { +- case DEV_PROP_U8: +- item_size = sizeof(u8); +- break; +- case DEV_PROP_U16: +- item_size = sizeof(u16); +- break; +- case DEV_PROP_U32: +- item_size = sizeof(u32); +- break; +- case DEV_PROP_U64: +- item_size = sizeof(u64); +- break; +- case DEV_PROP_STRING: +- item_size = sizeof(const char *); +- break; +- default: + return -EINVAL; +- } +- memcpy(val, prop->value.raw_data, nval * item_size); ++ ++ return prop->length / length; ++} ++ ++static int pset_prop_read_string_array(struct property_set *pset, ++ const char *propname, ++ const char **strings, size_t nval) ++{ ++ void *pointer; ++ size_t length = nval * sizeof(*strings); ++ ++ pointer = pset_prop_find(pset, propname, length); ++ if (IS_ERR(pointer)) ++ return PTR_ERR(pointer); ++ ++ memcpy(strings, pointer, length); + return 0; + } + +@@ -314,6 +376,10 @@ EXPORT_SYMBOL_GPL(device_property_match_string); + (val) ? of_property_read_##type##_array((node), (propname), (val), (nval)) \ + : of_property_count_elems_of_size((node), (propname), sizeof(type)) + ++#define PSET_PROP_READ_ARRAY(node, propname, type, val, nval) \ ++ (val) ? pset_prop_read_##type##_array((node), (propname), (val), (nval)) \ ++ : pset_prop_count_elems_of_size((node), (propname), sizeof(type)) ++ + #define FWNODE_PROP_READ_ARRAY(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ + ({ \ + int _ret_; \ +@@ -324,8 +390,8 @@ EXPORT_SYMBOL_GPL(device_property_match_string); + _ret_ = acpi_node_prop_read(_fwnode_, _propname_, _proptype_, \ + _val_, _nval_); \ + else if (is_pset_node(_fwnode_)) \ +- _ret_ = pset_prop_read_array(to_pset_node(_fwnode_), _propname_, \ +- _proptype_, _val_, _nval_); \ ++ _ret_ = PSET_PROP_READ_ARRAY(to_pset_node(_fwnode_), _propname_, \ ++ _type_, _val_, _nval_); \ + else \ + _ret_ = -ENXIO; \ + _ret_; \ +@@ -466,8 +532,12 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, + return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, + val, nval); + else if (is_pset_node(fwnode)) +- return pset_prop_read_array(to_pset_node(fwnode), propname, +- DEV_PROP_STRING, val, nval); ++ return val ? ++ pset_prop_read_string_array(to_pset_node(fwnode), ++ propname, val, nval) : ++ pset_prop_count_elems_of_size(to_pset_node(fwnode), ++ propname, ++ sizeof(const char *)); + return -ENXIO; + } + EXPORT_SYMBOL_GPL(fwnode_property_read_string_array); +@@ -496,8 +566,8 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, + return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, + val, 1); + else if (is_pset_node(fwnode)) +- return pset_prop_read_array(to_pset_node(fwnode), propname, +- DEV_PROP_STRING, val, 1); ++ return pset_prop_read_string_array(to_pset_node(fwnode), ++ propname, val, 1); + return -ENXIO; + } + EXPORT_SYMBOL_GPL(fwnode_property_read_string); +diff --git a/include/linux/property.h b/include/linux/property.h +index 0a3705a..c29460a 100644 +--- a/include/linux/property.h ++++ b/include/linux/property.h +@@ -144,14 +144,12 @@ static inline int fwnode_property_read_u64(struct fwnode_handle *fwnode, + /** + * struct property_entry - "Built-in" device property representation. + * @name: Name of the property. +- * @type: Type of the property. +- * @nval: Number of items of type @type making up the value. +- * @value: Value of the property (an array of @nval items of type @type). ++ * @length: Length of data making up the value. ++ * @value: Value of the property (an array of items of the given type). + */ + struct property_entry { + const char *name; +- enum dev_prop_type type; +- size_t nval; ++ size_t length; + union { + void *raw_data; + u8 *u8_data; +-- +2.5.0 + diff --git a/freed-ora/current/f24/0004-device-property-keep-single-value-inplace.patch b/freed-ora/current/f24/0004-device-property-keep-single-value-inplace.patch new file mode 100644 index 000000000..39f07cac2 --- /dev/null +++ b/freed-ora/current/f24/0004-device-property-keep-single-value-inplace.patch @@ -0,0 +1,123 @@ +From 66586baba56679baa2da1a10a96ccf15b1e96b95 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:32 +0200 +Subject: [PATCH 04/16] device property: keep single value inplace + +We may save a lot of lines of code and space by keeping single values inside +the struct property_entry. Refactor the implementation to do so. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 33 ++++++++++++++++++++++++++++++--- + include/linux/property.h | 31 +++++++++++++++++++++++-------- + 2 files changed, 53 insertions(+), 11 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index 86834bd..ad3cb09 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -72,7 +72,10 @@ static void *pset_prop_find(struct property_set *pset, const char *propname, + prop = pset_prop_get(pset, propname); + if (!prop) + return ERR_PTR(-EINVAL); +- pointer = prop->value.raw_data; ++ if (prop->is_array) ++ pointer = prop->pointer.raw_data; ++ else ++ pointer = &prop->value.raw_data; + if (!pointer) + return ERR_PTR(-ENODATA); + if (length > prop->length) +@@ -167,6 +170,31 @@ static int pset_prop_read_string_array(struct property_set *pset, + return 0; + } + ++static int pset_prop_read_string(struct property_set *pset, ++ const char *propname, const char **strings) ++{ ++ struct property_entry *prop; ++ const char **pointer; ++ ++ prop = pset_prop_get(pset, propname); ++ if (!prop) ++ return -EINVAL; ++ if (!prop->is_string) ++ return -EILSEQ; ++ if (prop->is_array) { ++ pointer = prop->pointer.str; ++ if (!pointer) ++ return -ENODATA; ++ } else { ++ pointer = &prop->value.str; ++ if (*pointer && strnlen(*pointer, prop->length) >= prop->length) ++ return -EILSEQ; ++ } ++ ++ *strings = *pointer; ++ return 0; ++} ++ + static inline struct fwnode_handle *dev_fwnode(struct device *dev) + { + return IS_ENABLED(CONFIG_OF) && dev->of_node ? +@@ -566,8 +594,7 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, + return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, + val, 1); + else if (is_pset_node(fwnode)) +- return pset_prop_read_string_array(to_pset_node(fwnode), +- propname, val, 1); ++ return pset_prop_read_string(to_pset_node(fwnode), propname, val); + return -ENXIO; + } + EXPORT_SYMBOL_GPL(fwnode_property_read_string); +diff --git a/include/linux/property.h b/include/linux/property.h +index c29460a..69a8a08 100644 +--- a/include/linux/property.h ++++ b/include/linux/property.h +@@ -145,19 +145,34 @@ static inline int fwnode_property_read_u64(struct fwnode_handle *fwnode, + * struct property_entry - "Built-in" device property representation. + * @name: Name of the property. + * @length: Length of data making up the value. +- * @value: Value of the property (an array of items of the given type). ++ * @is_array: True when the property is an array. ++ * @is_string: True when property is a string. ++ * @pointer: Pointer to the property (an array of items of the given type). ++ * @value: Value of the property (when it is a single item of the given type). + */ + struct property_entry { + const char *name; + size_t length; ++ bool is_array; ++ bool is_string; + union { +- void *raw_data; +- u8 *u8_data; +- u16 *u16_data; +- u32 *u32_data; +- u64 *u64_data; +- const char **str; +- } value; ++ union { ++ void *raw_data; ++ u8 *u8_data; ++ u16 *u16_data; ++ u32 *u32_data; ++ u64 *u64_data; ++ const char **str; ++ } pointer; ++ union { ++ unsigned long long raw_data; ++ u8 u8_data; ++ u16 u16_data; ++ u32 u32_data; ++ u64 u64_data; ++ const char *str; ++ } value; ++ }; + }; + + /** +-- +2.5.0 + diff --git a/freed-ora/current/f24/0005-device-property-helper-macros-for-property-entry-cre.patch b/freed-ora/current/f24/0005-device-property-helper-macros-for-property-entry-cre.patch new file mode 100644 index 000000000..877f95ef5 --- /dev/null +++ b/freed-ora/current/f24/0005-device-property-helper-macros-for-property-entry-cre.patch @@ -0,0 +1,84 @@ +From a85f420475334caed12b057ddcaa0b58e0b1ebb7 Mon Sep 17 00:00:00 2001 +From: Heikki Krogerus +Date: Mon, 30 Nov 2015 17:11:33 +0200 +Subject: [PATCH 05/16] device property: helper macros for property entry + creation + +Marcos for easier creation of build-in property entries. + +Signed-off-by: Heikki Krogerus +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + include/linux/property.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 55 insertions(+) + +diff --git a/include/linux/property.h b/include/linux/property.h +index 69a8a08..e4f29d8 100644 +--- a/include/linux/property.h ++++ b/include/linux/property.h +@@ -175,6 +175,61 @@ struct property_entry { + }; + }; + ++#define PROPERTY_ENTRY_INTEGER_ARRAY(_name_, _type_, _val_) \ ++{ \ ++ .name = _name_, \ ++ .length = ARRAY_SIZE(_val_) * sizeof(_type_), \ ++ .is_array = true, \ ++ .pointer._type_##_data = _val_, \ ++} ++ ++#define PROPERTY_ENTRY_U8_ARRAY(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u8, _val_) ++#define PROPERTY_ENTRY_U16_ARRAY(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u16, _val_) ++#define PROPERTY_ENTRY_U32_ARRAY(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u32, _val_) ++#define PROPERTY_ENTRY_U64_ARRAY(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER_ARRAY(_name_, u64, _val_) ++ ++#define PROPERTY_ENTRY_STRING_ARRAY(_name_, _val_) \ ++{ \ ++ .name = _name_, \ ++ .length = ARRAY_SIZE(_val_) * sizeof(const char *), \ ++ .is_array = true, \ ++ .is_string = true, \ ++ .pointer.str = _val_, \ ++} ++ ++#define PROPERTY_ENTRY_INTEGER(_name_, _type_, _val_) \ ++{ \ ++ .name = _name_, \ ++ .length = sizeof(_type_), \ ++ .value._type_##_data = _val_, \ ++} ++ ++#define PROPERTY_ENTRY_U8(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER(_name_, u8, _val_) ++#define PROPERTY_ENTRY_U16(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER(_name_, u16, _val_) ++#define PROPERTY_ENTRY_U32(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER(_name_, u32, _val_) ++#define PROPERTY_ENTRY_U64(_name_, _val_) \ ++ PROPERTY_ENTRY_INTEGER(_name_, u64, _val_) ++ ++#define PROPERTY_ENTRY_STRING(_name_, _val_) \ ++{ \ ++ .name = _name_, \ ++ .length = sizeof(_val_), \ ++ .is_string = true, \ ++ .value.str = _val_, \ ++} ++ ++#define PROPERTY_ENTRY_BOOL(_name_) \ ++{ \ ++ .name = _name_, \ ++} ++ + /** + * struct property_set - Collection of "built-in" device properties. + * @fwnode: Handle to be pointed to by the fwnode field of struct device. +-- +2.5.0 + diff --git a/freed-ora/current/f24/0006-device-property-improve-readability-of-macros.patch b/freed-ora/current/f24/0006-device-property-improve-readability-of-macros.patch new file mode 100644 index 000000000..9792798a2 --- /dev/null +++ b/freed-ora/current/f24/0006-device-property-improve-readability-of-macros.patch @@ -0,0 +1,80 @@ +From 1d656fb757c17e48a8a01bd576d14918701ba55c Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:34 +0200 +Subject: [PATCH 06/16] device property: improve readability of macros + +There is no functional change. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 28 ++++++++++++++-------------- + include/linux/property.h | 4 ++-- + 2 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index ad3cb09..a3538cb 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -400,29 +400,29 @@ int device_property_match_string(struct device *dev, const char *propname, + } + EXPORT_SYMBOL_GPL(device_property_match_string); + +-#define OF_DEV_PROP_READ_ARRAY(node, propname, type, val, nval) \ +- (val) ? of_property_read_##type##_array((node), (propname), (val), (nval)) \ ++#define OF_DEV_PROP_READ_ARRAY(node, propname, type, val, nval) \ ++ (val) ? of_property_read_##type##_array((node), (propname), (val), (nval)) \ + : of_property_count_elems_of_size((node), (propname), sizeof(type)) + + #define PSET_PROP_READ_ARRAY(node, propname, type, val, nval) \ + (val) ? pset_prop_read_##type##_array((node), (propname), (val), (nval)) \ + : pset_prop_count_elems_of_size((node), (propname), sizeof(type)) + +-#define FWNODE_PROP_READ_ARRAY(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ +-({ \ +- int _ret_; \ +- if (is_of_node(_fwnode_)) \ +- _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ +- _type_, _val_, _nval_); \ +- else if (is_acpi_node(_fwnode_)) \ +- _ret_ = acpi_node_prop_read(_fwnode_, _propname_, _proptype_, \ +- _val_, _nval_); \ ++#define FWNODE_PROP_READ_ARRAY(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ ++({ \ ++ int _ret_; \ ++ if (is_of_node(_fwnode_)) \ ++ _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ ++ _type_, _val_, _nval_); \ ++ else if (is_acpi_node(_fwnode_)) \ ++ _ret_ = acpi_node_prop_read(_fwnode_, _propname_, _proptype_, \ ++ _val_, _nval_); \ + else if (is_pset_node(_fwnode_)) \ + _ret_ = PSET_PROP_READ_ARRAY(to_pset_node(_fwnode_), _propname_, \ + _type_, _val_, _nval_); \ +- else \ +- _ret_ = -ENXIO; \ +- _ret_; \ ++ else \ ++ _ret_ = -ENXIO; \ ++ _ret_; \ + }) + + /** +diff --git a/include/linux/property.h b/include/linux/property.h +index e4f29d8..d1cf208 100644 +--- a/include/linux/property.h ++++ b/include/linux/property.h +@@ -73,8 +73,8 @@ int fwnode_property_match_string(struct fwnode_handle *fwnode, + struct fwnode_handle *device_get_next_child_node(struct device *dev, + struct fwnode_handle *child); + +-#define device_for_each_child_node(dev, child) \ +- for (child = device_get_next_child_node(dev, NULL); child; \ ++#define device_for_each_child_node(dev, child) \ ++ for (child = device_get_next_child_node(dev, NULL); child; \ + child = device_get_next_child_node(dev, child)) + + void fwnode_handle_put(struct fwnode_handle *fwnode); +-- +2.5.0 + diff --git a/freed-ora/current/f24/0007-device-property-return-EINVAL-when-property-isn-t-fo.patch b/freed-ora/current/f24/0007-device-property-return-EINVAL-when-property-isn-t-fo.patch new file mode 100644 index 000000000..1cff9c141 --- /dev/null +++ b/freed-ora/current/f24/0007-device-property-return-EINVAL-when-property-isn-t-fo.patch @@ -0,0 +1,65 @@ +From 3c60f1149a2fee9ac4ef3cc27bd830e3bd8d2654 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:35 +0200 +Subject: [PATCH 07/16] device property: return -EINVAL when property isn't + found in ACPI + +Change return code to be in align with OF and built-in device properties error +codes. In particular -EINVAL means property is not found. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/acpi/property.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c +index 88f4306..2aee416 100644 +--- a/drivers/acpi/property.c ++++ b/drivers/acpi/property.c +@@ -346,7 +346,7 @@ void acpi_free_properties(struct acpi_device *adev) + * + * Return: %0 if property with @name has been found (success), + * %-EINVAL if the arguments are invalid, +- * %-ENODATA if the property doesn't exist, ++ * %-EINVAL if the property doesn't exist, + * %-EPROTO if the property value type doesn't match @type. + */ + static int acpi_data_get_property(struct acpi_device_data *data, +@@ -360,7 +360,7 @@ static int acpi_data_get_property(struct acpi_device_data *data, + return -EINVAL; + + if (!data->pointer || !data->properties) +- return -ENODATA; ++ return -EINVAL; + + properties = data->properties; + for (i = 0; i < properties->package.count; i++) { +@@ -375,13 +375,13 @@ static int acpi_data_get_property(struct acpi_device_data *data, + if (!strcmp(name, propname->string.pointer)) { + if (type != ACPI_TYPE_ANY && propvalue->type != type) + return -EPROTO; +- else if (obj) ++ if (obj) + *obj = propvalue; + + return 0; + } + } +- return -ENODATA; ++ return -EINVAL; + } + + /** +@@ -439,7 +439,7 @@ int acpi_node_prop_get(struct fwnode_handle *fwnode, const char *propname, + * + * Return: %0 if array property (package) with @name has been found (success), + * %-EINVAL if the arguments are invalid, +- * %-ENODATA if the property doesn't exist, ++ * %-EINVAL if the property doesn't exist, + * %-EPROTO if the property is not a package or the type of its elements + * doesn't match @type. + */ +-- +2.5.0 + diff --git a/freed-ora/current/f24/0008-device-property-Fallback-to-secondary-fwnode-if-prim.patch b/freed-ora/current/f24/0008-device-property-Fallback-to-secondary-fwnode-if-prim.patch new file mode 100644 index 000000000..8e317d07d --- /dev/null +++ b/freed-ora/current/f24/0008-device-property-Fallback-to-secondary-fwnode-if-prim.patch @@ -0,0 +1,188 @@ +From 362c0b30249e8639489b428ff5acc4a9d81c087f Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:36 +0200 +Subject: [PATCH 08/16] device property: Fallback to secondary fwnode if + primary misses the property + +The struct fwnode has notion of secondary fwnode. This is supposed to used +as fallback if the primary firmware interface (DT, ACPI) does not have the +property in question. + +However, the current implementation never checks the secondary node which +prevents one to add default "built-in" properties to devices. + +This patch adds fallback to the secondary fwnode if the primary fwnode +returns that the property does not exists. + +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 109 ++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 78 insertions(+), 31 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index a3538cb..ebcbe34 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -214,12 +214,8 @@ bool device_property_present(struct device *dev, const char *propname) + } + EXPORT_SYMBOL_GPL(device_property_present); + +-/** +- * fwnode_property_present - check if a property of a firmware node is present +- * @fwnode: Firmware node whose property to check +- * @propname: Name of the property +- */ +-bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) ++static bool __fwnode_property_present(struct fwnode_handle *fwnode, ++ const char *propname) + { + if (is_of_node(fwnode)) + return of_property_read_bool(to_of_node(fwnode), propname); +@@ -229,6 +225,21 @@ bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) + return !!pset_prop_get(to_pset_node(fwnode), propname); + return false; + } ++ ++/** ++ * fwnode_property_present - check if a property of a firmware node is present ++ * @fwnode: Firmware node whose property to check ++ * @propname: Name of the property ++ */ ++bool fwnode_property_present(struct fwnode_handle *fwnode, const char *propname) ++{ ++ bool ret; ++ ++ ret = __fwnode_property_present(fwnode, propname); ++ if (ret == false && fwnode->secondary) ++ ret = __fwnode_property_present(fwnode->secondary, propname); ++ return ret; ++} + EXPORT_SYMBOL_GPL(fwnode_property_present); + + /** +@@ -408,7 +419,7 @@ EXPORT_SYMBOL_GPL(device_property_match_string); + (val) ? pset_prop_read_##type##_array((node), (propname), (val), (nval)) \ + : pset_prop_count_elems_of_size((node), (propname), sizeof(type)) + +-#define FWNODE_PROP_READ_ARRAY(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ ++#define FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ + ({ \ + int _ret_; \ + if (is_of_node(_fwnode_)) \ +@@ -425,6 +436,17 @@ EXPORT_SYMBOL_GPL(device_property_match_string); + _ret_; \ + }) + ++#define FWNODE_PROP_READ_ARRAY(_fwnode_, _propname_, _type_, _proptype_, _val_, _nval_) \ ++({ \ ++ int _ret_; \ ++ _ret_ = FWNODE_PROP_READ(_fwnode_, _propname_, _type_, _proptype_, \ ++ _val_, _nval_); \ ++ if (_ret_ == -EINVAL && _fwnode_->secondary) \ ++ _ret_ = FWNODE_PROP_READ(_fwnode_->secondary, _propname_, _type_, \ ++ _proptype_, _val_, _nval_); \ ++ _ret_; \ ++}) ++ + /** + * fwnode_property_read_u8_array - return a u8 array property of firmware node + * @fwnode: Firmware node to get the property of +@@ -529,6 +551,41 @@ int fwnode_property_read_u64_array(struct fwnode_handle *fwnode, + } + EXPORT_SYMBOL_GPL(fwnode_property_read_u64_array); + ++static int __fwnode_property_read_string_array(struct fwnode_handle *fwnode, ++ const char *propname, ++ const char **val, size_t nval) ++{ ++ if (is_of_node(fwnode)) ++ return val ? ++ of_property_read_string_array(to_of_node(fwnode), ++ propname, val, nval) : ++ of_property_count_strings(to_of_node(fwnode), propname); ++ else if (is_acpi_node(fwnode)) ++ return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, ++ val, nval); ++ else if (is_pset_node(fwnode)) ++ return val ? ++ pset_prop_read_string_array(to_pset_node(fwnode), ++ propname, val, nval) : ++ pset_prop_count_elems_of_size(to_pset_node(fwnode), ++ propname, ++ sizeof(const char *)); ++ return -ENXIO; ++} ++ ++static int __fwnode_property_read_string(struct fwnode_handle *fwnode, ++ const char *propname, const char **val) ++{ ++ if (is_of_node(fwnode)) ++ return of_property_read_string(to_of_node(fwnode), propname, val); ++ else if (is_acpi_node(fwnode)) ++ return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, ++ val, 1); ++ else if (is_pset_node(fwnode)) ++ return pset_prop_read_string(to_pset_node(fwnode), propname, val); ++ return -ENXIO; ++} ++ + /** + * fwnode_property_read_string_array - return string array property of a node + * @fwnode: Firmware node to get the property of +@@ -551,22 +608,13 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, + const char *propname, const char **val, + size_t nval) + { +- if (is_of_node(fwnode)) +- return val ? +- of_property_read_string_array(to_of_node(fwnode), +- propname, val, nval) : +- of_property_count_strings(to_of_node(fwnode), propname); +- else if (is_acpi_node(fwnode)) +- return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, +- val, nval); +- else if (is_pset_node(fwnode)) +- return val ? +- pset_prop_read_string_array(to_pset_node(fwnode), +- propname, val, nval) : +- pset_prop_count_elems_of_size(to_pset_node(fwnode), +- propname, +- sizeof(const char *)); +- return -ENXIO; ++ int ret; ++ ++ ret = __fwnode_property_read_string_array(fwnode, propname, val, nval); ++ if (ret == -EINVAL && fwnode->secondary) ++ ret = __fwnode_property_read_string_array(fwnode->secondary, ++ propname, val, nval); ++ return ret; + } + EXPORT_SYMBOL_GPL(fwnode_property_read_string_array); + +@@ -588,14 +636,13 @@ EXPORT_SYMBOL_GPL(fwnode_property_read_string_array); + int fwnode_property_read_string(struct fwnode_handle *fwnode, + const char *propname, const char **val) + { +- if (is_of_node(fwnode)) +- return of_property_read_string(to_of_node(fwnode), propname, val); +- else if (is_acpi_node(fwnode)) +- return acpi_node_prop_read(fwnode, propname, DEV_PROP_STRING, +- val, 1); +- else if (is_pset_node(fwnode)) +- return pset_prop_read_string(to_pset_node(fwnode), propname, val); +- return -ENXIO; ++ int ret; ++ ++ ret = __fwnode_property_read_string(fwnode, propname, val); ++ if (ret == -EINVAL && fwnode->secondary) ++ ret = __fwnode_property_read_string(fwnode->secondary, ++ propname, val); ++ return ret; + } + EXPORT_SYMBOL_GPL(fwnode_property_read_string); + +-- +2.5.0 + diff --git a/freed-ora/current/f24/0009-device-property-Take-a-copy-of-the-property-set.patch b/freed-ora/current/f24/0009-device-property-Take-a-copy-of-the-property-set.patch new file mode 100644 index 000000000..de24e9f4d --- /dev/null +++ b/freed-ora/current/f24/0009-device-property-Take-a-copy-of-the-property-set.patch @@ -0,0 +1,247 @@ +From 13141e1cb842ad6286c1cfa9a6b7c1577478d03b Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 30 Nov 2015 17:11:37 +0200 +Subject: [PATCH 09/16] device property: Take a copy of the property set + +It is convenient if the property set associated with the device secondary +firmware node is a copy of the original. This allows passing property set +from a stack for example for devices created dynamically. This also ties +the property set lifetime to the associated device. + +Because of that we provide new function device_remove_property_set() that +is used to disassociate and release memory allocated for the property set. + +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/property.c | 191 ++++++++++++++++++++++++++++++++++++++++++----- + include/linux/property.h | 3 +- + 2 files changed, 175 insertions(+), 19 deletions(-) + +diff --git a/drivers/base/property.c b/drivers/base/property.c +index ebcbe34..0b22c8a 100644 +--- a/drivers/base/property.c ++++ b/drivers/base/property.c +@@ -19,24 +19,6 @@ + #include + #include + +-/** +- * device_add_property_set - Add a collection of properties to a device object. +- * @dev: Device to add properties to. +- * @pset: Collection of properties to add. +- * +- * Associate a collection of device properties represented by @pset with @dev +- * as its secondary firmware node. +- */ +-void device_add_property_set(struct device *dev, struct property_set *pset) +-{ +- if (!pset) +- return; +- +- pset->fwnode.type = FWNODE_PDATA; +- set_secondary_fwnode(dev, &pset->fwnode); +-} +-EXPORT_SYMBOL_GPL(device_add_property_set); +- + static inline bool is_pset_node(struct fwnode_handle *fwnode) + { + return fwnode && fwnode->type == FWNODE_PDATA; +@@ -693,6 +675,179 @@ out: + EXPORT_SYMBOL_GPL(fwnode_property_match_string); + + /** ++ * pset_free_set - releases memory allocated for copied property set ++ * @pset: Property set to release ++ * ++ * Function takes previously copied property set and releases all the ++ * memory allocated to it. ++ */ ++static void pset_free_set(struct property_set *pset) ++{ ++ const struct property_entry *prop; ++ size_t i, nval; ++ ++ if (!pset) ++ return; ++ ++ for (prop = pset->properties; prop->name; prop++) { ++ if (prop->is_array) { ++ if (prop->is_string && prop->pointer.str) { ++ nval = prop->length / sizeof(const char *); ++ for (i = 0; i < nval; i++) ++ kfree(prop->pointer.str[i]); ++ } ++ kfree(prop->pointer.raw_data); ++ } else if (prop->is_string) { ++ kfree(prop->value.str); ++ } ++ kfree(prop->name); ++ } ++ ++ kfree(pset->properties); ++ kfree(pset); ++} ++ ++static int pset_copy_entry(struct property_entry *dst, ++ const struct property_entry *src) ++{ ++ const char **d, **s; ++ size_t i, nval; ++ ++ dst->name = kstrdup(src->name, GFP_KERNEL); ++ if (!dst->name) ++ return -ENOMEM; ++ ++ if (src->is_array) { ++ if (src->is_string) { ++ nval = src->length / sizeof(const char *); ++ dst->pointer.str = kcalloc(nval, sizeof(const char *), ++ GFP_KERNEL); ++ if (!dst->pointer.str) ++ return -ENOMEM; ++ ++ d = dst->pointer.str; ++ s = src->pointer.str; ++ for (i = 0; i < nval; i++) { ++ d[i] = kstrdup(s[i], GFP_KERNEL); ++ if (!d[i] && s[i]) ++ return -ENOMEM; ++ } ++ } else { ++ dst->pointer.raw_data = kmemdup(src->pointer.raw_data, ++ src->length, GFP_KERNEL); ++ if (!dst->pointer.raw_data) ++ return -ENOMEM; ++ } ++ } else if (src->is_string) { ++ dst->value.str = kstrdup(src->value.str, GFP_KERNEL); ++ if (!dst->value.str && src->value.str) ++ return -ENOMEM; ++ } else { ++ dst->value.raw_data = src->value.raw_data; ++ } ++ ++ dst->length = src->length; ++ dst->is_array = src->is_array; ++ dst->is_string = src->is_string; ++ ++ return 0; ++} ++ ++/** ++ * pset_copy_set - copies property set ++ * @pset: Property set to copy ++ * ++ * This function takes a deep copy of the given property set and returns ++ * pointer to the copy. Call device_free_property_set() to free resources ++ * allocated in this function. ++ * ++ * Return: Pointer to the new property set or error pointer. ++ */ ++static struct property_set *pset_copy_set(const struct property_set *pset) ++{ ++ const struct property_entry *entry; ++ struct property_set *p; ++ size_t i, n = 0; ++ ++ p = kzalloc(sizeof(*p), GFP_KERNEL); ++ if (!p) ++ return ERR_PTR(-ENOMEM); ++ ++ while (pset->properties[n].name) ++ n++; ++ ++ p->properties = kcalloc(n + 1, sizeof(*entry), GFP_KERNEL); ++ if (!p->properties) { ++ kfree(p); ++ return ERR_PTR(-ENOMEM); ++ } ++ ++ for (i = 0; i < n; i++) { ++ int ret = pset_copy_entry(&p->properties[i], ++ &pset->properties[i]); ++ if (ret) { ++ pset_free_set(p); ++ return ERR_PTR(ret); ++ } ++ } ++ ++ return p; ++} ++ ++/** ++ * device_remove_property_set - Remove properties from a device object. ++ * @dev: Device whose properties to remove. ++ * ++ * The function removes properties previously associated to the device ++ * secondary firmware node with device_add_property_set(). Memory allocated ++ * to the properties will also be released. ++ */ ++void device_remove_property_set(struct device *dev) ++{ ++ struct fwnode_handle *fwnode; ++ ++ fwnode = dev_fwnode(dev); ++ if (!fwnode) ++ return; ++ /* ++ * Pick either primary or secondary node depending which one holds ++ * the pset. If there is no real firmware node (ACPI/DT) primary ++ * will hold the pset. ++ */ ++ if (!is_pset_node(fwnode)) ++ fwnode = fwnode->secondary; ++ if (!IS_ERR(fwnode) && is_pset_node(fwnode)) ++ pset_free_set(to_pset_node(fwnode)); ++ set_secondary_fwnode(dev, NULL); ++} ++EXPORT_SYMBOL_GPL(device_remove_property_set); ++ ++/** ++ * device_add_property_set - Add a collection of properties to a device object. ++ * @dev: Device to add properties to. ++ * @pset: Collection of properties to add. ++ * ++ * Associate a collection of device properties represented by @pset with @dev ++ * as its secondary firmware node. The function takes a copy of @pset. ++ */ ++int device_add_property_set(struct device *dev, const struct property_set *pset) ++{ ++ struct property_set *p; ++ ++ if (!pset) ++ return -EINVAL; ++ ++ p = pset_copy_set(pset); ++ if (IS_ERR(p)) ++ return PTR_ERR(p); ++ ++ p->fwnode.type = FWNODE_PDATA; ++ set_secondary_fwnode(dev, &p->fwnode); ++ return 0; ++} ++EXPORT_SYMBOL_GPL(device_add_property_set); ++ ++/** + * device_get_next_child_node - Return the next child node handle for a device + * @dev: Device to find the next child node for. + * @child: Handle to one of the device's child nodes or a null handle. +diff --git a/include/linux/property.h b/include/linux/property.h +index d1cf208..3a8c7d7 100644 +--- a/include/linux/property.h ++++ b/include/linux/property.h +@@ -240,7 +240,8 @@ struct property_set { + struct property_entry *properties; + }; + +-void device_add_property_set(struct device *dev, struct property_set *pset); ++int device_add_property_set(struct device *dev, const struct property_set *pset); ++void device_remove_property_set(struct device *dev); + + bool device_dma_supported(struct device *dev); + +-- +2.5.0 + diff --git a/freed-ora/current/f24/0010-driver-core-platform-Add-support-for-built-in-device.patch b/freed-ora/current/f24/0010-driver-core-platform-Add-support-for-built-in-device.patch new file mode 100644 index 000000000..823198ef4 --- /dev/null +++ b/freed-ora/current/f24/0010-driver-core-platform-Add-support-for-built-in-device.patch @@ -0,0 +1,112 @@ +From 00bbc1d8e46a92ce7bd80622cf4b09c3b727a741 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 30 Nov 2015 17:11:38 +0200 +Subject: [PATCH 10/16] driver core: platform: Add support for built-in device + properties + +Make it possible to pass built-in device properties to platform device +drivers. This is useful if the system does not have any firmware interface +like Device Tree or ACPI which provides these. + +Properties associated with the platform device will be automatically +released when the corresponding device is removed. + +Suggested-by: Arnd Bergmann +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/platform.c | 25 +++++++++++++++++++++++++ + include/linux/platform_device.h | 5 +++++ + 2 files changed, 30 insertions(+) + +diff --git a/drivers/base/platform.c b/drivers/base/platform.c +index 1dd6d3b..d77ed0c 100644 +--- a/drivers/base/platform.c ++++ b/drivers/base/platform.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + #include "base.h" + #include "power/power.h" +@@ -299,6 +300,22 @@ int platform_device_add_data(struct platform_device *pdev, const void *data, + EXPORT_SYMBOL_GPL(platform_device_add_data); + + /** ++ * platform_device_add_properties - add built-in properties to a platform device ++ * @pdev: platform device to add properties to ++ * @pset: properties to add ++ * ++ * The function will take deep copy of the properties in @pset and attach ++ * the copy to the platform device. The memory associated with properties ++ * will be freed when the platform device is released. ++ */ ++int platform_device_add_properties(struct platform_device *pdev, ++ const struct property_set *pset) ++{ ++ return device_add_property_set(&pdev->dev, pset); ++} ++EXPORT_SYMBOL_GPL(platform_device_add_properties); ++ ++/** + * platform_device_add - add a platform device to device hierarchy + * @pdev: platform device we're adding + * +@@ -409,6 +426,8 @@ void platform_device_del(struct platform_device *pdev) + if (r->parent) + release_resource(r); + } ++ ++ device_remove_property_set(&pdev->dev); + } + } + EXPORT_SYMBOL_GPL(platform_device_del); +@@ -487,6 +506,12 @@ struct platform_device *platform_device_register_full( + if (ret) + goto err; + ++ if (pdevinfo->pset) { ++ ret = platform_device_add_properties(pdev, pdevinfo->pset); ++ if (ret) ++ goto err; ++ } ++ + ret = platform_device_add(pdev); + if (ret) { + err: +diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h +index dc777be..dba40b1 100644 +--- a/include/linux/platform_device.h ++++ b/include/linux/platform_device.h +@@ -18,6 +18,7 @@ + #define PLATFORM_DEVID_AUTO (-2) + + struct mfd_cell; ++struct property_set; + + struct platform_device { + const char *name; +@@ -70,6 +71,8 @@ struct platform_device_info { + const void *data; + size_t size_data; + u64 dma_mask; ++ ++ const struct property_set *pset; + }; + extern struct platform_device *platform_device_register_full( + const struct platform_device_info *pdevinfo); +@@ -167,6 +170,8 @@ extern int platform_device_add_resources(struct platform_device *pdev, + unsigned int num); + extern int platform_device_add_data(struct platform_device *pdev, + const void *data, size_t size); ++extern int platform_device_add_properties(struct platform_device *pdev, ++ const struct property_set *pset); + extern int platform_device_add(struct platform_device *pdev); + extern void platform_device_del(struct platform_device *pdev); + extern void platform_device_put(struct platform_device *pdev); +-- +2.5.0 + diff --git a/freed-ora/current/f24/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch b/freed-ora/current/f24/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch new file mode 100644 index 000000000..4d090acd9 --- /dev/null +++ b/freed-ora/current/f24/0011-driver-core-Do-not-overwrite-secondary-fwnode-with-N.patch @@ -0,0 +1,47 @@ +From 55f89a8a4538803195395bdf347cbba51dcb1906 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 30 Nov 2015 17:11:39 +0200 +Subject: [PATCH 11/16] driver core: Do not overwrite secondary fwnode with + NULL if it is set + +If multiple devices share single firmware node like it is case with MFD +devices, the same firmware node (ACPI) is assigned to all of them. The +function also modifies the shared firmware node in order to preserve +secondary firmware node of the device in question. + +If the new device which is sharing the firmware node does not have +secondary node it will be NULL which will be assigned to the secondary node +of the shared firmware node losing all built-in properties. + +Prevent this by setting the secondary firmware node only if the replacement +is non-NULL. + +Print also warning if someone tries to overwrite secondary node that has +already been assigned. + +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/base/core.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/base/core.c b/drivers/base/core.c +index b7d56c5..0a8bdad 100644 +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -2261,7 +2261,10 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) + if (fwnode_is_primary(fn)) + fn = fn->secondary; + +- fwnode->secondary = fn; ++ if (fn) { ++ WARN_ON(fwnode->secondary); ++ fwnode->secondary = fn; ++ } + dev->fwnode = fwnode; + } else { + dev->fwnode = fwnode_is_primary(dev->fwnode) ? +-- +2.5.0 + diff --git a/freed-ora/current/f24/0012-mfd-core-propagate-device-properties-to-sub-devices-.patch b/freed-ora/current/f24/0012-mfd-core-propagate-device-properties-to-sub-devices-.patch new file mode 100644 index 000000000..d9e52e06c --- /dev/null +++ b/freed-ora/current/f24/0012-mfd-core-propagate-device-properties-to-sub-devices-.patch @@ -0,0 +1,69 @@ +From 4d215cabc784990df11fbcca7af70adf53c9ff17 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:40 +0200 +Subject: [PATCH 12/16] mfd: core: propagate device properties to sub devices + drivers + +In the similar way like we do for the platform data we propagate the device +properties. For example, in case of Intel LPSS drivers we may provide a +specific property to tell the actual device driver an additional information +such as platform name. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/mfd/mfd-core.c | 7 +++++++ + include/linux/mfd/core.h | 5 +++++ + 2 files changed, 12 insertions(+) + +diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c +index 60b60dc..88bd1b1 100644 +--- a/drivers/mfd/mfd-core.c ++++ b/drivers/mfd/mfd-core.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -192,6 +193,12 @@ static int mfd_add_device(struct device *parent, int id, + goto fail_alias; + } + ++ if (cell->pset) { ++ ret = platform_device_add_properties(pdev, cell->pset); ++ if (ret) ++ goto fail_alias; ++ } ++ + ret = mfd_platform_add_cell(pdev, cell, usage_count); + if (ret) + goto fail_alias; +diff --git a/include/linux/mfd/core.h b/include/linux/mfd/core.h +index 27dac3f..bc6f7e0 100644 +--- a/include/linux/mfd/core.h ++++ b/include/linux/mfd/core.h +@@ -17,6 +17,7 @@ + #include + + struct irq_domain; ++struct property_set; + + /* Matches ACPI PNP id, either _HID or _CID, or ACPI _ADR */ + struct mfd_cell_acpi_match { +@@ -44,6 +45,10 @@ struct mfd_cell { + /* platform data passed to the sub devices drivers */ + void *platform_data; + size_t pdata_size; ++ ++ /* device properties passed to the sub devices drivers */ ++ const struct property_set *pset; ++ + /* + * Device Tree compatible string + * See: Documentation/devicetree/usage-model.txt Chapter 2.2 for details +-- +2.5.0 + diff --git a/freed-ora/current/f24/0013-mfd-intel-lpss-Add-support-for-passing-device-proper.patch b/freed-ora/current/f24/0013-mfd-intel-lpss-Add-support-for-passing-device-proper.patch new file mode 100644 index 000000000..5160053b9 --- /dev/null +++ b/freed-ora/current/f24/0013-mfd-intel-lpss-Add-support-for-passing-device-proper.patch @@ -0,0 +1,112 @@ +From e15ad2154b6166804fc04487e0398c9aef9e7c97 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 30 Nov 2015 17:11:41 +0200 +Subject: [PATCH 13/16] mfd: intel-lpss: Add support for passing device + properties + +If the boot firmware does not support ACPI we need a way to pass device +configuration information to the drivers. The unified device properties API +already supports passing platform data via properties so let's take +advantage of that and allow probe drivers to pass set of properties to the +host controller driver. + +In order to do that we need to be able to modify the MFD cell corresponding +the host controller, so make the core driver to take copy of the cell +instead of using it directly. Then we can assign info->pset to the +resulting copy of a cell and let the MFD core to assign that to the +resulting device. + +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/mfd/intel-lpss.c | 16 ++++++++++++---- + drivers/mfd/intel-lpss.h | 2 ++ + 2 files changed, 14 insertions(+), 4 deletions(-) + +diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c +index 6255513..1743788 100644 +--- a/drivers/mfd/intel-lpss.c ++++ b/drivers/mfd/intel-lpss.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -72,7 +73,7 @@ struct intel_lpss { + enum intel_lpss_dev_type type; + struct clk *clk; + struct clk_lookup *clock; +- const struct mfd_cell *cell; ++ struct mfd_cell *cell; + struct device *dev; + void __iomem *priv; + int devid; +@@ -217,6 +218,7 @@ static void intel_lpss_ltr_hide(struct intel_lpss *lpss) + + static int intel_lpss_assign_devs(struct intel_lpss *lpss) + { ++ const struct mfd_cell *cell; + unsigned int type; + + type = lpss->caps & LPSS_PRIV_CAPS_TYPE_MASK; +@@ -224,18 +226,22 @@ static int intel_lpss_assign_devs(struct intel_lpss *lpss) + + switch (type) { + case LPSS_DEV_I2C: +- lpss->cell = &intel_lpss_i2c_cell; ++ cell = &intel_lpss_i2c_cell; + break; + case LPSS_DEV_UART: +- lpss->cell = &intel_lpss_uart_cell; ++ cell = &intel_lpss_uart_cell; + break; + case LPSS_DEV_SPI: +- lpss->cell = &intel_lpss_spi_cell; ++ cell = &intel_lpss_spi_cell; + break; + default: + return -ENODEV; + } + ++ lpss->cell = devm_kmemdup(lpss->dev, cell, sizeof(*cell), GFP_KERNEL); ++ if (!lpss->cell) ++ return -ENOMEM; ++ + lpss->type = type; + + return 0; +@@ -401,6 +407,8 @@ int intel_lpss_probe(struct device *dev, + if (ret) + return ret; + ++ lpss->cell->pset = info->pset; ++ + intel_lpss_init_dev(lpss); + + lpss->devid = ida_simple_get(&intel_lpss_devid_ida, 0, 0, GFP_KERNEL); +diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h +index 2c7f8d7..0dcea9e 100644 +--- a/drivers/mfd/intel-lpss.h ++++ b/drivers/mfd/intel-lpss.h +@@ -16,12 +16,14 @@ + + struct device; + struct resource; ++struct property_set; + + struct intel_lpss_platform_info { + struct resource *mem; + int irq; + unsigned long clk_rate; + const char *clk_con_id; ++ struct property_set *pset; + }; + + int intel_lpss_probe(struct device *dev, +-- +2.5.0 + diff --git a/freed-ora/current/f24/0014-mfd-intel-lpss-Pass-SDA-hold-time-to-I2C-host-contro.patch b/freed-ora/current/f24/0014-mfd-intel-lpss-Pass-SDA-hold-time-to-I2C-host-contro.patch new file mode 100644 index 000000000..c06105162 --- /dev/null +++ b/freed-ora/current/f24/0014-mfd-intel-lpss-Pass-SDA-hold-time-to-I2C-host-contro.patch @@ -0,0 +1,138 @@ +From 028af5941dd870afd5eb6a95c39f25564dcca79a Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 30 Nov 2015 17:11:42 +0200 +Subject: [PATCH 14/16] mfd: intel-lpss: Pass SDA hold time to I2C host + controller driver + +Intel Skylake the LPSS I2C pad circuit has internal delays that require +programming non-zero SDA hold time for the I2C host controller. If this is +not done communication to slave devices may fail with arbitration lost +errors like the one seen below taken from Lenovo Yoga 900: + + i2c_hid i2c-SYNA2B29:00: Fetching the HID descriptor + i2c_hid i2c-SYNA2B29:00: __i2c_hid_command: cmd=20 00 + i2c_designware i2c_designware.1: i2c_dw_handle_tx_abort: lost arbitration + +To fix this we follow what the Windows driver is doing and pass the default +SDA hold time of 230 ns to all Intel Skylake host controllers. This still +allows the platform to override these values by passing special ACPI +methods SSCN and FMCN. + +Reported-by: Kevin Fenzi +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/mfd/intel-lpss-acpi.c | 19 +++++++++++++++++-- + drivers/mfd/intel-lpss-pci.c | 31 +++++++++++++++++++++++-------- + 2 files changed, 40 insertions(+), 10 deletions(-) + +diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c +index b6fd904..06f00d6 100644 +--- a/drivers/mfd/intel-lpss-acpi.c ++++ b/drivers/mfd/intel-lpss-acpi.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include "intel-lpss.h" + +@@ -25,6 +26,20 @@ static const struct intel_lpss_platform_info spt_info = { + .clk_rate = 120000000, + }; + ++static struct property_entry spt_i2c_properties[] = { ++ PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 230), ++ { }, ++}; ++ ++static struct property_set spt_i2c_pset = { ++ .properties = spt_i2c_properties, ++}; ++ ++static const struct intel_lpss_platform_info spt_i2c_info = { ++ .clk_rate = 120000000, ++ .pset = &spt_i2c_pset, ++}; ++ + static const struct intel_lpss_platform_info bxt_info = { + .clk_rate = 100000000, + }; +@@ -35,8 +50,8 @@ static const struct intel_lpss_platform_info bxt_i2c_info = { + + static const struct acpi_device_id intel_lpss_acpi_ids[] = { + /* SPT */ +- { "INT3446", (kernel_ulong_t)&spt_info }, +- { "INT3447", (kernel_ulong_t)&spt_info }, ++ { "INT3446", (kernel_ulong_t)&spt_i2c_info }, ++ { "INT3447", (kernel_ulong_t)&spt_i2c_info }, + /* BXT */ + { "80860AAC", (kernel_ulong_t)&bxt_i2c_info }, + { "80860ABC", (kernel_ulong_t)&bxt_info }, +diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c +index 5bfdfcc..a677480 100644 +--- a/drivers/mfd/intel-lpss-pci.c ++++ b/drivers/mfd/intel-lpss-pci.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include "intel-lpss.h" + +@@ -65,6 +66,20 @@ static const struct intel_lpss_platform_info spt_info = { + .clk_rate = 120000000, + }; + ++static struct property_entry spt_i2c_properties[] = { ++ PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 230), ++ { }, ++}; ++ ++static struct property_set spt_i2c_pset = { ++ .properties = spt_i2c_properties, ++}; ++ ++static const struct intel_lpss_platform_info spt_i2c_info = { ++ .clk_rate = 120000000, ++ .pset = &spt_i2c_pset, ++}; ++ + static const struct intel_lpss_platform_info spt_uart_info = { + .clk_rate = 120000000, + .clk_con_id = "baudclk", +@@ -121,20 +136,20 @@ static const struct pci_device_id intel_lpss_pci_ids[] = { + { PCI_VDEVICE(INTEL, 0x9d28), (kernel_ulong_t)&spt_uart_info }, + { PCI_VDEVICE(INTEL, 0x9d29), (kernel_ulong_t)&spt_info }, + { PCI_VDEVICE(INTEL, 0x9d2a), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0x9d60), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0x9d61), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0x9d62), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0x9d63), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0x9d64), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0x9d65), (kernel_ulong_t)&spt_info }, ++ { PCI_VDEVICE(INTEL, 0x9d60), (kernel_ulong_t)&spt_i2c_info }, ++ { PCI_VDEVICE(INTEL, 0x9d61), (kernel_ulong_t)&spt_i2c_info }, ++ { PCI_VDEVICE(INTEL, 0x9d62), (kernel_ulong_t)&spt_i2c_info }, ++ { PCI_VDEVICE(INTEL, 0x9d63), (kernel_ulong_t)&spt_i2c_info }, ++ { PCI_VDEVICE(INTEL, 0x9d64), (kernel_ulong_t)&spt_i2c_info }, ++ { PCI_VDEVICE(INTEL, 0x9d65), (kernel_ulong_t)&spt_i2c_info }, + { PCI_VDEVICE(INTEL, 0x9d66), (kernel_ulong_t)&spt_uart_info }, + /* SPT-H */ + { PCI_VDEVICE(INTEL, 0xa127), (kernel_ulong_t)&spt_uart_info }, + { PCI_VDEVICE(INTEL, 0xa128), (kernel_ulong_t)&spt_uart_info }, + { PCI_VDEVICE(INTEL, 0xa129), (kernel_ulong_t)&spt_info }, + { PCI_VDEVICE(INTEL, 0xa12a), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0xa160), (kernel_ulong_t)&spt_info }, +- { PCI_VDEVICE(INTEL, 0xa161), (kernel_ulong_t)&spt_info }, ++ { PCI_VDEVICE(INTEL, 0xa160), (kernel_ulong_t)&spt_i2c_info }, ++ { PCI_VDEVICE(INTEL, 0xa161), (kernel_ulong_t)&spt_i2c_info }, + { PCI_VDEVICE(INTEL, 0xa166), (kernel_ulong_t)&spt_uart_info }, + { } + }; +-- +2.5.0 + diff --git a/freed-ora/current/f24/0015-mfd-intel-lpss-Pass-HSUART-configuration-via-propert.patch b/freed-ora/current/f24/0015-mfd-intel-lpss-Pass-HSUART-configuration-via-propert.patch new file mode 100644 index 000000000..5b3c2753e --- /dev/null +++ b/freed-ora/current/f24/0015-mfd-intel-lpss-Pass-HSUART-configuration-via-propert.patch @@ -0,0 +1,55 @@ +From ec14c5395dfbc1d40a49c9f19d2bfde6739d89d5 Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Mon, 30 Nov 2015 17:11:43 +0200 +Subject: [PATCH 15/16] mfd: intel-lpss: Pass HSUART configuration via + properties + +The HS-UART host controller driver needs to know certain properties like +width of the register set if it cannot get that information from ACPI or +DT. In order to support non-ACPI systems we pass this information to the +driver via device properties. + +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Signed-off-by: Rafael J. Wysocki +--- + drivers/mfd/intel-lpss-pci.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c +index a677480..a7136c7 100644 +--- a/drivers/mfd/intel-lpss-pci.c ++++ b/drivers/mfd/intel-lpss-pci.c +@@ -80,9 +80,21 @@ static const struct intel_lpss_platform_info spt_i2c_info = { + .pset = &spt_i2c_pset, + }; + ++static struct property_entry uart_properties[] = { ++ PROPERTY_ENTRY_U32("reg-io-width", 4), ++ PROPERTY_ENTRY_U32("reg-shift", 2), ++ PROPERTY_ENTRY_BOOL("snps,uart-16550-compatible"), ++ { }, ++}; ++ ++static struct property_set uart_pset = { ++ .properties = uart_properties, ++}; ++ + static const struct intel_lpss_platform_info spt_uart_info = { + .clk_rate = 120000000, + .clk_con_id = "baudclk", ++ .pset = &uart_pset, + }; + + static const struct intel_lpss_platform_info bxt_info = { +@@ -92,6 +104,7 @@ static const struct intel_lpss_platform_info bxt_info = { + static const struct intel_lpss_platform_info bxt_uart_info = { + .clk_rate = 100000000, + .clk_con_id = "baudclk", ++ .pset = &uart_pset, + }; + + static const struct intel_lpss_platform_info bxt_i2c_info = { +-- +2.5.0 + diff --git a/freed-ora/current/f24/0016-i2c-designware-Convert-to-use-unified-device-propert.patch b/freed-ora/current/f24/0016-i2c-designware-Convert-to-use-unified-device-propert.patch new file mode 100644 index 000000000..f3039a1bd --- /dev/null +++ b/freed-ora/current/f24/0016-i2c-designware-Convert-to-use-unified-device-propert.patch @@ -0,0 +1,106 @@ +From 4c5301abbf81f4351416cec1e8a02647d96e6fd1 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Mon, 30 Nov 2015 17:11:44 +0200 +Subject: [PATCH 16/16] i2c: designware: Convert to use unified device property + API + +With ACPI _DSD (introduced in ACPI v5.1) it is now possible to pass device +configuration information from ACPI in addition to DT. In order to support +this, convert the driver to use the unified device property accessors +instead of DT specific. + +Change to ordering a bit so that we first try platform data and if that's +not available look from device properties. ACPI *CNT methods are then used +as last resort to override everything else. + +Signed-off-by: Mika Westerberg +Signed-off-by: Andy Shevchenko +Acked-by: Jarkko Nikula +Acked-by: Wolfram Sang +Signed-off-by: Rafael J. Wysocki +--- + drivers/i2c/busses/i2c-designware-platdrv.c | 50 +++++++++++++---------------- + 1 file changed, 23 insertions(+), 27 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c +index 809579e..06061b5 100644 +--- a/drivers/i2c/busses/i2c-designware-platdrv.c ++++ b/drivers/i2c/busses/i2c-designware-platdrv.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -129,10 +130,10 @@ static inline int dw_i2c_acpi_configure(struct platform_device *pdev) + + static int dw_i2c_plat_probe(struct platform_device *pdev) + { ++ struct dw_i2c_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct dw_i2c_dev *dev; + struct i2c_adapter *adap; + struct resource *mem; +- struct dw_i2c_platform_data *pdata; + int irq, r; + u32 clk_freq, ht = 0; + +@@ -156,33 +157,28 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) + /* fast mode by default because of legacy reasons */ + clk_freq = 400000; + +- if (has_acpi_companion(&pdev->dev)) { +- dw_i2c_acpi_configure(pdev); +- } else if (pdev->dev.of_node) { +- of_property_read_u32(pdev->dev.of_node, +- "i2c-sda-hold-time-ns", &ht); +- +- of_property_read_u32(pdev->dev.of_node, +- "i2c-sda-falling-time-ns", +- &dev->sda_falling_time); +- of_property_read_u32(pdev->dev.of_node, +- "i2c-scl-falling-time-ns", +- &dev->scl_falling_time); +- +- of_property_read_u32(pdev->dev.of_node, "clock-frequency", +- &clk_freq); +- +- /* Only standard mode at 100kHz and fast mode at 400kHz +- * are supported. +- */ +- if (clk_freq != 100000 && clk_freq != 400000) { +- dev_err(&pdev->dev, "Only 100kHz and 400kHz supported"); +- return -EINVAL; +- } ++ if (pdata) { ++ clk_freq = pdata->i2c_scl_freq; + } else { +- pdata = dev_get_platdata(&pdev->dev); +- if (pdata) +- clk_freq = pdata->i2c_scl_freq; ++ device_property_read_u32(&pdev->dev, "i2c-sda-hold-time-ns", ++ &ht); ++ device_property_read_u32(&pdev->dev, "i2c-sda-falling-time-ns", ++ &dev->sda_falling_time); ++ device_property_read_u32(&pdev->dev, "i2c-scl-falling-time-ns", ++ &dev->scl_falling_time); ++ device_property_read_u32(&pdev->dev, "clock-frequency", ++ &clk_freq); ++ } ++ ++ if (has_acpi_companion(&pdev->dev)) ++ dw_i2c_acpi_configure(pdev); ++ ++ /* ++ * Only standard mode at 100kHz and fast mode at 400kHz are supported. ++ */ ++ if (clk_freq != 100000 && clk_freq != 400000) { ++ dev_err(&pdev->dev, "Only 100kHz and 400kHz supported"); ++ return -EINVAL; + } + + r = i2c_dw_eval_lock_support(dev); +-- +2.5.0 + diff --git a/freed-ora/current/f24/ACPI-Limit-access-to-custom_method.patch b/freed-ora/current/f24/ACPI-Limit-access-to-custom_method.patch new file mode 100644 index 000000000..38236753e --- /dev/null +++ b/freed-ora/current/f24/ACPI-Limit-access-to-custom_method.patch @@ -0,0 +1,31 @@ +From 4b85149b764cd024e3dd2aff9eb22a9e1aadd1fa Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Mar 2012 08:39:37 -0500 +Subject: [PATCH 04/20] ACPI: Limit access to custom_method + +custom_method effectively allows arbitrary access to system memory, making +it possible for an attacker to circumvent restrictions on module loading. +Disable it if any such restrictions have been enabled. + +Signed-off-by: Matthew Garrett +--- + drivers/acpi/custom_method.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/acpi/custom_method.c b/drivers/acpi/custom_method.c +index c68e72414a67..4277938af700 100644 +--- a/drivers/acpi/custom_method.c ++++ b/drivers/acpi/custom_method.c +@@ -29,6 +29,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, + struct acpi_table_header table; + acpi_status status; + ++ if (secure_modules()) ++ return -EPERM; ++ + if (!(*ppos)) { + /* parse the table header to get the table length */ + if (count <= sizeof(struct acpi_table_header)) +-- +2.4.3 + diff --git a/freed-ora/current/f24/ARM-tegra-usb-no-reset.patch b/freed-ora/current/f24/ARM-tegra-usb-no-reset.patch new file mode 100644 index 000000000..8ea4f5174 --- /dev/null +++ b/freed-ora/current/f24/ARM-tegra-usb-no-reset.patch @@ -0,0 +1,28 @@ +From: Peter Robinson +Date: Thu, 3 May 2012 20:27:11 +0100 +Subject: [PATCH] ARM: tegra: usb no reset + +Patch for disconnect issues with storage attached to a + tegra-ehci controller +--- + drivers/usb/core/hub.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c +index 43cb2f2e3b43..7f838ec11c81 100644 +--- a/drivers/usb/core/hub.c ++++ b/drivers/usb/core/hub.c +@@ -4996,6 +4996,13 @@ static void hub_event(struct work_struct *work) + (u16) hub->change_bits[0], + (u16) hub->event_bits[0]); + ++ /* Don't disconnect USB-SATA on TrimSlice */ ++ if (strcmp(dev_name(hdev->bus->controller), "tegra-ehci.0") == 0) { ++ if ((hdev->state == 7) && (hub->change_bits[0] == 0) && ++ (hub->event_bits[0] == 0x2)) ++ hub->event_bits[0] = 0; ++ } ++ + /* Lock the device, then check to see if we were + * disconnected while waiting for the lock to succeed. */ + usb_lock_device(hdev); diff --git a/freed-ora/current/f24/Add-EFI-signature-data-types.patch b/freed-ora/current/f24/Add-EFI-signature-data-types.patch new file mode 100644 index 000000000..35f170abb --- /dev/null +++ b/freed-ora/current/f24/Add-EFI-signature-data-types.patch @@ -0,0 +1,57 @@ +From 47f6b5c281137394d627e275cb80980492d00d84 Mon Sep 17 00:00:00 2001 +From: Dave Howells +Date: Tue, 23 Oct 2012 09:30:54 -0400 +Subject: [PATCH 15/20] Add EFI signature data types + +Add the data types that are used for containing hashes, keys and certificates +for cryptographic verification. + +Bugzilla: N/A +Upstream-status: Fedora mustard for now + +Signed-off-by: David Howells +--- + include/linux/efi.h | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/include/linux/efi.h b/include/linux/efi.h +index 4dc970e..82d6218 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -599,6 +599,12 @@ void efi_native_runtime_setup(void); + #define EFI_PROPERTIES_TABLE_GUID \ + EFI_GUID( 0x880aaca3, 0x4adc, 0x4a04, 0x90, 0x79, 0xb7, 0x47, 0x34, 0x08, 0x25, 0xe5 ) + ++#define EFI_CERT_SHA256_GUID \ ++ EFI_GUID( 0xc1c41626, 0x504c, 0x4092, 0xac, 0xa9, 0x41, 0xf9, 0x36, 0x93, 0x43, 0x28 ) ++ ++#define EFI_CERT_X509_GUID \ ++ EFI_GUID( 0xa5c059a1, 0x94e4, 0x4aa7, 0x87, 0xb5, 0xab, 0x15, 0x5c, 0x2b, 0xf0, 0x72 ) ++ + typedef struct { + efi_guid_t guid; + u64 table; +@@ -823,6 +829,20 @@ typedef struct { + + #define EFI_INVALID_TABLE_ADDR (~0UL) + ++typedef struct { ++ efi_guid_t signature_owner; ++ u8 signature_data[]; ++} efi_signature_data_t; ++ ++typedef struct { ++ efi_guid_t signature_type; ++ u32 signature_list_size; ++ u32 signature_header_size; ++ u32 signature_size; ++ u8 signature_header[]; ++ /* efi_signature_data_t signatures[][] */ ++} efi_signature_list_t; ++ + /* + * All runtime access to EFI goes through this structure: + */ +-- +2.5.0 + diff --git a/freed-ora/current/f24/Add-an-EFI-signature-blob-parser-and-key-loader.patch b/freed-ora/current/f24/Add-an-EFI-signature-blob-parser-and-key-loader.patch new file mode 100644 index 000000000..06ddd1596 --- /dev/null +++ b/freed-ora/current/f24/Add-an-EFI-signature-blob-parser-and-key-loader.patch @@ -0,0 +1,179 @@ +From c279ba86f93cf6a75d078e2d0e3f59d4ba8a2dd0 Mon Sep 17 00:00:00 2001 +From: Dave Howells +Date: Tue, 23 Oct 2012 09:36:28 -0400 +Subject: [PATCH 16/20] Add an EFI signature blob parser and key loader. + +X.509 certificates are loaded into the specified keyring as asymmetric type +keys. + +Signed-off-by: David Howells +--- + crypto/asymmetric_keys/Kconfig | 8 +++ + crypto/asymmetric_keys/Makefile | 1 + + crypto/asymmetric_keys/efi_parser.c | 109 ++++++++++++++++++++++++++++++++++++ + include/linux/efi.h | 4 ++ + 4 files changed, 122 insertions(+) + create mode 100644 crypto/asymmetric_keys/efi_parser.c + +diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig +index 4870f28403f5..4a1b50d73b80 100644 +--- a/crypto/asymmetric_keys/Kconfig ++++ b/crypto/asymmetric_keys/Kconfig +@@ -67,4 +67,12 @@ config SIGNED_PE_FILE_VERIFICATION + This option provides support for verifying the signature(s) on a + signed PE binary. + ++config EFI_SIGNATURE_LIST_PARSER ++ bool "EFI signature list parser" ++ depends on EFI ++ select X509_CERTIFICATE_PARSER ++ help ++ This option provides support for parsing EFI signature lists for ++ X.509 certificates and turning them into keys. ++ + endif # ASYMMETRIC_KEY_TYPE +diff --git a/crypto/asymmetric_keys/Makefile b/crypto/asymmetric_keys/Makefile +index cd1406f9b14a..d9db380bbe53 100644 +--- a/crypto/asymmetric_keys/Makefile ++++ b/crypto/asymmetric_keys/Makefile +@@ -8,6 +8,7 @@ asymmetric_keys-y := asymmetric_type.o signature.o + + obj-$(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE) += public_key.o + obj-$(CONFIG_PUBLIC_KEY_ALGO_RSA) += rsa.o ++obj-$(CONFIG_EFI_SIGNATURE_LIST_PARSER) += efi_parser.o + + # + # X.509 Certificate handling +diff --git a/crypto/asymmetric_keys/efi_parser.c b/crypto/asymmetric_keys/efi_parser.c +new file mode 100644 +index 000000000000..424896a0b169 +--- /dev/null ++++ b/crypto/asymmetric_keys/efi_parser.c +@@ -0,0 +1,109 @@ ++/* EFI signature/key/certificate list parser ++ * ++ * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved. ++ * Written by David Howells (dhowells@redhat.com) ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public Licence ++ * as published by the Free Software Foundation; either version ++ * 2 of the Licence, or (at your option) any later version. ++ */ ++ ++#define pr_fmt(fmt) "EFI: "fmt ++#include ++#include ++#include ++#include ++#include ++ ++static __initdata efi_guid_t efi_cert_x509_guid = EFI_CERT_X509_GUID; ++ ++/** ++ * parse_efi_signature_list - Parse an EFI signature list for certificates ++ * @data: The data blob to parse ++ * @size: The size of the data blob ++ * @keyring: The keyring to add extracted keys to ++ */ ++int __init parse_efi_signature_list(const void *data, size_t size, struct key *keyring) ++{ ++ unsigned offs = 0; ++ size_t lsize, esize, hsize, elsize; ++ ++ pr_devel("-->%s(,%zu)\n", __func__, size); ++ ++ while (size > 0) { ++ efi_signature_list_t list; ++ const efi_signature_data_t *elem; ++ key_ref_t key; ++ ++ if (size < sizeof(list)) ++ return -EBADMSG; ++ ++ memcpy(&list, data, sizeof(list)); ++ pr_devel("LIST[%04x] guid=%pUl ls=%x hs=%x ss=%x\n", ++ offs, ++ list.signature_type.b, list.signature_list_size, ++ list.signature_header_size, list.signature_size); ++ ++ lsize = list.signature_list_size; ++ hsize = list.signature_header_size; ++ esize = list.signature_size; ++ elsize = lsize - sizeof(list) - hsize; ++ ++ if (lsize > size) { ++ pr_devel("<--%s() = -EBADMSG [overrun @%x]\n", ++ __func__, offs); ++ return -EBADMSG; ++ } ++ if (lsize < sizeof(list) || ++ lsize - sizeof(list) < hsize || ++ esize < sizeof(*elem) || ++ elsize < esize || ++ elsize % esize != 0) { ++ pr_devel("- bad size combo @%x\n", offs); ++ return -EBADMSG; ++ } ++ ++ if (efi_guidcmp(list.signature_type, efi_cert_x509_guid) != 0) { ++ data += lsize; ++ size -= lsize; ++ offs += lsize; ++ continue; ++ } ++ ++ data += sizeof(list) + hsize; ++ size -= sizeof(list) + hsize; ++ offs += sizeof(list) + hsize; ++ ++ for (; elsize > 0; elsize -= esize) { ++ elem = data; ++ ++ pr_devel("ELEM[%04x]\n", offs); ++ ++ key = key_create_or_update( ++ make_key_ref(keyring, 1), ++ "asymmetric", ++ NULL, ++ &elem->signature_data, ++ esize - sizeof(*elem), ++ (KEY_POS_ALL & ~KEY_POS_SETATTR) | ++ KEY_USR_VIEW, ++ KEY_ALLOC_NOT_IN_QUOTA | ++ KEY_ALLOC_TRUSTED); ++ ++ if (IS_ERR(key)) ++ pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", ++ PTR_ERR(key)); ++ else ++ pr_notice("Loaded cert '%s' linked to '%s'\n", ++ key_ref_to_ptr(key)->description, ++ keyring->description); ++ ++ data += esize; ++ size -= esize; ++ offs += esize; ++ } ++ } ++ ++ return 0; ++} +diff --git a/include/linux/efi.h b/include/linux/efi.h +index fac43c611614..414c3c3d988d 100644 +--- a/include/linux/efi.h ++++ b/include/linux/efi.h +@@ -941,6 +941,10 @@ extern bool efi_poweroff_required(void); + char * __init efi_md_typeattr_format(char *buf, size_t size, + const efi_memory_desc_t *md); + ++struct key; ++extern int __init parse_efi_signature_list(const void *data, size_t size, ++ struct key *keyring); ++ + /** + * efi_range_is_wc - check the WC bit on an address range + * @start: starting kvirt address +-- +2.4.3 + diff --git a/freed-ora/current/f24/Add-option-to-automatically-enforce-module-signature.patch b/freed-ora/current/f24/Add-option-to-automatically-enforce-module-signature.patch new file mode 100644 index 000000000..015371b8b --- /dev/null +++ b/freed-ora/current/f24/Add-option-to-automatically-enforce-module-signature.patch @@ -0,0 +1,186 @@ +From 37431394b3eeb1ef6d38d0e6b2693210606c2c2c Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Aug 2013 18:36:30 -0400 +Subject: [PATCH 10/20] Add option to automatically enforce module signatures + when in Secure Boot mode + +UEFI Secure Boot provides a mechanism for ensuring that the firmware will +only load signed bootloaders and kernels. Certain use cases may also +require that all kernel modules also be signed. Add a configuration option +that enforces this automatically when enabled. + +Signed-off-by: Matthew Garrett +--- + Documentation/x86/zero-page.txt | 2 ++ + arch/x86/Kconfig | 10 ++++++++++ + arch/x86/boot/compressed/eboot.c | 36 +++++++++++++++++++++++++++++++++++ + arch/x86/include/uapi/asm/bootparam.h | 3 ++- + arch/x86/kernel/setup.c | 6 ++++++ + include/linux/module.h | 6 ++++++ + kernel/module.c | 7 +++++++ + 7 files changed, 69 insertions(+), 1 deletion(-) + +diff --git a/Documentation/x86/zero-page.txt b/Documentation/x86/zero-page.txt +index 95a4d34af3fd..b8527c6b7646 100644 +--- a/Documentation/x86/zero-page.txt ++++ b/Documentation/x86/zero-page.txt +@@ -31,6 +31,8 @@ Offset Proto Name Meaning + 1E9/001 ALL eddbuf_entries Number of entries in eddbuf (below) + 1EA/001 ALL edd_mbr_sig_buf_entries Number of entries in edd_mbr_sig_buffer + (below) ++1EB/001 ALL kbd_status Numlock is enabled ++1EC/001 ALL secure_boot Secure boot is enabled in the firmware + 1EF/001 ALL sentinel Used to detect broken bootloaders + 290/040 ALL edd_mbr_sig_buffer EDD MBR signatures + 2D0/A00 ALL e820_map E820 memory map table +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig +index cc0d73eac047..14db458f4774 100644 +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -1734,6 +1734,16 @@ config EFI_MIXED + + If unsure, say N. + ++config EFI_SECURE_BOOT_SIG_ENFORCE ++ def_bool n ++ prompt "Force module signing when UEFI Secure Boot is enabled" ++ ---help--- ++ UEFI Secure Boot provides a mechanism for ensuring that the ++ firmware will only load signed bootloaders and kernels. Certain ++ use cases may also require that all kernel modules also be signed. ++ Say Y here to automatically enable module signature enforcement ++ when a system boots with UEFI Secure Boot enabled. ++ + config SECCOMP + def_bool y + prompt "Enable seccomp to safely compute untrusted bytecode" +diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c +index ee1b6d346b98..b4de3faa3f29 100644 +--- a/arch/x86/boot/compressed/eboot.c ++++ b/arch/x86/boot/compressed/eboot.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + #include "../string.h" + #include "eboot.h" +@@ -827,6 +828,37 @@ out: + return status; + } + ++static int get_secure_boot(void) ++{ ++ u8 sb, setup; ++ unsigned long datasize = sizeof(sb); ++ efi_guid_t var_guid = EFI_GLOBAL_VARIABLE_GUID; ++ efi_status_t status; ++ ++ status = efi_early->call((unsigned long)sys_table->runtime->get_variable, ++ L"SecureBoot", &var_guid, NULL, &datasize, &sb); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ if (sb == 0) ++ return 0; ++ ++ ++ status = efi_early->call((unsigned long)sys_table->runtime->get_variable, ++ L"SetupMode", &var_guid, NULL, &datasize, ++ &setup); ++ ++ if (status != EFI_SUCCESS) ++ return 0; ++ ++ if (setup == 1) ++ return 0; ++ ++ return 1; ++} ++ ++ + /* + * See if we have Graphics Output Protocol + */ +@@ -1412,6 +1444,10 @@ struct boot_params *efi_main(struct efi_config *c, + else + setup_boot_services32(efi_early); + ++ sanitize_boot_params(boot_params); ++ ++ boot_params->secure_boot = get_secure_boot(); ++ + setup_graphics(boot_params); + + setup_efi_pci(boot_params); +diff --git a/arch/x86/include/uapi/asm/bootparam.h b/arch/x86/include/uapi/asm/bootparam.h +index 329254373479..b61f8533c0fd 100644 +--- a/arch/x86/include/uapi/asm/bootparam.h ++++ b/arch/x86/include/uapi/asm/bootparam.h +@@ -134,7 +134,8 @@ struct boot_params { + __u8 eddbuf_entries; /* 0x1e9 */ + __u8 edd_mbr_sig_buf_entries; /* 0x1ea */ + __u8 kbd_status; /* 0x1eb */ +- __u8 _pad5[3]; /* 0x1ec */ ++ __u8 secure_boot; /* 0x1ec */ ++ __u8 _pad5[2]; /* 0x1ed */ + /* + * The sentinel is set to a nonzero value (0xff) in header.S. + * +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index baadbf90a7c5..1ac118146e90 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -1135,6 +1135,12 @@ void __init setup_arch(char **cmdline_p) + + io_delay_init(); + ++#ifdef CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE ++ if (boot_params.secure_boot) { ++ enforce_signed_modules(); ++ } ++#endif ++ + /* + * Parse the ACPI tables for possible boot-time SMP configuration. + */ +diff --git a/include/linux/module.h b/include/linux/module.h +index db386349cd01..4b8df91f03cd 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -273,6 +273,12 @@ const struct exception_table_entry *search_exception_tables(unsigned long add); + + struct notifier_block; + ++#ifdef CONFIG_MODULE_SIG ++extern void enforce_signed_modules(void); ++#else ++static inline void enforce_signed_modules(void) {}; ++#endif ++ + #ifdef CONFIG_MODULES + + extern int modules_disabled; /* for sysctl */ +diff --git a/kernel/module.c b/kernel/module.c +index 7f045246e123..2b403ab0ef29 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -4088,6 +4088,13 @@ void module_layout(struct module *mod, + EXPORT_SYMBOL(module_layout); + #endif + ++#ifdef CONFIG_MODULE_SIG ++void enforce_signed_modules(void) ++{ ++ sig_enforce = true; ++} ++#endif ++ + bool secure_modules(void) + { + #ifdef CONFIG_MODULE_SIG +-- +2.4.3 + diff --git a/freed-ora/current/f24/Add-secure_modules-call.patch b/freed-ora/current/f24/Add-secure_modules-call.patch new file mode 100644 index 000000000..b6e039ff0 --- /dev/null +++ b/freed-ora/current/f24/Add-secure_modules-call.patch @@ -0,0 +1,63 @@ +From a1aaf20cffb1a949c5d6b1198690c7c30cfda4d5 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Fri, 9 Aug 2013 17:58:15 -0400 +Subject: [PATCH 01/20] Add secure_modules() call + +Provide a single call to allow kernel code to determine whether the system +has been configured to either disable module loading entirely or to load +only modules signed with a trusted key. + +Bugzilla: N/A +Upstream-status: Fedora mustard. Replaced by securelevels, but that was nak'd + +Signed-off-by: Matthew Garrett +--- + include/linux/module.h | 6 ++++++ + kernel/module.c | 10 ++++++++++ + 2 files changed, 16 insertions(+) + +diff --git a/include/linux/module.h b/include/linux/module.h +index 3a19c79918e0..db386349cd01 100644 +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -635,6 +635,8 @@ static inline bool module_requested_async_probing(struct module *module) + return module && module->async_probe_requested; + } + ++extern bool secure_modules(void); ++ + #else /* !CONFIG_MODULES... */ + + /* Given an address, look for it in the exception tables. */ +@@ -751,6 +753,10 @@ static inline bool module_requested_async_probing(struct module *module) + return false; + } + ++static inline bool secure_modules(void) ++{ ++ return false; ++} + #endif /* CONFIG_MODULES */ + + #ifdef CONFIG_SYSFS +diff --git a/kernel/module.c b/kernel/module.c +index b86b7bf1be38..7f045246e123 100644 +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -4087,3 +4087,13 @@ void module_layout(struct module *mod, + } + EXPORT_SYMBOL(module_layout); + #endif ++ ++bool secure_modules(void) ++{ ++#ifdef CONFIG_MODULE_SIG ++ return (sig_enforce || modules_disabled); ++#else ++ return modules_disabled; ++#endif ++} ++EXPORT_SYMBOL(secure_modules); +-- +2.4.3 + diff --git a/freed-ora/current/f24/Add-sysrq-option-to-disable-secure-boot-mode.patch b/freed-ora/current/f24/Add-sysrq-option-to-disable-secure-boot-mode.patch new file mode 100644 index 000000000..4600848cf --- /dev/null +++ b/freed-ora/current/f24/Add-sysrq-option-to-disable-secure-boot-mode.patch @@ -0,0 +1,246 @@ +From 16d2ba5d5bc46e67e6aa7a3d113fbcc18c217388 Mon Sep 17 00:00:00 2001 +From: Kyle McMartin +Date: Fri, 30 Aug 2013 09:28:51 -0400 +Subject: [PATCH 20/20] Add sysrq option to disable secure boot mode + +Bugzilla: N/A +Upstream-status: Fedora mustard +--- + arch/x86/kernel/setup.c | 36 ++++++++++++++++++++++++++++++++++++ + drivers/input/misc/uinput.c | 1 + + drivers/tty/sysrq.c | 19 +++++++++++++------ + include/linux/input.h | 5 +++++ + include/linux/sysrq.h | 8 +++++++- + kernel/debug/kdb/kdb_main.c | 2 +- + kernel/module.c | 2 +- + 7 files changed, 64 insertions(+), 9 deletions(-) + +diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c +index f93826b8522c..41679b1aca83 100644 +--- a/arch/x86/kernel/setup.c ++++ b/arch/x86/kernel/setup.c +@@ -70,6 +70,11 @@ + #include + #include + ++#include ++#include ++#include ++#include ++ + #include