5.5.6-stable review
Subsystems (10)
Greg Kroah-Hartman
maintainerPATCH 140/399 selftests/net: make so_txtime more robust to timer variance
In reply to Greg Kroah-HartmanFrom: Willem de Bruijn <[email protected]>
[ Upstream commit ea6a547669b37453f2b1a5d85188d75b3613dfaa ]
The SO_TXTIME test depends on accurate timers. In some virtualized environments the test has been reported to be flaky. This is easily reproduced by disabling kvm acceleration in Qemu.
Allow greater variance in a run and retry to further reduce flakiness.
Observed errors are one of two kinds: either the packet arrives too early or late at recv(), or it was dropped in the qdisc itself and the recv() call times out.
In the latter case, the qdisc queues a notification to the error queue of the send socket. Also explicitly report this cause.
--- tools/testing/selftests/net/so_txtime.c | 84 +++++++++++++++++++++++- tools/testing/selftests/net/so_txtime.sh | 9 ++- 2 files changed, 88 insertions(+), 5 deletions(-)
tools/testing/selftests/net/so_txtime.c +81 -3
@@ -12,7 +12,11 @@#include <arpa/inet.h> #include <error.h> #include <errno.h> +#include <inttypes.h> #include <linux/net_tstamp.h> +#include <linux/errqueue.h> +#include <linux/ipv6.h> +#include <linux/tcp.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h>
@@ -28,7 +32,7 @@ static int cfg_clockid = CLOCK_TAI;static bool cfg_do_ipv4;static bool cfg_do_ipv6;static uint16_t cfg_port =8000 ; -static int cfg_variance_us =2000 ; +static int cfg_variance_us =4000 ;static uint64_t glob_tstart;
@@ -43,6 +47,9 @@ static struct timed_send cfg_in[MAX_NUM_PKT];static struct timed_send cfg_out[MAX_NUM_PKT ];static int cfg_num_pkt; +static int cfg_errq_level; +static int cfg_errq_type; +static uint64_t gettime_ns (void ) {struct timespec ts;
@@ -90,13 +97,15 @@ static void do_send_one(int fdt, struct timed_send *ts) } -static void do_recv_one (int fdr,struct timed_send *ts) +static bool do_recv_one (int fdr,struct timed_send *ts) {int64_t tstop, texpect;char rbuf[2 ];int ret; ret =recv (fdr, rbuf,sizeof (rbuf),0 ); +if (ret ==-1 && errno ==EAGAIN ) +return true;if (ret ==-1 )error (1 , errno,"read" );if (ret !=1 )
@@ -113,6 +122,8 @@ static void do_recv_one(int fdr, struct timed_send *ts)if (labs (tstop - texpect) > cfg_variance_us)error (1 ,0 ,"exceeds variance (%d us)" , cfg_variance_us); + +return false; }static void do_recv_verify_empty (int fdr)
@@ -125,12 +136,70 @@ static void do_recv_verify_empty(int fdr)error (1 ,0 ,"recv: not empty as expected (%d, %d)" , ret, errno); } +static void do_recv_errqueue_timeout (int fdt) +{ +char control[CMSG_SPACE (sizeof (struct sock_extended_err )) + +CMSG_SPACE (sizeof (struct sockaddr_in6 ))] = {0 }; +char data[sizeof (struct ipv6hdr ) + +sizeof (struct tcphdr ) +1 ]; +struct sock_extended_err *err; +struct msghdr msg = {0 }; +struct iovec iov = {0 }; +struct cmsghdr *cm; +int64_t tstamp =0 ; +int ret; + + iov.iov_base = data; + iov.iov_len =sizeof (data); + + msg.msg_iov = &iov; + msg.msg_iovlen =1 ; + + msg.msg_control = control; + msg.msg_controllen =sizeof (control); + +while (1 ) { + ret =recvmsg (fdt, &msg,MSG_ERRQUEUE ); +if (ret ==-1 && errno ==EAGAIN ) +break ; +if (ret ==-1 ) +error (1 , errno,"errqueue" ); +if (msg.msg_flags !=MSG_ERRQUEUE ) +error (1 ,0 ,"errqueue: flags 0x%x\n" , msg.msg_flags); + + cm =CMSG_FIRSTHDR (&msg); +if (cm->cmsg_level != cfg_errq_level || + cm->cmsg_type != cfg_errq_type) +error (1 ,0 ,"errqueue: type 0x%x.0x%x\n" , + cm->cmsg_level, cm->cmsg_type); + + err = (struct sock_extended_err *)CMSG_DATA (cm); +if (err->ee_origin !=SO_EE_ORIGIN_TXTIME ) +error (1 ,0 ,"errqueue: origin 0x%x\n" , err->ee_origin); +if (err->ee_code !=ECANCELED ) +error (1 ,0 ,"errqueue: code 0x%x\n" , err->ee_code); + + tstamp = ((int64_t ) err->ee_data) <<32 | err->ee_info; + tstamp -= (int64_t ) glob_tstart; + tstamp /=1000 *1000 ; +fprintf (stderr,"send: pkt %c at %" PRId64"ms dropped\n" , + data[ret -1 ], tstamp); + + msg.msg_flags =0 ; + msg.msg_controllen =sizeof (control); + } + +error (1 ,0 ,"recv: timeout" ); +} +static void setsockopt_txtime (int fd) {struct sock_txtime so_txtime_val = { .clockid = cfg_clockid };struct sock_txtime so_txtime_val_read = {0 };socklen_t vallen =sizeof (so_txtime_val); + so_txtime_val.flags =SOF_TXTIME_REPORT_ERRORS ; +if (setsockopt (fd,SOL_SOCKET ,SO_TXTIME , &so_txtime_val,sizeof (so_txtime_val)))error (1 , errno,"setsockopt txtime" );
@@ -194,7 +263,8 @@ static void do_test(struct sockaddr *addr, socklen_t alen)for (i =0 ; i < cfg_num_pkt; i++)do_send_one (fdt, &cfg_in[i]);for (i =0 ; i < cfg_num_pkt; i++) -do_recv_one (fdr, &cfg_out[i]); +if (do_recv_one (fdr, &cfg_out[i])) +do_recv_errqueue_timeout (fdt);do_recv_verify_empty (fdr);
@@ -280,6 +350,10 @@ int main(int argc, char **argv) addr6.sin6_family =AF_INET6 ; addr6.sin6_port =htons (cfg_port); addr6.sin6_addr = in6addr_loopback; + + cfg_errq_level =SOL_IPV6 ; + cfg_errq_type =IPV6_RECVERR ; +do_test ((void *)&addr6,sizeof (addr6)); }
@@ -289,6 +363,10 @@ int main(int argc, char **argv) addr4.sin_family =AF_INET ; addr4.sin_port =htons (cfg_port); addr4.sin_addr.s_addr =htonl (INADDR_LOOPBACK ); + + cfg_errq_level =SOL_IP ; + cfg_errq_type =IP_RECVERR ; +do_test ((void *)&addr4,sizeof (addr4)); }
tools/testing/selftests/net/so_txtime.sh +7 -2
@@ -5,7 +5,12 @@ # Run in network namespace if [[ $# -eq 0 ]]; then - ./in_netns.sh $0 __subprocess + if ! ./in_netns.sh $0 __subprocess; then + # test is time sensitive, can be flaky + echo "test failed: retry once" + ./in_netns.sh $0 __subprocess + fi + exit $? fi
@@ -18,7 +23,7 @@ tc qdisc add dev lo root fq ./so_txtime -4 -6 -c mono a,10,b,20 a,10,b,20 ./so_txtime -4 -6 -c mono a,20,b,10 b,20,a,20 -if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 200000; then +if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 400000; then ! ./so_txtime -4 -6 -c tai a,-1 a,-1 ! ./so_txtime -4 -6 -c tai a,0 a,0 ./so_txtime -4 -6 -c tai a,10 a,10
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 141/399 media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit afb34781620274236bd9fc9246e22f6963ef5262 ]
When building with Clang + -Wtautological-constant-compare, several of the ivtv and cx18 drivers warn along the lines of:
drivers/media/pci/cx18/cx18-driver.c:1005:21: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL,
^
drivers/media/pci/cx18/cx18-cards.h:18:37: note: expanded from macro
'CX18_HW_GPIO_RESET_CTRL'
#define CX18_HW_GPIO_RESET_CTRL (1 << 6)
^1 warning generated.
This warning happens because the shift operation is implicitly converted to a boolean in v4l2_device_mask_call_all before being negated. This can be solved by just comparing the mask result to 0 explicitly so that there is no boolean conversion. The ultimate goal is to enable -Wtautological-compare globally because there are several subwarnings that would be helpful to have.
For visual consistency and avoidance of these warnings in the future, all of the implicitly boolean conversions in the v4l2_device macros are converted to explicit ones as well.
--- include/media/v4l2-device.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
include/media/v4l2-device.h +6 -6
@@ -371,7 +371,7 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev)struct v4l2_subdev *__sd; \ \__v4l2_device_call_subdevs_p (v4l2_dev, __sd, \ - !(grpid) || __sd->grp_id == (grpid), o, f , \ + (grpid) == 0 || __sd->grp_id == (grpid), o, f , \ ##args); \ }while (0 )
@@ -403,7 +403,7 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev) ({ \struct v4l2_subdev *__sd; \__v4l2_device_call_subdevs_until_err_p (v4l2_dev, __sd, \ - !(grpid) || __sd->grp_id == (grpid), o, f , \ + (grpid) == 0 || __sd->grp_id == (grpid), o, f , \ ##args); \ })
@@ -431,8 +431,8 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev)struct v4l2_subdev *__sd; \ \__v4l2_device_call_subdevs_p (v4l2_dev, __sd, \ - !(grpmsk) || (__sd->grp_id & (grpmsk)), o, f , \ - ##args); \ + (grpmsk) ==0 || (__sd->grp_id & (grpmsk)), o, \ + f , ##args); \ }while (0 )/**
@@ -462,8 +462,8 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev) ({ \struct v4l2_subdev *__sd; \__v4l2_device_call_subdevs_until_err_p (v4l2_dev, __sd, \ - !(grpmsk) || (__sd->grp_id & (grpmsk)), o, f , \ - ##args); \ + (grpmsk) ==0 || (__sd->grp_id & (grpmsk)), o, \ + f , ##args); \ })
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 142/399 reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
[ Upstream commit 4d5c1adaf893b8aa52525d2b81995e949bcb3239 ]
When we fail to allocate string for journal device name we jump to 'error' label which tries to unlock reiserfs write lock which is not held. Jump to 'error_unlocked' instead.
--- fs/reiserfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/super.c +1 -1
@@ -1948,7 +1948,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)if (!sbi->s_jdev) {SWARN (silent, s,"" ,"Cannot allocate memory for " "journal device name" ); - goto error; + goto error_unlocked; } }#ifdef CONFIG_QUOTA
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 143/399 samples/bpf: Set -fno-stack-protector when building BPF programs
In reply to Greg Kroah-HartmanFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 450278977acbf494a20367c22fbb38729772d1fc ]
It seems Clang can in some cases turn on stack protection by default, which doesn't work with BPF. This was reported once before[0], but it seems the flag to explicitly turn off the stack protector wasn't added to the Makefile, so do that now.
The symptom of this is compile errors like the following:
error: <unknown>:0:0: in function bpf_prog1 i32 (%struct.__sk_buff*): A call to built-in function '__stack_chk_fail' is not supported.
[0] https://www.spinics.net/lists/netdev/msg556400.html
--- samples/bpf/Makefile | 1 + 1 file changed, 1 insertion(+)
samples/bpf/Makefile +1 -0
@@ -236,6 +236,7 @@ BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \ readelf -S ./llvm_btf_verify.o | grep BTF; \ /bin/rm -f ./llvm_btf_verify.o) +BPF_EXTRA_CFLAGS += -fno-stack-protector ifneq ($(BTF_LLVM_PROBE),) BPF_EXTRA_CFLAGS += -g else
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 144/399 r8169: check that Realtek PHY driver module is loaded
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit f325937735498afb054a0195291bbf68d0b60be5 ]
Some users complained about problems with r8169 and it turned out that the generic PHY driver was used instead instead of the dedicated one. In all cases reason was that r8169.ko was in initramfs, but realtek.ko not. Manually adding realtek.ko to initramfs fixed the issues. Root cause seems to be that tools like dracut and genkernel don't consider softdeps. Add a check for loaded Realtek PHY driver module and provide the user with a hint if it's not loaded.
--- drivers/net/ethernet/realtek/r8169_main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +9 -0
@@ -6831,6 +6831,15 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)int chipset, region;int jumbo_max, rc; +/* Some tools for creating an initramfs don't consider softdeps, then +* r8169.ko may be in initramfs, but realtek.ko not. Then the generic +* PHY driver is used that doesn't work with most chip versions. +*/ +if (!driver_find ("RTL8201CP Ethernet" , &mdio_bus_type)) { +dev_err (&pdev->dev,"realtek.ko not loaded, maybe it needs to be added to initramfs?\n" ); +return -ENOENT ; + } + dev =devm_alloc_etherdev (&pdev->dev,sizeof (*tp));if (!dev)return -ENOMEM ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 145/399 fore200e: Fix incorrect checks of NULL pointer dereference
In reply to Greg Kroah-HartmanFrom: Aditya Pakki <[email protected]>
[ Upstream commit bbd20c939c8aa3f27fa30e86691af250bf92973a ]
In fore200e_send and fore200e_close, the pointers from the arguments are dereferenced in the variable declaration block and then checked for NULL. The patch fixes these issues by avoiding NULL pointer dereferences.
--- drivers/atm/fore200e.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/atm/fore200e.c +18 -7
@@ -1414,12 +1414,14 @@ fore200e_open(struct atm_vcc *vcc)static void fore200e_close (struct atm_vcc * vcc) { -struct fore200e * fore200e =FORE200E_DEV (vcc->dev);struct fore200e_vcc * fore200e_vcc; +struct fore200e * fore200e;struct fore200e_vc_map * vc_map;unsigned long flags;ASSERT (vcc); + fore200e =FORE200E_DEV (vcc->dev); +ASSERT ((vcc->vpi >=0 ) && (vcc->vpi <1 <<FORE200E_VPI_BITS ));ASSERT ((vcc->vci >=0 ) && (vcc->vci <1 <<FORE200E_VCI_BITS ));
@@ -1464,10 +1466,10 @@ fore200e_close(struct atm_vcc* vcc)static int fore200e_send (struct atm_vcc *vcc,struct sk_buff *skb) { -struct fore200e * fore200e =FORE200E_DEV (vcc->dev); -struct fore200e_vcc * fore200e_vcc =FORE200E_VCC (vcc); +struct fore200e * fore200e; +struct fore200e_vcc * fore200e_vcc;struct fore200e_vc_map * vc_map; -struct host_txq * txq = &fore200e->host_txq; +struct host_txq * txq;struct host_txq_entry * entry;struct tpd * tpd;struct tpd_haddr tpd_haddr;
@@ -1480,9 +1482,18 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb)unsigned char * data;unsigned long flags; -ASSERT (vcc); -ASSERT (fore200e); -ASSERT (fore200e_vcc); +if (!vcc) +return -EINVAL ; + + fore200e =FORE200E_DEV (vcc->dev); + fore200e_vcc =FORE200E_VCC (vcc); + +if (!fore200e) +return -EINVAL ; + + txq = &fore200e->host_txq; +if (!fore200e_vcc) +return -EINVAL ;if (!test_bit (ATM_VF_READY , &vcc->flags)) {DPRINTK (1 ,"VC %d.%d.%d not ready for tx\n" , vcc->itf, vcc->vpi, vcc->vpi);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 146/399 isdn: dont mark kcapi_proc_exit as __exit
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit b33bdf8020c94438269becc6dace9ed49257c4ba ]
As everybody pointed out by now, my patch to clean up CAPI introduced a link time warning, as the two parts of the capi driver are now in one module and the exit function may need to be called in the error path of the init function:
Quoted 1 line
Quoted 1 line
WARNING: drivers/isdn/capi/kernelcapi.o(.text+0xea4): Section mismatch in reference from the function
kcapi_exit()to the function .exit.text:kcapi_proc_exit()
The function kcapi_exit() references a function in an exit section. Often the function kcapi_proc_exit() has valid usage outside the exit section and the fix is to remove the __exit annotation of kcapi_proc_exit.
Remove the incorrect __exit annotation.
--- drivers/isdn/capi/kcapi_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/isdn/capi/kcapi_proc.c +1 -1
@@ -239,7 +239,7 @@ kcapi_proc_init(void)proc_create_seq ("capi/driver" ,0 ,NULL , &seq_capi_driver_ops); } -void __exit +void kcapi_proc_exit (void ) {remove_proc_entry ("capi/driver" ,NULL );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 147/399 x86/mce/therm_throt: Mark throttle_active_work() as __maybe_unused
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit db1ae0314f47e88ae06679270adf17ffa245afd4 ]
throttle_active_work() is only called if CONFIG_SYSFS is set, otherwise we get a harmless warning:
arch/x86/kernel/cpu/mce/therm_throt.c:238:13: error: 'throttle_active_work' \
defined but not used [-Werror=unused-function]
Mark the function as __maybe_unused to avoid the warning.
--- arch/x86/kernel/cpu/mce/therm_throt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mce/therm_throt.c +1 -1
@@ -235,7 +235,7 @@ static void get_therm_status(int level, bool *proc_hot, u8 *temp) *temp = (msr_val >>16 ) &0x7F ; } -static void throttle_active_work (struct work_struct *work) +static void __maybe_unused throttle_active_work (struct work_struct *work) {struct _thermal_state *state =container_of (to_delayed_work (work), struct _thermal_state, therm_work);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 148/399 ARM: OMAP2+: pdata-quirks: add PRM data for reset support
In reply to Greg Kroah-HartmanFrom: Tero Kristo <[email protected]>
[ Upstream commit 8de44fb70659a5bc0c53a443e6129ea1bf00fd8b ]
The parent clockdomain for reset must be in force wakeup mode, otherwise the reset may never complete. Add pdata quirks for this purpose for PRM driver.
--- arch/arm/mach-omap2/pdata-quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +8 -0
@@ -23,6 +23,7 @@#include <linux/platform_data/ti-sysc.h> #include <linux/platform_data/wkup_m3.h> #include <linux/platform_data/asoc-ti-mcbsp.h> +#include <linux/platform_data/ti-prm.h> #include "clockdomain.h" #include "common.h"
@@ -412,6 +413,12 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void)) pcs_pdata.rearm = rearm; } +static struct ti_prm_platform_data ti_prm_pdata = { + .clkdm_deny_idle = clkdm_deny_idle, + .clkdm_allow_idle = clkdm_allow_idle, + .clkdm_lookup = clkdm_lookup, +}; +/* * GPIOs for TWL are initialized by the I2C bus and need custom * handing until DSS has device tree bindings.
@@ -514,6 +521,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {/* Common auxdata */ OF_DEV_AUXDATA ("ti,sysc" ,0 ,NULL , &ti_sysc_pdata),OF_DEV_AUXDATA ("pinctrl-single" ,0 ,NULL , &pcs_pdata), + OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata), { /* sentinel */ }, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 149/399 netfilter: nft_tunnel: add the missing ERSPAN_VERSION nla_policy
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 0705f95c332081036d85f26691e9d3cd7d901c31 ]
ERSPAN_VERSION is an attribute parsed in kernel side, nla_policy type should be added for it, like other attributes.
--- net/netfilter/nft_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nft_tunnel.c +2 -1
@@ -248,8 +248,9 @@ static int nft_tunnel_obj_vxlan_init(const struct nlattr *attr, }static const struct nla_policy nft_tunnel_opts_erspan_policy[NFTA_TUNNEL_KEY_ERSPAN_MAX +1 ] = { + [NFTA_TUNNEL_KEY_ERSPAN_VERSION ] = { .type =NLA_U32 }, [NFTA_TUNNEL_KEY_ERSPAN_V1_INDEX ] = { .type =NLA_U32 }, - [NFTA_TUNNEL_KEY_ERSPAN_V2_DIR ] = { .type =NLA_U8 }, + [NFTA_TUNNEL_KEY_ERSPAN_V2_DIR ] = { .type =NLA_U8 }, [NFTA_TUNNEL_KEY_ERSPAN_V2_HWID ] = { .type =NLA_U8 }, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 150/399 ALSA: usx2y: Adjust indentation in snd_usX2Y_hwdep_dsp_status
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit df4654bd6e42125d9b85ce3a26eaca2935290b98 ]
Clang warns:
../sound/usb/usx2y/usX2Yhwdep.c:122:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
info->version = USX2Y_DRIVER_VERSION;
^
../sound/usb/usx2y/usX2Yhwdep.c:120:2: note: previous statement is here
if (us428->chip_status & USX2Y_STAT_CHIP_INIT)
^1 warning generated.
This warning occurs because there is a space before the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.
This was introduced before the beginning of git history so no fixes tag.
--- sound/usb/usx2y/usX2Yhwdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/usx2y/usX2Yhwdep.c +1 -1
@@ -119,7 +119,7 @@ static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, info->num_dsps =2 ;// 0: Prepad Data, 1: FPGA Code if (us428->chip_status &USX2Y_STAT_CHIP_INIT ) info->chip_ready =1 ; - info->version =USX2Y_DRIVER_VERSION ; + info->version =USX2Y_DRIVER_VERSION ;return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 151/399 nfs: fix timstamp debug prints
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 057f184b1245150b88e59997fc6f1af0e138d42e ]
Starting in v5.5, the timestamps are correctly passed down as 64-bit seconds with NFSv4 on 32-bit machines, but some debug statements still truncate them to 'long'.
--- fs/nfs/nfs4xdr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
fs/nfs/nfs4xdr.c +5 -5
@@ -4097,7 +4097,7 @@ static int decode_attr_time_access(struct xdr_stream *xdr, uint32_t *bitmap, str status =NFS_ATTR_FATTR_ATIME ; bitmap[1 ] &= ~FATTR4_WORD1_TIME_ACCESS ; } -dprintk ("%s: atime=%ld\n" , __func__, (long )time->tv_sec); +dprintk ("%s: atime=%lld\n" , __func__, time->tv_sec);return status; }
@@ -4115,7 +4115,7 @@ static int decode_attr_time_metadata(struct xdr_stream *xdr, uint32_t *bitmap, s status =NFS_ATTR_FATTR_CTIME ; bitmap[1 ] &= ~FATTR4_WORD1_TIME_METADATA ; } -dprintk ("%s: ctime=%ld\n" , __func__, (long )time->tv_sec); +dprintk ("%s: ctime=%lld\n" , __func__, time->tv_sec);return status; }
@@ -4132,8 +4132,8 @@ static int decode_attr_time_delta(struct xdr_stream *xdr, uint32_t *bitmap, status =decode_attr_time (xdr, time); bitmap[1 ] &= ~FATTR4_WORD1_TIME_DELTA ; } -dprintk ("%s: time_delta=%ld %ld\n" , __func__, (long )time->tv_sec, - (long )time->tv_nsec); +dprintk ("%s: time_delta=%lld %ld\n" , __func__, time->tv_sec, + time->tv_nsec);return status; }
@@ -4197,7 +4197,7 @@ static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, str status =NFS_ATTR_FATTR_MTIME ; bitmap[1 ] &= ~FATTR4_WORD1_TIME_MODIFY ; } -dprintk ("%s: mtime=%ld\n" , __func__, (long )time->tv_sec); +dprintk ("%s: mtime=%lld\n" , __func__, time->tv_sec);return status; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 152/399 PCI: Add nr_devfns parameter to pci_add_dma_alias()
In reply to Greg Kroah-HartmanFrom: James Sewart <[email protected]>
[ Upstream commit 09298542cd891b43778db1f65aa3613aa5a562eb ]
Add a "nr_devfns" parameter to pci_add_dma_alias() so it can be used to create DMA aliases for a range of devfns.
[bhelgaas: incorporate nr_devfns fix from James, update quirk_pex_vca_alias() and setup_aliases()]
--- drivers/iommu/amd_iommu.c | 7 ++----- drivers/pci/pci.c | 22 +++++++++++++++++----- drivers/pci/quirks.c | 23 +++++++++-------------- include/linux/pci.h | 2 +- 4 files changed, 29 insertions(+), 25 deletions(-)
drivers/iommu/amd_iommu.c +2 -5
@@ -230,11 +230,8 @@ static struct pci_dev *setup_aliases(struct device *dev)*/ ivrs_alias = amd_iommu_alias_table[pci_dev_id (pdev)];if (ivrs_alias !=pci_dev_id (pdev) && -PCI_BUS_NUM (ivrs_alias) == pdev->bus->number) { -pci_add_dma_alias (pdev, ivrs_alias &0xff ); -pci_info (pdev,"Added PCI DMA alias %02x.%d\n" , -PCI_SLOT (ivrs_alias),PCI_FUNC (ivrs_alias)); - } +PCI_BUS_NUM (ivrs_alias) == pdev->bus->number) +pci_add_dma_alias (pdev, ivrs_alias &0xff ,1 );clone_aliases (pdev);
drivers/pci/pci.c +17 -5
@@ -5998,7 +5998,8 @@ EXPORT_SYMBOL_GPL(pci_pr3_present);/** * pci_add_dma_alias - Add a DMA devfn alias for a device * @dev: the PCI device for which alias is added -* @devfn: alias slot and function +* @devfn_from: alias slot and function +* @nr_devfns: number of subsequent devfns to alias * * This helper encodes an 8-bit devfn as a bit number in dma_alias_mask * which is used to program permissible bus-devfn source addresses for DMA
@@ -6014,8 +6015,13 @@ EXPORT_SYMBOL_GPL(pci_pr3_present);* cannot be left as a userspace activity). DMA aliases should therefore * be configured via quirks, such as the PCI fixup header quirk. */ -void pci_add_dma_alias (struct pci_dev *dev,u8 devfn) +void pci_add_dma_alias (struct pci_dev *dev,u8 devfn_from,unsigned nr_devfns) { +int devfn_to; + + nr_devfns =min (nr_devfns, (unsigned )MAX_NR_DEVFNS - devfn_from); + devfn_to = devfn_from + nr_devfns -1 ; +if (!dev->dma_alias_mask) dev->dma_alias_mask =bitmap_zalloc (MAX_NR_DEVFNS ,GFP_KERNEL );if (!dev->dma_alias_mask) {
@@ -6023,9 +6029,15 @@ void pci_add_dma_alias(struct pci_dev *dev, u8 devfn)return ; } -set_bit (devfn, dev->dma_alias_mask); -pci_info (dev,"Enabling fixed DMA alias to %02x.%d\n" , -PCI_SLOT (devfn),PCI_FUNC (devfn)); +bitmap_set (dev->dma_alias_mask, devfn_from, nr_devfns); + +if (nr_devfns ==1 ) +pci_info (dev,"Enabling fixed DMA alias to %02x.%d\n" , +PCI_SLOT (devfn_from),PCI_FUNC (devfn_from)); +else if (nr_devfns >1 ) +pci_info (dev,"Enabling fixed DMA alias for devfn range from %02x.%d to %02x.%d\n" , +PCI_SLOT (devfn_from),PCI_FUNC (devfn_from), +PCI_SLOT (devfn_to),PCI_FUNC (devfn_to)); }bool pci_devs_are_dma_aliases (struct pci_dev *dev1,struct pci_dev *dev2)
drivers/pci/quirks.c +9 -14
@@ -3927,7 +3927,7 @@ int pci_dev_specific_reset(struct pci_dev *dev, int probe)static void quirk_dma_func0_alias (struct pci_dev *dev) {if (PCI_FUNC (dev->devfn) !=0 ) -pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),0 )); +pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),0 ),1 ); }/*
@@ -3941,7 +3941,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe476, quirk_dma_func0_alias);static void quirk_dma_func1_alias (struct pci_dev *dev) {if (PCI_FUNC (dev->devfn) !=1 ) -pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),1 )); +pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),1 ),1 ); }/*
@@ -4026,7 +4026,7 @@ static void quirk_fixed_dma_alias(struct pci_dev *dev) id =pci_match_id (fixed_dma_alias_tbl, dev);if (id) -pci_add_dma_alias (dev, id->driver_data); +pci_add_dma_alias (dev, id->driver_data,1 ); }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_ADAPTEC2 ,0x0285 , quirk_fixed_dma_alias);
@@ -4067,9 +4067,9 @@ DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);*/ static void quirk_mic_x200_dma_alias (struct pci_dev *pdev) { -pci_add_dma_alias (pdev,PCI_DEVFN (0x10 ,0x0 )); -pci_add_dma_alias (pdev,PCI_DEVFN (0x11 ,0x0 )); -pci_add_dma_alias (pdev,PCI_DEVFN (0x12 ,0x3 )); +pci_add_dma_alias (pdev,PCI_DEVFN (0x10 ,0x0 ),1 ); +pci_add_dma_alias (pdev,PCI_DEVFN (0x11 ,0x0 ),1 ); +pci_add_dma_alias (pdev,PCI_DEVFN (0x12 ,0x3 ),1 ); }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2260 , quirk_mic_x200_dma_alias);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2264 , quirk_mic_x200_dma_alias);
@@ -4093,13 +4093,8 @@ static void quirk_pex_vca_alias(struct pci_dev *pdev)const unsigned int num_pci_slots =0x20 ;unsigned int slot; -for (slot =0 ; slot < num_pci_slots; slot++) { -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x0 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x1 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x2 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x3 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x4 )); - } +for (slot =0 ; slot < num_pci_slots; slot++) +pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x0 ),5 ); }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2954 , quirk_pex_vca_alias);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2955 , quirk_pex_vca_alias);
@@ -5334,7 +5329,7 @@ static void quirk_switchtec_ntb_dma_alias(struct pci_dev *pdev)pci_dbg (pdev,"Aliasing Partition %d Proxy ID %02x.%d\n" , pp,PCI_SLOT (devfn),PCI_FUNC (devfn)); -pci_add_dma_alias (pdev, devfn); +pci_add_dma_alias (pdev, devfn,1 ); } }
include/linux/pci.h +1 -1
@@ -2310,7 +2310,7 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) }#endif -void pci_add_dma_alias (struct pci_dev *dev,u8 devfn); +void pci_add_dma_alias (struct pci_dev *dev,u8 devfn_from,unsigned nr_devfns);bool pci_devs_are_dma_aliases (struct pci_dev *dev1,struct pci_dev *dev2); int pci_for_each_dma_alias(struct pci_dev *pdev, int (*fn)(struct pci_dev *pdev,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 153/399 PCI: Add DMA alias quirk for PLX PEX NTB
In reply to Greg Kroah-HartmanFrom: James Sewart <[email protected]>
[ Upstream commit 7b90dfc4873b87c468cc6046538f46a531c1d785 ]
The PLX PEX NTB forwards DMA transactions using Requester IDs that don't exist as PCI devices. The devfn for a transaction is used as an index into a lookup table storing the origin of a transaction on the other side of the bridge.
Alias all possible devfns to the NTB device so that any transaction coming in is governed by the mappings for the NTB.
--- drivers/pci/quirks.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/pci/quirks.c +15 -0
@@ -5371,6 +5371,21 @@ SWITCHTEC_QUIRK(0x8574); /* PFXI 64XG3 */SWITCHTEC_QUIRK (0x8575 );/* PFXI 80XG3 */ SWITCHTEC_QUIRK (0x8576 );/* PFXI 96XG3 */ +/* +* The PLX NTB uses devfn proxy IDs to move TLPs between NT endpoints. +* These IDs are used to forward responses to the originator on the other +* side of the NTB. Alias all possible IDs to the NTB to permit access when +* the IOMMU is turned on. +*/ +static void quirk_plx_ntb_dma_alias (struct pci_dev *pdev) +{ +pci_info (pdev,"Setting PLX NTB proxy ID aliases\n" ); +/* PLX NTB may use all 256 devfns */ +pci_add_dma_alias (pdev,0 ,256 ); +} +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_PLX ,0x87b0 , quirk_plx_ntb_dma_alias); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_PLX ,0x87b1 , quirk_plx_ntb_dma_alias); +/* * On Lenovo Thinkpad P50 SKUs with a Nvidia Quadro M1000M, the BIOS does * not always reset the secondary Nvidia GPU between reboots if the system
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 154/399 b43legacy: Fix -Wcast-function-type
In reply to Greg Kroah-HartmanFrom: Phong Tran <[email protected]>
[ Upstream commit 475eec112e4267232d10f4afe2f939a241692b6c ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/broadcom/b43legacy/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/b43legacy/main.c +3 -2
@@ -1275,8 +1275,9 @@ static void handle_irq_ucode_debug(struct b43legacy_wldev *dev) }/* Interrupt handler bottom-half */ -static void b43legacy_interrupt_tasklet (struct b43legacy_wldev *dev) +static void b43legacy_interrupt_tasklet (unsigned long data) { +struct b43legacy_wldev *dev = (struct b43legacy_wldev *)data;u32 reason;u32 dma_reason[ARRAY_SIZE (dev->dma_reason)];u32 merged_dma_reason =0 ;
@@ -3741,7 +3742,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,b43legacy_set_status (wldev, B43legacy_STAT_UNINIT); wldev->bad_frames_preempt = modparam_bad_frames_preempt;tasklet_init (&wldev->isr_tasklet, - (void (*)(unsigned long ))b43legacy_interrupt_tasklet, + b43legacy_interrupt_tasklet, (unsigned long )wldev);if (modparam_pio) wldev->__using_pio = true;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 155/399 ipw2x00: Fix -Wcast-function-type
In reply to Greg Kroah-HartmanFrom: Phong Tran <[email protected]>
[ Upstream commit ebd77feb27e91bb5fe35a7818b7c13ea7435fb98 ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/intel/ipw2x00/ipw2100.c | 7 ++++--- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/ipw2x00/ipw2100.c +4 -3
@@ -3206,8 +3206,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv) } } -static void ipw2100_irq_tasklet (struct ipw2100_priv *priv) +static void ipw2100_irq_tasklet (unsigned long data) { +struct ipw2100_priv *priv = (struct ipw2100_priv *)data;struct net_device *dev = priv->net_dev;unsigned long flags;u32 inta, tmp;
@@ -6006,7 +6007,7 @@ static void ipw2100_rf_kill(struct work_struct *work)spin_unlock_irqrestore (&priv->low_lock, flags); } -static void ipw2100_irq_tasklet (struct ipw2100_priv *priv); +static void ipw2100_irq_tasklet (unsigned long data);static const struct net_device_ops ipw2100_netdev_ops = { .ndo_open = ipw2100_open,
@@ -6136,7 +6137,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,INIT_DELAYED_WORK (&priv->rf_kill, ipw2100_rf_kill);INIT_DELAYED_WORK (&priv->scan_event, ipw2100_scan_event); -tasklet_init (&priv->irq_tasklet, (void (*)(unsigned long )) +tasklet_init (&priv->irq_tasklet, ipw2100_irq_tasklet, (unsigned long )priv);/* NOTE: We do not start the deferred work for status checks yet */
drivers/net/wireless/intel/ipw2x00/ipw2200.c +3 -2
@@ -1945,8 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)wireless_send_event (priv->net_dev,SIOCGIWAP , &wrqu,NULL ); } -static void ipw_irq_tasklet (struct ipw_priv *priv) +static void ipw_irq_tasklet (unsigned long data) { +struct ipw_priv *priv = (struct ipw_priv *)data;u32 inta, inta_mask, handled =0 ;unsigned long flags;int rc =0 ;
@@ -10677,7 +10678,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)INIT_WORK (&priv->qos_activate, ipw_bg_qos_activate);#endif /* CONFIG_IPW2200_QOS */ -tasklet_init (&priv->irq_tasklet, (void (*)(unsigned long )) +tasklet_init (&priv->irq_tasklet, ipw_irq_tasklet, (unsigned long )priv);return ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 156/399 iwlegacy: Fix -Wcast-function-type
In reply to Greg Kroah-HartmanFrom: Phong Tran <[email protected]>
[ Upstream commit da5e57e8a6a3e69dac2937ba63fa86355628fbb2 ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++-- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlegacy/3945-mac.c +3 -2
@@ -1376,8 +1376,9 @@ il3945_dump_nic_error_log(struct il_priv *il) }static void -il3945_irq_tasklet (struct il_priv *il) +il3945_irq_tasklet (unsigned long data) { +struct il_priv *il = (struct il_priv *)data;u32 inta, handled =0 ;u32 inta_fh;unsigned long flags;
@@ -3401,7 +3402,7 @@ il3945_setup_deferred_work(struct il_priv *il)timer_setup (&il->watchdog, il_bg_watchdog,0 );tasklet_init (&il->irq_tasklet, - (void (*)(unsigned long ))il3945_irq_tasklet, + il3945_irq_tasklet, (unsigned long )il); }
drivers/net/wireless/intel/iwlegacy/4965-mac.c +3 -2
@@ -4343,8 +4343,9 @@ il4965_synchronize_irq(struct il_priv *il) }static void -il4965_irq_tasklet (struct il_priv *il) +il4965_irq_tasklet (unsigned long data) { +struct il_priv *il = (struct il_priv *)data;u32 inta, handled =0 ;u32 inta_fh;unsigned long flags;
@@ -6237,7 +6238,7 @@ il4965_setup_deferred_work(struct il_priv *il)timer_setup (&il->watchdog, il_bg_watchdog,0 );tasklet_init (&il->irq_tasklet, - (void (*)(unsigned long ))il4965_irq_tasklet, + il4965_irq_tasklet, (unsigned long )il); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 157/399 rtlwifi: rtl_pci: Fix -Wcast-function-type
In reply to Greg Kroah-HartmanFrom: Phong Tran <[email protected]>
[ Upstream commit cb775c88da5d48a85d99d95219f637b6fad2e0e9 ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +6 -4
@@ -1061,13 +1061,15 @@ done:return ret; } -static void _rtl_pci_irq_tasklet (struct ieee80211_hw *hw) +static void _rtl_pci_irq_tasklet (unsigned long data) { +struct ieee80211_hw *hw = (struct ieee80211_hw *)data;_rtl_pci_tx_chk_waitq (hw); } -static void _rtl_pci_prepare_bcn_tasklet (struct ieee80211_hw *hw) +static void _rtl_pci_prepare_bcn_tasklet (unsigned long data) { +struct ieee80211_hw *hw = (struct ieee80211_hw *)data;struct rtl_priv *rtlpriv =rtl_priv (hw);struct rtl_pci *rtlpci =rtl_pcidev (rtl_pcipriv (hw));struct rtl_mac *mac =rtl_mac (rtl_priv (hw));
@@ -1193,10 +1195,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,/*task */ tasklet_init (&rtlpriv->works.irq_tasklet, - (void (*)(unsigned long ))_rtl_pci_irq_tasklet, + _rtl_pci_irq_tasklet, (unsigned long )hw);tasklet_init (&rtlpriv->works.irq_prepare_bcn_tasklet, - (void (*)(unsigned long ))_rtl_pci_prepare_bcn_tasklet, + _rtl_pci_prepare_bcn_tasklet, (unsigned long )hw);INIT_WORK (&rtlpriv->works.lps_change_work, rtl_lps_change_work_callback);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 158/399 orinoco: avoid assertion in case of NULL pointer
In reply to Greg Kroah-HartmanFrom: Aditya Pakki <[email protected]>
[ Upstream commit c705f9fc6a1736dcf6ec01f8206707c108dca824 ]
In ezusb_init, if upriv is NULL, the code crashes. However, the caller in ezusb_probe can handle the error and print the failure message. The patch replaces the BUG_ON call to error return.
--- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intersil/orinoco/orinoco_usb.c +2 -1
@@ -1361,7 +1361,8 @@ static int ezusb_init(struct hermes *hw)int retval;BUG_ON (in_interrupt ()); -BUG_ON (!upriv); +if (!upriv) +return -EINVAL ; upriv->reply_count =0 ;/* Write the MAGIC number on the simulated registers to keep
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 159/399 drm/amd/display: Fix update_bw_bounding_box Calcs
In reply to Greg Kroah-HartmanFrom: Sung Lee <[email protected]>
[ Upstream commit 615b9b585eb57c1d49382d16a62de768f2c6a340 ]
[Why]
Previously update_bw_bounding_box for RN was commented out due to incorrect values causing BSOD on Hybrid Graphics. However, commenting out this function also may cause issues such as underflow in certain cases such as 2x4K displays.
[How]
Fix dram_speed_mts calculations.
Update from proper index of clock_limits[]
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -9
@@ -1352,12 +1352,6 @@ struct display_stream_compressor *dcn21_dsc_create(static void update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params) { -/* -TODO: Fix this function to calcualte correct values. -There are known issues with this function currently -that will need to be investigated. Use hardcoded known good values for now. - -struct dcn21_resource_pool *pool =TO_DCN21_RES_POOL (dc->res_pool);struct clk_limit_table *clk_table = &bw_params->clk_table;int i;
@@ -1372,11 +1366,10 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn2_1_soc.clock_limits[i].dcfclk_mhz = clk_table->entries[i].dcfclk_mhz; dcn2_1_soc.clock_limits[i].fabricclk_mhz = clk_table->entries[i].fclk_mhz; dcn2_1_soc.clock_limits[i].socclk_mhz = clk_table->entries[i].socclk_mhz; -dcn2_1_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz * 16 / 1000; + dcn2_1_soc.clock_limits[i].dram_speed_mts = clk_table->entries[i].memclk_mhz *2 ; } -dcn2_1_soc.clock_limits[i] = dcn2_1_soc.clock_limits[i - i]; + dcn2_1_soc.clock_limits[i] = dcn2_1_soc.clock_limits[i -1 ]; dcn2_1_soc.num_states = i; -*/ }/* Temporary Place holder until we can get them from fuse */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 160/399 drm/amd/display: Lower DPP DTO only when safe
In reply to Greg Kroah-HartmanFrom: Sung Lee <[email protected]>
[ Upstream commit 5479034576ec8b7166a66efe5de1d911feb43d4a ]
[Why]
A corner case currently exists where DPP DTO is lowered before pipes are updated to a higher viewport. This causes underflow as the DPPCLK is too low for the current viewport.
[How]
Only lower DPP DTO when it is safe to lower, or if the newer clocks are higher than the current ones.
--- .../amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 16 ++++++++++------ .../amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.h | 2 +- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 8 ++++---- 3 files changed, 15 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +10 -6
@@ -100,13 +100,13 @@ uint32_t dentist_get_did_from_divider(int divider) }void dcn20_update_clocks_update_dpp_dto (struct clk_mgr_internal *clk_mgr, -struct dc_state *context) +struct dc_state *context,bool safe_to_lower) {int i; clk_mgr->dccg->ref_dppclk = clk_mgr->base.clks.dppclk_khz;for (i =0 ; i < clk_mgr->base.ctx->dc->res_pool->pipe_count; i++) { -int dpp_inst, dppclk_khz; +int dpp_inst, dppclk_khz, prev_dppclk_khz;/* Loop index will match dpp->inst if resource exists, * and we want to avoid dependency on dpp object
@@ -114,8 +114,12 @@ void dcn20_update_clocks_update_dpp_dto(struct clk_mgr_internal *clk_mgr, dpp_inst = i; dppclk_khz = context->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz; - clk_mgr->dccg->funcs->update_dpp_dto ( - clk_mgr->dccg, dpp_inst, dppclk_khz); + prev_dppclk_khz = clk_mgr->base.ctx->dc->current_state->res_ctx.pipe_ctx[i].plane_res.bw.dppclk_khz; + +if (safe_to_lower || prev_dppclk_khz < dppclk_khz) { + clk_mgr->dccg->funcs->update_dpp_dto ( + clk_mgr->dccg, dpp_inst, dppclk_khz); + } } }
@@ -240,7 +244,7 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base,if (dc->config.forced_clocks == false || (force_reset && safe_to_lower)) {if (dpp_clock_lowered) {// if clock is being lowered, increase DTO before lowering refclk -dcn20_update_clocks_update_dpp_dto (clk_mgr, context); +dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower);dcn20_update_clocks_update_dentist (clk_mgr); }else {// if clock is being raised, increase refclk before lowering DTO
@@ -248,7 +252,7 @@ void dcn2_update_clocks(struct clk_mgr *clk_mgr_base,dcn20_update_clocks_update_dentist (clk_mgr);// always update dtos unless clock is lowered and not safe to lower if (new_clocks->dppclk_khz >= dc->current_state->bw_ctx.bw.dcn.clk.dppclk_khz) -dcn20_update_clocks_update_dpp_dto (clk_mgr, context); +dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower); } }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.h +1 -1
@@ -34,7 +34,7 @@ void dcn2_update_clocks_fpga(struct clk_mgr *clk_mgr,struct dc_state *context, bool safe_to_lower);void dcn20_update_clocks_update_dpp_dto (struct clk_mgr_internal *clk_mgr, -struct dc_state *context); +struct dc_state *context,bool safe_to_lower);void dcn2_init_clocks (struct clk_mgr *clk_mgr);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +4 -4
@@ -164,16 +164,16 @@ void rn_update_clocks(struct clk_mgr *clk_mgr_base, }if (dpp_clock_lowered) { -// if clock is being lowered, increase DTO before lowering refclk -dcn20_update_clocks_update_dpp_dto (clk_mgr, context); +// increase per DPP DTO before lowering global dppclk +dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower);rn_vbios_smu_set_dppclk (clk_mgr, clk_mgr_base->clks.dppclk_khz); }else { -// if clock is being raised, increase refclk before lowering DTO +// increase global DPPCLK before lowering per DPP DTO if (update_dppclk || update_dispclk)rn_vbios_smu_set_dppclk (clk_mgr, clk_mgr_base->clks.dppclk_khz);// always update dtos unless clock is lowered and not safe to lower if (new_clocks->dppclk_khz >= dc->current_state->bw_ctx.bw.dcn.clk.dppclk_khz) -dcn20_update_clocks_update_dpp_dto (clk_mgr, context); +dcn20_update_clocks_update_dpp_dto (clk_mgr, context, safe_to_lower); } if (update_dispclk &&
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 161/399 drm/amdgpu: fix double gpu_recovery for NV of SRIOV
In reply to Greg Kroah-HartmanFrom: Monk Liu <[email protected]>
[ Upstream commit 1512d064f55bace6a8e32d65009c7ea112e76a31 ]
issues:gpu_recover() is re-entered by the mailbox interrupt handler mxgpu_nv.c
fix:
we need to bypass the gpu_recover() invoke in mailbox interrupt as long as the timeout is not infinite (thus the TDR will be triggered automatically after time out, no need to invoke gpu_recover() through mailbox interrupt.
--- drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +5 -1
@@ -269,7 +269,11 @@ flr_done: }/* Trigger recovery for world switch failure if no TDR */ -if (amdgpu_device_should_recover_gpu (adev)) +if (amdgpu_device_should_recover_gpu (adev) + && (adev->sdma_timeout ==MAX_SCHEDULE_TIMEOUT || + adev->gfx_timeout ==MAX_SCHEDULE_TIMEOUT || + adev->compute_timeout ==MAX_SCHEDULE_TIMEOUT || + adev->video_timeout ==MAX_SCHEDULE_TIMEOUT ))amdgpu_device_gpu_recover (adev,NULL ); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 162/399 drm/amdgpu: fix KIQ ring test fail in TDR of SRIOV
In reply to Greg Kroah-HartmanFrom: Monk Liu <[email protected]>
[ Upstream commit 5a7489a7e189ee2be889485f90c8cf24ea4b9a40 ]
issues:
MEC is ruined by the amdkfd_pre_reset after VF FLR done
fix:amdkfd_pre_reset() would ruin MEC after hypervisor finished the VF FLR, the correct sequence is do amdkfd_pre_reset before VF FLR but there is a limitation to block this sequence:
if we do pre_reset() before VF FLR, it would go KIQ way to do register access and stuck there, because KIQ probably won't work by that time (e.g. you already made GFX hang)
so the best way right now is to simply remove it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -3639,8 +3639,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,if (r)return r; -amdgpu_amdkfd_pre_reset (adev); -/* Resume IP prior to SMC */ r =amdgpu_device_ip_reinit_early_sriov (adev);if (r)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 163/399 clk: qcom: smd: Add missing bimc clock
In reply to Greg Kroah-HartmanFrom: Jeffrey Hugo <[email protected]>
[ Upstream commit 87ec9adcca71801a44ddb311185b17df09839ab5 ]
It turns out booting the modem is dependent on a bimc vote from Linux on msm8998. To make the modem happy, add the bimc clock to rely on the default vote from rpmcc. Once we have interconnect support, bimc should be controlled properly.
--- drivers/clk/qcom/clk-smd-rpm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/clk/qcom/clk-smd-rpm.c +3 -0
@@ -648,6 +648,7 @@ static const struct rpm_smd_clk_desc rpm_clk_qcs404 = { };/* msm8998 */ +DEFINE_CLK_SMD_RPM (msm8998, bimc_clk, bimc_a_clk,QCOM_SMD_RPM_MEM_CLK ,0 );DEFINE_CLK_SMD_RPM (msm8998, pcnoc_clk, pcnoc_a_clk,QCOM_SMD_RPM_BUS_CLK ,0 );DEFINE_CLK_SMD_RPM (msm8998, snoc_clk, snoc_a_clk,QCOM_SMD_RPM_BUS_CLK ,1 );DEFINE_CLK_SMD_RPM (msm8998, cnoc_clk, cnoc_a_clk,QCOM_SMD_RPM_BUS_CLK ,2 );
@@ -671,6 +672,8 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(msm8998, rf_clk2_pin, rf_clk2_a_pin, 5);DEFINE_CLK_SMD_RPM_XO_BUFFER (msm8998, rf_clk3, rf_clk3_a,6 );DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL (msm8998, rf_clk3_pin, rf_clk3_a_pin,6 );static struct clk_smd_rpm *msm8998_clks[] = { + [RPM_SMD_BIMC_CLK ] = &msm8998_bimc_clk, + [RPM_SMD_BIMC_A_CLK ] = &msm8998_bimc_a_clk, [RPM_SMD_PCNOC_CLK ] = &msm8998_pcnoc_clk, [RPM_SMD_PCNOC_A_CLK ] = &msm8998_pcnoc_a_clk, [RPM_SMD_SNOC_CLK ] = &msm8998_snoc_clk,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 164/399 ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1
In reply to Greg Kroah-HartmanFrom: Erik Kaneda <[email protected]>
[ Upstream commit 5ddbd77181dfca61b16d2e2222382ea65637f1b9 ]
ACPICA commit 29cc8dbc5463a93625bed87d7550a8bed8913bf4
create_buffer_field is a deferred op that is typically processed in load pass 2. However, disassembly of control method contents walk the parse tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed in a later walk. This is a problem when there is a control method that has the same name as the AML_CREATE object. In this case, any use of the name segment will be detected as a method call rather than a reference to a buffer field. If this is detected as a method call, it can result in a mal-formed parse tree if the control methods have parameters.
This change in processing AML_CREATE ops earlier solves this issue by inserting the named object in the ACPI namespace so that references to this name would be detected as a name string rather than a method call.
--- drivers/acpi/acpica/dsfield.c | 2 +- drivers/acpi/acpica/dswload.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
drivers/acpi/acpica/dsfield.c +1 -1
@@ -243,7 +243,7 @@ cleanup:* FUNCTION: acpi_ds_get_field_names * * PARAMETERS: info - create_field info structure -* ` walk_state - Current method state +* walk_state - Current method state * arg - First parser arg for the field name list * * RETURN: Status
drivers/acpi/acpica/dswload.c +21 -0
@@ -410,6 +410,27 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH ,"Op=%p State=%p\n" , op, walk_state)); +/* +* Disassembler: handle create field operators here. +* +* create_buffer_field is a deferred op that is typically processed in load +* pass 2. However, disassembly of control method contents walk the parse +* tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed +* in a later walk. This is a problem when there is a control method that +* has the same name as the AML_CREATE object. In this case, any use of the +* name segment will be detected as a method call rather than a reference +* to a buffer field. +* +* This earlier creation during disassembly solves this issue by inserting +* the named object in the ACPI namespace so that references to this name +* would be a name string rather than a method call. +*/ +if ((walk_state->parse_flags &ACPI_PARSE_DISASSEMBLE ) && + (walk_state->op_info->flags &AML_CREATE )) { + status =acpi_ds_create_buffer_field (op, walk_state); +return_ACPI_STATUS (status); + } +/* We are only interested in opcodes that have an associated name */ if (!(walk_state->op_info->flags & (AML_NAMED |AML_FIELD ))) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 165/399 nfsd: Clone should commit src file metadata too
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit 57f64034966fb945fc958f95f0c51e47af590344 ]
vfs_clone_file_range() can modify the metadata on the source file too, so we need to commit that to stable storage as well.
--- fs/nfsd/vfs.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
fs/nfsd/vfs.c +14 -5
@@ -280,19 +280,25 @@ out:* Commit metadata changes to stable storage. */ static int -commit_metadata (struct svc_fh *fhp) +commit_inode_metadata (struct inode *inode) { -struct inode *inode =d_inode (fhp->fh_dentry);const struct export_operations *export_ops = inode->i_sb->s_export_op; -if (!EX_ISSYNC (fhp->fh_export)) -return 0 ; -if (export_ops->commit_metadata)return export_ops->commit_metadata (inode);return sync_inode_metadata (inode,1 ); } +static int +commit_metadata (struct svc_fh *fhp) +{ +struct inode *inode =d_inode (fhp->fh_dentry); + +if (!EX_ISSYNC (fhp->fh_export)) +return 0 ; +return commit_inode_metadata (inode); +} +/* * Go over the attributes and take care of the small differences between * NFS semantics and what Linux expects.
@@ -537,6 +543,9 @@ __be32 nfsd4_clone_file_range(struct file *src, u64 src_pos, struct file *dst,if (sync) {loff_t dst_end = count ? dst_pos + count -1 :LLONG_MAX ;int status =vfs_fsync_range (dst, dst_pos, dst_end,0 ); + +if (!status) + status =commit_inode_metadata (file_inode (src));if (status <0 )return nfserrno (status); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 166/399 scsi: ufs: Complete pending requests in host reset and restore path
In reply to Greg Kroah-HartmanFrom: Can Guo <[email protected]>
[ Upstream commit 2df74b6985b51e77756e2e8faa16c45ca3ba53c5 ]
In UFS host reset and restore path, before probe, we stop and start the host controller once. After host controller is stopped, the pending requests, if any, are cleared from the doorbell, but no completion IRQ would be raised due to the hba is stopped. These pending requests shall be completed along with the first NOP_OUT command (as it is the first command which can raise a transfer completion IRQ) sent during probe. Since the OCSs of these pending requests are not SUCCESS (because they are not yet literally finished), their UPIUs shall be dumped. When there are multiple pending requests, the UPIU dump can be overwhelming and may lead to stability issues because it is in atomic context. Therefore, before probe, complete these pending requests right after host controller is stopped and silence the UPIU dump from them.
--- drivers/scsi/ufs/ufshcd.c | 24 ++++++++++-------------- drivers/scsi/ufs/ufshcd.h | 2 ++ 2 files changed, 12 insertions(+), 14 deletions(-)
drivers/scsi/ufs/ufshcd.c +10 -14
@@ -4799,7 +4799,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)break ; }/* end of switch */ -if (host_byte (result) !=DID_OK ) +if ((host_byte (result) !=DID_OK ) && !hba->silence_err_logs)ufshcd_print_trs (hba,1 << lrbp->task_tag, true);return result; }
@@ -5351,8 +5351,8 @@ static void ufshcd_err_handler(struct work_struct *work)/* * if host reset is required then skip clearing the pending -* transfers forcefully because they will automatically get -* cleared after link startup. +* transfers forcefully because they will get cleared during +* host reset and restore */ if (needs_reset) goto skip_pending_xfer_clear;
@@ -6282,9 +6282,15 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)int err;unsigned long flags; -/* Reset the host controller */ +/* +* Stop the host controller and complete the requests +* cleared by h/w +*/ spin_lock_irqsave (hba->host->host_lock, flags);ufshcd_hba_stop (hba, false); + hba->silence_err_logs = true; +ufshcd_complete_requests (hba); + hba->silence_err_logs = false;spin_unlock_irqrestore (hba->host->host_lock, flags);/* scale up clocks to max frequency before full reinitialization */
@@ -6318,7 +6324,6 @@ out:static int ufshcd_reset_and_restore (struct ufs_hba *hba) {int err =0 ; -unsigned long flags;int retries =MAX_HOST_RESET_RETRIES ; do {
@@ -6328,15 +6333,6 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba) err =ufshcd_host_reset_and_restore (hba); }while (err && --retries); -/* -* After reset the door-bell might be cleared, complete -* outstanding requests in s/w here. -*/ -spin_lock_irqsave (hba->host->host_lock, flags); -ufshcd_transfer_req_compl (hba); -ufshcd_tmc_handler (hba); -spin_unlock_irqrestore (hba->host->host_lock, flags); -return err; }
drivers/scsi/ufs/ufshcd.h +2 -0
@@ -513,6 +513,7 @@ struct ufs_stats {* @uic_error: UFS interconnect layer error status * @saved_err: sticky error mask * @saved_uic_err: sticky UIC error mask +* @silence_err_logs: flag to silence error logs * @dev_cmd: ufs device management command information * @last_dme_cmd_tstamp: time stamp of the last completed DME command * @auto_bkops_enabled: to track whether bkops is enabled in device
@@ -670,6 +671,7 @@ struct ufs_hba {u32 saved_err;u32 saved_uic_err;struct ufs_stats ufs_stats; +bool silence_err_logs;/* Device management request data */ struct ufs_dev_cmd dev_cmd;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 167/399 scsi: aic7xxx: Adjust indentation in ahc_find_syncrate
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 4dbc96ad65c45cdd4e895ed7ae4c151b780790c5 ]
Clang warns:
../drivers/scsi/aic7xxx/aic7xxx_core.c:2317:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if ((syncrate->sxfr_u2 & ST_SXFR) != 0)
^
../drivers/scsi/aic7xxx/aic7xxx_core.c:2310:4: note: previous statement
is here
if (syncrate == &ahc_syncrates[maxsync])
^1 warning generated.
This warning occurs because there is a space amongst the tabs on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.
This has been a problem since the beginning of git history hence no fixes tag.
--- drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +1 -1
@@ -2314,7 +2314,7 @@ ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,* At some speeds, we only support * ST transfers. */ -if ((syncrate->sxfr_u2 &ST_SXFR ) !=0 ) +if ((syncrate->sxfr_u2 &ST_SXFR ) !=0 ) *ppr_options &= ~MSG_EXT_PPR_DT_REQ ;break ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 168/399 crypto: inside-secure - add unspecified HAS_IOMEM dependency
In reply to Greg Kroah-HartmanFrom: Brendan Higgins <[email protected]>
[ Upstream commit 6dc0e310623fdcb27a1486eb436f0118c45e95a5 ]
Currently CONFIG_CRYPTO_DEV_SAFEXCEL=y implicitly depends on CONFIG_HAS_IOMEM=y; consequently, on architectures without IOMEM we get the following build error:
ld: drivers/crypto/inside-secure/safexcel.o: in function `safexcel_probe':drivers/crypto/inside-secure/safexcel.c:1692: undefined reference to `devm_platform_ioremap_resource'
Fix the build error by adding the unspecified dependency.
--- drivers/crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/Kconfig +1 -1
@@ -716,7 +716,7 @@ source "drivers/crypto/stm32/Kconfig" config CRYPTO_DEV_SAFEXCEL tristate "Inside Secure's SafeXcel cryptographic engine driver" - depends on OF || PCI || COMPILE_TEST + depends on (OF || PCI || COMPILE_TEST) && HAS_IOMEM select CRYPTO_LIB_AES select CRYPTO_AUTHENC select CRYPTO_SKCIPHER
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 169/399 crypto: amlogic - add unspecified HAS_IOMEM dependency
In reply to Greg Kroah-HartmanFrom: Brendan Higgins <[email protected]>
[ Upstream commit 7d07de2c18abd95f72efb28f78a4825e0fc1aa6a ]
Currently CONFIG_CRYPTO_DEV_AMLOGIC_GXL=y implicitly depends on CONFIG_HAS_IOMEM=y; consequently, on architectures without IOMEM we get the following build error:
ld: drivers/crypto/amlogic/amlogic-gxl-core.o: in function `meson_crypto_probe':drivers/crypto/amlogic/amlogic-gxl-core.c:240: undefined reference to `devm_platform_ioremap_resource'
Fix the build error by adding the unspecified dependency.
--- drivers/crypto/amlogic/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/amlogic/Kconfig +1 -0
@@ -1,5 +1,6 @@ config CRYPTO_DEV_AMLOGIC_GXL tristate "Support for amlogic cryptographic offloader" + depends on HAS_IOMEM default y if ARCH_MESON select CRYPTO_SKCIPHER select CRYPTO_ENGINE
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 170/399 drm/mediatek: handle events when enabling/disabling crtc
In reply to Greg Kroah-HartmanFrom: Bibby Hsieh <[email protected]>
[ Upstream commit 411f5c1eacfebb1f6e40b653d29447cdfe7282aa ]
The driver currently handles vblank events only when updating planes on an already enabled CRTC. The atomic update API however allows requesting an event when enabling or disabling a CRTC. This currently leads to event objects being leaked in the kernel and to events not being sent out. Fix it.
--- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +8 -0
@@ -328,6 +328,7 @@ err_pm_runtime_put:static void mtk_crtc_ddp_hw_fini (struct mtk_drm_crtc *mtk_crtc) {struct drm_device *drm = mtk_crtc->base.dev; +struct drm_crtc *crtc = &mtk_crtc->base;int i;DRM_DEBUG_DRIVER ("%s\n" , __func__);
@@ -353,6 +354,13 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)mtk_disp_mutex_unprepare (mtk_crtc->mutex);pm_runtime_put (drm->dev); + +if (crtc->state->event && !crtc->state->active) { +spin_lock_irq (&crtc->dev->event_lock); +drm_crtc_send_vblank_event (crtc, crtc->state->event); + crtc->state->event =NULL ; +spin_unlock_irq (&crtc->dev->event_lock); + } }static void mtk_crtc_ddp_config (struct drm_crtc *crtc)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 171/399 clk: renesas: rcar-gen3: Allow changing the RPC[D2] clocks
In reply to Greg Kroah-HartmanFrom: Sergei Shtylyov <[email protected]>
[ Upstream commit 0d67c0340a60829c5c1b7d09629d23bbd67696f3 ]
I was unable to get clk_set_rate() setting a lower RPC-IF clock frequency and that issue boiled down to me not passing CLK_SET_RATE_PARENT flag to clk_register_composite() when registering the RPC[D2] clocks...
--- drivers/clk/renesas/rcar-gen3-cpg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clk/renesas/rcar-gen3-cpg.c +4 -2
@@ -470,7 +470,8 @@ static struct clk * __init cpg_rpc_clk_register(const char *name, clk =clk_register_composite (NULL , name, &parent_name,1 ,NULL ,NULL , &rpc->div.hw, &clk_divider_ops, - &rpc->gate.hw, &clk_gate_ops,0 ); + &rpc->gate.hw, &clk_gate_ops, +CLK_SET_RATE_PARENT );if (IS_ERR (clk)) {kfree (rpc);return clk;
@@ -506,7 +507,8 @@ static struct clk * __init cpg_rpcd2_clk_register(const char *name, clk =clk_register_composite (NULL , name, &parent_name,1 ,NULL ,NULL , &rpcd2->fixed.hw, &clk_fixed_factor_ops, - &rpcd2->gate.hw, &clk_gate_ops,0 ); + &rpcd2->gate.hw, &clk_gate_ops, +CLK_SET_RATE_PARENT );if (IS_ERR (clk))kfree (rpcd2);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 172/399 ARM: dts: r8a7779: Add device node for ARM global timer
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 8443ffd1bbd5be74e9b12db234746d12e8ea93e2 ]
Add a device node for the global timer, which is part of the Cortex-A9 MPCore.
The global timer can serve as an accurate (4 ns) clock source for scheduling and delay loops.
--- arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/r8a7779.dtsi +8 -0
@@ -68,6 +68,14 @@ <0xf0000100 0x100>; }; + timer@f0000200 { + compatible = "arm,cortex-a9-global-timer"; + reg = <0xf0000200 0x100>; + interrupts = <GIC_PPI 11 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; + clocks = <&cpg_clocks R8A7779_CLK_ZS>; + }; + timer@f0000600 { compatible = "arm,cortex-a9-twd-timer"; reg = <0xf0000600 0x20>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 173/399 remoteproc: q6v5-mss: Remove mem clk from the active pool
In reply to Greg Kroah-HartmanFrom: Sibi Sankar <[email protected]>
[ Upstream commit 6ba519aa13758dd55248f3a6f939536656df2661 ]
Currently the mem clk is voted upon from both the active and proxy pool on MSM8998 SoCs where only a proxy vote should suffice. Fix this by removing mem clk from the active pool.
--- drivers/remoteproc/qcom_q6v5_mss.c | 1 - 1 file changed, 1 deletion(-)
drivers/remoteproc/qcom_q6v5_mss.c +0 -1
@@ -1594,7 +1594,6 @@ static const struct rproc_hexagon_res msm8998_mss = { .active_clk_names = (char*[]){"iface" ,"bus" , -"mem" ,"gpll0_mss" ,"mnoc_axi" ,"snoc_axi" ,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 174/399 selinux: ensure we cleanup the internal AVC counters on error in avc_update()
In reply to Greg Kroah-HartmanFrom: Jaihind Yadav <[email protected]>
[ Upstream commit 030b995ad9ece9fa2d218af4429c1c78c2342096 ]
In AVC update we don't call avc_node_kill() when avc_xperms_populate() fails, resulting in the avc->avc_cache.active_nodes counter having a false value. In last patch this changes was missed , so correcting it.
--- security/selinux/avc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/avc.c +1 -1
@@ -891,7 +891,7 @@ static int avc_update_node(struct selinux_avc *avc,if (orig->ae.xp_node) { rc =avc_xperms_populate (node, orig->ae.xp_node);if (rc) { -kmem_cache_free (avc_node_cachep, node); +avc_node_kill (avc, node); goto out_unlock; } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 175/399 scsi: lpfc: Fix: Rework setting of fdmi symbolic node name registration
In reply to Greg Kroah-HartmanFrom: James Smart <[email protected]>
[ Upstream commit df9166bfa7750bade5737ffc91fbd432e0354442 ]
This patch reworks the fdmi symbolic node name data for the following two issues:
- Correcting extraneous periods following the DV and HN fdmi data fields.
- Avoiding buffer overflow issues when formatting the data.
The fix to the fist issue is to just remove the characters.
The fix to the second issue has all data being staged in temporary storage before being moved to the real buffer.
--- drivers/scsi/lpfc/lpfc_ct.c | 42 +++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-)
drivers/scsi/lpfc/lpfc_ct.c +22 -20
@@ -1493,33 +1493,35 @@ int lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, size_t size) { - char fwrev[FW_REV_STR_SIZE]; -int n; + char fwrev[FW_REV_STR_SIZE] = {0}; +char tmp[MAXHOSTNAMELEN ] = {0 }; -lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); +memset (symbol,0 , size); - n =scnprintf (symbol, size,"Emulex %s" , vport->phba->ModelName); -if (size < n) -return n; +scnprintf (tmp,sizeof (tmp),"Emulex %s" , vport->phba->ModelName); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done; - n +=scnprintf (symbol + n, size - n," FV%s" , fwrev); -if (size < n) -return n; +lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); +scnprintf (tmp,sizeof (tmp)," FV%s" , fwrev); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done; - n +=scnprintf (symbol + n, size - n," DV%s." , - lpfc_release_version); -if (size < n) -return n; +scnprintf (tmp,sizeof (tmp)," DV%s" , lpfc_release_version); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done; - n +=scnprintf (symbol + n, size - n," HN:%s." , -init_utsname ()->nodename); -if (size < n) -return n; +scnprintf (tmp,sizeof (tmp)," HN:%s" ,init_utsname ()->nodename); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done;/* Note :- OS name is "Linux" */ - n +=scnprintf (symbol + n, size - n," OS:%s" , -init_utsname ()->sysname); -return n; +scnprintf (tmp,sizeof (tmp)," OS:%s" ,init_utsname ()->sysname); +strlcat (symbol, tmp, size); + +buffer_done: +return strnlen (symbol, size); + } static uint32_t
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 176/399 arm64: dts: qcom: db845c: Enable ath10k 8bit host-cap quirk
In reply to Greg Kroah-HartmanFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 2e198c395a084ff3015d71896e35de049c40e3a4 ]
The WiFi firmware used on db845c implements the 8bit host-capability message, so enable the quirk for this.
--- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +2 -0
@@ -529,6 +529,8 @@ vdd-1.8-xo-supply = <&vreg_l7a_1p8>; vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; + + qcom,snoc-host-cap-8bit-quirk; }; /* PINCTRL - additions to nodes defined in sdm845.dtsi */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 177/399 PCI/ATS: Restore EXPORT_SYMBOL_GPL() for pci_{enable,disable}_ats()
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit bb950bca5d522119f8b9ce3f6cbac4841c6d6517 ]
Commit d355bb209783 ("PCI/ATS: Remove unnecessary EXPORT_SYMBOL_GPL()") unexported a bunch of symbols from the PCI core since the only external users were non-modular IOMMU drivers. Although most of those symbols can remain private for now, 'pci_{enable,disable_ats()' is required for the ARM SMMUv3 driver to build as a module, otherwise we get a build failure as follows:
| ERROR: "pci_enable_ats" [drivers/iommu/arm-smmu-v3.ko] undefined! | ERROR: "pci_disable_ats" [drivers/iommu/arm-smmu-v3.ko] undefined!
Re-export these two functions so that the ARM SMMUv3 driver can be build as a module.
--- drivers/pci/ats.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/ats.c +2 -0
@@ -69,6 +69,7 @@ int pci_enable_ats(struct pci_dev *dev, int ps) dev->ats_enabled =1 ;return 0 ; } +EXPORT_SYMBOL_GPL (pci_enable_ats);/** * pci_disable_ats - disable the ATS capability
@@ -87,6 +88,7 @@ void pci_disable_ats(struct pci_dev *dev) dev->ats_enabled =0 ; } +EXPORT_SYMBOL_GPL (pci_disable_ats);void pci_restore_ats_state (struct pci_dev *dev) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 178/399 iommu/amd: Check feature support bit before accessing MSI capability registers
In reply to Greg Kroah-HartmanFrom: Suravee Suthikulpanit <[email protected]>
[ Upstream commit 813071438e83d338ba5cfe98b3b26c890dc0a6c0 ]
The IOMMU MMIO access to MSI capability registers is available only if the EFR[MsiCapMmioSup] is set. Current implementation assumes this bit is set if the EFR[XtSup] is set, which might not be the case.
Fix by checking the EFR[MsiCapMmioSup] before accessing the MSI address low/high and MSI data registers via the MMIO.
--- drivers/iommu/amd_iommu_init.c | 17 ++++++++++++----- drivers/iommu/amd_iommu_types.h | 1 + 2 files changed, 13 insertions(+), 5 deletions(-)
drivers/iommu/amd_iommu_init.c +12 -5
@@ -147,7 +147,7 @@ bool amd_iommu_dump;bool amd_iommu_irq_remap__read_mostly ;int amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_VAPIC ; -static int amd_iommu_xt_mode =IRQ_REMAP_X2APIC_MODE ; +static int amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ;static bool amd_iommu_detected;static bool __initdata amd_iommu_disabled;
@@ -1534,8 +1534,15 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) iommu->mmio_phys_end =MMIO_CNTR_CONF_OFFSET ;if (((h->efr_reg & (0x1 <<IOMMU_EFR_GASUP_SHIFT )) ==0 )) amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_LEGACY ; -if (((h->efr_reg & (0x1 <<IOMMU_EFR_XTSUP_SHIFT )) ==0 )) - amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ; +/* +* Note: Since iommu_update_intcapxt() leverages +* the IOMMU MMIO access to MSI capability block registers +* for MSI address lo/hi/data, we need to check both +* EFR[XtSup] and EFR[MsiCapMmioSup] for x2APIC support. +*/ +if ((h->efr_reg &BIT (IOMMU_EFR_XTSUP_SHIFT )) && + (h->efr_reg &BIT (IOMMU_EFR_MSICAPMMIOSUP_SHIFT ))) + amd_iommu_xt_mode =IRQ_REMAP_X2APIC_MODE ;break ;default :return -EINVAL ;
@@ -1996,8 +2003,8 @@ static int iommu_init_intcapxt(struct amd_iommu *iommu)struct irq_affinity_notify *notify = &iommu->intcapxt_notify;/** -* IntCapXT requires XTSup=1, which can be inferred -* amd_iommu_xt_mode. +* IntCapXT requires XTSup=1 and MsiCapMmioSup=1, +* which can be inferred from amd_iommu_xt_mode. */ if (amd_iommu_xt_mode !=IRQ_REMAP_X2APIC_MODE )return 0 ;
drivers/iommu/amd_iommu_types.h +1 -0
@@ -383,6 +383,7 @@/* IOMMU Extended Feature Register (EFR) */ #define IOMMU_EFR_XTSUP_SHIFT 2#define IOMMU_EFR_GASUP_SHIFT 7 +#define IOMMU_EFR_MSICAPMMIOSUP_SHIFT 46#define MAX_DOMAIN_ID 65536
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 179/399 iommu/amd: Only support x2APIC with IVHD type 11h/40h
In reply to Greg Kroah-HartmanFrom: Suravee Suthikulpanit <[email protected]>
[ Upstream commit 966b753cf3969553ca50bacd2b8c4ddade5ecc9e ]
Current implementation for IOMMU x2APIC support makes use of the MMIO access to MSI capability block registers, which requires checking EFR[MsiCapMmioSup]. However, only IVHD type 11h/40h contain the information, and not in the IVHD type 10h IOMMU feature reporting field. Since the BIOS in newer systems, which supports x2APIC, would normally contain IVHD type 11h/40h, remove the IOMMU_FEAT_XTSUP_SHIFT check for IVHD type 10h, and only support x2APIC with IVHD type 11h/40h.
--- drivers/iommu/amd_iommu_init.c | 2 -- drivers/iommu/amd_iommu_types.h | 1 - 2 files changed, 3 deletions(-)
drivers/iommu/amd_iommu_init.c +0 -2
@@ -1523,8 +1523,6 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) iommu->mmio_phys_end =MMIO_CNTR_CONF_OFFSET ;if (((h->efr_attr & (0x1 <<IOMMU_FEAT_GASUP_SHIFT )) ==0 )) amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_LEGACY ; -if (((h->efr_attr & (0x1 <<IOMMU_FEAT_XTSUP_SHIFT )) ==0 )) - amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ;break ;case 0x11 :case 0x40 :
drivers/iommu/amd_iommu_types.h +0 -1
@@ -377,7 +377,6 @@#define IOMMU_CAP_EFR 27/* IOMMU Feature Reporting Field (for IVHD type 10h */ -#define IOMMU_FEAT_XTSUP_SHIFT 0#define IOMMU_FEAT_GASUP_SHIFT 6/* IOMMU Extended Feature Register (EFR) */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 180/399 iommu/iova: Silence warnings under memory pressure
In reply to Greg Kroah-HartmanFrom: Qian Cai <[email protected]>
[ Upstream commit 944c9175397476199d4dd1028d87ddc582c35ee8 ]
When running heavy memory pressure workloads, this 5+ old system is throwing endless warnings below because disk IO is too slow to recover from swapping. Since the volume from alloc_iova_fast() could be large, once it calls printk(), it will trigger disk IO (writing to the log files) and pending softirqs which could cause an infinite loop and make no progress for days by the ongoimng memory reclaim. This is the counter part for Intel where the AMD part has already been merged. See the commit 3d708895325b ("iommu/amd: Silence warnings under memory pressure"). Since the allocation failure will be reported in intel_alloc_iova(), so just call dev_err_once() there because even the "ratelimited" is too much, and silence the one in alloc_iova_mem() to avoid the expensive warn_alloc().
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
slab_out_of_memory: 66 callbacks suppressed
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: iommu_iova, object size: 40, buffer size: 448, default order:
0, min order: 0
node 0: slabs: 1822, objs: 16398, free: 0
node 1: slabs: 2051, objs: 18459, free: 31
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: iommu_iova, object size: 40, buffer size: 448, default order:
0, min order: 0
node 0: slabs: 1822, objs: 16398, free: 0
node 1: slabs: 2051, objs: 18459, free: 31
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: iommu_iova, object size: 40, buffer size: 448, default order:
0, min order: 0
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
node 0: slabs: 697, objs: 4182, free: 0
node 0: slabs: 697, objs: 4182, free: 0
node 0: slabs: 697, objs: 4182, free: 0
node 0: slabs: 697, objs: 4182, free: 0
node 1: slabs: 381, objs: 2286, free: 27
node 1: slabs: 381, objs: 2286, free: 27
node 1: slabs: 381, objs: 2286, free: 27
node 1: slabs: 381, objs: 2286, free: 27
node 0: slabs: 1822, objs: 16398, free: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
node 1: slabs: 2051, objs: 18459, free: 31
node 0: slabs: 697, objs: 4182, free: 0
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
node 1: slabs: 381, objs: 2286, free: 27
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
node 0: slabs: 697, objs: 4182, free: 0
node 1: slabs: 381, objs: 2286, free: 27
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
warn_alloc: 96 callbacks suppressed
kworker/11:1H: page allocation failure: order:0,
mode:0xa20(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0-1
CPU: 11 PID: 1642 Comm: kworker/11:1H Tainted: G B Hardware name: HP ProLiant XL420 Gen9/ProLiant XL420 Gen9, BIOS U19 12/27/2015 Workqueue: kblockd blk_mq_run_work_fn Call Trace: dump_stack+0xa0/0xea warn_alloc.cold.94+0x8a/0x12d __alloc_pages_slowpath+0x1750/0x1870 __alloc_pages_nodemask+0x58a/0x710 alloc_pages_current+0x9c/0x110 alloc_slab_page+0xc9/0x760 allocate_slab+0x48f/0x5d0 new_slab+0x46/0x70 ___slab_alloc+0x4ab/0x7b0 __slab_alloc+0x43/0x70 kmem_cache_alloc+0x2dd/0x450 SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) alloc_iova+0x33/0x210 cache: skbuff_head_cache, object size: 208, buffer size: 640, default order: 0, min order: 0 node 0: slabs: 697, objs: 4182, free: 0 alloc_iova_fast+0x62/0x3d1 node 1: slabs: 381, objs: 2286, free: 27 intel_alloc_iova+0xce/0xe0 intel_map_sg+0xed/0x410 scsi_dma_map+0xd7/0x160 scsi_queue_rq+0xbf7/0x1310 blk_mq_dispatch_rq_list+0x4d9/0xbc0 blk_mq_sched_dispatch_requests+0x24a/0x300 __blk_mq_run_hw_queue+0x156/0x230 blk_mq_run_work_fn+0x3b/0x40 process_one_work+0x579/0xb90 worker_thread+0x63/0x5b0 kthread+0x1e6/0x210 ret_from_fork+0x3a/0x50 Mem-Info: active_anon:2422723 inactive_anon:361971 isolated_anon:34403 active_file:2285 inactive_file:1838 isolated_file:0 unevictable:0 dirty:1 writeback:5 unstable:0 slab_reclaimable:13972 slab_unreclaimable:453879 mapped:2380 shmem:154 pagetables:6948 bounce:0 free:19133 free_pcp:7363 free_cma:0
--- drivers/iommu/intel-iommu.c | 3 ++- drivers/iommu/iova.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/iommu/intel-iommu.c +2 -1
@@ -3406,7 +3406,8 @@ static unsigned long intel_alloc_iova(struct device *dev, iova_pfn =alloc_iova_fast (&domain->iovad, nrpages,IOVA_PFN (dma_mask), true);if (unlikely (!iova_pfn)) { -dev_err (dev,"Allocating %ld-page iova failed" , nrpages); +dev_err_once (dev,"Allocating %ld-page iova failed\n" , + nrpages);return 0 ; }
drivers/iommu/iova.c +1 -1
@@ -233,7 +233,7 @@ static DEFINE_MUTEX(iova_cache_mutex);struct iova *alloc_iova_mem (void ) { -return kmem_cache_zalloc (iova_cache,GFP_ATOMIC ); +return kmem_cache_zalloc (iova_cache,GFP_ATOMIC | __GFP_NOWARN); }EXPORT_SYMBOL (alloc_iova_mem);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 181/399 clk: qcom: Add missing msm8998 gcc_bimc_gfx_clk
In reply to Greg Kroah-HartmanFrom: Jeffrey Hugo <[email protected]>
[ Upstream commit db2c7c0a04b11753f5741d00b784b5380ddeee72 ]
gcc_bimc_gfx_clk is a required clock for booting the GPU and GPU SMMU.
--- drivers/clk/qcom/gcc-msm8998.c | 14 ++++++++++++++ include/dt-bindings/clock/qcom,gcc-msm8998.h | 1 + 2 files changed, 15 insertions(+)
drivers/clk/qcom/gcc-msm8998.c +14 -0
@@ -1996,6 +1996,19 @@ static struct clk_branch gcc_gp3_clk = { }, }; +static struct clk_branch gcc_bimc_gfx_clk = { + .halt_reg =0x46040 , + .halt_check =BRANCH_HALT , + .clkr = { + .enable_reg =0x46040 , + .enable_mask =BIT (0 ), + .hw.init = &(struct clk_init_data ){ + .name ="gcc_bimc_gfx_clk" , + .ops = &clk_branch2_ops, + }, + }, +}; +static struct clk_branch gcc_gpu_bimc_gfx_clk = { .halt_reg =0x71010 , .halt_check =BRANCH_HALT ,
@@ -2810,6 +2823,7 @@ static struct clk_regmap *gcc_msm8998_clocks[] = { [GCC_GP1_CLK] = &gcc_gp1_clk.clkr, [GCC_GP2_CLK] = &gcc_gp2_clk.clkr, [GCC_GP3_CLK] = &gcc_gp3_clk.clkr, + [GCC_BIMC_GFX_CLK] = &gcc_bimc_gfx_clk.clkr, [GCC_GPU_BIMC_GFX_CLK] = &gcc_gpu_bimc_gfx_clk.clkr, [GCC_GPU_BIMC_GFX_SRC_CLK] = &gcc_gpu_bimc_gfx_src_clk.clkr, [GCC_GPU_CFG_AHB_CLK] = &gcc_gpu_cfg_ahb_clk.clkr,
include/dt-bindings/clock/qcom,gcc-msm8998.h +1 -0
@@ -182,6 +182,7 @@#define GCC_MSS_GPLL0_DIV_CLK_SRC 173#define GCC_MSS_SNOC_AXI_CLK 174#define GCC_MSS_MNOC_BIMC_AXI_CLK 175 +#define GCC_BIMC_GFX_CLK 176#define PCIE_0_GDSC 0#define UFS_GDSC 1
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 182/399 clk: actually call the clock init before any other callback of the clock
In reply to Greg Kroah-HartmanFrom: Jerome Brunet <[email protected]>
[ Upstream commit f6fa75ca912be6021335de63a32aa4d295f3c524 ]
__clk_init_parent() will call the .get_parent() callback of the clock so .init() must run before.
--- drivers/clk/clk.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/clk/clk.c +15 -11
@@ -3338,6 +3338,21 @@ static int __clk_core_init(struct clk_core *core) goto out; } +/* +* optional platform-specific magic +* +* The .init callback is not used by any of the basic clock types, but +* exists for weird hardware that must perform initialization magic. +* Please consider other ways of solving initialization problems before +* using this callback, as its use is discouraged. +* +* If it exist, this callback should called before any other callback of +* the clock +*/ +if (core->ops->init) + core->ops->init (core->hw); + + core->parent =__clk_init_parent (core);/*
@@ -3362,17 +3377,6 @@ static int __clk_core_init(struct clk_core *core) core->orphan = true; } -/* -* optional platform-specific magic -* -* The .init callback is not used by any of the basic clock types, but -* exists for weird hardware that must perform initialization magic. -* Please consider other ways of solving initialization problems before -* using this callback, as its use is discouraged. -*/ -if (core->ops->init) - core->ops->init (core->hw); -/* * Set clk's accuracy. The preferred method is to use * .recalc_accuracy. For simple clocks and lazy developers the default
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 183/399 dmaengine: Store module owner in dma_device struct
In reply to Greg Kroah-HartmanFrom: Logan Gunthorpe <[email protected]>
[ Upstream commit dae7a589c18a4d979d5f14b09374e871b995ceb1 ]
dma_chan_to_owner() dereferences the driver from the struct device to obtain the owner and call module_[get|put](). However, if the backing device is unbound before the dma_device is unregistered, the driver will be cleared and this will cause a NULL pointer dereference.
Instead, store a pointer to the owner module in the dma_device struct so the module reference can be properly put when the channel is put, even if the backing device was destroyed first.
This change helps to support a safer unbind of DMA engines. If the dma_device is unregistered in the driver's remove function, there's no guarantee that there are no existing clients and a users action may trigger the WARN_ONCE in dma_async_device_unregister() which is unlikely to leave the system in a consistent state. Instead, a better approach is to allow the backing driver to go away and fail any subsequent requests to it.
--- drivers/dma/dmaengine.c | 4 +++- include/linux/dmaengine.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/dma/dmaengine.c +3 -1
@@ -179,7 +179,7 @@ __dma_device_satisfies_mask(struct dma_device *device,static struct module *dma_chan_to_owner (struct dma_chan *chan) { -return chan->device->dev->driver->owner; +return chan->device->owner; }/**
@@ -919,6 +919,8 @@ int dma_async_device_register(struct dma_device *device)return -EIO ; } + device->owner = device->dev->driver->owner; +if (dma_has_cap (DMA_MEMCPY , device->cap_mask) && !device->device_prep_dma_memcpy) { dev_err(device->dev, "Device claims capability %s, but op is not defined\n",
include/linux/dmaengine.h +2 -0
@@ -674,6 +674,7 @@ struct dma_filter {* @fill_align: alignment shift for memset operations * @dev_id: unique device ID * @dev: struct device reference for dma mapping api +* @owner: owner module (automatically set based on the provided dev) * @src_addr_widths: bit mask of src addr widths the device supports * Width is specified in bytes, e.g. for a device supporting * a width of 4 the mask should have BIT(4) set.
@@ -737,6 +738,7 @@ struct dma_device {int dev_id;struct device *dev; +struct module *owner;u32 src_addr_widths;u32 dst_addr_widths;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 184/399 clk: bm1800: Remove set but not used variable fref
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit 59ef4da4e4084d323dd4c3aa4b2fc64ce9e25625 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/clk/clk-bm1880.c: In function 'bm1880_pll_rate_calc':drivers/clk/clk-bm1880.c:477:13: warning:
variable 'fref' set but not used [-Wunused-but-set-variable]
It is never used, so remove it.
--- drivers/clk/clk-bm1880.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/clk/clk-bm1880.c +1 -2
@@ -474,11 +474,10 @@ static struct bm1880_composite_clock bm1880_composite_clks[] = {static unsigned long bm1880_pll_rate_calc (u32 regval,unsigned long parent_rate) {u64 numerator; -u32 fbdiv, fref, refdiv; +u32 fbdiv, refdiv;u32 postdiv1, postdiv2, denominator; fbdiv = (regval >>16 ) &0xfff ; - fref = parent_rate; refdiv = regval &0x1f ; postdiv1 = (regval >>8 ) &0x7 ; postdiv2 = (regval >>12 ) &0x7 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 185/399 dmaengine: imx-sdma: Fix memory leak
In reply to Greg Kroah-HartmanFrom: Sascha Hauer <[email protected]>
[ Upstream commit 02939cd167095f16328a1bd5cab5a90b550606df ]
The current descriptor is not on any list of the virtual DMA channel. Once sdma_terminate_all() is called when a descriptor is currently in flight then this one is forgotten to be freed. We have to call vchan_terminate_vdesc() on this descriptor to re-add it to the lists. Now that we also free the currently running descriptor we can (and actually have to) remove the current descriptor from its list also for the cyclic case.
--- drivers/dma/imx-sdma.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/dma/imx-sdma.c +11 -8
@@ -760,12 +760,8 @@ static void sdma_start_desc(struct sdma_channel *sdmac)return ; } sdmac->desc = desc =to_sdma_desc (&vd->tx); -/* -* Do not delete the node in desc_issued list in cyclic mode, otherwise -* the desc allocated will never be freed in vchan_dma_desc_free_list -*/ -if (!(sdmac->flags &IMX_DMA_SG_LOOP )) -list_del (&vd->node); + +list_del (&vd->node); sdma->channel_control[channel].base_bd_ptr = desc->bd_phys; sdma->channel_control[channel].current_bd_ptr = desc->bd_phys;
@@ -1071,7 +1067,6 @@ static void sdma_channel_terminate_work(struct work_struct *work)spin_lock_irqsave (&sdmac->vc.lock, flags);vchan_get_all_descriptors (&sdmac->vc, &head); - sdmac->desc =NULL ;spin_unlock_irqrestore (&sdmac->vc.lock, flags);vchan_dma_desc_free_list (&sdmac->vc, &head); sdmac->context_loaded = false;
@@ -1080,11 +1075,19 @@ static void sdma_channel_terminate_work(struct work_struct *work)static int sdma_disable_channel_async (struct dma_chan *chan) {struct sdma_channel *sdmac =to_sdma_chan (chan); +unsigned long flags; + +spin_lock_irqsave (&sdmac->vc.lock, flags);sdma_disable_channel (chan); -if (sdmac->desc) +if (sdmac->desc) { +vchan_terminate_vdesc (&sdmac->desc->vd); + sdmac->desc =NULL ;schedule_work (&sdmac->terminate_worker); + } + +spin_unlock_irqrestore (&sdmac->vc.lock, flags);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 186/399 bpf: Print error message for bpftool cgroup show
In reply to Greg Kroah-HartmanFrom: Hechao Li <[email protected]>
[ Upstream commit 1162f844030ac1ac7321b5e8f6c9badc7a11428f ]
Currently, when bpftool cgroup show <path> has an error, no error message is printed. This is confusing because the user may think the result is empty.
Before the change:
$ bpftool cgroup show /sys/fs/cgroup ID AttachType AttachFlags Name $ echo $? 255
After the change:
$ ./bpftool cgroup show /sys/fs/cgroup Error: can't query bpf programs attached to /sys/fs/cgroup: Operation not permitted
v2: Rename check_query_cgroup_progs to cgroup_has_attached_progs
--- tools/bpf/bpftool/cgroup.c | 56 ++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 17 deletions(-)
tools/bpf/bpftool/cgroup.c +39 -17
@@ -117,6 +117,25 @@ static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)return prog_cnt; } +static int cgroup_has_attached_progs (int cgroup_fd) +{ +enum bpf_attach_type type; +bool no_prog = true; + +for (type =0 ; type < __MAX_BPF_ATTACH_TYPE; type++) { +int count =count_attached_bpf_progs (cgroup_fd, type); + +if (count <0 && errno !=EINVAL ) +return -1 ; + +if (count >0 ) { + no_prog = false; +break ; + } + } + +return no_prog ?0 :1 ; +}static int show_attached_bpf_progs (int cgroup_fd,enum bpf_attach_type type,int level) {
@@ -161,6 +180,7 @@ static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type,static int do_show (int argc,char **argv) {enum bpf_attach_type type; +int has_attached_progs;const char *path;int cgroup_fd;int ret =-1 ;
@@ -192,6 +212,16 @@ static int do_show(int argc, char **argv) goto exit; } + has_attached_progs =cgroup_has_attached_progs (cgroup_fd); +if (has_attached_progs <0 ) { +p_err ("can't query bpf programs attached to %s: %s" , + path,strerror (errno)); + goto exit_cgroup; + }else if (!has_attached_progs) { + ret =0 ; + goto exit_cgroup; + } +if (json_output)jsonw_start_array (json_wtr);else
@@ -212,6 +242,7 @@ static int do_show(int argc, char **argv)if (json_output)jsonw_end_array (json_wtr); +exit_cgroup:close (cgroup_fd); exit:return ret;
@@ -228,7 +259,7 @@ static int do_show_tree_fn(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftw) { enum bpf_attach_type type; -bool skip = true; +int has_attached_progs;int cgroup_fd;if (typeflag !=FTW_D )
@@ -240,22 +271,13 @@ static int do_show_tree_fn(const char *fpath, const struct stat *sb,return SHOW_TREE_FN_ERR ; } -for (type =0 ; type < __MAX_BPF_ATTACH_TYPE; type++) { -int count =count_attached_bpf_progs (cgroup_fd, type); - -if (count <0 && errno !=EINVAL ) { -p_err ("can't query bpf programs attached to %s: %s" , - fpath,strerror (errno)); -close (cgroup_fd); -return SHOW_TREE_FN_ERR ; - } -if (count >0 ) { - skip = false; -break ; - } - } - -if (skip) { + has_attached_progs =cgroup_has_attached_progs (cgroup_fd); +if (has_attached_progs <0 ) { +p_err ("can't query bpf programs attached to %s: %s" , + fpath,strerror (errno)); +close (cgroup_fd); +return SHOW_TREE_FN_ERR ; + }else if (!has_attached_progs) {close (cgroup_fd);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 187/399 net: phy: realtek: add logging for the RGMII TX delay configuration
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 3aec743d69822d22d4a5b60deb9518ed8be6fa67 ]
RGMII requires a delay of 2ns between the data and the clock signal. There are at least three ways this can happen. One possibility is by having the PHY generate this delay.
This is a common source for problems (for example with slow TX speeds or packet loss when sending data). The TX delay configuration of the RTL8211F PHY can be set either by pin-strappping the RXD1 pin (HIGH means enabled, LOW means disabled) or through configuring a paged register. The setting from the RXD1 pin is also reflected in the register.
Add debug logging to the TX delay configuration on RTL8211F so it's easier to spot these issues (for example if the TX delay is enabled for both, the RTL8211F PHY and the MAC).
This is especially helpful because there is no public datasheet for the RTL8211F PHY available with all the RX/TX delay specifics.
--- drivers/net/phy/realtek.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/net/phy/realtek.c +18 -1
@@ -171,7 +171,9 @@ static int rtl8211c_config_init(struct phy_device *phydev)static int rtl8211f_config_init (struct phy_device *phydev) { +struct device *dev = &phydev->mdio.dev;u16 val; +int ret;/* enable TX-delay for rgmii-{id,txid}, and disable it for rgmii and * rgmii-rxid. The RX-delay can be enabled by the external RXDLY pin.
@@ -189,7 +191,22 @@ static int rtl8211f_config_init(struct phy_device *phydev)return 0 ; } -return phy_modify_paged (phydev,0xd08 ,0x11 ,RTL8211F_TX_DELAY , val); + ret =phy_modify_paged_changed (phydev,0xd08 ,0x11 ,RTL8211F_TX_DELAY , + val); +if (ret <0 ) { +dev_err (dev,"Failed to update the TX delay register\n" ); +return ret; + }else if (ret) { +dev_dbg (dev, +"%s 2ns TX delay (and changing the value from pin-strapping RXD1 or the bootloader)\n" , + val ?"Enabling" :"Disabling" ); + }else { +dev_dbg (dev, +"2ns TX delay was already %s (by pin-strapping RXD1 or bootloader configuration)\n" , + val ?"enabled" :"disabled" ); + } + +return 0 ; }static int rtl8211e_config_init (struct phy_device *phydev)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 188/399 crypto: chtls - Fixed memory leak
In reply to Greg Kroah-HartmanFrom: Vinay Kumar Yadav <[email protected]>
[ Upstream commit 93e23eb2ed6c11b4f483c8111ac155ec2b1f3042 ]
Freed work request skbs when connection terminates. enqueue_wr()/ dequeue_wr() is shared between softirq and application contexts, should be protected by socket lock. Moved dequeue_wr() to appropriate file.
--- drivers/crypto/chelsio/chtls/chtls_cm.c | 27 +++++++++++++------------ drivers/crypto/chelsio/chtls/chtls_cm.h | 21 +++++++++++++++++++ drivers/crypto/chelsio/chtls/chtls_hw.c | 3 +++ 3 files changed, 38 insertions(+), 13 deletions(-)
drivers/crypto/chelsio/chtls/chtls_cm.c +14 -13
@@ -727,6 +727,14 @@ static int chtls_close_listsrv_rpl(struct chtls_dev *cdev, struct sk_buff *skb)return 0 ; } +static void chtls_purge_wr_queue (struct sock *sk) +{ +struct sk_buff *skb; + +while ((skb =dequeue_wr (sk)) !=NULL ) +kfree_skb (skb); +} +static void chtls_release_resources (struct sock *sk) {struct chtls_sock *csk =rcu_dereference_sk_user_data (sk);
@@ -741,6 +749,11 @@ static void chtls_release_resources(struct sock *sk)kfree_skb (csk->txdata_skb_cache); csk->txdata_skb_cache =NULL ; +if (csk->wr_credits != csk->wr_max_credits) { +chtls_purge_wr_queue (sk); +chtls_reset_wr_list (csk); + } +if (csk->l2t_entry) {cxgb4_l2t_release (csk->l2t_entry); csk->l2t_entry =NULL ;
@@ -1735,6 +1748,7 @@ static void chtls_peer_close(struct sock *sk, struct sk_buff *skb)else sk_wake_async (sk,SOCK_WAKE_WAITD ,POLL_IN ); } +kfree_skb (skb); }static void chtls_close_con_rpl (struct sock *sk,struct sk_buff *skb)
@@ -2062,19 +2076,6 @@ rel_skb:return 0 ; } -static struct sk_buff *dequeue_wr (struct sock *sk) -{ -struct chtls_sock *csk =rcu_dereference_sk_user_data (sk); -struct sk_buff *skb = csk->wr_skb_head; - -if (likely (skb)) { -/* Don't bother clearing the tail */ - csk->wr_skb_head =WR_SKB_CB (skb)->next_wr; -WR_SKB_CB (skb)->next_wr =NULL ; - } -return skb; -} -static void chtls_rx_ack (struct sock *sk,struct sk_buff *skb) {struct cpl_fw4_ack *hdr =cplhdr (skb) +RSS_HDR ;
drivers/crypto/chelsio/chtls/chtls_cm.h +21 -0
@@ -185,6 +185,12 @@ static inline void chtls_kfree_skb(struct sock *sk, struct sk_buff *skb)kfree_skb (skb); } +static inline void chtls_reset_wr_list (struct chtls_sock *csk) +{ + csk->wr_skb_head =NULL ; + csk->wr_skb_tail =NULL ; +} +static inline void enqueue_wr (struct chtls_sock *csk,struct sk_buff *skb) {WR_SKB_CB (skb)->next_wr =NULL ;
@@ -197,4 +203,19 @@ static inline void enqueue_wr(struct chtls_sock *csk, struct sk_buff *skb)WR_SKB_CB (csk->wr_skb_tail)->next_wr = skb; csk->wr_skb_tail = skb; } + +static inline struct sk_buff *dequeue_wr (struct sock *sk) +{ +struct chtls_sock *csk =rcu_dereference_sk_user_data (sk); +struct sk_buff *skb =NULL ; + + skb = csk->wr_skb_head; + +if (likely (skb)) { +/* Don't bother clearing the tail */ + csk->wr_skb_head =WR_SKB_CB (skb)->next_wr; +WR_SKB_CB (skb)->next_wr =NULL ; + } +return skb; +}#endif
drivers/crypto/chelsio/chtls/chtls_hw.c +3 -0
@@ -350,6 +350,7 @@ int chtls_setkey(struct chtls_sock *csk, u32 keylen, u32 optname) kwr->sc_imm.cmd_more =cpu_to_be32 (ULPTX_CMD_V (ULP_TX_SC_IMM )); kwr->sc_imm.len =cpu_to_be32 (klen); +lock_sock (sk);/* key info */ kctx = (struct _key_ctx *)(kwr +1 ); ret =chtls_key_info (csk, kctx, keylen, optname);
@@ -388,8 +389,10 @@ int chtls_setkey(struct chtls_sock *csk, u32 keylen, u32 optname) csk->tlshws.txkey = keyid; } +release_sock (sk);return ret; out_notcb: +release_sock (sk);free_tls_keyid (sk); out_nokey:kfree_skb (skb);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 189/399 x86/vdso: Provide missing include file
In reply to Greg Kroah-HartmanFrom: Valdis Klētnieks <[email protected]>
[ Upstream commit bff47c2302cc249bcd550b17067f8dddbd4b6f77 ]
When building with C=1, sparse issues a warning:
CHECK arch/x86/entry/vdso/vdso32-setup.c
arch/x86/entry/vdso/vdso32-setup.c:28:28: warning: symbol 'vdso32_enabled' was not declared. Should it be static?
Provide the missing header file.
--- arch/x86/entry/vdso/vdso32-setup.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/entry/vdso/vdso32-setup.c +1 -0
@@ -11,6 +11,7 @@#include <linux/smp.h> #include <linux/kernel.h> #include <linux/mm_types.h> +#include <linux/elf.h> #include <asm/processor.h> #include <asm/vdso.h>
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 190/399 PM / devfreq: exynos-ppmu: Fix excessive stack usage
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit d4556f5e99d5f603913bac01adaff8670cb2d08b ]
Putting a 'struct devfreq_event_dev' object on the stack is generally a bad idea and here it leads to a warnig about potential stack overflow:
drivers/devfreq/event/exynos-ppmu.c:643:12: error: stack frame size of 1040 bytes in function 'exynos_ppmu_probe' [-Werror,-Wframe-larger-than=]
There is no real need for the device structure, only the string inside it, so add an internal helper function that simply takes the string as its argument and remove the device structure.
--- drivers/devfreq/event/exynos-ppmu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/devfreq/event/exynos-ppmu.c +8 -5
@@ -101,17 +101,22 @@ static struct __exynos_ppmu_events { PPMU_EVENT(dmc1_1), }; -static int exynos_ppmu_find_ppmu_id (struct devfreq_event_dev *edev) +static int __exynos_ppmu_find_ppmu_id (const char *edev_name) {int i;for (i =0 ; i <ARRAY_SIZE (ppmu_events); i++) -if (!strcmp (edev->desc->name, ppmu_events[i].name)) +if (!strcmp (edev_name, ppmu_events[i].name))return ppmu_events[i].id;return -EINVAL ; } +static int exynos_ppmu_find_ppmu_id (struct devfreq_event_dev *edev) +{ +return __exynos_ppmu_find_ppmu_id (edev->desc->name); +} +/* * The devfreq-event ops structure for PPMU v1.1 */
@@ -556,13 +561,11 @@ static int of_get_devfreq_events(struct device_node *np,* use default if not. */ if (info->ppmu_type ==EXYNOS_TYPE_PPMU_V2 ) { -struct devfreq_event_dev edev;int id;/* Not all registers take the same value for * read+write data count. */ - edev.desc = &desc[j]; - id =exynos_ppmu_find_ppmu_id (&edev); + id =__exynos_ppmu_find_ppmu_id (desc[j].name);switch (id) {case PPMU_PMNCNT0 :
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 191/399 PM / devfreq: Change time stats to 64-bit
In reply to Greg Kroah-HartmanFrom: Kamil Konieczny <[email protected]>
[ Upstream commit b76b3479dab948bea0a98b6d263eb56d8f358528 ]
Change time stats counting to bigger type by using 64-bit jiffies. This will make devfreq stats code look similar to cpufreq stats and prevents overflow (for HZ = 1000 after 49.7 days).
--- drivers/devfreq/devfreq.c | 14 +++++++------- include/linux/devfreq.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-)
drivers/devfreq/devfreq.c +7 -7
@@ -209,10 +209,10 @@ static int set_freq_table(struct devfreq *devfreq)int devfreq_update_status (struct devfreq *devfreq,unsigned long freq) {int lev, prev_lev, ret =0 ; -unsigned long cur_time; +u64 cur_time;lockdep_assert_held (&devfreq->lock); - cur_time = jiffies; + cur_time =get_jiffies_64 ();/* Immediately exit if previous_freq is not initialized yet. */ if (!devfreq->previous_freq)
@@ -535,7 +535,7 @@ void devfreq_monitor_resume(struct devfreq *devfreq) msecs_to_jiffies(devfreq->profile->polling_ms)); out_update: - devfreq->last_stat_updated = jiffies; + devfreq->last_stat_updated =get_jiffies_64 (); devfreq->stop_polling = false; if (devfreq->profile->get_cur_freq &&
@@ -820,7 +820,7 @@ struct devfreq *devfreq_add_device(struct device *dev, devfreq->time_in_state =devm_kcalloc (&devfreq->dev, devfreq->profile->max_state, -sizeof (unsigned long ), +sizeof (*devfreq->time_in_state),GFP_KERNEL );if (!devfreq->time_in_state) {mutex_unlock (&devfreq->lock);
@@ -828,7 +828,7 @@ struct devfreq *devfreq_add_device(struct device *dev, goto err_devfreq; } - devfreq->last_stat_updated = jiffies; + devfreq->last_stat_updated =get_jiffies_64 ();srcu_init_notifier_head (&devfreq->transition_notifier_list);
@@ -1589,8 +1589,8 @@ static ssize_t trans_stat_show(struct device *dev,for (j =0 ; j < max_state; j++) len +=sprintf (buf + len,"%10u" , devfreq->trans_table[(i * max_state) + j]); - len +=sprintf (buf + len,"%10u\n" , -jiffies_to_msecs (devfreq->time_in_state[i])); + len +=sprintf (buf + len,"%10llu\n" , (u64 ) +jiffies64_to_msecs (devfreq->time_in_state[i])); } len += sprintf(buf + len, "Total transition : %u\n",
include/linux/devfreq.h +2 -2
@@ -177,8 +177,8 @@ struct devfreq {/* information for device frequency transition */ unsigned int total_trans;unsigned int *trans_table; -unsigned long *time_in_state; -unsigned long last_stat_updated; +u64 *time_in_state; +u64 last_stat_updated;struct srcu_notifier_head transition_notifier_list;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 192/399 PM / devfreq: rk3399_dmc: Add COMPILE_TEST and HAVE_ARM_SMCCC dependency
In reply to Greg Kroah-HartmanFrom: Chanwoo Choi <[email protected]>
[ Upstream commit eff5d31f7407fa9d31fb840106f1593399457298 ]
To build test, add COMPILE_TEST depedency to both ARM_RK3399_DMC_DEVFREQ and DEVFREQ_EVENT_ROCKCHIP_DFI configuration. And ARM_RK3399_DMC_DEVFREQ used the SMCCC interface so that add HAVE_ARM_SMCCC dependency to prevent the build break.
--- drivers/devfreq/Kconfig | 3 ++- drivers/devfreq/event/Kconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/devfreq/Kconfig +2 -1
@@ -115,7 +115,8 @@ config ARM_TEGRA20_DEVFREQ config ARM_RK3399_DMC_DEVFREQ tristate "ARM RK3399 DMC DEVFREQ Driver" - depends on ARCH_ROCKCHIP + depends on (ARCH_ROCKCHIP && HAVE_ARM_SMCCC) || \ + (COMPILE_TEST && HAVE_ARM_SMCCC) select DEVFREQ_EVENT_ROCKCHIP_DFI select DEVFREQ_GOV_SIMPLE_ONDEMAND select PM_DEVFREQ_EVENT
drivers/devfreq/event/Kconfig +1 -1
@@ -34,7 +34,7 @@ config DEVFREQ_EVENT_EXYNOS_PPMU config DEVFREQ_EVENT_ROCKCHIP_DFI tristate "ROCKCHIP DFI DEVFREQ event Driver" - depends on ARCH_ROCKCHIP + depends on ARCH_ROCKCHIP || COMPILE_TEST help This add the devfreq-event driver for Rockchip SoC. It provides DFI (DDR Monitor Module) driver to count ddr load.
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 193/399 drm/fbdev: Fallback to non tiled mode if all tiles not present
In reply to Greg Kroah-HartmanFrom: Manasi Navare <[email protected]>
[ Upstream commit f25c7a006cd1c07254780e3406e45cee4842b933 ]
In case of tiled displays, if we hotplug just one connector, fbcon currently just selects the preferred mode and if it is tiled mode then that becomes a problem if rest of the tiles are not present.
So in the fbdev driver on hotplug when we probe the client modeset, if we dont find all the connectors for all tiles, then on a connector with one tile, just fallback to the first available non tiled mode to display over a single connector.
On the hotplug of the consecutive tiled connectors, if the tiled mode no longer exists because of fbcon size limitation, then return no modes for consecutive tiles but retain the non tiled mode on the 0th tile.
Use the same logic in case of connected boot case as well. This has been tested with Dell UP328K tiled monitor.
v2:
* Set the modes on consecutive hotplugged tiles to no mode if tiled mode is pruned (Dave)
v1:
* Just handle the 1st connector hotplug case
* v1 Reviewed-by: Dave Airlie <[email protected]>
--- drivers/gpu/drm/drm_client_modeset.c | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
drivers/gpu/drm/drm_client_modeset.c +72 -0
@@ -114,6 +114,33 @@ drm_client_find_modeset(struct drm_client_dev *client, struct drm_crtc *crtc)return NULL ; } +static struct drm_display_mode * +drm_connector_get_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +return mode; + } +return NULL ; +} + +static struct drm_display_mode * +drm_connector_fallback_non_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +continue ; +return mode; + } +return NULL ; +} +static struct drm_display_mode *drm_connector_has_preferred_mode (struct drm_connector *connector,int width,int height) {
@@ -348,8 +375,15 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,struct drm_connector *connector;u64 conn_configured =0 ;int tile_pass =0 ; +int num_tiled_conns =0 ;int i; +for (i =0 ; i < connector_count; i++) { +if (connectors[i]->has_tile && + connectors[i]->status == connector_status_connected) + num_tiled_conns++; + } + retry:for (i =0 ; i < connector_count; i++) { connector = connectors[i];
@@ -399,6 +433,28 @@ retry:list_for_each_entry (modes[i], &connector->modes, head)break ; } +/* +* In case of tiled mode if all tiles not present fallback to +* first available non tiled mode. +* After all tiles are present, try to find the tiled mode +* for all and if tiled mode not present due to fbcon size +* limitations, use first non tiled mode only for +* tile 0,0 and set to no mode for all other tiles. +*/ +if (connector->has_tile) { +if (num_tiled_conns < + connector->num_h_tile * connector->num_v_tile || + (connector->tile_h_loc ==0 && + connector->tile_v_loc ==0 && + !drm_connector_get_tiled_mode (connector))) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + }else { + modes[i] =drm_connector_get_tiled_mode (connector); + } + } +DRM_DEBUG_KMS ("found mode %s\n" , modes[i] ? modes[i]->name :"none" ); conn_configured |=BIT_ULL (i);
@@ -515,6 +571,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,bool fallback = true, ret = true;int num_connectors_enabled =0 ;int num_connectors_detected =0 ; +int num_tiled_conns =0 ;struct drm_modeset_acquire_ctx ctx;if (!drm_drv_uses_atomic_modeset (dev))
@@ -532,6 +589,11 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,memcpy (save_enabled, enabled, count); mask =GENMASK (count -1 ,0 ); conn_configured =0 ; +for (i =0 ; i < count; i++) { +if (connectors[i]->has_tile && + connectors[i]->status == connector_status_connected) + num_tiled_conns++; + } retry: conn_seq = conn_configured;for (i =0 ; i < count; i++) {
@@ -631,6 +693,16 @@ retry: connector->name); modes[i] = &connector->state->crtc->mode; } +/* +* In case of tiled modes, if all tiles are not present +* then fallback to a non tiled mode. +*/ +if (connector->has_tile && + num_tiled_conns < connector->num_h_tile * connector->num_v_tile) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + } crtcs[i] = new_crtc; DRM_DEBUG_KMS("connector %s on [CRTC:%d:%s]: %dx%d%s\n",
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 194/399 pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 02aeb2f21530c98fc3ca51028eda742a3fafbd9f ]
pinmux_func_gpios[] contains a hole due to the missing function GPIO definition for the "CTX0&CTX1" signal, which is the logical "AND" of the first two CAN outputs.
A closer look reveals other issues:
- Some functionality is available on alternative pins, but the PINMUX_DATA() entries is using the wrong marks,
- Several configurations are missing.
Fix this by:
- Renaming CTX0CTX1CTX2_MARK, CRX0CRX1_PJ22_MARK, and CRX0CRX1CRX2_PJ20_MARK to CTX0_CTX1_CTX2_MARK, CRX0_CRX1_PJ22_MARK, resp. CRX0_CRX1_CRX2_PJ20_MARK for consistency with the corresponding enum IDs,
- Adding all missing enum IDs and marks,
- Use the right (*_PJ2x) variants for alternative pins,
- Adding all missing configurations to pinmux_data[],
- Adding all missing function GPIO definitions to pinmux_func_gpios[].
See SH7268 Group, SH7269 Group User’s Manual: Hardware, Rev. 2.00:
[1] Table 1.4 List of Pins
[2] Figure 23.29 Connection Example when Using Channels 0 and 1 as One Channel (64 Mailboxes × 1 Channel) and Channel 2 as One Channel (32 Mailboxes × 1 Channel),
[3] Figure 23.30 Connection Example when Using Channels 0, 1, and 2 as One Channel (96 Mailboxes × 1 Channel),
[4] Table 48.3 Multiplexed Pins (Port B),
[5] Table 48.4 Multiplexed Pins (Port C),
[6] Table 48.10 Multiplexed Pins (Port J),
[7] Section 48.2.4 Port B Control Registers 0 to 5 (PBCR0 to PBCR5).
--- arch/sh/include/cpu-sh2a/cpu/sh7269.h | 11 ++++++-- drivers/pinctrl/sh-pfc/pfc-sh7269.c | 39 ++++++++++++++++++--------- 2 files changed, 36 insertions(+), 14 deletions(-)
arch/sh/include/cpu-sh2a/cpu/sh7269.h +9 -2
@@ -78,8 +78,15 @@ enum {GPIO_FN_WDTOVF ,/* CAN */ -GPIO_FN_CTX1 ,GPIO_FN_CRX1 ,GPIO_FN_CTX0 ,GPIO_FN_CTX0_CTX1 , -GPIO_FN_CRX0 ,GPIO_FN_CRX0_CRX1 ,GPIO_FN_CRX0_CRX1_CRX2 , +GPIO_FN_CTX2 ,GPIO_FN_CRX2 , +GPIO_FN_CTX1 ,GPIO_FN_CRX1 , +GPIO_FN_CTX0 ,GPIO_FN_CRX0 , +GPIO_FN_CTX0_CTX1 ,GPIO_FN_CRX0_CRX1 , +GPIO_FN_CTX0_CTX1_CTX2 ,GPIO_FN_CRX0_CRX1_CRX2 , +GPIO_FN_CTX2_PJ21 ,GPIO_FN_CRX2_PJ20 , +GPIO_FN_CTX1_PJ23 ,GPIO_FN_CRX1_PJ22 , +GPIO_FN_CTX0_CTX1_PJ23 ,GPIO_FN_CRX0_CRX1_PJ22 , +GPIO_FN_CTX0_CTX1_CTX2_PJ21 ,GPIO_FN_CRX0_CRX1_CRX2_PJ20 ,/* DMAC */ GPIO_FN_TEND0, GPIO_FN_DACK0, GPIO_FN_DREQ0,
drivers/pinctrl/sh-pfc/pfc-sh7269.c +27 -12
@@ -737,13 +737,12 @@ enum {CRX0_MARK ,CTX0_MARK ,CRX1_MARK ,CTX1_MARK ,CRX2_MARK ,CTX2_MARK , -CRX0_CRX1_MARK , -CRX0_CRX1_CRX2_MARK , -CTX0CTX1CTX2_MARK , +CRX0_CRX1_MARK ,CTX0_CTX1_MARK , +CRX0_CRX1_CRX2_MARK ,CTX0_CTX1_CTX2_MARK ,CRX1_PJ22_MARK ,CTX1_PJ23_MARK ,CRX2_PJ20_MARK ,CTX2_PJ21_MARK , -CRX0CRX1_PJ22_MARK , -CRX0CRX1CRX2_PJ20_MARK , +CRX0_CRX1_PJ22_MARK ,CTX0_CTX1_PJ23_MARK , +CRX0_CRX1_CRX2_PJ20_MARK ,CTX0_CTX1_CTX2_PJ21_MARK ,/* VDC */ DV_CLK_MARK,
@@ -821,6 +820,7 @@ static const u16 pinmux_data[] = {PINMUX_DATA (CS3_MARK ,PC8MD_001 ),PINMUX_DATA (TXD7_MARK ,PC8MD_010 ),PINMUX_DATA (CTX1_MARK ,PC8MD_011 ), +PINMUX_DATA (CTX0_CTX1_MARK ,PC8MD_100 ),PINMUX_DATA (PC7_DATA ,PC7MD_000 ), PINMUX_DATA(CKE_MARK, PC7MD_001),
@@ -833,11 +833,12 @@ static const u16 pinmux_data[] = {PINMUX_DATA (CAS_MARK ,PC6MD_001 ),PINMUX_DATA (SCK7_MARK ,PC6MD_010 ),PINMUX_DATA (CTX0_MARK ,PC6MD_011 ), +PINMUX_DATA (CTX0_CTX1_CTX2_MARK ,PC6MD_100 ),PINMUX_DATA (PC5_DATA ,PC5MD_000 ),PINMUX_DATA (RAS_MARK ,PC5MD_001 ),PINMUX_DATA (CRX0_MARK ,PC5MD_011 ), -PINMUX_DATA (CTX0CTX1CTX2_MARK ,PC5MD_100 ), +PINMUX_DATA (CTX0_CTX1_CTX2_MARK ,PC5MD_100 ),PINMUX_DATA (IRQ0_PC_MARK ,PC5MD_101 ), PINMUX_DATA(PC4_DATA, PC4MD_00),
@@ -1289,30 +1290,32 @@ static const u16 pinmux_data[] = {PINMUX_DATA (LCD_DATA23_PJ23_MARK ,PJ23MD_010 ),PINMUX_DATA (LCD_TCON6_MARK ,PJ23MD_011 ),PINMUX_DATA (IRQ3_PJ_MARK ,PJ23MD_100 ), -PINMUX_DATA (CTX1_MARK ,PJ23MD_101 ), +PINMUX_DATA (CTX1_PJ23_MARK ,PJ23MD_101 ), +PINMUX_DATA (CTX0_CTX1_PJ23_MARK ,PJ23MD_110 ),PINMUX_DATA (PJ22_DATA ,PJ22MD_000 ),PINMUX_DATA (DV_DATA22_MARK ,PJ22MD_001 ),PINMUX_DATA (LCD_DATA22_PJ22_MARK ,PJ22MD_010 ),PINMUX_DATA (LCD_TCON5_MARK ,PJ22MD_011 ),PINMUX_DATA (IRQ2_PJ_MARK ,PJ22MD_100 ), -PINMUX_DATA (CRX1_MARK ,PJ22MD_101 ), -PINMUX_DATA (CRX0_CRX1_MARK ,PJ22MD_110 ), +PINMUX_DATA (CRX1_PJ22_MARK ,PJ22MD_101 ), +PINMUX_DATA (CRX0_CRX1_PJ22_MARK ,PJ22MD_110 ),PINMUX_DATA (PJ21_DATA ,PJ21MD_000 ),PINMUX_DATA (DV_DATA21_MARK ,PJ21MD_001 ),PINMUX_DATA (LCD_DATA21_PJ21_MARK ,PJ21MD_010 ),PINMUX_DATA (LCD_TCON4_MARK ,PJ21MD_011 ),PINMUX_DATA (IRQ1_PJ_MARK ,PJ21MD_100 ), -PINMUX_DATA (CTX2_MARK ,PJ21MD_101 ), +PINMUX_DATA (CTX2_PJ21_MARK ,PJ21MD_101 ), +PINMUX_DATA (CTX0_CTX1_CTX2_PJ21_MARK ,PJ21MD_110 ),PINMUX_DATA (PJ20_DATA ,PJ20MD_000 ),PINMUX_DATA (DV_DATA20_MARK ,PJ20MD_001 ),PINMUX_DATA (LCD_DATA20_PJ20_MARK ,PJ20MD_010 ),PINMUX_DATA (LCD_TCON3_MARK ,PJ20MD_011 ),PINMUX_DATA (IRQ0_PJ_MARK ,PJ20MD_100 ), -PINMUX_DATA (CRX2_MARK ,PJ20MD_101 ), -PINMUX_DATA (CRX0CRX1CRX2_PJ20_MARK ,PJ20MD_110 ), +PINMUX_DATA (CRX2_PJ20_MARK ,PJ20MD_101 ), +PINMUX_DATA (CRX0_CRX1_CRX2_PJ20_MARK ,PJ20MD_110 ),PINMUX_DATA (PJ19_DATA ,PJ19MD_000 ), PINMUX_DATA(DV_DATA19_MARK, PJ19MD_001),
@@ -1663,12 +1666,24 @@ static const struct pinmux_func pinmux_func_gpios[] = {GPIO_FN (WDTOVF ),/* CAN */ +GPIO_FN (CTX2 ), +GPIO_FN (CRX2 ),GPIO_FN (CTX1 ),GPIO_FN (CRX1 ),GPIO_FN (CTX0 ),GPIO_FN (CRX0 ), +GPIO_FN (CTX0_CTX1 ),GPIO_FN (CRX0_CRX1 ), +GPIO_FN (CTX0_CTX1_CTX2 ),GPIO_FN (CRX0_CRX1_CRX2 ), +GPIO_FN (CTX2_PJ21 ), +GPIO_FN (CRX2_PJ20 ), +GPIO_FN (CTX1_PJ23 ), +GPIO_FN (CRX1_PJ22 ), +GPIO_FN (CTX0_CTX1_PJ23 ), +GPIO_FN (CRX0_CRX1_PJ22 ), +GPIO_FN (CTX0_CTX1_CTX2_PJ21 ), +GPIO_FN (CRX0_CRX1_CRX2_PJ20 ),/* DMAC */ GPIO_FN(TEND0),
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 195/399 reset: uniphier: Add SCSSI reset control for each channel
In reply to Greg Kroah-HartmanFrom: Kunihiko Hayashi <[email protected]>
[ Upstream commit f4aec227e985e31d2fdc5608daf48e3de19157b7 ]
SCSSI has reset controls for each channel in the SoCs newer than Pro4, so this adds missing reset controls for channel 1, 2 and 3. And more, this moves MCSSI reset ID after SCSSI.
--- drivers/reset/reset-uniphier.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/reset/reset-uniphier.c +8 -5
@@ -193,8 +193,8 @@ static const struct uniphier_reset_data uniphier_pro5_sd_reset_data[] = {#define UNIPHIER_PERI_RESET_FI2C (id, ch) \ UNIPHIER_RESETX((id), 0x114, 24 + (ch)) -#define UNIPHIER_PERI_RESET_SCSSI (id) \ - UNIPHIER_RESETX((id), 0x110, 17) +#define UNIPHIER_PERI_RESET_SCSSI (id, ch) \ + UNIPHIER_RESETX((id), 0x110, 17 + (ch))#define UNIPHIER_PERI_RESET_MCSSI (id) \ UNIPHIER_RESETX((id), 0x114, 14)
@@ -209,7 +209,7 @@ static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = {UNIPHIER_PERI_RESET_I2C (6 ,2 ),UNIPHIER_PERI_RESET_I2C (7 ,3 ),UNIPHIER_PERI_RESET_I2C (8 ,4 ), -UNIPHIER_PERI_RESET_SCSSI (11 ), +UNIPHIER_PERI_RESET_SCSSI (11 ,0 ), UNIPHIER_RESET_END, };
@@ -225,8 +225,11 @@ static const struct uniphier_reset_data uniphier_pro4_peri_reset_data[] = {UNIPHIER_PERI_RESET_FI2C (8 ,4 ),UNIPHIER_PERI_RESET_FI2C (9 ,5 ),UNIPHIER_PERI_RESET_FI2C (10 ,6 ), -UNIPHIER_PERI_RESET_SCSSI (11 ), -UNIPHIER_PERI_RESET_MCSSI (12 ), +UNIPHIER_PERI_RESET_SCSSI (11 ,0 ), +UNIPHIER_PERI_RESET_SCSSI (12 ,1 ), +UNIPHIER_PERI_RESET_SCSSI (13 ,2 ), +UNIPHIER_PERI_RESET_SCSSI (14 ,3 ), +UNIPHIER_PERI_RESET_MCSSI (15 ), UNIPHIER_RESET_END, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 196/399 ASoC: soc-topology: fix endianness issues
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 72bbeda0222bcd382ee33b3aff71346074410c21 ]
Sparse complains about a series of easy warnings, fix.
--- sound/soc/soc-topology.c | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-)
sound/soc/soc-topology.c +22 -20
@@ -604,9 +604,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, ext_ops = tplg->bytes_ext_ops; num_ops = tplg->bytes_ext_ops_count;for (i =0 ; i < num_ops; i++) { -if (!sbe->put && ext_ops[i].id == be->ext_ops.put) +if (!sbe->put && + ext_ops[i].id ==le32_to_cpu (be->ext_ops.put)) sbe->put = ext_ops[i].put; -if (!sbe->get && ext_ops[i].id == be->ext_ops.get) +if (!sbe->get && + ext_ops[i].id ==le32_to_cpu (be->ext_ops.get)) sbe->get = ext_ops[i].get; }
@@ -621,11 +623,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, num_ops = tplg->io_ops_count;for (i =0 ; i < num_ops; i++) { -if (k->put ==NULL && ops[i].id == hdr->ops.put) +if (k->put ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.put)) k->put = ops[i].put; -if (k->get ==NULL && ops[i].id == hdr->ops.get) +if (k->get ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.get)) k->get = ops[i].get; -if (k->info ==NULL && ops[i].id == hdr->ops.info) +if (k->info ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.info)) k->info = ops[i].info; }
@@ -638,11 +640,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, num_ops =ARRAY_SIZE (io_ops);for (i =0 ; i < num_ops; i++) { -if (k->put ==NULL && ops[i].id == hdr->ops.put) +if (k->put ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.put)) k->put = ops[i].put; -if (k->get ==NULL && ops[i].id == hdr->ops.get) +if (k->get ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.get)) k->get = ops[i].get; -if (k->info ==NULL && ops[i].id == hdr->ops.info) +if (k->info ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.info)) k->info = ops[i].info; }
@@ -931,7 +933,7 @@ static int soc_tplg_denum_create_texts(struct soc_enum *se,if (se->dobj.control.dtexts ==NULL )return -ENOMEM ; -for (i =0 ; i < ec->items; i++) { +for (i =0 ; i <le32_to_cpu (ec->items); i++) {if (strnlen (ec->texts[i],SNDRV_CTL_ELEM_ID_NAME_MAXLEN ) ==SNDRV_CTL_ELEM_ID_NAME_MAXLEN ) {
@@ -1325,7 +1327,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(if (kc[i].name ==NULL ) goto err_sm; kc[i].iface =SNDRV_CTL_ELEM_IFACE_MIXER ; - kc[i].access = mc->hdr.access; + kc[i].access =le32_to_cpu (mc->hdr.access);/* we only support FL/FR channel mapping atm */ sm->reg = tplc_chan_get_reg(tplg, mc->channel,
@@ -1337,10 +1339,10 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create( sm->rshift =tplc_chan_get_shift (tplg, mc->channel,SNDRV_CHMAP_FR ); - sm->max = mc->max; - sm->min = mc->min; - sm->invert = mc->invert; - sm->platform_max = mc->platform_max; + sm->max =le32_to_cpu (mc->max); + sm->min =le32_to_cpu (mc->min); + sm->invert =le32_to_cpu (mc->invert); + sm->platform_max =le32_to_cpu (mc->platform_max); sm->dobj.index = tplg->index;INIT_LIST_HEAD (&sm->dobj.list);
@@ -1401,7 +1403,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( goto err_se; tplg->pos += (sizeof (struct snd_soc_tplg_enum_control ) + - ec->priv.size); +le32_to_cpu (ec->priv.size));dev_dbg (tplg->dev," adding DAPM widget enum control %s\n" , ec->hdr.name);
@@ -1411,7 +1413,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(if (kc[i].name ==NULL ) goto err_se; kc[i].iface =SNDRV_CTL_ELEM_IFACE_MIXER ; - kc[i].access = ec->hdr.access; + kc[i].access =le32_to_cpu (ec->hdr.access);/* we only support FL/FR channel mapping atm */ se->reg =tplc_chan_get_reg (tplg, ec->channel,SNDRV_CHMAP_FL );
@@ -1420,8 +1422,8 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( se->shift_r =tplc_chan_get_shift (tplg, ec->channel,SNDRV_CHMAP_FR ); - se->items = ec->items; - se->mask = ec->mask; + se->items =le32_to_cpu (ec->items); + se->mask =le32_to_cpu (ec->mask); se->dobj.index = tplg->index;switch (le32_to_cpu (ec->hdr.ops.info)) {
@@ -1523,9 +1525,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create(if (kc[i].name ==NULL ) goto err_sbe; kc[i].iface =SNDRV_CTL_ELEM_IFACE_MIXER ; - kc[i].access = be->hdr.access; + kc[i].access =le32_to_cpu (be->hdr.access); - sbe->max = be->max; + sbe->max =le32_to_cpu (be->max);INIT_LIST_HEAD (&sbe->dobj.list);/* map standard io handlers and check for external handlers */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 197/399 fbdev: fix numbering of fbcon options
In reply to Greg Kroah-HartmanFrom: Peter Rosin <[email protected]>
[ Upstream commit fd933c00ebe220060e66fb136a7050a242456566 ]
Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count...
One! Two! Five!
--- Documentation/fb/fbcon.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/fb/fbcon.rst +4 -4
@@ -127,7 +127,7 @@ C. Boot options is typically located on the same video card. Thus, the consoles that are controlled by the VGA console will be garbled. -4. fbcon=rotate:<n> +5. fbcon=rotate:<n> This option changes the orientation angle of the console display. The value 'n' accepts the following:
@@ -152,21 +152,21 @@ C. Boot options Actually, the underlying fb driver is totally ignorant of console rotation. -5. fbcon=margin:<color> +6. fbcon=margin:<color> This option specifies the color of the margins. The margins are the leftover area at the right and the bottom of the screen that are not used by text. By default, this area will be black. The 'color' value is an integer number that depends on the framebuffer driver being used. -6. fbcon=nodefer +7. fbcon=nodefer If the kernel is compiled with deferred fbcon takeover support, normally the framebuffer contents, left in place by the firmware/bootloader, will be preserved until there actually is some text is output to the console. This option causes fbcon to bind immediately to the fbdev device. -7. fbcon=logo-pos:<location> +8. fbcon=logo-pos:<location> The only possible 'location' is 'center' (without quotes), and when given, the bootup logo is moved from the default top-left corner
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 198/399 RDMA/rxe: Fix error type of mmap_offset
In reply to Greg Kroah-HartmanFrom: Jiewei Ke <[email protected]>
[ Upstream commit 6ca18d8927d468c763571f78c9a7387a69ffa020 ]
The type of mmap_offset should be u64 instead of int to match the type of mminfo.offset. If otherwise, after we create several thousands of CQs, it will run into overflow issues.
--- drivers/infiniband/sw/rxe/rxe_verbs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_verbs.h +1 -1
@@ -408,7 +408,7 @@ struct rxe_dev {struct list_head pending_mmaps;spinlock_t mmap_offset_lock;/* guard mmap_offset */ -int mmap_offset; +u64 mmap_offset;atomic64_t stats_counters[RXE_NUM_OF_COUNTERS ];
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 199/399 ice: add extra check for null Rx descriptor
In reply to Greg Kroah-HartmanFrom: Mitch Williams <[email protected]>
[ Upstream commit 1f45ebe0d8fbe6178670b663005f38ef8535db5d ]
In the case where the hardware gives us a null Rx descriptor, it is theoretically possible that we could call one of our skb-construction functions with no data pointer, which would cause a panic.
In real life, this will never happen - we only get null RX descriptors as the final descriptor in a chain of otherwise-valid descriptors. When this happens, the skb will be extant and we'll just call ice_add_rx_frag(), which can deal with empty data buffers.
Unfortunately, Coverity does not have intimate knowledge of our hardware, so we must add a check here.
--- drivers/net/ethernet/intel/ice/ice_txrx.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +8 -5
@@ -1071,13 +1071,16 @@ static int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)ice_put_rx_buf (rx_ring, rx_buf);continue ; construct_skb: -if (skb) +if (skb) {ice_add_rx_frag (rx_ring, rx_buf, skb, size); -else if (ice_ring_uses_build_skb (rx_ring)) - skb =ice_build_skb (rx_ring, rx_buf, &xdp); -else + }else if (likely (xdp.data)) { +if (ice_ring_uses_build_skb (rx_ring)) + skb =ice_build_skb (rx_ring, rx_buf, &xdp); +else + skb =ice_construct_skb (rx_ring, rx_buf, &xdp); + }else { skb =ice_construct_skb (rx_ring, rx_buf, &xdp); - + }/* exit if we failed to retrieve a buffer */ if (!skb) { rx_ring->rx_stats.alloc_buf_failed++;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 200/399 clk: sunxi-ng: add mux and pll notifiers for A64 CPU clock
In reply to Greg Kroah-HartmanFrom: Icenowy Zheng <[email protected]>
[ Upstream commit ec97faff743b398e21f74a54c81333f3390093aa ]
The A64 PLL_CPU clock has the same instability if some factor changed without the PLL gated like other SoCs with sun6i-style CCU, e.g. A33, H3.
Add the mux and pll notifiers for A64 CPU clock to workaround the problem.
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 28 ++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +27 -1
@@ -921,11 +921,26 @@ static const struct sunxi_ccu_desc sun50i_a64_ccu_desc = { .num_resets = ARRAY_SIZE(sun50i_a64_ccu_resets), }; +static struct ccu_pll_nb sun50i_a64_pll_cpu_nb = { + .common = &pll_cpux_clk.common, +/* copy from pll_cpux_clk */ + .enable =BIT (31 ), + .lock =BIT (28 ), +}; + +static struct ccu_mux_nb sun50i_a64_cpu_nb = { + .common = &cpux_clk.common, + .cm = &cpux_clk.mux, + .delay_us =1 ,/* > 8 clock cycles at 24 MHz */ + .bypass_index =1 ,/* index of 24 MHz oscillator */ +}; +static int sun50i_a64_ccu_probe (struct platform_device *pdev) {struct resource *res;void __iomem *reg;u32 val; +int ret; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg =devm_ioremap_resource (&pdev->dev, res);
@@ -939,7 +954,18 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)writel (0x515 , reg +SUN50I_A64_PLL_MIPI_REG ); -return sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a64_ccu_desc); + ret =sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a64_ccu_desc); +if (ret) +return ret; + +/* Gate then ungate PLL CPU after any rate changes */ +ccu_pll_notifier_register (&sun50i_a64_pll_cpu_nb); + +/* Reparent CPU during PLL CPU rate changes */ +ccu_mux_notifier_register (pll_cpux_clk.common.hw.clk, + &sun50i_a64_cpu_nb); + +return 0 ; }static const struct of_device_id sun50i_a64_ccu_ids[] = {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 201/399 ALSA: sh: Fix unused variable warnings
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit 5da116f164ce265e397b8f59af5c39e4a61d61a5 ]
Remove unused variables that are left over after the conversion of new PCM ops:
sound/sh/sh_dac_audio.c:166:26: warning: unused variable 'runtime' sound/sh/sh_dac_audio.c:186:26: warning: unused variable 'runtime' sound/sh/sh_dac_audio.c:205:26: warning: unused variable 'runtime'
--- sound/sh/sh_dac_audio.c | 3 --- 1 file changed, 3 deletions(-)
sound/sh/sh_dac_audio.c +0 -3
@@ -175,7 +175,6 @@ static int snd_sh_dac_pcm_copy(struct snd_pcm_substream *substream, {/* channel is not used (interleaved data) */ struct snd_sh_dac *chip =snd_pcm_substream_chip (substream); -struct snd_pcm_runtime *runtime = substream->runtime;if (copy_from_user_toio (chip->data_buffer + pos, src, count))return -EFAULT ;
@@ -195,7 +194,6 @@ static int snd_sh_dac_pcm_copy_kernel(struct snd_pcm_substream *substream, {/* channel is not used (interleaved data) */ struct snd_sh_dac *chip =snd_pcm_substream_chip (substream); -struct snd_pcm_runtime *runtime = substream->runtime;memcpy_toio (chip->data_buffer + pos, src, count); chip->buffer_end = chip->data_buffer + pos + count;
@@ -214,7 +212,6 @@ static int snd_sh_dac_pcm_silence(struct snd_pcm_substream *substream, {/* channel is not used (interleaved data) */ struct snd_sh_dac *chip =snd_pcm_substream_chip (substream); -struct snd_pcm_runtime *runtime = substream->runtime;memset_io (chip->data_buffer + pos,0 , count); chip->buffer_end = chip->data_buffer + pos + count;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 202/399 clk: Use parent node pointer during registration if necessary
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit 9011f92622e5ef2d075f45e5fa818776d4feb8c0 ]
Sometimes clk drivers are attached to devices which are children of a parent device that is connected to a node in DT. This happens when devices are MFD-ish and the parent device driver mostly registers child devices to match against drivers placed in their respective subsystem directories like drivers/clk, drivers/regulator, etc. When the clk driver calls clk_register() with a device pointer, that struct device pointer won't have a device_node associated with it because it was created purely in software as a way to partition logic to a subsystem.
This causes problems for the way we find parent clks for the clks registered by these child devices because we look at the registering device's device_node pointer to lookup 'clocks' and 'clock-names' properties. Let's use the parent device's device_node pointer if the registering device doesn't have a device_node but the parent does. This simplifies clk registration code by avoiding the need to assign some device_node to the device registering the clk.
--- drivers/clk/clk.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)
drivers/clk/clk.c +25 -2
@@ -3736,6 +3736,28 @@ fail_out:return ERR_PTR (ret); } +/** +* dev_or_parent_of_node() - Get device node of @dev or @dev's parent +* @dev: Device to get device node of +* +* Return: device node pointer of @dev, or the device node pointer of +* @dev->parent if dev doesn't have a device node, or NULL if neither +* @dev or @dev->parent have a device node. +*/ +static struct device_node *dev_or_parent_of_node (struct device *dev) +{ +struct device_node *np; + +if (!dev) +return NULL ; + + np =dev_of_node (dev); +if (!np) + np =dev_of_node (dev->parent); + +return np; +} +/** * clk_register - allocate a new clock, register it and return an opaque cookie * @dev: device that is registering this clock
@@ -3751,7 +3773,7 @@ fail_out:*/ struct clk *clk_register (struct device *dev,struct clk_hw *hw) { -return __clk_register (dev,dev_of_node (dev), hw); +return __clk_register (dev,dev_or_parent_of_node (dev), hw); }EXPORT_SYMBOL_GPL (clk_register);
@@ -3767,7 +3789,8 @@ EXPORT_SYMBOL_GPL(clk_register);*/ int clk_hw_register (struct device *dev,struct clk_hw *hw) { -return PTR_ERR_OR_ZERO (__clk_register (dev,dev_of_node (dev), hw)); +return PTR_ERR_OR_ZERO (__clk_register (dev,dev_or_parent_of_node (dev), + hw)); }EXPORT_SYMBOL_GPL (clk_hw_register);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 203/399 clk: uniphier: Add SCSSI clock gate for each channel
In reply to Greg Kroah-HartmanFrom: Kunihiko Hayashi <[email protected]>
[ Upstream commit 1ec09a2ec67a0baa46a3ccac041dbcdbc6db2cb9 ]
SCSSI has clock gates for each channel in the SoCs newer than Pro4, so this adds missing clock gates for channel 1, 2 and 3. And more, this moves MCSSI clock ID after SCSSI.
--- drivers/clk/uniphier/clk-uniphier-peri.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/clk/uniphier/clk-uniphier-peri.c +8 -5
@@ -18,8 +18,8 @@#define UNIPHIER_PERI_CLK_FI2C (idx, ch) \ UNIPHIER_CLK_GATE("i2c" #ch, (idx), "i2c", 0x24, 24 + (ch)) -#define UNIPHIER_PERI_CLK_SCSSI (idx) \ - UNIPHIER_CLK_GATE("scssi", (idx), "spi", 0x20, 17) +#define UNIPHIER_PERI_CLK_SCSSI (idx, ch) \ + UNIPHIER_CLK_GATE("scssi" #ch, (idx), "spi", 0x20, 17 + (ch))#define UNIPHIER_PERI_CLK_MCSSI (idx) \ UNIPHIER_CLK_GATE("mcssi", (idx), "spi", 0x24, 14)
@@ -35,7 +35,7 @@ const struct uniphier_clk_data uniphier_ld4_peri_clk_data[] = {UNIPHIER_PERI_CLK_I2C (6 ,2 ),UNIPHIER_PERI_CLK_I2C (7 ,3 ),UNIPHIER_PERI_CLK_I2C (8 ,4 ), - UNIPHIER_PERI_CLK_SCSSI(11), + UNIPHIER_PERI_CLK_SCSSI(11, 0), { /* sentinel */ } };
@@ -51,7 +51,10 @@ const struct uniphier_clk_data uniphier_pro4_peri_clk_data[] = {UNIPHIER_PERI_CLK_FI2C (8 ,4 ),UNIPHIER_PERI_CLK_FI2C (9 ,5 ),UNIPHIER_PERI_CLK_FI2C (10 ,6 ), -UNIPHIER_PERI_CLK_SCSSI (11 ), - UNIPHIER_PERI_CLK_MCSSI(12), +UNIPHIER_PERI_CLK_SCSSI (11 ,0 ), +UNIPHIER_PERI_CLK_SCSSI (12 ,1 ), +UNIPHIER_PERI_CLK_SCSSI (13 ,2 ), +UNIPHIER_PERI_CLK_SCSSI (14 ,3 ), + UNIPHIER_PERI_CLK_MCSSI(15), { /* sentinel */ } };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 204/399 ALSA: hda/realtek - Apply mic mute LED quirk for Dell E7xx laptops, too
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit 5fab5829674c279839a7408ab30c71c6dfe726b9 ]
Dell E7xx laptops have also mic mute LED that is driven by the dell-laptop platform driver. Bind it with the capture control as already done for other models.
A caveat is that the fixup hook for the mic mute LED has to be applied at last, otherwise it results in the invalid override of the callback.
--- sound/pci/hda/patch_realtek.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +9 -1
@@ -5852,6 +5852,7 @@ enum {ALC288_FIXUP_DELL1_MIC_NO_PRESENCE ,ALC288_FIXUP_DELL_XPS_13 ,ALC288_FIXUP_DISABLE_AAMIX , +ALC292_FIXUP_DELL_E7X_AAMIX ,ALC292_FIXUP_DELL_E7X ,ALC292_FIXUP_DISABLE_AAMIX , ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
@@ -6547,12 +6548,19 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC293_FIXUP_DELL1_MIC_NO_PRESENCE }, - [ALC292_FIXUP_DELL_E7X] = { + [ALC292_FIXUP_DELL_E7X_AAMIX] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_dell_xps13, .chained = true, .chain_id =ALC292_FIXUP_DISABLE_AAMIX }, + [ALC292_FIXUP_DELL_E7X] = { + .type = HDA_FIXUP_FUNC, + .v.func = snd_hda_gen_fixup_micmute_led, +/* micmute fixup must be applied at last */ + .chained_before = true, + .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, + }, [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 205/399 ALSA: sh: Fix compile warning wrt const
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit f1dd4795b1523fbca7ab4344dd5a8bb439cc770d ]
A long-standing compile warning was seen during build test:
sound/sh/aica.c: In function 'load_aica_firmware':
sound/sh/aica.c:521:25: warning: passing argument 2 of 'spu_memload' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
--- sound/sh/aica.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/sh/aica.c +2 -2
@@ -101,10 +101,10 @@ static void spu_memset(u32 toi, u32 what, int length) }/* spu_memload - write to SPU address space */ -static void spu_memload (u32 toi,void *from,int length) +static void spu_memload (u32 toi,const void *from,int length) {unsigned long flags; -u32 *froml = from; +const u32 *froml = from;u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi);int i;u32 val;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 206/399 net: phy: fixed_phy: fix use-after-free when checking link GPIO
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit d266f19f3ae7fbcaf92229639b78d2110ae44f33 ]
If we fail to locate GPIO for any reason other than deferral or not-found-GPIO, we try to print device tree node info, however if might be freed already as we called of_node_put() on it.
--- drivers/net/phy/fixed_phy.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/phy/fixed_phy.c +2 -5
@@ -212,16 +212,13 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)*/ gpiod =gpiod_get_from_of_node (fixed_link_node,"link-gpios" ,0 ,GPIOD_IN ,"mdio" ); -of_node_put (fixed_link_node); -if (IS_ERR (gpiod)) { -if (PTR_ERR (gpiod) == -EPROBE_DEFER ) -return gpiod; - +if (IS_ERR (gpiod) &&PTR_ERR (gpiod) != -EPROBE_DEFER ) {if (PTR_ERR (gpiod) != -ENOENT )pr_err ("error getting GPIO for fixed link %pOF, proceed without\n" , fixed_link_node); gpiod =NULL ; } +of_node_put (fixed_link_node);return gpiod; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 207/399 tools lib api fs: Fix gcc9 stringop-truncation compilation error
In reply to Greg Kroah-HartmanFrom: Andrey Zhizhikin <[email protected]>
[ Upstream commit 6794200fa3c9c3e6759dae099145f23e4310f4f7 ]
GCC9 introduced string hardening mechanisms, which exhibits the error during fs api compilation:
error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
This comes when the length of copy passed to strncpy is is equal to destination size, which could potentially lead to buffer overflow.
There is a need to mitigate this potential issue by limiting the size of destination by 1 and explicitly terminate the destination with NULL.
--- tools/lib/api/fs/fs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/lib/api/fs/fs.c +3 -1
@@ -210,6 +210,7 @@ static bool fs__env_override(struct fs *fs)size_t name_len =strlen (fs->name);/* name + "_PATH" + '\0' */ char upper_name[name_len +5 +1 ]; +memcpy (upper_name, fs->name, name_len);mem_toupper (upper_name, name_len);strcpy (&upper_name[name_len],"_PATH" );
@@ -219,7 +220,8 @@ static bool fs__env_override(struct fs *fs)return false; fs->found = true; -strncpy (fs->path, override_path,sizeof (fs->path)); +strncpy (fs->path, override_path,sizeof (fs->path) -1 ); + fs->path[sizeof (fs->path) -1 ] ='\0' ;return true; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 208/399 vfio/spapr/nvlink2: Skip unpinning pages on error exit
In reply to Greg Kroah-HartmanFrom: Alexey Kardashevskiy <[email protected]>
[ Upstream commit 338b4e10f939a71194d8ecef7ece205a942cec05 ]
The nvlink2 subdriver for IBM Witherspoon machines preregisters GPU memory in the IOMMI API so KVM TCE code can map this memory for DMA as well. This is done by mm_iommu_newdev() called from vfio_pci_nvgpu_regops::mmap.
In an unlikely event of failure the data->mem remains NULL and since mm_iommu_put() (which unregisters the region and unpins memory if that was regular memory) does not expect mem=NULL, it should not be called.
This adds a check to only call mm_iommu_put() for a valid data->mem.
--- drivers/vfio/pci/vfio_pci_nvlink2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/vfio/pci/vfio_pci_nvlink2.c +4 -2
@@ -97,8 +97,10 @@ static void vfio_pci_nvgpu_release(struct vfio_pci_device *vdev,/* If there were any mappings at all... */ if (data->mm) { - ret =mm_iommu_put (data->mm, data->mem); -WARN_ON (ret); +if (data->mem) { + ret =mm_iommu_put (data->mm, data->mem); +WARN_ON (ret); + }mmdrop (data->mm); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 209/399 ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isnt one.
In reply to Greg Kroah-HartmanFrom: Sam McNally <[email protected]>
[ Upstream commit d4b74e218a8d0d6cf58e546627ab9d4d4f2645ab ]
Some members of the Google_Hatch family include a rt5682 jack codec, but no speaker amplifier. This uses the same driver (sof_rt5682) as a combination of rt5682 jack codec and max98357a speaker amplifier. Within the sof_rt5682 driver, these cases are not currently distinguishable, relying on a DMI quirk to decide the configuration. This causes an incorrect configuration when only the rt5682 is present on a Google_Hatch device.
For CML, the jack codec is used as the primary key when matching, with a possible speaker amplifier described in quirk_data. The two cases of interest are the second and third 10EC5682 entries in snd_soc_acpi_intel_cml_machines[]. The second entry matches the combination of rt5682 and max98357a, resulting in the quirk_data field in the snd_soc_acpi_mach being non-null, pointing at max98357a_spk_codecs, the snd_soc_acpi_codecs for the matched speaker amplifier. The third entry matches just the rt5682, resulting in a null quirk_data.
The sof_rt5682 driver's DMI data matching identifies that a speaker amplifier is present for all Google_Hatch family devices. Detect cases where there is no speaker amplifier by checking for a null quirk_data in the snd_soc_acpi_mach and remove the speaker amplifier bit in that case.
--- sound/soc/intel/boards/sof_rt5682.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
sound/soc/intel/boards/sof_rt5682.c +8 -1
@@ -603,6 +603,14 @@ static int sof_audio_probe(struct platform_device *pdev)dmi_check_system (sof_rt5682_quirk_table); + mach = (&pdev->dev)->platform_data; + +/* A speaker amp might not be present when the quirk claims one is. +* Detect this via whether the machine driver match includes quirk_data. +*/ +if ((sof_rt5682_quirk &SOF_SPEAKER_AMP_PRESENT ) && !mach->quirk_data) + sof_rt5682_quirk &= ~SOF_SPEAKER_AMP_PRESENT ; +if (soc_intel_is_byt () ||soc_intel_is_cht ()) { is_legacy_cpu =1 ; dmic_be_num =0 ;
@@ -663,7 +671,6 @@ static int sof_audio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&ctx->hdmi_pcm_list); sof_audio_card_rt5682.dev = &pdev->dev; - mach = (&pdev->dev)->platform_data;/* set platform name for each dailink */ ret = snd_soc_fixup_dai_links_platform_name(&sof_audio_card_rt5682,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 210/399 x86/unwind/orc: Fix !CONFIG_MODULES build warning
In reply to Greg Kroah-HartmanFrom: Shile Zhang <[email protected]>
[ Upstream commit 22a7fa8848c5e881d87ef2f7f3c2ea77b286e6f9 ]
To fix follwowing warning due to ORC sort moved to build time:
arch/x86/kernel/unwind_orc.c:210:12: warning: ‘orc_sort_cmp’ defined but not used [-Wunused-function] arch/x86/kernel/unwind_orc.c:190:13: warning: ‘orc_sort_swap’ defined but not used [-Wunused-function]
--- arch/x86/kernel/unwind_orc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/unwind_orc.c +2 -1
@@ -187,6 +187,8 @@ static struct orc_entry *orc_find(unsigned long ip)return orc_ftrace_find (ip); } +#ifdef CONFIG_MODULES +static void orc_sort_swap (void *_a,void *_b,int size) {struct orc_entry *orc_a, *orc_b;
@@ -229,7 +231,6 @@ static int orc_sort_cmp(const void *_a, const void *_b)return orc_a->sp_reg ==ORC_REG_UNDEFINED && !orc_a->end ?-1 :1 ; } -#ifdef CONFIG_MODULES void unwind_module_init (struct module *mod,void *_orc_ip,size_t orc_ip_size,void *_orc,size_t orc_size) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 211/399 ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch
In reply to Greg Kroah-HartmanFrom: Jason Ekstrand <[email protected]>
[ Upstream commit 0528904926aab19bffb2068879aa44db166c6d5f ]
Running evemu-record on the lid switch event shows that the lid reports the first "close" but then never reports an "open". This causes systemd to continuously re-suspend the laptop every 30s. Resetting the _LID to "open" fixes the issue.
--- drivers/acpi/button.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/acpi/button.c +11 -0
@@ -122,6 +122,17 @@ static const struct dmi_system_id dmi_lid_quirks[] = { }, .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, }, + { + /* + * Razer Blade Stealth 13 late 2019, notification of the LID device + * only happens on close, not on open and _LID always returns closed. + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Razer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Razer Blade Stealth 13 Late 2019"), + }, + .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, + }, {} };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 212/399 iommu/vt-d: Match CPU and IOMMU paging mode
In reply to Greg Kroah-HartmanFrom: Jacob Pan <[email protected]>
[ Upstream commit 79db7e1b4cf2a006f556099c13de3b12970fc6e3 ]
When setting up first level page tables for sharing with CPU, we need to ensure IOMMU can support no less than the levels supported by the CPU.
It is not adequate, as in the current code, to set up 5-level paging in PASID entry First Level Paging Mode(FLPM) solely based on CPU.
Currently, intel_pasid_setup_first_level() is only used by native SVM code which already checks paging mode matches. However, future use of this helper function may not be limited to native SVM.
https://lkml.org/lkml/2019/11/18/1037
--- drivers/iommu/intel-pasid.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/iommu/intel-pasid.c +10 -2
@@ -499,8 +499,16 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu, }#ifdef CONFIG_X86 -if (cpu_feature_enabled (X86_FEATURE_LA57 )) -pasid_set_flpm (pte,1 ); +/* Both CPU and IOMMU paging mode need to match */ +if (cpu_feature_enabled (X86_FEATURE_LA57 )) { +if (cap_5lp_support (iommu->cap)) { +pasid_set_flpm (pte,1 ); + }else { +pr_err ("VT-d has no 5-level paging support for CPU\n" ); +pasid_clear_entry (pte); +return -EINVAL ; + } + }#endif /* CONFIG_X86 */ pasid_set_domain_id (pte, did);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 213/399 iommu/vt-d: Avoid sending invalid page response
In reply to Greg Kroah-HartmanFrom: Jacob Pan <[email protected]>
[ Upstream commit 5f75585e19cc7018bf2016aa771632081ee2f313 ]
Page responses should only be sent when last page in group (LPIG) or private data is present in the page request. This patch avoids sending invalid descriptors.
--- drivers/iommu/intel-svm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/iommu/intel-svm.c +3 -4
@@ -654,11 +654,10 @@ static irqreturn_t prq_event_thread(int irq, void *d)if (req->priv_data_present)memcpy (&resp.qw2, req->priv_data,sizeof (req->priv_data)); + resp.qw2 =0 ; + resp.qw3 =0 ; +qi_submit_sync (&resp, iommu); } - resp.qw2 =0 ; - resp.qw3 =0 ; -qi_submit_sync (&resp, iommu); - head = (head +sizeof (*req)) &PRQ_RING_MASK ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 214/399 drm/amdkfd: Fix permissions of hang_hws
In reply to Greg Kroah-HartmanFrom: Felix Kuehling <[email protected]>
[ Upstream commit 2bdac179e217a0c0b548a8c60524977586621b19 ]
Reading from /sys/kernel/debug/kfd/hang_hws would cause a kernel oops because we didn't implement a read callback. Set the permission to write-only to prevent that.
--- drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c +1 -1
@@ -93,7 +93,7 @@ void kfd_debugfs_init(void) kfd_debugfs_hqds_by_device, &kfd_debugfs_fops);debugfs_create_file ("rls" ,S_IFREG |0444 , debugfs_root, kfd_debugfs_rls_by_device, &kfd_debugfs_fops); -debugfs_create_file ("hang_hws" ,S_IFREG |0644 , debugfs_root, +debugfs_create_file ("hang_hws" ,S_IFREG |0200 , debugfs_root,NULL , &kfd_debugfs_hang_hws_fops); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 215/399 mlx5: work around high stack usage with gcc
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 42ae1a5c76691928ed217c7e40269db27f5225e9 ]
In some configurations, gcc tries too hard to optimize this code:
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function 'mlx5e_grp_sw_update_stats':drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:302:1: error: the frame size of 1336 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
As was stated in the bug report, the reason is that gcc runs into a corner case in the register allocator that is rather hard to fix in a good way.
As there is an easy way to work around it, just add a comment and the barrier that stops gcc from trying to overoptimize the function.
--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +3 -0
@@ -297,6 +297,9 @@ static void mlx5e_grp_sw_update_stats(struct mlx5e_priv *priv) s->tx_tls_drop_bypass_req += sq_stats->tls_drop_bypass_req;#endif s->tx_cqes += sq_stats->cqes; + +/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92657 */ +barrier (); } } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 216/399 RDMA/hns: Avoid printing address of mtt page
In reply to Greg Kroah-HartmanFrom: Wenpeng Liang <[email protected]>
[ Upstream commit eca44507c3e908b7362696a4d6a11d90371334c6 ]
Address of a page shouldn't be printed in case of security issues.
--- drivers/infiniband/hw/hns/hns_roce_mr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hns/hns_roce_mr.c +2 -2
@@ -1064,8 +1064,8 @@ int hns_roce_ib_umem_write_mtt(struct hns_roce_dev *hr_dev,if (!(npage % (1 << (mtt->page_shift -PAGE_SHIFT )))) {if (page_addr & ((1 << mtt->page_shift) -1 )) {dev_err (dev, -"page_addr 0x%llx is not page_shift %d alignment!\n" , - page_addr, mtt->page_shift); +"page_addr is not page_shift %d alignment!\n" , + mtt->page_shift); ret = -EINVAL ; goto out; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 217/399 drm: remove the newline for CRC source name.
In reply to Greg Kroah-HartmanFrom: Dingchen Zhang <[email protected]>
[ Upstream commit 72a848f5c46bab4c921edc9cbffd1ab273b2be17 ]
userspace may transfer a newline, and this terminating newline is replaced by a '\0' to avoid followup issues.
'len-1' is the index to replace the newline of CRC source name.
v3: typo fix (Sam)
v2: update patch subject, body and format. (Sam)
--- drivers/gpu/drm/drm_debugfs_crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_debugfs_crc.c +2 -2
@@ -140,8 +140,8 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf,if (IS_ERR (source))return PTR_ERR (source); -if (source[len] =='\n' ) - source[len] ='\0' ; +if (source[len -1 ] =='\n' ) + source[len -1 ] ='\0' ; ret = crtc->funcs->verify_crc_source (crtc, source, &values_cnt);if (ret)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 218/399 usb: dwc3: use proper initializers for property entries
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 5eb5afb07853d6e90d3a2b230c825e028e948f79 ]
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
--- drivers/usb/dwc3/host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/dwc3/host.c +3 -3
@@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)memset (props,0 ,sizeof (struct property_entry ) *ARRAY_SIZE (props));if (dwc->usb3_lpm_capable) - props[prop_idx++].name ="usb3-lpm-capable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb3-lpm-capable" );if (dwc->usb2_lpm_disable) - props[prop_idx++].name ="usb2-lpm-disable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb2-lpm-disable" );/** * WORKAROUND: dwc3 revisions <=3.00a have a limitation
@@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)* This following flag tells XHCI to do just that. */ if (dwc->revision <=DWC3_REVISION_300A ) - props[prop_idx++].name ="quirk-broken-port-ped" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("quirk-broken-port-ped" );if (prop_idx) { ret =platform_device_add_properties (xhci, props);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 219/399 ARM: dts: stm32: Add power-supply for DSI panel on stm32f469-disco
In reply to Greg Kroah-HartmanFrom: Benjamin Gaignard <[email protected]>
[ Upstream commit 0ff15a86d0c5a3f004fee2e92d65b88e56a3bc58 ]
Add a fixed regulator and use it as power supply for DSI panel.
--- arch/arm/boot/dts/stm32f469-disco.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/stm32f469-disco.dts +8 -0
@@ -76,6 +76,13 @@ regulator-max-microvolt = <3300000>; }; + vdd_dsi: vdd-dsi { + compatible = "regulator-fixed"; + regulator-name = "vdd_dsi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + soc { dma-ranges = <0xc0000000 0x0 0x10000000>; };
@@ -155,6 +162,7 @@ compatible = "orisetech,otm8009a"; reg = <0>; /* dsi virtual channel (0..3) */ reset-gpios = <&gpioh 7 GPIO_ACTIVE_LOW>; + power-supply = <&vdd_dsi>; status = "okay"; port {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 220/399 usbip: Fix unsafe unaligned pointer usage
In reply to Greg Kroah-HartmanFrom: Shuah Khan <[email protected]>
[ Upstream commit 585c91f40d201bc564d4e76b83c05b3b5363fe7e ]
Fix unsafe unaligned pointer usage in usbip network interfaces. usbip tool build fails with new gcc -Werror=address-of-packed-member checks.
usbip_network.c: In function ‘usbip_net_pack_usb_device’:
usbip_network.c:79:32: error: taking address of packed member of ‘struct usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
79 | usbip_net_pack_uint32_t(pack, &udev->busnum);
Fix with minor changes to pass by value instead of by address.
--- tools/usb/usbip/src/usbip_network.c | 40 +++++++++++++++++------------ tools/usb/usbip/src/usbip_network.h | 12 +++------ 2 files changed, 27 insertions(+), 25 deletions(-)
tools/usb/usbip/src/usbip_network.c +24 -16
@@ -50,39 +50,39 @@ void usbip_setup_port_number(char *arg)info ("using port %d (\"%s\")" , usbip_port, usbip_port_string); } -void usbip_net_pack_uint32_t (int pack,uint32_t *num) +uint32_t usbip_net_pack_uint32_t (int pack,uint32_t num) {uint32_t i;if (pack) - i =htonl (*num); + i =htonl (num);else - i =ntohl (*num); + i =ntohl (num); - *num = i; +return i; } -void usbip_net_pack_uint16_t (int pack,uint16_t *num) +uint16_t usbip_net_pack_uint16_t (int pack,uint16_t num) {uint16_t i;if (pack) - i =htons (*num); + i =htons (num);else - i =ntohs (*num); + i =ntohs (num); - *num = i; +return i; }void usbip_net_pack_usb_device (int pack,struct usbip_usb_device *udev) { -usbip_net_pack_uint32_t (pack, &udev->busnum); -usbip_net_pack_uint32_t (pack, &udev->devnum); -usbip_net_pack_uint32_t (pack, &udev->speed); + udev->busnum =usbip_net_pack_uint32_t (pack, udev->busnum); + udev->devnum =usbip_net_pack_uint32_t (pack, udev->devnum); + udev->speed =usbip_net_pack_uint32_t (pack, udev->speed); -usbip_net_pack_uint16_t (pack, &udev->idVendor); -usbip_net_pack_uint16_t (pack, &udev->idProduct); -usbip_net_pack_uint16_t (pack, &udev->bcdDevice); + udev->idVendor =usbip_net_pack_uint16_t (pack, udev->idVendor); + udev->idProduct =usbip_net_pack_uint16_t (pack, udev->idProduct); + udev->bcdDevice =usbip_net_pack_uint16_t (pack, udev->bcdDevice); } void usbip_net_pack_usb_interface(int pack __attribute__((unused)),
@@ -129,6 +129,14 @@ ssize_t usbip_net_send(int sockfd, void *buff, size_t bufflen)return usbip_net_xmit (sockfd, buff, bufflen,1 ); } +static inline void usbip_net_pack_op_common (int pack, +struct op_common *op_common) +{ + op_common->version =usbip_net_pack_uint16_t (pack, op_common->version); + op_common->code =usbip_net_pack_uint16_t (pack, op_common->code); + op_common->status =usbip_net_pack_uint32_t (pack, op_common->status); +} +int usbip_net_send_op_common (int sockfd,uint32_t code,uint32_t status) {struct op_common op_common;
@@ -140,7 +148,7 @@ int usbip_net_send_op_common(int sockfd, uint32_t code, uint32_t status) op_common.code = code; op_common.status = status; -PACK_OP_COMMON (1 , &op_common); +usbip_net_pack_op_common (1 , &op_common); rc =usbip_net_send (sockfd, &op_common,sizeof (op_common));if (rc <0 ) {
@@ -164,7 +172,7 @@ int usbip_net_recv_op_common(int sockfd, uint16_t *code, int *status) goto err; } -PACK_OP_COMMON (0 , &op_common); +usbip_net_pack_op_common (0 , &op_common);if (op_common.version !=USBIP_VERSION ) { err("USBIP Kernel and tool version mismatch: %d %d:",
tools/usb/usbip/src/usbip_network.h +3 -9
@@ -32,12 +32,6 @@ struct op_common { } __attribute__((packed)); -#define PACK_OP_COMMON (pack, op_common) do {\ - usbip_net_pack_uint16_t(pack, &(op_common)->version);\ - usbip_net_pack_uint16_t(pack, &(op_common)->code);\ - usbip_net_pack_uint32_t(pack, &(op_common)->status);\ -} while (0) -/* ---------------------------------------------------------------------- */ /* Dummy Code */ #define OP_UNSPEC 0x00
@@ -163,11 +157,11 @@ struct op_devlist_reply_extra { } while (0)#define PACK_OP_DEVLIST_REPLY (pack, reply) do {\ - usbip_net_pack_uint32_t(pack, &(reply)->ndev);\ + (reply)->ndev = usbip_net_pack_uint32_t(pack, (reply)->ndev);\ } while (0) -void usbip_net_pack_uint32_t (int pack,uint32_t *num); -void usbip_net_pack_uint16_t (int pack,uint16_t *num); +uint32_t usbip_net_pack_uint32_t (int pack,uint32_t num); +uint16_t usbip_net_pack_uint16_t (int pack,uint16_t num);void usbip_net_pack_usb_device (int pack,struct usbip_usb_device *udev);void usbip_net_pack_usb_interface (int pack,struct usbip_usb_interface *uinf);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 221/399 udf: Fix free space reporting for metadata and virtual partitions
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
[ Upstream commit a4a8b99ec819ca60b49dc582a4287ef03411f117 ]
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
--- fs/udf/super.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
fs/udf/super.c +17 -5
@@ -2491,17 +2491,29 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) { +/* +* Filesystems with VAT are append-only and we cannot write to +* them. Let's just report 0 here. +*/ +return 0 ; + } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);if (accum ==0xFFFFFFFF ) accum =0 ; }
@@ -2510,7 +2522,7 @@ static unsigned int udf_count_free(struct super_block *sb)if (accum)return accum; - map = &sbi->s_partmaps[sbi->s_partition]; + map = &sbi->s_partmaps[part];if (map->s_partition_flags &UDF_PART_FLAG_UNALLOC_BITMAP ) { accum +=udf_count_free_bitmap (sb, map->s_uspace.s_bitmap);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 222/399 selftests: Uninitialized variable in test_cgcore_proc_migration()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 192c197cbca599321de95a4cf15c2fa0681140d3 ]
The "c_threads" variable is used in the error handling code before it has been initialized
--- tools/testing/selftests/cgroup/test_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cgroup/test_core.c +1 -1
@@ -369,7 +369,7 @@ static void *dummy_thread_fn(void *arg)static int test_cgcore_proc_migration (const char *root) {int ret =KSFT_FAIL ; -int t, c_threads, n_threads =13 ; +int t, c_threads =0 , n_threads =13 ;char *src =NULL , *dst =NULL ;pthread_t threads[n_threads];
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 223/399 kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds
In reply to Greg Kroah-HartmanFrom: Alan Maguire <[email protected]>
[ Upstream commit 1c024d45151b51c8f8d4749e65958b0bcf3e7c52 ]
In discussion of how to handle timeouts, it was noted that if sysctl_hung_task_timeout_seconds is exceeded for a kunit test, the test task will be killed and an oops generated. This should suffice as a means of debugging such timeout issues for now.
Hence remove use of sysctl_hung_task_timeout_secs, which has the added benefit of avoiding the need to export that symbol from the core kernel.
--- lib/kunit/try-catch.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-)
lib/kunit/try-catch.c +4 -18
@@ -12,7 +12,6 @@#include <linux/completion.h> #include <linux/kernel.h> #include <linux/kthread.h> -#include <linux/sched/sysctl.h> void __noreturn kunit_try_catch_throw (struct kunit_try_catch *try_catch) {
@@ -31,8 +30,6 @@ static int kunit_generic_run_threadfn_adapter(void *data)static unsigned long kunit_test_timeout (void ) { -unsigned long timeout_msecs; -/* * TODO([email protected]): We should probably have some type of * variable timeout here. The only question is what that timeout value
@@ -49,22 +46,11 @@ static unsigned long kunit_test_timeout(void)* * For more background on this topic, see: * https://mike-bland.com/2011/11/01/small-medium-large.html +* +* If tests timeout due to exceeding sysctl_hung_task_timeout_secs, +* the task will be killed and an oops generated. */ -if (sysctl_hung_task_timeout_secs) { -/* -* If sysctl_hung_task is active, just set the timeout to some -* value less than that. -* -* In regards to the above TODO, if we decide on variable -* timeouts, this logic will likely need to change. -*/ - timeout_msecs = (sysctl_hung_task_timeout_secs -1 ) * -MSEC_PER_SEC ; - }else { - timeout_msecs =300 *MSEC_PER_SEC ;/* 5 min */ - } - -return timeout_msecs; +return 300 *MSEC_PER_SEC ;/* 5 min */ }void kunit_try_catch_run (struct kunit_try_catch *try_catch,void *context)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 224/399 drm/mediatek: Add gamma property according to hardware capability
In reply to Greg Kroah-HartmanFrom: Yongqiang Niu <[email protected]>
[ Upstream commit 4cebc1de506fa753301266a5a23bb21bca52ad3a ]
If there is no gamma function in the crtc
display path, don't add gamma property
for crtc
--- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +8 -2
@@ -641,6 +641,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,int pipe = priv->num_pipes;int ret;int i; +uint gamma_lut_size =0 ;if (!path)return 0 ;
@@ -691,6 +692,9 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, } mtk_crtc->ddp_comp[i] = comp; + +if (comp->funcs && comp->funcs->gamma_set) + gamma_lut_size =MTK_LUT_SIZE ; }for (i =0 ; i < mtk_crtc->ddp_comp_nr; i++)
@@ -711,8 +715,10 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, NULL, pipe);if (ret <0 )return ret; -drm_mode_crtc_set_gamma_size (&mtk_crtc->base,MTK_LUT_SIZE ); -drm_crtc_enable_color_mgmt (&mtk_crtc->base,0 , false,MTK_LUT_SIZE ); + +if (gamma_lut_size) +drm_mode_crtc_set_gamma_size (&mtk_crtc->base, gamma_lut_size); +drm_crtc_enable_color_mgmt (&mtk_crtc->base,0 , false, gamma_lut_size); priv->num_pipes++;return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 225/399 staging: rtl8188: avoid excessive stack usage
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit c497ae2077c055b85c1bf04f3d182a84bd8f365b ]
The rtl8188 copy of the os_dep support code causes a warning about a very significant stack usage in the translate_scan() function:
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'translate_scan':drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:306:1: error: the frame size of 1560 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]
Use the same trick as in the rtl8723bs copy of the same function, and allocate it dynamically.
--- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +6 -3
@@ -222,18 +222,21 @@ static char *translate_scan(struct adapter *padapter,/* parsing WPA/WPA2 IE */ { -u8 buf[MAX_WPA_IE_LEN ]; +u8 *buf;u8 wpa_ie[255 ], rsn_ie[255 ];u16 wpa_len =0 , rsn_len =0 ;u8 *p; + buf =kzalloc (MAX_WPA_IE_LEN ,GFP_ATOMIC ); +if (!buf) +return start; +rtw_get_sec_ie (pnetwork->network.ies, pnetwork->network.ie_length, rsn_ie, &rsn_len, wpa_ie, &wpa_len);RT_TRACE (_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n" , pnetwork->network.ssid.ssid));RT_TRACE (_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n" , wpa_len, rsn_len));if (wpa_len >0 ) { p = buf; -memset (buf,0 ,MAX_WPA_IE_LEN ); p +=sprintf (p,"wpa_ie=" );for (i =0 ; i < wpa_len; i++) p +=sprintf (p,"%02x" , wpa_ie[i]);
@@ -250,7 +253,6 @@ static char *translate_scan(struct adapter *padapter, }if (rsn_len >0 ) { p = buf; -memset (buf,0 ,MAX_WPA_IE_LEN ); p +=sprintf (p,"rsn_ie=" );for (i =0 ; i < rsn_len; i++) p +=sprintf (p,"%02x" , rsn_ie[i]);
@@ -264,6 +266,7 @@ static char *translate_scan(struct adapter *padapter, iwe.u.data.length = rsn_len; start =iwe_stream_add_point (info, start, stop, &iwe, rsn_ie); } +kfree (buf); } {/* parsing WPS IE */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 226/399 IB/hfi1: Add software counter for ctxt0 seq drop
In reply to Greg Kroah-HartmanFrom: Mike Marciniszyn <[email protected]>
[ Upstream commit 5ffd048698ea5139743acd45e8ab388a683642b8 ]
All other code paths increment some form of drop counter.
This was missed in the original implementation.
--- drivers/infiniband/hw/hfi1/chip.c | 10 ++++++++++ drivers/infiniband/hw/hfi1/chip.h | 1 + drivers/infiniband/hw/hfi1/driver.c | 1 + drivers/infiniband/hw/hfi1/hfi.h | 2 ++ 4 files changed, 14 insertions(+)
drivers/infiniband/hw/hfi1/chip.c +10 -0
@@ -1685,6 +1685,14 @@ static u64 access_sw_pio_drain(const struct cntr_entry *entry,return dd->verbs_dev.n_piodrain; } +static u64 access_sw_ctx0_seq_drop (const struct cntr_entry *entry, +void *context,int vl,int mode,u64 data) +{ +struct hfi1_devdata *dd = context; + +return dd->ctx0_seq_drop; +} +static u64 access_sw_vtx_wait (const struct cntr_entry *entry,void *context,int vl,int mode,u64 data) {
@@ -4249,6 +4257,8 @@ static struct cntr_entry dev_cntrs[DEV_CNTR_LAST] = { access_sw_cpu_intr), [C_SW_CPU_RCV_LIM ] =CNTR_ELEM ("RcvLimit" ,0 ,0 ,CNTR_NORMAL , access_sw_cpu_rcv_limit), +[C_SW_CTX0_SEQ_DROP ] =CNTR_ELEM ("SeqDrop0" ,0 ,0 ,CNTR_NORMAL , + access_sw_ctx0_seq_drop), [C_SW_VTX_WAIT ] =CNTR_ELEM ("vTxWait" ,0 ,0 ,CNTR_NORMAL , access_sw_vtx_wait), [C_SW_PIO_WAIT] = CNTR_ELEM("PioWait", 0, 0, CNTR_NORMAL,
drivers/infiniband/hw/hfi1/chip.h +1 -0
@@ -926,6 +926,7 @@ enum {C_DC_PG_STS_TX_MBE_CNT ,C_SW_CPU_INTR ,C_SW_CPU_RCV_LIM , +C_SW_CTX0_SEQ_DROP ,C_SW_VTX_WAIT ,C_SW_PIO_WAIT , C_SW_PIO_DRAIN,
drivers/infiniband/hw/hfi1/driver.c +1 -0
@@ -734,6 +734,7 @@ static noinline int skip_rcv_packet(struct hfi1_packet *packet, int thread) {int ret; + packet->rcd->dd->ctx0_seq_drop++;/* Set up for the next packet */ packet->rhqoff += packet->rsize;if (packet->rhqoff >= packet->maxcnt)
drivers/infiniband/hw/hfi1/hfi.h +2 -0
@@ -1153,6 +1153,8 @@ struct hfi1_devdata {char *boardname;/* human readable board info */ +u64 ctx0_seq_drop; +/* reset value */ u64 z_int_counter;u64 z_rcv_limit;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 227/399 IB/hfi1: Add RcvShortLengthErrCnt to hfi1stats
In reply to Greg Kroah-HartmanFrom: Mike Marciniszyn <[email protected]>
[ Upstream commit 2c9d4e26d1ab27ceae2ded2ffe930f8e5f5b2a89 ]
This counter, RxShrErr, is required for error analysis and debug.
--- drivers/infiniband/hw/hfi1/chip.c | 1 + drivers/infiniband/hw/hfi1/chip.h | 1 + drivers/infiniband/hw/hfi1/chip_registers.h | 1 + 3 files changed, 3 insertions(+)
drivers/infiniband/hw/hfi1/chip.c +1 -0
@@ -4114,6 +4114,7 @@ def_access_ibp_counter(rc_crwaits);static struct cntr_entry dev_cntrs[DEV_CNTR_LAST ] = { [C_RCV_OVF ] =RXE32_DEV_CNTR_ELEM (RcvOverflow,RCV_BUF_OVFL_CNT ,CNTR_SYNTH ), [C_RX_LEN_ERR ] =RXE32_DEV_CNTR_ELEM (RxLenErr,RCV_LENGTH_ERR_CNT ,CNTR_SYNTH ), +[C_RX_SHORT_ERR ] =RXE32_DEV_CNTR_ELEM (RxShrErr,RCV_SHORT_ERR_CNT ,CNTR_SYNTH ), [C_RX_ICRC_ERR ] =RXE32_DEV_CNTR_ELEM (RxICrcErr,RCV_ICRC_ERR_CNT ,CNTR_SYNTH ), [C_RX_EBP ] =RXE32_DEV_CNTR_ELEM (RxEbpCnt,RCV_EBP_CNT ,CNTR_SYNTH ), [C_RX_TID_FULL] = RXE32_DEV_CNTR_ELEM(RxTIDFullEr, RCV_TID_FULL_ERR_CNT,
drivers/infiniband/hw/hfi1/chip.h +1 -0
@@ -859,6 +859,7 @@ static inline int idx_from_vl(int vl)enum {C_RCV_OVF =0 ,C_RX_LEN_ERR , +C_RX_SHORT_ERR ,C_RX_ICRC_ERR ,C_RX_EBP ,C_RX_TID_FULL ,
drivers/infiniband/hw/hfi1/chip_registers.h +1 -0
@@ -381,6 +381,7 @@#define DC_LCB_STS_LINK_TRANSFER_ACTIVE (DC_LCB_CSRS + 0x000000000468)#define DC_LCB_STS_ROUND_TRIP_LTP_CNT (DC_LCB_CSRS + 0x0000000004B0)#define RCV_LENGTH_ERR_CNT 0 +#define RCV_SHORT_ERR_CNT 2#define RCV_ICRC_ERR_CNT 6#define RCV_EBP_CNT 9#define RCV_BUF_OVFL_CNT 10
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 228/399 soc/tegra: fuse: Correct straps address for older Tegra124 device trees
In reply to Greg Kroah-HartmanFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit 2d9ea1934f8ef0dfb862d103389562cc28b4fc03 ]
Trying to read out Chip ID before APBMISC registers are mapped won't succeed, in a result Tegra124 gets a wrong address for the HW straps register if machine uses an old outdated device tree.
--- drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +1 -1
@@ -123,7 +123,7 @@ void __init tegra_init_apbmisc(void) apbmisc.flags =IORESOURCE_MEM ;/* strapping options */ -if (tegra_get_chip_id () ==TEGRA124 ) { +if (of_machine_is_compatible ("nvidia,tegra124" )) { straps.start =0x7000e864 ; straps.end =0x7000e867 ; }else {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 229/399 efi/x86: Dont panic or BUG() on non-critical error conditions
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit e2d68a955e49d61fd0384f23e92058dc9b79be5e ]
The logic in __efi_enter_virtual_mode() does a number of steps in sequence, all of which may fail in one way or the other. In most cases, we simply print an error and disable EFI runtime services support, but in some cases, we BUG() or panic() and bring down the system when encountering conditions that we could easily handle in the same way.
While at it, replace a pointless page-to-virt-phys conversion with one that goes straight from struct page to physical.
--- arch/x86/platform/efi/efi.c | 28 ++++++++++++++-------------- arch/x86/platform/efi/efi_64.c | 9 +++++---- 2 files changed, 19 insertions(+), 18 deletions(-)
arch/x86/platform/efi/efi.c +14 -14
@@ -1000,16 +1000,14 @@ static void __init __efi_enter_virtual_mode(void)if (efi_alloc_page_tables ()) {pr_err ("Failed to allocate EFI page tables\n" ); -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; + goto err; }efi_merge_regions (); new_memmap =efi_map_regions (&count, &pg_shift);if (!new_memmap) {pr_err ("Error reallocating memory, EFI runtime non-functional!\n" ); -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; + goto err; } pa =__pa (new_memmap);
@@ -1023,8 +1021,7 @@ static void __init __efi_enter_virtual_mode(void)if (efi_memmap_init_late (pa, efi.memmap.desc_size * count)) {pr_err ("Failed to remap late EFI memory map\n" ); -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; + goto err; }if (efi_enabled (EFI_DBG )) {
@@ -1032,12 +1029,11 @@ static void __init __efi_enter_virtual_mode(void)efi_print_memmap (); } -BUG_ON (!efi.systab); +if (WARN_ON (!efi.systab)) + goto err; -if (efi_setup_page_tables (pa,1 << pg_shift)) { -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; - } +if (efi_setup_page_tables (pa,1 << pg_shift)) + goto err;efi_sync_low_kernel_mappings ();
@@ -1057,9 +1053,9 @@ static void __init __efi_enter_virtual_mode(void) }if (status !=EFI_SUCCESS ) { -pr_alert ("Unable to switch EFI into virtual mode (status=%lx)!\n" , - status); -panic ("EFI call to SetVirtualAddressMap() failed!" ); +pr_err ("Unable to switch EFI into virtual mode (status=%lx)!\n" , + status); + goto err; }efi_free_boot_services ();
@@ -1088,6 +1084,10 @@ static void __init __efi_enter_virtual_mode(void)/* clean DUMMY object */ efi_delete_dummy_variable (); +return ; + +err: +clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); }void __init efi_enter_virtual_mode (void )
arch/x86/platform/efi/efi_64.c +5 -4
@@ -392,11 +392,12 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)return 0 ; page =alloc_page (GFP_KERNEL |__GFP_DMA32); -if (!page) -panic ("Unable to allocate EFI runtime stack < 4GB\n" ); +if (!page) { +pr_err ("Unable to allocate EFI runtime stack < 4GB\n" ); +return 1 ; + } - efi_scratch.phys_stack =virt_to_phys (page_address (page)); - efi_scratch.phys_stack +=PAGE_SIZE ;/* stack grows down */ + efi_scratch.phys_stack =page_to_phys (page +1 );/* stack grows down */ npages = (_etext - _text) >>PAGE_SHIFT ; text =__pa (_text);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 230/399 rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls
In reply to Greg Kroah-HartmanFrom: Paul E. McKenney <[email protected]>
[ Upstream commit 860c8802ace14c646864795e057349c9fb2d60ad ]
Eric Dumazet supplied a KCSAN report of a bug that forces use of hlist_unhashed_lockless() from sk_unhashed():
------------------------------------------------------------------------
BUG: KCSAN: data-race in inet_unhash / inet_unhash
write to 0xffff8880a69a0170 of 8 bytes by interrupt on cpu 1:
__hlist_nulls_del include/linux/list_nulls.h:88 [inline] hlist_nulls_del_init_rcu include/linux/rculist_nulls.h:36 [inline] __sk_nulls_del_node_init_rcu include/net/sock.h:676 [inline] inet_unhash+0x38f/0x4a0 net/ipv4/inet_hashtables.c:612 tcp_set_state+0xfa/0x3e0 net/ipv4/tcp.c:2249 tcp_done+0x93/0x1e0 net/ipv4/tcp.c:3854 tcp_write_err+0x7e/0xc0 net/ipv4/tcp_timer.c:56 tcp_retransmit_timer+0x9b8/0x16d0 net/ipv4/tcp_timer.c:479 tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:599 tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:619 call_timer_fn+0x5f/0x2f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0xc0c/0xcd0 kernel/time/timer.c:1786 __do_softirq+0x115/0x33f kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0xbb/0xe0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71 arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571 default_idle_call+0x1e/0x40 kernel/sched/idle.c:94 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1af/0x280 kernel/sched/idle.c:263 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355 start_secondary+0x208/0x260 arch/x86/kernel/smpboot.c:264 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
read to 0xffff8880a69a0170 of 8 bytes by interrupt on cpu 0:
sk_unhashed include/net/sock.h:607 [inline] inet_unhash+0x3d/0x4a0 net/ipv4/inet_hashtables.c:592 tcp_set_state+0xfa/0x3e0 net/ipv4/tcp.c:2249 tcp_done+0x93/0x1e0 net/ipv4/tcp.c:3854 tcp_write_err+0x7e/0xc0 net/ipv4/tcp_timer.c:56 tcp_retransmit_timer+0x9b8/0x16d0 net/ipv4/tcp_timer.c:479 tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:599 tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:619 call_timer_fn+0x5f/0x2f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0xc0c/0xcd0 kernel/time/timer.c:1786 __do_softirq+0x115/0x33f kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0xbb/0xe0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71 arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571 default_idle_call+0x1e/0x40 kernel/sched/idle.c:94 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1af/0x280 kernel/sched/idle.c:263 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355 rest_init+0xec/0xf6 init/main.c:452 arch_call_rest_init+0x17/0x37 start_kernel+0x838/0x85e init/main.c:786 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:490 x86_64_start_kernel+0x72/0x76 arch/x86/kernel/head64.c:471 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-rc6+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine,
BIOS Google 01/01/2011
------------------------------------------------------------------------
This commit therefore replaces C-language assignments with WRITE_ONCE() in include/linux/list_nulls.h and include/linux/rculist_nulls.h.
--- include/linux/list_nulls.h | 8 ++++---- include/linux/rculist_nulls.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
include/linux/list_nulls.h +4 -4
@@ -72,10 +72,10 @@ static inline void hlist_nulls_add_head(struct hlist_nulls_node *n,struct hlist_nulls_node *first = h->first; n->next = first; - n->pprev = &h->first; +WRITE_ONCE (n->pprev, &h->first); h->first = n;if (!is_a_nulls (first)) - first->pprev = &n->next; +WRITE_ONCE (first->pprev, &n->next); }static inline void __hlist_nulls_del (struct hlist_nulls_node *n)
@@ -85,13 +85,13 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n)WRITE_ONCE (*pprev, next);if (!is_a_nulls (next)) - next->pprev = pprev; +WRITE_ONCE (next->pprev, pprev); }static inline void hlist_nulls_del (struct hlist_nulls_node *n) {__hlist_nulls_del (n); - n->pprev =LIST_POISON2 ; +WRITE_ONCE (n->pprev,LIST_POISON2 ); }/**
include/linux/rculist_nulls.h +4 -4
@@ -34,7 +34,7 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n) {if (!hlist_nulls_unhashed (n)) {__hlist_nulls_del (n); - n->pprev =NULL ; +WRITE_ONCE (n->pprev,NULL ); } }
@@ -66,7 +66,7 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n)static inline void hlist_nulls_del_rcu (struct hlist_nulls_node *n) {__hlist_nulls_del (n); - n->pprev =LIST_POISON2 ; +WRITE_ONCE (n->pprev,LIST_POISON2 ); }/**
@@ -94,10 +94,10 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n,struct hlist_nulls_node *first = h->first; n->next = first; - n->pprev = &h->first; +WRITE_ONCE (n->pprev, &h->first);rcu_assign_pointer (hlist_nulls_first_rcu (h), n);if (!is_a_nulls (first)) - first->pprev = &n->next; +WRITE_ONCE (first->pprev, &n->next); }/**
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 231/399 Input: edt-ft5x06 - work around first register access error
In reply to Greg Kroah-HartmanFrom: Philipp Zabel <[email protected]>
[ Upstream commit e112324cc0422c046f1cf54c56f333d34fa20885 ]
The EP0700MLP1 returns bogus data on the first register read access (reading the threshold parameter from register 0x00):
edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40
It ignores writes until then. This patch adds a dummy read after which the number of sensors and parameter read/writes work correctly.
--- drivers/input/touchscreen/edt-ft5x06.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/touchscreen/edt-ft5x06.c +7 -0
@@ -1050,6 +1050,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, {const struct edt_i2c_chip_data *chip_data;struct edt_ft5x06_ts_data *tsdata; +u8 buf[2 ] = {0xfc ,0x00 };struct input_dev *input;unsigned long irq_flags;int error;
@@ -1140,6 +1141,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,return error; } +/* +* Dummy read access. EP0700MLP1 returns bogus data on the first +* register read access and ignores writes. +*/ +edt_ft5x06_ts_readwrite (tsdata->client,2 , buf,2 , buf); +edt_ft5x06_ts_set_regs (tsdata);edt_ft5x06_ts_get_defaults (&client->dev, tsdata);edt_ft5x06_ts_get_parameters (tsdata);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 232/399 bnxt: Detach page from page pool before sending up the stack
In reply to Greg Kroah-HartmanFrom: Jonathan Lemon <[email protected]>
[ Upstream commit 3071c51783b39d6a676d02a9256c3b3f87804285 ]
When running in XDP mode, pages come from the page pool, and should be freed back to the same pool or specifically detached. Currently, when the driver re-initializes, the page pool destruction is delayed forever since it thinks there are oustanding pages.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
@@ -944,6 +944,7 @@ static struct sk_buff *bnxt_rx_page_skb(struct bnxt *bp, dma_addr -= bp->rx_dma_offset;dma_unmap_page_attrs (&bp->pdev->dev, dma_addr,PAGE_SIZE , bp->rx_dir,DMA_ATTR_WEAK_ORDERING ); +page_pool_release_page (rxr->page_pool, page);if (unlikely (!payload)) payload =eth_get_headlen (bp->dev, data_ptr, len);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 233/399 x86/nmi: Remove irq_work from the long duration NMI handler
In reply to Greg Kroah-HartmanFrom: Changbin Du <[email protected]>
[ Upstream commit 248ed51048c40d36728e70914e38bffd7821da57 ]
First, printk() is NMI-context safe now since the safe printk() has been implemented and it already has an irq_work to make NMI-context safe.
Second, this NMI irq_work actually does not work if a NMI handler causes panic by watchdog timeout. It has no chance to run in such case, while the safe printk() will flush its per-cpu buffers before panicking.
While at it, repurpose the irq_work callback into a function which concentrates the NMI duration checking and makes the code easier to follow.
[ bp: Massage. ]
--- arch/x86/include/asm/nmi.h | 1 - arch/x86/kernel/nmi.c | 20 +++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-)
arch/x86/include/asm/nmi.h +0 -1
@@ -41,7 +41,6 @@ struct nmiaction {struct list_head list;nmi_handler_t handler;u64 max_duration; -struct irq_work irq_work;unsigned long flags;const char *name; };
arch/x86/kernel/nmi.c +9 -11
@@ -104,18 +104,22 @@ static int __init nmi_warning_debugfs(void) }fs_initcall (nmi_warning_debugfs); -static void nmi_max_handler (struct irq_work *w) +static void nmi_check_duration (struct nmiaction *action,u64 duration) { - struct nmiaction *a = container_of(w, struct nmiaction, irq_work); +u64 whole_msecs =READ_ONCE (action->max_duration);int remainder_ns, decimal_msecs; -u64 whole_msecs =READ_ONCE (a->max_duration); + +if (duration < nmi_longest_ns || duration < action->max_duration) +return ; + + action->max_duration = duration; remainder_ns =do_div (whole_msecs, (1000 *1000 )); decimal_msecs = remainder_ns /1000 ;printk_ratelimited (KERN_INFO "INFO: NMI handler (%ps) took too long to run: %lld.%03d msecs\n" , - a->handler, whole_msecs, decimal_msecs); + action->handler, whole_msecs, decimal_msecs); }static int nmi_handle (unsigned int type,struct pt_regs *regs)
@@ -142,11 +146,7 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs) delta =sched_clock () - delta;trace_nmi_handler (a->handler, (int )delta, thishandled); -if (delta < nmi_longest_ns || delta < a->max_duration) -continue ; - - a->max_duration = delta; -irq_work_queue (&a->irq_work); +nmi_check_duration (a, delta); }rcu_read_unlock ();
@@ -164,8 +164,6 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action)if (!action->handler)return -EINVAL ; -init_irq_work (&action->irq_work, nmi_max_handler); -raw_spin_lock_irqsave (&desc->lock, flags);/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 234/399 wan: ixp4xx_hss: fix compile-testing on 64-bit
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 504c28c853ec5c626900b914b5833daf0581a344 ]
Change the driver to use portable integer types to avoid warnings during compile testing:
drivers/net/wan/ixp4xx_hss.c:863:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast]
memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
^
drivers/net/wan/ixp4xx_hss.c:979:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
&port->desc_tab_phys)))
^~~~~~~~~~~~~~~~~~~~
include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here
dma_addr_t *handle);
^--- drivers/net/wan/ixp4xx_hss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wan/ixp4xx_hss.c +2 -2
@@ -258,7 +258,7 @@ struct port {struct hss_plat_info *plat;buffer_t *rx_buff_tab[RX_DESCS ], *tx_buff_tab[TX_DESCS ];struct desc *desc_tab;/* coherent */ -u32 desc_tab_phys; +dma_addr_t desc_tab_phys;unsigned int id;unsigned int clock_type, clock_rate, loopback;unsigned int initialized, carrier;
@@ -858,7 +858,7 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev) dev->stats.tx_dropped++; return NETDEV_TX_OK; } -memcpy_swab32 (mem, (u32 *)((int )skb->data & ~3 ), bytes /4 ); +memcpy_swab32 (mem, (u32 *)((uintptr_t )skb->data & ~3 ), bytes /4 );dev_kfree_skb (skb);#endif
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 235/399 clocksource: davinci: only enable clockevents once tim34 is initialized
In reply to Greg Kroah-HartmanFrom: Bartosz Golaszewski <[email protected]>
[ Upstream commit cea931c25104e6bddc42eb067f58193f355dbdd7 ]
The DM365 platform has a strange quirk (only present when using ancient u-boot - mainline u-boot v2013.01 and later works fine) where if we enable the second half of the timer in periodic mode before we do its initialization - the time won't start flowing and we can't boot.
When using more recent u-boot, we can enable the timer, then reinitialize it and all works fine.
To work around this issue only enable clockevents once tim34 is initialized i.e. move clockevents_config_and_register() below tim34 initialization.
--- drivers/clocksource/timer-davinci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clocksource/timer-davinci.c +4 -4
@@ -302,10 +302,6 @@ int __init davinci_timer_register(struct clk *clk,return rv; } -clockevents_config_and_register (&clockevent->dev, tick_rate, -DAVINCI_TIMER_MIN_DELTA , -DAVINCI_TIMER_MAX_DELTA ); - davinci_clocksource.dev.rating =300 ; davinci_clocksource.dev.read = davinci_clocksource_read; davinci_clocksource.dev.mask =
@@ -323,6 +319,10 @@ int __init davinci_timer_register(struct clk *clk,davinci_clocksource_init_tim34 (base); } +clockevents_config_and_register (&clockevent->dev, tick_rate, +DAVINCI_TIMER_MIN_DELTA , +DAVINCI_TIMER_MAX_DELTA ); + rv =clocksource_register_hz (&davinci_clocksource.dev, tick_rate);if (rv) {pr_err ("Unable to register clocksource" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 236/399 arm64: dts: rockchip: fix dwmmc clock name for px30
In reply to Greg Kroah-HartmanFrom: Johan Jonker <[email protected]>
[ Upstream commit 7f2147350291569acd1df5a26dcdfc573916016f ]
An experimental test with the command below gives this error:px30-evb.dt.yaml: dwmmc@ff390000: clock-names:2:
'ciu-drive' was expected
'ciu-drv' is not a valid dwmmc clock name,
so fix this by changing it to 'ciu-drive'.
make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm64/boot/dts/rockchip/px30.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/rockchip/px30.dtsi +3 -3
@@ -826,7 +826,7 @@ interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
@@ -841,7 +841,7 @@ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
@@ -856,7 +856,7 @@ interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 237/399 arm64: dts: rockchip: fix dwmmc clock name for rk3308
In reply to Greg Kroah-HartmanFrom: Johan Jonker <[email protected]>
[ Upstream commit 2be6a280144e521248a4bdefb691a0a97e604294 ]
An experimental test with the command below gives this error:rk3308-evb.dt.yaml: dwmmc@ff480000: clock-names:2:
'ciu-drive' was expected
'ciu-drv' is not a valid dwmmc clock name,
so fix this by changing it to 'ciu-drive'.
make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm64/boot/dts/rockchip/rk3308.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/rockchip/rk3308.dtsi +3 -3
@@ -591,7 +591,7 @@ bus-width = <4>; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
@@ -606,7 +606,7 @@ bus-width = <8>; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; status = "disabled";
@@ -619,7 +619,7 @@ bus-width = <4>; clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 238/399 arm64: dts: rockchip: add reg property to brcmf sub-nodes
In reply to Greg Kroah-HartmanFrom: Johan Jonker <[email protected]>
[ Upstream commit 96ff264bccb22175bbe2185a1eb5204ca3c5f03f ]
An experimental test with the command below gives this error:rk3399-firefly.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required propertyrk3399-orangepi.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property rk3399-khadas-edge.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property rk3399-khadas-edge-captain.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property rk3399-khadas-edge-v.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property
So fix this by adding a reg property to the brcmf sub node. Also add #address-cells and #size-cells to prevent more warnings.
make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 3 +++ arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 3 +++ arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts | 3 +++ 3 files changed, 9 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +3 -0
@@ -669,9 +669,12 @@ vqmmc-supply = &vcc1v8_s3; /* IO line */ vmmc-supply = &vcc_sdio; /* card's power */ + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio0>; interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi +3 -0
@@ -654,9 +654,12 @@ sd-uhs-sdr104; vqmmc-supply = <&vcc1v8_s3>; vmmc-supply = <&vccio_sd>; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio0>; interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts +3 -0
@@ -648,9 +648,12 @@ pinctrl-names = "default"; pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; sd-uhs-sdr104; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio0>; interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 239/399 ARM: dts: rockchip: add reg property to brcmf sub node for rk3188-bqedison2qc
In reply to Greg Kroah-HartmanFrom: Johan Jonker <[email protected]>
[ Upstream commit cf206bca178cd5b5a436494b2e0cea75295944f4 ]
An experimental test with the command below gives this error:rk3188-bqedison2qc.dt.yaml: dwmmc@10218000: wifi@1:
'reg' is a required property
So fix this by adding a reg property to the brcmf sub node. Also add #address-cells and #size-cells to prevent more warnings.
make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm/boot/dts/rk3188-bqedison2qc.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/rk3188-bqedison2qc.dts +3 -0
@@ -466,9 +466,12 @@ pinctrl-names = "default"; pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_bus4>; vmmcq-supply = <&vccio_wl>; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio3>; interrupts = <RK_PD2 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 240/399 ALSA: usb-audio: Add boot quirk for MOTU M Series
In reply to Greg Kroah-HartmanFrom: Alexander Tsoy <[email protected]>
[ Upstream commit 73ac9f5e5b43a5dbadb61f27dae7a971f7ec0d22 ]
Add delay to make sure that audio urbs are not sent too early. Otherwise the device hangs. Windows driver makes ~2s delay, so use about the same time delay value.
snd_usb_apply_boot_quirk() is called 3 times for my MOTU M4, which is an overkill. Thus a quirk that is called only once is implemented.
Also send two vendor-specific control messages before and after the delay. This behaviour is blindly copied from the Windows driver.
--- sound/usb/card.c | 4 ++++ sound/usb/quirks.c | 38 ++++++++++++++++++++++++++++++++++++++ sound/usb/quirks.h | 5 +++++ 3 files changed, 47 insertions(+)
sound/usb/card.c +4 -0
@@ -600,6 +600,10 @@ static int usb_audio_probe(struct usb_interface *intf, } }if (! chip) { + err =snd_usb_apply_boot_quirk_once (dev, intf, quirk, id); +if (err <0 ) +return err; +/* it's a fresh one. * now look for an empty slot and create a new card instance */
sound/usb/quirks.c +38 -0
@@ -1113,6 +1113,31 @@ free_buf:return err; } +static int snd_usb_motu_m_series_boot_quirk (struct usb_device *dev) +{ +int ret; + +if (snd_usb_pipe_sanity_check (dev,usb_sndctrlpipe (dev,0 ))) +return -EINVAL ; + ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), +1 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE , +0x0 ,0 ,NULL ,0 ,1000 ); + +if (ret <0 ) +return ret; + +msleep (2000 ); + + ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), +1 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE , +0x20 ,0 ,NULL ,0 ,1000 ); + +if (ret <0 ) +return ret; + +return 0 ; +} +/* * Setup quirks */
@@ -1297,6 +1322,19 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,return 0 ; } +int snd_usb_apply_boot_quirk_once (struct usb_device *dev, +struct usb_interface *intf, +const struct snd_usb_audio_quirk *quirk, +unsigned int id) +{ +switch (id) { +case USB_ID (0x07fd ,0x0008 ):/* MOTU M Series */ +return snd_usb_motu_m_series_boot_quirk (dev); + } + +return 0 ; +} +/* * check if the device uses big-endian samples */
sound/usb/quirks.h +5 -0
@@ -20,6 +20,11 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,const struct snd_usb_audio_quirk *quirk, unsigned int usb_id); +int snd_usb_apply_boot_quirk_once (struct usb_device *dev, +struct usb_interface *intf, +const struct snd_usb_audio_quirk *quirk, +unsigned int usb_id); +void snd_usb_set_format_quirk (struct snd_usb_substream *subs,struct audioformat *fmt);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 241/399 ASoC: txx9: Remove unused rtd variable
In reply to Greg Kroah-HartmanFrom: Paul Burton <[email protected]>
[ Upstream commit ec0f6a4c4a987aa20b2e77e0db2ae555276e45e6 ]
Commit a857e073ffc6 ("ASoC: txx9: txx9aclc: remove snd_pcm_ops") removed the last use of the rtd variable but didn't remove its definition, leading to the following warning/error for MIPS rbtx49xx_defconfig builds:
sound/soc/txx9/txx9aclc.c: In function 'txx9aclc_pcm_hw_params':sound/soc/txx9/txx9aclc.c:54:30: error: unused variable 'rtd'
[-Werror=unused-variable]
struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream);
^~~Resolve this by removing the unused variable.
--- sound/soc/txx9/txx9aclc.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/txx9/txx9aclc.c +0 -1
@@ -51,7 +51,6 @@ static int txx9aclc_pcm_hw_params(struct snd_soc_component *component,struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { - struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime;struct txx9aclc_dmadata *dmadata = runtime->private_data;int ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 242/399 ASoC: atmel: fix build error with CONFIG_SND_ATMEL_SOC_DMA=m
In reply to Greg Kroah-HartmanFrom: Chen Zhou <[email protected]>
[ Upstream commit 8fea78029f5e6ed734ae1957bef23cfda1af4354 ]
If CONFIG_SND_ATMEL_SOC_DMA=m, build error:
sound/soc/atmel/atmel_ssc_dai.o: In function `atmel_ssc_set_audio':
(.text+0x7cd): undefined reference to `atmel_pcm_dma_platform_register'
Function atmel_pcm_dma_platform_register is defined under CONFIG SND_ATMEL_SOC_DMA, so select SND_ATMEL_SOC_DMA in CONFIG SND_ATMEL_SOC_SSC, same to CONFIG_SND_ATMEL_SOC_PDC.
--- sound/soc/atmel/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/atmel/Kconfig +2 -0
@@ -19,6 +19,8 @@ config SND_ATMEL_SOC_DMA config SND_ATMEL_SOC_SSC tristate + select SND_ATMEL_SOC_DMA + select SND_ATMEL_SOC_PDC config SND_ATMEL_SOC_SSC_PDC tristate "SoC PCM DAI support for AT91 SSC controller using PDC"
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 243/399 raid6/test: fix a compilation warning
In reply to Greg Kroah-HartmanFrom: Zhengyuan Liu <[email protected]>
[ Upstream commit 5e5ac01c2b8802921fee680518a986011cb59820 ]
The compilation warning is redefination showed as following:
In file included from tables.c:2:
../../../include/linux/export.h:180: warning: "EXPORT_SYMBOL" redefined
#define EXPORT_SYMBOL(sym) __EXPORT_SYMBOL(sym, "")
In file included from tables.c:1:
../../../include/linux/raid/pq.h:61: note: this is the location of the previous definition
#define EXPORT_SYMBOL(sym)
--- include/linux/raid/pq.h | 2 ++ lib/raid6/mktables.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/raid/pq.h +2 -0
@@ -58,7 +58,9 @@ extern const char raid6_empty_zero_page[PAGE_SIZE];#define enable_kernel_altivec ()#define disable_kernel_altivec () +#undef EXPORT_SYMBOL#define EXPORT_SYMBOL (sym) +#undef EXPORT_SYMBOL_GPL#define EXPORT_SYMBOL_GPL (sym)#define MODULE_LICENSE (licence)#define MODULE_DESCRIPTION (desc)
lib/raid6/mktables.c +1 -1
@@ -56,8 +56,8 @@ int main(int argc, char *argv[])uint8_t v;uint8_t exptbl[256 ], invtbl[256 ]; -printf ("#include <linux/raid/pq.h>\n" );printf ("#include <linux/export.h>\n" ); +printf ("#include <linux/raid/pq.h>\n" );/* Compute multiplication table */ printf("\nconst u8 __attribute__((aligned(256)))\n"
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 244/399 RDMA/uverbs: Remove needs_kfree_rcu from uverbs_obj_type_class
In reply to Greg Kroah-HartmanFrom: Jason Gunthorpe <[email protected]>
[ Upstream commit 8bdf9dd984c18375d1090ddeb1792511f619c5c1 ]
After device disassociation the uapi_objects are destroyed and freed, however it is still possible that core code can be holding a kref on the uobject. When it finally goes to uverbs_uobject_free() via the kref_put() it can trigger a use-after-free on the uapi_object.
Since needs_kfree_rcu is a micro optimization that only benefits file uobjects, just get rid of it. There is no harm in using kfree_rcu even if it isn't required, and the number of involved objects is small.
--- drivers/infiniband/core/rdma_core.c | 23 +---------------------- include/rdma/uverbs_types.h | 1 - 2 files changed, 1 insertion(+), 23 deletions(-)
drivers/infiniband/core/rdma_core.c +1 -22
@@ -49,13 +49,7 @@ void uverbs_uobject_get(struct ib_uobject *uobject)static void uverbs_uobject_free (struct kref *ref) { -struct ib_uobject *uobj = - container_of(ref, struct ib_uobject, ref); - -if (uobj->uapi_object->type_class->needs_kfree_rcu) -kfree_rcu (uobj, rcu); -else -kfree (uobj); + kfree_rcu(container_of(ref, struct ib_uobject, ref), rcu); }void uverbs_uobject_put (struct ib_uobject *uobject)
@@ -744,20 +738,6 @@ const struct uverbs_obj_type_class uverbs_idr_class = { .lookup_put = lookup_put_idr_uobject, .destroy_hw = destroy_hw_idr_uobject, .remove_handle = remove_handle_idr_uobject, -/* -* When we destroy an object, we first just lock it for WRITE and -* actually DESTROY it in the finalize stage. So, the problematic -* scenario is when we just started the finalize stage of the -* destruction (nothing was executed yet). Now, the other thread -* fetched the object for READ access, but it didn't lock it yet. -* The DESTROY thread continues and starts destroying the object. -* When the other thread continue - without the RCU, it would -* access freed memory. However, the rcu_read_lock delays the free -* until the rcu_read_lock of the READ operation quits. Since the -* exclusive lock of the object is still taken by the DESTROY flow, the -* READ operation will get -EBUSY and it'll just bail out. -*/ - .needs_kfree_rcu = true, };EXPORT_SYMBOL (uverbs_idr_class);
@@ -920,7 +900,6 @@ const struct uverbs_obj_type_class uverbs_fd_class = { .lookup_put = lookup_put_fd_uobject, .destroy_hw = destroy_hw_fd_uobject, .remove_handle = remove_handle_fd_uobject, - .needs_kfree_rcu = false, };EXPORT_SYMBOL (uverbs_fd_class);
include/rdma/uverbs_types.h +0 -1
@@ -98,7 +98,6 @@ struct uverbs_obj_type_class {enum rdma_remove_reason why, struct uverbs_attr_bundle *attrs);void (*remove_handle)(struct ib_uobject *uobj); -u8 needs_kfree_rcu; };struct uverbs_obj_type {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 245/399 tty: synclinkmp: Adjust indentation in several functions
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 1feedf61e7265128244f6993f23421f33dd93dbc ]
Clang warns:
../drivers/tty/synclinkmp.c:1456:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (C_CRTSCTS(tty)) {
^
../drivers/tty/synclinkmp.c:1453:2: note: previous statement is here
if (I_IXOFF(tty))
^
../drivers/tty/synclinkmp.c:2473:8: warning: misleading indentation;
statement is not part of the previous 'if' [-Wmisleading-indentation]
info->port.tty->hw_stopped = 0;
^../drivers/tty/synclinkmp.c:2471:7: note: previous statement is here
if ( debug_level >= DEBUG_LEVEL_ISR ) ^../drivers/tty/synclinkmp.c:2482:8: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
info->port.tty->hw_stopped = 1;
^../drivers/tty/synclinkmp.c:2480:7: note: previous statement is here
if ( debug_level >= DEBUG_LEVEL_ISR ) ^../drivers/tty/synclinkmp.c:2809:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
^
../drivers/tty/synclinkmp.c:2807:2: note: previous statement is here
if (I_INPCK(info->port.tty))
^
../drivers/tty/synclinkmp.c:3246:3: warning: misleading indentation;
statement is not part of the previous 'else' [-Wmisleading-indentation]
set_signals(info);
^
../drivers/tty/synclinkmp.c:3244:2: note: previous statement is here
else
^5 warnings generated.
The indentation on these lines is not at all consistent, tabs and spaces are mixed together. Convert to just using tabs to be consistent with the Linux kernel coding style and eliminate these warnings from clang.
--- drivers/tty/synclinkmp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/tty/synclinkmp.c +12 -12
@@ -1453,10 +1453,10 @@ static void throttle(struct tty_struct * tty)if (I_IXOFF (tty))send_xchar (tty,STOP_CHAR (tty)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->serial_signals &= ~SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -1482,10 +1482,10 @@ static void unthrottle(struct tty_struct * tty)send_xchar (tty,START_CHAR (tty)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->serial_signals |= SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -2470,7 +2470,7 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )if (status & SerialSignal_CTS) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx start..." ); - info->port.tty->hw_stopped =0 ; + info->port.tty->hw_stopped =0 ;tx_start (info); info->pending_bh |=BH_TRANSMIT ;return ;
@@ -2479,7 +2479,7 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )if (!(status & SerialSignal_CTS)) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx stop..." ); - info->port.tty->hw_stopped =1 ; + info->port.tty->hw_stopped =1 ;tx_stop (info); } }
@@ -2806,8 +2806,8 @@ static void change_params(SLMP_INFO *info) info->read_status_mask2 =OVRN ;if (I_INPCK (info->port.tty)) info->read_status_mask2 |=PE |FRME ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) - info->read_status_mask1 |=BRKD ; +if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) + info->read_status_mask1 |=BRKD ;if (I_IGNPAR (info->port.tty)) info->ignore_status_mask2 |=PE |FRME ;if (I_IGNBRK (info->port.tty)) {
@@ -3177,7 +3177,7 @@ static int tiocmget(struct tty_struct *tty)unsigned long flags;spin_lock_irqsave (&info->lock,flags); -get_signals (info); +get_signals (info);spin_unlock_irqrestore (&info->lock,flags); result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS : 0) |
@@ -3215,7 +3215,7 @@ static int tiocmset(struct tty_struct *tty, info->serial_signals &= ~SerialSignal_DTR;spin_lock_irqsave (&info->lock,flags); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags);return 0 ;
@@ -3227,7 +3227,7 @@ static int carrier_raised(struct tty_port *port)unsigned long flags;spin_lock_irqsave (&info->lock,flags); -get_signals (info); +get_signals (info);spin_unlock_irqrestore (&info->lock,flags);return (info->serial_signals & SerialSignal_DCD) ?1 :0 ;
@@ -3243,7 +3243,7 @@ static void dtr_rts(struct tty_port *port, int on) info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; else info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 246/399 tty: synclink_gt: Adjust indentation in several functions
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 446e76873b5e4e70bdee5db2f2a894d5b4a7d081 ]
Clang warns:
../drivers/tty/synclink_gt.c:1337:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (C_CRTSCTS(tty)) {
^
../drivers/tty/synclink_gt.c:1335:2: note: previous statement is here
if (I_IXOFF(tty))
^
../drivers/tty/synclink_gt.c:2563:3: warning: misleading indentation;
statement is not part of the previous 'if' [-Wmisleading-indentation]
if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
^
../drivers/tty/synclink_gt.c:2561:2: note: previous statement is here
if (I_INPCK(info->port.tty))
^
../drivers/tty/synclink_gt.c:3221:3: warning: misleading indentation;
statement is not part of the previous 'else' [-Wmisleading-indentation]
set_signals(info);
^
../drivers/tty/synclink_gt.c:3219:2: note: previous statement is here
else
^3 warnings generated.
The indentation on these lines is not at all consistent, tabs and spaces are mixed together. Convert to just using tabs to be consistent with the Linux kernel coding style and eliminate these warnings from clang.
--- drivers/tty/synclink_gt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/tty/synclink_gt.c +9 -9
@@ -1334,10 +1334,10 @@ static void throttle(struct tty_struct * tty)DBGINFO (("%s throttle\n" , info->device_name));if (I_IXOFF (tty))send_xchar (tty,STOP_CHAR (tty)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->signals &= ~SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -1359,10 +1359,10 @@ static void unthrottle(struct tty_struct * tty)else send_xchar (tty,START_CHAR (tty)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->signals |= SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -2560,8 +2560,8 @@ static void change_params(struct slgt_info *info) info->read_status_mask =IRQ_RXOVER ;if (I_INPCK (info->port.tty)) info->read_status_mask |=MASK_PARITY |MASK_FRAMING ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) - info->read_status_mask |=MASK_BREAK ; +if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) + info->read_status_mask |=MASK_BREAK ;if (I_IGNPAR (info->port.tty)) info->ignore_status_mask |=MASK_PARITY |MASK_FRAMING ;if (I_IGNBRK (info->port.tty)) {
@@ -3192,7 +3192,7 @@ static int tiocmset(struct tty_struct *tty, info->signals &= ~SerialSignal_DTR;spin_lock_irqsave (&info->lock,flags); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags);return 0 ; }
@@ -3203,7 +3203,7 @@ static int carrier_raised(struct tty_port *port) struct slgt_info *info = container_of(port, struct slgt_info, port);spin_lock_irqsave (&info->lock,flags); -get_signals (info); +get_signals (info);spin_unlock_irqrestore (&info->lock,flags);return (info->signals & SerialSignal_DCD) ?1 :0 ; }
@@ -3218,7 +3218,7 @@ static void dtr_rts(struct tty_port *port, int on) info->signals |= SerialSignal_RTS | SerialSignal_DTR; else info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 247/399 bus: fsl-mc: properly empty-initialize structure
In reply to Greg Kroah-HartmanFrom: Ioana Ciornei <[email protected]>
[ Upstream commit cff081ea9d0962defd733daf6778f62b1dac3daa ]
Use the proper form of the empty initializer when working with structures that contain an array. Otherwise, older gcc versions (eg gcc 4.9) will complain about this.
--- drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/bus/fsl-mc/fsl-mc-bus.c +3 -3
@@ -715,9 +715,9 @@ EXPORT_SYMBOL_GPL(fsl_mc_device_remove);struct fsl_mc_device *fsl_mc_get_endpoint (struct fsl_mc_device *mc_dev) {struct fsl_mc_device *mc_bus_dev, *endpoint; -struct fsl_mc_obj_desc endpoint_desc = {0 }; -struct dprc_endpoint endpoint1 = {0 }; -struct dprc_endpoint endpoint2 = {0 }; +struct fsl_mc_obj_desc endpoint_desc = {{0 }}; +struct dprc_endpoint endpoint1 = {{0 }}; +struct dprc_endpoint endpoint2 = {{0 }};int state, err; mc_bus_dev =to_fsl_mc_device (mc_dev->dev.parent);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 248/399 misc: xilinx_sdfec: fix xsdfec_poll()s return type
In reply to Greg Kroah-HartmanFrom: Luc Van Oostenryck <[email protected]>
[ Upstream commit fa4e7fc1386078edcfddd8848cb0374f4af74fe7 ]
xsdfec_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type.
Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t.
--- drivers/misc/xilinx_sdfec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/misc/xilinx_sdfec.c +5 -5
@@ -1025,25 +1025,25 @@ static long xsdfec_dev_compat_ioctl(struct file *file, unsigned int cmd, }#endif -static unsigned int xsdfec_poll (struct file *file,poll_table *wait) +static __poll_t xsdfec_poll (struct file *file,poll_table *wait) { -unsigned int mask =0 ; +__poll_t mask =0 ;struct xsdfec_dev *xsdfec; xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev);if (!xsdfec) -return POLLNVAL |POLLHUP ; +return EPOLLNVAL |EPOLLHUP ;poll_wait (file, &xsdfec->waitq, wait);/* XSDFEC ISR detected an error */ spin_lock_irqsave (&xsdfec->error_data_lock, xsdfec->flags);if (xsdfec->state_updated) - mask |=POLLIN |POLLPRI ; + mask |=EPOLLIN |EPOLLPRI ;if (xsdfec->stats_updated) - mask |=POLLIN |POLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ;spin_unlock_irqrestore (&xsdfec->error_data_lock, xsdfec->flags);return mask;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 249/399 visorbus: fix uninitialized variable access
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit caf82f727e69b647f09d57a1fc56e69d22a5f483 ]
The setup_crash_devices_work_queue function only partially initializes the message it sends to chipset_init, leading to undefined behavior:
drivers/visorbus/visorchipset.c: In function 'setup_crash_devices_work_queue':drivers/visorbus/visorchipset.c:333:6: error: '((unsigned char*)&msg.hdr.flags)[0]' is used uninitialized in this function [-Werror=uninitialized]
if (inmsg->hdr.flags.response_expected)
Set up the entire structure, zero-initializing the 'response_expected' flag.
This was apparently found by the patch that added the -O3 build option in Kconfig.
--- drivers/visorbus/visorchipset.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/visorbus/visorchipset.c +7 -4
@@ -1210,14 +1210,17 @@ static void setup_crash_devices_work_queue(struct work_struct *work) {struct controlvm_message local_crash_bus_msg;struct controlvm_message local_crash_dev_msg; -struct controlvm_message msg; +struct controlvm_message msg = { + .hdr.id =CONTROLVM_CHIPSET_INIT , + .cmd.init_chipset = { + .bus_count =23 , + .switch_count =0 , + }, + };u32 local_crash_msg_offset;u16 local_crash_msg_count;/* send init chipset msg */ - msg.hdr.id =CONTROLVM_CHIPSET_INIT ; - msg.cmd.init_chipset.bus_count =23 ; - msg.cmd.init_chipset.switch_count =0 ;chipset_init (&msg);/* get saved message count */ if (visorchannel_read(chipset_dev->controlvm_channel,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 250/399 driver core: platform: Prevent resouce overflow from causing infinite loops
In reply to Greg Kroah-HartmanFrom: Simon Schwartz <[email protected]>
[ Upstream commit 39cc539f90d035a293240c9443af50be55ee81b8 ]
num_resources in the platform_device struct is declared as a u32. The for loops that iterate over num_resources use an int as the counter, which can cause infinite loops on architectures with smaller ints. Change the loop counters to u32.
--- drivers/base/platform.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/base/platform.c +6 -4
@@ -27,6 +27,7 @@#include <linux/limits.h> #include <linux/property.h> #include <linux/kmemleak.h> +#include <linux/types.h> #include "base.h" #include "power/power.h"
@@ -48,7 +49,7 @@ EXPORT_SYMBOL_GPL(platform_bus);struct resource *platform_get_resource (struct platform_device *dev,unsigned int type,unsigned int num) { -int i; +u32 i;for (i =0 ; i < dev->num_resources; i++) {struct resource *r = &dev->resource[i];
@@ -255,7 +256,7 @@ struct resource *platform_get_resource_byname(struct platform_device *dev,unsigned int type, const char *name) { - int i; + u32 i;for (i =0 ; i < dev->num_resources; i++) {struct resource *r = &dev->resource[i];
@@ -501,7 +502,8 @@ EXPORT_SYMBOL_GPL(platform_device_add_properties);*/ int platform_device_add (struct platform_device *pdev) { -int i, ret; +u32 i; +int ret;if (!pdev)return -EINVAL ;
@@ -590,7 +592,7 @@ EXPORT_SYMBOL_GPL(platform_device_add);*/ void platform_device_del (struct platform_device *pdev) { -int i; +u32 i;if (!IS_ERR_OR_NULL (pdev)) {device_del (&pdev->dev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 251/399 driver core: Print device when resources present in really_probe()
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7c35e699c88bd60734277b26962783c60e04b494 ]
If a device already has devres items attached before probing, a warning backtrace is printed. However, this backtrace does not reveal the offending device, leaving the user uninformed. Furthermore, using WARN_ON() causes systems with panic-on-warn to reboot.
Fix this by replacing the WARN_ON() by a dev_crit() message. Abort probing the device, to prevent doing more damage to the device's resources.
--- drivers/base/dd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/base/dd.c +4 -1
@@ -516,7 +516,10 @@ static int really_probe(struct device *dev, struct device_driver *drv)atomic_inc (&probe_count);pr_debug ("bus: '%s': %s: probing driver %s with device %s\n" , drv->bus->name, __func__, drv->name,dev_name (dev)); -WARN_ON (!list_empty (&dev->devres_head)); +if (!list_empty (&dev->devres_head)) { +dev_crit (dev,"Resources present before probing\n" ); +return -EBUSY ; + } re_probe: dev->driver = drv;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 252/399 ASoC: SOF: Intel: hda-dai: fix compilation warning in pcm_prepare
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit d873997192ddcacb5333575502be2f91ea4b47b8 ]
Fix GCC warning with W=1, previous cleanup did not remove unnecessary variable.
sound/soc/sof/intel/hda-dai.c: In function ‘hda_link_pcm_prepare’:
sound/soc/sof/intel/hda-dai.c:265:31: warning: variable ‘hda_stream’ set but not used [-Wunused-but-set-variable]
265 | struct sof_intel_hda_stream *hda_stream;
| ^~~~~~~~~~--- sound/soc/sof/intel/hda-dai.c | 3 --- 1 file changed, 3 deletions(-)
sound/soc/sof/intel/hda-dai.c +0 -3
@@ -261,14 +261,11 @@ static int hda_link_pcm_prepare(struct snd_pcm_substream *substream, {struct hdac_ext_stream *link_dev =snd_soc_dai_get_dma_data (dai, substream); -struct sof_intel_hda_stream *hda_stream;struct snd_sof_dev *sdev =snd_soc_component_get_drvdata (dai->component);struct snd_soc_pcm_runtime *rtd =snd_pcm_substream_chip (substream);int stream = substream->stream; - hda_stream =hstream_to_sof_hda_stream (link_dev); -if (link_dev->link_prepared)return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 253/399 bpf: Return -EBADRQC for invalid map type in __bpf_tx_xdp_map
In reply to Greg Kroah-HartmanFrom: Li RongQing <[email protected]>
[ Upstream commit 0a29275b6300f39f78a87f2038bbfe5bdbaeca47 ]
A negative value should be returned if map->map_type is invalid although that is impossible now, but if we run into such situation in future, then xdpbuff could be leaked.
Daniel Borkmann suggested:
-EBADRQC should be returned to stay consistent with generic XDP for the tracepoint output and not to be confused with -EOPNOTSUPP from other locations like dev_map_enqueue() when ndo_xdp_xmit is missing and such.
--- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/filter.c +1 -1
@@ -3543,7 +3543,7 @@ static int __bpf_tx_xdp_map(struct net_device *dev_rx, void *fwd,return err; }default : -break ; +return -EBADRQC ; }return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 254/399 vme: bridges: reduce stack usage
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 7483e7a939c074d887450ef1c4d9ccc5909405f8 ]
With CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3, the stack usage in vme_fake grows above the warning limit:
drivers/vme/bridges/vme_fake.c: In function 'fake_master_read':drivers/vme/bridges/vme_fake.c:610:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] drivers/vme/bridges/vme_fake.c: In function 'fake_master_write':drivers/vme/bridges/vme_fake.c:797:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
The problem is that in some configurations, each call to fake_vmereadX() puts another variable on the stack.
Reduce the amount of inlining to get back to the previous state, with no function using more than 200 bytes each.
--- drivers/vme/bridges/vme_fake.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/vme/bridges/vme_fake.c +18 -12
@@ -414,8 +414,9 @@ static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr, } } -static u8 fake_vmeread8 (struct fake_driver *bridge,unsigned long long addr, -u32 aspace,u32 cycle) +static noinline_for_stack u8 fake_vmeread8(struct fake_driver *bridge, +unsigned long long addr, +u32 aspace,u32 cycle) {u8 retval =0xff ;int i;
@@ -446,8 +447,9 @@ static u8 fake_vmeread8(struct fake_driver *bridge, unsigned long long addr,return retval; } -static u16 fake_vmeread16 (struct fake_driver *bridge,unsigned long long addr, -u32 aspace,u32 cycle) +static noinline_for_stack u16 fake_vmeread16(struct fake_driver *bridge, +unsigned long long addr, +u32 aspace,u32 cycle) {u16 retval =0xffff ;int i;
@@ -478,8 +480,9 @@ static u16 fake_vmeread16(struct fake_driver *bridge, unsigned long long addr,return retval; } -static u32 fake_vmeread32 (struct fake_driver *bridge,unsigned long long addr, -u32 aspace,u32 cycle) +static noinline_for_stack u32 fake_vmeread32(struct fake_driver *bridge, +unsigned long long addr, +u32 aspace,u32 cycle) {u32 retval =0xffffffff ;int i;
@@ -609,8 +612,9 @@ out:return retval; } -static void fake_vmewrite8 (struct fake_driver *bridge,u8 *buf, -unsigned long long addr,u32 aspace,u32 cycle) +static noinline_for_stack void fake_vmewrite8(struct fake_driver *bridge, +u8 *buf,unsigned long long addr, +u32 aspace,u32 cycle) {int i;unsigned long long start, end, offset;
@@ -639,8 +643,9 @@ static void fake_vmewrite8(struct fake_driver *bridge, u8 *buf, } -static void fake_vmewrite16 (struct fake_driver *bridge,u16 *buf, -unsigned long long addr,u32 aspace,u32 cycle) +static noinline_for_stack void fake_vmewrite16(struct fake_driver *bridge, +u16 *buf,unsigned long long addr, +u32 aspace,u32 cycle) {int i;unsigned long long start, end, offset;
@@ -669,8 +674,9 @@ static void fake_vmewrite16(struct fake_driver *bridge, u16 *buf, } -static void fake_vmewrite32 (struct fake_driver *bridge,u32 *buf, -unsigned long long addr,u32 aspace,u32 cycle) +static noinline_for_stack void fake_vmewrite32(struct fake_driver *bridge, +u32 *buf,unsigned long long addr, +u32 aspace,u32 cycle) {int i;unsigned long long start, end, offset;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 255/399 MIPS: ralink: dts: gardena_smart_gateway_mt7688: Limit UART1
In reply to Greg Kroah-HartmanFrom: Reto Schneider <[email protected]>
[ Upstream commit e8c192011c920517e5578d51c7aff0ecadd25de3 ]
The radio module asserts CTS when its RX buffer has 10 bytes left. Putting just 8 instead of 16 bytes into the UART1 TX buffer on the Linux side ensures to not overflow the RX buffer on the radio module side.
--- arch/mips/boot/dts/ralink/gardena_smart_gateway_mt7688.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/mips/boot/dts/ralink/gardena_smart_gateway_mt7688.dts +3 -0
@@ -177,6 +177,9 @@ pinctrl-names = "default"; pinctrl-0 = <&pinmux_i2s_gpio>; /* GPIO0..3 */ + fifo-size = <8>; + tx-threshold = <8>; + rts-gpios = <&gpio 1 GPIO_ACTIVE_LOW>; cts-gpios = <&gpio 2 GPIO_ACTIVE_LOW>; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 256/399 drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 3613a9bea95a1470dd42e4ed1cc7d86ebe0a2dc0 ]
We accidentally set "psb" which is a no-op instead of "*psb" so it generates a static checker warning. We should probably set it before the first error return so that it's always initialized.
--- drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c +2 -3
@@ -108,6 +108,7 @@ gm20b_secboot_new(struct nvkm_device *device, int index,struct gm200_secboot *gsb;struct nvkm_acr *acr; + *psb =NULL ; acr =acr_r352_new (BIT (NVKM_SECBOOT_FALCON_FECS ) |BIT (NVKM_SECBOOT_FALCON_PMU ));if (IS_ERR (acr))
@@ -116,10 +117,8 @@ gm20b_secboot_new(struct nvkm_device *device, int index, acr->optional_falcons =BIT (NVKM_SECBOOT_FALCON_PMU ); gsb =kzalloc (sizeof (*gsb),GFP_KERNEL ); -if (!gsb) { - psb =NULL ; +if (!gsb)return -ENOMEM ; - } *psb = &gsb->base; ret =nvkm_secboot_ctor (&gm20b_secboot, acr, device, index, &gsb->base);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 257/399 drm/nouveau/gr/gk20a,gm200-: add terminators to method lists read from fw
In reply to Greg Kroah-HartmanFrom: Ben Skeggs <[email protected]>
[ Upstream commit 7adc77aa0e11f25b0e762859219c70852cd8d56f ]
Method init is typically ordered by class in the FW image as ThreeD, TwoD, Compute.
Due to a bug in parsing the FW into our internal format, we've been accidentally sending Twod + Compute methods to the ThreeD class, as well as Compute methods to the TwoD class - oops.
--- .../gpu/drm/nouveau/nvkm/engine/gr/gk20a.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c +11 -10
@@ -143,23 +143,24 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name, nent = (fuc.size /sizeof (struct gk20a_fw_av )); - pack =vzalloc ((sizeof (*pack) * max_classes) + - (sizeof (*init) * (nent +1 ))); + pack =vzalloc ((sizeof (*pack) * (max_classes +1 )) + + (sizeof (*init) * (nent + max_classes +1 )));if (!pack) { ret = -ENOMEM ; goto end; } - init = (void *)(pack + max_classes); + init = (void *)(pack + max_classes +1 ); -for (i =0 ; i < nent; i++) { -struct gf100_gr_init *ent = &init[i]; +for (i =0 ; i < nent; i++, init++) {struct gk20a_fw_av *av = &((struct gk20a_fw_av *)fuc.data)[i];u32 class = av->addr &0xffff ;u32 addr = (av->addr &0xffff0000 ) >>14 ;if (prevclass != class) { - pack[classidx].init = ent; +if (prevclass)/* Add terminator to the method list. */ + init++; + pack[classidx].init = init; pack[classidx].type = class; prevclass = class;if (++classidx >= max_classes) {
@@ -169,10 +170,10 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name, } } - ent->addr = addr; - ent->data = av->data; - ent->count =1 ; - ent->pitch =1 ; + init->addr = addr; + init->data = av->data; + init->count =1 ; + init->pitch =1 ; } *ppack = pack;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 258/399 drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit 1eb013473bff5f95b6fe1ca4dd7deda47257b9c2 ]
Like other cases, it should use rcu protected 'chan' rather than 'fence->channel' in nouveau_fence_wait_uevent_handler.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
@@ -156,7 +156,7 @@ nouveau_fence_wait_uevent_handler(struct nvif_notify *notify) fence =list_entry (fctx->pending.next,typeof (*fence), head); chan =rcu_dereference_protected (fence->channel,lockdep_is_held (&fctx->lock)); -if (nouveau_fence_update (fence->channel, fctx)) +if (nouveau_fence_update (chan, fctx)) ret =NVIF_NOTIFY_DROP ; }spin_unlock_irqrestore (&fctx->lock, flags);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 259/399 drm/nouveau/drm/ttm: Remove set but not used variable mem
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit 2e4534a22794746b11a794b2229b8d58797eccce ]
drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_vram_manager_new:drivers/gpu/drm/nouveau/nouveau_ttm.c:66:22: warning: variable mem set but not used [-Wunused-but-set-variable] drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_gart_manager_new:drivers/gpu/drm/nouveau/nouveau_ttm.c:106:22: warning: variable mem set but not used [-Wunused-but-set-variable]
They are not used any more, so remove it.
--- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/nouveau/nouveau_ttm.c +0 -4
@@ -63,14 +63,12 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, {struct nouveau_bo *nvbo =nouveau_bo (bo);struct nouveau_drm *drm =nouveau_bdev (bo->bdev); -struct nouveau_mem *mem;int ret;if (drm->client.device.info.ram_size ==0 )return -ENOMEM ; ret =nouveau_mem_new (&drm->master, nvbo->kind, nvbo->comp, reg); - mem =nouveau_mem (reg);if (ret)return ret;
@@ -103,11 +101,9 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, {struct nouveau_bo *nvbo =nouveau_bo (bo);struct nouveau_drm *drm =nouveau_bdev (bo->bdev); -struct nouveau_mem *mem;int ret; ret =nouveau_mem_new (&drm->master, nvbo->kind, nvbo->comp, reg); - mem =nouveau_mem (reg);if (ret)return ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 260/399 drm/nouveau/fault/gv100-: fix memory leak on module unload
In reply to Greg Kroah-HartmanFrom: Ben Skeggs <[email protected]>
[ Upstream commit 633cc9beeb6f9b5fa2f17a2a9d0e2790cb6c3de7 ]
--- drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c +1 -0
@@ -146,6 +146,7 @@ nvkm_fault_dtor(struct nvkm_subdev *subdev)struct nvkm_fault *fault =nvkm_fault (subdev);int i; +nvkm_notify_fini (&fault->nrpfb);nvkm_event_fini (&fault->event);for (i =0 ; i < fault->buffer_nr; i++) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 261/399 dm thin: dont allow changing data device during thin-pool reload
In reply to Greg Kroah-HartmanFrom: Mikulas Patocka <[email protected]>
[ Upstream commit 873937e75f9a8ea231a502c3d29d9cb6ad91b3ef ]
The existing code allows changing the data device when the thin-pool target is reloaded.
This capability is not required and only complicates device lifetime guarantees. This can cause crashes like the one reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=1788596
where the kernel tries to issue a flush bio located in a structure that was already freed.
Take the first step to simplifying the thin-pool's data device lifetime by disallowing changing it. Like the thin-pool's metadata device, the data device is now set in pool_create() and it cannot be changed for a given thin-pool.
--- drivers/md/dm-thin.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/md/dm-thin.c +13 -5
@@ -231,6 +231,7 @@ struct pool {struct dm_target *ti;/* Only set if a pool target is bound */ struct mapped_device *pool_md; +struct block_device *data_dev;struct block_device *md_dev;struct dm_pool_metadata *pmd;
@@ -2933,6 +2934,7 @@ static struct kmem_cache *_new_mapping_cache;static struct pool *pool_create (struct mapped_device *pool_md,struct block_device *metadata_dev, +struct block_device *data_dev,unsigned long block_size,int read_only,char **error) {
@@ -3040,6 +3042,7 @@ static struct pool *pool_create(struct mapped_device *pool_md, pool->last_commit_jiffies = jiffies; pool->pool_md = pool_md; pool->md_dev = metadata_dev; + pool->data_dev = data_dev;__pool_table_insert (pool);return pool;
@@ -3081,6 +3084,7 @@ static void __pool_dec(struct pool *pool)static struct pool *__pool_find (struct mapped_device *pool_md,struct block_device *metadata_dev, +struct block_device *data_dev,unsigned long block_size,int read_only,char **error,int *created) {
@@ -3091,19 +3095,23 @@ static struct pool *__pool_find(struct mapped_device *pool_md, *error ="metadata device already in use by a pool" ;return ERR_PTR (-EBUSY ); } +if (pool->data_dev != data_dev) { + *error ="data device already in use by a pool" ; +return ERR_PTR (-EBUSY ); + }__pool_inc (pool); }else { pool =__pool_table_lookup (pool_md);if (pool) { -if (pool->md_dev != metadata_dev) { +if (pool->md_dev != metadata_dev || pool->data_dev != data_dev) { *error ="different pool cannot replace a pool" ;return ERR_PTR (-EINVAL ); }__pool_inc (pool); }else { - pool =pool_create (pool_md, metadata_dev, block_size, read_only, error); + pool =pool_create (pool_md, metadata_dev, data_dev, block_size, read_only, error); *created =1 ; } }
@@ -3356,7 +3364,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) goto out; } - pool =__pool_find (dm_table_get_md (ti->table), metadata_dev->bdev, + pool =__pool_find (dm_table_get_md (ti->table), metadata_dev->bdev, data_dev->bdev, block_size, pf.mode ==PM_READ_ONLY , &ti->error, &pool_created);if (IS_ERR (pool)) { r =PTR_ERR (pool);
@@ -4098,7 +4106,7 @@ static struct target_type pool_target = { .name = "thin-pool", .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE | DM_TARGET_IMMUTABLE, - .version = {1, 21, 0}, + .version = {1, 22, 0}, .module = THIS_MODULE, .ctr = pool_ctr, .dtr = pool_dtr,
@@ -4475,7 +4483,7 @@ static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)static struct target_type thin_target = { .name ="thin" , - .version = {1 ,21 ,0 }, + .version = {1 ,22 ,0 }, .module =THIS_MODULE , .ctr = thin_ctr, .dtr = thin_dtr,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 262/399 gpiolib: Set lockdep class for hierarchical irq domains
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit c34f6dc8c9e6bbe9fba1d53acd6d9a3889599da3 ]
I see the following lockdep splat in the qcom pinctrl driver when attempting to suspend the device.
============================================
WARNING: possible recursive locking detected
5.4.2 #2 Tainted: G S
--------------------------------------------
cat/6536 is trying to acquire lock:
ffffff814787ccc0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
but task is already holding lock:
ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
---- lock(&irq_desc_lock_class);
lock(&irq_desc_lock_class);
*** DEADLOCK ***
May be due to missing lock nesting notation
7 locks held by cat/6536:
#0: ffffff8140e0c420 (sb_writers#7){.+.+}, at: vfs_write+0xc8/0x19c #1: ffffff8121eec480 (&of->mutex){+.+.}, at: kernfs_fop_write+0x128/0x1f4 #2: ffffff8147cad668 (kn->count#263){.+.+}, at: kernfs_fop_write+0x130/0x1f4 #3: ffffffd011446000 (system_transition_mutex){+.+.}, at: pm_suspend+0x108/0x354 #4: ffffff814302b970 (&dev->mutex){....}, at: __device_suspend+0x16c/0x420 #5: ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94 #6: ffffff81479b8c10 (&pctrl->lock){....}, at: msm_gpio_irq_set_wake+0x48/0x7c
stack backtrace: CPU: 4 PID: 6536 Comm: cat Tainted: G S 5.4.2 #2 Call trace: dump_backtrace+0x0/0x174 show_stack+0x20/0x2c dump_stack+0xdc/0x144 __lock_acquire+0x52c/0x2268 lock_acquire+0x1dc/0x220 _raw_spin_lock_irqsave+0x64/0x80 __irq_get_desc_lock+0x64/0x94 irq_set_irq_wake+0x40/0x144 msm_gpio_irq_set_wake+0x5c/0x7c set_irq_wake_real+0x40/0x5c irq_set_irq_wake+0x70/0x144 cros_ec_rtc_suspend+0x38/0x4c platform_pm_suspend+0x34/0x60 dpm_run_callback+0x64/0xcc __device_suspend+0x314/0x420 dpm_suspend+0xf8/0x298 dpm_suspend_start+0x84/0xb4 suspend_devices_and_enter+0xbc/0x628 pm_suspend+0x214/0x354 state_store+0xb0/0x108 kobj_attr_store+0x14/0x24 sysfs_kf_write+0x4c/0x64 kernfs_fop_write+0x158/0x1f4 __vfs_write+0x54/0x18c vfs_write+0xdc/0x19c ksys_write+0x7c/0xe4 __arm64_sys_write+0x20/0x2c el0_svc_common+0xa8/0x160 el0_svc_compat_handler+0x2c/0x38 el0_svc_compat+0x8/0x10
This is because the msm_gpio_irq_set_wake() function calls irq_set_irq_wake() as a backup in case the irq comes in during the path to idle. Given that we're calling irqchip functions from within an irqchip we need to set the lockdep class to be different for this child controller vs. the default one that the parent irqchip gets.
This used to be done before this driver was converted to hierarchical irq domains in commit e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy") via the gpiochip_irq_map() function. With hierarchical irq domains this function has been replaced by gpiochip_hierarchy_irq_domain_alloc(). Therefore, set the lockdep class like was done previously in the irq domain path so we can avoid this lockdep warning.
--- drivers/gpio/gpiolib.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib.c +1 -0
@@ -2053,6 +2053,7 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d, parent_type);chip_info (gc,"alloc_irqs_parent for %d parent hwirq %d\n" , irq, parent_hwirq); +irq_set_lockdep_class (irq, gc->irq.lock_key, gc->irq.request_key); ret =irq_domain_alloc_irqs_parent (d, irq,1 , &parent_fwspec);if (ret) chip_err(gc,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 263/399 drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
[ Upstream commit 40efb09a7f53125719e49864da008495e39aaa1e ]
In vmw_cmdbuf_res_add if drm_ht_insert_item fails the allocated memory for cres should be released.
--- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c +3 -1
@@ -209,8 +209,10 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man, cres->hash.key = user_key | (res_type <<24 ); ret =drm_ht_insert_item (&man->resources, &cres->hash); -if (unlikely (ret !=0 )) +if (unlikely (ret !=0 )) { +kfree (cres); goto out_invalid_key; + } cres->state =VMW_CMDBUF_RES_ADD ; cres->res =vmw_resource_reference (res);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 264/399 perf/imx_ddr: Fix cpu hotplug state cleanup
In reply to Greg Kroah-HartmanFrom: Leonard Crestez <[email protected]>
[ Upstream commit 9ee68b314e9aa63ed11b98beb8a68810b8234dcf ]
This driver allocates a dynamic cpu hotplug state but never releases it. If reloaded in a loop it will quickly trigger a WARN message:
"No more dynamic states available for CPU hotplug"
Fix by calling cpuhp_remove_multi_state on remove like several other perf pmu drivers.
Also fix the cleanup logic on probe error paths: add the missing cpuhp_remove_multi_state call and properly check the return value from cpuhp_state_add_instant_nocalls.
--- drivers/perf/fsl_imx8_ddr_perf.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/perf/fsl_imx8_ddr_perf.c +11 -5
@@ -633,13 +633,17 @@ static int ddr_perf_probe(struct platform_device *pdev)if (ret <0 ) {dev_err (&pdev->dev,"cpuhp_setup_state_multi failed\n" ); - goto ddr_perf_err; + goto cpuhp_state_err; } pmu->cpuhp_state = ret;/* Register the pmu instance for cpu hotplug */ -cpuhp_state_add_instance_nocalls (pmu->cpuhp_state, &pmu->node); + ret =cpuhp_state_add_instance_nocalls (pmu->cpuhp_state, &pmu->node); +if (ret) { +dev_err (&pdev->dev,"Error %d registering hotplug\n" , ret); + goto cpuhp_instance_err; + }/* Request irq */ irq =of_irq_get (np,0 );
@@ -673,9 +677,10 @@ static int ddr_perf_probe(struct platform_device *pdev)return 0 ; ddr_perf_err: -if (pmu->cpuhp_state) -cpuhp_state_remove_instance_nocalls (pmu->cpuhp_state, &pmu->node); - +cpuhp_state_remove_instance_nocalls (pmu->cpuhp_state, &pmu->node); +cpuhp_instance_err: +cpuhp_remove_multi_state (pmu->cpuhp_state); +cpuhp_state_err:ida_simple_remove (&ddr_ida, pmu->id);dev_warn (&pdev->dev,"i.MX8 DDR Perf PMU failed (%d), disabled\n" , ret);return ret;
@@ -686,6 +691,7 @@ static int ddr_perf_remove(struct platform_device *pdev)struct ddr_pmu *pmu =platform_get_drvdata (pdev);cpuhp_state_remove_instance_nocalls (pmu->cpuhp_state, &pmu->node); +cpuhp_remove_multi_state (pmu->cpuhp_state);irq_set_affinity_hint (pmu->irq,NULL );perf_pmu_unregister (&pmu->pmu);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 265/399 usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 91b6dec32e5c25fbdbb564d1e5af23764ec17ef1 ]
We currently have musb_set_vbus() called from two different paths. Mostly it gets called from the USB PHY via omap_musb_set_mailbox(), but in some cases it can get also called from musb_stage0_irq() rather via .set_vbus:
(musb_set_host [musb_hdrc])
(omap2430_musb_set_vbus [omap2430])
(musb_stage0_irq [musb_hdrc])
(musb_interrupt [musb_hdrc])
(omap2430_musb_interrupt [omap2430])
This is racy and will not work with introducing generic helper functions for musb_set_host() and musb_set_peripheral(). We want to get rid of the busy loops in favor of usleep_range().
Let's just get rid of .set_vbus for omap2430 glue layer and let the PHY code handle VBUS with musb_set_vbus(). Note that in the follow-up patch we can completely remove omap2430_musb_set_vbus(), but let's do it in a separate patch as this change may actually turn out to be needed as a fix.
--- drivers/usb/musb/omap2430.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/musb/omap2430.c +0 -2
@@ -361,8 +361,6 @@ static const struct musb_platform_ops omap2430_ops = { .init = omap2430_musb_init, .exit = omap2430_musb_exit, - .set_vbus = omap2430_musb_set_vbus, - .enable = omap2430_musb_enable, .disable = omap2430_musb_disable,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 266/399 kbuild: remove *.tmp file when filechk fails
In reply to Greg Kroah-HartmanFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 88fe89a47153facd8cb2d06d5c8727f7224c43c2 ]
Bartosz Golaszewski reports that when "make {menu,n,g,x}config" fails due to missing packages, a temporary file is left over, which is not ignored by git.
For example, if GTK+ is not installed:
$ make gconfig
*
* Unable to find the GTK+ installation. Please make sure that
* the GTK+ 2.0 development package is correctly installed.
* You need gtk+-2.0 gmodule-2.0 libglade-2.0
*
scripts/kconfig/Makefile:208: recipe for target 'scripts/kconfig/gconf-cfg' failed
make[1]: *** [scripts/kconfig/gconf-cfg] Error 1
Makefile:567: recipe for target 'gconfig' failed
make: *** [gconfig] Error 2
$ git status
HEAD detached at v5.4
Untracked files:
(use "git add <file>..." to include in what will be committed) scripts/kconfig/gconf-cfg.tmp
nothing added to commit but untracked files present (use "git add" to track)
This is because the check scripts are run with filechk, which misses to clean up the temporary file on failure.
When the line
{ $(filechk_$(1)); } > [email protected];... fails, it exits immediately due to the 'set -e'. Use trap to make sure to delete the temporary file on exit.
For extra safety, I replaced [email protected] with $(dot-target).tmp to make it a hidden file.
--- scripts/Kbuild.include | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
scripts/Kbuild.include +7 -8
@@ -55,14 +55,13 @@ kecho := $($(quiet)kecho) # - stdin is piped in from the first prerequisite ($<) so one has # to specify a valid file as first prerequisite (often the kbuild file) define filechk - $(Q)set -e; \ - mkdir -p $(dir $@); \ - { $(filechk_$(1)); } > [email protected]; \ - if [ -r $@ ] && cmp -s $@ [email protected]; then \ - rm -f [email protected]; \ - else \ - $(kecho) ' UPD $@'; \ - mv -f [email protected] $@; \ + $(Q)set -e; \ + mkdir -p $(dir $@); \ + trap "rm -f $(dot-target).tmp" EXIT; \ + { $(filechk_$(1)); } > $(dot-target).tmp; \ + if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then \ + $(kecho) ' UPD $@'; \ + mv -f $(dot-target).tmp $@; \ fi endef
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 267/399 iommu/arm-smmu-v3: Use WRITE_ONCE() when changing validity of an STE
In reply to Greg Kroah-HartmanFrom: Will Deacon <[email protected]>
[ Upstream commit d71e01716b3606a6648df7e5646ae12c75babde4 ]
If, for some bizarre reason, the compiler decided to split up the write of STE DWORD 0, we could end up making a partial structure valid.
Although this probably won't happen, follow the example of the context-descriptor code and use WRITE_ONCE() to ensure atomicity of the write.
--- drivers/iommu/arm-smmu-v3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iommu/arm-smmu-v3.c +2 -1
@@ -1643,7 +1643,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_master *master, u32 sid, STRTAB_STE_1_EATS_TRANS));arm_smmu_sync_ste_for_sid (smmu, sid); - dst[0 ] =cpu_to_le64 (val); +/* See comment in arm_smmu_write_ctx_desc() */ +WRITE_ONCE (dst[0 ],cpu_to_le64 (val));arm_smmu_sync_ste_for_sid (smmu, sid);/* It's likely that we'll want to use the new STE soon */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 268/399 ALSA: usb-audio: unlock on error in probe
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit a3afa29942b84b4e2548beacccc3a68b8d77e3dc ]
We need to unlock before we returning on this error path.
--- sound/usb/card.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/card.c +1 -1
@@ -602,7 +602,7 @@ static int usb_audio_probe(struct usb_interface *intf,if (! chip) { err =snd_usb_apply_boot_quirk_once (dev, intf, quirk, id);if (err <0 ) -return err; + goto __error;/* it's a fresh one. * now look for an empty slot and create a new card instance
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 269/399 f2fs: set I_LINKABLE early to avoid wrong access by vfs
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
[ Upstream commit 5b1dbb082f196278f82b6a15a13848efacb9ff11 ]
This patch moves setting I_LINKABLE early in rename2(whiteout) to avoid the below warning.
[ 3189.163385] WARNING: CPU: 3 PID: 59523 at fs/inode.c:358 inc_nlink+0x32/0x40 [ 3189.246979] Call Trace: [ 3189.248707] f2fs_init_inode_metadata+0x2d6/0x440 [f2fs] [ 3189.251399] f2fs_add_inline_entry+0x162/0x8c0 [f2fs] [ 3189.254010] f2fs_add_dentry+0x69/0xe0 [f2fs] [ 3189.256353] f2fs_do_add_link+0xc5/0x100 [f2fs] [ 3189.258774] f2fs_rename2+0xabf/0x1010 [f2fs] [ 3189.261079] vfs_rename+0x3f8/0xaa0 [ 3189.263056] ? tomoyo_path_rename+0x44/0x60 [ 3189.265283] ? do_renameat2+0x49b/0x550 [ 3189.267324] do_renameat2+0x49b/0x550 [ 3189.269316] __x64_sys_renameat2+0x20/0x30 [ 3189.271441] do_syscall_64+0x5a/0x230 [ 3189.273410] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 3189.275848] RIP: 0033:0x7f270b4d9a49
--- fs/f2fs/namei.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-)
fs/f2fs/namei.c +13 -14
@@ -797,6 +797,7 @@ static int __f2fs_tmpfile(struct inode *dir, struct dentry *dentry,if (whiteout) {f2fs_i_links_write (inode, false); + inode->i_state |=I_LINKABLE ; *whiteout = inode; }else {d_tmpfile (dentry, inode);
@@ -867,6 +868,12 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, F2FS_I(old_dentry->d_inode)->i_projid)))return -EXDEV ; +if (flags &RENAME_WHITEOUT ) { + err =f2fs_create_whiteout (old_dir, &whiteout); +if (err) +return err; + } + err =dquot_initialize (old_dir);if (err) goto out;
@@ -898,17 +905,11 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, } } -if (flags &RENAME_WHITEOUT ) { - err =f2fs_create_whiteout (old_dir, &whiteout); -if (err) - goto out_dir; - } -if (new_inode) { err = -ENOTEMPTY ;if (old_dir_entry && !f2fs_empty_dir (new_inode)) - goto out_whiteout; + goto out_dir; err = -ENOENT ; new_entry = f2fs_find_entry(new_dir, &new_dentry->d_name,
@@ -916,7 +917,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,if (!new_entry) {if (IS_ERR (new_page)) err =PTR_ERR (new_page); - goto out_whiteout; + goto out_dir; }f2fs_balance_fs (sbi, true);
@@ -948,7 +949,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry, err =f2fs_add_link (new_dentry, old_inode);if (err) {f2fs_unlock_op (sbi); - goto out_whiteout; + goto out_dir; }if (old_dir_entry)
@@ -972,7 +973,7 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,if (IS_ERR (old_page)) err =PTR_ERR (old_page);f2fs_unlock_op (sbi); - goto out_whiteout; + goto out_dir; } } }
@@ -991,7 +992,6 @@ static int f2fs_rename(struct inode *old_dir, struct dentry *old_dentry,f2fs_delete_entry (old_entry, old_page, old_dir,NULL );if (whiteout) { - whiteout->i_state |=I_LINKABLE ;set_inode_flag (whiteout,FI_INC_LINK ); err =f2fs_add_link (old_dentry, whiteout);if (err)
@@ -1027,15 +1027,14 @@ put_out_dir:f2fs_unlock_op (sbi);if (new_page)f2fs_put_page (new_page,0 ); -out_whiteout: -if (whiteout) -iput (whiteout); out_dir:if (old_dir_entry)f2fs_put_page (old_dir_page,0 ); out_old:f2fs_put_page (old_page,0 ); out: +if (whiteout) +iput (whiteout);return err; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 270/399 f2fs: free sysfs kobject
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
[ Upstream commit 820d366736c949ffe698d3b3fe1266a91da1766d ]
Detected kmemleak.
--- fs/f2fs/sysfs.c | 1 + 1 file changed, 1 insertion(+)
fs/f2fs/sysfs.c +1 -0
@@ -786,4 +786,5 @@ void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi)remove_proc_entry (sbi->sb->s_id, f2fs_proc_root); }kobject_del (&sbi->s_kobj); +kobject_put (&sbi->s_kobj); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 271/399 scsi: ufs: pass device information to apply_dev_quirks
In reply to Greg Kroah-HartmanFrom: Stanley Chu <[email protected]>
[ Upstream commit c40ad6b7fcd35bc4d36db820c7737e1aa18d5d41 ]
Pass UFS device information to vendor-specific variant callback "apply_dev_quirks" because some platform vendors need to know such information to apply special handling or quirks in specific devices.
At the same time, modify existing vendor implementations according to the new interface for those vendor drivers which will be built-in or built as a module alone with UFS core driver.
[mkp: clarified commit desc]
--- drivers/scsi/ufs/ufs-qcom.c | 3 ++- drivers/scsi/ufs/ufshcd.c | 8 ++++---- drivers/scsi/ufs/ufshcd.h | 7 ++++--- 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/scsi/ufs/ufs-qcom.c +2 -1
@@ -949,7 +949,8 @@ out:return err; } -static int ufs_qcom_apply_dev_quirks (struct ufs_hba *hba) +static int ufs_qcom_apply_dev_quirks (struct ufs_hba *hba, +struct ufs_dev_desc *card) {int err =0 ;
drivers/scsi/ufs/ufshcd.c +4 -4
@@ -6798,7 +6798,8 @@ out:return ret; } -static void ufshcd_tune_unipro_params (struct ufs_hba *hba) +static void ufshcd_tune_unipro_params (struct ufs_hba *hba, +struct ufs_dev_desc *card) {if (ufshcd_is_unipro_pa_params_tuning_req (hba)) {ufshcd_tune_pa_tactivate (hba);
@@ -6812,7 +6813,7 @@ static void ufshcd_tune_unipro_params(struct ufs_hba *hba)if (hba->dev_quirks &UFS_DEVICE_QUIRK_HOST_PA_TACTIVATE )ufshcd_quirk_tune_host_pa_tactivate (hba); -ufshcd_vops_apply_dev_quirks (hba); +ufshcd_vops_apply_dev_quirks (hba, card); }static void ufshcd_clear_dbg_ufs_stats (struct ufs_hba *hba)
@@ -6975,10 +6976,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba) }ufs_fixup_device_setup (hba, &card); +ufshcd_tune_unipro_params (hba, &card);ufs_put_device_desc (&card); -ufshcd_tune_unipro_params (hba); -/* UFS device is also active now */ ufshcd_set_ufs_dev_active (hba);ufshcd_force_reset_auto_bkops (hba);
drivers/scsi/ufs/ufshcd.h +4 -3
@@ -322,7 +322,7 @@ struct ufs_hba_variant_ops {void (*setup_task_mgmt)(struct ufs_hba *,int ,u8 );void (*hibern8_notify)(struct ufs_hba *,enum uic_cmd_dme ,enum ufs_notify_change_status ); -int (*apply_dev_quirks)(struct ufs_hba *); +int (*apply_dev_quirks)(struct ufs_hba *,struct ufs_dev_desc *);int (*suspend)(struct ufs_hba *,enum ufs_pm_op );int (*resume)(struct ufs_hba *,enum ufs_pm_op );void (*dbg_register_dump)(struct ufs_hba *hba);
@@ -1057,10 +1057,11 @@ static inline void ufshcd_vops_hibern8_notify(struct ufs_hba *hba,return hba->vops->hibern8_notify (hba, cmd, status); } -static inline int ufshcd_vops_apply_dev_quirks (struct ufs_hba *hba) +static inline int ufshcd_vops_apply_dev_quirks (struct ufs_hba *hba, +struct ufs_dev_desc *card) {if (hba->vops && hba->vops->apply_dev_quirks) -return hba->vops->apply_dev_quirks (hba); +return hba->vops->apply_dev_quirks (hba, card);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 272/399 scsi: ufs-mediatek: add apply_dev_quirks variant operation
In reply to Greg Kroah-HartmanFrom: Stanley Chu <[email protected]>
[ Upstream commit ea92c32bd336efba89c5b09cf609e6e26e963796 ]
Add vendor-specific variant callback "apply_dev_quirks" to MediaTek UFS driver.
--- drivers/scsi/ufs/ufs-mediatek.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/scsi/ufs/ufs-mediatek.c +11 -0
@@ -13,6 +13,7 @@#include "ufshcd.h" #include "ufshcd-pltfrm.h" +#include "ufs_quirks.h" #include "unipro.h" #include "ufs-mediatek.h"
@@ -289,6 +290,15 @@ static int ufs_mtk_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)return 0 ; } +static int ufs_mtk_apply_dev_quirks (struct ufs_hba *hba, +struct ufs_dev_desc *card) +{ +if (card->wmanufacturerid ==UFS_VENDOR_SAMSUNG ) +ufshcd_dme_set (hba,UIC_ARG_MIB (PA_TACTIVATE ),6 ); + +return 0 ; +} +/** * struct ufs_hba_mtk_vops - UFS MTK specific variant operations *
@@ -301,6 +311,7 @@ static struct ufs_hba_variant_ops ufs_hba_mtk_vops = { .setup_clocks = ufs_mtk_setup_clocks, .link_startup_notify = ufs_mtk_link_startup_notify, .pwr_change_notify = ufs_mtk_pwr_change_notify, + .apply_dev_quirks = ufs_mtk_apply_dev_quirks, .suspend = ufs_mtk_suspend, .resume = ufs_mtk_resume, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 273/399 scsi: iscsi: Dont destroy session if there are outstanding connections
In reply to Greg Kroah-HartmanFrom: Nick Black <[email protected]>
[ Upstream commit 54155ed4199c7aa3fd20866648024ab63c96d579 ]
A faulty userspace that calls destroy_session() before destroying the connections can trigger the failure. This patch prevents the issue by refusing to destroy the session if there are outstanding connections.
------------[ cut here ]------------ kernel BUG at mm/slub.c:306! invalid opcode: 0000 [#1] SMP PTI CPU: 1 PID: 1224 Comm: iscsid Not tainted 5.4.0-rc2.iscsi+ #7 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 RIP: 0010:__slab_free+0x181/0x350 [...] [ 1209.686056] RSP: 0018:ffffa93d4074fae0 EFLAGS: 00010246 [ 1209.686694] RAX: ffff934efa5ad800 RBX: 000000008010000a RCX: ffff934efa5ad800 [ 1209.687651] RDX: ffff934efa5ad800 RSI: ffffeb4041e96b00 RDI: ffff934efd402c40 [ 1209.688582] RBP: ffffa93d4074fb80 R08: 0000000000000001 R09: ffffffffbb5dfa26 [ 1209.689425] R10: ffff934efa5ad800 R11: 0000000000000001 R12: ffffeb4041e96b00 [ 1209.690285] R13: ffff934efa5ad800 R14: ffff934efd402c40 R15: 0000000000000000 [ 1209.691213] FS: 00007f7945dfb540(0000) GS:ffff934efda80000(0000) knlGS:0000000000000000 [ 1209.692316] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 1209.693013] CR2: 000055877fd3da80 CR3: 0000000077384000 CR4: 00000000000006e0 [ 1209.693897] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1209.694773] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 1209.695631] Call Trace: [ 1209.695957] ? __wake_up_common_lock+0x8a/0xc0 [ 1209.696712] iscsi_pool_free+0x26/0x40 [ 1209.697263] iscsi_session_teardown+0x2f/0xf0 [ 1209.698117] iscsi_sw_tcp_session_destroy+0x45/0x60 [ 1209.698831] iscsi_if_rx+0xd88/0x14e0 [ 1209.699370] netlink_unicast+0x16f/0x200 [ 1209.699932] netlink_sendmsg+0x21a/0x3e0 [ 1209.700446] sock_sendmsg+0x4f/0x60 [ 1209.700902] ___sys_sendmsg+0x2ae/0x320 [ 1209.701451] ? cp_new_stat+0x150/0x180 [ 1209.701922] __sys_sendmsg+0x59/0xa0 [ 1209.702357] do_syscall_64+0x52/0x160 [ 1209.702812] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 1209.703419] RIP: 0033:0x7f7946433914 [...] [ 1209.706084] RSP: 002b:00007fffb99f2378 EFLAGS: 00000246 ORIG_RAX: 000000000000002e [ 1209.706994] RAX: ffffffffffffffda RBX: 000055bc869eac20 RCX: 00007f7946433914 [ 1209.708082] RDX: 0000000000000000 RSI: 00007fffb99f2390 RDI: 0000000000000005 [ 1209.709120] RBP: 00007fffb99f2390 R08: 000055bc84fe9320 R09: 00007fffb99f1f07 [ 1209.710110] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000038 [ 1209.711085] R13: 000055bc8502306e R14: 0000000000000000 R15: 0000000000000000 Modules linked in: ---[ end trace a2d933ede7f730d8 ]---
--- drivers/scsi/iscsi_tcp.c | 4 ++++ drivers/scsi/scsi_transport_iscsi.c | 26 +++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-)
drivers/scsi/iscsi_tcp.c +4 -0
@@ -887,6 +887,10 @@ free_host:static void iscsi_sw_tcp_session_destroy (struct iscsi_cls_session *cls_session) {struct Scsi_Host *shost =iscsi_session_to_shost (cls_session); +struct iscsi_session *session = cls_session->dd_data; + +if (WARN_ON_ONCE (session->leadconn)) +return ;iscsi_tcp_r2tpool_free (cls_session->dd_data);iscsi_session_teardown (cls_session);
drivers/scsi/scsi_transport_iscsi.c +23 -3
@@ -2947,6 +2947,24 @@ iscsi_set_path(struct iscsi_transport *transport, struct iscsi_uevent *ev)return err; } +static int iscsi_session_has_conns (int sid) +{ +struct iscsi_cls_conn *conn; +unsigned long flags; +int found =0 ; + +spin_lock_irqsave (&connlock, flags); +list_for_each_entry (conn, &connlist, conn_list) { +if (iscsi_conn_get_sid (conn) == sid) { + found =1 ; +break ; + } + } +spin_unlock_irqrestore (&connlock, flags); + +return found; +} +static int iscsi_set_iface_params (struct iscsi_transport *transport,struct iscsi_uevent *ev,uint32_t len)
@@ -3524,10 +3542,12 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group)break ;case ISCSI_UEVENT_DESTROY_SESSION : session =iscsi_session_lookup (ev->u.d_session.sid); -if (session) - transport->destroy_session (session); -else +if (!session) err = -EINVAL ; +else if (iscsi_session_has_conns (ev->u.d_session.sid)) + err = -EBUSY ; +else + transport->destroy_session (session);break ;case ISCSI_UEVENT_UNBIND_SESSION : session =iscsi_session_lookup (ev->u.d_session.sid);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 274/399 crypto: hisilicon - Update debugfs usage of SEC V2
In reply to Greg Kroah-HartmanFrom: Zaibo Xu <[email protected]>
[ Upstream commit ca0d158dc9e5dc0902c1d507d82178d97f6f5709 ]
Applied some advices of Marco Elver on atomic usage of Debugfs, which is carried out by basing on Arnd Bergmann's fixing patch.
--- drivers/crypto/hisilicon/sec2/sec.h | 2 +- drivers/crypto/hisilicon/sec2/sec_crypto.c | 8 ++++---- drivers/crypto/hisilicon/sec2/sec_main.c | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-)
drivers/crypto/hisilicon/sec2/sec.h +1 -1
@@ -40,7 +40,7 @@ struct sec_req {int req_id;/* Status of the SEC request */ -atomic_t fake_busy; +bool fake_busy; };/**
drivers/crypto/hisilicon/sec2/sec_crypto.c +4 -4
@@ -141,7 +141,7 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req)return -ENOBUFS ;if (!ret) { -if (atomic_read (&req->fake_busy)) +if (req->fake_busy) ret = -EBUSY ;else ret = -EINPROGRESS ;
@@ -641,7 +641,7 @@ static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req)if (ctx->c_ctx.c_mode ==SEC_CMODE_CBC && req->c_req.encrypt)sec_update_iv (req); -if (atomic_cmpxchg (&req->fake_busy,1 ,0 ) !=1 ) +if (req->fake_busy) sk_req->base.complete (&sk_req->base, -EINPROGRESS ); sk_req->base.complete (&sk_req->base, req->err_type);
@@ -672,9 +672,9 @@ static int sec_request_init(struct sec_ctx *ctx, struct sec_req *req) }if (ctx->fake_req_limit <=atomic_inc_return (&qp_ctx->pending_reqs)) -atomic_set (&req->fake_busy,1 ); + req->fake_busy = true;else -atomic_set (&req->fake_busy,0 ); + req->fake_busy = false; ret = ctx->req_op->get_res (ctx, req);if (ret) {
drivers/crypto/hisilicon/sec2/sec_main.c +9 -9
@@ -608,13 +608,13 @@ static const struct file_operations sec_dbg_fops = { .write = sec_debug_write, }; -static int debugfs_atomic64_t_get (void *data,u64 *val) +static int sec_debugfs_atomic64_get (void *data,u64 *val) { - *val =atomic64_read ((atomic64_t *)data); -return 0 ; + *val =atomic64_read ((atomic64_t *)data); +return 0 ; } -DEFINE_DEBUGFS_ATTRIBUTE (fops_atomic64_t_ro, debugfs_atomic64_t_get,NULL , -"%lld\n" ); +DEFINE_DEBUGFS_ATTRIBUTE (sec_atomic64_ops, sec_debugfs_atomic64_get, +NULL ,"%lld\n" );static int sec_core_debug_init (struct sec_dev *sec) {
@@ -636,11 +636,11 @@ static int sec_core_debug_init(struct sec_dev *sec)debugfs_create_regset32 ("regs" ,0444 , tmp_d, regset); -debugfs_create_file ("send_cnt" ,0444 , tmp_d, &dfx->send_cnt, - &fops_atomic64_t_ro); +debugfs_create_file ("send_cnt" ,0444 , tmp_d, + &dfx->send_cnt, &sec_atomic64_ops); -debugfs_create_file ("recv_cnt" ,0444 , tmp_d, &dfx->recv_cnt, - &fops_atomic64_t_ro); +debugfs_create_file ("recv_cnt" ,0444 , tmp_d, + &dfx->recv_cnt, &sec_atomic64_ops);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 275/399 crypto: hisilicon - Bugfixed tfm leak
In reply to Greg Kroah-HartmanFrom: Zaibo Xu <[email protected]>
[ Upstream commit dfee9955abc7ec9364413d16316181322cf44f2f ]
1.Fixed the bug of software tfm leakage.
2.Update HW error log message.
--- drivers/crypto/hisilicon/hpre/hpre_crypto.c | 7 +++++- drivers/crypto/hisilicon/hpre/hpre_main.c | 24 ++++++++++----------- 2 files changed, 18 insertions(+), 13 deletions(-)
drivers/crypto/hisilicon/hpre/hpre_crypto.c +6 -1
@@ -1043,6 +1043,7 @@ static unsigned int hpre_rsa_max_size(struct crypto_akcipher *tfm)static int hpre_rsa_init_tfm (struct crypto_akcipher *tfm) {struct hpre_ctx *ctx =akcipher_tfm_ctx (tfm); +int ret; ctx->rsa.soft_tfm =crypto_alloc_akcipher ("rsa-generic" ,0 ,0 );if (IS_ERR (ctx->rsa.soft_tfm)) {
@@ -1050,7 +1051,11 @@ static int hpre_rsa_init_tfm(struct crypto_akcipher *tfm)return PTR_ERR (ctx->rsa.soft_tfm); } -return hpre_ctx_init (ctx); + ret =hpre_ctx_init (ctx); +if (ret) +crypto_free_akcipher (ctx->rsa.soft_tfm); + +return ret; }static void hpre_rsa_exit_tfm (struct crypto_akcipher *tfm)
drivers/crypto/hisilicon/hpre/hpre_main.c +12 -12
@@ -106,18 +106,18 @@ static const char * const hpre_debug_file_name[] = { };static const struct hpre_hw_error hpre_hw_errors[] = { - { .int_msk =BIT (0 ), .msg ="hpre_ecc_1bitt_err" }, - { .int_msk =BIT (1 ), .msg ="hpre_ecc_2bit_err" }, - { .int_msk =BIT (2 ), .msg ="hpre_data_wr_err" }, - { .int_msk =BIT (3 ), .msg ="hpre_data_rd_err" }, - { .int_msk =BIT (4 ), .msg ="hpre_bd_rd_err" }, - { .int_msk =BIT (5 ), .msg ="hpre_ooo_2bit_ecc_err" }, - { .int_msk =BIT (6 ), .msg ="hpre_cltr1_htbt_tm_out_err" }, - { .int_msk =BIT (7 ), .msg ="hpre_cltr2_htbt_tm_out_err" }, - { .int_msk =BIT (8 ), .msg ="hpre_cltr3_htbt_tm_out_err" }, - { .int_msk =BIT (9 ), .msg ="hpre_cltr4_htbt_tm_out_err" }, - { .int_msk =GENMASK (15 ,10 ), .msg ="hpre_ooo_rdrsp_err" }, - { .int_msk =GENMASK (21 ,16 ), .msg ="hpre_ooo_wrrsp_err" }, + { .int_msk =BIT (0 ), .msg ="core_ecc_1bit_err_int_set" }, + { .int_msk =BIT (1 ), .msg ="core_ecc_2bit_err_int_set" }, + { .int_msk =BIT (2 ), .msg ="dat_wb_poison_int_set" }, + { .int_msk =BIT (3 ), .msg ="dat_rd_poison_int_set" }, + { .int_msk =BIT (4 ), .msg ="bd_rd_poison_int_set" }, + { .int_msk =BIT (5 ), .msg ="ooo_ecc_2bit_err_int_set" }, + { .int_msk =BIT (6 ), .msg ="cluster1_shb_timeout_int_set" }, + { .int_msk =BIT (7 ), .msg ="cluster2_shb_timeout_int_set" }, + { .int_msk =BIT (8 ), .msg ="cluster3_shb_timeout_int_set" }, + { .int_msk =BIT (9 ), .msg ="cluster4_shb_timeout_int_set" }, + { .int_msk =GENMASK (15 ,10 ), .msg ="ooo_rdrsp_err_int_set" }, + { .int_msk =GENMASK (21 ,16 ), .msg ="ooo_wrrsp_err_int_set" }, {/* sentinel */ } };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 276/399 crypto: essiv - fix AEAD capitalization and preposition use in help text
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit ab3d436bf3e9d05f58ceaa85ff7475bfcd6e45af ]
"AEAD" is capitalized everywhere else.
Use "an" when followed by a written or spoken vowel.
--- crypto/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
crypto/Kconfig +2 -2
@@ -511,10 +511,10 @@ config CRYPTO_ESSIV encryption. This driver implements a crypto API template that can be - instantiated either as a skcipher or as a aead (depending on the + instantiated either as an skcipher or as an AEAD (depending on the type of the first template argument), and which defers encryption and decryption requests to the encapsulated cipher after applying - ESSIV to the input IV. Note that in the aead case, it is assumed + ESSIV to the input IV. Note that in the AEAD case, it is assumed that the keys are presented in the same format used by the authenc template, and that the IV appears at the end of the authenticated associated data (AAD) region (which is how dm-crypt uses it.)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 277/399 ALSA: usb-audio: add implicit fb quirk for MOTU M Series
In reply to Greg Kroah-HartmanFrom: Alexander Tsoy <[email protected]>
[ Upstream commit c249177944b650816069f6c49b769baaa94339dc ]
This fixes crackling sound during playback.
Further note: MOTU is known for reusing Product IDs for different devices or different generations of the device (e.g. MicroBook I/II/IIc shares a single Product ID). This patch was only tested with M4 audio interface, but the same Product ID is also used by M2. Hope it will work for M2 as well.
--- sound/usb/pcm.c | 4 ++++ 1 file changed, 4 insertions(+)
sound/usb/pcm.c +4 -0
@@ -348,6 +348,10 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, ep =0x84 ; ifnum =0 ; goto add_sync_ep_from_ifnum; +case USB_ID (0x07fd ,0x0008 ):/* MOTU M Series */ + ep =0x81 ; + ifnum =2 ; + goto add_sync_ep_from_ifnum;case USB_ID (0x0582 ,0x01d8 ):/* BOSS Katana */ /* BOSS Katana amplifiers do not need quirks */ return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 278/399 PM / devfreq: Add debugfs support with devfreq_summary file
In reply to Greg Kroah-HartmanFrom: Chanwoo Choi <[email protected]>
[ Upstream commit 490a421bc575d1bf391a6ad5b582dcfbd0037724 ]
Add debugfs interface to provide debugging information of devfreq device. It contains 'devfreq_summary' entry to show the summary of registered devfreq devices as following and the additional debugfs file will be added.
- /sys/kernel/debug/devfreq/devfreq_summary
[Detailed description of each field of 'devfreq_summary' debugfs file]
- dev_name : Device name of h/w
- dev : Device name made by devfreq core
- parent_dev : If devfreq device uses the passive governor,
show parent devfreq device name. Otherwise, show 'null'.
- governor : Devfreq governor name
- polling_ms : If devfreq device uses the simple_ondemand governor,
polling_ms is necessary for the period. (unit: millisecond)
- cur_freq_Hz : Current frequency (unit: Hz)
- min_freq_Hz : Minimum frequency (unit: Hz)
- max_freq_Hz : Maximum frequency (unit: Hz)
[For example on Exynos5422-based Odroid-XU3 board]
$ cat /sys/kernel/debug/devfreq/devfreq_summary dev_name dev parent_dev governor polling_ms cur_freq_Hz min_freq_Hz max_freq_Hz ------------------------------ ---------- ---------- --------------- ---------- ------------ ------------ ------------ 10c20000.memory-controller devfreq0 null simple_ondemand 0 165000000 165000000 825000000 soc:bus_wcore devfreq1 null simple_ondemand 50 532000000 88700000 532000000 soc:bus_noc devfreq2 devfreq1 passive 0 111000000 66600000 111000000 soc:bus_fsys_apb devfreq3 devfreq1 passive 0 222000000 111000000 222000000 soc:bus_fsys devfreq4 devfreq1 passive 0 200000000 75000000 200000000 soc:bus_fsys2 devfreq5 devfreq1 passive 0 200000000 75000000 200000000 soc:bus_mfc devfreq6 devfreq1 passive 0 333000000 83250000 333000000 soc:bus_gen devfreq7 devfreq1 passive 0 266000000 88700000 266000000 soc:bus_peri devfreq8 devfreq1 passive 0 66600000 66600000 66600000 soc:bus_g2d devfreq9 devfreq1 passive 0 333000000 83250000 333000000 soc:bus_g2d_acp devfreq10 devfreq1 passive 0 266000000 66500000 266000000 soc:bus_jpeg devfreq11 devfreq1 passive 0 300000000 75000000 300000000 soc:bus_jpeg_apb devfreq12 devfreq1 passive 0 166500000 83250000 166500000 soc:bus_disp1_fimd devfreq13 devfreq1 passive 0 200000000 120000000 200000000 soc:bus_disp1 devfreq14 devfreq1 passive 0 300000000 120000000 300000000 soc:bus_gscl_scaler devfreq15 devfreq1 passive 0 300000000 150000000 300000000 soc:bus_mscl devfreq16 devfreq1 passive 0 666000000 84000000 666000000
--- drivers/devfreq/devfreq.c | 82 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+)
drivers/devfreq/devfreq.c +82 -0
@@ -10,6 +10,7 @@#include <linux/kernel.h> #include <linux/kmod.h> #include <linux/sched.h> +#include <linux/debugfs.h> #include <linux/errno.h> #include <linux/err.h> #include <linux/init.h>
@@ -33,6 +34,7 @@#define HZ_PER_KHZ 1000static struct class *devfreq_class; +static struct dentry *devfreq_debugfs;/* * devfreq core provides delayed work based load monitoring helper
@@ -1614,6 +1616,81 @@ static struct attribute *devfreq_attrs[] = { };ATTRIBUTE_GROUPS (devfreq); +/** +* devfreq_summary_show() - Show the summary of the devfreq devices +* @s: seq_file instance to show the summary of devfreq devices +* @data: not used +* +* Show the summary of the devfreq devices via 'devfreq_summary' debugfs file. +* It helps that user can know the detailed information of the devfreq devices. +* +* Return 0 always because it shows the information without any data change. +*/ +static int devfreq_summary_show (struct seq_file *s,void *data) +{ +struct devfreq *devfreq; +struct devfreq *p_devfreq =NULL ; +unsigned long cur_freq, min_freq, max_freq; +unsigned int polling_ms; + +seq_printf (s,"%-30s %-10s %-10s %-15s %10s %12s %12s %12s\n" , +"dev_name" , +"dev" , +"parent_dev" , +"governor" , +"polling_ms" , +"cur_freq_Hz" , +"min_freq_Hz" , +"max_freq_Hz" ); +seq_printf (s,"%30s %10s %10s %15s %10s %12s %12s %12s\n" , +"------------------------------" , +"----------" , +"----------" , +"---------------" , +"----------" , +"------------" , +"------------" , +"------------" ); + +mutex_lock (&devfreq_list_lock); + +list_for_each_entry_reverse (devfreq, &devfreq_list, node) { +#if IS_ENABLED (CONFIG_DEVFREQ_GOV_PASSIVE ) +if (!strncmp (devfreq->governor_name,DEVFREQ_GOV_PASSIVE , +DEVFREQ_NAME_LEN )) { +struct devfreq_passive_data *data = devfreq->data; + +if (data) + p_devfreq = data->parent; + }else { + p_devfreq =NULL ; + } +#endif + +mutex_lock (&devfreq->lock); + cur_freq = devfreq->previous_freq, +get_freq_range (devfreq, &min_freq, &max_freq); + polling_ms = devfreq->profile->polling_ms, +mutex_unlock (&devfreq->lock); + +seq_printf (s, +"%-30s %-10s %-10s %-15s %10d %12ld %12ld %12ld\n" , +dev_name (devfreq->dev.parent), +dev_name (&devfreq->dev), + p_devfreq ?dev_name (&p_devfreq->dev) :"null" , + devfreq->governor_name, + polling_ms, + cur_freq, + min_freq, + max_freq); + } + +mutex_unlock (&devfreq_list_lock); + +return 0 ; +} +DEFINE_SHOW_ATTRIBUTE (devfreq_summary); +static int __init devfreq_init (void ) { devfreq_class =class_create (THIS_MODULE ,"devfreq" );
@@ -1630,6 +1707,11 @@ static int __init devfreq_init(void) } devfreq_class->dev_groups = devfreq_groups; + devfreq_debugfs =debugfs_create_dir ("devfreq" ,NULL ); +debugfs_create_file ("devfreq_summary" ,0444 , + devfreq_debugfs,NULL , + &devfreq_summary_fops); +return 0 ; }subsys_initcall (devfreq_init);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 279/399 pinctrl: tigerlake: Tiger Lake uses _HID enumeration
In reply to Greg Kroah-HartmanFrom: Mika Westerberg <[email protected]>
[ Upstream commit cd0a32371db73d0b50536a7ca4f036abddff0d1d ]
Turns out that Tiger Lake GPIO will be enumerated using _HID method where there is only a single ACPI device and multiple BARs so rework the driver to support that scheme instead.
--- drivers/pinctrl/intel/pinctrl-tigerlake.c | 547 ++++++++++------------ 1 file changed, 250 insertions(+), 297 deletions(-)
drivers/pinctrl/intel/pinctrl-tigerlake.c +250 -297
@@ -2,7 +2,7 @@/* * Intel Tiger Lake PCH pinctrl/GPIO driver * -* Copyright (C) 2019, Intel Corporation +* Copyright (C) 2019 - 2020, Intel Corporation * Authors: Andy Shevchenko <[email protected]> * Mika Westerberg <[email protected]> */
@@ -21,15 +21,19 @@#define TGL_GPI_IS 0x100#define TGL_GPI_IE 0x120 -#define TGL_GPP (r, s, e) \ +#define TGL_NO_GPIO -1 + +#define TGL_GPP (r, s, e, g) \ { \ .reg_num = (r), \ .base = (s), \ .size = ((e) - (s) + 1), \ + .gpio_base = (g), \ } -#define TGL_COMMUNITY (s, e, g) \ +#define TGL_COMMUNITY (b, s, e, g) \ { \ + .barno = (b), \ .padown_offset = TGL_PAD_OWN, \ .padcfglock_offset = TGL_PADCFGLOCK, \ .hostown_offset = TGL_HOSTSW_OWN, \
@@ -42,7 +46,7 @@ }/* Tiger Lake-LP */ -static const struct pinctrl_pin_desc tgllp_community0_pins[] = { +static const struct pinctrl_pin_desc tgllp_pins[] = {/* GPP_B */ PINCTRL_PIN (0 ,"CORE_VID_0" ),PINCTRL_PIN (1 ,"CORE_VID_1" ),
@@ -113,324 +117,273 @@ static const struct pinctrl_pin_desc tgllp_community0_pins[] = {PINCTRL_PIN (64 ,"GPPC_A_22" ),PINCTRL_PIN (65 ,"I2S1_SCLK" ),PINCTRL_PIN (66 ,"ESPI_CLK_LOOPBK" ), -}; - -static const struct intel_padgroup tgllp_community0_gpps[] = { -TGL_GPP (0 ,0 ,25 ),/* GPP_B */ -TGL_GPP (1 ,26 ,41 ),/* GPP_T */ -TGL_GPP (2 ,42 ,66 ),/* GPP_A */ -}; - -static const struct intel_community tgllp_community0[] = { -TGL_COMMUNITY (0 ,66 , tgllp_community0_gpps), -}; - -static const struct intel_pinctrl_soc_data tgllp_community0_soc_data = { - .uid ="0" , - .pins = tgllp_community0_pins, - .npins =ARRAY_SIZE (tgllp_community0_pins), - .communities = tgllp_community0, - .ncommunities =ARRAY_SIZE (tgllp_community0), -}; - -static const struct pinctrl_pin_desc tgllp_community1_pins[] = {/* GPP_S */ -PINCTRL_PIN (0 ,"SNDW0_CLK" ), -PINCTRL_PIN (1 ,"SNDW0_DATA" ), -PINCTRL_PIN (2 ,"SNDW1_CLK" ), -PINCTRL_PIN (3 ,"SNDW1_DATA" ), -PINCTRL_PIN (4 ,"SNDW2_CLK" ), -PINCTRL_PIN (5 ,"SNDW2_DATA" ), -PINCTRL_PIN (6 ,"SNDW3_CLK" ), -PINCTRL_PIN (7 ,"SNDW3_DATA" ), +PINCTRL_PIN (67 ,"SNDW0_CLK" ), +PINCTRL_PIN (68 ,"SNDW0_DATA" ), +PINCTRL_PIN (69 ,"SNDW1_CLK" ), +PINCTRL_PIN (70 ,"SNDW1_DATA" ), +PINCTRL_PIN (71 ,"SNDW2_CLK" ), +PINCTRL_PIN (72 ,"SNDW2_DATA" ), +PINCTRL_PIN (73 ,"SNDW3_CLK" ), +PINCTRL_PIN (74 ,"SNDW3_DATA" ),/* GPP_H */ -PINCTRL_PIN (8 ,"GPPC_H_0" ), -PINCTRL_PIN (9 ,"GPPC_H_1" ), -PINCTRL_PIN (10 ,"GPPC_H_2" ), -PINCTRL_PIN (11 ,"SX_EXIT_HOLDOFFB" ), -PINCTRL_PIN (12 ,"I2C2_SDA" ), -PINCTRL_PIN (13 ,"I2C2_SCL" ), -PINCTRL_PIN (14 ,"I2C3_SDA" ), -PINCTRL_PIN (15 ,"I2C3_SCL" ), -PINCTRL_PIN (16 ,"I2C4_SDA" ), -PINCTRL_PIN (17 ,"I2C4_SCL" ), -PINCTRL_PIN (18 ,"SRCCLKREQB_4" ), -PINCTRL_PIN (19 ,"SRCCLKREQB_5" ), -PINCTRL_PIN (20 ,"M2_SKT2_CFG_0" ), -PINCTRL_PIN (21 ,"M2_SKT2_CFG_1" ), -PINCTRL_PIN (22 ,"M2_SKT2_CFG_2" ), -PINCTRL_PIN (23 ,"M2_SKT2_CFG_3" ), -PINCTRL_PIN (24 ,"DDPB_CTRLCLK" ), -PINCTRL_PIN (25 ,"DDPB_CTRLDATA" ), -PINCTRL_PIN (26 ,"CPU_C10_GATEB" ), -PINCTRL_PIN (27 ,"TIME_SYNC_0" ), -PINCTRL_PIN (28 ,"IMGCLKOUT_1" ), -PINCTRL_PIN (29 ,"IMGCLKOUT_2" ), -PINCTRL_PIN (30 ,"IMGCLKOUT_3" ), -PINCTRL_PIN (31 ,"IMGCLKOUT_4" ), +PINCTRL_PIN (75 ,"GPPC_H_0" ), +PINCTRL_PIN (76 ,"GPPC_H_1" ), +PINCTRL_PIN (77 ,"GPPC_H_2" ), +PINCTRL_PIN (78 ,"SX_EXIT_HOLDOFFB" ), +PINCTRL_PIN (79 ,"I2C2_SDA" ), +PINCTRL_PIN (80 ,"I2C2_SCL" ), +PINCTRL_PIN (81 ,"I2C3_SDA" ), +PINCTRL_PIN (82 ,"I2C3_SCL" ), +PINCTRL_PIN (83 ,"I2C4_SDA" ), +PINCTRL_PIN (84 ,"I2C4_SCL" ), +PINCTRL_PIN (85 ,"SRCCLKREQB_4" ), +PINCTRL_PIN (86 ,"SRCCLKREQB_5" ), +PINCTRL_PIN (87 ,"M2_SKT2_CFG_0" ), +PINCTRL_PIN (88 ,"M2_SKT2_CFG_1" ), +PINCTRL_PIN (89 ,"M2_SKT2_CFG_2" ), +PINCTRL_PIN (90 ,"M2_SKT2_CFG_3" ), +PINCTRL_PIN (91 ,"DDPB_CTRLCLK" ), +PINCTRL_PIN (92 ,"DDPB_CTRLDATA" ), +PINCTRL_PIN (93 ,"CPU_C10_GATEB" ), +PINCTRL_PIN (94 ,"TIME_SYNC_0" ), +PINCTRL_PIN (95 ,"IMGCLKOUT_1" ), +PINCTRL_PIN (96 ,"IMGCLKOUT_2" ), +PINCTRL_PIN (97 ,"IMGCLKOUT_3" ), +PINCTRL_PIN (98 ,"IMGCLKOUT_4" ),/* GPP_D */ -PINCTRL_PIN (32 ,"ISH_GP_0" ), -PINCTRL_PIN (33 ,"ISH_GP_1" ), -PINCTRL_PIN (34 ,"ISH_GP_2" ), -PINCTRL_PIN (35 ,"ISH_GP_3" ), -PINCTRL_PIN (36 ,"IMGCLKOUT_0" ), -PINCTRL_PIN (37 ,"SRCCLKREQB_0" ), -PINCTRL_PIN (38 ,"SRCCLKREQB_1" ), -PINCTRL_PIN (39 ,"SRCCLKREQB_2" ), -PINCTRL_PIN (40 ,"SRCCLKREQB_3" ), -PINCTRL_PIN (41 ,"ISH_SPI_CSB" ), -PINCTRL_PIN (42 ,"ISH_SPI_CLK" ), -PINCTRL_PIN (43 ,"ISH_SPI_MISO" ), -PINCTRL_PIN (44 ,"ISH_SPI_MOSI" ), -PINCTRL_PIN (45 ,"ISH_UART0_RXD" ), -PINCTRL_PIN (46 ,"ISH_UART0_TXD" ), -PINCTRL_PIN (47 ,"ISH_UART0_RTSB" ), -PINCTRL_PIN (48 ,"ISH_UART0_CTSB" ), -PINCTRL_PIN (49 ,"ISH_GP_4" ), -PINCTRL_PIN (50 ,"ISH_GP_5" ), -PINCTRL_PIN (51 ,"I2S_MCLK1_OUT" ), -PINCTRL_PIN (52 ,"GSPI2_CLK_LOOPBK" ), +PINCTRL_PIN (99 ,"ISH_GP_0" ), +PINCTRL_PIN (100 ,"ISH_GP_1" ), +PINCTRL_PIN (101 ,"ISH_GP_2" ), +PINCTRL_PIN (102 ,"ISH_GP_3" ), +PINCTRL_PIN (103 ,"IMGCLKOUT_0" ), +PINCTRL_PIN (104 ,"SRCCLKREQB_0" ), +PINCTRL_PIN (105 ,"SRCCLKREQB_1" ), +PINCTRL_PIN (106 ,"SRCCLKREQB_2" ), +PINCTRL_PIN (107 ,"SRCCLKREQB_3" ), +PINCTRL_PIN (108 ,"ISH_SPI_CSB" ), +PINCTRL_PIN (109 ,"ISH_SPI_CLK" ), +PINCTRL_PIN (110 ,"ISH_SPI_MISO" ), +PINCTRL_PIN (111 ,"ISH_SPI_MOSI" ), +PINCTRL_PIN (112 ,"ISH_UART0_RXD" ), +PINCTRL_PIN (113 ,"ISH_UART0_TXD" ), +PINCTRL_PIN (114 ,"ISH_UART0_RTSB" ), +PINCTRL_PIN (115 ,"ISH_UART0_CTSB" ), +PINCTRL_PIN (116 ,"ISH_GP_4" ), +PINCTRL_PIN (117 ,"ISH_GP_5" ), +PINCTRL_PIN (118 ,"I2S_MCLK1_OUT" ), +PINCTRL_PIN (119 ,"GSPI2_CLK_LOOPBK" ),/* GPP_U */ -PINCTRL_PIN (53 ,"UART3_RXD" ), -PINCTRL_PIN (54 ,"UART3_TXD" ), -PINCTRL_PIN (55 ,"UART3_RTSB" ), -PINCTRL_PIN (56 ,"UART3_CTSB" ), -PINCTRL_PIN (57 ,"GSPI3_CS0B" ), -PINCTRL_PIN (58 ,"GSPI3_CLK" ), -PINCTRL_PIN (59 ,"GSPI3_MISO" ), -PINCTRL_PIN (60 ,"GSPI3_MOSI" ), -PINCTRL_PIN (61 ,"GSPI4_CS0B" ), -PINCTRL_PIN (62 ,"GSPI4_CLK" ), -PINCTRL_PIN (63 ,"GSPI4_MISO" ), -PINCTRL_PIN (64 ,"GSPI4_MOSI" ), -PINCTRL_PIN (65 ,"GSPI5_CS0B" ), -PINCTRL_PIN (66 ,"GSPI5_CLK" ), -PINCTRL_PIN (67 ,"GSPI5_MISO" ), -PINCTRL_PIN (68 ,"GSPI5_MOSI" ), -PINCTRL_PIN (69 ,"GSPI6_CS0B" ), -PINCTRL_PIN (70 ,"GSPI6_CLK" ), -PINCTRL_PIN (71 ,"GSPI6_MISO" ), -PINCTRL_PIN (72 ,"GSPI6_MOSI" ), -PINCTRL_PIN (73 ,"GSPI3_CLK_LOOPBK" ), -PINCTRL_PIN (74 ,"GSPI4_CLK_LOOPBK" ), -PINCTRL_PIN (75 ,"GSPI5_CLK_LOOPBK" ), -PINCTRL_PIN (76 ,"GSPI6_CLK_LOOPBK" ), +PINCTRL_PIN (120 ,"UART3_RXD" ), +PINCTRL_PIN (121 ,"UART3_TXD" ), +PINCTRL_PIN (122 ,"UART3_RTSB" ), +PINCTRL_PIN (123 ,"UART3_CTSB" ), +PINCTRL_PIN (124 ,"GSPI3_CS0B" ), +PINCTRL_PIN (125 ,"GSPI3_CLK" ), +PINCTRL_PIN (126 ,"GSPI3_MISO" ), +PINCTRL_PIN (127 ,"GSPI3_MOSI" ), +PINCTRL_PIN (128 ,"GSPI4_CS0B" ), +PINCTRL_PIN (129 ,"GSPI4_CLK" ), +PINCTRL_PIN (130 ,"GSPI4_MISO" ), +PINCTRL_PIN (131 ,"GSPI4_MOSI" ), +PINCTRL_PIN (132 ,"GSPI5_CS0B" ), +PINCTRL_PIN (133 ,"GSPI5_CLK" ), +PINCTRL_PIN (134 ,"GSPI5_MISO" ), +PINCTRL_PIN (135 ,"GSPI5_MOSI" ), +PINCTRL_PIN (136 ,"GSPI6_CS0B" ), +PINCTRL_PIN (137 ,"GSPI6_CLK" ), +PINCTRL_PIN (138 ,"GSPI6_MISO" ), +PINCTRL_PIN (139 ,"GSPI6_MOSI" ), +PINCTRL_PIN (140 ,"GSPI3_CLK_LOOPBK" ), +PINCTRL_PIN (141 ,"GSPI4_CLK_LOOPBK" ), +PINCTRL_PIN (142 ,"GSPI5_CLK_LOOPBK" ), +PINCTRL_PIN (143 ,"GSPI6_CLK_LOOPBK" ),/* vGPIO */ -PINCTRL_PIN (77 ,"CNV_BTEN" ), -PINCTRL_PIN (78 ,"CNV_BT_HOST_WAKEB" ), -PINCTRL_PIN (79 ,"CNV_BT_IF_SELECT" ), -PINCTRL_PIN (80 ,"vCNV_BT_UART_TXD" ), -PINCTRL_PIN (81 ,"vCNV_BT_UART_RXD" ), -PINCTRL_PIN (82 ,"vCNV_BT_UART_CTS_B" ), -PINCTRL_PIN (83 ,"vCNV_BT_UART_RTS_B" ), -PINCTRL_PIN (84 ,"vCNV_MFUART1_TXD" ), -PINCTRL_PIN (85 ,"vCNV_MFUART1_RXD" ), -PINCTRL_PIN (86 ,"vCNV_MFUART1_CTS_B" ), -PINCTRL_PIN (87 ,"vCNV_MFUART1_RTS_B" ), -PINCTRL_PIN (88 ,"vUART0_TXD" ), -PINCTRL_PIN (89 ,"vUART0_RXD" ), -PINCTRL_PIN (90 ,"vUART0_CTS_B" ), -PINCTRL_PIN (91 ,"vUART0_RTS_B" ), -PINCTRL_PIN (92 ,"vISH_UART0_TXD" ), -PINCTRL_PIN (93 ,"vISH_UART0_RXD" ), -PINCTRL_PIN (94 ,"vISH_UART0_CTS_B" ), -PINCTRL_PIN (95 ,"vISH_UART0_RTS_B" ), -PINCTRL_PIN (96 ,"vCNV_BT_I2S_BCLK" ), -PINCTRL_PIN (97 ,"vCNV_BT_I2S_WS_SYNC" ), -PINCTRL_PIN (98 ,"vCNV_BT_I2S_SDO" ), -PINCTRL_PIN (99 ,"vCNV_BT_I2S_SDI" ), -PINCTRL_PIN (100 ,"vI2S2_SCLK" ), -PINCTRL_PIN (101 ,"vI2S2_SFRM" ), -PINCTRL_PIN (102 ,"vI2S2_TXD" ), -PINCTRL_PIN (103 ,"vI2S2_RXD" ), -}; - -static const struct intel_padgroup tgllp_community1_gpps[] = { -TGL_GPP (0 ,0 ,7 ),/* GPP_S */ -TGL_GPP (1 ,8 ,31 ),/* GPP_H */ -TGL_GPP (2 ,32 ,52 ),/* GPP_D */ -TGL_GPP (3 ,53 ,76 ),/* GPP_U */ -TGL_GPP (4 ,77 ,103 ),/* vGPIO */ -}; - -static const struct intel_community tgllp_community1[] = { -TGL_COMMUNITY (0 ,103 , tgllp_community1_gpps), -}; - -static const struct intel_pinctrl_soc_data tgllp_community1_soc_data = { - .uid ="1" , - .pins = tgllp_community1_pins, - .npins =ARRAY_SIZE (tgllp_community1_pins), - .communities = tgllp_community1, - .ncommunities =ARRAY_SIZE (tgllp_community1), -}; - -static const struct pinctrl_pin_desc tgllp_community4_pins[] = { +PINCTRL_PIN (144 ,"CNV_BTEN" ), +PINCTRL_PIN (145 ,"CNV_BT_HOST_WAKEB" ), +PINCTRL_PIN (146 ,"CNV_BT_IF_SELECT" ), +PINCTRL_PIN (147 ,"vCNV_BT_UART_TXD" ), +PINCTRL_PIN (148 ,"vCNV_BT_UART_RXD" ), +PINCTRL_PIN (149 ,"vCNV_BT_UART_CTS_B" ), +PINCTRL_PIN (150 ,"vCNV_BT_UART_RTS_B" ), +PINCTRL_PIN (151 ,"vCNV_MFUART1_TXD" ), +PINCTRL_PIN (152 ,"vCNV_MFUART1_RXD" ), +PINCTRL_PIN (153 ,"vCNV_MFUART1_CTS_B" ), +PINCTRL_PIN (154 ,"vCNV_MFUART1_RTS_B" ), +PINCTRL_PIN (155 ,"vUART0_TXD" ), +PINCTRL_PIN (156 ,"vUART0_RXD" ), +PINCTRL_PIN (157 ,"vUART0_CTS_B" ), +PINCTRL_PIN (158 ,"vUART0_RTS_B" ), +PINCTRL_PIN (159 ,"vISH_UART0_TXD" ), +PINCTRL_PIN (160 ,"vISH_UART0_RXD" ), +PINCTRL_PIN (161 ,"vISH_UART0_CTS_B" ), +PINCTRL_PIN (162 ,"vISH_UART0_RTS_B" ), +PINCTRL_PIN (163 ,"vCNV_BT_I2S_BCLK" ), +PINCTRL_PIN (164 ,"vCNV_BT_I2S_WS_SYNC" ), +PINCTRL_PIN (165 ,"vCNV_BT_I2S_SDO" ), +PINCTRL_PIN (166 ,"vCNV_BT_I2S_SDI" ), +PINCTRL_PIN (167 ,"vI2S2_SCLK" ), +PINCTRL_PIN (168 ,"vI2S2_SFRM" ), +PINCTRL_PIN (169 ,"vI2S2_TXD" ), +PINCTRL_PIN (170 ,"vI2S2_RXD" ),/* GPP_C */ -PINCTRL_PIN (0 ,"SMBCLK" ), -PINCTRL_PIN (1 ,"SMBDATA" ), -PINCTRL_PIN (2 ,"SMBALERTB" ), -PINCTRL_PIN (3 ,"SML0CLK" ), -PINCTRL_PIN (4 ,"SML0DATA" ), -PINCTRL_PIN (5 ,"SML0ALERTB" ), -PINCTRL_PIN (6 ,"SML1CLK" ), -PINCTRL_PIN (7 ,"SML1DATA" ), -PINCTRL_PIN (8 ,"UART0_RXD" ), -PINCTRL_PIN (9 ,"UART0_TXD" ), -PINCTRL_PIN (10 ,"UART0_RTSB" ), -PINCTRL_PIN (11 ,"UART0_CTSB" ), -PINCTRL_PIN (12 ,"UART1_RXD" ), -PINCTRL_PIN (13 ,"UART1_TXD" ), -PINCTRL_PIN (14 ,"UART1_RTSB" ), -PINCTRL_PIN (15 ,"UART1_CTSB" ), -PINCTRL_PIN (16 ,"I2C0_SDA" ), -PINCTRL_PIN (17 ,"I2C0_SCL" ), -PINCTRL_PIN (18 ,"I2C1_SDA" ), -PINCTRL_PIN (19 ,"I2C1_SCL" ), -PINCTRL_PIN (20 ,"UART2_RXD" ), -PINCTRL_PIN (21 ,"UART2_TXD" ), -PINCTRL_PIN (22 ,"UART2_RTSB" ), -PINCTRL_PIN (23 ,"UART2_CTSB" ), +PINCTRL_PIN (171 ,"SMBCLK" ), +PINCTRL_PIN (172 ,"SMBDATA" ), +PINCTRL_PIN (173 ,"SMBALERTB" ), +PINCTRL_PIN (174 ,"SML0CLK" ), +PINCTRL_PIN (175 ,"SML0DATA" ), +PINCTRL_PIN (176 ,"SML0ALERTB" ), +PINCTRL_PIN (177 ,"SML1CLK" ), +PINCTRL_PIN (178 ,"SML1DATA" ), +PINCTRL_PIN (179 ,"UART0_RXD" ), +PINCTRL_PIN (180 ,"UART0_TXD" ), +PINCTRL_PIN (181 ,"UART0_RTSB" ), +PINCTRL_PIN (182 ,"UART0_CTSB" ), +PINCTRL_PIN (183 ,"UART1_RXD" ), +PINCTRL_PIN (184 ,"UART1_TXD" ), +PINCTRL_PIN (185 ,"UART1_RTSB" ), +PINCTRL_PIN (186 ,"UART1_CTSB" ), +PINCTRL_PIN (187 ,"I2C0_SDA" ), +PINCTRL_PIN (188 ,"I2C0_SCL" ), +PINCTRL_PIN (189 ,"I2C1_SDA" ), +PINCTRL_PIN (190 ,"I2C1_SCL" ), +PINCTRL_PIN (191 ,"UART2_RXD" ), +PINCTRL_PIN (192 ,"UART2_TXD" ), +PINCTRL_PIN (193 ,"UART2_RTSB" ), +PINCTRL_PIN (194 ,"UART2_CTSB" ),/* GPP_F */ -PINCTRL_PIN (24 ,"CNV_BRI_DT" ), -PINCTRL_PIN (25 ,"CNV_BRI_RSP" ), -PINCTRL_PIN (26 ,"CNV_RGI_DT" ), -PINCTRL_PIN (27 ,"CNV_RGI_RSP" ), -PINCTRL_PIN (28 ,"CNV_RF_RESET_B" ), -PINCTRL_PIN (29 ,"GPPC_F_5" ), -PINCTRL_PIN (30 ,"CNV_PA_BLANKING" ), -PINCTRL_PIN (31 ,"GPPC_F_7" ), -PINCTRL_PIN (32 ,"I2S_MCLK2_INOUT" ), -PINCTRL_PIN (33 ,"BOOTMPC" ), -PINCTRL_PIN (34 ,"GPPC_F_10" ), -PINCTRL_PIN (35 ,"GPPC_F_11" ), -PINCTRL_PIN (36 ,"GSXDOUT" ), -PINCTRL_PIN (37 ,"GSXSLOAD" ), -PINCTRL_PIN (38 ,"GSXDIN" ), -PINCTRL_PIN (39 ,"GSXSRESETB" ), -PINCTRL_PIN (40 ,"GSXCLK" ), -PINCTRL_PIN (41 ,"GMII_MDC" ), -PINCTRL_PIN (42 ,"GMII_MDIO" ), -PINCTRL_PIN (43 ,"SRCCLKREQB_6" ), -PINCTRL_PIN (44 ,"EXT_PWR_GATEB" ), -PINCTRL_PIN (45 ,"EXT_PWR_GATE2B" ), -PINCTRL_PIN (46 ,"VNN_CTRL" ), -PINCTRL_PIN (47 ,"V1P05_CTRL" ), -PINCTRL_PIN (48 ,"GPPF_CLK_LOOPBACK" ), +PINCTRL_PIN (195 ,"CNV_BRI_DT" ), +PINCTRL_PIN (196 ,"CNV_BRI_RSP" ), +PINCTRL_PIN (197 ,"CNV_RGI_DT" ), +PINCTRL_PIN (198 ,"CNV_RGI_RSP" ), +PINCTRL_PIN (199 ,"CNV_RF_RESET_B" ), +PINCTRL_PIN (200 ,"GPPC_F_5" ), +PINCTRL_PIN (201 ,"CNV_PA_BLANKING" ), +PINCTRL_PIN (202 ,"GPPC_F_7" ), +PINCTRL_PIN (203 ,"I2S_MCLK2_INOUT" ), +PINCTRL_PIN (204 ,"BOOTMPC" ), +PINCTRL_PIN (205 ,"GPPC_F_10" ), +PINCTRL_PIN (206 ,"GPPC_F_11" ), +PINCTRL_PIN (207 ,"GSXDOUT" ), +PINCTRL_PIN (208 ,"GSXSLOAD" ), +PINCTRL_PIN (209 ,"GSXDIN" ), +PINCTRL_PIN (210 ,"GSXSRESETB" ), +PINCTRL_PIN (211 ,"GSXCLK" ), +PINCTRL_PIN (212 ,"GMII_MDC" ), +PINCTRL_PIN (213 ,"GMII_MDIO" ), +PINCTRL_PIN (214 ,"SRCCLKREQB_6" ), +PINCTRL_PIN (215 ,"EXT_PWR_GATEB" ), +PINCTRL_PIN (216 ,"EXT_PWR_GATE2B" ), +PINCTRL_PIN (217 ,"VNN_CTRL" ), +PINCTRL_PIN (218 ,"V1P05_CTRL" ), +PINCTRL_PIN (219 ,"GPPF_CLK_LOOPBACK" ),/* HVCMOS */ -PINCTRL_PIN (49 ,"L_BKLTEN" ), -PINCTRL_PIN (50 ,"L_BKLTCTL" ), -PINCTRL_PIN (51 ,"L_VDDEN" ), -PINCTRL_PIN (52 ,"SYS_PWROK" ), -PINCTRL_PIN (53 ,"SYS_RESETB" ), -PINCTRL_PIN (54 ,"MLK_RSTB" ), +PINCTRL_PIN (220 ,"L_BKLTEN" ), +PINCTRL_PIN (221 ,"L_BKLTCTL" ), +PINCTRL_PIN (222 ,"L_VDDEN" ), +PINCTRL_PIN (223 ,"SYS_PWROK" ), +PINCTRL_PIN (224 ,"SYS_RESETB" ), +PINCTRL_PIN (225 ,"MLK_RSTB" ),/* GPP_E */ -PINCTRL_PIN (55 ,"SATAXPCIE_0" ), -PINCTRL_PIN (56 ,"SPI1_IO_2" ), -PINCTRL_PIN (57 ,"SPI1_IO_3" ), -PINCTRL_PIN (58 ,"CPU_GP_0" ), -PINCTRL_PIN (59 ,"SATA_DEVSLP_0" ), -PINCTRL_PIN (60 ,"SATA_DEVSLP_1" ), -PINCTRL_PIN (61 ,"GPPC_E_6" ), -PINCTRL_PIN (62 ,"CPU_GP_1" ), -PINCTRL_PIN (63 ,"SPI1_CS1B" ), -PINCTRL_PIN (64 ,"USB2_OCB_0" ), -PINCTRL_PIN (65 ,"SPI1_CSB" ), -PINCTRL_PIN (66 ,"SPI1_CLK" ), -PINCTRL_PIN (67 ,"SPI1_MISO_IO_1" ), -PINCTRL_PIN (68 ,"SPI1_MOSI_IO_0" ), -PINCTRL_PIN (69 ,"DDSP_HPD_A" ), -PINCTRL_PIN (70 ,"ISH_GP_6" ), -PINCTRL_PIN (71 ,"ISH_GP_7" ), -PINCTRL_PIN (72 ,"GPPC_E_17" ), -PINCTRL_PIN (73 ,"DDP1_CTRLCLK" ), -PINCTRL_PIN (74 ,"DDP1_CTRLDATA" ), -PINCTRL_PIN (75 ,"DDP2_CTRLCLK" ), -PINCTRL_PIN (76 ,"DDP2_CTRLDATA" ), -PINCTRL_PIN (77 ,"DDPA_CTRLCLK" ), -PINCTRL_PIN (78 ,"DDPA_CTRLDATA" ), -PINCTRL_PIN (79 ,"SPI1_CLK_LOOPBK" ), +PINCTRL_PIN (226 ,"SATAXPCIE_0" ), +PINCTRL_PIN (227 ,"SPI1_IO_2" ), +PINCTRL_PIN (228 ,"SPI1_IO_3" ), +PINCTRL_PIN (229 ,"CPU_GP_0" ), +PINCTRL_PIN (230 ,"SATA_DEVSLP_0" ), +PINCTRL_PIN (231 ,"SATA_DEVSLP_1" ), +PINCTRL_PIN (232 ,"GPPC_E_6" ), +PINCTRL_PIN (233 ,"CPU_GP_1" ), +PINCTRL_PIN (234 ,"SPI1_CS1B" ), +PINCTRL_PIN (235 ,"USB2_OCB_0" ), +PINCTRL_PIN (236 ,"SPI1_CSB" ), +PINCTRL_PIN (237 ,"SPI1_CLK" ), +PINCTRL_PIN (238 ,"SPI1_MISO_IO_1" ), +PINCTRL_PIN (239 ,"SPI1_MOSI_IO_0" ), +PINCTRL_PIN (240 ,"DDSP_HPD_A" ), +PINCTRL_PIN (241 ,"ISH_GP_6" ), +PINCTRL_PIN (242 ,"ISH_GP_7" ), +PINCTRL_PIN (243 ,"GPPC_E_17" ), +PINCTRL_PIN (244 ,"DDP1_CTRLCLK" ), +PINCTRL_PIN (245 ,"DDP1_CTRLDATA" ), +PINCTRL_PIN (246 ,"DDP2_CTRLCLK" ), +PINCTRL_PIN (247 ,"DDP2_CTRLDATA" ), +PINCTRL_PIN (248 ,"DDPA_CTRLCLK" ), +PINCTRL_PIN (249 ,"DDPA_CTRLDATA" ), +PINCTRL_PIN (250 ,"SPI1_CLK_LOOPBK" ),/* JTAG */ -PINCTRL_PIN (80 ,"JTAG_TDO" ), -PINCTRL_PIN (81 ,"JTAGX" ), -PINCTRL_PIN (82 ,"PRDYB" ), -PINCTRL_PIN (83 ,"PREQB" ), -PINCTRL_PIN (84 ,"CPU_TRSTB" ), -PINCTRL_PIN (85 ,"JTAG_TDI" ), -PINCTRL_PIN (86 ,"JTAG_TMS" ), -PINCTRL_PIN (87 ,"JTAG_TCK" ), -PINCTRL_PIN (88 ,"DBG_PMODE" ), -}; - -static const struct intel_padgroup tgllp_community4_gpps[] = { -TGL_GPP (0 ,0 ,23 ),/* GPP_C */ -TGL_GPP (1 ,24 ,48 ),/* GPP_F */ -TGL_GPP (2 ,49 ,54 ),/* HVCMOS */ -TGL_GPP (3 ,55 ,79 ),/* GPP_E */ -TGL_GPP (4 ,80 ,88 ),/* JTAG */ +PINCTRL_PIN (251 ,"JTAG_TDO" ), +PINCTRL_PIN (252 ,"JTAGX" ), +PINCTRL_PIN (253 ,"PRDYB" ), +PINCTRL_PIN (254 ,"PREQB" ), +PINCTRL_PIN (255 ,"CPU_TRSTB" ), +PINCTRL_PIN (256 ,"JTAG_TDI" ), +PINCTRL_PIN (257 ,"JTAG_TMS" ), +PINCTRL_PIN (258 ,"JTAG_TCK" ), +PINCTRL_PIN (259 ,"DBG_PMODE" ), +/* GPP_R */ +PINCTRL_PIN (260 ,"HDA_BCLK" ), +PINCTRL_PIN (261 ,"HDA_SYNC" ), +PINCTRL_PIN (262 ,"HDA_SDO" ), +PINCTRL_PIN (263 ,"HDA_SDI_0" ), +PINCTRL_PIN (264 ,"HDA_RSTB" ), +PINCTRL_PIN (265 ,"HDA_SDI_1" ), +PINCTRL_PIN (266 ,"GPP_R_6" ), +PINCTRL_PIN (267 ,"GPP_R_7" ), +/* SPI */ +PINCTRL_PIN (268 ,"SPI0_IO_2" ), +PINCTRL_PIN (269 ,"SPI0_IO_3" ), +PINCTRL_PIN (270 ,"SPI0_MOSI_IO_0" ), +PINCTRL_PIN (271 ,"SPI0_MISO_IO_1" ), +PINCTRL_PIN (272 ,"SPI0_TPM_CSB" ), +PINCTRL_PIN (273 ,"SPI0_FLASH_0_CSB" ), +PINCTRL_PIN (274 ,"SPI0_FLASH_1_CSB" ), +PINCTRL_PIN (275 ,"SPI0_CLK" ), + PINCTRL_PIN(276, "SPI0_CLK_LOOPBK"), }; -static const struct intel_community tgllp_community4[] = { -TGL_COMMUNITY (0 ,88 , tgllp_community4_gpps), +static const struct intel_padgroup tgllp_community0_gpps[] = { +TGL_GPP (0 ,0 ,25 ,0 ),/* GPP_B */ +TGL_GPP (1 ,26 ,41 ,32 ),/* GPP_T */ +TGL_GPP (2 ,42 ,66 ,64 ),/* GPP_A */ }; -static const struct intel_pinctrl_soc_data tgllp_community4_soc_data = { - .uid ="4" , - .pins = tgllp_community4_pins, - .npins =ARRAY_SIZE (tgllp_community4_pins), - .communities = tgllp_community4, - .ncommunities =ARRAY_SIZE (tgllp_community4), +static const struct intel_padgroup tgllp_community1_gpps[] = { +TGL_GPP (0 ,67 ,74 ,96 ),/* GPP_S */ +TGL_GPP (1 ,75 ,98 ,128 ),/* GPP_H */ +TGL_GPP (2 ,99 ,119 ,160 ),/* GPP_D */ +TGL_GPP (3 ,120 ,143 ,192 ),/* GPP_U */ +TGL_GPP (4 ,144 ,170 ,224 ),/* vGPIO */ }; -static const struct pinctrl_pin_desc tgllp_community5_pins[] = { -/* GPP_R */ -PINCTRL_PIN (0 ,"HDA_BCLK" ), -PINCTRL_PIN (1 ,"HDA_SYNC" ), -PINCTRL_PIN (2 ,"HDA_SDO" ), -PINCTRL_PIN (3 ,"HDA_SDI_0" ), -PINCTRL_PIN (4 ,"HDA_RSTB" ), -PINCTRL_PIN (5 ,"HDA_SDI_1" ), -PINCTRL_PIN (6 ,"GPP_R_6" ), -PINCTRL_PIN (7 ,"GPP_R_7" ), -/* SPI */ -PINCTRL_PIN (8 ,"SPI0_IO_2" ), -PINCTRL_PIN (9 ,"SPI0_IO_3" ), -PINCTRL_PIN (10 ,"SPI0_MOSI_IO_0" ), -PINCTRL_PIN (11 ,"SPI0_MISO_IO_1" ), -PINCTRL_PIN (12 ,"SPI0_TPM_CSB" ), -PINCTRL_PIN (13 ,"SPI0_FLASH_0_CSB" ), -PINCTRL_PIN (14 ,"SPI0_FLASH_1_CSB" ), -PINCTRL_PIN (15 ,"SPI0_CLK" ), -PINCTRL_PIN (16 ,"SPI0_CLK_LOOPBK" ), +static const struct intel_padgroup tgllp_community4_gpps[] = { +TGL_GPP (0 ,171 ,194 ,256 ),/* GPP_C */ +TGL_GPP (1 ,195 ,219 ,288 ),/* GPP_F */ +TGL_GPP (2 ,220 ,225 ,TGL_NO_GPIO ),/* HVCMOS */ +TGL_GPP (3 ,226 ,250 ,320 ),/* GPP_E */ +TGL_GPP (4 ,251 ,259 ,TGL_NO_GPIO ),/* JTAG */ };static const struct intel_padgroup tgllp_community5_gpps[] = { -TGL_GPP (0 ,0 ,7 ),/* GPP_R */ -TGL_GPP (1 ,8 ,16 ),/* SPI */ -}; - -static const struct intel_community tgllp_community5[] = { -TGL_COMMUNITY (0 ,16 , tgllp_community5_gpps), +TGL_GPP (0 ,260 ,267 ,352 ),/* GPP_R */ +TGL_GPP (1 ,268 ,276 ,TGL_NO_GPIO ),/* SPI */ }; -static const struct intel_pinctrl_soc_data tgllp_community5_soc_data = { - .uid ="5" , - .pins = tgllp_community5_pins, - .npins =ARRAY_SIZE (tgllp_community5_pins), - .communities = tgllp_community5, - .ncommunities =ARRAY_SIZE (tgllp_community5), +static const struct intel_community tgllp_communities[] = { +TGL_COMMUNITY (0 ,0 ,66 , tgllp_community0_gpps), +TGL_COMMUNITY (1 ,67 ,170 , tgllp_community1_gpps), +TGL_COMMUNITY (2 ,171 ,259 , tgllp_community4_gpps), +TGL_COMMUNITY (3 ,260 ,276 , tgllp_community5_gpps), }; -static const struct intel_pinctrl_soc_data *tgllp_soc_data_array[] = { - &tgllp_community0_soc_data, - &tgllp_community1_soc_data, - &tgllp_community4_soc_data, - &tgllp_community5_soc_data, -NULL +static const struct intel_pinctrl_soc_data tgllp_soc_data = { + .pins = tgllp_pins, + .npins =ARRAY_SIZE (tgllp_pins), + .communities = tgllp_communities, + .ncommunities =ARRAY_SIZE (tgllp_communities), };static const struct acpi_device_id tgl_pinctrl_acpi_match[] = { - {"INT34C5" , (kernel_ulong_t )tgllp_soc_data_array }, + {"INT34C5" , (kernel_ulong_t)&tgllp_soc_data }, { } };MODULE_DEVICE_TABLE (acpi, tgl_pinctrl_acpi_match);
@@ -438,7 +391,7 @@ MODULE_DEVICE_TABLE(acpi, tgl_pinctrl_acpi_match);static INTEL_PINCTRL_PM_OPS (tgl_pinctrl_pm_ops);static struct platform_driver tgl_pinctrl_driver = { - .probe = intel_pinctrl_probe_by_uid, + .probe = intel_pinctrl_probe_by_hid, .driver = { .name ="tigerlake-pinctrl" , .acpi_match_table = tgl_pinctrl_acpi_match,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 280/399 RDMA/mlx5: Dont fake udata for kernel path
In reply to Greg Kroah-HartmanFrom: Leon Romanovsky <[email protected]>
[ Upstream commit 4835709176e8ccf6561abc9f5c405293e008095f ]
Kernel paths must not set udata and provide NULL pointer, instead of faking zeroed udata struct.
--- drivers/infiniband/hw/mlx5/main.c | 34 +++++++++++++++---------------- 1 file changed, 16 insertions(+), 18 deletions(-)
drivers/infiniband/hw/mlx5/main.c +16 -18
@@ -815,6 +815,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,struct ib_device_attr *props, struct ib_udata *uhw) { + size_t uhw_outlen = (uhw) ? uhw->outlen : 0;struct mlx5_ib_dev *dev =to_mdev (ibdev);struct mlx5_core_dev *mdev = dev->mdev;int err = -ENOMEM ;
@@ -828,12 +829,12 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,u64 max_tso; resp_len =sizeof (resp.comp_mask) +sizeof (resp.response_length); -if (uhw->outlen && uhw->outlen < resp_len) +if (uhw_outlen && uhw_outlen < resp_len)return -EINVAL ; resp.response_length = resp_len; -if (uhw->inlen && !ib_is_udata_cleared (uhw,0 , uhw->inlen)) +if (uhw && uhw->inlen && !ib_is_udata_cleared (uhw,0 , uhw->inlen))return -EINVAL ;memset (props,0 ,sizeof (*props));
@@ -897,7 +898,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, props->raw_packet_caps |=IB_RAW_PACKET_CAP_CVLAN_STRIPPING ; -if (field_avail (typeof (resp), tso_caps, uhw->outlen)) { +if (field_avail (typeof (resp), tso_caps, uhw_outlen)) { max_tso =MLX5_CAP_ETH (mdev, max_lso_cap);if (max_tso) { resp.tso_caps.max_tso =1 << max_tso;
@@ -907,7 +908,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, } } -if (field_avail (typeof (resp), rss_caps, uhw->outlen)) { +if (field_avail (typeof (resp), rss_caps, uhw_outlen)) { resp.rss_caps.rx_hash_function =MLX5_RX_HASH_FUNC_TOEPLITZ ; resp.rss_caps.rx_hash_fields_mask =
@@ -927,9 +928,9 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, resp.response_length +=sizeof (resp.rss_caps); } }else { -if (field_avail (typeof (resp), tso_caps, uhw->outlen)) +if (field_avail (typeof (resp), tso_caps, uhw_outlen)) resp.response_length +=sizeof (resp.tso_caps); -if (field_avail (typeof (resp), rss_caps, uhw->outlen)) +if (field_avail (typeof (resp), rss_caps, uhw_outlen)) resp.response_length +=sizeof (resp.rss_caps); }
@@ -1054,7 +1055,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,MLX5_MAX_CQ_PERIOD ; } -if (field_avail (typeof (resp), cqe_comp_caps, uhw->outlen)) { +if (field_avail (typeof (resp), cqe_comp_caps, uhw_outlen)) { resp.response_length +=sizeof (resp.cqe_comp_caps);if (MLX5_CAP_GEN (dev->mdev, cqe_compression)) {
@@ -1072,7 +1073,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, } } -if (field_avail (typeof (resp), packet_pacing_caps, uhw->outlen) && +if (field_avail (typeof (resp), packet_pacing_caps, uhw_outlen) && raw_support) {if (MLX5_CAP_QOS (mdev, packet_pacing) &&MLX5_CAP_GEN (mdev, qos)) {
@@ -1091,7 +1092,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, }if (field_avail (typeof (resp), mlx5_ib_support_multi_pkt_send_wqes, - uhw->outlen)) { + uhw_outlen)) {if (MLX5_CAP_ETH (mdev, multi_pkt_send_wqe)) resp.mlx5_ib_support_multi_pkt_send_wqes =MLX5_IB_ALLOW_MPW ;
@@ -1104,7 +1105,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,sizeof (resp.mlx5_ib_support_multi_pkt_send_wqes); } -if (field_avail (typeof (resp), flags, uhw->outlen)) { +if (field_avail (typeof (resp), flags, uhw_outlen)) { resp.response_length +=sizeof (resp.flags);if (MLX5_CAP_GEN (mdev, cqe_compression_128))
@@ -1120,8 +1121,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, resp.flags |=MLX5_IB_QUERY_DEV_RESP_FLAGS_SCAT2CQE_DCT ; } -if (field_avail (typeof (resp), sw_parsing_caps, - uhw->outlen)) { +if (field_avail (typeof (resp), sw_parsing_caps, uhw_outlen)) { resp.response_length +=sizeof (resp.sw_parsing_caps);if (MLX5_CAP_ETH (mdev, swp)) { resp.sw_parsing_caps.sw_parsing_offloads |=
@@ -1141,7 +1141,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, } } -if (field_avail (typeof (resp), striding_rq_caps, uhw->outlen) && +if (field_avail (typeof (resp), striding_rq_caps, uhw_outlen) && raw_support) { resp.response_length +=sizeof (resp.striding_rq_caps);if (MLX5_CAP_GEN (mdev, striding_rq)) {
@@ -1164,8 +1164,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, } } -if (field_avail (typeof (resp), tunnel_offloads_caps, - uhw->outlen)) { +if (field_avail (typeof (resp), tunnel_offloads_caps, uhw_outlen)) { resp.response_length +=sizeof (resp.tunnel_offloads_caps);if (MLX5_CAP_ETH (mdev, tunnel_stateless_vxlan)) resp.tunnel_offloads_caps |=
@@ -1186,7 +1185,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,MLX5_IB_TUNNELED_OFFLOADS_MPLS_UDP ; } -if (uhw->outlen) { +if (uhw_outlen) { err =ib_copy_to_udata (uhw, &resp, resp.response_length);if (err)
@@ -4771,7 +4770,6 @@ static int __get_port_caps(struct mlx5_ib_dev *dev, u8 port)struct ib_device_attr *dprops =NULL ;struct ib_port_attr *pprops =NULL ;int err = -ENOMEM ; -struct ib_udata uhw = {.inlen =0 , .outlen =0 }; pprops =kzalloc (sizeof (*pprops),GFP_KERNEL );if (!pprops)
@@ -4781,7 +4779,7 @@ static int __get_port_caps(struct mlx5_ib_dev *dev, u8 port)if (!dprops) goto out; - err =mlx5_ib_query_device (&dev->ib_dev, dprops, &uhw); + err =mlx5_ib_query_device (&dev->ib_dev, dprops,NULL );if (err) {mlx5_ib_warn (dev,"query_device failed %d\n" , err); goto out;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 281/399 arm64: lse: fix LSE atomics with LLVMs integrated assembler
In reply to Greg Kroah-HartmanFrom: Sami Tolvanen <[email protected]>
[ Upstream commit e0d5896bd356cd577f9710a02d7a474cdf58426b ]
Unlike gcc, clang considers each inline assembly block to be independent and therefore, when using the integrated assembler for inline assembly, any preambles that enable features must be repeated in each block.
This change defines __LSE_PREAMBLE and adds it to each inline assembly block that has LSE instructions, which allows them to be compiled also with clang's assembler.
--- arch/arm64/include/asm/atomic_lse.h | 19 +++++++++++++++++++ arch/arm64/include/asm/lse.h | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-)
arch/arm64/include/asm/atomic_lse.h +19 -0
@@ -14,6 +14,7 @@ static inline void __lse_atomic_##op(int i, atomic_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " " #asm_op " %w[i], %[v]\n" \ : [i] "+r" (i), [v] "+Q" (v->counter) \ : "r" (v)); \
@@ -30,6 +31,7 @@ ATOMIC_OP(add, stadd) static inline int __lse_atomic_fetch_##op##name(int i, atomic_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " " #asm_op #mb " %w[i], %w[i], %[v]" \ : [i] "+r" (i), [v] "+Q" (v->counter) \ : "r" (v) \
@@ -58,6 +60,7 @@ static inline int __lse_atomic_add_return##name(int i, atomic_t *v) \u32 tmp; \ \ asm volatile( \ + __LSE_PREAMBLE \ " ldadd" #mb " %w[i], %w[tmp], %[v]\n" \ " add %w[i], %w[i], %w[tmp]" \ : [i] "+r" (i), [v] "+Q" (v->counter), [tmp] "=&r" (tmp) \
@@ -77,6 +80,7 @@ ATOMIC_OP_ADD_RETURN( , al, "memory")static inline void __lse_atomic_and (int i,atomic_t *v) { asmvolatile ( + __LSE_PREAMBLE" mvn %w[i], %w[i]\n" " stclr %w[i], %[v]" : [i] "+&r" (i), [v] "+Q" (v->counter)
@@ -87,6 +91,7 @@ static inline void __lse_atomic_and(int i, atomic_t *v) static inline int __lse_atomic_fetch_and##name(int i, atomic_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " mvn %w[i], %w[i]\n" \ " ldclr" #mb " %w[i], %w[i], %[v]" \ : [i] "+&r" (i), [v] "+Q" (v->counter) \
@@ -106,6 +111,7 @@ ATOMIC_FETCH_OP_AND( , al, "memory")static inline void __lse_atomic_sub (int i,atomic_t *v) { asmvolatile ( + __LSE_PREAMBLE" neg %w[i], %w[i]\n" " stadd %w[i], %[v]" : [i] "+&r" (i), [v] "+Q" (v->counter)
@@ -118,6 +124,7 @@ static inline int __lse_atomic_sub_return##name(int i, atomic_t *v) \u32 tmp; \ \ asm volatile( \ + __LSE_PREAMBLE \ " neg %w[i], %w[i]\n" \ " ldadd" #mb " %w[i], %w[tmp], %[v]\n" \ " add %w[i], %w[i], %w[tmp]" \
@@ -139,6 +146,7 @@ ATOMIC_OP_SUB_RETURN( , al, "memory") static inline int __lse_atomic_fetch_sub##name(int i, atomic_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " neg %w[i], %w[i]\n" \ " ldadd" #mb " %w[i], %w[i], %[v]" \ : [i] "+&r" (i), [v] "+Q" (v->counter) \
@@ -159,6 +167,7 @@ ATOMIC_FETCH_OP_SUB( , al, "memory") static inline void __lse_atomic64_##op(s64 i, atomic64_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " " #asm_op " %[i], %[v]\n" \ : [i] "+r" (i), [v] "+Q" (v->counter) \ : "r" (v)); \
@@ -175,6 +184,7 @@ ATOMIC64_OP(add, stadd) static inline long __lse_atomic64_fetch_##op##name(s64 i, atomic64_t *v)\ { \ asm volatile( \ + __LSE_PREAMBLE \ " " #asm_op #mb " %[i], %[i], %[v]" \ : [i] "+r" (i), [v] "+Q" (v->counter) \ : "r" (v) \
@@ -203,6 +213,7 @@ static inline long __lse_atomic64_add_return##name(s64 i, atomic64_t *v)\unsigned long tmp; \ \ asm volatile( \ + __LSE_PREAMBLE \ " ldadd" #mb " %[i], %x[tmp], %[v]\n" \ " add %[i], %[i], %x[tmp]" \ : [i] "+r" (i), [v] "+Q" (v->counter), [tmp] "=&r" (tmp) \
@@ -222,6 +233,7 @@ ATOMIC64_OP_ADD_RETURN( , al, "memory")static inline void __lse_atomic64_and (s64 i,atomic64_t *v) { asmvolatile ( + __LSE_PREAMBLE" mvn %[i], %[i]\n" " stclr %[i], %[v]" : [i] "+&r" (i), [v] "+Q" (v->counter)
@@ -232,6 +244,7 @@ static inline void __lse_atomic64_and(s64 i, atomic64_t *v) static inline long __lse_atomic64_fetch_and##name(s64 i, atomic64_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " mvn %[i], %[i]\n" \ " ldclr" #mb " %[i], %[i], %[v]" \ : [i] "+&r" (i), [v] "+Q" (v->counter) \
@@ -251,6 +264,7 @@ ATOMIC64_FETCH_OP_AND( , al, "memory")static inline void __lse_atomic64_sub (s64 i,atomic64_t *v) { asmvolatile ( + __LSE_PREAMBLE" neg %[i], %[i]\n" " stadd %[i], %[v]" : [i] "+&r" (i), [v] "+Q" (v->counter)
@@ -263,6 +277,7 @@ static inline long __lse_atomic64_sub_return##name(s64 i, atomic64_t *v) \unsigned long tmp; \ \ asm volatile( \ + __LSE_PREAMBLE \ " neg %[i], %[i]\n" \ " ldadd" #mb " %[i], %x[tmp], %[v]\n" \ " add %[i], %[i], %x[tmp]" \
@@ -284,6 +299,7 @@ ATOMIC64_OP_SUB_RETURN( , al, "memory") static inline long __lse_atomic64_fetch_sub##name(s64 i, atomic64_t *v) \ { \ asm volatile( \ + __LSE_PREAMBLE \ " neg %[i], %[i]\n" \ " ldadd" #mb " %[i], %[i], %[v]" \ : [i] "+&r" (i), [v] "+Q" (v->counter) \
@@ -305,6 +321,7 @@ static inline s64 __lse_atomic64_dec_if_positive(atomic64_t *v)unsigned long tmp; asmvolatile ( + __LSE_PREAMBLE"1: ldr %x[tmp], %[v]\n" " subs %[ret], %x[tmp], #1\n" " b.lt 2f\n"
@@ -332,6 +349,7 @@ __lse__cmpxchg_case_##name##sz(volatile void *ptr, \unsigned long tmp; \ \ asm volatile( \ + __LSE_PREAMBLE \ " mov %" #w "[tmp], %" #w "[old]\n" \ " cas" #mb #sfx "\t%" #w "[tmp], %" #w "[new], %[v]\n" \ " mov %" #w "[ret], %" #w "[tmp]" \
@@ -379,6 +397,7 @@ __lse__cmpxchg_double##name(unsigned long old1, \ register unsigned long x4 asm ("x4") = (unsigned long)ptr; \ \ asm volatile( \ + __LSE_PREAMBLE \ " casp" #mb "\t%[old1], %[old2], %[new1], %[new2], %[v]\n"\ " eor %[old1], %[old1], %[oldval1]\n" \ " eor %[old2], %[old2], %[oldval2]\n" \
arch/arm64/include/asm/lse.h +3 -3
@@ -6,6 +6,8 @@#if defined(CONFIG_AS_LSE ) && defined(CONFIG_ARM64_LSE_ATOMICS ) +#define __LSE_PREAMBLE ".arch armv8-a+lse\n" +#include <linux/compiler_types.h> #include <linux/export.h> #include <linux/jump_label.h>
@@ -14,8 +16,6 @@#include <asm/atomic_lse.h> #include <asm/cpucaps.h> -__asm__(".arch_extension lse" ); -extern struct static_key_false cpu_hwcap_keys[ARM64_NCAPS ];extern struct static_key_false arm64_const_caps_ready;
@@ -34,7 +34,7 @@ static inline bool system_uses_lse_atomics(void)/* In-line patching at runtime */ #define ARM64_LSE_ATOMIC_INSN (llsc, lse) \ - ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS) + ALTERNATIVE(llsc, __LSE_PREAMBLE lse, ARM64_HAS_LSE_ATOMICS)#else /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 282/399 arm64: fix alternatives with LLVMs integrated assembler
In reply to Greg Kroah-HartmanFrom: Sami Tolvanen <[email protected]>
[ Upstream commit c54f90c2627cc316d365e3073614731e17dbc631 ]
LLVM's integrated assembler fails with the following error when building KVM:
<inline asm>:12:6: error: expected absolute expression
.if kvm_update_va_mask == 0
^
<inline asm>:21:6: error: expected absolute expression
.if kvm_update_va_mask == 0
^
<inline asm>:24:2: error: unrecognized instruction mnemonic
NOT_AN_INSTRUCTION
^LLVM ERROR: Error parsing inline asm
These errors come from ALTERNATIVE_CB and __ALTERNATIVE_CFG, which test for the existence of the callback parameter in inline assembly using the following expression:
" .if " __stringify(cb) " == 0\n"
This works with GNU as, but isn't supported by LLVM. This change splits __ALTERNATIVE_CFG and ALTINSTR_ENTRY into separate macros to fix the LLVM build.
--- arch/arm64/include/asm/alternative.h | 32 ++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-)
arch/arm64/include/asm/alternative.h +21 -11
@@ -35,13 +35,16 @@ void apply_alternatives_module(void *start, size_t length);static inline void apply_alternatives_module (void *start,size_t length) { }#endif -#define ALTINSTR_ENTRY (feature,cb) \ +#define ALTINSTR_ENTRY (feature) \ " .word 661b - .\n"/* label */ \ - " .if " __stringify(cb) " == 0\n" \" .word 663f - .\n" /* new instruction */ \ -" .else\n" \ + " .hword " __stringify(feature) "\n" /* feature bit */ \ +" .byte 662b-661b\n" /* source len */ \ + " .byte 664f-663f\n" /* replacement len */ + +#define ALTINSTR_ENTRY_CB (feature, cb) \ + " .word 661b - .\n"/* label */ \ " .word " __stringify(cb) "- .\n" /* callback */ \ -" .endif\n" \ " .hword " __stringify(feature) "\n" /* feature bit */ \" .byte 662b-661b\n" /* source len */ \" .byte 664f-663f\n" /* replacement len */
@@ -62,15 +65,14 @@ static inline void apply_alternatives_module(void *start, size_t length) { }* * Alternatives with callbacks do not generate replacement instructions. */ -#define __ALTERNATIVE_CFG (oldinstr, newinstr, feature, cfg_enabled, cb) \ +#define __ALTERNATIVE_CFG (oldinstr, newinstr, feature, cfg_enabled) \ ".if "__stringify(cfg_enabled)" == 1\n" \ "661:\n\t" \ oldinstr "\n" \ "662:\n" \ ".pushsection .altinstructions,\"a\"\n" \ - ALTINSTR_ENTRY(feature,cb) \ + ALTINSTR_ENTRY(feature) \ ".popsection\n" \ - " .if " __stringify(cb) " == 0\n" \ ".pushsection .altinstr_replacement, \"a\"\n" \ "663:\n\t" \ newinstr "\n" \
@@ -78,17 +80,25 @@ static inline void apply_alternatives_module(void *start, size_t length) { }".popsection\n\t" \".org . - (664b-663b) + (662b-661b)\n\t" \".org . - (662b-661b) + (664b-663b)\n" \ -".else\n\t" \ + ".endif\n" + +#define __ALTERNATIVE_CFG_CB (oldinstr, feature, cfg_enabled, cb) \ + ".if "__stringify(cfg_enabled)" == 1\n" \ + "661:\n\t" \ + oldinstr "\n" \ + "662:\n" \ + ".pushsection .altinstructions,\"a\"\n" \ + ALTINSTR_ENTRY_CB(feature, cb) \ + ".popsection\n" \ "663:\n\t" \ "664:\n\t" \ -".endif\n" \ ".endif\n"#define _ALTERNATIVE_CFG (oldinstr, newinstr, feature, cfg, ...) \ - __ALTERNATIVE_CFG(oldinstr, newinstr, feature, IS_ENABLED(cfg), 0) + __ALTERNATIVE_CFG(oldinstr, newinstr, feature, IS_ENABLED(cfg))#define ALTERNATIVE_CB (oldinstr, cb) \ - __ALTERNATIVE_CFG(oldinstr, "NOT_AN_INSTRUCTION", ARM64_CB_PATCH, 1, cb) + __ALTERNATIVE_CFG_CB(oldinstr, ARM64_CB_PATCH, 1, cb)#else #include <asm/assembler.h>
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 283/399 drm/amd/display: fixup DML dependencies
In reply to Greg Kroah-HartmanFrom: Jun Lei <[email protected]>
[ Upstream commit 34ad0230062c39cdcba564d16d122c0fb467a7d6 ]
[why]
Need to fix DML portability issues to enable SW unit testing around DML
[how]
Move calcs into dc include folder since multiple components reference it Remove relative paths to external dependencies
---
drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.c | 2 +-
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h | 2 +-
drivers/gpu/drm/amd/display/dc/{calcs => inc}/dcn_calc_math.h | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename drivers/gpu/drm/amd/display/dc/{calcs => inc}/dcn_calc_math.h (100%)drivers/gpu/drm/amd/display/dc/dml/dml_common_defs.c +1 -1
@@ -24,7 +24,7 @@*/ #include "dml_common_defs.h" -#include "../calcs/dcn_calc_math.h" +#include "dcn_calc_math.h" #include "dml_inline_defs.h"
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h +1 -1
@@ -27,7 +27,7 @@#define __DML_INLINE_DEFS_H__#include "dml_common_defs.h" -#include "../calcs/dcn_calc_math.h" +#include "dcn_calc_math.h" #include "dml_logger.h" static inline double dml_min (double a,double b)
drivers/gpu/drm/amd/display/dc/inc/dcn_calc_math.h renamed from drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.h +0 -0
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 284/399 staging: wfx: fix possible overflow on jiffies comparaison
In reply to Greg Kroah-HartmanFrom: Jérôme Pouiller <[email protected]>
[ Upstream commit def39be019b6494acd3570ce6f3f11ba1c3203a3 ]
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It is recommended to use function time_*() to compare jiffies.
--- drivers/staging/wfx/data_tx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/staging/wfx/data_tx.c +5 -9
@@ -282,8 +282,7 @@ void wfx_tx_policy_init(struct wfx_vif *wvif)static int wfx_alloc_link_id (struct wfx_vif *wvif,const u8 *mac) {int i, ret =0 ; -unsigned long max_inactivity =0 ; -unsigned long now = jiffies; +unsigned long oldest;spin_lock_bh (&wvif->ps_state_lock);for (i =0 ; i <WFX_MAX_STA_IN_AP_MODE ; ++i) {
@@ -292,13 +291,10 @@ static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac)break ; }else if (wvif->link_id_db[i].status !=WFX_LINK_HARD && !wvif->wdev->tx_queue_stats.link_map_cache[i +1 ]) { -unsigned long inactivity = - now - wvif->link_id_db[i].timestamp; - -if (inactivity < max_inactivity) -continue ; - max_inactivity = inactivity; - ret = i +1 ; +if (!ret ||time_after (oldest, wvif->link_id_db[i].timestamp)) { + oldest = wvif->link_id_db[i].timestamp; + ret = i +1 ; + } } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 285/399 EDAC/sifive: Fix return value check in ecc_register()
In reply to Greg Kroah-HartmanFrom: Wei Yongjun <[email protected]>
[ Upstream commit 6cd18453b68942913fd3b1913b707646e544c2ac ]
In case of error, the function edac_device_alloc_ctl_info() returns a NULL pointer, not ERR_PTR(). Replace the IS_ERR() test in the return value check with a NULL test.
--- drivers/edac/sifive_edac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/sifive_edac.c +2 -2
@@ -54,8 +54,8 @@ static int ecc_register(struct platform_device *pdev) p->dci =edac_device_alloc_ctl_info (0 ,"sifive_ecc" ,1 ,"sifive_ecc" ,1 ,1 ,NULL ,0 ,edac_device_alloc_index ()); -if (IS_ERR (p->dci)) -return PTR_ERR (p->dci); +if (!p->dci) +return -ENOMEM ; p->dci->dev = &pdev->dev; p->dci->mod_name ="Sifive ECC Manager" ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 286/399 KVM: PPC: Remove set but not used variable ra, rs, rt
In reply to Greg Kroah-HartmanFrom: zhengbin <[email protected]>
[ Upstream commit 4de0a8355463e068e443b48eb5ae32370155368b ]
Fixes gcc '-Wunused-but-set-variable' warning:
arch/powerpc/kvm/emulate_loadstore.c: In function kvmppc_emulate_loadstore:arch/powerpc/kvm/emulate_loadstore.c:87:6: warning: variable ra set but not used [-Wunused-but-set-variable] arch/powerpc/kvm/emulate_loadstore.c: In function kvmppc_emulate_loadstore:arch/powerpc/kvm/emulate_loadstore.c:87:10: warning: variable rs set but not used [-Wunused-but-set-variable] arch/powerpc/kvm/emulate_loadstore.c: In function kvmppc_emulate_loadstore:arch/powerpc/kvm/emulate_loadstore.c:87:14: warning: variable rt set but not used [-Wunused-but-set-variable]
They are not used since commit 2b33cb585f94 ("KVM: PPC: Reimplement LOAD_FP/STORE_FP instruction mmio emulation with analyse_instr() input")
--- arch/powerpc/kvm/emulate_loadstore.c | 5 ----- 1 file changed, 5 deletions(-)
arch/powerpc/kvm/emulate_loadstore.c +0 -5
@@ -73,7 +73,6 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu) {struct kvm_run *run = vcpu->run;u32 inst; -int ra, rs, rt;enum emulation_result emulated =EMULATE_FAIL ;int advance =1 ;struct instruction_op op;
@@ -85,10 +84,6 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)if (emulated !=EMULATE_DONE )return emulated; - ra =get_ra (inst); - rs =get_rs (inst); - rt =get_rt (inst); - vcpu->arch.mmio_vsx_copy_nums =0 ; vcpu->arch.mmio_vsx_offset =0 ; vcpu->arch.mmio_copy_type =KVMPPC_VSX_COPY_NONE ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 287/399 arm64: dts: ti: k3-j721e-main: Add missing power-domains for smmu
In reply to Greg Kroah-HartmanFrom: Lokesh Vutla <[email protected]>
[ Upstream commit 3f03a58b25753843ce9e4511e9e246c51bd11011 ]
Add power-domains entry for smmu, so that the it is accessible as long as the driver is active. Without this device shutdown is throwing the below warning:
"[ 44.736348] arm-smmu-v3 36600000.smmu: failed to clear cr0"
--- arch/arm64/boot/dts/ti/k3-j721e-main.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi +1 -0
@@ -43,6 +43,7 @@ smmu0: smmu@36600000 { compatible = "arm,smmu-v3"; reg = <0x0 0x36600000 0x0 0x100000>; + power-domains = <&k3_pds 229 TI_SCI_PD_EXCLUSIVE>; interrupt-parent = <&gic500>; interrupts = <GIC_SPI 772 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 768 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 288/399 sched/core: Fix size of rq::uclamp initialization
In reply to Greg Kroah-HartmanFrom: Li Guanglei <[email protected]>
[ Upstream commit dcd6dffb0a75741471297724640733fa4e958d72 ]
rq::uclamp is an array of struct uclamp_rq, make sure we clear the whole thing.
--- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/core.c +2 -1
@@ -1253,7 +1253,8 @@ static void __init init_uclamp(void)mutex_init (&uclamp_mutex);for_each_possible_cpu (cpu) { -memset (&cpu_rq (cpu)->uclamp,0 ,sizeof (struct uclamp_rq )); +memset (&cpu_rq (cpu)->uclamp,0 , +sizeof (struct uclamp_rq )*UCLAMP_CNT );cpu_rq (cpu)->uclamp_flags =0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 289/399 sched/topology: Assert non-NUMA topology masks dont (partially) overlap
In reply to Greg Kroah-HartmanFrom: Valentin Schneider <[email protected]>
[ Upstream commit ccf74128d66ce937876184ad55db2e0276af08d3 ]
topology.c::get_group() relies on the assumption that non-NUMA domains do not partially overlap. Zeng Tao pointed out in [1] that such topology descriptions, while completely bogus, can end up being exposed to the scheduler.
In his example (8 CPUs, 2-node system), we end up with:
MC span for CPU3 == 3-7
MC span for CPU4 == 4-7
The first pass through get_group(3, sdd@MC) will result in the following sched_group list:
3 -> 4 -> 5 -> 6 -> 7
^ /
`----------------'
And a later pass through get_group(4, sdd@MC) will "corrupt" that to:
3 -> 4 -> 5 -> 6 -> 7
^ / `-----------'
which will completely break things like 'while (sg != sd->groups)' when using CPU3's base sched_domain.
There already are some architecture-specific checks in place such as x86/kernel/smpboot.c::topology.sane(), but this is something we can detect in the core scheduler, so it seems worthwhile to do so.
Warn and abort the construction of the sched domains if such a broken topology description is detected. Note that this is somewhat expensive (O(t.c²), 't' non-NUMA topology levels and 'c' CPUs) and could be gated under SCHED_DEBUG if deemed necessary.
Testing
=======
Dietmar managed to reproduce this using the following qemu incantation:
$ qemu-system-aarch64 -kernel ./Image -hda ./qemu-image-aarch64.img \ -append 'root=/dev/vda console=ttyAMA0 loglevel=8 sched_debug' -smp \ cores=8 --nographic -m 512 -cpu cortex-a53 -machine virt -numa \ node,cpus=0-2,nodeid=0 -numa node,cpus=3-7,nodeid=1
alongside the following drivers/base/arch_topology.c hack (AIUI wouldn't be needed if '-smp cores=X, sockets=Y' would work with qemu):
8<---
@@ -465,6 +465,9 @@ void update_siblings_masks(unsigned int cpuid)
if (cpuid_topo->package_id != cpu_topo->package_id)
continue;
+ if ((cpu < 4 && cpuid > 3) || (cpu > 3 && cpuid < 4))
+ continue;
+
cpumask_set_cpu(cpuid, &cpu_topo->core_sibling); cpumask_set_cpu(cpu, &cpuid_topo->core_sibling);
8<---
[1]: https://lkml.kernel.org/r/[email protected]
--- kernel/sched/topology.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
kernel/sched/topology.c +39 -0
@@ -1879,6 +1879,42 @@ static struct sched_domain *build_sched_domain(struct sched_domain_topology_levereturn sd; } +/* +* Ensure topology masks are sane, i.e. there are no conflicts (overlaps) for +* any two given CPUs at this (non-NUMA) topology level. +*/ +static bool topology_span_sane (struct sched_domain_topology_level *tl, +const struct cpumask *cpu_map,int cpu) +{ +int i; + +/* NUMA levels are allowed to overlap */ +if (tl->flags &SDTL_OVERLAP ) +return true; + +/* +* Non-NUMA levels cannot partially overlap - they must be either +* completely equal or completely disjoint. Otherwise we can end up +* breaking the sched_group lists - i.e. a later get_group() pass +* breaks the linking done for an earlier span. +*/ +for_each_cpu (i, cpu_map) { +if (i == cpu) +continue ; +/* +* We should 'and' all those masks with 'cpu_map' to exactly +* match the topology we're about to build, but that can only +* remove CPUs, which only lessens our ability to detect +* overlaps +*/ +if (!cpumask_equal (tl->mask (cpu), tl->mask (i)) && +cpumask_intersects (tl->mask (cpu), tl->mask (i))) +return false; + } + +return true; +} +/* * Find the sched_domain_topology_level where all CPU capacities are visible * for all CPUs.
@@ -1975,6 +2011,9 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att has_asym = true; } +if (WARN_ON (!topology_span_sane (tl, cpu_map, i))) + goto error; + sd =build_sched_domain (tl, cpu_map, attr, sd, dflags, i);if (tl == sched_domain_topology)
Signature · 1 line
2.20.1