From patchwork Thu Dec 19 18:31:44 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: 182160 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp857463iln; Thu, 19 Dec 2019 10:42:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzW27iGq2r/N5WR4Ctf/4ZJYOQzgG8LdZNTm3Fh7IFNZ7hUaXf8InvBIgA2XUsJ9yioaM2/ X-Received: by 2002:a9d:2264:: with SMTP id o91mr10455437ota.328.1576780959893; Thu, 19 Dec 2019 10:42:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576780959; cv=none; d=google.com; s=arc-20160816; b=LCDQiaaHNYnlpzzhE/OLnEGytD5U+cKmSXgICvZGvTcAklBUEQc75s4VZjmnB8fhg5 8Aam9S32Tt8ajXNjoQzq7UYqBvZ68c0+K/heGkCHzUz93/IeaXuu86Rrzk/cog6Q7Rk6 MG7eywNsqAM6mI406czipjG1ylBonzfdkCb+fbSMjG2Z0DAtZB4AllSDPUgjlQgIERLr Bz7VT09mb4I5QZo/dB2T8O9k/xmnn8ejnG/A7R1UMCtqWbpo4QzQtqfk2BC0/5yYIhy6 OpXcYoXVdxBu8bUnMovZK7yWiTmVKuKnWE01FVN+lIHzv1VwYcHGh8xaVJ13KLqE3aL8 RRFQ== 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=VxTgn0IHLIkoEeJ50HZEcqGLjXf7X3mGhsV85MERphk=; b=Qy6QRyU1JGkr334FLURqR7rAN627NCy/8ijP/2bCMgCivaaKpRpRSZOYKF9S/SGnCU 5TUrO7y03q2ZgfzMZn6RsJD+7ZVnifn4hpkGH3r32PvMFZbYYQjFQuGRVnagS0n2KjW0 tJZvhuiws7Jvd+Pcm1n7EuwxauOyU2gpk+6oGB8fS/XpRgaOzjjC+S6hCnPMUF/gO9mG rZ8zxoY03AfhxKy6Xp9gCK1Kse+W+RLy0LDW+GVX2KCQgVMOzMjN1RBplr52QxSNz72m stAiC7wg3OTptNVgpWEaLMEOMOvkxfz36HRdyaDCd2zH3nzn9I5PG3hDSFQsgXdwl+a6 YA4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kyvfdWcS; 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 w68si3314398oia.223.2019.12.19.10.42.39; Thu, 19 Dec 2019 10:42: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=kyvfdWcS; 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 S1728723AbfLSSmi (ORCPT + 27 others); Thu, 19 Dec 2019 13:42:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:33814 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728695AbfLSSmd (ORCPT ); Thu, 19 Dec 2019 13:42:33 -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 AFB0024672; Thu, 19 Dec 2019 18:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780953; bh=SQ+63E8dRGVFKoxnKVDyx3YwGbAdRpIHTG3O4filuZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kyvfdWcSrs9jmHX9/aB7OatsyAwCZ9beiJjWMRmkZcV6gr+NUes6zyEfM9asQOFtR yGjmuc2/fIyFXwa2+ZU3r6o5vm0d0YFGdHOElGe8VgvHVQc3PdWi+OJeUiJJJCNZq1 FQIRP2a7DCOIrfgVkX9GADSK4OFnuZHLLxjSu60Q= 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.9 022/199] extcon: max8997: Fix lack of path setting in USB device mode Date: Thu, 19 Dec 2019 19:31:44 +0100 Message-Id: <20191219183216.039083350@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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 4a0612fb9c070..b9b48d45a6dc4 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 Thu Dec 19 18:31:53 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: 182161 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp857896iln; Thu, 19 Dec 2019 10:43:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxY3fs3dAmaUmotNSvx9GeTJk8TEEJM8ovC/a15GMWTbhr3xl93hltz4wPo/pRXtgWNUnOV X-Received: by 2002:a9d:32a2:: with SMTP id u31mr9707114otb.249.1576780982802; Thu, 19 Dec 2019 10:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576780982; cv=none; d=google.com; s=arc-20160816; b=1D9I5dpXW+zJcPLlAdw1oxWlQeskeFGr6UOEU5KA4B8bBr9y+ENnsWKO9X5pjeXQHv OQ8m35f/GS1fUMtHqjcvmchgCmN1Kmj6pwi77Jcn0RZ4iRCzgASZ4ZZQxX00/KQ/xaE8 0P+8caTJhuI1KLl10OqWZPC7jGURFKgi8qpod/og7ica5fiufkLd1OwnBc1rfJIil55R cCCNcF4cYrbhStd1dKPVKG/UeflZSKjQlSw+F/9H+TBwXwFHGLa7Vy0BSqEKgtOXf8Nq d2N4dsTrIbvKzfCNcci2Eq5NH3D/qV/xdnpDPMgY6kVbbrVQsZWEwZs290JQnNJSMIJz PA6A== 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=twPY5/Gi8j87rTpLyu53Evkey//78kuUvJpMRf5BJ3Y=; b=pOuDIdvALoOnR4vZo3GXufZADFPHtsCAr79j5FyMz4n+oVyfmN5uZo5hw1IewCs7qm fqBuZwZ4Fjls/S+x/+W09X9A3jNpYbpRX92rF+WGccDJvdECn4Jc9o1at2NH3jQ+rh8q Js2L348HP/Hw3fEPX+peB5q9K12v+SSwkaWKlVPtQZRszsa99Ous0gDsaAVwJ49zIPQ8 gEJCm1FECPZYAHDtVFNQFUlREMqJnKG+qRtw5pa8yGAxAUcvIQLBs4zlFMtXo6/9wNb/ qJS+tVF3NaEm/NJ2v6Ctk8rB9i5kd4ekWlBE/hOmgDsIyVRlT4muDwM6sXVVukeE2Y7Y 8kBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Wo+2xaPF; 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 w68si3314398oia.223.2019.12.19.10.43.02; Thu, 19 Dec 2019 10:43:02 -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=Wo+2xaPF; 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 S1728225AbfLSSnB (ORCPT + 27 others); Thu, 19 Dec 2019 13:43:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:34418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728773AbfLSSm6 (ORCPT ); Thu, 19 Dec 2019 13:42:58 -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 1790B222C2; Thu, 19 Dec 2019 18:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576780977; bh=7qZGJelULVxUzXvNCcQGpWBoKxbjnvtdeG82dKQgVT4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wo+2xaPF1zes/pqfAeCF7oMfEGrKuFZBQTssrwB7QWtsHg7TtWd/WkxkSty+bizSw nGXX2o6EdnaRKh2LahAuergEt9QRDKGqjb6doJVeMcplGhSz+Tbk/c7PwSO8mXl90H sb9D9HfsbOs+GmNM9k8LGl0Fg2iIa+zam28LljEA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cheng-Yi Chiang , Mark Brown , Douglas Anderson , Sasha Levin Subject: [PATCH 4.9 031/199] regulator: Fix return value of _set_load() stub Date: Thu, 19 Dec 2019 19:31:53 +0100 Message-Id: <20191219183216.600647207@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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: Mark Brown [ Upstream commit f1abf67217de91f5cd3c757ae857632ca565099a ] The stub implementation of _set_load() returns a mode value which is within the bounds of valid return codes for success (the documentation just says that failures are negative error codes) but not sensible or what the actual implementation does. Fix it to just return 0. Reported-by: Cheng-Yi Chiang Signed-off-by: Mark Brown Reviewed-by: Douglas Anderson Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- include/linux/regulator/consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 692108222271a..bab9236e43675 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -479,7 +479,7 @@ static inline unsigned int regulator_get_mode(struct regulator *regulator) static inline int regulator_set_load(struct regulator *regulator, int load_uA) { - return REGULATOR_MODE_NORMAL; + return 0; } static inline int regulator_allow_bypass(struct regulator *regulator, From patchwork Thu Dec 19 18:32:15 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: 182164 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp858721iln; Thu, 19 Dec 2019 10:43:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzogTvWPAmCKJ/nwROGKJCnDdcCbErJ79w6A/Dqmc2yJC3BAwmAsarW6Sjd1LzhN9RYk+9X X-Received: by 2002:a9d:6a8f:: with SMTP id l15mr10028150otq.59.1576781033552; Thu, 19 Dec 2019 10:43:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781033; cv=none; d=google.com; s=arc-20160816; b=yquZchxwxXLGnAQMrx+L80A1+akoDdRPaaSB7OKGgaU6MKIeQXmiCmjltEA4kR+TJq TqQH292ayhUlUDlDQwsz2tsDQVNcr4La9Up9qqAae570cGJXdwVff9ikPjzwOIA3bqYQ rl11rH3+mQXZoRsbloOjnEOHgcgOq0p/D25EDPe1fYuuvs7dGbdGBKy+hn5mpBanxscc ZI5aAeMlHLKBdb4e7jSX/Bn6rbDrJt/IfxhlYDebqhScjJc+0oChtV5MhCtUNICaHTmr 9sgqtpfvqxYwhPm5VN0/9hwjKgk6lOINlz+sja1Fnx8b42nh9rrEQvAlkXAjmcnOFakB 3YNg== 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=CgShVYA1LF/h2OcKMdkhsDEgSIm/jRk0OaP21Ko+DyRfj7NYld/NUhRJZMO2KlLILh NTDONBa4SbOpwwOBT80sFYCz7TZkZ2zObMDST0FUkbgzDueVC0/cnVh4s4KNrNcN21Ay 1GRCz3rKb6wKQomOU4dsHkQXuBTFRNykwujQvMZVYw2vZ7Qo5sw5+HqHq7ut6HurMCTS NqAhoMi4UZBWdno3F8oEdo/1Qj7US2A5JT2l10Dm5aosocfChgAwVVIvqyG9GcZigojN UGyckd1p23HYeP41u3XKxCLK/fD81CsJ86SZ6zXgGguH+QP0kpTF699VzmHLLNArucQR mpOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bC5pC1wM; 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 s22si3729952otq.10.2019.12.19.10.43.53; Thu, 19 Dec 2019 10:43:53 -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=bC5pC1wM; 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 S1728917AbfLSSnw (ORCPT + 27 others); Thu, 19 Dec 2019 13:43:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:35560 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728865AbfLSSnr (ORCPT ); Thu, 19 Dec 2019 13:43: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 34C6D24672; Thu, 19 Dec 2019 18:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781026; bh=VSBIhfZCukb3KkAC7X5bF+mpEdHCaVQdLhX+frrXC4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bC5pC1wMBS9hH3vdfadh96lQ9OhzpygtI8szRUGWRm/zgSKkmkC8tzg7s08va7/EZ K9Q8Q9ROBTqbEtdCuB94hBh6vDy7r419QLqnb+FSZJC0RfH2rGomoeAl/L+m0kT+U+ 8ErceuFzVs+BXPBHpZYTLKbzZx8hKZQBd+cKw3+w= 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.9 053/199] ARM: dts: realview-pbx: Fix duplicate regulator nodes Date: Thu, 19 Dec 2019 19:32:15 +0100 Message-Id: <20191219183217.894949173@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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 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 Thu Dec 19 18:32:23 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: 182166 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp859102iln; Thu, 19 Dec 2019 10:44:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxk1PAAAk9h+jHEljYXkAlTx33BmWhxawGidIiYdU3bzJNfwTBzLNdWQYxoAjpjSAfkx3RV X-Received: by 2002:a9d:7dc9:: with SMTP id k9mr10251187otn.117.1576781053624; Thu, 19 Dec 2019 10:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781053; cv=none; d=google.com; s=arc-20160816; b=tNCMmeLSsTzyUNnzm8Ns0kLGy23qSKjdpsIj1YAkXT6CnkJoZJqAxwEodEjozi1R37 /whJbPDUrgchigE/QPKHIwiE+mlA0JH+oUJ0ZtuLnmH1+QGsU6NsUNPxP/oUDk/qRXYd YVlbOg6iSGRflyDRAWAIrLBLrTsi9shJT21EQzGARMHyybvlzRp6+49wFMRtdBu6iEgf UeIH4Z/dYYZGv1JX+x/LXCFHoy/3t/T7E04dNEfkWs4xri5KgZMlxZDax/5mP0DbYeEp hvknckbQAx9XpdVldpoIBClJZazXr7Dk3F30PkXETg88OxdA5CiJEznJMFjDePnnlT4q qlAg== 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=pAnREPZiFocN+LVb2ESNQx2msHnu158DNR8yyEgOKWc=; b=yT0vikx08MATXwOIX+VnXrthyJG4E5ULQ90E8NRu97Bxaz5qmjCx66HLwWpD3UnU79 dTyAVRSarb8F3dunmEedSFMPCtLLuI1BnPHsNIczvgqehRTckrmjhr2BGSbKXAa4YE+p Op2kaCjUDeMw0oMQpNahvHoGW4clHCOTXRxs6LMB2/ytgSojUIFhraPrcx7uLpiigqbg /3D5eusqqpgJ7OowWbhgd+s0Pb/HL1Tgh+ynldsZjO7IB0Hvo5Qj5rGHVnvhS2Y0Lrf+ PT/06Avmdvmtz3v6BFTqBEWohc9vn4lyi6xVy5/7AOeOENsbh0vng62Fu1npliOiNMZk 9DPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=b0lvAL1v; 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 g1si504602otj.115.2019.12.19.10.44.13; Thu, 19 Dec 2019 10:44:13 -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=b0lvAL1v; 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 S1728972AbfLSSoM (ORCPT + 27 others); Thu, 19 Dec 2019 13:44:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:36072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728306AbfLSSoJ (ORCPT ); Thu, 19 Dec 2019 13:44:09 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4252624672; Thu, 19 Dec 2019 18:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781048; bh=L1ZJnOukyG9pbLSqdTAzhSKY7W/Y+Cjvd9R5hzHLJUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b0lvAL1vaOrsk9hkWOMaNkubTosc7ZEFftfasXUt9Bhkn6XmwsDM3ONEvaHRG7Q06 76WjmoDSXVx8S0w9wsP2VdtVVnPOOKYD84AbcRVyK62vTb5G1VyrUgOlI2pHDUWjut hjYMt7wiEChuijVYobbQkth8lAOtQhcWr5pkD9aM= 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.9 061/199] ARM: dts: realview: Fix some more duplicate regulator nodes Date: Thu, 19 Dec 2019 19:32:23 +0100 Message-Id: <20191219183218.384297605@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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 c1fd5615ddfe3..939c108c24a6c 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 e306f1cceb4ec..95037c48182de 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 Thu Dec 19 18:32:26 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: 182186 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp894318iln; Thu, 19 Dec 2019 11:13:05 -0800 (PST) X-Google-Smtp-Source: APXvYqyXPoOovEmirNlNELzh0TaQKur88FkcUNM34bxGGjl5aUwZ16r5EudzAe+/sqSYI15xLLIB X-Received: by 2002:aca:d6c8:: with SMTP id n191mr3133320oig.103.1576782784964; Thu, 19 Dec 2019 11:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576782784; cv=none; d=google.com; s=arc-20160816; b=xrR/3+atgG+qWTyWjSYG1/jbjcXsJZ3WeftioopEuSJTDYtlHp2ksIYwJ0yhewAi/G YSSE1qdhteJHVqwRvGwwWVAaLpqRRtCrV4psLbhyA6aB2MSRrXfIoYm/U5pT32dYSD/G SUrgz+2j+s085XVpvyrSuPPaU+Zh/X3iG3k0I5CpdcWqf3qhl4QGHSz4tPDeSnCCacjW VOr/Bp0toyJ8vfpsuZ1kzxYmO7bgiZfAq1CaMpxeiuqpoIoMdDIoxSIk+MlkmseEJQsJ cpp6q563C2GbchFv50mifqVQgBGtEfetsjw+tqVs9YICq5dYlDFcJ5rgMfPeTcs0jK6L Ag+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=dDq+WKl9XFwhH5McBizAftmJWiZ1h3imxqy/7AlKzWg=; b=ERB2kpD/4W1pRfc4DbKqEfgMIiG9eZNT3kdT7q+p4FLfl4/ap8D8UPZR/q4mx4oFRI 9hnDiVU/3yle1uZyjQf6Tc37aPya4/4uoWMN+wSkuKIEk0Q6ffaPNl9uH0lRjyrUDkTL wkdC6n8c7YmgqF4ZoRXNdcy2QieLx0MpDvMR19nUze2a/8KKqE4v3sZWTYhtaKXFI0Yn P9lNcjMoPCup+vWLYMggINX7e44R0lKQgdA1rOaZNYRK+B0sPyqTGwBq5S+lz4Mrs2+N Pk7lLLO3ISNztCefgwaRv7qoht0DjrrS/scp/5LGhzJL5GWFRhsWcotsgZKLB058Lhzt qFBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eP4d2ikt; 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 v26si3819910otj.0.2019.12.19.11.13.03; Thu, 19 Dec 2019 11:13:03 -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=eP4d2ikt; 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 S1728956AbfLSTGi (ORCPT + 27 others); Thu, 19 Dec 2019 14:06:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:36194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728725AbfLSSoQ (ORCPT ); Thu, 19 Dec 2019 13:44:16 -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 9DAAE206D7; Thu, 19 Dec 2019 18:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781056; bh=m0Xi4nTk+oGEpyZ0wdmXOfeFk6InEJHjaHdGJ/1h9rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eP4d2iktTl4Oky7cLXCiNtwnK49ZTEq4+Dsg/yA25mdeRMmTYTmYccKcnTO6a4mZb pdUAfOJHxZBeqwJLglfOx1oa2m+lgkZ0cX2CBJj+kuHBVhqxCER7CLje2Y4NfolBP4 FCmyTRK66kJPrKJx/UsJuDEgZUzE8pQcI66x+2ik= 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.9 064/199] powerpc/math-emu: Update macros from GCC Date: Thu, 19 Dec 2019 19:32:26 +0100 Message-Id: <20191219183218.541541530@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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 Thu Dec 19 18:32:53 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: 182169 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp860274iln; Thu, 19 Dec 2019 10:45:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxEUmF4t6QQssCtksIxqsOv9cqTJ7JM8tprmCPO38vSFsOxPIhhqOaNKrjwHFs3qphGTYp7 X-Received: by 2002:a9d:624e:: with SMTP id i14mr10477166otk.371.1576781123749; Thu, 19 Dec 2019 10:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781123; cv=none; d=google.com; s=arc-20160816; b=qEZej6rOn7xtN5npzJRXDa/qhZY7K1U/XM7SCQtjNtr1s0aHdxBdTrdfOG4VqQWSWy al0RBv/PU10gNbg6b53yg0oa+J6yaQuVeOgV6nS8RCtB7LmHWrzy+09HiJIt4+axB2xp j/NU2U6h6fmOGO1piwkXwn54DS1VrpdbHh9ATPQnq1ybCe0n89+/gtnVU6nu6piqQzBE h6kZb0lPsjQgcrcwReIKdTcFkek1sxjOr4k3yIEde6nzcuNsUFW00fR1l8kLgiR3U+8s R5zy/PtmGm0qL2jljy+KCBl362UVrz3vo760U74n/AIC8AAlX9/K6xe8VvbXMqy+LRe1 eE9w== 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=wRVYW/qLZerGZifb0YCiAzSz32BvX8OtJgoLSw/yb5SObHQKwigP1rK8GvskYpAZQj 9ZJLi9yAq6PBcEYs6031MycDRx7tOwNaySQA6asdvgk6T3KMlASeNsKhd+V6MAAkAbHq WdRwd1Uex4KyvfgKV1QWNnvh1b2GH8d8TiZR2sE75SM4405qDFukim6a9EnDDoNV8Jfj HFvhllnSEy+lz2qp/sQhmb4Kh0DF+tDyplcvAKzSWYwivWY8sOr8jwdKXZlQA+e+apCi t6ipMvdPhpbZLwtuYqZjPeXJ7JsIsIgtuMW3u0UqmH6/dIwCTZNEC9OwdmHk8tkZtN9X JZgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="TKSn5/3G"; 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 l19si3349935oii.54.2019.12.19.10.45.23; Thu, 19 Dec 2019 10:45:23 -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="TKSn5/3G"; 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 S1727539AbfLSSpW (ORCPT + 27 others); Thu, 19 Dec 2019 13:45:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:37620 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729126AbfLSSpU (ORCPT ); Thu, 19 Dec 2019 13:45:20 -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 AAB092465E; Thu, 19 Dec 2019 18:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781119; bh=bMEM8CgX/6uIErmN9B5ttGlNi4wBwVVcAmuXfFf4Z8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TKSn5/3Gvvs34FQg7SwvJAsJ8DqL4PFxWAKjBzHYnzC1Pj6Q0ToyW6UD2v9D0soVN B9fHGx6eIF8Fka3Cx6QFRFfmN6XtAFUX2vQi1sg6SHv9mtZ1ee6vHDXOGLJSMuw+/J j366lPkpMYlw729KRwLUqJ9EsdKDbyPQPuh8AnV8= 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.9 091/199] RDMA/qib: Validate ->show()/store() callbacks before calling them Date: Thu, 19 Dec 2019 19:32:53 +0100 Message-Id: <20191219183219.965713070@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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); } From patchwork Thu Dec 19 18:34:19 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: 182173 Delivered-To: patch@linaro.org Received: by 2002:a92:d0a:0:0:0:0:0 with SMTP id 10csp864110iln; Thu, 19 Dec 2019 10:48:52 -0800 (PST) X-Google-Smtp-Source: APXvYqy9+toIvk+7EEWJxUROj+qANl5bNfUryMKn+XuciwSxq6V4Hfru7WWLEBlpYiguwL7ftRI5 X-Received: by 2002:a9d:6251:: with SMTP id i17mr10471760otk.14.1576781332869; Thu, 19 Dec 2019 10:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781332; cv=none; d=google.com; s=arc-20160816; b=oo4njhtYyXflKovriWVWEzhGECZOpABJtSR5iOn8cBS96OjW2UnMRGTRehRGsqi2s7 Vt9bssSxu0LcXL/nHKyUx+hM8IWTQzKj0RhRVI1QoXFZ7i+m0fSbfqkG/GQobC+dBVvh QR+8c4jJu4QS03YZC0Bm/TA+ssc/prAfQnxHR5MZZL3Nz1pFUG1I+nnHYOAMsmLNcsZR x7taveskPbRfyxMLpQc6Cv6cE+xlcQy2ukQQOUwyaobheitI51G4r2qWBUyeOcWJ+ACd ibfFs7s+LcIOSf3QnxFX1lQ29c4tmiOdi+Yuj9Mc0nxzZwWVmDfjGmyxi5+PqacSgIm/ JNcg== 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=haE+a58DvEzuRQCf76cx8qHjn5lRIXDhHJzmyGJUf/Q=; b=EUby0iYXepz9ktp5vjCfw1LB6vo4+pSi9TS5wer4NWH3qap9Sx4T1XcN8vuqCFmFQk /72fRLdZl2/xxY38zWDyQiU/yyDKjVbgtmAlwA9Do/Bsp0YK03kAe8TwPR6a2Y0oRM9g NFR0pfFNnhujftCERycU40JLGGHL6lHQOzmLPEb9FRtDLlYTHc2uQYFoQtjS+K4KejwW idob/yELPwM5evnjM1qTlAtitO/vbwcQh2GhKuhCoAaGFqJqA6lxdmfNyHOT7pRRfIrH iSZYLKRgzYPO43bdyu1wEvb44FOp+bK8njVXT78OwfrZVLGFnAYVkDVJmsTVqsZJAvqf kUbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q+CPpPa+; 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 r1si3692938otq.298.2019.12.19.10.48.52; Thu, 19 Dec 2019 10:48:52 -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=Q+CPpPa+; 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 S1729690AbfLSSsv (ORCPT + 27 others); Thu, 19 Dec 2019 13:48:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:42030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729677AbfLSSss (ORCPT ); Thu, 19 Dec 2019 13:48:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D0FC24683; Thu, 19 Dec 2019 18:48:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781327; bh=Ph09qFfmaBHHIt4pNk55ghnUGqDVXfldIT3+1xaUYjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q+CPpPa+dI0UrwLuQKDsyPpUlSsdYuCvsUtQ+BmJf0owYMTzPKBteEyxqZ+tXDUZT 2iLG/vrgIw2ZixfM353p4cgDBgJiAkKvgrlCk6pMDSemLcl68AWRX+c+uPwZuy8oPo FxAmUyhwd2IzweT6SfdO0IN9Yqqo831R25z7s41Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Grygorii Strashko , "David S. Miller" Subject: [PATCH 4.9 177/199] net: ethernet: ti: cpsw: fix extra rx interrupt Date: Thu, 19 Dec 2019 19:34:19 +0100 Message-Id: <20191219183225.379351583@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183214.629503389@linuxfoundation.org> References: <20191219183214.629503389@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: Grygorii Strashko [ Upstream commit 51302f77bedab8768b761ed1899c08f89af9e4e2 ] Now RX interrupt is triggered twice every time, because in cpsw_rx_interrupt() it is asked first and then disabled. So there will be pending interrupt always, when RX interrupt is enabled again in NAPI handler. Fix it by first disabling IRQ and then do ask. Fixes: 870915feabdc ("drivers: net: cpsw: remove disable_irq/enable_irq as irq can be masked from cpsw itself") Signed-off-by: Grygorii Strashko Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -773,8 +773,8 @@ static irqreturn_t cpsw_rx_interrupt(int { struct cpsw_common *cpsw = dev_id; - cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX); writel(0, &cpsw->wr_regs->rx_en); + cpdma_ctlr_eoi(cpsw->dma, CPDMA_EOI_RX); if (cpsw->quirk_irq) { disable_irq_nosync(cpsw->irqs_table[0]);