From patchwork Sun Oct 6 17:21:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175297 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3308090ill; Sun, 6 Oct 2019 10:43:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRGIWTnokem1vdeLISFSVUoyGK0wFicUTqquSuv2uFxi4o0LNkCWN3MGh8eR3gZ8p911D7 X-Received: by 2002:a50:eb8b:: with SMTP id y11mr24848482edr.200.1570383794315; Sun, 06 Oct 2019 10:43:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383794; cv=none; d=google.com; s=arc-20160816; b=d6Yec30KhduMGOHCfN2WEN1PbVkZgISuTN4wfmJ5RlmTDZto51+PNqGBBZVCT5j+2j w2CeLOuS2Sa+2QZeB1cX1cvzW7LYKRdZVd7WX+Y7W++smfgqCIc+AB5VmtTF0mhHCxdr D0SpAt/MJR5k89r9zzI5YEXSxia6uWrQAgPAAj3brdDC3pSvHnDk5LQE79Q7d8Uft0po QXPVwoA4fBtoQFA+W4STVNTHx8T6MhdQ+3Ys7ABVmag/l+NHJVwbvRFc9jOVaI9qikLQ S8JW8WUFc1Uf454ty3vqboI59jnBFRWtkUXctSMuD2CohUfOtryQenB1XfR2MtOhq0iF NLmQ== 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=ihzXLtpjhluH503WCuGQwklxBgAd/Mo4z1vEjb3wppI=; b=WIsB8rq/rFIRigVSWFTXWDvXXRgT0gRjO7OBFO37yoLNktvbcLrFUeVS3wYXh5DeYQ 1yp2zRV9x0n7eSVoWKjeXxxgFVns7hrnRzanvFDS1NQg/mkkHDow9Drknpio6WLT74Jw PS3M6xHEIvpiWlqyLzCTwSKOIfrMGfdR3bKaiDwr8gaAU97Rt9GVCdEWJK4TaZy7cMYr Ei41A+AWy/jLzZFIKRP2dv5Q94sU1tlmzuO2zU9nXKrpAd6eBQavUPz+scRTUfpPSs/3 IyAtLJOOdx7Mq+VkWZykrqOGH5Dwf/5RukHA6fvOOrzE8cIIYcOaKEEy1JkO4dt825Aq OQeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KgVLSmM5; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oc20si5788022ejb.260.2019.10.06.10.43.14; Sun, 06 Oct 2019 10:43:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KgVLSmM5; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731481AbfJFRnN (ORCPT + 14 others); Sun, 6 Oct 2019 13:43:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:43120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731477AbfJFRnN (ORCPT ); Sun, 6 Oct 2019 13:43:13 -0400 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 F1BD62087E; Sun, 6 Oct 2019 17:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383792; bh=C8GGBJVGuQevLu0Z6ggEvyEinRf5njOQ0297fhKdxTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgVLSmM58kCLrNeptIG4SFadhrFAEj2q8JWG0IPck0ZK7dhvm2q1IwQLLGNcuTliz flB779o+JzvkmB0pBlJNzmycCDxekb7sq0RyzQvpy/aMs4UtNNlQcCw0iLYoD9cLAp EZB8KrZf1PmKZe1GmSJShFCkfvnGP62KH9jKgPpA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Nick Desaulniers , Linus Walleij , Russell King , Sasha Levin Subject: [PATCH 5.3 098/166] ARM: 8875/1: Kconfig: default to AEABI w/ Clang Date: Sun, 6 Oct 2019 19:21:04 +0200 Message-Id: <20191006171221.817844263@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nick Desaulniers [ Upstream commit a05b9608456e0d4464c6f7ca8572324ace57a3f4 ] Clang produces references to __aeabi_uidivmod and __aeabi_idivmod for arm-linux-gnueabi and arm-linux-gnueabihf targets incorrectly when AEABI is not selected (such as when OABI_COMPAT is selected). While this means that OABI userspaces wont be able to upgraded to kernels built with Clang, it means that boards that don't enable AEABI like s3c2410_defconfig will stop failing to link in KernelCI when built with Clang. Link: https://github.com/ClangBuiltLinux/linux/issues/482 Link: https://groups.google.com/forum/#!msg/clang-built-linux/yydsAAux5hk/GxjqJSW-AQAJ Suggested-by: Arnd Bergmann Signed-off-by: Nick Desaulniers Reviewed-by: Arnd Bergmann Reviewed-by: Linus Walleij Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 24360211534ab..5e2c68e9dd6e2 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1572,8 +1572,9 @@ config ARM_PATCH_IDIV code to do integer division. config AEABI - bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && !CPU_V7M && !CPU_V6 && !CPU_V6K - default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K + bool "Use the ARM EABI to compile the kernel" if !CPU_V7 && \ + !CPU_V7M && !CPU_V6 && !CPU_V6K && !CC_IS_CLANG + default CPU_V7 || CPU_V7M || CPU_V6 || CPU_V6K || CC_IS_CLANG help This option allows for the kernel to be compiled using the latest ARM ABI (aka EABI). This is only useful if you are using a user From patchwork Sun Oct 6 17:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175298 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3308739ill; Sun, 6 Oct 2019 10:44:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPaRoio8TFvvMOA0CwiafNh6DeUSj8DVDQ/i12WKxO7nAGIWFkyMSSwEnZrMztW2zBrCFG X-Received: by 2002:a17:906:90d4:: with SMTP id v20mr21014073ejw.189.1570383844088; Sun, 06 Oct 2019 10:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383844; cv=none; d=google.com; s=arc-20160816; b=i/eC2d0jHHEio9W+aY7+ZSh5I9hHA47yBxUzUM9IxdnqhkwSmg3rIpkvmUFs4wHDEO 6Hq7rBLiHN+vnImK8iwwQLEMfz+xvoun276PNoySrAuSPYUUrJXvnEiStlKts/MFTBH5 /0uF38EasgRhwITxhckDJu76xEQMpWOiw073GTkm0LePTJV4fWy4QhHN6sVoEKjIgAoq sJJ95Ij+Sz4RRosNyBhh3UztIVnRctiLtrnDESKNEeOfJcmpRUTcTc+t2g+T5fVuwv4I /Ps1JBqAl7/XE/jcbp9EhO1NgyynmOHlEc6QnLbApldYyh0IQNhFro/DiJKf3dcP8/Xx BOiw== 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=lbFJ3ZeWUsXTvuCqy0xG+5Sy1AMck9H7AyYWb5NxUdc=; b=mPpYFebHJ+qvjPdyOnshGNTGYbGvQkA2MW1aC6TiTeX41040s76rsxaYW+32uuOK9t KQMkKz10LZztVm02rhnL7QG6blthgKMgDjAsuMf73P4i5egylcKZBa4tAkPOAWO/5qOu GrSlNEERVODcALbLP732Nd2hkOqVzb7M8HpiX+VK6qChy4Ub4+/SNtVdj07dyZ3hx5bZ Np9KMCnyaa+DkQ8Vpy9j5BSFgowB1c6zBcIQjismAVM2lvpJJ+ZFpWZzXrsBcGA8h6kV RewnehE0X1/X7DgyRyyl5Coq+mepcePdeewuP/81nFuZHa1fo/KG/5pvcLB8A/xWQ9xU 37xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NY0OV9aM; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w34si7625802edc.252.2019.10.06.10.44.03; Sun, 06 Oct 2019 10:44:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NY0OV9aM; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731023AbfJFRoD (ORCPT + 14 others); Sun, 6 Oct 2019 13:44:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:44142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731598AbfJFRoB (ORCPT ); Sun, 6 Oct 2019 13:44:01 -0400 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 A900D20700; Sun, 6 Oct 2019 17:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383841; bh=1gC8dF8dzfLCl1x3XsU1+O9RnKWeN/KhwwtSk3TzVcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NY0OV9aMq/VNql3FX8nby40asCWs1cPPk5iN6N5Bq1IvQvr0ujnDdfiETldsH/2ys tnf4V5erajSv+RZ2EIgln255YnphoJLXaG3lgJ3p7Uk8tYN9hVJzRbQzME0xwDd1XK sFqVDMP04GuuiSHtWKsfGzd33w8+9MDmHBWn7sAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oleksandr Natalenko , Paolo Valente , Jens Axboe , Sasha Levin Subject: [PATCH 5.3 114/166] block, bfq: push up injection only after setting service time Date: Sun, 6 Oct 2019 19:21:20 +0200 Message-Id: <20191006171222.946938472@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paolo Valente [ Upstream commit 58494c980f40274c465ebfdece02d401def088bf ] If equal to 0, the injection limit for a bfq_queue is pushed to 1 after a first sample of the total service time of the I/O requests of the queue is computed (to allow injection to start). Yet, because of a mistake in the branch that performs this action, the push may happen also in some other case. This commit fixes this issue. Tested-by: Oleksandr Natalenko Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bfq-iosched.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index b33be928d164f..70bcbd02edcb1 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5809,12 +5809,14 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd, */ if ((bfqq->last_serv_time_ns == 0 && bfqd->rq_in_driver == 1) || tot_time_ns < bfqq->last_serv_time_ns) { + if (bfqq->last_serv_time_ns == 0) { + /* + * Now we certainly have a base value: make sure we + * start trying injection. + */ + bfqq->inject_limit = max_t(unsigned int, 1, old_limit); + } bfqq->last_serv_time_ns = tot_time_ns; - /* - * Now we certainly have a base value: make sure we - * start trying injection. - */ - bfqq->inject_limit = max_t(unsigned int, 1, old_limit); } else if (!bfqd->rqs_injected && bfqd->rq_in_driver == 1) /* * No I/O injected and no request still in service in From patchwork Sun Oct 6 17:21: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: 175299 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3311873ill; Sun, 6 Oct 2019 10:47:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIpwDYoKt7hcvnVgVxEPz702wDqAA4Jcb9ydu9zZ43R8ljwUAFOJvcv/hvrOLbaYfXJsNC X-Received: by 2002:a05:6402:651:: with SMTP id u17mr25838763edx.104.1570384078205; Sun, 06 Oct 2019 10:47:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384078; cv=none; d=google.com; s=arc-20160816; b=xwB1N/o9eIhPl+J6YVOtt2FGaazj5cPeDhJ/Dunaaem51qIisJstnS7YIMfVJxMNZJ oX5gLPGkCY0j3Vw3FahDXxM1th3Y9pICqvT8tgehUi2MWnrujXBVe0C3LET/I2KTXaSi h0uJxnrL7sC25umaOmRW675bNj5rEjAug4T393/355cUiNrAbNHY8DVm+0DeytY1BCnd JDFfgJWPDXcdHX+BCnxkOcmcni6gVYkDUUdemRTAhU6z+qdJj50maRKY1fer6VHqhj9L rbgnFjxKkA69spDIGhAoLg6MlLt3oB5oqmw/v77MqAMqyZELpOAFt8tPpOzGgAXYTF1I 6czA== 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=QC+/p1pczWOP+Nh1FU9qgFkzAhIGIfWC8EaC4FchpQg=; b=QxeX55DC7z8Z72XJQY4fM8+XvkaiHSvyDT7/VBaxmYPIaklsXOYfQ2/SbQ7D8i2yTb IqnmpqCE+EeURWUlmi7vDvXtnk3p0jSYZWVUHVC4wOMod9gH4moaCTLtNxDglZcz19WR QE53mIoJ2iZMoxeN/mXoCol5CFnjJemR68sCmonN/jzTqUCydfSHvP2Yc4f4SL5bv5RD ut79AhoiS8OorD+SqjKFEjBbHk54avwjVCBvzd/b2TnYXjFyhHgd5+AH+I7cDEydooP5 nB5h+7Lo6CZ9ct5HhHzKvGp+YT4tKSPf+GtlzcsY9WMwutbch5VN1DwNr8ioPaNB49WW FtyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eJ1puECR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x51si7236623eda.272.2019.10.06.10.47.58; Sun, 06 Oct 2019 10:47:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eJ1puECR; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727179AbfJFRr4 (ORCPT + 14 others); Sun, 6 Oct 2019 13:47:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:44470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731081AbfJFRoR (ORCPT ); Sun, 6 Oct 2019 13:44:17 -0400 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 BA4D920700; Sun, 6 Oct 2019 17:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383857; bh=Wk4nPLxqKbyr+4wrsBpGefst6njL/ETV2Bw+Kk2IN90=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJ1puECRoIcd+FrFA8SGucMZ6EUKY61KCtCSawUNl5iewPSX/kWrA7f5lLRhnTEt6 g4MeZZ6fApymsN42IiWBFV4R+/CqKt1ty2husDThs5BqOJMH1FmDZIpkVAwoEMgvL5 uqWJTT8KpNcArUMnjPSgT1VkLxvMTycTXgyxUXYM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jason Gunthorpe , Michal Hocko , Bernard Metzler , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 5.3 120/166] mm: add dummy can_do_mlock() helper Date: Sun, 6 Oct 2019 19:21:26 +0200 Message-Id: <20191006171223.408924054@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 710ec38b0f633ab3e2581f07a73442d809e28ab0 ] On kernels without CONFIG_MMU, we get a link error for the siw driver: drivers/infiniband/sw/siw/siw_mem.o: In function `siw_umem_get': siw_mem.c:(.text+0x4c8): undefined reference to `can_do_mlock' This is probably not the only driver that needs the function and could otherwise build correctly without CONFIG_MMU, so add a dummy variant that always returns false. Link: http://lkml.kernel.org/r/20190909204201.931830-1-arnd@arndb.de Fixes: 2251334dcac9 ("rdma/siw: application buffer management") Signed-off-by: Arnd Bergmann Suggested-by: Jason Gunthorpe Acked-by: Michal Hocko Cc: Bernard Metzler Cc: "Matthew Wilcox (Oracle)" Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/mm.h | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.1 diff --git a/include/linux/mm.h b/include/linux/mm.h index 0334ca97c584d..fe4552e1c40b4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -1405,7 +1405,11 @@ extern void pagefault_out_of_memory(void); extern void show_free_areas(unsigned int flags, nodemask_t *nodemask); +#ifdef CONFIG_MMU extern bool can_do_mlock(void); +#else +static inline bool can_do_mlock(void) { return false; } +#endif extern int user_shm_lock(size_t, struct user_struct *); extern void user_shm_unlock(size_t, struct user_struct *); From patchwork Sun Oct 6 17:21:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 175301 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3314322ill; Sun, 6 Oct 2019 10:50:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhoYsxjGB1WTnayrRbwtlobdZsK2S6tFtepjZAX8Je1JUSlM4geAzsr1HsQwPaPDqYsaFd X-Received: by 2002:a50:cc4d:: with SMTP id n13mr25360391edi.5.1570384259142; Sun, 06 Oct 2019 10:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384259; cv=none; d=google.com; s=arc-20160816; b=dTcY6VyJh9BEa84XHnh89I5QWGPpsAn0bvzGlcBYYzPhu9u0HEAf9Keb1L8CUZOVse NlY/yoOVTrqjuHB+PaIXz12dLnL7jfLkStUQGjqOCw894dWbdKmU5hDoXBfkV/O8KVLn D58Mj937/TuunZLH2ZNNyGsKLbB4v7fdjuWCekQON75WhezmDt7FctlXNPKfk4N3hD8q RdY3/QvIa1+6jGWmMDBS07xS3Zatpd75uilo/pCM7TqaZNs5CkMBs3AjJSIkRsWHGiBy tF++h7m86pdUv3o/ezP8Vz+hU7jWT3VBj1InyO/iFQtb3QSpf42nD7wMijAMMo0hfasG sIAw== 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=0X4PyE+/A0pzc0nrYoqO3ss0n4+zHg2FYbq6rwTnoCY=; b=LZdii4dIU7MpOY7WqnL4A3AlXZDZyo4A3/dgsvonFPPh4LpdUR7xy3uAk4nRfFWKz2 SnFIooB3P0SdgVnBdpiIgEaKjxIK1zYbpS1uaauaQ+F/4mRe9DCMciK6OoaWBQE2H9u0 5GB+rTQmEhXgbcQ7N4eT+YNJBSofqDyUOMMVmeCPKLQC+73WFqy4z8gtEbaJCHi3Xqy6 8hzM9KGvjapIU2MprEua4SHwJI70elvWemK69aNGA09nJjnFzWbfVdWlq6tGN0nWP/E0 NV7xR70gyOlmWQWhxCYuEmbe5vqrzwvlOJ9KIs4J7KIg+XxpQtJaHDNlscZVE1AJeQGH 7Veg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jgXzoPUK; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si8317777edk.331.2019.10.06.10.50.58; Sun, 06 Oct 2019 10:50:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jgXzoPUK; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728925AbfJFRu5 (ORCPT + 14 others); Sun, 6 Oct 2019 13:50:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:48972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727321AbfJFRuy (ORCPT ); Sun, 6 Oct 2019 13:50:54 -0400 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 2ECA02087E; Sun, 6 Oct 2019 17:45:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383919; bh=qbJambDLBU2iCC1IS1jCXXoXh7F8TMycRq4h3giH+D8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jgXzoPUKmb3HK6NcHyUiM9e4xQKZriUFIrflYM+TJrXHZB3MUuHiotCFqCOLrmiFL sTIxfYWm/WxWSSWgqtQnXs2suSK8RDbycbYSkHx+8uhOA0ObPaNpYOc+502kBRsuV4 GXM6eFMLE/DaafD1+0bqrwzkf+cQXlNIZwjPy0UU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , "David S. Miller" Subject: [PATCH 5.3 145/166] net: dsa: rtl8366: Check VLAN ID and not ports Date: Sun, 6 Oct 2019 19:21:51 +0200 Message-Id: <20191006171225.179123080@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit e8521e53cca584ddf8ec4584d3c550a6c65f88c4 ] There has been some confusion between the port number and the VLAN ID in this driver. What we need to check for validity is the VLAN ID, nothing else. The current confusion came from assigning a few default VLANs for default routing and we need to rewrite that properly. Instead of checking if the port number is a valid VLAN ID, check the actual VLAN IDs passed in to the callback one by one as expected. Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver") Signed-off-by: Linus Walleij Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/rtl8366.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/net/dsa/rtl8366.c +++ b/drivers/net/dsa/rtl8366.c @@ -339,10 +339,12 @@ int rtl8366_vlan_prepare(struct dsa_swit const struct switchdev_obj_port_vlan *vlan) { struct realtek_smi *smi = ds->priv; + u16 vid; int ret; - if (!smi->ops->is_vlan_valid(smi, port)) - return -EINVAL; + for (vid = vlan->vid_begin; vid < vlan->vid_end; vid++) + if (!smi->ops->is_vlan_valid(smi, vid)) + return -EINVAL; dev_info(smi->dev, "prepare VLANs %04x..%04x\n", vlan->vid_begin, vlan->vid_end); @@ -370,8 +372,9 @@ void rtl8366_vlan_add(struct dsa_switch u16 vid; int ret; - if (!smi->ops->is_vlan_valid(smi, port)) - return; + for (vid = vlan->vid_begin; vid < vlan->vid_end; vid++) + if (!smi->ops->is_vlan_valid(smi, vid)) + return; dev_info(smi->dev, "add VLAN on port %d, %s, %s\n", port,