From patchwork Wed Dec 11 15:02:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181282 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp714461ile; Wed, 11 Dec 2019 07:55:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwYcDVByAcD5JTLDC5KOpGA62+y4RzuTadEZ5WAVxx6IvKPhr6T1Eg9NL029mtnXQoApvBp X-Received: by 2002:aca:1903:: with SMTP id l3mr3393738oii.16.1576079707345; Wed, 11 Dec 2019 07:55:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079707; cv=none; d=google.com; s=arc-20160816; b=eGPYJ58GSUS+unDR7wBBphOEGQmtzvRPc9FZJDanhZ75o7WAGaAbry5kbZQtuV5DyH RG6+9Z1doWsor6ZVv3K5r8FTc84zcT2qq1ge10DJAQCT4MMRWyz5cUznNn1F8ywtsfrO Ujk8eL1a+5OUY/W0qmJEEvNPojx8jc1opOKwKwbX6RTPiqa5c6EIzr19QwO0laGTfkRc IycZNzjM9WQUigkOAPh6QP2x5ZmHquLfiijR0ufNjxr0sr/chO3iw4jbRDiM+BBwitEU HQKwJTlhoCp3UfoLxJHSZqEreiz/uHIAuWfzEmCSYWwPugLaA03lacz0zSKePCKvLuRB Y9qg== 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=LRjMzX9HvJe5uVdlatlHgf77MPDmm7N8GZ/8+N7d8YY=; b=LpebXiZjMNqKgTMqVVbX6P4pjRff96HFoXEcKfnW/UUsWhF2hdpPOdMSTImbKloWuf TIy1E+dY78uboq93KyZ+YEOO9f3BqkDBt92Ni2cEVitYhSWFLU2lbBHg892v2yHZUzdP w9oqXXgklgw8KCjZDl3Fr8XyH5ihclR/ky6N26hCOznbiNXRa/2JnEogWx1MywCufuKk ngWJdkDOYmmueEZoNV8p1Mt0Po86LgtnGRagRq1QJRg5VKCzUUjjdrY+ae0ectPzSEhd Gmlq2aBrmTnaLufSDi4IgWa/LzdMyMpXUqYD5xPyLzC1xPqoxLxS44/nfn+I1BJR4khY iZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gm5KqiyM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 i10si1405935otk.195.2019.12.11.07.55.07; Wed, 11 Dec 2019 07:55:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=gm5KqiyM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732241AbfLKPzE (ORCPT + 27 others); Wed, 11 Dec 2019 10:55:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:44098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730329AbfLKPQu (ORCPT ); Wed, 11 Dec 2019 10:16: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 4A484208C3; Wed, 11 Dec 2019 15:16:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077409; bh=Kxa5WyMgQit6kjaJNFOCMh1jYPWLabPyHMg/gJX4mmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gm5KqiyM5lw4zfD/o0azoFnXFVMWvQeWGyrlvHX8x8XaidnW2o9Ntd7qNSR2AuWdZ oirSiAOH+c1BeRzVoebgKs4//PLLCnbQGQJfI7qdnEdXBIurfEQDJpIeO10ieaoxJI 8KztWUxes8akT0FPlLlTQo4LiQg3sJwHXU6WnsWM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann Subject: [PATCH 4.19 004/243] lp: fix sparc64 LPSETTIMEOUT ioctl Date: Wed, 11 Dec 2019 16:02:46 +0100 Message-Id: <20191211150339.449307512@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 45a2d64696b11913bcf1087b041740edbade3e21 upstream. The layout of struct timeval is different on sparc64 from anything else, and the patch I did long ago failed to take this into account. Change it now to handle sparc64 user space correctly again. Quite likely nobody cares about parallel ports on sparc64, but there is no reason not to fix it. Cc: stable@vger.kernel.org Fixes: 9a450484089d ("lp: support 64-bit time_t user space") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20191108203435.112759-7-arnd@arndb.de Signed-off-by: Greg Kroah-Hartman --- drivers/char/lp.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -708,6 +708,10 @@ static int lp_set_timeout64(unsigned int if (copy_from_user(karg, arg, sizeof(karg))) return -EFAULT; + /* sparc64 suseconds_t is 32-bit only */ + if (IS_ENABLED(CONFIG_SPARC64) && !in_compat_syscall()) + karg[1] >>= 32; + return lp_set_timeout(minor, karg[0], karg[1]); } From patchwork Wed Dec 11 15:03:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181234 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp910020och; Wed, 11 Dec 2019 07:17:25 -0800 (PST) X-Google-Smtp-Source: APXvYqzuNohWxLJKFVHMUu/kkufCHpVWytzXHPWcREKxFkA++Y/B6/W7dCQmuaxaV8v68tvnTaVN X-Received: by 2002:a9d:7393:: with SMTP id j19mr2547098otk.336.1576077445883; Wed, 11 Dec 2019 07:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077445; cv=none; d=google.com; s=arc-20160816; b=RDh1jKiWNEiA0u/CBAtZwYORHKfwXBnBQAVrH8IiyH9yEP9E0YbWSPYPdFkR9df+J3 Zjw1rYDPbH4f+0WnAGllQDU7TR2JN0h4/uImrkvLLc0HUWyACQecoWVED538+1UoxJVD sZg44V3BCczzwNJYMh4c9kh9XKfsInlOabPMaBB8WWIIS6F57kHbLz84tw5a+My/Q8Ky g5U+EJjkXQ0rmHCx3PhspUX/NoPVxQtby/fQl7sDZKE1BrU+9fJcils/ThFkOB3ruCEY Z6KMytEZDTIW4KObgJElsZbEJHAR9/muk5F/HxIvLuxOI2T/v2WTO3uGJ7F1LkdpcPY6 XaHw== 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=1n3eSJ5jl4gISH/u8iKdGZEIUadfpuKbEgMZMZITeAg=; b=HObUovRUFKitZ1JOs6xV6QYszyPbJjDotSgF09wIEti0syOwhH2Odixnm0nIu+8mf0 TDS3vSEURWMKmer8C/tfIoZ78BjkAf/1C+5ErL+7mhzGQ2mcSLhuK/iZaZBf6QV2iDak LsZ6M99MHfVzGpNCRCKLd8JgDOhEhTS14ou/0NLlYYxfrvClJlpJ3k3lzWLofs7nwrKc nyO87W0OHqn3janrGUHL1WBgwIRdYvDG6+cdbCCNaUVPmC1Nq0UO7aPGfPNyQMh2e9uL R8RoGEeaXXuQyTMrTRkxr2h3+D61zrjWiaYSh0OKOC7AuutAWjm8l6TY1I4HNeeJdL4E 562g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="lxPOd25/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 h4si1158238otk.172.2019.12.11.07.17.25; Wed, 11 Dec 2019 07:17:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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="lxPOd25/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732011AbfLKPRY (ORCPT + 27 others); Wed, 11 Dec 2019 10:17:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:44762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730738AbfLKPRW (ORCPT ); Wed, 11 Dec 2019 10:17:22 -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 CE09B24654; Wed, 11 Dec 2019 15:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077441; bh=xlTCbem2gi9LaqW/ch6R47FmwnGQF0tvIApcLDExZyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxPOd25/+ahkUEN58qla2iYxh+xScavTYeIi9KL13+JdyCECvvwGrvL/Z2qrU9UJw qYP1wK6W6sekTlgW0XNWI1K/pOHeLHhObCGXj9+mdlPNKJL1MfK9RdGFQl41/3797z lt3jBl6Vx0bm0+9/fhcMm++1RL0ZDuLhqeRVW7YU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Chanwoo Choi , Sasha Levin Subject: [PATCH 4.19 041/243] extcon: max8997: Fix lack of path setting in USB device mode Date: Wed, 11 Dec 2019 16:03:23 +0100 Message-Id: <20191211150341.930414616@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski [ Upstream commit a2dc50914744eea9f83a70a5db0486be625e5dc0 ] MAX8997 driver disables automatic path selection from MicroUSB connector and manually sets path to either UART or USB lines. However the code for setting USB path worked only for USB host mode (when ID pin is set to ground). When standard USB cable (USB device mode) is connected, path registers are not touched. This means that once the non-USB accessory is connected to MAX8997-operated micro USB port, the path is no longer set to USB and USB device mode doesn't work. This patch fixes it by setting USB path both for USB and USB host modes. Signed-off-by: Marek Szyprowski Signed-off-by: Chanwoo Choi Signed-off-by: Sasha Levin --- drivers/extcon/extcon-max8997.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.20.1 diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c index 9f30f4929b729..7a767b66dd865 100644 --- a/drivers/extcon/extcon-max8997.c +++ b/drivers/extcon/extcon-max8997.c @@ -321,12 +321,10 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info, { int ret = 0; - if (usb_type == MAX8997_USB_HOST) { - ret = max8997_muic_set_path(info, info->path_usb, attached); - if (ret < 0) { - dev_err(info->dev, "failed to update muic register\n"); - return ret; - } + ret = max8997_muic_set_path(info, info->path_usb, attached); + if (ret < 0) { + dev_err(info->dev, "failed to update muic register\n"); + return ret; } switch (usb_type) { From patchwork Wed Dec 11 15:03:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181281 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp713911ile; Wed, 11 Dec 2019 07:54:37 -0800 (PST) X-Google-Smtp-Source: APXvYqxw09AfusBjkdGIz+NuN9wdnAEjE0uOjTnI5Y7pZYBN/mvJKI3Aj+4Z9jvN4O6zl2CzyFK4 X-Received: by 2002:aca:180a:: with SMTP id h10mr3434553oih.99.1576079676992; Wed, 11 Dec 2019 07:54:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079676; cv=none; d=google.com; s=arc-20160816; b=Ri1+4A+suhv+HKCszfNitfGOZinCGtkwdcL8dMS4V+aWJElIykaCASrut7+Zl1vi6Z i5vEFxR03yfCoqTOsypHdPkEhQWDtbX/vCEynrPOQ0Nmb6HYV+wRO+269FZYap6GB6Um 1v74o1IaMKoipNZCGmdjoQxSY1YIbdXLVlQ0Jnk91fGqrHkApLg0WCtGwNWuXtd1TUvg Uf7tw/jI/hBEojptjOFQy1OaWVOuEwAGf3AcYqZbG/AZ7qHjPkEHrNgjR0gqtktX/c9H j4lUGSttcYl/noL9lWeN4coAR3TBGHc3Mu2R58nSxZE+oZ1/dR87tNlmsVT7Ts7I8LU/ kcqQ== 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=DSjx8EoBENwOEC3FzbTqZXxTSmbNu+NC/QLIdib0KCk=; b=0mz/q35ufd30eUkRbRWELvKA2eIEl2IhHbeBE7IO2xf0+1eHiM2RgcxuickdQkL3YK PLCfpGtXrPmw73L9r7a80PFp0tV8x5SiAwEHTC4D9m6+/HOVA+dHesLdUrZjB9mZkwzv 5mW9CjG6QgYpE4ntOlGKEG4deD9+zyuO1DzwXYVNyINDKWf1n6n2aaGeyy8UrVjdIppG GOB9vau7WQAEm6o4K8YU3q5F+JR7Bk/1pKcdbXtBrEVeWT4ZwzdA8+apZMwq1sIxvjA3 JRjabpvkUejLyBxBCqwryoR9MpoZ8tvhSD3J5AK1PwXAY2nVPNqR2Rcm3uxyz+y/tgN8 nhkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JUrYAt6S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q22si1623018otm.304.2019.12.11.07.54.36; Wed, 11 Dec 2019 07:54:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=JUrYAt6S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732015AbfLKPR2 (ORCPT + 27 others); Wed, 11 Dec 2019 10:17:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:44820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731391AbfLKPRY (ORCPT ); Wed, 11 Dec 2019 10:17:24 -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 5B2DB2073D; Wed, 11 Dec 2019 15:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077443; bh=aeJN9iD2dFfWHJYWyfxdk8+zHVMsBoio6kyTZ0brv3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JUrYAt6Si/Ej0BPborKQZj5QXIHgI4/9xTDoRH8yWCaIA43iVPJ+plrTc1X7S51Eo FmCjASuwdz8PZu2R3xRm2/lHi2YPPP4K4Jtx+wyurQvH4tNuT/hqEwcsrDQduXpkaB YuYfc5dVkCS5Agyyoyts5Hexo1cEVMflx937sphQ= 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.19 042/243] net: ethernet: ti: cpts: correct debug for expired txq skb Date: Wed, 11 Dec 2019 16:03:24 +0100 Message-Id: <20191211150341.984159300@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 4f644ac314fe8..d7543811dfae2 100644 --- a/drivers/net/ethernet/ti/cpts.c +++ b/drivers/net/ethernet/ti/cpts.c @@ -119,9 +119,7 @@ static bool cpts_match_tx_ts(struct cpts *cpts, struct cpts_event *event) 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 Wed Dec 11 15:04:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181237 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp913018och; Wed, 11 Dec 2019 07:19:49 -0800 (PST) X-Google-Smtp-Source: APXvYqwaq2TtUEmC1l5Vi6jetAnmS3eP9XAVx8XmcF7CSzvxscNNRRe5OGXuVv1UpgGpE7yoTTkN X-Received: by 2002:a9d:6a8f:: with SMTP id l15mr2556531otq.59.1576077589565; Wed, 11 Dec 2019 07:19:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077589; cv=none; d=google.com; s=arc-20160816; b=jVkFoHMw3SlPPhCe1tEu/BD5gcNEceT/VNsEucMiRfCBfrbDZtEZxzc+UwPTN9L3OY wiNrQnjfQMu/wZyyccPI/3//RwwQhcM4zu/Xqa5iEerXuT+g2LF1sUxJiMrH3LPrmYee nc5EdW6+G/bzKLVT5396t1i/pzA1GKxijSiOPBR08bLmKtKh/uerpan85WX0ZPn/ZIX3 NecRK4bhxAbZLke2WzIUG1Aq35b/IRka0sB7BJLPY05iV17IVzwzAcMMQt9AHBxchIxR i2sLR2dGcYqLyM/jWF8Qdg7PLHe21AwVhoOvFPd1LUSlt4SVgRfrxdW9sylQi1Cnynma oUmg== 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=tNX3boPItiqeUyFYqEFkIj2tOBwBKCUoqGW4W3JyoHA=; b=Vykou1bmIOlZpeJwI1j+ogSvX20YQIY2PJ9mqJrTnYFfcOTAtIuQbKSjpP5Tn774kM MOBve6G3EA4iHZlF+1TpV/oPfbsVAcnJte6AtUIge3TGb4sGXq6sJggCXY7173V3noBn tNlKLZNvKZR8q0O4o5zAvwr60TxMj2nh2Bz5eLUK2ORgRDJs+M8OWMAblOjHbgHWXX7m J8263NBIikFZpAR+lmoouiCqNgkKWRyT4NtXoxbAnCHj4G4uqVbpjz0oNproJkFH3l99 n0/jGP31xqP+Da1PY3itj8/8V97IIqWgHTfbSrCyIG9+GUFU7uwxRoFYQ0sazviht1Rf 6+9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tgXZdiUS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 d187si1353759oif.33.2019.12.11.07.19.49; Wed, 11 Dec 2019 07:19:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=tgXZdiUS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732094AbfLKPTs (ORCPT + 27 others); Wed, 11 Dec 2019 10:19:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:48672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732263AbfLKPTq (ORCPT ); Wed, 11 Dec 2019 10:19: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 274DE2073D; Wed, 11 Dec 2019 15:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077585; bh=/LUzzBf+Yofy0eimmBq0G62TXMndjXspkVTWifPx2yg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tgXZdiUSgMfpCrFaiTPKITqQBPb8TaFjDmZ/pjJ0QEq9ng0DSzx0QSMo0H2OZaSOG gnOxIBsB5kHcmkRfjZ3MWOK6NzMuh27xYLZQEIY4z7KRKX8B2ShAqmrjDJ4quK2nnh d91pbOrZ+YrT0I2JzGvoLo74sHNVxDsN8VJkK36M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stephen Rothwell , Vinod Koul Subject: [PATCH 4.19 094/243] dmaengine: coh901318: Remove unused variable Date: Wed, 11 Dec 2019 16:04:16 +0100 Message-Id: <20191211150345.464670208@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinod Koul commit 35faaf0df42d285b40f8a6310afbe096720f7758 upstream. Commit 627469e4445b ("dmaengine: coh901318: Fix a double-lock bug") left flags variable unused, so remove it to fix the warning. drivers/dma/coh901318.c: In function 'coh901318_config': drivers/dma/coh901318.c:1805:16: warning: unused variable 'flags' [-Wunused-variable] unsigned long flags; ^~~~~ Fixes: 627469e4445b ("dmaengine: coh901318: Fix a double-lock bug") Reported-By: Stephen Rothwell Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/coh901318.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -1797,7 +1797,6 @@ static struct dma_chan *coh901318_xlate( static int coh901318_config(struct coh901318_chan *cohc, struct coh901318_params *param) { - unsigned long flags; const struct coh901318_params *p; int channel = cohc->id; void __iomem *virtbase = cohc->base->virtbase; From patchwork Wed Dec 11 15:04:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181238 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp915373och; Wed, 11 Dec 2019 07:21:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwNhrHebSFXQvLhmP7/6UeKO/0fM6D220GHeCurCqTsL6+ZJNYiAxVzOaZsa/B8NasyF9EO X-Received: by 2002:a05:6808:f:: with SMTP id u15mr3098035oic.164.1576077705995; Wed, 11 Dec 2019 07:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077705; cv=none; d=google.com; s=arc-20160816; b=lybDZQTA6gPBNJsjs3D+TN4k5ugY+i9iDeGEjsPC1giJ9IFJTFZ3BuSLo7/iTGYFha 0Mfi/J2v9WsNO7HT+HVGEYkZkfOyLbOWytjk9nDB33vgx8eSa3vzIO33ZciU7xXVqjuu M/emKUmY80p81oj4xvezzdusvAZURMMz7PL50WUIKnu0sQRX/ydu7RpNwuw3P+OFgtfi dcFK2htjF944m7Zy0P6iv7+4aNIABkP+RhEMYHLf2WOIsOg+ZD5h+Qq/UmYuMfae9mVK ECKTcxaRV+9hvMeNkWjljhQ+DM6IJT+zIfRVapGKKYMmPcw8BbVLhJ6SYsBtFj/lpyg0 OrLA== 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=sdxFNB4PIvlpD8Z4HD3s9qD85RNeOsdXuuuKHWMDRZ4=; b=JaFXsaIvTHGBZnovHoESBdyzdfIPunXXwjMtDXIH6JACEt6UUySjwpYrXWwi0Iqy/I cwuxQV4dBzGi91D8dO0m/HlBgkzLSv56xNrxL/X/sADJ0B7dcG4AaLfv6JCC0zqklpXp IHNU5MLOGGWkn7zPdeGJQKKKnrqZZis47/r1YegBIx+WhGyNezY54tp3jlfl+rM6oC5Z 6cRsyWShe6nSWZdqW4qMk9T4ThvR+fMMcrFfV0dQo8ppcnMQuNINvu7PtjJrQ2Ctn1r8 lkEVprR+h1HUEJwB4Y3e8Xhkr/lNcoGHR40H93IaIDm0Iiyq6faWTHwot42DHj60ZCvz nfdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WVtOquf2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 g25si1314015otp.20.2019.12.11.07.21.45; Wed, 11 Dec 2019 07:21:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=WVtOquf2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732501AbfLKPVo (ORCPT + 27 others); Wed, 11 Dec 2019 10:21:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:52050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731843AbfLKPVl (ORCPT ); Wed, 11 Dec 2019 10:21:41 -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 0189322527; Wed, 11 Dec 2019 15:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077700; bh=UV2G6q/DXBthsE3ae57WamEql2zCNb2Q2GjMnMRBGkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WVtOquf2oudfARqi89sn3/KsjQWYysEwZDWuXJ0m58z4Ma4JA/pzs8g/4gleSf+aL PoKGktQ5kHpTbpK2d57QCM4Ql7yirxLMeQoLeAhuTibWRt4/w0pJdLilsGFa9KrfGa iEVXNYCBkLO8JSwk5RBVkW335ePwd9fMuX2njb8Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, linux-mmc@vger.kernel.org, linux-gpio@vger.kernel.org, Bartosz Golaszewski , Linus Walleij , Sasha Levin Subject: [PATCH 4.19 137/243] gpio: OF: Parse MMC-specific CD and WP properties Date: Wed, 11 Dec 2019 16:04:59 +0100 Message-Id: <20191211150348.405211936@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 81c85ec15a1946f2e347ec0bf66936121eb97ce7 ] When retrieveing CD (card detect) and WP (write protect) GPIO handles from the device tree, make sure to assign them active low by default unless the "cd-inverted" or "wp-inverted" properties are set. These properties mean that respective signal is active HIGH since the SDHCI specification stipulates that this kind of signals should be treated as active LOW. If the twocell GPIO flag is also specified as active low, well that's nice and we will silently ignore the tautological specification. If however the GPIO line is specified as active low in the GPIO flasg cell and "cd-inverted" or "wp-inverted" is also specified, the latter takes precedence and we print a warning. The current effect on the MMC slot-gpio core are as follows: For CD GPIOs: no effect. The current code in mmc/core/host.c calls mmc_gpiod_request_cd() with the "override_active_level" argument set to true, which means that whatever the GPIO descriptor thinks about active low/high will be ignored, the core will use the MMC_CAP2_CD_ACTIVE_HIGH to keep track of this and reads the raw value from the GPIO descriptor, totally bypassing gpiolibs inversion semantics. I plan to clean this up at a later point passing the handling of inversion semantics over to gpiolib, so this patch prepares the ground for that. Fow WP GPIOs: this is probably fixing a bug, because the code in mmc/core/host.c calls mmc_gpiod_request_ro() with the "override_active_level" argument set to false, which means it will respect the inversion semantics of the gpiolib and ignore the MMC_CAP2_RO_ACTIVE_HIGH flag for everyone using this through device tree. However the code in host.c confusingly goes to great lengths setting up the MMC_CAP2_RO_ACTIVE_HIGH flag from the GPIO descriptor and by reading the "wp-inverted" property of the node. As far as I can tell this is all in vain and the inversion is broken: device trees that use "wp-inverted" do not work as intended, instead the only way to actually get inversion on a line is by setting the second cell flag to GPIO_ACTIVE_HIGH (which will be the default) or GPIO_ACTIVE_LOW if they want the proper MMC semantics. Presumably all device trees do this right but we need to parse and handle this properly. Cc: linux-mmc@vger.kernel.org Cc: linux-gpio@vger.kernel.org Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpiolib-of.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) -- 2.20.1 diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index e0f149bdf98ff..1147ad968fd75 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -60,6 +60,45 @@ static struct gpio_desc *of_xlate_and_get_gpiod_flags(struct gpio_chip *chip, static void of_gpio_flags_quirks(struct device_node *np, enum of_gpio_flags *flags) { + /* + * Handle MMC "cd-inverted" and "wp-inverted" semantics. + */ + if (IS_ENABLED(CONFIG_MMC)) { + if (of_property_read_bool(np, "cd-gpios")) { + if (of_property_read_bool(np, "cd-inverted")) { + if (*flags & OF_GPIO_ACTIVE_LOW) { + /* "cd-inverted" takes precedence */ + *flags &= ~OF_GPIO_ACTIVE_LOW; + pr_warn("%s GPIO handle specifies CD active low - ignored\n", + of_node_full_name(np)); + } + } else { + /* + * Active low is the default according to the + * SDHCI specification. If the GPIO handle + * specifies the same thing - good. + */ + *flags |= OF_GPIO_ACTIVE_LOW; + } + } + if (of_property_read_bool(np, "wp-gpios")) { + if (of_property_read_bool(np, "wp-inverted")) { + /* "wp-inverted" takes precedence */ + if (*flags & OF_GPIO_ACTIVE_LOW) { + *flags &= ~OF_GPIO_ACTIVE_LOW; + pr_warn("%s GPIO handle specifies WP active low - ignored\n", + of_node_full_name(np)); + } + } else { + /* + * Active low is the default according to the + * SDHCI specification. If the GPIO handle + * specifies the same thing - good. + */ + *flags |= OF_GPIO_ACTIVE_LOW; + } + } + } /* * Some GPIO fixed regulator quirks. * Note that active low is the default. From patchwork Wed Dec 11 15:05:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181242 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp917622och; Wed, 11 Dec 2019 07:23:32 -0800 (PST) X-Google-Smtp-Source: APXvYqweRehrqvJ51ZU9+Ib/fPDy24yWQ+/AMheB/Ieeq7XD0mkZWZuacE6OReeDZ7AYlJFq9PZV X-Received: by 2002:a9d:7d8e:: with SMTP id j14mr2487777otn.227.1576077812379; Wed, 11 Dec 2019 07:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077812; cv=none; d=google.com; s=arc-20160816; b=r/E6JXngrFGc4+e90y+KmhEp1v47HTJoFCKayRLiAJXjfSVnicakbb7EoShjB3D6aO H3dWHzaSBj0uyoy4Hds4mXNeeJd+2ZFQTfkHb3qZUtr8j4kOVLFpi10STAkzgza5Xem9 sRwNyKmOZSbErVRv38kn17f3blmtyqMqKOz5YOx/MKP/iiONCQ/xe5jNiyl3Xrho3yiv nkxoveCgpJD45aYHOe1yNHyZ7PkbIYWpuTWeJfYAL0edozSA3PBSH9x5aNJ+NnPj9kaN YekiuwasdSsWrFZt1jc+rg6UIQcgarHlBIyWIiPbkQDvUfQE8X+Xe/jryvXAh92J7YC1 qTSw== 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=6tQESpUq7iDMxSY88ExsLHPtn56exeJ5CZRiQsHwjrk=; b=fSxkOyrBCihQnoQvcnzEEcpY/ClWXifcCqlYvccakqXv4W5IdAll8safKpqx6UVCkt O3BljT4lP0tLNDbAisHA+lXRUwx3XvrGAcXrCrxG6HEVVhuGhTb6A0tasb7INEnd3uRN VBHkR0TAIPUXQW/WT76+GSh5OJHzodd0SrpGbV+tamJxYW4vUosKutE1VMKf2AosJwcD LSBlQRLZcgkAN40hPI2OUXS263HxTCfUIzT7Puxstx27D1R7tAnEEU0/aNMF+zoHz70t Nd3MfsFVW3g6PEKvxtYMjY3Qb3FLVuTVpnlwh18W+tUGb9GPr9xMhi8MFESOdbVz25gS zOrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qjUPYItf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 m4si1272102otq.42.2019.12.11.07.23.32; Wed, 11 Dec 2019 07:23:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=qjUPYItf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732725AbfLKPXa (ORCPT + 27 others); Wed, 11 Dec 2019 10:23:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:54480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732556AbfLKPX2 (ORCPT ); Wed, 11 Dec 2019 10:23: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 20BD524671; Wed, 11 Dec 2019 15:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077807; bh=XGyI+LgxkYxAty6h+VcHbdk6av8Guw2rvj2UsdveNNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qjUPYItfCXY4EGR8xUUt5sUBj/Z2VEpWEW1Z3W0VPrfdyYv0c20thouDo9RRqJ6x5 4pGChjY2+l65RDaSQt5+c5hmszrYadzMzJn7KZ3lfPrrm+T9y1uYtiLrjs0AQt1ACq COluLuugE99eQqZ7+/EhT20ZsaJJrVzBTOArfzZo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Herring , Sasha Levin Subject: [PATCH 4.19 151/243] kbuild: disable dtc simple_bus_reg warnings by default Date: Wed, 11 Dec 2019 16:05:13 +0100 Message-Id: <20191211150349.364778287@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring [ Upstream commit 70523a3ce5ff928faa43bb2cad554dc63438e3e7 ] The updated version of dtc has a bug fix for simple_bus_reg warnings and lots of warnings are generated now. So disable this warning by default. Signed-off-by: Rob Herring Signed-off-by: Sasha Levin --- scripts/Makefile.lib | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 61e596650ed31..a232741e3fd3b 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -252,6 +252,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ -Wno-alias_paths \ -Wno-graph_child_address \ -Wno-graph_port \ + -Wno-simple_bus_reg \ -Wno-unique_unit_address \ -Wno-pci_device_reg endif From patchwork Wed Dec 11 15:05: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: 181239 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp916487och; Wed, 11 Dec 2019 07:22:40 -0800 (PST) X-Google-Smtp-Source: APXvYqz+LpERckWEa40ANaREuddpb7o4DdXyDPT4D23V2qLoYGe7JInYzEVsavp/EmSsn8RgA9lL X-Received: by 2002:a05:6808:8ed:: with SMTP id d13mr3038484oic.93.1576077759909; Wed, 11 Dec 2019 07:22:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077759; cv=none; d=google.com; s=arc-20160816; b=fWZ3Mi8fU6m7Can/CSdMf7oz+cHm3d5+LZQhXqhbgzHir9ZKsXwmSlh99ENSaiBddD 9RT42KauDFZlLivhP4xNoBUBAy4C2Ubc7DkLU4m+Rr8hNapJHEZ9RXt7XIAatePeyc1a nUZDP1nsKWQ6pGdsKGAbTDrX+NfsaOGagFficAseQm+q6vl0O6lvWuxnIHknTb5eXXmf MTV2uiaMoIns5ir0gvbAIvRFXZAbtqwvgDoU7hoLX6fn7atMCH1hadeeAa/9qC+AF+f0 4dNKse+nWk/0/6paE/Fn4KgjysYW8mnTSNExXsZOu18s+klt2s4ZefMT6LbcWIkMdrQB 8nAQ== 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=2D5meARvVuI5WBzVX79tC6SmH9VtE1kawG/csoRvBGI=; b=FNnd3t9VyMNtwAkvFEbEDRX3NI/++YcXd80HBjQANmNuwFpI3SUd2hp4EM6ylhFsn6 fMlSmYpzgPyUYWIXCVr54Vhs/xwsI2NXC4L84uc4AZTsA6odPqBdyJkFnpBFvuwNPRdx wqpkVyc9Yxkoar6heFXO3f0Us5WG3hPqwQQxbxYCQXey9Yp79GeL5icJpvDMq8t9wb6t EISF32zlj/494X6P8V/TO/pacC/AZaPMj086VLGyRgWS9uq5Lym5ASY3KsCJ2Lr1xtKv 1G2uHRWduJtFLndr3ZxidHD66KHnMW8IBLvgobMx3acCtt7hpdJuqKULS4QaoS4H2pMP gwRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tDU8+U3G; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 n137si1340735oig.127.2019.12.11.07.22.39; Wed, 11 Dec 2019 07:22:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=tDU8+U3G; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732158AbfLKPWi (ORCPT + 27 others); Wed, 11 Dec 2019 10:22:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:53378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732615AbfLKPWg (ORCPT ); Wed, 11 Dec 2019 10:22:36 -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 CA4FC2073D; Wed, 11 Dec 2019 15:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077755; bh=Z5AqVrIC8GjWQ/SiK2JLzDiahAB4oiEWSlkGKafYMJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tDU8+U3GoVuWK2wSiTZhbvqehhnj2avQLSNBRYdp12anOCjDcm1iArSbQkyl/YB42 dVnuUDqbRnS8yjIy4tHLYOc9ybrkgJLVZgb8sxNAHc8ZNneD/yl0a42Gi4oXmV2vn6 Aaw44Y93WA/+HdhWUrpxCUbNLTHEouHmOj5j/BxM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Sasha Levin Subject: [PATCH 4.19 159/243] kbuild: fix single target build for external module Date: Wed, 11 Dec 2019 16:05:21 +0100 Message-Id: <20191211150349.899539555@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit e07db28eea38ed4e332b3a89f3995c86b713cb5b ] Building a single target in an external module fails due to missing .tmp_versions directory. For example, $ make -C /lib/modules/$(uname -r)/build M=$PWD foo.o will fail in the following way: CC [M] /home/masahiro/foo/foo.o /bin/sh: 1: cannot create /home/masahiro/foo/.tmp_versions/foo.mod: Directory nonexistent This is because $(cmd_crmodverdir) is executed only before building /, %/, %.ko single targets of external modules. Create .tmp_versions in the 'prepare' target. Signed-off-by: Masahiro Yamada Signed-off-by: Sasha Levin --- Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/Makefile b/Makefile index f9ebb74e8e43f..471acfc74998b 100644 --- a/Makefile +++ b/Makefile @@ -1507,9 +1507,6 @@ else # KBUILD_EXTMOD # We are always building modules KBUILD_MODULES := 1 -PHONY += crmodverdir -crmodverdir: - $(cmd_crmodverdir) PHONY += $(objtree)/Module.symvers $(objtree)/Module.symvers: @@ -1521,7 +1518,7 @@ $(objtree)/Module.symvers: module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) PHONY += $(module-dirs) modules -$(module-dirs): crmodverdir $(objtree)/Module.symvers +$(module-dirs): prepare $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) modules: $(module-dirs) @@ -1562,7 +1559,8 @@ help: # Dummies... PHONY += prepare scripts -prepare: ; +prepare: + $(cmd_crmodverdir) scripts: ; endif # KBUILD_EXTMOD @@ -1689,17 +1687,14 @@ endif # Modules /: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) # Make sure the latest headers are built for Documentation Documentation/ samples/: headers_install %/: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) %.ko: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) $(@:.ko=.o) $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost From patchwork Wed Dec 11 15:05:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181240 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp916999och; Wed, 11 Dec 2019 07:23:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwIc5Vd/EnEg7KBls+Cp2DXGwawVNaeemxHpbe4xdbqm+CHWPNhE3FcfkjVhTRzBIczFe0T X-Received: by 2002:a05:6830:1251:: with SMTP id s17mr2601466otp.108.1576077784924; Wed, 11 Dec 2019 07:23:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077784; cv=none; d=google.com; s=arc-20160816; b=Oxs8WuRoG0K36UzpdNFgCeJtngi3lWHTM3jKNe5XgexIcqgHdTcICRRaqVQ6PvVH2w UCFHD1WY5dj2ERhXuTPHJqUbJBBym61GTSbRnW9i9NxALnXBZpmSGgRmdM1HAll9K12M b71osEZIqpwjLx3HFH32W6uhXktqKoFe3Zd5uUwyNl0sOntJH+MKPbu76DVM6pfybEJb bRZT+t+Bnqe6YQcjuARs7PGGrztYpCOpmQoS/bQdvgM9cdXNnAbOyjSlff4ktvxm8n/j MII7Q3ow1Z68IDgLvDnN4y7sv2iMulXlCDUgs55XkUJ0xoX3PffbLMDnOnCAeIQPVcZr kaJw== 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=XQhPlQSj1kHXbmdVSlSjLO3yN5hUI6SNn6kEcjoZHoc=; b=oozP6leSJxxXlCWXFqZkmN684qGZuXsVKOHACt0jUAHyRJQw51heDaSmrsQEih0BBp XT3iNuv7A1DwP+ELpAm4Z63wScXYjZWRLoqL1S2OCKe50oYW43BzW7b/wFy4Wmu81Yzg mhZXJh62Sc69GIi+W4ZwXR354+dlXkIXUiC2vLhJ+C1P/42xfOrQZVXXSo/rkQS4fCAh byUlUZJRiW+rRTxtW+Fmzllsjm6jC49NLNncFosUzWBnxv1FJZkKfRHCACyqWvOq6VAP MygfGfMpV3Yu+ebj8ouo1sNZDhd/OD9xqo7leaSfy6Squ9T9TcpP8P/KuphlfZBmnipe Eepw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tdEq6xDJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f3si1354253oia.264.2019.12.11.07.23.04; Wed, 11 Dec 2019 07:23:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=tdEq6xDJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732661AbfLKPXC (ORCPT + 27 others); Wed, 11 Dec 2019 10:23:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:53726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732373AbfLKPWx (ORCPT ); Wed, 11 Dec 2019 10:22:53 -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 0F20B2077B; Wed, 11 Dec 2019 15:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077773; bh=GV1g4sMqmTSGFJASFaRg3b/yajlyg7qgx76zRdLk9gM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdEq6xDJM4xnJx1R0twKPE7OVIMYaCx9zkfi8BbJ51XlISgimexWDcleAdw6q425+ lLvCj7x8ILu7CvZYea7r56G6sn2N8fAViqa67vskgdiMabMIR/Jvx+ZFxMohg6UO6j bC5DTksCUXF7TfClNXoL/48cjvIfeFW2CzieCHzQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Herring , Linus Walleij , Olof Johansson , Sasha Levin Subject: [PATCH 4.19 166/243] ARM: dts: realview: Fix some more duplicate regulator nodes Date: Wed, 11 Dec 2019 16:05:28 +0100 Message-Id: <20191211150350.374909288@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring [ Upstream commit f3b2f758ec1e6cdb13c925647cbd8ad4938b78fb ] 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. Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Olof Johansson Signed-off-by: Sasha Levin --- arch/arm/boot/dts/arm-realview-pb1176.dts | 4 ++-- arch/arm/boot/dts/arm-realview-pb11mp.dts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/arch/arm/boot/dts/arm-realview-pb1176.dts b/arch/arm/boot/dts/arm-realview-pb1176.dts index f2a1d25eb6cf3..83e0fbc4a1a10 100644 --- a/arch/arm/boot/dts/arm-realview-pb1176.dts +++ b/arch/arm/boot/dts/arm-realview-pb1176.dts @@ -45,7 +45,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>; @@ -53,7 +53,7 @@ regulator-boot-on; }; - veth: fixedregulator@0 { + veth: regulator-veth { compatible = "regulator-fixed"; regulator-name = "veth"; regulator-min-microvolt = <3300000>; diff --git a/arch/arm/boot/dts/arm-realview-pb11mp.dts b/arch/arm/boot/dts/arm-realview-pb11mp.dts index 7f9cbdf33a510..2f6aa24a0b67c 100644 --- a/arch/arm/boot/dts/arm-realview-pb11mp.dts +++ b/arch/arm/boot/dts/arm-realview-pb11mp.dts @@ -145,7 +145,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>; @@ -153,7 +153,7 @@ regulator-boot-on; }; - veth: fixedregulator@0 { + veth: regulator-veth { compatible = "regulator-fixed"; regulator-name = "veth"; regulator-min-microvolt = <3300000>; From patchwork Wed Dec 11 15:05:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181241 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp917188och; Wed, 11 Dec 2019 07:23:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxi5Tw30SMZWIlrwj7+MXg8clSCzvm5B64aQj3nx0S3c6ts7XU2Cc2paadll31fhnEUxf3T X-Received: by 2002:a9d:6c85:: with SMTP id c5mr2588978otr.164.1576077794342; Wed, 11 Dec 2019 07:23:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077794; cv=none; d=google.com; s=arc-20160816; b=qFO1GjRrNKJBb06F/OvGMcaU5nsButdKlaKbHUBu2Q3ewEUb953W2KoKzv7TkeYVX0 QMuSLawTJMtbYcQKFuEMvSxRnk62xhMSnZ5TQ4CL7nXQbqoeRsgdDouuq41MFRKAMAxl Ie0/kJ0iUUQNC1mGNC8FS/uSJvVbkmcz0UwHLgvy+onfWqrjvvEqDVQdQoIhS2KebHrw VMjwL6qbGbUWAdBZoaxjR3KaCRBs8areuR5IVcT/gs1NRC1e+BzkB3RigTDuW/7XipbD sV2uyMCAa8vXhdlYPR/M0VJTgE+KI7otQ/3RirWa9c1/QAmNZJok61tipAT7hJ9xeiuv GuzQ== 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=HlXuHRa2DXbyCeB2G1/XAx6lRX9FDTA0nfxf0dAAEM2fhuKoxXXcr9Euf8DZsTyM5f kMLyRoY5SjC5FhgobesJD8oP7gChPfIlwJEMIRJzJ4PEIWqBJoA4qkv5beNNlxwK5lY2 Uzqz1dEgVcho8C5qrAwG5N2M4OkcRDuvlT7qTEmGGc0Hx7vAny/DzUr3N1w5g0Q51nj8 Z5aVQ3e7ubPTXpT3TcLwNky5IFYHf8kZN3RgZLS71vukVBubvb8E9iwkiIks7l686oKh gDZqiC8lNNBORDSBif4eWx7gFc5zsQM4HOKIxS18tURqLeSyhgdLcLElFhHBhibNX8d9 cRvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y20i9oFh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 e23si1343240otr.145.2019.12.11.07.23.14; Wed, 11 Dec 2019 07:23:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=Y20i9oFh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732357AbfLKPXN (ORCPT + 27 others); Wed, 11 Dec 2019 10:23:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:53960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732666AbfLKPXH (ORCPT ); Wed, 11 Dec 2019 10:23: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 339A722B48; Wed, 11 Dec 2019 15:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077786; bh=m0Xi4nTk+oGEpyZ0wdmXOfeFk6InEJHjaHdGJ/1h9rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y20i9oFh1j67nkyLtbsIl/xOya9QZq6Q72+Id2to2Q+rlfyAyAR1AyEV7rERsAq8G pwWndSWxDs1Dgz7O7rrfRvOf+E13XS44M9CD4W7fzb9CNnh7sEN7tPghd5r5Xh5WwT fsWiX9AZEI0uM9dJO7HWOfQUe//chM2hRY3Fis9Y= 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.19 170/243] powerpc/math-emu: Update macros from GCC Date: Wed, 11 Dec 2019 16:05:32 +0100 Message-Id: <20191211150350.655949194@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Wed Dec 11 15:05:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181247 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp920483och; Wed, 11 Dec 2019 07:25:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxSlB5k3CyI3TOjs4423fKLQE4ZrJmSkTKnWOBWUfO4mTyvVDDwetuGEb07YX+qqSjN6fMn X-Received: by 2002:aca:111a:: with SMTP id 26mr2972714oir.145.1576077955144; Wed, 11 Dec 2019 07:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077955; cv=none; d=google.com; s=arc-20160816; b=iLYVJh744sSIf/Kith6SUmE2I6wQ2ff5+c9AshqDRgjkTBAjZwMbFiX5n/+33VMh3/ YDfsB5TDi+zdxopuCqTiADFGkS1s2MxPXhhhpe6LR2j/8rWocjJ3cj7N6OdaKWk91I8D rA5xtnA1SMMSoVGbs4mh0rpAw4wYz1Q5ljZxxv1Fo5pgvL48Lf/LLZ/vhFoLbnD6q+us emMkSvJxbLtgcdtkQtU+Cj2RZJhBgVZZSy324FrHgP5zCf8K0DNqERu3UzJNnlrmVg08 nur9cREnwdnqZ/Glmb8TTA7En4xs98uki4VjvaSYvV1B4/IWejAvejQU2Qf3BkQSYd0U VYLg== 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=DTS1qwqkhjVOeQOM/rLiM/F1GSutW+8ZhZP3esuIVcM=; b=B16cptRsa6YWyXl83eQImGAWk9WMJGe3laUIXKrGFCj7i3xDpPD0QrRWWcoENmzcC0 xW+iR3pWatVVYoGI36rwX/E12S7K3pigCL40TdiGBFrbRAqgOT/4EDbrfV9uq42Oowck Hsqg8UOEPJmasFAjXvZbpkIlp+f6iaiLLn7qYyMGv9h01e7lPS1pBrlpRDlekbgDFJMW kNEXlhsopsSdaDcnhKk8O59/Wo+DCfdar4XBAnCmFJJgn6yeFQ3efkCDWvvHbzpPn1x9 cSy0ZSEGV5B7g6rJZxql0ub1Euz/iyFvbFiOQy8j3uRK8Y0wh4TkZygHdjlhbGKXEYlZ J2Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vbDz181F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z25si1303201oto.211.2019.12.11.07.25.52; Wed, 11 Dec 2019 07:25:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=vbDz181F; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733042AbfLKPZs (ORCPT + 27 others); Wed, 11 Dec 2019 10:25:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:58120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732716AbfLKPZn (ORCPT ); Wed, 11 Dec 2019 10:25: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 E0F4F2173E; Wed, 11 Dec 2019 15:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077942; bh=cZpitACy2KXnabzudAg8l5hYZuEEYB2y4ZV+QDVz0gA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vbDz181FPXVf5MmuIYp78hG7wE2KThSdBwpCL7lzStdMVLXXUm0pdNVn+VJHxQb94 ObtdIvf5xTf9NT+LX8T2DPFwMdADNkT0pdKYeQZChf6VXAEHtfA50ZZZ5wCLyzFGwd aHCmg1z6QvMWhDGqKXVqrsTt8k17VTm4lbgw3YVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxime Ripard , Chen-Yu Tsai , Rob Herring , Will Deacon , Sasha Levin Subject: [PATCH 4.19 192/243] ARM: dts: sunxi: Fix PMU compatible strings Date: Wed, 11 Dec 2019 16:05:54 +0100 Message-Id: <20191211150352.132077034@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring [ Upstream commit 5719ac19fc32d892434939c1756c2f9a8322e6ef ] "arm,cortex-a15-pmu" is not a valid fallback compatible string for an Cortex-A7 PMU, so drop it. Cc: Maxime Ripard Cc: Chen-Yu Tsai Signed-off-by: Rob Herring Acked-by: Will Deacon Signed-off-by: Maxime Ripard Signed-off-by: Sasha Levin --- arch/arm/boot/dts/sun6i-a31.dtsi | 2 +- arch/arm/boot/dts/sun7i-a20.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi index debc0bf22ea3b..76924fa42bbc3 100644 --- a/arch/arm/boot/dts/sun6i-a31.dtsi +++ b/arch/arm/boot/dts/sun6i-a31.dtsi @@ -201,7 +201,7 @@ }; pmu { - compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu"; + compatible = "arm,cortex-a7-pmu"; interrupts = , , , diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index 73e789a133de1..355619dce7994 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi @@ -183,7 +183,7 @@ }; pmu { - compatible = "arm,cortex-a7-pmu", "arm,cortex-a15-pmu"; + compatible = "arm,cortex-a7-pmu"; interrupts = , ; }; From patchwork Wed Dec 11 15:06:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181279 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp707316ile; Wed, 11 Dec 2019 07:48:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwR2bpiNc9IAFzprXj0UsFrUXBB9s4pg1eMs2yyDPwrFeMF9SxPRJqHbkQvPoIilRS/yeqT X-Received: by 2002:aca:1a10:: with SMTP id a16mr3395844oia.9.1576079320436; Wed, 11 Dec 2019 07:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576079320; cv=none; d=google.com; s=arc-20160816; b=fTgyzjOAfPsrExaGMdeRZsYNxuwNvg3FrODWuBMFlo+TQHkXESqLkti5FYBDCmp6A/ Soc1PhZd1BQEdx2IMPA2FliL52vSK/tCX8L4B85hsY1EJarhcjgfY5Ta0afvE+UUJBxk H6ylHmta3k9o0IiRKuwK6plNoeF+1YdGnxiVrmIsZBhXa+pj9HgCWwFB8YUU2CgPV6BH CbTi3pdyIFS7EoQGAV/jnYvYhiLXtIkWtGT97XN/R+3C88NsnPCKVYwxyprYCxWZXnbj FU5x9zyU5BOr+O7bTLr8sZclrcu4jd7oPHlRNer5hP39vMzAssVp6lMzB5+zBVKxHkZB rxHg== 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=RjR81QkhQYv19sOxqFt1wMuPFOEIEZCYoCmWCgMMF6Y=; b=X+kA39XwyWM0Zl85QX1TPmO+pGi5jjiOKojzW6T0VMnhPrKz7zwkJm/7+c5XjGzPTn iy81fI7Su+euvk7jxcMZXQABHkt68cDIctdJ85WjJ7IJVqKxN3/l2la9DbdZMy31IvMM xbNTkcAbUrroypBe7uQw5b2kqwRC4CXRwXU7TURaS9UIIHmt9U6AuXDEoa8KymfBdfR3 P7SXuUNg+6x9U3CC31H4PFQQc3r01e72LXt6b23CZoD2oWxsWWxuJmK0rgeEXh8O8NHU zY61a+UZdHRPyKl6Syazg98QcRwefUh5cvlavgA8ICUOLJhoRNKP2xVUgg/c4/LKb2+v DNMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uk5c8sQ+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f81si1398203oig.110.2019.12.11.07.48.40; Wed, 11 Dec 2019 07:48:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=uk5c8sQ+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732902AbfLKPYv (ORCPT + 27 others); Wed, 11 Dec 2019 10:24:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:56216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732886AbfLKPYr (ORCPT ); Wed, 11 Dec 2019 10:24:47 -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 A6B9C2077B; Wed, 11 Dec 2019 15:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077886; bh=cQnHYqMKMnTnO6m2mJKlDYRQy3IpoH92Ix9Topw/7fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uk5c8sQ+uscbXDNvSF0hQ0tEZbVeJumB8hfWablHMkrqGc39E0C6a11w9KjfV+3gY BC2ocYWI+ZjaLiK5uRMwAOkWZm7x0oWLpz5LWY8+BNlCxp0w28to+otEq0AxZpY7HV 2HjIJaynu0e9FofgoMUoNzuDN/GAGZNPBHV1yoGQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Leo Yan , Mathieu Poirier , Mike Leach Subject: [PATCH 4.19 208/243] coresight: etm4x: Fix input validation for sysfs. Date: Wed, 11 Dec 2019 16:06:10 +0100 Message-Id: <20191211150353.224230883@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Leach commit 2fe6899e36aa174abefd017887f9cfe0cb60c43a upstream. A number of issues are fixed relating to sysfs input validation:- 1) bb_ctrl_store() - incorrect compare of bit select field to absolute value. Reworked per ETMv4 specification. 2) seq_event_store() - incorrect mask value - register has two event values. 3) cyc_threshold_store() - must mask with max before checking min otherwise wrapped values can set illegal value below min. 4) res_ctrl_store() - update to mask off all res0 bits. Reviewed-by: Leo Yan Reviewed-by: Mathieu Poirier Signed-off-by: Mike Leach Fixes: a77de2637c9eb ("coresight: etm4x: moving sysFS entries to a dedicated file") Cc: stable # 4.9+ Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20191104181251.26732-6-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 21 ++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -655,10 +655,13 @@ static ssize_t cyc_threshold_store(struc if (kstrtoul(buf, 16, &val)) return -EINVAL; + + /* mask off max threshold before checking min value */ + val &= ETM_CYC_THRESHOLD_MASK; if (val < drvdata->ccitmin) return -EINVAL; - config->ccctlr = val & ETM_CYC_THRESHOLD_MASK; + config->ccctlr = val; return size; } static DEVICE_ATTR_RW(cyc_threshold); @@ -689,14 +692,16 @@ static ssize_t bb_ctrl_store(struct devi return -EINVAL; if (!drvdata->nr_addr_cmp) return -EINVAL; + /* - * Bit[7:0] selects which address range comparator is used for - * branch broadcast control. + * Bit[8] controls include(1) / exclude(0), bits[0-7] select + * individual range comparators. If include then at least 1 + * range must be selected. */ - if (BMVAL(val, 0, 7) > drvdata->nr_addr_cmp) + if ((val & BIT(8)) && (BMVAL(val, 0, 7) == 0)) return -EINVAL; - config->bb_ctrl = val; + config->bb_ctrl = val & GENMASK(8, 0); return size; } static DEVICE_ATTR_RW(bb_ctrl); @@ -1329,8 +1334,8 @@ static ssize_t seq_event_store(struct de spin_lock(&drvdata->spinlock); idx = config->seq_idx; - /* RST, bits[7:0] */ - config->seq_ctrl[idx] = val & 0xFF; + /* Seq control has two masks B[15:8] F[7:0] */ + config->seq_ctrl[idx] = val & 0xFFFF; spin_unlock(&drvdata->spinlock); return size; } @@ -1585,7 +1590,7 @@ static ssize_t res_ctrl_store(struct dev if (idx % 2 != 0) /* PAIRINV, bit[21] */ val &= ~BIT(21); - config->res_ctrl[idx] = val; + config->res_ctrl[idx] = val & GENMASK(21, 0); spin_unlock(&drvdata->spinlock); return size; } From patchwork Wed Dec 11 15:06:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181246 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp920222och; Wed, 11 Dec 2019 07:25:41 -0800 (PST) X-Google-Smtp-Source: APXvYqw3f7ZVU4hH+y8RHZY/DUedwegmQGIsajjZWYM3p3zkwUqicIGa5x0o4+kYTuoQe7IcJlo/ X-Received: by 2002:a05:6808:1c5:: with SMTP id x5mr3331252oic.57.1576077941283; Wed, 11 Dec 2019 07:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077941; cv=none; d=google.com; s=arc-20160816; b=AA5DYfZur73jdAw8u9IDT+VB13P0A9B6f07qrpRFogpIosPNzm9JyPrUR0MvPN75zC PFTgDhFSrKIjl5dXDL1/MAOAlgz8wwFWlnBLVhmnFDAnNBn4VYkEYVWWuzoD2CBRIxE0 Zaxfi3HmXDrGWjKPh6yQn+EMg5P6A5Q65VeCTQV7CICqJrP51dmtlRqGoD1+xh+WQ56Z e+4tZVeudiJBo/H5Z7cZv1L9WYAKbaxMryGby1BAMSEqdXo81moAul4tmBrvhumXtEQA vdghaBBjTQk9PHhhTl5YIypfmhR4jl1XaJeW46KRgjARIFgdD6Fqbu8Xr9lGZ6H02I3u OtJg== 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=FnzVuPcFjcaT21nHV+YQx20QJGV/0sQU658DpMH14/0=; b=OjSGs+qqSrryXj24aRD+tk/eoMrLW3RMyEVXTDe4WU3EpmPsCtmO9ZJy3cc1IuP6TD I1Bu2PD9Cp8BGD4rWhKgEktDoHp70Pwa2b5nJR30nld4jvpls2M8sHOydDcJQzDsMSnQ i20kpBINYb1jDEnPSnbFwLUdTDx8zqisxY8pU9QOfCO9runxpLOTFv5KslzmDfoFLyPp jyZ2ZdUoQsfqtny9ScW3uV9lmdSdQzY0h01qTa/78Lp2lliDe1qX8Xvy1Ac52Z0p2k3y bfNwAJgwurWM8ZVAGMJeMJaGdUiXQcn/A906dmeBgPRUqu7eyLgUB+30llnXDZEupY9P M8EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RFb2k0vm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z25si1303201oto.211.2019.12.11.07.25.38; Wed, 11 Dec 2019 07:25:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=RFb2k0vm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733018AbfLKPZe (ORCPT + 27 others); Wed, 11 Dec 2019 10:25:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:57694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732782AbfLKPZb (ORCPT ); Wed, 11 Dec 2019 10:25:31 -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 78D26208C3; Wed, 11 Dec 2019 15:25:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077930; bh=8E4J7fMbM6LkudO+9F/RC+PJKcsy8gwUCsIbxesTyQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RFb2k0vmyz09vCqUo4gd/tD+9uRb7n5sBuUm66mP6Kdsx/kItO2o41CYMNF/spmln UzpE0jk1U654vvXaYMuWyJTcp4kDmOup9n/PN33cM7iZO1yKP9pTjgiJeZLiD0nfwm 0iZc7xrssxMGGtB2FWvMLSQS7nRdf6/9VU7cOUn8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alim Akhtar , Marek Szyprowski , Krzysztof Kozlowski Subject: [PATCH 4.19 224/243] arm64: dts: exynos: Revert "Remove unneeded address space mapping for soc node" Date: Wed, 11 Dec 2019 16:06:26 +0100 Message-Id: <20191211150354.452202223@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski commit bed903167ae5b5532eda5d7db26de451bd232da5 upstream. Commit ef72171b3621 ("arm64: dts: exynos: Remove unneeded address space mapping for soc node") changed the address and size cells in root node from 2 to 1, but /memory nodes for the affected boards were not updated. This went unnoticed on Exynos5433-based TM2(e) boards, because they use u-boot, which updates /memory node to the correct values. On the other hand, the mentioned commit broke boot on Exynos7-based Espresso board, which bootloader doesn't touch /memory node at all. This patch reverts commit ef72171b3621 ("arm64: dts: exynos: Remove unneeded address space mapping for soc node"), so Exynos5433 and Exynos7 SoCs again matches other ARM64 platforms with 64bit mappings in root node. Reported-by: Alim Akhtar Fixes: ef72171b3621 ("arm64: dts: exynos: Remove unneeded address space mapping for soc node") Signed-off-by: Marek Szyprowski Cc: # 5.3.x: 72ddcf6aa224 arm64: dts: exynos: Move GPU under /soc node for Exynos5433 Cc: # 5.3.x: ede87c3a2bdb arm64: dts: exynos: Move GPU under /soc node for Exynos7 Cc: # 4.18.x Tested-by: Alim Akhtar Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 6 +++--- arch/arm64/boot/dts/exynos/exynos7.dtsi | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) --- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi @@ -18,8 +18,8 @@ / { compatible = "samsung,exynos5433"; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; interrupt-parent = <&gic>; @@ -235,7 +235,7 @@ compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges; + ranges = <0x0 0x0 0x0 0x18000000>; arm_a53_pmu { compatible = "arm,cortex-a53-pmu", "arm,armv8-pmuv3"; --- a/arch/arm64/boot/dts/exynos/exynos7.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi @@ -12,8 +12,8 @@ / { compatible = "samsung,exynos7"; interrupt-parent = <&gic>; - #address-cells = <1>; - #size-cells = <1>; + #address-cells = <2>; + #size-cells = <2>; aliases { pinctrl0 = &pinctrl_alive; @@ -70,7 +70,7 @@ compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; - ranges; + ranges = <0 0 0 0x18000000>; chipid@10000000 { compatible = "samsung,exynos4210-chipid"; From patchwork Wed Dec 11 15:06:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181250 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp921509och; Wed, 11 Dec 2019 07:26:51 -0800 (PST) X-Google-Smtp-Source: APXvYqzoajNGOGb0gsMZZ3Ws/8iEbcQCLv12R2o3r3pSat03xIT0L71I59pfNKY0MyCc+D7YRyhV X-Received: by 2002:a05:6808:6c5:: with SMTP id m5mr3060598oih.143.1576078011736; Wed, 11 Dec 2019 07:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576078011; cv=none; d=google.com; s=arc-20160816; b=RPx8oO3h3Qpn6JL+VLQcGTSvVelWsWwAd6GtaO4gzkTkpDIKyiMiSVaTdSXzDXhpY8 4//2DQ90nu4pRz6wL8Avozju8W4DuNrf/J/8z1psAASAlwBTGK+T6VOYeJjcKWf1FZh/ A/FLdCXQ1d4OK3I/JbGF7mGDdaF7BqTdT84qR+m8zbhdiGLyeR5l8uKvwts2Jar0NuEb rvZWmxCBcuClVE9eK0YnscmZq1x95GwrAk62pG08qD8F7MygYsR/lFmngMFSTYTTQK5d Xpes8w4fSnm3e5Mdx8cVIzsWkNtdp08ny4ORCahdNXGoKPUMKoIPPm2Qr4XmrMwwmp3E 2y0w== 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=K9pIKlHTohhm2Nax2cnkLrnS6CYuVBJU4hKE8n03FTE=; b=xhQ5UMuGD/y6Rt7QS4XOYLquoVp+IL/tgROyijdEZQO/tVuzv5ZbDElbTadfniMsEL 8WgrS9aGqPBgX2mx6eHjeqsruH4e9RA39n3e9ZFZMHADqUsFQ3nd972Qytgqyir0IliR bu2f2Senb8XdzYfwZSPuO8qvOkFchbk8G0F8q0+jCCaSU1TXs15YEP1VoObTEsl2dXJ4 NfeKdLH3OoMVBRPF2E95So1NWQgueoqHBP34NuJ4sAST/5gxeus907wmPQCg6R1bysrN LYzkcCt3Mv7tNerAwOIwGpI3J9Rl8dBwSgk2HeG16Z5ziF7HwxTAgX26zT9HoWC8inPY Qn6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b4YT1Qk7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z25si1303201oto.211.2019.12.11.07.26.48; Wed, 11 Dec 2019 07:26:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=b4YT1Qk7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732991AbfLKP03 (ORCPT + 27 others); Wed, 11 Dec 2019 10:26:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:59776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732983AbfLKP00 (ORCPT ); Wed, 11 Dec 2019 10:26:26 -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 C895E208C3; Wed, 11 Dec 2019 15:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077986; bh=bxchu0qrYflqAmDF3wnDWrczTqaHYpynd2lndRqnIO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4YT1Qk7gbUndX5Id9+xBPlhmRYT49nTECXPvUmBO99XmSrNc2+1EjTHTWm0q+apB V0UJpW6DhmrIsH6QzMmFjxTO6oITPWMJChzvmXatCruzjHyq4nus+y7/wJzgMYJtZ8 RWjyGD+HhE6bxDBCzO1XRfu8LVmqYm7oo0P+x/zs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Herbert Xu Subject: [PATCH 4.19 233/243] crypto: ecdh - fix big endian bug in ECC library Date: Wed, 11 Dec 2019 16:06:35 +0100 Message-Id: <20191211150355.060433734@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel commit f398243e9fd6a3a059c1ea7b380c40628dbf0c61 upstream. The elliptic curve arithmetic library used by the EC-DH KPP implementation assumes big endian byte order, and unconditionally reverses the byte and word order of multi-limb quantities. On big endian systems, the byte reordering is not necessary, while the word ordering needs to be retained. So replace the __swab64() invocation with a call to be64_to_cpu() which should do the right thing for both little and big endian builds. Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support") Cc: # v4.9+ Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- crypto/ecc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/crypto/ecc.c +++ b/crypto/ecc.c @@ -906,10 +906,11 @@ static void ecc_point_mult(struct ecc_po static inline void ecc_swap_digits(const u64 *in, u64 *out, unsigned int ndigits) { + const __be64 *src = (__force __be64 *)in; int i; for (i = 0; i < ndigits; i++) - out[i] = __swab64(in[ndigits - 1 - i]); + out[i] = be64_to_cpu(src[ndigits - 1 - i]); } static int __ecc_is_key_valid(const struct ecc_curve *curve, From patchwork Wed Dec 11 15:06:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 181248 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp921045och; Wed, 11 Dec 2019 07:26:26 -0800 (PST) X-Google-Smtp-Source: APXvYqweHzrkjxcdJToTaAZ9rypjkoY5QpvnqobxIRaeYM6YF8ie2isOIU7OulZILWs/B00EtVV8 X-Received: by 2002:a9d:6396:: with SMTP id w22mr2738355otk.364.1576077986351; Wed, 11 Dec 2019 07:26:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077986; cv=none; d=google.com; s=arc-20160816; b=IvoeDyOR64Ug1c9BOZ8xI9h8Wyz4T2okQQyHhGh04veS9IinJN9ztPy2GZcpS8PM7z OSha6QYXS4Ng1WaG0rBGiZav7irt/8ME67MqCdhbUcdMyFrGaN+m/smmfSqVranb4byg 4gZj2nx8HQ1uIZDfaWqdTJVrtoSHj68+PEwNFa1U1i+JYssrQX1h2IILpH194cA0/+Oc cv48QJx85LsdsWLFGA+w9fZf7UbrG9xSj5PwyUjGWXYjUN9u085B9qOeXZOzYFvlE0zR L8hg/yeqgF0j1gLPAUNqf6Pjw7o7E13GM6sM3M3+zmTgyk1JKApXTqaCFPn5+ba21GWe GFew== 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=iRrQ7XyIsuHNKGSQz3kvubZ0jarX3LFpFNvIERf/CVd4zP5Bt2FfNUNJ6awzHTBUMe u/zo07r4d/+pF0Sm456h+0VhztoNRtJmAqPa9oEpLcfOOasGHNOj8cv11mBzzUn6/0Ed 0ORMcmg+cqH00hZpD4kG8EpXYa1qCWhOqLRK5ImiGQ86eeSaDuDC1pZGAEjRE8LuLqup OSJBIu25C5kn4sHWmzL8vjEX5fvNI1TQ16UAM8d+rjU7IVScQC6CgwiPX8KYdpF21FXc LzamIyPzI8eDhhZA1hfHm/A2OxyFUPr+G0jIVcmIr3MHTLYtv2PmK3ZFvO0QsIcYgA3a YFFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ugZx38xq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 z25si1303201oto.211.2019.12.11.07.26.23; Wed, 11 Dec 2019 07:26:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=ugZx38xq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733081AbfLKP0L (ORCPT + 27 others); Wed, 11 Dec 2019 10:26:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:58924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731095AbfLKP0D (ORCPT ); Wed, 11 Dec 2019 10:26:03 -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 4683E2077B; Wed, 11 Dec 2019 15:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077962; bh=bMEM8CgX/6uIErmN9B5ttGlNi4wBwVVcAmuXfFf4Z8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ugZx38xqhotAWnWlB+tyu8dyndm9NgE3kvSkaWua2yhlxBWRAEm3zuBFgQ3Hd5/jz lmVeVHz8kgY+R1LCh4N+GLOMu9ZhrIXXg3ZbS1LMqmT/zrrPQHgrZGLG2oRQHD/JI1 3EDKk69blEzD4jz0svYXk/+7SoDBcGkMpj4dp3eE= 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.19 238/243] RDMA/qib: Validate ->show()/store() callbacks before calling them Date: Wed, 11 Dec 2019 16:06:40 +0100 Message-Id: <20191211150355.402771505@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150339.185439726@linuxfoundation.org> References: <20191211150339.185439726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); }