From 5e82e1ed2f71586ec4a9c4e21449a9a78013c38e Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 31 Mar 2020 20:27:11 +0100 Subject: [PATCH 1/3] oxnas: fix warning in SATA driver drivers/ata/sata_oxnas.c: In function 'sata_oxnas_port_irq': drivers/ata/sata_oxnas.c:2126:25: warning: left shift count >= width of type [-Wshift-count-overflow] if (ap->qc_active & (1 << ATA_TAG_INTERNAL)) { ^~ Signed-off-by: Daniel Golle --- target/linux/oxnas/files/drivers/ata/sata_oxnas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/oxnas/files/drivers/ata/sata_oxnas.c b/target/linux/oxnas/files/drivers/ata/sata_oxnas.c index 64afa728a1..6e0f7a72a6 100644 --- a/target/linux/oxnas/files/drivers/ata/sata_oxnas.c +++ b/target/linux/oxnas/files/drivers/ata/sata_oxnas.c @@ -2123,7 +2123,7 @@ static void sata_oxnas_port_irq(struct ata_port *ap, int force_error) DPRINTK("ENTER port %d irqstatus %x\n", ap->port_no, ioread32(port_base + INT_STATUS)); - if (ap->qc_active & (1 << ATA_TAG_INTERNAL)) { + if (ap->qc_active & (1ULL << ATA_TAG_INTERNAL)) { qc = ata_qc_from_tag(ap, ATA_TAG_INTERNAL); DPRINTK("completing non-ncq cmd\n"); From 9f14216a2c4c9d669d8033df31f40f2ca05ce41d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 28 Mar 2020 21:55:31 +0000 Subject: [PATCH 2/3] oxnas: some improvements for Shuttle KD20 * install kmod-hwmon-drivetemp by default * wire up thermal zone * fix fan GPIO polarity * fix i2c-gpio GPIO_OPEN_DRAIN Signed-off-by: Daniel Golle --- target/linux/oxnas/config-5.4 | 6 +++ .../arch/arm/boot/dts/ox820-shuttle-kd20.dts | 54 +++++++++++++++++-- target/linux/oxnas/image/ox820.mk | 6 +-- 3 files changed, 59 insertions(+), 7 deletions(-) diff --git a/target/linux/oxnas/config-5.4 b/target/linux/oxnas/config-5.4 index 973bbc79dd..112d4e43be 100644 --- a/target/linux/oxnas/config-5.4 +++ b/target/linux/oxnas/config-5.4 @@ -328,6 +328,12 @@ CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y CONFIG_SWPHY=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_OF=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TIMER_OF=y CONFIG_TIMER_PROBE=y diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts index 61ea2b57a7..0bcd2fcf00 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts @@ -4,6 +4,7 @@ #include #include +#include / { model = "Shuttle KD20"; @@ -30,13 +31,48 @@ led-upgrade = &led_warn; }; + thermal_zones { + chassis-thermal { + /* Poll every 20 seconds */ + polling-delay = <20000>; + /* Poll every 2nd second when cooling */ + polling-delay-passive = <2000>; + + thermal-sensors = <&hdd0_temp>, <&hdd1_temp>; + + trips { + chassis_alert0: chassis-alert0 { + /* At 43 degrees turn on fan */ + temperature = <43000>; + hysteresis = <3000>; + type = "active"; + }; + + chassis_alert1: chassis-alert1 { + /* At 60 degrees emergency shutdown */ + temperature = <60000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&chassis_alert0>; + cooling-device = <&system_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + }; + i2c-gpio { compatible = "i2c-gpio"; - sda-gpios = <&gpio1 9 (GPIO_ACTIVE_HIGH|GPIO_LINE_OPEN_DRAIN)>; - sck-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH|GPIO_LINE_OPEN_DRAIN)>; + sda-gpios = <&gpio1 9 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; + sck-gpios = <&gpio1 10 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; i2c-gpio,delay-us = <10>; #address-cells = <1>; #size-cells = <0>; + rtc0: rtc@51 { compatible = "nxp,pcf8563"; reg = <0x51>; @@ -112,9 +148,9 @@ gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>; }; - gpio-fan { + system_fan: gpio-fan { compatible = "gpio-fan"; - gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; gpio-fan,speed-map = <0 0 3000 1>; }; @@ -193,6 +229,16 @@ &sata { status = "okay"; nr-ports = <2>; + + hdd0_temp: sata-port@0 { + reg = <0>; + #thermal-sensor-cells = <0>; + }; + + hdd1_temp: sata-port@1 { + reg = <1>; + #thermal-sensor-cells = <0>; + }; }; &pcie_phy { diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index 7a41e1641b..2a9295bd97 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -73,9 +73,9 @@ define Device/shuttle_kd20 KERNEL_INITRAMFS = kernel-bin | append-dtb | uImage none | omninas-factory | \ encrypt-3des sohmuntitnlaes DEVICE_PACKAGES := kmod-usb2-oxnas kmod-usb3 kmod-usb-ledtrig-usbport \ - kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper kmod-hwmon-gpiofan \ - kmod-ata-oxnas-sata kmod-md-mod kmod-md-raid0 kmod-md-raid1 kmod-fs-ext4 \ - kmod-fs-xfs + kmod-i2c-gpio kmod-rtc-pcf8563 kmod-gpio-beeper kmod-hwmon-drivetemp \ + kmod-hwmon-gpiofan kmod-ata-oxnas-sata kmod-md-mod kmod-md-raid0 \ + kmod-md-raid1 kmod-fs-ext4 kmod-fs-xfs endef TARGET_DEVICES += shuttle_kd20 From af5ccfbac74b859801cf174460fb8dbf9ed9e181 Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Tue, 31 Mar 2020 17:51:45 -0300 Subject: [PATCH 3/3] openssl: bump to 1.1.1f There were two changes between 1.1.1e and 1.1.1f: - a change in BN prime generation to avoid possible fingerprinting of newly generated RSA modules - the patch reversing EOF detection we had already applied. Signed-off-by: Eneas U de Queiroz --- package/libs/openssl/Makefile | 6 +- ...t-Detect-EOF-while-reading-in-libssl.patch | 80 ------------------- 2 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 package/libs/openssl/patches/200-Partially-revert-Detect-EOF-while-reading-in-libssl.patch diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index ca45549800..e2f2661566 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.1.1 -PKG_BUGFIX:=e +PKG_BUGFIX:=f PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 ENGINES_DIR=engines-1.1 @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \ http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ -PKG_HASH:=694f61ac11cb51c9bf73f54e771ff6022b0327a43bbdfa1b2f19de1662a6dcbe +PKG_HASH:=186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE diff --git a/package/libs/openssl/patches/200-Partially-revert-Detect-EOF-while-reading-in-libssl.patch b/package/libs/openssl/patches/200-Partially-revert-Detect-EOF-while-reading-in-libssl.patch deleted file mode 100644 index c269dff07c..0000000000 --- a/package/libs/openssl/patches/200-Partially-revert-Detect-EOF-while-reading-in-libssl.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 30d190caf311d534867df97e26b552e628cb7d85 Mon Sep 17 00:00:00 2001 -From: Tomas Mraz -Date: Wed, 25 Mar 2020 14:15:31 +0100 -Subject: [PATCH] Partially revert "Detect EOF while reading in libssl" - -This partially reverts commit db943f43a60d1b5b1277e4b5317e8f288e7a0a3a. - -Reviewed-by: Matt Caswell -(Merged from https://github.com/openssl/openssl/pull/11400) - -diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt -index f5324c6819..35512f9caf 100644 ---- a/crypto/err/openssl.txt -+++ b/crypto/err/openssl.txt -@@ -2852,7 +2852,6 @@ SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES:242:unable to load ssl3 md5 routines - SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES:243:unable to load ssl3 sha1 routines - SSL_R_UNEXPECTED_CCS_MESSAGE:262:unexpected ccs message - SSL_R_UNEXPECTED_END_OF_EARLY_DATA:178:unexpected end of early data --SSL_R_UNEXPECTED_EOF_WHILE_READING:294:unexpected eof while reading - SSL_R_UNEXPECTED_MESSAGE:244:unexpected message - SSL_R_UNEXPECTED_RECORD:245:unexpected record - SSL_R_UNINITIALIZED:276:uninitialized -diff --git a/include/openssl/sslerr.h b/include/openssl/sslerr.h -index 0ef684f3c1..ba4c4ae5fb 100644 ---- a/include/openssl/sslerr.h -+++ b/include/openssl/sslerr.h -@@ -1,6 +1,6 @@ - /* - * Generated by util/mkerr.pl DO NOT EDIT -- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy -@@ -734,7 +734,6 @@ int ERR_load_SSL_strings(void); - # define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 - # define SSL_R_UNEXPECTED_CCS_MESSAGE 262 - # define SSL_R_UNEXPECTED_END_OF_EARLY_DATA 178 --# define SSL_R_UNEXPECTED_EOF_WHILE_READING 294 - # define SSL_R_UNEXPECTED_MESSAGE 244 - # define SSL_R_UNEXPECTED_RECORD 245 - # define SSL_R_UNINITIALIZED 276 -diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c -index 1c885a664f..b2a7a47eb0 100644 ---- a/ssl/record/rec_layer_s3.c -+++ b/ssl/record/rec_layer_s3.c -@@ -296,12 +296,6 @@ int ssl3_read_n(SSL *s, size_t n, size_t max, int extend, int clearold, - ret = BIO_read(s->rbio, pkt + len + left, max - left); - if (ret >= 0) - bioread = ret; -- if (ret <= 0 -- && !BIO_should_retry(s->rbio) -- && BIO_eof(s->rbio)) { -- SSLfatal(s, SSL_AD_DECODE_ERROR, SSL_F_SSL3_READ_N, -- SSL_R_UNEXPECTED_EOF_WHILE_READING); -- } - } else { - SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_SSL3_READ_N, - SSL_R_READ_BIO_NOT_SET); -diff --git a/ssl/ssl_err.c b/ssl/ssl_err.c -index a0c7b79659..4b12ed1485 100644 ---- a/ssl/ssl_err.c -+++ b/ssl/ssl_err.c -@@ -1,6 +1,6 @@ - /* - * Generated by util/mkerr.pl DO NOT EDIT -- * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. -+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy -@@ -1205,8 +1205,6 @@ static const ERR_STRING_DATA SSL_str_reasons[] = { - "unexpected ccs message"}, - {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_END_OF_EARLY_DATA), - "unexpected end of early data"}, -- {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_EOF_WHILE_READING), -- "unexpected eof while reading"}, - {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_MESSAGE), "unexpected message"}, - {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNEXPECTED_RECORD), "unexpected record"}, - {ERR_PACK(ERR_LIB_SSL, 0, SSL_R_UNINITIALIZED), "uninitialized"},