From patchwork Mon Dec 16 17:45:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181751 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4614999och; Mon, 16 Dec 2019 09:51:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxN73OWd8Ax2rmJDvNJN9C0C5+1inTYFuY4IWH2p7QEvYMgwd7dmVUwmI51MUrcv5Kyevr+ X-Received: by 2002:a9d:5888:: with SMTP id x8mr31613202otg.361.1576518702399; Mon, 16 Dec 2019 09:51:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576518702; cv=none; d=google.com; s=arc-20160816; b=rZl/sM+f5qHAS2D0wsq4Gxrz77nOCXWD8fDrLcDDPvka1WOZfgNLqMqDObKdhN/e3g za2Jwy3FUS8q8uT2E0hAPjX9ys/Z+H3l0XuMbUGHqeaexnTmkCZDLSTxNIkz+z5T39ME XSNXlfsuQUgYg4+DDJu17a6VnVvVAIjugALqOCy/8L7TTj89T76qxoYfEyz/7K+iH0DZ qtfe6dI8b8fXs1QrqPSpbByCuCRo0eydDrt/GV1QWVvb6wIut8ToqAQAMs7O89Q887AG EZmlWHmQ0ghhSjz9YqQVMNvIzlwOPvbyFmtE1GSVbGzpzbdAGv4IthuC6zDHu89dmuZw 3KjA== 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=6N4XO1XV4I90WJgR2Gn/ZIKlmy8A7Wmcas3ZsANryLQ=; b=UbFWEUYnVWCO7bgWxYH7a+b/jUoOSn5P4ACI0/JmYjdSklmAOVNa3ZK4R/7F6sWXo1 +gfRMzVNH2da//FIVB6NHRgp50rUAgvv27c4isp7str81BK/mo+59tmkyEyIY/Bxzgga 4pZb8cUP0F/wP4rfh7VaTj7QztZMh+dHzZMkH6GRb61Amgw6loI5M+BdPwjSbaejth7A pfZ3K+yKGjBGpShHNfoUGVsdEhe+4+izot/YZx4QWl6HjWpZ1VGrMV0XsD1oSRhgy8a2 Ol1SkC0t8c5naOefNTzcJ54W17EY6+8DgbAVAQJJeEIlDIVMOvhaqlnqigDRaoj2dGWT orNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MxHilmdw; 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 w26si10732877otl.213.2019.12.16.09.51.42; Mon, 16 Dec 2019 09:51:42 -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=MxHilmdw; 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 S1727099AbfLPRvl (ORCPT + 14 others); Mon, 16 Dec 2019 12:51:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:41986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbfLPRvk (ORCPT ); Mon, 16 Dec 2019 12:51:40 -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 9A4DF20717; Mon, 16 Dec 2019 17:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518700; bh=6xX4GUpXtBOhRworb/C4nNl8y/xDjDpnXdqXg5c/DNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MxHilmdwXOJkBpbBIK7DxTikC9K0F8klEYkk2DjnUC4kbr5dTieACJxyAxA8vjMUN /2/PScPSjko8cJP5jLmj78NUBcIoiYdut/PeW9VO6aHRrwX0J5c4h9G2a8LcxwTvQT qI8cCZjITgSHw+qEOFZQvPujxFwAeEAQXXLRbg8M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ivan Khoronzhuk , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 031/267] net: ethernet: ti: cpts: correct debug for expired txq skb Date: Mon, 16 Dec 2019 18:45:57 +0100 Message-Id: <20191216174852.348367061@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Ivan Khoronzhuk [ Upstream commit d0e14c4d9bcef0d4aa1057d2959adaa6f18d4a17 ] The msgtype and seqid that is smth that belongs to event for comparison but not for staled txq skb. Signed-off-by: Ivan Khoronzhuk Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/ti/cpts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.20.1 diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c index 7d1281d812480..23c953496a0d1 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -116,9 +116,7 @@ static bool cpts_match_tx_ts(struct cpts *cpts, struct cpts_event *event) mtype, seqid); } else if (time_after(jiffies, skb_cb->tmo)) { /* timeout any expired skbs over 1s */ - dev_dbg(cpts->dev, - "expiring tx timestamp mtype %u seqid %04x\n", - mtype, seqid); + dev_dbg(cpts->dev, "expiring tx timestamp from txq\n"); __skb_unlink(skb, &cpts->txq); dev_consume_skb_any(skb); } From patchwork Mon Dec 16 17:45:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181752 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4615036och; Mon, 16 Dec 2019 09:51:45 -0800 (PST) X-Google-Smtp-Source: APXvYqz8H6e7KsZ6Xw0rxZn+9RznepNHwNakIKXLr3RmcAXWKP0tNfEvzfLlh2H4LpIINDzqVyOZ X-Received: by 2002:a05:6830:2116:: with SMTP id i22mr35173070otc.0.1576518704887; Mon, 16 Dec 2019 09:51:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576518704; cv=none; d=google.com; s=arc-20160816; b=vFST4sYd9YszGLMiOQZQoZPqhWKY8kKbwE4peWWz98EcyIzlAYfilKPUYII0tuGG56 MUEpIAHEzTOgtKi1xm/cxq03ov+x0PHXQ31rmfOmmn1yML83JwuPR3sGDi5RWrKN/TJO eKOLVNLNmLPwT3uMyKf2Nvsvbyg/8GgOjvxBG+uSsAJ5J3uWRUYvHjWWP6C/yuOlWnQo dtJ/fOULo2fovdkom/0bbFhrsQxguqSlFHynQWJ6/tCgOc9Snlv3SDquYiXC79pejT5u h8zA/VPA8LLZfyOatNMV7J9HYPakthMqApKf1+KbDR4Qiw7wUZyvFu82kyMVZFw2Mm6K 30Bw== 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=ij57WLioUSrHsqhZFZpQkqa8E4qVLYlRKZ2vf3bmNlo=; b=zVbcmD1qgK3itCgGvc39UY+yN+6b+XJEn3bSCVnSeUnUOCIfH/CGktZ2M/JHQe2gJ4 sEI1Dj4GOCjOyShAYKe9U7RBOv/JAznuPdTQVOgJqgUXwjICoyhD8QmpYREERxnIbaoh 3p6EGMLC6H2dJH9hO1DGRjmibNZROGdUCA49I8+K3NMlkKHbfKGKhvUoXgTXMbQIQRj7 +fjXVF9L81IoRrNcQDRzKCH4xXxnkxXzu+YMBN/Zoy6CJ9/mvd1smVup8sVXeZOUDBFw RRstrLR/fVftdI0wNtzHOUouoZtwpnI7s09kdnQRYTBxnDAciaJMxVIYJy+kWXYOu4aQ pCPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XS7JHond; 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 w15si11218103otm.263.2019.12.16.09.51.44; Mon, 16 Dec 2019 09:51:44 -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=XS7JHond; 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 S1727125AbfLPRvn (ORCPT + 14 others); Mon, 16 Dec 2019 12:51:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:42136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbfLPRvm (ORCPT ); Mon, 16 Dec 2019 12:51:42 -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 023C322464; Mon, 16 Dec 2019 17:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518702; bh=92m9MD0g2AXDPwD4TjpCVW3W2UQi4LGyYLnHE06iveM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XS7JHondk4saeFPUjezqVtzzXtrAJjp9PjLxC4SEUMFu3WdFQ4Ecl4+4EmoZynSyG WuJXheGI3dUcmypCxxuHvkjL7bxqvbqwTEdfMOaRbAAOD77KvBmBqeeIvkq8lgAxTu OBVbJLu4X1h2RvIimeBxB/Fu4MyscvsRyvLn/Bzk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Alexandre Belloni , Sasha Levin Subject: [PATCH 4.14 032/267] rtc: s3c-rtc: Avoid using broken ALMYEAR register Date: Mon, 16 Dec 2019 18:45:58 +0100 Message-Id: <20191216174852.488895969@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Marek Szyprowski [ Upstream commit 50c8aec4212a966817e868056efc9bfbb73337c0 ] (RTC,ALM)YEAR registers of Exynos built-in RTC device contains 3 BCD characters. s3c-rtc driver uses only 2 lower of them and supports years from 2000..2099 range. The third BCD value is typically set to 0, but it looks that handling of it is broken in the hardware. It sometimes defaults to a random (even non-BCD) value. This is not an issue for handling RTCYEAR register, because bcd2bin() properly handles only 8bit values (2 BCD characters, the third one is skipped). The problem is however with ALMYEAR register and proper RTC alarm operation. When YEAREN bit is set for the configured alarm, RTC hardware triggers alarm only when ALMYEAR and RTCYEAR matches. This usually doesn't happen because of the random noise on the third BCD character. Fix this by simply skipping setting ALMYEAR register in alarm configuration. This workaround fixes broken alarm operation on Exynos built-in rtc device. My tests revealed that the issue happens on the following Exynos series: 3250, 4210, 4412, 5250 and 5410. Signed-off-by: Marek Szyprowski Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/rtc/rtc-s3c.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.20.1 diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index a8992c227f611..4120a305954af 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -327,7 +327,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) struct rtc_time *tm = &alrm->time; unsigned int alrm_en; int ret; - int year = tm->tm_year - 100; dev_dbg(dev, "s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", alrm->enabled, @@ -356,11 +355,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) writeb(bin2bcd(tm->tm_hour), info->base + S3C2410_ALMHOUR); } - if (year < 100 && year >= 0) { - alrm_en |= S3C2410_RTCALM_YEAREN; - writeb(bin2bcd(year), info->base + S3C2410_ALMYEAR); - } - if (tm->tm_mon < 12 && tm->tm_mon >= 0) { alrm_en |= S3C2410_RTCALM_MONEN; writeb(bin2bcd(tm->tm_mon + 1), info->base + S3C2410_ALMMON); From patchwork Mon Dec 16 17:46:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181753 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4616209och; Mon, 16 Dec 2019 09:52:48 -0800 (PST) X-Google-Smtp-Source: APXvYqxBT5IQzQVa3k+nvSGX9OOwPZnc4HfFNm7kE0ayJEYyY6FdSgK/ny2uf7lxsN61sNfjnpqi X-Received: by 2002:a9d:7483:: with SMTP id t3mr33214566otk.262.1576518768537; Mon, 16 Dec 2019 09:52:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576518768; cv=none; d=google.com; s=arc-20160816; b=r5AopHDEnH4SrKJsBxR5d/LmGBiVN9ALbkS9BzDGN/+OQkeOObkXoK+FLGdbwl5jNZ Rjp4D0JGJrS63l+BmX5LU/tIp+m2S+9R00dMV+icpClTJ0nfOo13Z4RaTtfGpp19n8Sl 7OG4FqSENehyVConEJlN/HmXL6YgshT4O5tqrvWXs38BmrQy+qD1hvN2J87Cr6SkUHhM 1PAsnQy8wijOirf15clBFk8ATo+5OYWGSrhYw5P3C92szDBQkKQRCkPRa7kH51Rj2GKH E4rjXY20zd8QjFRCydwgHogMtm9UFsgHY48IxBq8PjxvlIXNSaIbA5/v/I5Vc2yC1TpH c/+A== 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=Ku5eDI8lKPXLnOqISfNjVnsqYyyGTqcNYssKBJm/n4o=; b=GpA7n+F5epXMzqTh/Co45FAUB6Qv1zh1B64mhcDiGEvpXFIv9DJdOd4NfT5r4rLIIj cfAcuaX40bQLA0/mnCvGGUp8ailwhrTULHbzC0RIooSWVLk2/CyxJbKFBD5QhsM0SNDC QSFLoJ+W31uHazElQBfNjkPWzIloD98n7Dqc+gZAmIOGyBxSSu6RJyzGimaUNl4X+var o5Gqe0YkTg6wvVt5Kdd+2UK4PAH+XbPaD94DGMqftJqCrXlN96DMUmvq8BiallBnjFhq I4gHbRbflGKoVYhRW54/+Pw0Y5bjFjqL3OGXeI2yyaPmDq4pYalJ3KL1pW97kg8VRPxe djdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=h4hAJ9Ki; 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 d13si10105257ote.242.2019.12.16.09.52.48; Mon, 16 Dec 2019 09:52:48 -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=h4hAJ9Ki; 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 S1727591AbfLPRwr (ORCPT + 14 others); Mon, 16 Dec 2019 12:52:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:45196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727577AbfLPRwq (ORCPT ); Mon, 16 Dec 2019 12:52:46 -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 05B9221775; Mon, 16 Dec 2019 17:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518765; bh=QSdhKLOCJdi1nDRDrfplSOxXx5/mnCvmw6p4a8jvB24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h4hAJ9Kiupev5khp+gNXXvDybt/I358vgU85N6QRp5Jt8Y+M0AIsV+PTtwNGQb39F tG6q0mzHZk6hdn9KbD95KBhE+kBtFzcN4hdubt8Ybad7RFiJ8N2oC0DAbklO30+gwX Bc1GBwn957MrgcAO4CEqVV0cjQEapZPdhA3tuwW0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 4.14 056/267] ARM: dts: exynos: Use Samsung SoC specific compatible for DWC2 module Date: Mon, 16 Dec 2019 18:46:22 +0100 Message-Id: <20191216174854.609482572@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Marek Szyprowski [ Upstream commit 6035cbcceb069f87296b3cd0bc4736ad5618bf47 ] DWC2 hardware module integrated in Samsung SoCs requires some quirks to operate properly, so use Samsung SoC specific compatible to notify driver to apply respective fixes. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- arch/arm/boot/dts/exynos3250.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/arch/arm/boot/dts/exynos3250.dtsi b/arch/arm/boot/dts/exynos3250.dtsi index aa06a02c3ff59..5ba6622549097 100644 --- a/arch/arm/boot/dts/exynos3250.dtsi +++ b/arch/arm/boot/dts/exynos3250.dtsi @@ -359,7 +359,7 @@ }; hsotg: hsotg@12480000 { - compatible = "snps,dwc2"; + compatible = "samsung,s3c6400-hsotg", "snps,dwc2"; reg = <0x12480000 0x20000>; interrupts = ; clocks = <&cmu CLK_USBOTG>; From patchwork Mon Dec 16 17:46:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181790 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4700939ile; Mon, 16 Dec 2019 10:48:35 -0800 (PST) X-Google-Smtp-Source: APXvYqyPtZiGURt9/1cJaLIewTaUXSTnlovj/HvP7jBCLMI1rg/wHAWiT/GCoAPnd/g5W1Ha2jvH X-Received: by 2002:a9d:768b:: with SMTP id j11mr33305324otl.116.1576522115640; Mon, 16 Dec 2019 10:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576522115; cv=none; d=google.com; s=arc-20160816; b=fsrdDC9CYFbqTpkrGEKIOhcDgmuJRxmOV/CVSdK8OVTC2EfQgLgIydSLb/bWi7BUiQ Ub5f+ZeW5yKAVeZ12t4Vsqtb2QGCTJZN1oBynYWO/DJPrWnEGpBfwcAndvoDM8UrHv6S q8+RSKMO9okIM+5UtsvFYqT44WEcdnFo6XVfeouwA7H1x5FEpQhg9b0ofAfLsgxsgpeO wc2mLTCC2ooPdreq0bgb/CIZRyKb/wEvx2hjzBw1MnD1OUhblRq/eiU51sVjDT58fQb/ LRuNPihiqRA9L13mP05H5r8CCm0KexQNcwFv5XTJdwkjLXrqvkvMCy7l5yLIZxdYMLCn 2X7w== 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=FmsVIokvUsqDPDOtukA1LV7Vb2MNWemk/XjW4dLRrJA=; b=Rw1femHmmZ4bm6bfY9Ojsx4uZtDvAcSrJyVZ5ww9cNCWuj++2EweM7fHF5odWt1u9M 3wceEJqiBhe3h3EbYWrxzGvbbDtlEHzlBR+1b/gsmK9sNG5Et58fgh1LyNr2Bws6cVKp ShpgawTehn8E6uSYfRWL0tKmgIMp25sporg1CZsatLcFsd0wpngos8MguUMsJQShkvj/ 0cYGgv3fCZbYt6pnKzxK8Xio6pYtUvQ0suHtLXH87A7NdGUgZpK06N2wIWihxnCHWCpp MkU5CW/iym6q8d81sqQfui4FMFdTsyVA67Pcd/wXmy8Fl7nBdlt+W1RXr1XOscJzdoIQ /Vlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DI1xas5Z; 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 r1si10625854otp.251.2019.12.16.10.48.35; Mon, 16 Dec 2019 10:48:35 -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=DI1xas5Z; 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 S1727394AbfLPSse (ORCPT + 14 others); Mon, 16 Dec 2019 13:48:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:49594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727868AbfLPRyK (ORCPT ); Mon, 16 Dec 2019 12:54:10 -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 73C2121582; Mon, 16 Dec 2019 17:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518849; bh=VSBIhfZCukb3KkAC7X5bF+mpEdHCaVQdLhX+frrXC4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DI1xas5ZLsoy5oAAfG3MdNUndP6SDYyQi398kFtrMHHz+qdEFnT+1fn//VIo3HP3Y /aZcBcB0WdpBXs7Ot5te+Iea/yIJeR0wNWWlhsZo3Ny2qzj2DfqfTrhk3ai8Eg9T0M u0Ar6BnaJT8JUuIXV3lK3Ot057A/NFrVwcgoiv20= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Rob Herring , Olof Johansson , Sasha Levin Subject: [PATCH 4.14 091/267] ARM: dts: realview-pbx: Fix duplicate regulator nodes Date: Mon, 16 Dec 2019 18:46:57 +0100 Message-Id: <20191216174858.071865771@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Rob Herring [ Upstream commit 7f4b001b7f6e0480b5bdab9cd8ce1711e43e5cb5 ] There's a bug in dtc in checking for duplicate node names when there's another section (e.g. "/ { };"). In this case, skeleton.dtsi provides another section. Upon removal of skeleton.dtsi, the dtb fails to build due to a duplicate node 'fixedregulator@0'. As both nodes were pretty much the same 3.3V fixed regulator, it hasn't really mattered. Fix this by renaming the nodes to something unique. In the process, drop the unit-address which shouldn't be present wtihout reg property. Cc: Linus Walleij Signed-off-by: Rob Herring Signed-off-by: Olof Johansson Signed-off-by: Sasha Levin --- arch/arm/boot/dts/arm-realview-pbx.dtsi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/arch/arm/boot/dts/arm-realview-pbx.dtsi b/arch/arm/boot/dts/arm-realview-pbx.dtsi index 2bf3958b2e6b9..068293254fbb8 100644 --- a/arch/arm/boot/dts/arm-realview-pbx.dtsi +++ b/arch/arm/boot/dts/arm-realview-pbx.dtsi @@ -43,7 +43,7 @@ }; /* The voltage to the MMC card is hardwired at 3.3V */ - vmmc: fixedregulator@0 { + vmmc: regulator-vmmc { compatible = "regulator-fixed"; regulator-name = "vmmc"; regulator-min-microvolt = <3300000>; @@ -51,7 +51,7 @@ regulator-boot-on; }; - veth: fixedregulator@0 { + veth: regulator-veth { compatible = "regulator-fixed"; regulator-name = "veth"; regulator-min-microvolt = <3300000>; @@ -539,4 +539,3 @@ }; }; }; - From patchwork Mon Dec 16 17:47:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181758 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4619710och; Mon, 16 Dec 2019 09:56:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwQz4DOZdXer6kIQEB6yPkBDjzHPYKGsoG94KP6UZ/OMeTb6e6JS2qbQK7g3dXlXNCq1I18 X-Received: by 2002:a05:6830:4b9:: with SMTP id l25mr33884302otd.266.1576518972415; Mon, 16 Dec 2019 09:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576518972; cv=none; d=google.com; s=arc-20160816; b=0sUjUeBsD5cwCx0dKILlxLkPnTXXntBke3vuXL0/aAPHzPP4d7PF8kVsm1rHA+TGWK M2nr9hLgBpc38XEujemhntmPqWYilp4/LcxS5OYqcjD2f97ofnHp1jc15AEPtzVow54i 7RwPEMe55fngePRHydp1F9dE5DyyThXFj0TDoINkuC2Fzt3i/qgeafKWEtWgNk1HzrPc cr7oVhTLaczyacz0Y2wgiItfxQ+fZhBYVtPuP38HmJVhw8Th6OgJVifUxjqAJAB15uql jSJ1OzTC3MUGFQGHdYu9ovfIDsa9gjyz+M3N5APSuND5hK0HZXnWZ2x9wMHePZtg69He 8iVg== 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=dDq+WKl9XFwhH5McBizAftmJWiZ1h3imxqy/7AlKzWg=; b=Cp8H2/2hwn5Znb/0utLU/3deZaTnTFEgl/mGRfb5sZ2vi8TITdEWDx7TDha3yw2Yb3 +vOHC0HEoZfvp1tOifXYyykDRZWpyRjYGgXmMIcbvTKsm8FbwzREMapcIHDAWi1c+GU9 PM9IFKswKzG/wQghzqYQT7Ek99TDMfp5474iei1Q6K4qGBnJVqhOR7V2JvOKMzrzcjdE puSfPynEuA0iOX4QVkah55Y+0wHFxKpXbgxF9RlAxLPtBwMFyCPuh/Kk6VUo5N/frlGh 4T9Sf/MN3BpDkH2i/k4T/JYelBz4yxtCW0HdxwfskKII4EMhrVZSCKtmMX7Ya5bKEkRJ sNAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="c6Uy/4SL"; 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 f9si10878882otp.111.2019.12.16.09.56.12; Mon, 16 Dec 2019 09:56:12 -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="c6Uy/4SL"; 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 S1727756AbfLPR4K (ORCPT + 14 others); Mon, 16 Dec 2019 12:56:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:54006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727337AbfLPR4K (ORCPT ); Mon, 16 Dec 2019 12:56:10 -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 7DB3420733; Mon, 16 Dec 2019 17:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576518969; bh=m0Xi4nTk+oGEpyZ0wdmXOfeFk6InEJHjaHdGJ/1h9rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c6Uy/4SLeSmgSZwP8EuHKgoyf88zS4pSeiBLq9Fs6O/224MaPTQmQWHI2BHfUBnyO qaWwW/AxLJN0oX/quMLdqZDbnOJSG6Ba7f5Q8y1gsayTVUU0Bafk+zu0bUxK3VXw2y aGGWWosObMMcg05q426Moi8Zwz1iQZS0UKdgRuaM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joel Stanley , Nick Desaulniers , Segher Boessenkool , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 104/267] powerpc/math-emu: Update macros from GCC Date: Mon, 16 Dec 2019 18:47:10 +0100 Message-Id: <20191216174902.408908071@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Joel Stanley [ Upstream commit b682c8692442711684befe413cf93cf01c5324ea ] The add_ssaaaa, sub_ddmmss, umul_ppmm and udiv_qrnnd macros originate from GCC's longlong.h which in turn was copied from GMP's longlong.h a few decades ago. This was found when compiling with clang: arch/powerpc/math-emu/fnmsub.c:46:2: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions FP_ADD_D(R, T, B); ^~~~~~~~~~~~~~~~~ ... ./arch/powerpc/include/asm/sfp-machine.h:283:27: note: expanded from macro 'sub_ddmmss' : "=r" ((USItype)(sh)), \ ~~~~~~~~~~^~~ Segher points out: this was fixed in GCC over 16 years ago ( https://gcc.gnu.org/r56600 ), and in GMP (where it comes from) presumably before that. Update the add_ssaaaa, sub_ddmmss, umul_ppmm and udiv_qrnnd macros to the latest GCC version in order to git rid of the invalid casts. These were taken as-is from GCC's longlong in order to make future syncs obvious. Other parts of sfp-machine.h were left as-is as the file contains more features than present in longlong.h. Link: https://github.com/ClangBuiltLinux/linux/issues/260 Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Reviewed-by: Segher Boessenkool Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/sfp-machine.h | 92 ++++++++------------------ 1 file changed, 29 insertions(+), 63 deletions(-) -- 2.20.1 diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h index d89beaba26ff9..8b957aabb826d 100644 --- a/arch/powerpc/include/asm/sfp-machine.h +++ b/arch/powerpc/include/asm/sfp-machine.h @@ -213,30 +213,18 @@ * respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow * (i.e. carry out) is not stored anywhere, and is lost. */ -#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ +#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ do { \ if (__builtin_constant_p (bh) && (bh) == 0) \ - __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "%r" ((USItype)(ah)), \ - "%r" ((USItype)(al)), \ - "rI" ((USItype)(bl))); \ - else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \ - __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "%r" ((USItype)(ah)), \ - "%r" ((USItype)(al)), \ - "rI" ((USItype)(bl))); \ + __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ + else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \ + __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ else \ - __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "%r" ((USItype)(ah)), \ - "r" ((USItype)(bh)), \ - "%r" ((USItype)(al)), \ - "rI" ((USItype)(bl))); \ + __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \ + : "=r" (sh), "=&r" (sl) \ + : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \ } while (0) /* sub_ddmmss is used in op-2.h and udivmodti4.c and should be equivalent to @@ -248,44 +236,24 @@ * and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere, * and is lost. */ -#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ +#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ do { \ if (__builtin_constant_p (ah) && (ah) == 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(bh)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ - else if (__builtin_constant_p (ah) && (ah) ==~(USItype) 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(bh)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ + __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\ + else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0) \ + __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\ else if (__builtin_constant_p (bh) && (bh) == 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(ah)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ - else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(ah)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ + __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\ + else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \ + __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\ else \ - __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(ah)), \ - "r" ((USItype)(bh)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ + __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \ + : "=r" (sh), "=&r" (sl) \ + : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \ } while (0) /* asm fragments for mul and div */ @@ -294,13 +262,10 @@ * UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype * word product in HIGH_PROD and LOW_PROD. */ -#define umul_ppmm(ph, pl, m0, m1) \ +#define umul_ppmm(ph, pl, m0, m1) \ do { \ USItype __m0 = (m0), __m1 = (m1); \ - __asm__ ("mulhwu %0,%1,%2" \ - : "=r" ((USItype)(ph)) \ - : "%r" (__m0), \ - "r" (__m1)); \ + __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \ (pl) = __m0 * __m1; \ } while (0) @@ -312,9 +277,10 @@ * significant bit of DENOMINATOR must be 1, then the pre-processor symbol * UDIV_NEEDS_NORMALIZATION is defined to 1. */ -#define udiv_qrnnd(q, r, n1, n0, d) \ +#define udiv_qrnnd(q, r, n1, n0, d) \ do { \ - UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m; \ + UWtype __d1, __d0, __q1, __q0; \ + UWtype __r1, __r0, __m; \ __d1 = __ll_highpart (d); \ __d0 = __ll_lowpart (d); \ \ @@ -325,7 +291,7 @@ if (__r1 < __m) \ { \ __q1--, __r1 += (d); \ - if (__r1 >= (d)) /* we didn't get carry when adding to __r1 */ \ + if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\ if (__r1 < __m) \ __q1--, __r1 += (d); \ } \ From patchwork Mon Dec 16 17:47:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181761 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4621553och; Mon, 16 Dec 2019 09:57:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwH9YpSP4pewotTOjP0L29joUbmyotTDRA7+zuFy7+0usR2Mi9RWSsFIkR2yXbivyUXq714 X-Received: by 2002:a9d:74d8:: with SMTP id a24mr35095222otl.100.1576519071561; Mon, 16 Dec 2019 09:57:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519071; cv=none; d=google.com; s=arc-20160816; b=ukBePjgzdqzZZUAg5zPaMw1sOcZLCRpx0ZtOhlVzmGXNC1mfatneCKiizselWxaYjh unFfVlUrltRfZpj4ka6MEllo6xAgl6EXEd73KZuTOo0s5aCX0YRmqVO9nXuIgWP0qOI3 TlPLPexx5mWaFFOatErbBKdHlu6Sx5PcVMRANYQE0LN0M1hV48hQte2kWteoGgOXYVjc CzLIClzhwb9wPqGPI+oYnHPr6XLGvAr3/Pys99UoA9N6SbndiRF/AwwUxWBzJajg8/5s dC4ZEqpbHNcXkHcMHHamYLP9af6RwMAb3wQqefL5AfCu7PpTlC+ZAvjcUp5DmXsJ0zj5 vXKg== 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=dcsyXSb3xjV5yVlyG8XnUdZO+Xjjlf8E0WqhDS/CMW8=; b=M9KgsBAQehCQqMSvXvxIJxfDnUKY/yLy/jJy/ktqEYkc+b9uEFK/uNZPLjMbfk2IqB L/50GIQZC4JzMR+T2kwkeAXIxyr6I71cMz1TqbtRdG5N7AgMjrrPGIxK2Kqbk2r9/D13 czyIPQEAnKYNKK0tLdAbLRKrxYdoklmUvRmoC8qLdKbOvxwMU4Mfs8VRLpsEelKczenf E28E9PzJW2ytBlh6EHZRhexCnHOGL0l1HxOIY8cJ/7VvRbEAneEd5MgQOt5cbCoS3dlF EeFww0I/hijQyE4Lf/fHTdh2/64SqBzFo0GNU5YhbPXvefZzvg0PPB3PlX1I+jSVkZk0 vD3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=haOIuDRE; 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 i5si10422089oif.211.2019.12.16.09.57.51; Mon, 16 Dec 2019 09:57:51 -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=haOIuDRE; 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 S1727377AbfLPR5u (ORCPT + 14 others); Mon, 16 Dec 2019 12:57:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:57018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbfLPR5t (ORCPT ); Mon, 16 Dec 2019 12:57:49 -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 374B5205ED; Mon, 16 Dec 2019 17:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519068; bh=DXDA4Lq4acHcggXVh/4++Hr9oR4iVnfHrAAnjEEAhiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=haOIuDREjegheu1zlxMNs2WIPPfEGk/1LJub39lwbRAwU0CLjevF7NcJjdBetxrAp H5MajEz2aIy2vrYOwH4EXT527molyCsCq1ALo18l70BTOnLSowfhJhyCLAWBW67+Rv ETjlYCOLM1hP7Sldr4LTaCxDRlm4OZ9t7PvHbPh8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sahaj Sarup , Mark Salter , Gary R Hook , Herbert Xu Subject: [PATCH 4.14 145/267] crypto: ccp - fix uninitialized list head Date: Mon, 16 Dec 2019 18:47:51 +0100 Message-Id: <20191216174910.419981328@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Mark Salter commit 691505a803a7f223b2af621848d581259c61f77d upstream. A NULL-pointer dereference was reported in fedora bz#1762199 while reshaping a raid6 array after adding a fifth drive to an existing array. [ 47.343549] md/raid:md0: raid level 6 active with 3 out of 5 devices, algorithm 2 [ 47.804017] md0: detected capacity change from 0 to 7885289422848 [ 47.822083] Unable to handle kernel read from unreadable memory at virtual address 0000000000000000 ... [ 47.940477] CPU: 1 PID: 14210 Comm: md0_raid6 Tainted: G W 5.2.18-200.fc30.aarch64 #1 [ 47.949594] Hardware name: AMD Overdrive/Supercharger/To be filled by O.E.M., BIOS ROD1002C 04/08/2016 [ 47.958886] pstate: 00400085 (nzcv daIf +PAN -UAO) [ 47.963668] pc : __list_del_entry_valid+0x2c/0xa8 [ 47.968366] lr : ccp_tx_submit+0x84/0x168 [ccp] [ 47.972882] sp : ffff00001369b970 [ 47.976184] x29: ffff00001369b970 x28: ffff00001369bdb8 [ 47.981483] x27: 00000000ffffffff x26: ffff8003b758af70 [ 47.986782] x25: ffff8003b758b2d8 x24: ffff8003e6245818 [ 47.992080] x23: 0000000000000000 x22: ffff8003e62450c0 [ 47.997379] x21: ffff8003dfd6add8 x20: 0000000000000003 [ 48.002678] x19: ffff8003e6245100 x18: 0000000000000000 [ 48.007976] x17: 0000000000000000 x16: 0000000000000000 [ 48.013274] x15: 0000000000000000 x14: 0000000000000000 [ 48.018572] x13: ffff7e000ef83a00 x12: 0000000000000001 [ 48.023870] x11: ffff000010eff998 x10: 00000000000019a0 [ 48.029169] x9 : 0000000000000000 x8 : ffff8003e6245180 [ 48.034467] x7 : 0000000000000000 x6 : 000000000000003f [ 48.039766] x5 : 0000000000000040 x4 : ffff8003e0145080 [ 48.045064] x3 : dead000000000200 x2 : 0000000000000000 [ 48.050362] x1 : 0000000000000000 x0 : ffff8003e62450c0 [ 48.055660] Call trace: [ 48.058095] __list_del_entry_valid+0x2c/0xa8 [ 48.062442] ccp_tx_submit+0x84/0x168 [ccp] [ 48.066615] async_tx_submit+0x224/0x368 [async_tx] [ 48.071480] async_trigger_callback+0x68/0xfc [async_tx] [ 48.076784] ops_run_biofill+0x178/0x1e8 [raid456] [ 48.081566] raid_run_ops+0x248/0x818 [raid456] [ 48.086086] handle_stripe+0x864/0x1208 [raid456] [ 48.090781] handle_active_stripes.isra.0+0xb0/0x278 [raid456] [ 48.096604] raid5d+0x378/0x618 [raid456] [ 48.100602] md_thread+0xa0/0x150 [ 48.103905] kthread+0x104/0x130 [ 48.107122] ret_from_fork+0x10/0x18 [ 48.110686] Code: d2804003 f2fbd5a3 eb03003f 54000320 (f9400021) [ 48.116766] ---[ end trace 23f390a527f7ad77 ]--- ccp_tx_submit is passed a dma_async_tx_descriptor which is contained in a ccp_dma_desc and adds it to a ccp channel's pending list: list_del(&desc->entry); list_add_tail(&desc->entry, &chan->pending); The problem is that desc->entry may be uninitialized in the async_trigger_callback path where the descriptor was gotten from ccp_prep_dma_interrupt which got it from ccp_alloc_dma_desc which doesn't initialize the desc->entry list head. So, just initialize the list head to avoid the problem. Cc: Reported-by: Sahaj Sarup Signed-off-by: Mark Salter Acked-by: Gary R Hook Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/ccp/ccp-dmaengine.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/crypto/ccp/ccp-dmaengine.c +++ b/drivers/crypto/ccp/ccp-dmaengine.c @@ -341,6 +341,7 @@ static struct ccp_dma_desc *ccp_alloc_dm desc->tx_desc.flags = flags; desc->tx_desc.tx_submit = ccp_tx_submit; desc->ccp = chan->ccp; + INIT_LIST_HEAD(&desc->entry); INIT_LIST_HEAD(&desc->pending); INIT_LIST_HEAD(&desc->active); desc->status = DMA_IN_PROGRESS; From patchwork Mon Dec 16 17:47:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181763 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4621844och; Mon, 16 Dec 2019 09:58:09 -0800 (PST) X-Google-Smtp-Source: APXvYqw4p1PIXh4twUpw9DA/hPM4fVEpGH8/260svLVe2CL6K2IxGKBMD7DtviB9hu1C5I6dPc7Q X-Received: by 2002:a9d:6d10:: with SMTP id o16mr33987087otp.28.1576519089232; Mon, 16 Dec 2019 09:58:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519089; cv=none; d=google.com; s=arc-20160816; b=pnq1cyzTGHmsFGJliyL+jhPyc4EHdb6boWbnBHxznCBlkjzTUTF7ro+ii3bGuLAiVm J7k7A76WYcLYXH2Cw9afm5043MQ2OjYRP4RznhZJebJPUommajln3Sumiv6SXWmueTsZ jPjlZGPMHdRrOsawPaJsXKAOBIdeqSg4deZHy8lwAwhHjvT3SygwJH8h1Lzi9Bk2Kz0l 3V/rDPfosFhqPnTmZSaeOZgBJv6FjDz9iVyoON5XQGWtjLdkS+GBnf+ZZ06llGxI0G5F xaCjjivHwAs6GvnK2mHXylpV093g7fzya9Zot5mopBfbmxtaG9O5XeKIzLcD6XTNsDAf ikjg== 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=UhOp/l3ujFqz6RAm/8VTdFIsvCu9tVGgETC5hzpHcUo=; b=SalyEWaDFgUqFpu6bM6C+eGLpnFa8VO+XY2lK/sE6HE7N1T1NCp2qEDDMrrlreYJrz 3gFcwhrfJUtsWP3v+9y16dSnX5CezKCmW6OnwEAfT6pN8yQujjw6w/MDGtuncaUJXPBY YXHcK9G9QOuNbiWw1pTR/yEw70UXUUXaQlvqHE7S6RaDAA99to2Cfn7ONxs8P1uNnmSG iH/wkXj0JXuRvAZSimvfl6Vxm3vykAMs4LenzI0g1ws2hkvNxJH/bd0TV76JqhoCFSUa ASJkA4BsGYuxXCvBEjTZs+4rwK+RkHEDePKumkDM4fxa3yLSXNOigdgQ3jUbruRRBH9p bJZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2Vv/OV4i"; 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 f60si11353393otf.119.2019.12.16.09.58.09; Mon, 16 Dec 2019 09:58:09 -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="2Vv/OV4i"; 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 S1728362AbfLPR6I (ORCPT + 14 others); Mon, 16 Dec 2019 12:58:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:57596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728575AbfLPR6G (ORCPT ); Mon, 16 Dec 2019 12:58: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 71C8F205ED; Mon, 16 Dec 2019 17:58:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519085; bh=bMEM8CgX/6uIErmN9B5ttGlNi4wBwVVcAmuXfFf4Z8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Vv/OV4ir2v2pxr5sXbyG200/DvKyQob6zQquIFJKXaieSEaKOdNWt5eS8kSxJvRT DuPm+Xq5fM6KHTESiDm4BHRhSW8o6fz6sBMKzWQGHx2a2ivJeVPwCOJQizwyXREFHx qZhvZZI/mnTyD2LMwzY14cqDX/kmPKDsNrbZNwes= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Viresh Kumar , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 149/267] RDMA/qib: Validate ->show()/store() callbacks before calling them Date: Mon, 16 Dec 2019 18:47:55 +0100 Message-Id: <20191216174910.648241558@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Viresh Kumar commit 7ee23491b39259ae83899dd93b2a29ef0f22f0a7 upstream. The permissions of the read-only or write-only sysfs files can be changed (as root) and the user can then try to read a write-only file or write to a read-only file which will lead to kernel crash here. Protect against that by always validating the show/store callbacks. Link: https://lore.kernel.org/r/d45cc26361a174ae12dbb86c994ef334d257924b.1573096807.git.viresh.kumar@linaro.org Signed-off-by: Viresh Kumar Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/qib/qib_sysfs.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/infiniband/hw/qib/qib_sysfs.c +++ b/drivers/infiniband/hw/qib/qib_sysfs.c @@ -301,6 +301,9 @@ static ssize_t qib_portattr_show(struct struct qib_pportdata *ppd = container_of(kobj, struct qib_pportdata, pport_kobj); + if (!pattr->show) + return -EIO; + return pattr->show(ppd, buf); } @@ -312,6 +315,9 @@ static ssize_t qib_portattr_store(struct struct qib_pportdata *ppd = container_of(kobj, struct qib_pportdata, pport_kobj); + if (!pattr->store) + return -EIO; + return pattr->store(ppd, buf, len); } From patchwork Mon Dec 16 17:48:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 181764 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp4622231och; Mon, 16 Dec 2019 09:58:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwkwgK/z8csQb2ioF+NXYbAMoKUY/0JY3q7avKv/KFm7RNUdy0jmKyscH3rBTAyjvVx8u95 X-Received: by 2002:a9d:578a:: with SMTP id q10mr31964924oth.215.1576519111080; Mon, 16 Dec 2019 09:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576519111; cv=none; d=google.com; s=arc-20160816; b=tXEk5Uw+aFxdWwzXnh/8rdVwwGrGS0uxwM1FZbDD1VFLMBQMtihMl2r4ESzGNo5sjK LEUVFp6O0XmSpA6BH4l+3mbNKbOr3ppWEu1YVIJlziJnN2SlhD8WoH2xInXxjkaYUI9L 3uapggL4G0/YI8y95mQLWvUb7YAcrsB3JzAN1XeZwoYdBZsb6cKdA+3Rz6htqkJ94yd5 ystbtcrjCnweT6SEm/53OZAHYizFQ2k77IjLsziLUzc/SNTKu00e/7fNqw0E8LOx0Nu9 IE8zR+ldqRaSjkTuQDZNmNgW4aRbG/vcbELo8EZD8R1Ntt5TPZX6M+fSAPXCJYa6YvCp K/9g== 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=RhZYkInM4/L4u9816xItFvcYX6P19603RTaOGJYRRcE=; b=QtD2UF5IJr+Z9fCUvkIUSw+mx1IzR3TdZr7eeF9A2ybhfJQ8BvMHA5sjohk/tWbt5H uB8+KrwQhQ0v8HLds1B9ejWGf8e83LEyCVxDowmw9xfhUR2W1Z/iQAtkm5OEoHR4NLf6 zGdcKwKV2QwME1mM7LiUaHw12BePNEWRYpm/T+z1Yhn/p/hkCE/g7sn+suSaKQkG24ch Qm+C7qxskLxJXq0s8l3kW5l9D9wrossLa+aeT5WnxMNQibkm8m16yMzn2Q6V+c9N9mfm SqwLYRvVfxS9AKMjHtkCRPbTwK8g7YyvQ1nKne6HxL3bM3PbM2mmUiyCUAH+F1NM99Lw Ce3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cLF3VTi7; 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 l16si11157360otq.73.2019.12.16.09.58.30; Mon, 16 Dec 2019 09:58: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=cLF3VTi7; 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 S1728615AbfLPR63 (ORCPT + 14 others); Mon, 16 Dec 2019 12:58:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:58238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727862AbfLPR62 (ORCPT ); Mon, 16 Dec 2019 12:58: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 41B22205ED; Mon, 16 Dec 2019 17:58:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576519107; bh=MpxtrENkNjZdHfFpgX0nTElVRVzAyCMKzMzjQ3oojsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cLF3VTi71uj0PFGkCwmp4gXnw/jBA3ULbcXB/xFPLhz56XhozrgSc+qG5ANtxBKiq vxLt6oPLYJumo3juIJBfKhPDCHE8RHYpF1ij/mZNnIZB0hBcCKMXDUJoLOdu/S965o GT3/lHd5oMgId5yUbscFjWoPZiSUT99ZsWDJTGCQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sumit Garg , Herbert Xu Subject: [PATCH 4.14 199/267] hwrng: omap - Fix RNG wait loop timeout Date: Mon, 16 Dec 2019 18:48:45 +0100 Message-Id: <20191216174913.438567056@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191216174848.701533383@linuxfoundation.org> References: <20191216174848.701533383@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: Sumit Garg commit be867f987a4e1222114dd07a01838a17c26f3fff upstream. Existing RNG data read timeout is 200us but it doesn't cover EIP76 RNG data rate which takes approx. 700us to produce 16 bytes of output data as per testing results. So configure the timeout as 1000us to also take account of lack of udelay()'s reliability. Fixes: 383212425c92 ("hwrng: omap - Add device variant for SafeXcel IP-76 found in Armada 8K") Cc: Signed-off-by: Sumit Garg Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/char/hw_random/omap-rng.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -66,6 +66,13 @@ #define OMAP4_RNG_OUTPUT_SIZE 0x8 #define EIP76_RNG_OUTPUT_SIZE 0x10 +/* + * EIP76 RNG takes approx. 700us to produce 16 bytes of output data + * as per testing results. And to account for the lack of udelay()'s + * reliability, we keep the timeout as 1000us. + */ +#define RNG_DATA_FILL_TIMEOUT 100 + enum { RNG_OUTPUT_0_REG = 0, RNG_OUTPUT_1_REG, @@ -175,7 +182,7 @@ static int omap_rng_do_read(struct hwrng if (max < priv->pdata->data_size) return 0; - for (i = 0; i < 20; i++) { + for (i = 0; i < RNG_DATA_FILL_TIMEOUT; i++) { present = priv->pdata->data_present(priv); if (present || !wait) break;