Merge Lean's source

This commit is contained in:
CN_SZTL 2020-01-09 17:58:09 +08:00
commit 5bf38da855
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
12 changed files with 10696 additions and 96 deletions

View File

@ -10,10 +10,10 @@ uci:foreach(shadowsocksr, "servers", function(s)
end
end)
local key_table = {}
for key,_ in pairs(server_table) do
table.insert(key_table,key)
end
local key_table = {}
for key,_ in pairs(server_table) do
table.insert(key_table,key)
end
table.sort(key_table)
@ -38,6 +38,11 @@ o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 5
o = s:option(Value, "switch_try_count", translate("Check Try Count"))
o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 3
-- [[ SOCKS5 Proxy ]]--
if nixio.fs.access("/usr/bin/ssr-local") then
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy"))

View File

@ -320,6 +320,9 @@ msgstr "自动切换检查周期(秒)"
msgid "Check timout(second)"
msgstr "切换检查超时时间(秒)"
msgid "Check Try Count"
msgstr "切换检查重试次数"
msgid "Enable Process Deamon"
msgstr "启用进程自动守护"

View File

@ -119,7 +119,6 @@
27.116.44.0/22
27.121.72.0/21
27.121.120.0/21
27.123.232.0/22
27.128.0.0/15
27.131.220.0/22
27.144.0.0/16
@ -158,7 +157,6 @@
36.255.164.0/22
36.255.172.0/22
36.255.176.0/22
36.255.220.0/22
39.0.0.0/24
39.0.2.0/23
39.0.4.0/22
@ -425,7 +423,6 @@
43.228.148.0/22
43.228.152.0/22
43.228.188.0/22
43.229.16.0/22
43.229.40.0/22
43.229.48.0/22
43.229.56.0/22
@ -696,7 +693,6 @@
43.239.172.0/22
43.239.176.0/22
43.240.0.0/22
43.240.48.0/22
43.240.56.0/22
43.240.60.0/22
43.240.68.0/22
@ -707,6 +703,7 @@
43.240.128.0/22
43.240.132.0/22
43.240.136.0/22
43.240.144.0/22
43.240.156.0/22
43.240.160.0/22
43.240.164.0/22
@ -910,7 +907,6 @@
43.248.244.0/22
43.249.4.0/22
43.249.8.0/22
43.249.24.0/22
43.249.120.0/22
43.249.132.0/22
43.249.136.0/22
@ -1036,8 +1032,7 @@
45.65.28.0/22
45.112.132.0/22
45.112.188.0/22
45.112.208.0/22
45.112.212.0/22
45.112.208.0/21
45.112.216.0/22
45.112.220.0/22
45.112.228.0/22
@ -1092,7 +1087,6 @@
45.115.236.0/22
45.115.244.0/22
45.115.248.0/22
45.116.12.0/22
45.116.16.0/22
45.116.24.0/22
45.116.32.0/22
@ -1128,7 +1122,6 @@
45.121.72.0/22
45.121.92.0/22
45.121.96.0/22
45.121.104.0/22
45.121.172.0/22
45.121.176.0/22
45.121.212.0/22
@ -1229,7 +1222,6 @@
45.124.176.0/22
45.124.208.0/22
45.124.248.0/22
45.124.252.0/22
45.125.12.0/22
45.125.16.0/22
45.125.24.0/22
@ -1481,9 +1473,6 @@
45.253.232.0/22
45.253.236.0/22
45.253.240.0/22
45.253.244.0/22
45.253.248.0/22
45.253.252.0/22
45.254.0.0/22
45.254.4.0/22
45.254.8.0/22
@ -1795,7 +1784,6 @@
61.29.128.0/18
61.29.192.0/19
61.29.224.0/20
61.29.240.0/20
61.45.128.0/18
61.45.224.0/20
61.47.128.0/18
@ -1890,12 +1878,15 @@
101.2.172.0/22
101.4.0.0/14
101.16.0.0/12
101.32.0.0/14
101.33.128.0/17
101.34.0.0/15
101.36.0.0/17
101.36.128.0/17
101.37.0.0/16
101.38.0.0/15
101.40.0.0/13
101.40.0.0/15
101.42.0.0/15
101.44.0.0/14
101.48.0.0/15
101.50.8.0/22
101.50.12.0/22
@ -2053,7 +2044,6 @@
103.12.184.0/22
103.12.232.0/22
103.13.12.0/22
103.13.72.0/23
103.13.124.0/22
103.13.144.0/22
103.13.196.0/22
@ -2428,7 +2418,6 @@
103.35.180.0/22
103.35.200.0/22
103.35.220.0/22
103.36.20.0/22
103.36.28.0/22
103.36.36.0/22
103.36.56.0/22
@ -2538,7 +2527,6 @@
103.40.44.0/22
103.40.88.0/22
103.40.100.0/22
103.40.112.0/22
103.40.192.0/22
103.40.212.0/22
103.40.220.0/22
@ -2583,7 +2571,6 @@
103.43.208.0/22
103.43.220.0/22
103.43.224.0/22
103.43.232.0/22
103.43.240.0/22
103.44.56.0/22
103.44.80.0/22
@ -2719,7 +2706,6 @@
103.47.136.0/22
103.47.140.0/22
103.47.212.0/22
103.48.20.0/22
103.48.52.0/22
103.48.92.0/22
103.48.144.0/22
@ -3175,7 +3161,6 @@
103.76.72.0/22
103.76.84.0/22
103.76.92.0/22
103.76.104.0/22
103.76.216.0/22
103.76.220.0/22
103.76.224.0/22
@ -3828,8 +3813,21 @@
103.124.216.0/22
103.125.20.0/22
103.125.44.0/22
103.125.132.0/22
103.125.164.0/22
103.125.196.0/22
103.125.236.0/22
103.125.248.0/22
103.126.0.0/22
103.126.16.0/22
103.126.44.0/22
103.126.100.0/22
103.126.124.0/22
103.126.128.0/22
103.126.132.0/22
103.126.208.0/22
103.126.241.0/24
103.129.52.0/22
103.129.148.0/22
103.130.132.0/22
103.130.152.0/24
103.130.160.0/22
@ -3842,6 +3840,156 @@
103.131.224.0/22
103.131.228.0/22
103.131.240.0/22
103.132.60.0/22
103.132.64.0/22
103.132.68.0/22
103.132.72.0/22
103.132.76.0/22
103.132.80.0/22
103.132.104.0/22
103.132.108.0/22
103.132.112.0/22
103.132.116.0/22
103.132.120.0/22
103.132.160.0/22
103.132.164.0/22
103.132.188.0/22
103.132.208.0/22
103.132.212.0/22
103.132.234.0/23
103.133.12.0/22
103.133.40.0/22
103.133.128.0/22
103.133.136.0/22
103.133.176.0/22
103.133.232.0/22
103.134.12.0/24
103.134.196.0/22
103.135.80.0/22
103.135.124.0/22
103.135.148.0/22
103.135.156.0/22
103.135.160.0/22
103.135.164.0/22
103.135.176.0/22
103.135.184.0/22
103.135.192.0/22
103.135.196.0/22
103.135.236.0/22
103.136.128.0/22
103.136.232.0/22
103.137.58.0/23
103.137.60.0/24
103.137.76.0/22
103.137.136.0/23
103.137.149.0/24
103.137.180.0/22
103.137.236.0/22
103.138.2.0/23
103.138.12.0/23
103.138.80.0/22
103.138.134.0/23
103.138.156.0/23
103.138.208.0/23
103.138.220.0/23
103.138.246.0/23
103.138.248.0/23
103.139.0.0/23
103.139.2.0/23
103.139.22.0/23
103.139.113.0/24
103.139.134.0/23
103.139.136.0/23
103.139.172.0/23
103.139.200.0/23
103.139.204.0/23
103.139.212.0/23
103.140.8.0/23
103.140.14.0/23
103.140.46.0/23
103.140.70.0/23
103.140.126.0/23
103.140.140.0/23
103.140.144.0/23
103.140.152.0/23
103.140.192.0/23
103.140.194.0/23
103.140.228.0/23
103.141.10.0/23
103.141.36.0/23
103.141.58.0/23
103.141.128.0/23
103.141.186.0/23
103.141.190.0/23
103.141.242.0/23
103.142.0.0/23
103.142.28.0/23
103.142.58.0/23
103.142.82.0/23
103.142.96.0/23
103.142.102.0/23
103.142.122.0/23
103.142.126.0/24
103.142.128.0/23
103.142.140.0/23
103.142.154.0/23
103.142.156.0/23
103.142.172.0/23
103.142.180.0/23
103.142.186.0/23
103.142.190.0/23
103.142.220.0/23
103.142.230.0/24
103.142.234.0/23
103.142.238.0/23
103.142.248.0/23
103.143.16.0/23
103.143.18.0/23
103.143.31.0/24
103.143.74.0/23
103.143.120.0/23
103.143.124.0/23
103.143.132.0/23
103.143.134.0/23
103.143.174.0/23
103.143.228.0/23
103.144.40.0/23
103.144.52.0/23
103.144.66.0/23
103.144.70.0/23
103.144.72.0/23
103.144.88.0/24
103.144.108.0/23
103.144.136.0/23
103.144.148.0/23
103.144.158.0/23
103.144.240.0/23
103.145.38.0/23
103.145.40.0/23
103.145.42.0/23
103.145.60.0/23
103.145.72.0/23
103.145.80.0/23
103.145.86.0/23
103.145.92.0/23
103.145.94.0/23
103.145.98.0/23
103.145.106.0/23
103.145.122.0/23
103.145.188.0/23
103.145.190.0/23
103.146.6.0/23
103.146.72.0/23
103.146.88.0/23
103.146.90.0/23
103.146.124.0/23
103.146.126.0/23
103.146.138.0/23
103.146.147.0/24
103.146.230.0/23
103.146.236.0/23
103.146.252.0/23
103.147.12.0/23
103.192.0.0/22
103.192.4.0/22
103.192.8.0/22
@ -4902,7 +5050,8 @@
106.4.0.0/14
106.8.0.0/15
106.11.0.0/16
106.12.0.0/14
106.12.0.0/15
106.14.0.0/15
106.16.0.0/12
106.32.0.0/12
106.48.0.0/15
@ -5064,6 +5213,8 @@
113.208.128.0/17
113.209.0.0/16
113.212.0.0/18
113.212.64.0/22
113.212.88.0/22
113.212.100.0/22
113.212.184.0/21
113.213.0.0/17
@ -5093,7 +5244,6 @@
114.117.0.0/16
114.118.0.0/16
114.119.0.0/17
114.119.128.0/18
114.119.192.0/21
114.119.200.0/22
114.119.204.0/22
@ -5204,9 +5354,11 @@
116.204.132.0/22
116.204.168.0/22
116.204.216.0/22
116.204.232.0/22
116.204.236.0/22
116.204.244.0/22
116.205.0.0/16
116.206.92.0/22
116.206.100.0/22
116.206.176.0/22
116.207.0.0/16
116.208.0.0/14
@ -5237,7 +5389,10 @@
117.32.0.0/13
117.40.0.0/14
117.44.0.0/15
117.48.0.0/14
117.48.0.0/17
117.48.128.0/17
117.49.0.0/16
117.50.0.0/15
117.53.48.0/20
117.53.176.0/20
117.57.0.0/16
@ -5316,7 +5471,20 @@
118.186.0.0/15
118.188.0.0/16
118.190.0.0/16
118.191.0.0/16
118.191.0.0/21
118.191.8.0/22
118.191.12.0/24
118.191.16.0/21
118.191.64.0/20
118.191.80.0/22
118.191.128.0/19
118.191.176.0/20
118.191.192.0/20
118.191.208.0/24
118.191.216.0/22
118.191.223.0/24
118.191.224.0/24
118.191.240.0/20
118.192.0.0/16
118.193.0.0/21
118.193.8.0/21
@ -5346,7 +5514,6 @@
119.2.128.0/17
119.3.0.0/16
119.4.0.0/14
119.8.0.0/16
119.10.0.0/17
119.15.136.0/21
119.16.0.0/16
@ -5512,17 +5679,17 @@
122.9.0.0/16
122.10.128.0/22
122.10.132.0/23
122.10.134.0/23
122.10.136.0/23
122.10.138.0/23
122.10.140.0/22
122.10.144.0/20
122.10.160.0/19
122.10.192.0/20
122.10.164.0/22
122.10.168.0/21
122.10.176.0/20
122.10.192.0/22
122.10.200.0/21
122.10.208.0/21
122.10.216.0/22
122.10.220.0/22
122.10.224.0/19
122.10.228.0/22
122.10.232.0/21
122.10.240.0/22
122.11.0.0/17
122.12.0.0/16
122.13.0.0/16
@ -5627,6 +5794,8 @@
123.242.196.0/22
123.244.0.0/14
123.249.0.0/16
123.253.108.0/22
123.253.240.0/22
123.254.96.0/22
123.254.100.0/22
124.6.64.0/18
@ -6122,7 +6291,9 @@
183.182.0.0/19
183.184.0.0/13
183.192.0.0/10
185.203.36.0/22
188.131.128.0/17
192.51.188.0/24
192.55.46.0/24
192.55.68.0/22
192.102.204.0/23
@ -6146,12 +6317,15 @@
192.140.208.0/22
192.140.212.0/22
192.144.128.0/17
192.197.113.0/24
193.112.0.0/16
198.175.100.0/22
199.212.57.0/24
202.0.100.0/23
202.0.122.0/23
202.0.176.0/22
202.3.128.0/23
202.3.134.0/24
202.4.128.0/19
202.4.252.0/22
202.5.208.0/22
@ -6174,6 +6348,7 @@
202.8.12.0/24
202.8.24.0/24
202.8.77.0/24
202.8.120.0/22
202.8.128.0/19
202.8.192.0/20
202.9.32.0/24
@ -6359,6 +6534,7 @@
202.52.34.0/24
202.52.47.0/24
202.52.143.0/24
202.52.144.0/24
202.53.140.0/24
202.53.143.0/24
202.57.192.0/22
@ -6369,6 +6545,7 @@
202.57.216.0/22
202.57.240.0/20
202.58.0.0/24
202.58.101.0/24
202.58.104.0/22
202.58.112.0/22
202.59.0.0/24
@ -6493,6 +6670,7 @@
202.92.252.0/22
202.93.0.0/22
202.93.252.0/22
202.94.68.0/24
202.94.74.0/24
202.94.81.0/24
202.94.92.0/22
@ -6954,7 +7132,6 @@
203.8.0.0/24
203.8.8.0/24
203.8.23.0/24
203.8.24.0/21
203.8.70.0/24
203.8.82.0/24
203.8.86.0/23
@ -7018,7 +7195,6 @@
203.12.66.0/24
203.12.70.0/23
203.12.87.0/24
203.12.88.0/21
203.12.100.0/23
203.12.103.0/24
203.12.114.0/24
@ -7026,7 +7202,6 @@
203.12.130.0/24
203.12.137.0/24
203.12.196.0/22
203.12.200.0/21
203.12.211.0/24
203.12.219.0/24
203.12.226.0/24
@ -7034,7 +7209,6 @@
203.13.18.0/24
203.13.24.0/24
203.13.44.0/23
203.13.80.0/21
203.13.88.0/23
203.13.92.0/22
203.13.173.0/24
@ -7050,7 +7224,6 @@
203.14.114.0/23
203.14.118.0/24
203.14.162.0/24
203.14.184.0/21
203.14.192.0/24
203.14.194.0/23
203.14.214.0/24
@ -7676,6 +7849,7 @@
203.86.250.0/24
203.86.254.0/23
203.88.32.0/19
203.88.100.0/22
203.88.192.0/19
203.89.0.0/22
203.89.8.0/21
@ -7862,9 +8036,9 @@
203.212.80.0/20
203.215.232.0/21
203.217.164.0/22
203.222.192.0/20
203.223.0.0/20
203.223.16.0/21
204.52.191.0/24
210.2.0.0/20
210.2.16.0/20
210.5.0.0/19
@ -7992,7 +8166,6 @@
211.164.0.0/14
212.64.0.0/17
212.129.128.0/17
216.250.108.0/22
218.0.0.0/16
218.1.0.0/16
218.2.0.0/15

View File

@ -9,6 +9,7 @@ config global
option enable_switch '1'
option switch_timeout '5'
option switch_time '667'
option switch_try_count '3'
config socks5_proxy
option server 'nil'

View File

@ -46,7 +46,7 @@ add_cron()
sed -i '/shadowsocksr/d' $CRON_FILE
sed -i '/ssrplus.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/ssrplus.log' >> $CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/share/shadowsocksr/subscribe.sh" >> $CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 5 * * * /usr/share/shadowsocksr/update.sh" >> $CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/share/shadowsocksr/update.sh" >> $CRON_FILE
crontab $CRON_FILE
}

View File

@ -35,31 +35,39 @@ CURRENT_SERVER=$DEFAULT_SERVER
#判断代理是否正常
check_proxy() {
/usr/bin/ssr-check www.google.com 80 $switch_time 1
if [ "$?" == "0" ]; then
return 0
else
/usr/bin/ssr-check www.baidu.com 80 $switch_time 1
if [ "$?" == "0" ]; then
#goole不通baidu通则不正常
return 1
else
return 2
fi
fi
return 0
local result=0
local try_count=$(uci_get_by_type global switch_try_count 3)
for i in $(seq 1 $try_count)
do
/usr/bin/ssr-check www.google.com 80 $switch_time 1
if [ "$?" == "0" ]; then
# echo "$(date "+%Y-%m-%d %H:%M:%S") Check Google Proxy Success, count=$i" >> /tmp/ssrplus.log
result=0
break
else
# echo "$(date "+%Y-%m-%d %H:%M:%S") Check Google Proxy Fail, count=$i" >> /tmp/ssrplus.log
/usr/bin/ssr-check www.baidu.com 80 $switch_time 1
if [ "$?" == "0" ]; then
result=1
else
result=2
fi
fi
sleep 1;
done
return $result;
}
test_proxy() {
local servername=$(uci_get_by_name $1 server)
local serverport=$(uci_get_by_name $1 server_port)
ret=$(ping -c 3 $servername | grep 'loss' | awk -F ',' '{ print $3 }' | awk -F "%" '{ print $1 }')
ret=$(ping -c 3 $servername | grep 'loss' | awk -F ',' '{ print $3 }' | awk -F "%" '{ print $1 }')
[ -z "$ret" ] && return 1
[ "$ret" -gt "50" ] && return 1
ipset add ss_spec_wan_ac $servername 2>/dev/null
ret=$?
/usr/bin/ssr-check $servername $serverport $switch_time
/usr/bin/ssr-check $servername $serverport $switch_time
local ret2=$?
if [ "$ret" = "0" ] ;then
ipset del ss_spec_wan_ac $servername 2>/dev/null
@ -81,7 +89,7 @@ local servername=$(uci_get_by_name $1 server)
local serverport=$(uci_get_by_name $1 server_port)
ipset add ss_spec_wan_ac $servername 2>/dev/null
ret=$?
/usr/bin/ssr-check $servername $serverport $switch_time
/usr/bin/ssr-check $servername $serverport $switch_time
local ret2=$?
if [ "$ret" = "0" ] ;then
ipset del ss_spec_wan_ac $servername 2>/dev/null
@ -117,12 +125,12 @@ start() {
[ $(uci_get_by_name $DEFAULT_SERVER kcp_enable) = "1" ] && return 1
while [ "1" = "1" ] #死循环
do
do
sleep $cycle_time
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
#判断当前代理是否为缺省服务器
if [ "$CURRENT_SERVER" != "$DEFAULT_SERVER" ] ;then
#echo "not default proxy"
@ -134,7 +142,7 @@ do
echo "$(date "+%Y-%m-%d %H:%M:%S") Main server is avilable." >> /tmp/ssrplus.log
#缺省服务器正常,切换回来
CURRENT_SERVER=$DEFAULT_SERVER
switch_proxy $CURRENT_SERVER
switch_proxy $CURRENT_SERVER
echo "$(date "+%Y-%m-%d %H:%M:%S") switch to default ["$(uci_get_by_name $CURRENT_SERVER server)"] proxy!" >> /tmp/ssrplus.log
continue
else
@ -143,14 +151,14 @@ do
fi
#判断当前代理是否正常
check_proxy
check_proxy
current_ret=$?
if [ "$current_ret" = "1" ] ;then
#当前代理错误,判断有无可用的服务器
#echo "current error"
echo "$(date "+%Y-%m-%d %H:%M:%S") Current server error, try to switch another server." >> /tmp/ssrplus.log
select_proxy
if [ "$ENABLE_SERVER" != nil ] ;then
#有其他服务器可用,进行切换
@ -162,11 +170,11 @@ do
echo "$(date "+%Y-%m-%d %H:%M:%S") ShadowsocksR server switch OK" >> /tmp/ssrplus.log
else
switch_proxy $CURRENT_SERVER
normal_flag=1
normal_flag=1
echo "$(date "+%Y-%m-%d %H:%M:%S") Try restart current server." >> /tmp/ssrplus.log
fi
else
normal_flag=0
normal_flag=0
echo "$(date "+%Y-%m-%d %H:%M:%S") ShadowsocksR No Problem." >> /tmp/ssrplus.log
fi

View File

@ -207,11 +207,12 @@ do
fi
fi
if [ -z "ssr_remarks" ]; then # 没有备注的话则生成一个
if [ -z "ssr_remarks" ]; then # 没有备注的话则生成一个
ssr_remarks="$ssr_host:$ssr_port";
fi
if [ -z "$ssr_host" ];then # 丢弃没有host的无效服务器信息例如剩余流量xxx
# 丢弃没有host的无效服务器信息例如剩余流量xxx
if [[ "$ssr_remarks" =~ "过期时间" ]] || [[ "$ssr_remarks" =~ "剩余流量" ]] || [[ "$ssr_remarks" =~ "防失联QQ群" ]] || [ -z "$ssr_host" ];then
echo_date "丢弃无效节点:【$ssr_remarks"
continue
fi
@ -230,7 +231,7 @@ do
# echo "服务器地址: $ssr_host"
# echo "服务器端口 $ssr_port"
# echo "密码: $ssr_passwd"
# echo "SS加密: $ss_method"
# echo "SS加密: $ss_method"
# echo "加密: $ssr_method"
# echo "协议: $ssr_protocol"
# echo "协议参数: $ssr_protoparam"

View File

@ -9,8 +9,8 @@ PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/etnperlong/vlmcsd.git
PKG_SOURCE_VERSION:=88007b3578cab6324241ae6e636d8e6503cd611c
PKG_SOURCE_URL:=https://github.com/Wind4/vlmcsd.git
PKG_SOURCE_VERSION:=cd488aeb85aedefe1cb4db02c632397d78a9de88
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR)-$(PKG_VERSION).tar.gz

View File

@ -463,7 +463,7 @@ ar71xx_board_detect() {
*"AP143 reference board")
name="ap143"
;;
*"AP147-010 reference board")
*"Letv SuperRouter")
name="ap147-010"
;;
*"AP152 reference board")

View File

@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */
--- a/arch/mips/kernel/module.c
+++ b/arch/mips/kernel/module.c
@@ -44,14 +44,224 @@ struct mips_hi16 {
@@ -44,14 +44,221 @@ struct mips_hi16 {
static LIST_HEAD(dbe_list);
static DEFINE_SPINLOCK(dbe_lock);
@ -187,7 +187,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ if (!ptr)
+ return vmalloc(size);
+
+ kmemleak_alloc(ptr, size, 1, GFP_KERNEL);
+ return ptr;
+#endif
}
@ -204,12 +203,10 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+/* Free memory returned from module_alloc */
+void module_memfree(void *module_region)
+{
+ if (is_phys_addr(module_region)) {
+ kmemleak_free(module_region);
+ if (is_phys_addr(module_region))
+ free_phys(module_region);
+ } else {
+ else
+ vfree(module_region);
+ }
+}
+
+static void *__module_alloc(int size, bool phys)
@ -272,7 +269,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int apply_r_mips_none(struct module *me, u32 *location,
u32 base, Elf_Addr v, bool rela)
@@ -67,9 +277,40 @@ static int apply_r_mips_32(struct module
@@ -67,9 +274,40 @@ static int apply_r_mips_32(struct module
return 0;
}
@ -313,7 +310,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (v % 4) {
pr_err("module %s: dangerous R_MIPS_26 relocation\n",
me->name);
@@ -77,13 +318,17 @@ static int apply_r_mips_26(struct module
@@ -77,13 +315,17 @@ static int apply_r_mips_26(struct module
}
if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
@ -335,7 +332,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return 0;
}
@@ -459,9 +704,36 @@ int module_finalize(const Elf_Ehdr *hdr,
@@ -459,9 +701,36 @@ int module_finalize(const Elf_Ehdr *hdr,
list_add(&me->arch.dbe_list, &dbe_list);
spin_unlock_irq(&dbe_lock);
}

View File

@ -12,7 +12,7 @@ diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 32879b845b75..157ae07f9309 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1117,6 +1117,33 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
@@ -1531,6 +1531,33 @@ static void sdhci_msm_set_clock(struct sdhci_host *host, unsigned int clock)
__sdhci_msm_set_clock(host, clock);
}
@ -29,7 +29,7 @@ index 32879b845b75..157ae07f9309 100644
+ * SDHCI_RESET_ALL triggers the PWR IRQ
+ * and we need to handle it here.
+ */
+ sdhci_msm_voltage_switch(host);
+ sdhci_msm_dump_pwr_ctrl_regs(host);
+ }
+
+ while (sdhci_readb(host, SDHCI_SOFTWARE_RESET) & mask) {
@ -43,10 +43,10 @@ index 32879b845b75..157ae07f9309 100644
+ }
+}
+
static void sdhci_msm_write_w(struct sdhci_host *host, u16 val, int reg)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -1148,7 +1174,7 @@ static const struct of_device_id sdhci_msm_dt_match[] = {
/*
* Platform specific register write functions. This is so that, if any
* register write needs to be followed up by platform specific actions,
@@ -1680,7 +1706,7 @@ static const struct of_device_id sdhci_msm_dt_match[] = {
MODULE_DEVICE_TABLE(of, sdhci_msm_dt_match);
static const struct sdhci_ops sdhci_msm_ops = {