From patchwork Sun Dec 29 17:22:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182552 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5458964ild; Sun, 29 Dec 2019 09:44:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyVfULox3UQw/UYea0u7mXYvRiH36P7FV17cV9HlVaGDNiWqCtbZyI5EM9Uv/jYaNqZT5DN X-Received: by 2002:a9d:68cb:: with SMTP id i11mr65454191oto.210.1577641492370; Sun, 29 Dec 2019 09:44:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641492; cv=none; d=google.com; s=arc-20160816; b=T8BNJiMoGOMvzBwqAB5y1am5xpdPkLyKh8BD8BZLUqFFSAl9ozxhtINQcYwo2zarSJ WVqttqBtLAzRlYc82KplkUcXlaNj2Ao09in0nidZdLVKK4ZM4E86PwsHfcuXypIt0OJ7 //Vc6Au0cw8zicTZIhilzxsm4P391FRPD5N4zFIgdXOLIsnoYcdxSr+UCYH685vKwHlQ RGMZ0gx0u2iJ0FEgOZT28jR7Ifqif0ftKuPnpYCIIN1vL+am8ysJsG5SdgkhcnMo26IZ pVYkrm5hBficRtDQEhPLOfoEkj4HAq7sIcX1lqNME5wusoMfC4thIfk0sTD0Q5hhwrNY L70Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=T4M4SJc5pDswSuKJ6wHeBaBrAJiwcNhKFlF71XuZuhk=; b=CIkebHoZY1ver83CYpQFoedOb037RL8wurWE1NSKZyutK95C4b4fDl7FX9oiOv/sZj G8CqHMUaGXcyeUGdyKyR9YLejdzGkqwSlRAM13Avzy0abwmBaPa4QTkFuhHUIqp7zdMB ge7dbhJvrdcPZr0FAGE7ISYkzMbpuAoHTemHdUhpDHdJe45pR4gSUuQDkONHTfWh7v9k l4eIx75UkAP6pU9RfbgMuwwaIySgqWlXSAS+xJMzjo58bVTI/mpCF8kBec3GNKVtIunu /4V3yE/WWKQL5SqxASsXMM67Xa+ZAFFTV8Nv6abrhmv6PtMlcUBGcd0DFq/fG8u/Ia3R 4T+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lO0CEVPU; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si22944922otn.180.2019.12.29.09.44.52; Sun, 29 Dec 2019 09:44:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lO0CEVPU; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730369AbfL2Rou (ORCPT + 14 others); Sun, 29 Dec 2019 12:44:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:53290 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730790AbfL2Rou (ORCPT ); Sun, 29 Dec 2019 12:44:50 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2CCFC206DB; Sun, 29 Dec 2019 17:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641489; bh=LniEfBpbtRahalkZJtD5PFh1Q7cv0pt9RRnylEHr1hY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lO0CEVPUsKGz515yrBz1D5D+RfgDtzbgNpqElbD787NeBhidKnRIsUvhh2NjK483K X2v/SOrNAiKVEu35ACuxV4t8ltQMn8RXpxwCG/kvi/7Gh6EmK2JgAZkfNvp7oEH8Sw CLkknTouxbHnnnpgzTPIobRvu6ullqG1V7gON4OE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Loic Poulain , Stanimir Varbanov , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.4 087/434] media: venus: core: Fix msm8996 frequency table Date: Sun, 29 Dec 2019 18:22:20 +0100 Message-Id: <20191229172707.326729999@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Loic Poulain [ Upstream commit c690435ed07901737e5c007a65ec59f53b33eb71 ] In downstream driver, there are two frequency tables defined, one for the encoder and one for the decoder: /* Encoders / <972000 490000000 0x55555555>, / 4k UHD @ 30 / <489600 320000000 0x55555555>, / 1080p @ 60 / <244800 150000000 0x55555555>, / 1080p @ 30 / <108000 75000000 0x55555555>, / 720p @ 30 */ /* Decoders / <1944000 490000000 0xffffffff>, / 4k UHD @ 60 / < 972000 320000000 0xffffffff>, / 4k UHD @ 30 / < 489600 150000000 0xffffffff>, / 1080p @ 60 / < 244800 75000000 0xffffffff>; / 1080p @ 30 */ It shows that encoder always needs a higher clock than decoder. In current venus driver, the unified frequency table is aligned with the downstream decoder table which causes performance issues in encoding scenarios. Fix that by aligning frequency table on worst case (encoding). Signed-off-by: Loic Poulain Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index e6eff512a8a1..84e982f259a0 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -427,10 +427,11 @@ static const struct venus_resources msm8916_res = { }; static const struct freq_tbl msm8996_freq_table[] = { - { 1944000, 490000000 }, /* 4k UHD @ 60 */ - { 972000, 320000000 }, /* 4k UHD @ 30 */ - { 489600, 150000000 }, /* 1080p @ 60 */ - { 244800, 75000000 }, /* 1080p @ 30 */ + { 1944000, 520000000 }, /* 4k UHD @ 60 (decode only) */ + { 972000, 520000000 }, /* 4k UHD @ 30 */ + { 489600, 346666667 }, /* 1080p @ 60 */ + { 244800, 150000000 }, /* 1080p @ 30 */ + { 108000, 75000000 }, /* 720p @ 30 */ }; static const struct reg_val msm8996_reg_preset[] = { From patchwork Sun Dec 29 17:22:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182553 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5459211ild; Sun, 29 Dec 2019 09:45:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzbcF9iMFvEpzE9m82Tdav2kZTRlgWqnjS2lQRp6bV6bP56npt1lowgHPN8nAgsg/xsVinu X-Received: by 2002:a9d:ed5:: with SMTP id 79mr70409722otj.72.1577641514123; Sun, 29 Dec 2019 09:45:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641514; cv=none; d=google.com; s=arc-20160816; b=AwmfAa9m8ylwNrPNBsC/+sQTesZZ3EkXln8MmWS3HKJaY5Xz9LS0/47j1QVgCk3e9a hS3ScJuioxFbOdMIL/ALLG7XGn5WUcqH6bFkaXwLhqiSEdif0QT0Z7Il2pHnJkHCVZ3t 3fLsxneLUwTzp3KPNdmBWxbxbpDmA9PF5J48dY8yNxjtmSTe/txbDnivhKZb/Et48CyF xtvsxmV1fwFx3poBYY+D1GNQEYjOGNSzuvu5hex/XfNEq8ryDcorgGfrDrJV48Bud2xt eYxG6RPGzy7O289+NnQehCmCLj5KI/WtH/NbbULuXea1spII3tvqIEoFWaQIcNmK9NYA rKRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qVFm7Njw+DtIWdbl9hrRldto+Oumtpr3c8sSsQCOANA=; b=BeVW/GSz6EnAhSWzfNunfqNIQZGOv0I5pSU0hh4WWK4/yOv8S4TuADszz3PeIai3Ip ZnNdDrjJ0IEsNcL6AwJAVHjUx/DIQdfYRwUZZL9vIhbDOFuds0zQqFxk+BhFESic+lj5 c7/Gk/F1WG5YDYoF3vppkZmr/RxVkv53W+LCkP5r1X3qk7LqLTfjy1aGuDFFMzGq2M/5 WcF5CytAl/5N+v6/TcSa8N3yoew1DycsuAU4kEuK+V2szgbCcfV4b4YTsc52ROQL1US8 j13S3Rl3Ga5qHDknRtRFGWvxFxKoc98VuC7S28G5QQcIHoKHCMP7Ot/1VRU/PSNgxLNJ obAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="GI/Dqzph"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si22018137oto.116.2019.12.29.09.45.13; Sun, 29 Dec 2019 09:45:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="GI/Dqzph"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730852AbfL2RpN (ORCPT + 14 others); Sun, 29 Dec 2019 12:45:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:53950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730844AbfL2RpJ (ORCPT ); Sun, 29 Dec 2019 12:45:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8223B207FD; Sun, 29 Dec 2019 17:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641509; bh=qwBSQ4mPR8y2C+OqTwzQ7Ingo8tM8DD5G2X5Hxi3gfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GI/DqzphNPPWoBwdi3YBsNdL0tGpnmb8YPAmSs6nUhCOYRTnEkYfJ87coLozde1Zt akF2QsfXvE8o1kLA9/kEkyJnbAqpLhmXn576euzIMNtdnW8y25bjEh8j+OVZcYfL19 Rtfl5QfIsmi4qnEm6CK2lHJiBIfC5fzxN8bt5nx8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Borislav Petkov , Kees Cook , "H. Peter Anvin" , Bill Metzenthen , Ingo Molnar , Thomas Gleixner , x86-ml , Sasha Levin Subject: [PATCH 5.4 094/434] x86/math-emu: Check __copy_from_user() result Date: Sun, 29 Dec 2019 18:22:27 +0100 Message-Id: <20191229172707.810344347@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit e6b44ce1925a8329a937c57f0d60ba0d9bb5d226 ] The new __must_check annotation on __copy_from_user() successfully identified some code that has lacked the check since at least linux-2.1.73: arch/x86/math-emu/reg_ld_str.c:88:2: error: ignoring return value of \ function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]         __copy_from_user(sti_ptr, s, 10);         ^~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~ arch/x86/math-emu/reg_ld_str.c:1129:2: error: ignoring return value of \ function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]         __copy_from_user(register_base + offset, s, other);         ^~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/math-emu/reg_ld_str.c:1131:3: error: ignoring return value of \ function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result]                 __copy_from_user(register_base, s + other, offset);                 ^~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In addition, the get_user()/put_user() helpers do not enforce a return value check, but actually still require one. These have been missing for even longer. Change the internal wrappers around get_user()/put_user() to force a signal and add a corresponding wrapper around __copy_from_user() to check all such cases. [ bp: Break long lines. ] Fixes: 257e458057e5 ("Import 2.1.73") Fixes: 9dd819a15162 ("uaccess: add missing __must_check attributes") Signed-off-by: Arnd Bergmann Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Cc: "H. Peter Anvin" Cc: Bill Metzenthen Cc: Ingo Molnar Cc: Thomas Gleixner Cc: x86-ml Link: https://lkml.kernel.org/r/20191001142344.1274185-1-arnd@arndb.de Signed-off-by: Sasha Levin --- arch/x86/math-emu/fpu_system.h | 6 ++++-- arch/x86/math-emu/reg_ld_str.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h index f98a0c956764..9b41391867dc 100644 --- a/arch/x86/math-emu/fpu_system.h +++ b/arch/x86/math-emu/fpu_system.h @@ -107,6 +107,8 @@ static inline bool seg_writable(struct desc_struct *d) #define FPU_access_ok(y,z) if ( !access_ok(y,z) ) \ math_abort(FPU_info,SIGSEGV) #define FPU_abort math_abort(FPU_info, SIGSEGV) +#define FPU_copy_from_user(to, from, n) \ + do { if (copy_from_user(to, from, n)) FPU_abort; } while (0) #undef FPU_IGNORE_CODE_SEGV #ifdef FPU_IGNORE_CODE_SEGV @@ -122,7 +124,7 @@ static inline bool seg_writable(struct desc_struct *d) #define FPU_code_access_ok(z) FPU_access_ok((void __user *)FPU_EIP,z) #endif -#define FPU_get_user(x,y) get_user((x),(y)) -#define FPU_put_user(x,y) put_user((x),(y)) +#define FPU_get_user(x,y) do { if (get_user((x),(y))) FPU_abort; } while (0) +#define FPU_put_user(x,y) do { if (put_user((x),(y))) FPU_abort; } while (0) #endif diff --git a/arch/x86/math-emu/reg_ld_str.c b/arch/x86/math-emu/reg_ld_str.c index f3779743d15e..fe6246ff9887 100644 --- a/arch/x86/math-emu/reg_ld_str.c +++ b/arch/x86/math-emu/reg_ld_str.c @@ -85,7 +85,7 @@ int FPU_load_extended(long double __user *s, int stnr) RE_ENTRANT_CHECK_OFF; FPU_access_ok(s, 10); - __copy_from_user(sti_ptr, s, 10); + FPU_copy_from_user(sti_ptr, s, 10); RE_ENTRANT_CHECK_ON; return FPU_tagof(sti_ptr); @@ -1126,9 +1126,9 @@ void frstor(fpu_addr_modes addr_modes, u_char __user *data_address) /* Copy all registers in stack order. */ RE_ENTRANT_CHECK_OFF; FPU_access_ok(s, 80); - __copy_from_user(register_base + offset, s, other); + FPU_copy_from_user(register_base + offset, s, other); if (offset) - __copy_from_user(register_base, s + other, offset); + FPU_copy_from_user(register_base, s + other, offset); RE_ENTRANT_CHECK_ON; for (i = 0; i < 8; i++) { From patchwork Sun Dec 29 17:22:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182554 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5459304ild; Sun, 29 Dec 2019 09:45:21 -0800 (PST) X-Google-Smtp-Source: APXvYqz+rQUxPhhuezdGSBvpstnrHGOG3lGFdDpphK4B1eLt8j2258kbLQV/PcOe3jePIyqch/Ys X-Received: by 2002:a9d:70d9:: with SMTP id w25mr65053933otj.231.1577641521239; Sun, 29 Dec 2019 09:45:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641521; cv=none; d=google.com; s=arc-20160816; b=UNb6t5vM2Zapty6k0hDdsebiQ7bsTT9enDBigCyvfdVvON4fnUkSOieucDQCdtkeE8 cHuiC4sTGk9s44rAETmaeI4URFs13kq9edGI+bqc5nYkIIcOOhGUKaTvv6deeUvmF4B6 4Tn/2qN5Uw+J2f39mseGMl0xyFN8e/YaWfByfX2EEpwotATvnDAD+6AVpua+/3mYVW2A dpe3yreBpWg3JcJY6LCs8hFw3sx8WdjH4/z3Uudg32YW8YGomTaybTzDzUDAQQCY3uFz Inpduc6YHTUEIOTYJ7EDJeSLwpLv6Rmckgqy8jmMeKNuzpLDZ77x3yYxx26V8skLR9UA tXoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XiqM5n/HxqYiaXEw5mBUHw2TXdK03OpNcC7pz1s/Loc=; b=qAo/7jGse5QormIJWmrUUDaOGe/I+jytOpS9glkGNhOQdtnfTeeZfROgjv3MeJ/kvV /I7GUo6BJrmlEDIXJW8p3GK1Bds/C6Mhl/yEPWVNxhYAt0oesQ04O2fyp4fxmDgmgEwt vxQbtrQpXDgo0YWxGx1a2Dr61Jv4bFnHtemcm4BTzPtb0HwM1w6XxVObI6CjOhngNfET KjWF8PseSLcfqelmbHrGMYdGY/w0R1isF6vCoXUUWGhVBiawNVmkzWKNcZGBLtD4vDlP 37i4CVRfWrAOJG1VEI72oHBChjbsFkqCm8q5iO8wglpJ6fr1nVo5iQTx2jvp866yhaaC QMEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FGQcBkma; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si21292985otq.31.2019.12.29.09.45.21; Sun, 29 Dec 2019 09:45:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FGQcBkma; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730877AbfL2RpT (ORCPT + 14 others); Sun, 29 Dec 2019 12:45:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:54268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729173AbfL2RpT (ORCPT ); Sun, 29 Dec 2019 12:45:19 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E260207FD; Sun, 29 Dec 2019 17:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641518; bh=/15pi5qSvB4ceV78bERpn7re2axBK/lYD0PAppSjBj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGQcBkmaFnMJPwh5z/4twO2GO/8MHDZzu5wxl4hzZw4/y4mPAV6ygJpvjPMLBqzdt wNxLkOuI7nUgfIKzUhkuY5D5e/BwpzM7aG8Nhl6xsuaZtcFj+Gx+xeT9wU69Czg3/o lZxH2foV0tD4/HIfTe5N0ldHvzvo3sg8LlgcyrPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stanimir Varbanov , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.4 098/434] media: venus: Fix occasionally failures to suspend Date: Sun, 29 Dec 2019 18:22:31 +0100 Message-Id: <20191229172708.099982918@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stanimir Varbanov [ Upstream commit 8dbebb2bd01e6f36e9a215dcde99ace70408f2c8 ] Failure to suspend (venus_suspend_3xx) happens when the system is fresh booted and loading venus driver. This happens once and after reload the venus driver modules the problem disrepair. Fix the failure by skipping the check for WFI and IDLE bits if PC_READY is on in control status register. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/hfi_venus.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 7129a2aea09a..0d8855014ab3 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1472,6 +1472,7 @@ static int venus_suspend_3xx(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; + u32 ctrl_status; bool val; int ret; @@ -1487,6 +1488,10 @@ static int venus_suspend_3xx(struct venus_core *core) return -EINVAL; } + ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + if (ctrl_status & CPU_CS_SCIACMDARG0_PC_READY) + goto power_off; + /* * Power collapse sequence for Venus 3xx and 4xx versions: * 1. Check for ARM9 and video core to be idle by checking WFI bit @@ -1511,6 +1516,7 @@ static int venus_suspend_3xx(struct venus_core *core) if (ret) return ret; +power_off: mutex_lock(&hdev->lock); ret = venus_power_off(hdev); From patchwork Sun Dec 29 17:22:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182556 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5460119ild; Sun, 29 Dec 2019 09:46:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxG3zfxWVRuaUD6mNXa52pItXVtrm66FZwFsBSr3OqTmqOu+JQeP8xyijbIrDuodApiBGoy X-Received: by 2002:a05:6830:20d3:: with SMTP id z19mr65320228otq.330.1577641581496; Sun, 29 Dec 2019 09:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641581; cv=none; d=google.com; s=arc-20160816; b=XQOQQlJhd5oK/omX+9CLHjaDkpsU395RTKDbM01FTXWcGNC8+evvFW0nptYVksRSYh Tgzsklk9iQpZKEI1/PemNqkQzUk5GogTUrTNt2OheUypEmhga2E1ntNl9whkRJyMyBP+ 8LCXpg8+YF6cor4EtRcxmY4pR9BYYXLNEv3JhwGHSfp5iWwmSuUf82hT8eE9O2mR5OqM /98XtYYDrIJVLu75F+5Nnn7O1YzKVi0nmQ8f7DVRdSqvpbUix/91XRFUZHkrT3D6Gsqc 2zhTFrXd9PO449gQuHH3M4X4Ab3kXmHf7rUEPnma/oLP+1aKFu92TSWNQ/0EurlB7qXj G+uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yxKzPG/Q/q2Pbq1B2/WeWG2QQk2cehP5XzvDYCFBJYs=; b=hf5bZkREI0VSyholSlyYNkynVddVJjRVp2r56WRNKaUCivUToRNkdFtTMUlmtAK/1X g7zWXIYJRFA8fkgaEnZFgtKuprqNLwEy6Gt73EmNPh63QWfUew3CXcCS1/OYFFNjRalV yGUYtQYe5IyaDNTcXHP8qaQJFrgZK4DMrgCF0UYMVToMakzKa+3hkTWn8uogmRHmdn0x dLSCyK5bgc3xTM5KSCDIBM8qGphJ6SA3ugJVR0zeM5lzv2vKWe3FPmHcm31c2WUyF+Tr 8kIFMgzs2cyNLrqon/udVLmp5f69Yj2y2cp/M0EV0gL6rI4kqfvzCEfyl8jWh9Gwdxs9 IcFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m2M8jPFf; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o128si19781129oih.66.2019.12.29.09.46.21; Sun, 29 Dec 2019 09:46:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=m2M8jPFf; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731055AbfL2RqU (ORCPT + 14 others); Sun, 29 Dec 2019 12:46:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:55992 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731052AbfL2RqT (ORCPT ); Sun, 29 Dec 2019 12:46:19 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 90A88206DB; Sun, 29 Dec 2019 17:46:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641579; bh=uFNxM7/O65MW/lOtCWv+XHBpUX/dWkTOHmXneIeUm0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m2M8jPFfhRpDCPRTfJioySQdhOrr2B5GDGDOhQmwvBTWoM+ga4fNkVEp1PEMmeJJo IEocHu4FmN3NX7z3am7HOc2x87hExyeQRZRsfH+vaJ+/MZB5iC9I+BbLGrMQE2QC3a F4URahW+nAXDI/mc1/6wEH9sh1OKUeie0YnQJ8rQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Nathan Chancellor , Nick Desaulniers , ci_notify@linaro.org, Herbert Xu , Sasha Levin Subject: [PATCH 5.4 124/434] crypto: aegis128/simd - build 32-bit ARM for v8 architecture explicitly Date: Sun, 29 Dec 2019 18:22:57 +0100 Message-Id: <20191229172709.933326081@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 830536770f968ab33ece123b317e252c269098db ] Now that the Clang compiler has taken it upon itself to police the compiler command line, and reject combinations for arguments it views as incompatible, the AEGIS128 no longer builds correctly, and errors out like this: clang-10: warning: ignoring extension 'crypto' because the 'armv7-a' architecture does not support it [-Winvalid-command-line-argument] So let's switch to armv8-a instead, which matches the crypto-neon-fp-armv8 FPU profile we specify. Since neither were actually supported by GCC versions before 4.8, let's tighten the Kconfig dependencies as well so we won't run into errors when building with an ancient compiler. Signed-off-by: Ard Biesheuvel Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Reported-by: Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/crypto/Kconfig b/crypto/Kconfig index 9e524044d312..29472fb795f3 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -309,6 +309,7 @@ config CRYPTO_AEGIS128 config CRYPTO_AEGIS128_SIMD bool "Support SIMD acceleration for AEGIS-128" depends on CRYPTO_AEGIS128 && ((ARM || ARM64) && KERNEL_MODE_NEON) + depends on !ARM || CC_IS_CLANG || GCC_VERSION >= 40800 default y config CRYPTO_AEGIS128_AESNI_SSE2 From patchwork Sun Dec 29 17:23:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182574 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5478684ild; Sun, 29 Dec 2019 10:08:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx7+Qx/ximrM1hkyu/4+vnglwTDSRN8MXcoCZjZVMu0QeBiKK61a1jsm/8aPG0YJV4So8qR X-Received: by 2002:a9d:6502:: with SMTP id i2mr42306711otl.206.1577642913918; Sun, 29 Dec 2019 10:08:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577642913; cv=none; d=google.com; s=arc-20160816; b=jJ4PQyZCjIvZemLyRi/Xo8vbrIbYbLGZtVVHw9nJBpYsYJpFUnrgVVA2ihEh0kKTxu ZDzzysEIsazxxyNIfOqlLfJFF0HpEBI0JYv+ydqAJ1Pl/0+B134mIQgMNH/JVpEZJ0XI eUkEZkn7r+QiQBDcC7mYt0a98M8v35LoKLwI05KOPz2pnBpr8am30E+3i1jl6HdA78ut yspA8zxDa8vmrv22J2NlUwDofl8WYjM4MWtNtCc+EES2QC2lrePbCX2/ycZyePCyzhDa KCrjA1RCPdKe28KS2JABJSScj66l81VogvLXhu7hbZU0WmxH4Kxf+qPJx4ryXs7acJOG r5WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zVunRSPszcNGeSzZ9Dumk0EwWfmFsOkeo68Crr2G6iU=; b=yoe/hC6YOENugGeNke1fGOWcbj/MoYzUJpbJhtfzqVj9mVqOIy811J8npLCYCt7lur fCKxmlBv4n5y4jOw9Qyq+N7g4zLVltGTlScoUnOrAQ3DIiQ+hp2Vmo7a0WLV0RpqplPL uNt4FtWXcY3qFdByiTJgBb4Ge4zxvaEszDtfRE3wZFdRvXqt07NcidRFeP2g+/tVTUuY B2BS10H0cX9K/Nc1DfZImpfAGwDn6J7mVjhn3R9rCbdeHeeMRRGVF3dfwBsGvFALSExV w481/efHDyaq/2iscqk1FuHuN4NKxiLjYUD+ZWvAkkpwgfrF/Yp1CCqix9CfpK91GhhH BV5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yx1w1B6T; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si11790063oia.262.2019.12.29.10.08.33; Sun, 29 Dec 2019 10:08:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yx1w1B6T; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731204AbfL2SIb (ORCPT + 14 others); Sun, 29 Dec 2019 13:08:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:57488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731199AbfL2RrH (ORCPT ); Sun, 29 Dec 2019 12:47:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61353206A4; Sun, 29 Dec 2019 17:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641626; bh=aLZtRPo3J/10vYacInLSi2e43+VprTKkpjOLkrQxtFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yx1w1B6TgV3dcIlHcdCwrrZy265VBrmN3U25H/2dyztUuZdMw4kIIWxctwM5dWcdi SOINXn0KY67cYFIML1904B+cmKp8oxJQ+H5R7LY6CK5g4YLs3LuWKOk8KbAvGxVXs+ 5Ih1+6h+HMILwoErSS4F0QlQ5vZFQv7myTfCa/rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Bjorn Andersson , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 142/434] ath10k: Correct error handling of dma_map_single() Date: Sun, 29 Dec 2019 18:23:15 +0100 Message-Id: <20191229172711.169025164@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bjorn Andersson [ Upstream commit d43810b2c1808ac865aa1a2a2c291644bf95345c ] The return value of dma_map_single() should be checked for errors using dma_mapping_error() and the skb has been dequeued so it needs to be freed. This was found when enabling CONFIG_DMA_API_DEBUG and it warned about the missing dma_mapping_error() call. Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Reported-by: Niklas Cassel Signed-off-by: Bjorn Andersson Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index a40e1a998f4c..2b53ea6ca205 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3903,8 +3903,10 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work) ar->running_fw->fw_file.fw_features)) { paddr = dma_map_single(ar->dev, skb->data, skb->len, DMA_TO_DEVICE); - if (!paddr) + if (dma_mapping_error(ar->dev, paddr)) { + ieee80211_free_txskb(ar->hw, skb); continue; + } ret = ath10k_wmi_mgmt_tx_send(ar, skb, paddr); if (ret) { ath10k_warn(ar, "failed to transmit management frame by ref via WMI: %d\n", From patchwork Sun Dec 29 17:23:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182558 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5461312ild; Sun, 29 Dec 2019 09:47:55 -0800 (PST) X-Google-Smtp-Source: APXvYqy91UF9O15UBQmKLgHGuieQItDWF+5AnOZzZ5YT0JO/L+9ZjJcxuWBL56ySrF1sUMUJYRXl X-Received: by 2002:a05:6830:1515:: with SMTP id k21mr53851229otp.177.1577641675894; Sun, 29 Dec 2019 09:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641675; cv=none; d=google.com; s=arc-20160816; b=qYEImBuDrJBwHh60MAltNNQmcQbjtWzMpkt91H05ZdD8Iv2SS2RwKu/WemSz9D/fgL 59GUkFW6OQNub8BLiD45cq7zZPtWnpZjzMtcikgWVsgeIMsJcT9xQnMuu1hXg9Wrgmlo a4fTZQ20QKvupNiGNYXxKDkPL1rjuMpytRtbneD0mBN/+eerD/MZd3Zn5/ZoLj8zviqV 6zH3Cj2ZnG3EGJO7JGxE100POc4Gei9xG1MYYsTiV1xOjRUyf0FKNz1CnEHXungnvKf/ M6elrrVxI5uAFa0I2pE004AsJ+uA24I0Oeqx9/Lg4FUqnRUUcnvx9tcX89/lrGOXQzQt ZQEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Bgxr+BgoWDHJUZmIznQ4d2oVrSffrd4/XeOjnUd+O+o=; b=iqMzsolIL8SjdtvajA1Su0RSZ3lGL6EWzgRFdT8cWhZPz7SxbvhHVdeLgZYS7soVhB dobeDcAsl3a/Ej/Ec/8e4zlJ/XU97ERiV/lwzrlfaOoI7wb4hvYVM+cxrAS5TpDBFoxd N1nlV8A5u88pASySEoNf1YuSd9mazn3VqwSIjvCYfq/03PXFO1PELYiaI3hAyMDarLfE R+QpjTIPP9Yua3O/oKlQlBd5jGmyvyBjAnD6yzxcNVk1coovUPc1KWp+ssxk3B4wmURn Sc6c45oBevgqvnt5OGnoFl2UqY3TMVOZJTVha0mrSbD+gqL0BIGQQuNOxEnsBnneOuwY obpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SwOXNhza; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d20si16766296oic.40.2019.12.29.09.47.55; Sun, 29 Dec 2019 09:47:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SwOXNhza; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731354AbfL2Rry (ORCPT + 14 others); Sun, 29 Dec 2019 12:47:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:58750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731344AbfL2Rrv (ORCPT ); Sun, 29 Dec 2019 12:47:51 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E33E0208C4; Sun, 29 Dec 2019 17:47:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641670; bh=6qnczI6FHQazh9DmcWWErTsXpBXTUWcCdkBVEqjRnPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SwOXNhza+QKTpeL8liSepb9iJupWjpHtf8Nzsvl5MK/VoXGDSwRpip9RyspJrMIJY GGg61GEeq5l35pog6forZyRMXhljyfGn1Q5GqHZJPzITNVqz2T97EceW+8X/S3ABEz y4RMHLaNYvm7IS/kDIrlQGO1T9sIRqc6QiHSwUi8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leo Yan , Alexander Shishkin , Jiri Olsa , Mark Rutland , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 145/434] perf test: Report failure for mmap events Date: Sun, 29 Dec 2019 18:23:18 +0100 Message-Id: <20191229172711.376706225@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leo Yan [ Upstream commit 6add129c5d9210ada25217abc130df0b7096ee02 ] When fail to mmap events in task exit case, it misses to set 'err' to -1; thus the testing will not report failure for it. This patch sets 'err' to -1 when fails to mmap events, thus Perf tool can report correct result. Fixes: d723a55096b8 ("perf test: Add test case for checking number of EXIT events") Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20191011091942.29841-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/task-exit.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index bce3a4cb4c89..ca0a6ca43b13 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -110,6 +110,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused if (evlist__mmap(evlist, 128) < 0) { pr_debug("failed to mmap events: %d (%s)\n", errno, str_error_r(errno, sbuf, sizeof(sbuf))); + err = -1; goto out_delete_evlist; } From patchwork Sun Dec 29 17:23:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182559 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5461897ild; Sun, 29 Dec 2019 09:48:45 -0800 (PST) X-Google-Smtp-Source: APXvYqz4PavXtnxoeg50DbSDXQxXFD4e2LfmOBmEqPpBODjCp6a1mNfphee6tJVqtLUW4NDpP1cC X-Received: by 2002:a9d:3676:: with SMTP id w109mr51423407otb.35.1577641725655; Sun, 29 Dec 2019 09:48:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641725; cv=none; d=google.com; s=arc-20160816; b=QlwKhBB47dFbQq0V2tlQh2gdG3VsSjF86LWTNFDD9MhKjbiS7NdGvI1HW9lYlL3hCJ FYQjp3bCyIe0NH1X6A9KLjbUR1yZYrPRtsNg/+HaBX/cZZRezMo30urvdA7UGP8U5hFI SM3bGUXl6YjaSrrv5iC4bVcSTg49/ArRHLDI3GsiDOlP3Ozj6DpL25sebCBVfP3cC85T HR05ocswOQY07MVxVsSLwNdqAXt5o3p8Qc4wa8/piSQWYHgCPb1S+Gznh0THW4iRW1k9 kzHAO6eNOjM4V1PFClu62OEuGQ29OAU2C7lspsFYdotd6T6k7JBe9RweKGLErgyAStyq RKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SiNxYMdr22qa8DFw384BhuNj8mQASmAAE3copw1w9FQ=; b=YPo6NMIf8P7ucrWFUChGuokDhceNpTKAHWsl8w/H5t+02suKeUWzH62hGY8SAH35aL RutygSSeQCFsO54X25UBqrS+qc7R7Zw9pZ70WseZuG4RCFFPQMVzoptJ+8DSTbHfi3M6 8bj9RK9kFeAqzr0nUY2jZJ8QSEK6riPmV1PL8bBeTKyg6UROs/+ahwlw+CtyXioTtzX4 Jmd4Q9nkfewKrL7QxkBcAIJqAnoA45GR8WpkBr8rQe4tAMupsHNpVUUJMmYziPDSf4/z cn+GOPU9vvkpfrjjyLgTtZ0w13QWoNSoH0J0CJKVcBwB2CRr8xxEYRs0b0ATho5YS9+9 PGSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qmenAAsz; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n137si20289953oig.127.2019.12.29.09.48.45; Sun, 29 Dec 2019 09:48:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qmenAAsz; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730832AbfL2Rso (ORCPT + 14 others); Sun, 29 Dec 2019 12:48:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:60210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbfL2Rsn (ORCPT ); Sun, 29 Dec 2019 12:48:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C6B3207FD; Sun, 29 Dec 2019 17:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641723; bh=r9HNGkrrcvcIgewxqzftcT+iHS7Y814AmtaQcyc85as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qmenAAszLEMlAjlLR2W+LYlnBMoLwIu9eE0uwUa3vhvp6UUtMAik5r+9vjcMmzMjy WMpxRmgDoAZemHVy7LTyiV+gURbzAdj7BhJn7ZFNv9d7ulHTEhAjicLyPKsqRZhDDh fwoSm1vWTYN6xdUNEI9rlXYg73hvjf6IG3hSry/Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leo Yan , Alexander Shishkin , Jiri Olsa , Mark Rutland , Namhyung Kim , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 147/434] perf test: Avoid infinite loop for task exit case Date: Sun, 29 Dec 2019 18:23:20 +0100 Message-Id: <20191229172711.515478736@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Leo Yan [ Upstream commit 791ce9c48c79210d2ffcdbe69421e7783b32921f ] When executing the task exit testing case, perf gets stuck in an endless loop this case and doesn't return back on Arm64 Juno board. After digging into this issue, since Juno board has Arm's big.LITTLE CPUs, thus the PMUs are not compatible between the big CPUs and little CPUs. This leads to a PMU event that cannot be enabled properly when the traced task is migrated from one variant's CPU to another variant. Finally, the test case runs into infinite loop for cannot read out any event data after return from polling. Eventually, we need to work out formal solution to allow PMU events can be freely migrated from one CPU variant to another, but this is a difficult task and a different topic. This patch tries to fix the Perf test case to avoid infinite loop, when the testing detects 1000 times retrying for reading empty events, it will directly bail out and return failure. This allows the Perf tool can continue its other test cases. Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20191011091942.29841-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/tests/task-exit.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.20.1 diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index ca0a6ca43b13..d85c9f608564 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -53,6 +53,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused struct perf_cpu_map *cpus; struct perf_thread_map *threads; struct mmap *md; + int retry_count = 0; signal(SIGCHLD, sig_handler); @@ -132,6 +133,13 @@ retry: out_init: if (!exited || !nr_exit) { evlist__poll(evlist, -1); + + if (retry_count++ > 1000) { + pr_debug("Failed after retrying 1000 times\n"); + err = -1; + goto out_free_maps; + } + goto retry; } From patchwork Sun Dec 29 17:23:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182560 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5462092ild; Sun, 29 Dec 2019 09:48:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwUWXGuyt37mykdLAbRgQ7WOnJjOR005lyPhbUGPPQeyd3OYz56CZyRUptcgmIqzZRGBwH9 X-Received: by 2002:a05:6830:1cc5:: with SMTP id p5mr45030942otg.218.1577641738519; Sun, 29 Dec 2019 09:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641738; cv=none; d=google.com; s=arc-20160816; b=jvKi98q11EGkvNeKpREkOdREab8G64VkM25qVedFf9ueabt5ZwsjzIyM/Fj1uMeZ2b uFSKTBfYmLKJ//4hW6XUV2KYCT0ou6w6xjJC2LKOpJc2ERQMyy9je2+TeLwisoPbDEW1 uKx+OVC1UyM/z8dkm5AO94zbab6nJgu/aHs5qPqoqYHHLYZ3SoCddtp40hn1GIuop2j1 A7sk5eSBDV+3MQhbP0p9NWLtLH6UWMjfY4mmJKpLOHBzdnM6M6yHxEYoIWUMqr+FdUG7 rM1axTkTV7acFCZiKide5DIeFU+yUb4t4IZ3qILGwcYQQSz/7sasaI825L8Gfb1rZRWr nJEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kt/o80jltXOkgE2emvJT/OXqKC1BJtk0PREZorcdBe4=; b=KQCirJ7A+4GpVnnwKcG0LSfwuDKWCly7B8LmlqG/Y8YXkxsbnc21AnCq8cyLBFCB3u IuE4HEjHQ2QNmzsNYppxVamnmNqG/Cv76FRaQ3kw+aHHY2bk0fglwyOTOegYEeLtV4h/ Q0KCHHYW+rViJwDLCK/Y+Y2ZUVj6tYzIZk+wplxD7K4dXDlqR/NpGDyoGKHcrxHOWjei mhr+MxsDC12273xyKhYcKIlsn227yooJoj3r9sa87J4GZe2WQH7tP7rwxZZBrZt6wCfR QysQeUEBTaqICjwS+KTZHJwd5g9RUB9GsNoVBQ2JBccSP3TkZV7f4ktsQkkBCq/9u5F0 E7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hduXkThx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si22106401otr.197.2019.12.29.09.48.58; Sun, 29 Dec 2019 09:48:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hduXkThx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731539AbfL2Rs4 (ORCPT + 14 others); Sun, 29 Dec 2019 12:48:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:60580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731261AbfL2Rsz (ORCPT ); Sun, 29 Dec 2019 12:48:55 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57D1D207FF; Sun, 29 Dec 2019 17:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641734; bh=YE6fA8U4hpcf3Who/RGRmXS2l2nWWlDo7ap4HH8yOzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hduXkThxZdhgXMqS53jFbeKQtno58EJRZ3ffS20Nk9ceQVCyjQ+8l8cDGxodaPK8J bkhXOmg7vtXcdv0g6HMRRHjgAiQMrirCAA7ZgTZdOKWMzzYFh+onu9oXdPQ5kgTkR/ iQUgR5uPwfY8KMMfHryxNW+a44g0j7CekAo/t5DU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Shaokun Zhang , Alexander Shishkin , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Will Deacon , linuxarm@huawei.com, Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 148/434] perf vendor events arm64: Fix Hisi hip08 DDRC PMU eventname Date: Sun, 29 Dec 2019 18:23:21 +0100 Message-Id: <20191229172711.582498387@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: John Garry [ Upstream commit 84b0975f4853ba32d2d9b3c19ffa2b947f023fb3 ] The "EventName" for the DDRC precharge command event is incorrect, so fix it. Fixes: 57cc732479ba ("perf jevents: Add support for Hisi hip08 DDRC PMU aliasing") Signed-off-by: John Garry Reviewed-by: Shaokun Zhang Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: linuxarm@huawei.com Link: http://lore.kernel.org/lkml/1567612484-195727-2-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- .../perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json index 0d1556fcdffe..99f4fc425564 100644 --- a/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip08/uncore-ddrc.json @@ -15,7 +15,7 @@ }, { "EventCode": "0x04", - "EventName": "uncore_hisi_ddrc.flux_wr", + "EventName": "uncore_hisi_ddrc.pre_cmd", "BriefDescription": "DDRC precharge commands", "PublicDescription": "DDRC precharge commands", "Unit": "hisi_sccl,ddrc", From patchwork Sun Dec 29 17:24:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182563 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5463555ild; Sun, 29 Dec 2019 09:50:50 -0800 (PST) X-Google-Smtp-Source: APXvYqyjjrj54fzgtKqKQ33otihdh6mCksGGHvnfrD20C17ZQrhjxyWEQfMyEH+qub56JCIGw34E X-Received: by 2002:a9d:67d2:: with SMTP id c18mr67465318otn.362.1577641850562; Sun, 29 Dec 2019 09:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641850; cv=none; d=google.com; s=arc-20160816; b=Vfb8v45r+ZMUJNQ2bo9dDfohMRC02E9ZuIMn/BZaeKgTFh88d18hqZlPYGEjk8hxT0 8LrzOUv3wLvVq/E24bOsbKq+4nly4VU8fsAeoTaUc0ovkUW+h4zM/3zXN130PiM4W9DP offZ+ck6/dqQV+Fu1UoHkcxCCzC2VI4q3Pb12L9EQdWjF0D+ZMm8sDJD1VP6/EOe0Rd/ U3QnKI4vp0VgCiBpYup/09w85/Dntq3adnEIehMlZUy/+lB++V7QvhyStj/Rjkd6vbnG bJsl5SMvfBcCQf/3gJVouMeJLzzkfdSbMmLMgmKO7gLDm29c9vxfA6xFoPSFhRHPqvUM anxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=88AVnpBEsnkBD8ha5VzEPsOUP1GLcPn85y25bXwY7+A=; b=b5d+H+7J/ODLBBEBSV8h9qof8A4lP5cMJKHtlzrb38b1JKuvry7IyGnQYg0keVxbmg AWoCt6eIzEXwWQnflM6viy9LaQocZYpxZ2cG6m7dbOuLeysP83oqNoT6a9Y5h2xBaW9a VrRlk772otAEAtUSQsVJnkvknCGUvVWWzecZi7oOXS13jnTMbQWcl6ReIyF9ATMZSvQo 921baN1+3ZhKYGtqeLYsbSr3iePhIXZ70lLflDvvzFo+9h7lODOCfIT6vBBp7AkUnde7 btnswJHK6hCLb/57Wb89hKV8HPJPn5fTAgvxj4xFR9IbhUVoCtDK0it0m4g0awfIRegD 6ZTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pN7xt5M4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si19400803oij.118.2019.12.29.09.50.50; Sun, 29 Dec 2019 09:50:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pN7xt5M4; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731622AbfL2Rut (ORCPT + 14 others); Sun, 29 Dec 2019 12:50:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:35498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731929AbfL2Rus (ORCPT ); Sun, 29 Dec 2019 12:50:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8B2BB207FD; Sun, 29 Dec 2019 17:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641847; bh=kGp2oEj4Y0E7GzyIkTeTvwRHpJHHSsU9qgEs6Z+cSog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pN7xt5M48Eek7fNZrTMt3K8F53tyYqCA1MM1+mYYNqoFW4WAfkQo9LOfIiK7p7wC6 qiuuiMiMv/taBZp0EE7PB+XgxgNZ3isUbL1M0j2jBFDCkgrSDOsuR9Qff5CfOjnBia mqEnjVe5siqdBOZwWmgkaTlPoHyEwg4cdvXYu/4c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grygorii Strashko , Andrew Lunn , Florian Fainelli , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 193/434] net: phy: dp83867: enable robust auto-mdix Date: Sun, 29 Dec 2019 18:24:06 +0100 Message-Id: <20191229172714.645230740@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Grygorii Strashko [ Upstream commit 5a7f08c2abb0efc9d17aff2fc75d6d3b85e622e4 ] The link detection timeouts can be observed (or link might not be detected at all) when dp83867 PHY is configured in manual mode (speed/duplex). CFG3[9] Robust Auto-MDIX option allows to significantly improve link detection in case dp83867 is configured in manual mode and reduce link detection time. As per DM: "If link partners are configured to operational modes that are not supported by normal Auto MDI/MDIX mode (like Auto-Neg versus Force 100Base-TX or Force 100Base-TX versus Force 100Base-TX), this Robust Auto MDI/MDIX mode allows MDI/MDIX resolution and prevents deadlock." Hence, enable this option by default as there are no known reasons not to do so. Signed-off-by: Grygorii Strashko Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/dp83867.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 37fceaf9fa10..cf4455bbf888 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -95,6 +95,10 @@ #define DP83867_IO_MUX_CFG_CLK_O_SEL_MASK (0x1f << 8) #define DP83867_IO_MUX_CFG_CLK_O_SEL_SHIFT 8 +/* CFG3 bits */ +#define DP83867_CFG3_INT_OE BIT(7) +#define DP83867_CFG3_ROBUST_AUTO_MDIX BIT(9) + /* CFG4 bits */ #define DP83867_CFG4_PORT_MIRROR_EN BIT(0) @@ -410,12 +414,13 @@ static int dp83867_config_init(struct phy_device *phydev) phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_SGMIICTL, val); } + val = phy_read(phydev, DP83867_CFG3); /* Enable Interrupt output INT_OE in CFG3 register */ - if (phy_interrupt_is_valid(phydev)) { - val = phy_read(phydev, DP83867_CFG3); - val |= BIT(7); - phy_write(phydev, DP83867_CFG3, val); - } + if (phy_interrupt_is_valid(phydev)) + val |= DP83867_CFG3_INT_OE; + + val |= DP83867_CFG3_ROBUST_AUTO_MDIX; + phy_write(phydev, DP83867_CFG3, val); if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP) dp83867_config_port_mirroring(phydev); From patchwork Sun Dec 29 17:25:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182565 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5464020ild; Sun, 29 Dec 2019 09:51:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxl/7kNDEKMHd0PKgujRCp/lPyiKKy1I7eWvFlluy5s/IEK2eZHLCWvM/74O0NmQ0UVAyxa X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr65945371otr.169.1577641891055; Sun, 29 Dec 2019 09:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641891; cv=none; d=google.com; s=arc-20160816; b=dr+LoH6D2r/qAwgDeT0w271f5+v6KdKx59CTW78Wj4ZNWjqhyt31zkC6BppV27DDCZ FMIPMzoJo+gmk+RGkCt1X6RpewMlhkamouF0auWpWHG+HrVj49SkD0+yfrpRMA/bDymM g2oUI4N9TxIRDXdAz7TvY2SIOgmRFYCNtOq/tdXOLiWXK/fwxPSx1NB9H70J+yWn9mOj wo54kjVQOUXFMUNWlpwAQdsNb8FBGqZpus1DdKdojys7Va3ij47cJMZTAx8Rnuay6sHi /8Awt+nc54MmuV0IrnR7T4SeKyNhaUD8pPnef5wZVAE9XaBzcjkCr82/9F6xofkBjirq 4pgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7nrUu4QdJLZTowqdlnc9YF2HI86DTj5hgisc7li7r0M=; b=O0+kXc7smd9zPsYqwkHmsQni7WzYYj+jCr93xF+0g1AY0KssyF6GYy2XaUci2Ga90P jN0g4mma6nYSt3He7023NAwUkRDI6fq1E2W+yK4YFacticos+aAGCbZ6q9kOsFhAbMXC zGGdXbubFrbJJXiTg4semUY6LeIOClLbnohUHPjJA4rtD0kdiHlLmziRQwBYVuXM7QoK nIKcfnNw9JE9OghqZSDl4FGjFSNdzlNeLJI4hOd9tSy1e0VCzunoFd70MBY9HCvGq97j 7qBxXv1+wq3jbl2s/C5s1tEbtGEaOf1gyCUYx15gMDYV873dUP1zryQeyO1HSM8Xs6A7 Mrzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1tAF5pXJ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a15si18287756otq.83.2019.12.29.09.51.30; Sun, 29 Dec 2019 09:51:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1tAF5pXJ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732090AbfL2Rva (ORCPT + 14 others); Sun, 29 Dec 2019 12:51:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:36810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731771AbfL2Rv2 (ORCPT ); Sun, 29 Dec 2019 12:51:28 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6C21820718; Sun, 29 Dec 2019 17:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641887; bh=xlc7THDxqHOy7omFyY3ozdfR6uXdFyOw7hRsO3wCTyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1tAF5pXJqwcjxBkfp6g0F4nneIQcSRUirygO0C+BqikVjkQytsOy61Mi8LRf1bxp7 Bd9KNRztvlOnHcabRnPzEVn0DctZmn6D5XPyp4rMRFgzn53bPferUhcRP3aWHn0ztu rjdTpq+z/+9hBjh5UzZXETsDEosJzNRLK0HgYU00= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, John Garry , Alexander Shishkin , Jiri Olsa , Mark Rutland , Namhyung Kim , Peter Zijlstra , Will Deacon , linux-arm-kernel@lists.infradead.org, Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 5.4 253/434] perf tools: Fix cross compile for ARM64 Date: Sun, 29 Dec 2019 18:25:06 +0100 Message-Id: <20191229172718.726560429@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: John Garry [ Upstream commit 71f699078b154fcb1c9162fd0208ada9ce532ffc ] Currently when cross compiling perf tool for ARM64 on my x86 machine I get this error: arch/arm64/util/sym-handling.c:9:10: fatal error: gelf.h: No such file or directory #include For the build, libelf is reported off: Auto-detecting system features: ... ... libelf: [ OFF ] Indeed, test-libelf is not built successfully: more ./build/feature/test-libelf.make.output test-libelf.c:2:10: fatal error: libelf.h: No such file or directory #include ^~~~~~~~~~ compilation terminated. I have no such problems natively compiling on ARM64, and I did not previously have this issue for cross compiling. Fix by relocating the gelf.h include. Signed-off-by: John Garry Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/1573045254-39833-1-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/arch/arm64/util/sym-handling.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/tools/perf/arch/arm64/util/sym-handling.c b/tools/perf/arch/arm64/util/sym-handling.c index 5df788985130..8dfa3e5229f1 100644 --- a/tools/perf/arch/arm64/util/sym-handling.c +++ b/tools/perf/arch/arm64/util/sym-handling.c @@ -6,9 +6,10 @@ #include "symbol.h" // for the elf__needs_adjust_symbols() prototype #include -#include #ifdef HAVE_LIBELF_SUPPORT +#include + bool elf__needs_adjust_symbols(GElf_Ehdr ehdr) { return ehdr.e_type == ET_EXEC || From patchwork Sun Dec 29 17:25:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182572 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5473046ild; Sun, 29 Dec 2019 10:02:57 -0800 (PST) X-Google-Smtp-Source: APXvYqwPRfpyohw+LMgDGltwNProTwArxsEi2jBOMryJSDGOxT0LgEKX6/3fjvIT3SswUHOwGiv8 X-Received: by 2002:a05:6830:194:: with SMTP id q20mr72227342ota.92.1577642577221; Sun, 29 Dec 2019 10:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577642577; cv=none; d=google.com; s=arc-20160816; b=F9Xe2SMzzBxcSRTyvZsPKzyUTvLSH5BAwWxwD/Rz1l1PkWkaC6x5GID7anP26fGIzc U/u5pK5wswzQeTKpacJxnt7kajhJW3qA8nDOF0l2KBBslR9i1SyUgh8XGooP1qfc5k4w GxNRG7X9lv1mnUkRbSgwQaXiOaM7o/dx/X08Xe1Vd40MQDqRprG6K/vmKZHrTrweCsYb IhgUn2gG28+qOKIDS6RlOAEFuPV595Lu+nfC7H0wPpulc8CfF5dwgpP8vYi/j0GNlb85 cdi5nhsL0mPtCPRKPvh+wuDG2YVNWRF6bHJhi4MQJyfpGnOltahPyDqB7L7hVKuenw/q FmFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wvr6fymlzfZ7tp38DlDcAZntd35DVmdNcZpRzz6YzAo=; b=rMxY3KZUj2u+vJ7OxBKtFz68ImkrxOqoI2puRQKAHguoEE6DDVtkYUIobbW+Jz/A9G WpEGR4tB68UE6xKXP5rDViToMfQ+TLK0ok7XQlXYvREK8Mz0/R1YHzy8SCRKtf6yt0r/ F0ntod3a/TZXVggO/LN6xkfhjgCktUD/kywDJS1a+yAT8dsWzRsvKskEGajTJvNpbD/G 2W4uU1GTwZqXDfgkUVcDfHRSMfKyJQTmxS4srojR/jcNg3/jt0o4cfX4Sk0z8/z3HctW hRKB5lRBYtOaiSvxE4j6RwsNY54EL+LdVjF7R4UJw1MD2QXVZhOksgNW/pRd/fjeNEeS WikQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ySzmk82y; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si21811056oth.236.2019.12.29.10.02.57; Sun, 29 Dec 2019 10:02:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ySzmk82y; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387757AbfL2SCz (ORCPT + 14 others); Sun, 29 Dec 2019 13:02:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:42288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732674AbfL2RyZ (ORCPT ); Sun, 29 Dec 2019 12:54:25 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 98E4821744; Sun, 29 Dec 2019 17:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642065; bh=UZCOrNCSYzLLHQQCAcwBP86yz0fqplT9ITOoRdzBppw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ySzmk82yG41ouG4TD8ri0a+QryqBBZINeo9cWZBuF1zj09jAEFwqFUoKCXMbwElKe A7c5M1EX50Bi+8yM01ho9eeNVYLhj7sTTc/ku/DS/PSb0KsVjhtkLmZ+sR+/pbYTxM Gz95lwDQ+niMT1dTFQ1CQc95U4VYEBxi79MpMg4A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Morse , Robert Richter , Borislav Petkov , Mauro Carvalho Chehab , "linux-edac@vger.kernel.org" , Tony Luck , Sasha Levin Subject: [PATCH 5.4 284/434] EDAC/ghes: Fix grain calculation Date: Sun, 29 Dec 2019 18:25:37 +0100 Message-Id: <20191229172720.814013410@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Robert Richter [ Upstream commit 7088e29e0423d3195e09079b4f849ec4837e5a75 ] The current code to convert a physical address mask to a grain (defined as granularity in bytes) is: e->grain = ~(mem_err->physical_addr_mask & ~PAGE_MASK); This is broken in several ways: 1) It calculates to wrong grain values. E.g., a physical address mask of ~0xfff should give a grain of 0x1000. Without considering PAGE_MASK, there is an off-by-one. Things are worse when also filtering it with ~PAGE_MASK. This will calculate to a grain with the upper bits set. In the example it even calculates to ~0. 2) The grain does not depend on and is unrelated to the kernel's page-size. The page-size only matters when unmapping memory in memory_failure(). Smaller grains are wrongly rounded up to the page-size, on architectures with a configurable page-size (e.g. arm64) this could round up to the even bigger page-size of the hypervisor. Fix this with: e->grain = ~mem_err->physical_addr_mask + 1; The grain_bits are defined as: grain = 1 << grain_bits; Change also the grain_bits calculation accordingly, it is the same formula as in edac_mc.c now and the code can be unified. The value in ->physical_addr_mask coming from firmware is assumed to be contiguous, but this is not sanity-checked. However, in case the mask is non-contiguous, a conversion to grain_bits effectively converts the grain bit mask to a power of 2 by rounding it up. Suggested-by: James Morse Signed-off-by: Robert Richter Signed-off-by: Borislav Petkov Reviewed-by: Mauro Carvalho Chehab Cc: "linux-edac@vger.kernel.org" Cc: Tony Luck Link: https://lkml.kernel.org/r/20191106093239.25517-11-rrichter@marvell.com Signed-off-by: Sasha Levin --- drivers/edac/ghes_edac.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c index 296e714bf553..523dd56a798c 100644 --- a/drivers/edac/ghes_edac.c +++ b/drivers/edac/ghes_edac.c @@ -231,6 +231,7 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) /* Cleans the error report buffer */ memset(e, 0, sizeof (*e)); e->error_count = 1; + e->grain = 1; strcpy(e->label, "unknown label"); e->msg = pvt->msg; e->other_detail = pvt->other_detail; @@ -326,7 +327,7 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) /* Error grain */ if (mem_err->validation_bits & CPER_MEM_VALID_PA_MASK) - e->grain = ~(mem_err->physical_addr_mask & ~PAGE_MASK); + e->grain = ~mem_err->physical_addr_mask + 1; /* Memory error location, mapped on e->location */ p = e->location; @@ -442,8 +443,13 @@ void ghes_edac_report_mem_error(int sev, struct cper_sec_mem_err *mem_err) if (p > pvt->other_detail) *(p - 1) = '\0'; + /* Sanity-check driver-supplied grain value. */ + if (WARN_ON_ONCE(!e->grain)) + e->grain = 1; + + grain_bits = fls_long(e->grain - 1); + /* Generate the trace event */ - grain_bits = fls_long(e->grain); snprintf(pvt->detail_location, sizeof(pvt->detail_location), "APEI location: %s %s", e->location, e->other_detail); trace_mc_event(type, e->msg, e->label, e->error_count, From patchwork Sun Dec 29 17:26:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182568 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5466425ild; Sun, 29 Dec 2019 09:55:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyxVnF39T4c1wWnGoVWUtf5W4OZufqunNSzVvMjHiOH83xu1ldNAC/1duJ6kEOhHw4CM/VX X-Received: by 2002:a9d:65cb:: with SMTP id z11mr49123679oth.348.1577642108529; Sun, 29 Dec 2019 09:55:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577642108; cv=none; d=google.com; s=arc-20160816; b=LhZujZ4IaD3QghFfzDjDWkTq4hVeqCYs4jzj3lXiWgZJgA84eVscIdbblTWqmrXN1/ 8BZqNOWbpN+VMjHeSxeE0wQg0oqjr1Zi2ASWa4a9b9sI3AKtIsRXb7d4k8FEaXGSpC1n RR3nwXc4lEyQdE1sN2KhV4JtpnfYmHPIyhySJoeYHZ3GXzjpbYORifHRkjCdBRyymY0+ FI8gq4wsIKI6A4cJEVacnnmn5Sty5fatEpZnFvFDUT7/D1mCmeaZSko/tM2VjI2MYmxn HzQxA/WESEERA/E9+YkT9Lj1WZXeQ3TfSbC/ZdtePyjqEsZ3hRlyo5jk4xwjff/8eWNg WNSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vczm2NFtwPwn+WHKCPkXMIqh4Ly9qxYbK/lGqMHwCbU=; b=jgWrrxNFBTItg0Nqr76TkNKmze/qZIEGcOf6H2gEwC3zdeJn40b1UPGEDauHhY7fBl IF2brbgXBEeC/g734vUN1xxe+S0CAxdh6beSaQkK3f+Jg8KDj0+7Z5Fe0pt4/a2jjDh9 RI4Ro7vXnY8aqTCAvhIqbTzq9jPanqU/TaXZ/LB3o2DkCEQZ0IcWqhD4VS8ZF5CKBlsQ jjdzQMC/N4GHZ+tV2OaMxTr5nYaHSCABH7OG9Rfy4FDQTpZsmPODMBuy3beRlfCruGGy uyZsCQG4MYoGPy76mqp0VCQG/yyrkr2eSDZbWVptOd8T+d53tTm/ofRmQfRkM/muRGD4 dbhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fi4c4LQe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y9si12837639oiy.81.2019.12.29.09.55.08; Sun, 29 Dec 2019 09:55:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fi4c4LQe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732801AbfL2RzH (ORCPT + 14 others); Sun, 29 Dec 2019 12:55:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:43528 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732830AbfL2RzG (ORCPT ); Sun, 29 Dec 2019 12:55:06 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6178E206A4; Sun, 29 Dec 2019 17:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642105; bh=OMmq0E4JQP23vd/LKxRBWu2Ka5C0HriFypktdNcNkHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fi4c4LQeCT+XK3AR9ezdvJEnrJTb7wEfotMVh09ceTl6c7J31Hex3KJ2cESCHaeEW YRM4aT+/Evos8lArEZMFsSshAynSY5lmy163gidSBzPsgsQkIno48Y41/U/5K1Kv7w whzk3/xRAcwGu977ct94/2Bl5JQz945bHx3e9C+4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 5.4 344/434] crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c Date: Sun, 29 Dec 2019 18:26:37 +0100 Message-Id: <20191229172724.820528050@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Corentin Labbe [ Upstream commit a7126603d46fe8f01aeedf589e071c6aaa6c6c39 ] If you try to compile this driver on a 64-bit platform then you will get warnings because it mixes size_t with unsigned int which only works on 32-bit. This patch fixes all of the warnings on sun4i-ss-hash.c. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/sunxi-ss/sun4i-ss-hash.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c index fcffba5ef927..1369c5fa3087 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-hash.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hash.c @@ -272,8 +272,8 @@ static int sun4i_hash(struct ahash_request *areq) */ while (op->len < 64 && i < end) { /* how many bytes we can read from current SG */ - in_r = min3(mi.length - in_i, end - i, - 64 - op->len); + in_r = min(end - i, 64 - op->len); + in_r = min_t(size_t, mi.length - in_i, in_r); memcpy(op->buf + op->len, mi.addr + in_i, in_r); op->len += in_r; i += in_r; @@ -293,8 +293,8 @@ static int sun4i_hash(struct ahash_request *areq) } if (mi.length - in_i > 3 && i < end) { /* how many bytes we can read from current SG */ - in_r = min3(mi.length - in_i, areq->nbytes - i, - ((mi.length - in_i) / 4) * 4); + in_r = min_t(size_t, mi.length - in_i, areq->nbytes - i); + in_r = min_t(size_t, ((mi.length - in_i) / 4) * 4, in_r); /* how many bytes we can write in the device*/ todo = min3((u32)(end - i) / 4, rx_cnt, (u32)in_r / 4); writesl(ss->base + SS_RXFIFO, mi.addr + in_i, todo); @@ -320,8 +320,8 @@ static int sun4i_hash(struct ahash_request *areq) if ((areq->nbytes - i) < 64) { while (i < areq->nbytes && in_i < mi.length && op->len < 64) { /* how many bytes we can read from current SG */ - in_r = min3(mi.length - in_i, areq->nbytes - i, - 64 - op->len); + in_r = min(areq->nbytes - i, 64 - op->len); + in_r = min_t(size_t, mi.length - in_i, in_r); memcpy(op->buf + op->len, mi.addr + in_i, in_r); op->len += in_r; i += in_r;