Commit Graph

659607 Commits

Author SHA1 Message Date
Mauro (mdrjr) Ribeiro
98163ef0bd Merge branch 'odroidg12-4.9.y'
Change-Id: Ibe642d3a57d6a9bce0ae01ee95316654900a67e5
4.9.236-63
2020-12-09 18:37:50 -03:00
Mauro (mdrjr) Ribeiro
562a677bc4 net: add wireguard 2020-12-09 18:35:12 -03:00
Mauro (mdrjr) Ribeiro
6599c1d834 ODROID-COMMON: config: enable transparent huge pages
Change-Id: Ib6649c28eaa673c652e8294371781d65ca704b38
2020-12-09 18:27:45 -03:00
Kees Cook
35ba5e79de timer: Prepare to change timer callback argument type
Modern kernel callback systems pass the structure associated with a
given callback to the callback function. The timer callback remains one
of the legacy cases where an arbitrary unsigned long argument continues
to be passed as the callback argument. This has several problems:

- This bloats the timer_list structure with a normally redundant
  .data field.

- No type checking is being performed, forcing callbacks to do
  explicit type casts of the unsigned long argument into the object
  that was passed, rather than using container_of(), as done in most
  of the other callback infrastructure.

- Neighboring buffer overflows can overwrite both the .function and
  the .data field, providing attackers with a way to elevate from a buffer
  overflow into a simplistic ROP-like mechanism that allows calling
  arbitrary functions with a controlled first argument.

- For future Control Flow Integrity work, this creates a unique function
  prototype for timer callbacks, instead of allowing them to continue to
  be clustered with other void functions that take a single unsigned long
  argument.

This adds a new timer initialization API, which will ultimately replace
the existing setup_timer(), setup_{deferrable,pinned,etc}_timer() family,
named timer_setup() (to mirror hrtimer_setup(), making instances of its
use much easier to grep for).

In order to support the migration of existing timers into the new
callback arguments, timer_setup() casts its arguments to the existing
legacy types, and explicitly passes the timer pointer as the legacy
data argument. Once all setup_*timer() callers have been replaced with
timer_setup(), the casts can be removed, and the data argument can be
dropped with the timer expiration code changed to just pass the timer
to the callback directly.

Since the regular pattern of using container_of() during local variable
declaration repeats the need for the variable type declaration
to be included, this adds a helper modeled after other from_*()
helpers that wrap container_of(), named from_timer(). This helper uses
typeof(*variable), removing the type redundancy and minimizing the need
for line wraps in forthcoming conversions from "unsigned data long" to
"struct timer_list *" in the timer callbacks:

-void callback(unsigned long data)
+void callback(struct timer_list *t)
{
-   struct some_data_structure *local = (struct some_data_structure *)data;
+   struct some_data_structure *local = from_timer(local, t, timer);

Finally, in order to support the handful of timer users that perform
open-coded assignments of the .function (and .data) fields, provide
cast macros (TIMER_FUNC_TYPE and TIMER_DATA_TYPE) that can be used
temporarily. Once conversion has been completed, these can be globally
trivially removed.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20170928133817.GA113410@beast
Change-Id: Ie5af397a7702c2ed9f9cda23e3dcc04708c057dc
2020-12-09 13:55:39 +09:00
Dongjin Kim
95086680ab ODROID-COMMON: config: add to enable GPIO-based Joystick support
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I45be7633cc23990e48f04231d158140ad808408a
2020-12-09 11:58:57 +09:00
Dongjin Kim
643b16ad28 ODROID-COMMON: config: disable 'CONFIG_AMLOGIC_MEDIA_FB_OSD2_CURSOR' to use soft cursor
This change affects to the OSD driver, drivers/amlogic/media/osd/osd_fb.c, to enable
soft cursor instead of OSD cursor.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Ic4af0037579b5b62c4df7b29a05d1cceec0cd9cf
4.9.236-106 4.9.236-60
2020-12-02 10:48:01 -03:00
Dongjin Kim
bf8d73f1f6 ODROID-COMMON: ARM64/dts: add GPIO-based joystick support device tree
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I54ebe56b09f5cc66f26718f4486f011fb50dcc0e
2020-12-02 13:20:47 +09:00
Dongjin Kim
937dcaf76f ODROID-COMMON: add drivers GPIO-based Joystick drivers
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I0856df4dec6a05f769b0e325ea8f8200f82b8058
2020-12-02 13:20:24 +09:00
Dongjin Kim
f2a1304b10 ODROID-HC4: enable eMMC to make SD as /dev/mmcblk1*
Change-Id: Id3b7050a0b81b5e53785991074b6d0285e11a6e8
2020-12-01 20:41:06 +09:00
Dongjin Kim
f6bcdb2b15 ODROID-COMMON: hwmon: (pwm-fan) add fan pwm1_enable attribute
This patch adds to new attribute 'pwm1_enable' to change the fan speed
control method as documented in 'Documentation/hwmon/sysfs-interface'.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I19094d60e928d6c3ce226d319e75a35ecbd3ae52
2020-11-26 04:45:43 +09:00
Dongjin Kim
327df05e63 ODROID-COMMON: thermal: amlogic_thermal: Add hwmon support
Expose Amlogic thermal as HWMON devices.

	$ sensors
	cpu_thermal-virtual-0
	Adapter: Virtual device
	temp1:        +32.2 C  (crit = +110.0 C)

	ddr_thermal-virtual-0
	Adapter: Virtual device
	temp1:        +33.4 C  (crit = +110.0 C)

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Icb1bf7cd7e4462f9923af5bcd72fa7c0c8e14cc9
2020-11-25 14:54:08 +09:00
ckkim
6ad97dceb7 ODROID-HC4:remove pwm-fan pinctrl(PWM_C : GPIOC_4 remove)
Signed-off-by: ckkim <changkon12@gmail.com>
Change-Id: I36ddb1889cc1d181372c8925e58726d71a615d4e
4.9.236-51 4.9.236-104
2020-11-10 09:24:26 -03:00
Dongjin Kim
8fb70183bd Revert "ODROID-COMMON: osd: Adjust osd scaler and vout serve to fit in KODI"
This reverts commit 6f7138e3ac.

Change-Id: Ib57697cf7668460ab81bf951d0dee1e003adba44
4.9.236-50
2020-11-05 17:17:51 +09:00
Dongjin Kim
67281d47ea Revert "ODROID-COMMON:osd: Adjust osd scaler and vout serve to fit in KODI. Only works in S922(N2/N2+)."
This reverts commit 0427609dc9.

Change-Id: Idcf054d6da7a2602dbac904ae2a6ec6da0ee00bf
2020-11-05 17:17:48 +09:00
ckkim
800070774d ODROID-N2/N2+:no soundcard error fix.
Change-Id: I71319cf50a1fd07b9ec48edc62e2a0bbcf565ba9
4.9.236-103
2020-11-04 13:26:52 +09:00
Mauro Ribeiro
b865c9de61 Merge "ODROID-COMMON:osd: Adjust osd scaler and vout serve to fit in KODI. Only works in S922(N2/N2+)." into odroidg12-4.9.y 4.9.236-98 2020-10-30 22:39:19 +09:00
Deokgyu Yang
98774b1480 ODROID-COMMON: drivers/spi: Set the 64 bits per word by default
The existing force64b routine might not work properly under specific
conditions. This patch fixes that bug of 64 bits per word and forces
use that option. It will improve SPI performance significantly.

Signed-off-by: Deokgyu Yang <secugyu@gmail.com>
Change-Id: I85a58d425303ea1765b7b83ee5dd5f0a7f4203fc
2020-10-30 16:09:06 +09:00
ckkim
0427609dc9 ODROID-COMMON:osd: Adjust osd scaler and vout serve to fit in KODI. Only works in S922(N2/N2+).
Change-Id: I7a16dd2cbde63d8b716aab17d85fb9dc1157e2ff
2020-10-29 18:28:25 +09:00
Luke go
3fb04f4ee0 ODROID-HC4: arm64/dtbs: overlay: Changed fanspeed.
- Because of noise, Changed the fan speed by adjust pwm frequency.

Change-Id: Ie12eb7f16cfbf1eeab01cb4694540b8260985a47
2020-10-22 09:53:12 +09:00
Dongjin Kim
bd5043c030 ODROID-HC4: arm64/dts: add PWM pinctrl for cooling fan
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I44e55ae09a1cbd6eb46b5636147f5f3f35ef28a8
2020-10-20 17:21:07 +09:00
Luke go
d615a4cadc ODROID-COMMON: arm64/dts: overlay: Add the PWM examples.
- pwmfan, pwm-backlight.

Change-Id: Id1cdbbebc80962f0ed51be05d95b771c1af6be30
2020-10-20 17:20:56 +09:00
Luke go
154309864d ODROID-COMMON: arm64/dts: overlay: Separate PWM and apply overlay.
- The PWM's configuration is difference between the n2 and c4. So
  separate configuration and placed to the device tree overlays.

Change-Id: Ia870ce6ea4404c8bc7028ae7f1cc72174406ed27
2020-10-20 17:19:11 +09:00
Luke go
5d32c14779 ODROID-C4/HC4: arm64/dts: overlay: Add overlay to run fully loaded fan
speed.

Change-Id: I56dd11c2cc88406ed695e1594301a759eedfc017
Signed-off-by: Luke go <sangch.go@gmail.com>
2020-10-16 16:01:25 +09:00
Luke Go
d136a8e5b6 ODROID: bt: Bugfix.
- power_low_level value is not applied correctly.

Change-Id: Id98d8e819e0502f7ec2ae27f972a926ac7c855d2
Signed-off-by: Luke Go <sangch.go@gmail.com>
2020-10-14 12:22:49 +09:00
Luke go
2da194b281 ODROID-C4: Add wifi/bt combo.
Change-Id: I7aee51cd8c8babcebf3b060f9b09cbd6f00212f1
2020-10-14 12:22:27 +09:00
Dongjin Kim
2ea1cdf417 ODROID-COMMON: clock: remove confusing kernel warning
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Ic13f009bc8221317e554921d3da2a420fce28c53
4.9.236-37
2020-10-12 14:23:13 +09:00
Dongjin Kim
e7fb2db2f4 ODROID-HC4: cpufreq: add to use kernel parameter to set max cpufreq
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I5ce9b4b69e4f436f183292764149950d74131900
2020-10-07 12:11:08 +09:00
Dongjin Kim
4c7f82cbfc ODROID-COMMON: config: add ATA drivers for ODROID-HC4
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Iaf336ea71095938d4da5a2abb0cbe9c61e43ee95
2020-10-07 12:11:08 +09:00
Dongjin Kim
5fb3d92bb2 ODROID-HC4: arm64/boot: add PWM based fan node entry
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I8cf61fe74f59411c92b7367099664cba6b5e576e
2020-10-07 12:11:08 +09:00
Dongjin Kim
aa5ce947c0 ODROID-HC4: arm64/dts: add SPI flash memory
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: If6ae6a414d1f27ab48c7a337aa8241603146376a
2020-10-07 12:11:08 +09:00
Dongjin Kim
a73de30e3b ODROID-HC4: arm64/dts: add USB host support on 'rev.20200512'
[1] GPIOAO_2 is tied to control USB 2.0 host power
[2] USB 3.0 PHY must be disabled exclusively for PCIe.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I340ca69f6da448a441ed75c506ea569947a581c4
2020-10-07 12:11:08 +09:00
Dongjin Kim
5068036653 ODROID-HC4: arch/arm64: Introduce new board 'ODROID-HC4'
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: I8ba3c401aedacfcf1307049fac66ebb13bddfa6d
2020-10-07 12:11:08 +09:00
Dongjin Kim
d227b6e25e ODROID-C4: cpufreq: fix typo to set the default cpufreq
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: Ie790225b30477ee0af821c55066df1f83c819b51
2020-10-07 12:11:08 +09:00
Luke go
b60f79adbc ODROID-C4: arm64/dts: overlay: Add sdio.
Change-Id: I87bf7ff7f68863b79826b5d10e8eb840c0e70c1e
2020-09-24 15:17:06 +09:00
Luke go
efe463052b ODROID-C4: wireless: esp8089: Support esp8089 driver.
- The esp8089 driver supports many esp's wifi modules. So it is imported.

Change-Id: If039882e183e454baff2c222bf7a1282b6705459
2020-09-24 15:14:34 +09:00
Joy Cho
cbb49c05e1 Merge "ODROID-COMMON: hdmitx: Adjust 2560x1600 timing to use lower pixel clock" into odroidg12-4.9.y 4.9.236-38 4.9.236-39 2020-09-24 10:35:13 +09:00
Dongjin Kim
04f0d87806 ODROID-N2: arm64/dts: move the default SPDIF to GPIOA_11 to GPIOA_13
- Add gpio's spdifout overlays. It support GPIOA 13 - PIN7 spdifout.

Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Change-Id: If18cbdc8b9995accbe79df1d060ca8f1677758b5
2020-09-22 14:38:57 +09:00
Joy Cho
5695340a34 ODROID-COMMON: hdmitx: Adjust 2560x1600 timing to use lower pixel clock
With some specific monitors those pixel clock is under 300MHz,
unstable display operation may occur.
So, default timing for 2560x1600p60hz is set as following.

Detailed mode: Clock 268.500 MHz, 641 mm x 401 mm
               2560 2608 2640 2720 ( 48  32  80)
               1600 1602 1608 1646 (  2   6  38)
               +hsync -vsync
               VertFreq: 59.972 Hz, HorFreq: 98.713 kHz

Change-Id: I7812a491b5d81379cd4568223d478909ecd882c4
2020-09-20 12:09:58 +09:00
Joy Cho
9c5a019836 vout: cvbs: Update cvbscable option detection
Change-Id: Ia80e740f913439e03f2f4f2ae01e85aabcc096fd
2020-09-16 21:05:39 +09:00
Mauro (mdrjr) Ribeiro
de23fd9c97 Merge tag 'v4.9.236' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.236 stable release

Change-Id: I469c4a63c9bc761ca785b08ef0a1ff5ad2c1f650
4.9.236-36 4.9.236-97
2020-09-15 10:54:30 -03:00
Mauro (mdrjr) Ribeiro
b5e205b376 Merge tag 'v4.9.235' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.235 stable release

Change-Id: I826c11db869c580205ffc19d9d811c6b136c95cb
2020-09-15 10:54:19 -03:00
Mauro (mdrjr) Ribeiro
3cb1471988 Merge tag 'v4.9.234' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.234 stable release
2020-09-15 10:54:07 -03:00
Mauro (mdrjr) Ribeiro
4d6f772c22 Merge tag 'v4.9.233' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.233 stable release
2020-09-15 10:53:28 -03:00
Mauro (mdrjr) Ribeiro
d4468d096e Merge tag 'v4.9.232' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.232 stable release

Change-Id: I39e43636ab0570c5338daac4cc6eba64d257c955
2020-09-15 10:52:47 -03:00
Mauro (mdrjr) Ribeiro
ac06db4d16 Merge tag 'v4.9.231' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into odroidg12-4.9.y
This is the 4.9.231 stable release
2020-09-15 10:52:40 -03:00
Greg Kroah-Hartman
65676505f8 Linux 4.9.236
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:40 +02:00
Jakub Kicinski
6048d57b66 net: disable netpoll on fresh napis
[ Upstream commit 96e97bc07e ]

napi_disable() makes sure to set the NAPI_STATE_NPSVC bit to prevent
netpoll from accessing rings before init is complete. However, the
same is not done for fresh napi instances in netif_napi_add(),
even though we expect NAPI instances to be added as disabled.

This causes crashes during driver reconfiguration (enabling XDP,
changing the channel count) - if there is any printk() after
netif_napi_add() but before napi_enable().

To ensure memory ordering is correct we need to use RCU accessors.

Reported-by: Rob Sherwood <rsher@fb.com>
Fixes: 2d8bff1269 ("netpoll: Close race condition between poll_one_napi and napi_disable")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:40 +02:00
Xin Long
20e63db771 sctp: not disable bh in the whole sctp_get_port_local()
[ Upstream commit 3106ecb43a ]

With disabling bh in the whole sctp_get_port_local(), when
snum == 0 and too many ports have been used, the do-while
loop will take the cpu for a long time and cause cpu stuck:

  [ ] watchdog: BUG: soft lockup - CPU#11 stuck for 22s!
  [ ] RIP: 0010:native_queued_spin_lock_slowpath+0x4de/0x940
  [ ] Call Trace:
  [ ]  _raw_spin_lock+0xc1/0xd0
  [ ]  sctp_get_port_local+0x527/0x650 [sctp]
  [ ]  sctp_do_bind+0x208/0x5e0 [sctp]
  [ ]  sctp_autobind+0x165/0x1e0 [sctp]
  [ ]  sctp_connect_new_asoc+0x355/0x480 [sctp]
  [ ]  __sctp_connect+0x360/0xb10 [sctp]

There's no need to disable bh in the whole function of
sctp_get_port_local. So fix this cpu stuck by removing
local_bh_disable() called at the beginning, and using
spin_lock_bh() instead.

The same thing was actually done for inet_csk_get_port() in
Commit ea8add2b19 ("tcp/dccp: better use of ephemeral
ports in bind()").

Thanks to Marcelo for pointing the buggy code out.

v1->v2:
  - use cond_resched() to yield cpu to other tasks if needed,
    as Eric noticed.

Fixes: 1da177e4c3 ("Linux-2.6.12-rc2")
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:40 +02:00
Kamil Lorenc
3412e02663 net: usb: dm9601: Add USB ID of Keenetic Plus DSL
[ Upstream commit a609d02591 ]

Keenetic Plus DSL is a xDSL modem that uses dm9620 as its USB interface.

Signed-off-by: Kamil Lorenc <kamil@re-ws.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00
Paul Moore
a542f4fe6e netlabel: fix problems with mapping removal
[ Upstream commit d3b990b7f3 ]

This patch fixes two main problems seen when removing NetLabel
mappings: memory leaks and potentially extra audit noise.

The memory leaks are caused by not properly free'ing the mapping's
address selector struct when free'ing the entire entry as well as
not properly cleaning up a temporary mapping entry when adding new
address selectors to an existing entry.  This patch fixes both these
problems such that kmemleak reports no NetLabel associated leaks
after running the SELinux test suite.

The potentially extra audit noise was caused by the auditing code in
netlbl_domhsh_remove_entry() being called regardless of the entry's
validity.  If another thread had already marked the entry as invalid,
but not removed/free'd it from the list of mappings, then it was
possible that an additional mapping removal audit record would be
generated.  This patch fixes this by returning early from the removal
function when the entry was previously marked invalid.  This change
also had the side benefit of improving the code by decreasing the
indentation level of large chunk of code by one (accounting for most
of the diffstat).

Fixes: 63c4168874 ("netlabel: Add network address selectors to the NetLabel/LSM domain mapping")
Reported-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-12 11:47:39 +02:00