From patchwork Mon Mar 19 15:55:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132093 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp101907ljb; Mon, 19 Mar 2018 15:05:12 -0700 (PDT) X-Google-Smtp-Source: AG47ELugZ4ZM6Zw8Obtz833YdDYj+Vs9/aJIyUlVDUIomVm9pFncuhQc9cE4SvOR0cSIzFUaMyTZ X-Received: by 10.99.121.131 with SMTP id u125mr10299894pgc.263.1521497112106; Mon, 19 Mar 2018 15:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521497112; cv=none; d=google.com; s=arc-20160816; b=KNeb0Hu9anaNL2lRp7WX6haLgEvEsCyJDvYyp8lDc0BzKq1UWR1vr+83Pew7IlnRI0 dnI5yOjFCuCdiC9j9QMg4CdLnIBYDp0e2ZaDvFxJiVcRy6xgdHYG0vYsqlhTz1AADGNA 2GopfOTyv3AeBmcsN8Kc9LLzZtjfRwiuItyPdkFyjmPMrx4cGX1dw5aITeYDYMwzAkBO HJtSLJhVXvUQuUEx5NW8jKcHPITUxNOdG9jf5UfeqwmTVbPhLOL0XpJIMzYfQutTC2ph I5iaIQGDUjsqMf49xAVh1o+VSzsT3+VLvOhfvAbBe8irE55v6Izk/fjJQTTuQdETQ/Xb S4tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=98Eu7yEWcyxNDBxcz6PwfJ8/H4xrNu7mYMwFZo8uayo=; b=roI3Fym7ma/Muu38osCsEiHnRiPLsxbKUXm9nklEk2+xRGP3GNNoTn9h9ZftJd/wkR lnEGTmJmTJbKMzZIC70fI6nfTBdUXo/Hp9vqfHYB0tLGfkmE083+7jVFG9WZiize6eLx 18rpXNqfCyJhhFuUhcSRMOF5WZKaAyfnN7CDGBiJnFazW94zqXaTs92TQOKF2KSNMN31 6TnjGivnAc3lj2ELU4Y7BxFOalrsPpMKRqNclVrWmZoPPCNvAhNljRuqsbwev6tt7p1Q IiCjUYa8ahT7Skq4A/iObb6HGpeH9YLZ0WbIwlRFW+eh0VLayjbyhPbF2eXa8Nogs1uN 2UBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nMavLIuM; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c27si147876pgn.223.2018.03.19.15.05.11; Mon, 19 Mar 2018 15:05:12 -0700 (PDT) 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=@microsoft.com header.s=selector1 header.b=nMavLIuM; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936260AbeCSWFI (ORCPT + 28 others); Mon, 19 Mar 2018 18:05:08 -0400 Received: from mail-by2nam03on0129.outbound.protection.outlook.com ([104.47.42.129]:43956 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933827AbeCSPzq (ORCPT ); Mon, 19 Mar 2018 11:55:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=98Eu7yEWcyxNDBxcz6PwfJ8/H4xrNu7mYMwFZo8uayo=; b=nMavLIuM+l6dqtMDymfVNIo+D0AFEASs4SyiwBMdkwla3zieJX4ZaU+o3DR0KS+UqtPvfbk/j1W5pfrC4NsY8r5SyZf1ZWN2vTkVTLbORxOpf8v9EV8e6mGZO4lRmZd5QUk4RL4LwjMW9wRXeU3wFh089ArqyfInvEJeUbKVhS0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0967.namprd21.prod.outlook.com (52.132.133.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:55:43 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:55:43 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Linus Walleij , "Reported-by : Jason Kridner" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 39/97] gpio: label descriptors using the device name Thread-Topic: [PATCH AUTOSEL for 4.14 39/97] gpio: label descriptors using the device name Thread-Index: AQHTv5qsAN2EbUV2qUyg6Fm0yT2hNQ== Date: Mon, 19 Mar 2018 15:55:15 +0000 Message-ID: <20180319155411.12348-39-alexander.levin@microsoft.com> References: <20180319155411.12348-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155411.12348-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB0967; 7:aDoYkd8Y2ZNbaq6gBIDRpCdoy4n0Dkcsk9bjCwjJxa+1x6Uz7TnzAcpNVZkVsONOW35onlBV4X7HfZeuA+KQ/1DSx/Yen9OdinLsevq/d1PhTws9vZlgx7kyYAzTTzUK+I2d2P2QdO8zMzYsl/UQJAfZqu9G3xExOrsjoneo+4r4ukgc+VTer9q7ilkrcKNOQwr1UxNK/Bzhs3BrOpdjaR+z54/PutDcNjWR+fS48q5pbLxsiepv0mUy6aEUIYKW; 20:oFLgT5/VR1VuWEV/nQl24bgNzMU+M5Fa8VhMM6Cejxz9IAEx5tf7obRDTXwQXyghQ4jQ6cO1uBKooMMJJqcB66IDUd6O+EYsNehAt8F6sQ6Ga1nonFH21NBd9XZvHePmwjnLQZAAitbTWs8ANNIXoNY5M7nrmUOJa0MJHGa2lnw= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: bd3a3c16-2c44-4b20-5a99-08d58db1df48 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB0967; x-ms-traffictypediagnostic: DM5PR2101MB0967: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB0967; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB0967; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39380400002)(376002)(39860400002)(366004)(346002)(189003)(199004)(54906003)(59450400001)(10090500001)(110136005)(5250100002)(2501003)(1076002)(6116002)(3846002)(2900100001)(99286004)(22452003)(3280700002)(186003)(2906002)(76176011)(86612001)(26005)(6486002)(10290500003)(102836004)(14454004)(36756003)(68736007)(3660700001)(72206003)(478600001)(107886003)(106356001)(53936002)(6506007)(6512007)(6436002)(86362001)(105586002)(316002)(7736002)(4326008)(305945005)(66066001)(81156014)(81166006)(5660300001)(97736004)(8936002)(25786009)(8676002)(2950100002)(6666003)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB0967; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 54QvOL5u4xLWEZEllP2rC/OqyfY07Yjm3RwxYlznmoYm28AYAOR6g9WkR1nO2uuXN+JXMx5ZSBRKO2zk6oMG/92h0bPrMnEQwbconv4wca2yudZGQzyd9ul188juM0SF9VicgojD5LSXkRaqUfpm+J+qkaavZZTuuUcmEkaYwXvJlvigVBnwk92FFTbNCUWsLnVmhO7oqxt107R1k2SnQQ1i/DfIDOM3LdtY0hY+QJi2enR465GBHVATkaraca7MxX5qq0uP5483jsnUOaiG6TMPUdel7v/iG4iPuz+OZeGd12PLNGakv8YVdrjUmhQgymIu+/NpAskaHiHExLScvw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd3a3c16-2c44-4b20-5a99-08d58db1df48 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:55:15.9653 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0967 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linus Walleij [ Upstream commit 24e78079bf2250874e33da2e7cfbb6db72d3caf4 ] Some GPIO lines appear named "?" in the lsgpio dump due to their requesting drivers not passing a reasonable label. Most typically this happens if a device tree node just defines gpios = <...> and not foo-gpios = <...>, the former gets named "foo" and the latter gets named "?". However the struct device passed in is always valid so let's just label the GPIO with dev_name() on the device if no proper label was passed. Cc: Reported-by: Jason Kridner Reported-by: Jason Kridner Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpiolib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index bdd68ff197dc..b4c8b25453a6 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -3340,7 +3340,8 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, return desc; } - status = gpiod_request(desc, con_id); + /* If a connection label was passed use that, else use the device name as label */ + status = gpiod_request(desc, con_id ? con_id : dev_name(dev)); if (status < 0) return ERR_PTR(status); From patchwork Mon Mar 19 15:56:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132092 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp93791ljb; Mon, 19 Mar 2018 14:57:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELs3fCNe/Gkq7xoC3l5gwK1VlQFtqOLX474FeI3hIHFcgPQCsqviauVkrDM1RxgRoggbMb3C X-Received: by 10.101.67.198 with SMTP id n6mr10304724pgp.150.1521496637196; Mon, 19 Mar 2018 14:57:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521496637; cv=none; d=google.com; s=arc-20160816; b=KEy/LA23MRnoXcsHeNxBtM8dXCj1ipi7yhIeL0A1/TWBzAKly9ZTQiA2mEf+6yoo49 BqBKLPG8y4d2KGZ8Z3OKex4TcOewrbN/Vp6uPj7/0mQJ4q/6u9zC9jUHYgvD0++hdfH/ 1cHl35yRs5HDaQrtJ5f37mNWKy6y4u2z+G+3NH3NHcrGEwaG8APeJmosrnR3GDWbUyUu NVqJcAgvZMme4WGmmAdAD8vx442AJFnVEqd2nIm+cdkUEF4mKRBQ0tmjNRZA+SXIW/r/ w+yLRssjE0ZaabW7fg0lwtEjdKA/R4nlTIi3qVtNHJ6p3J0Gzx9cEq2qRfaBJrW15Tn3 +vow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=lP2+1JTv3hRcacjAquh492UERePxfateFV/k+apieqc=; b=CI0H2An3Hw9Mn6tlU37WJk89+WEguvt7l5Jzv1CHr9458iSaIQcRisAlJdVk/NcSkm 2deuQAnyvxmX8yr2d2mHRqOfkOPqVGOx0P9AR+KMRcP3QjcsDMw5vJmFN2VjRY3SUhE9 f/KcJipn1KtGs0DEe2PqPwffkISOPEZmWyvGWN8tOAzgxBgq2wSQgVKkzF766/ZlN6Ch Gt4O8+cmQ4iqT312AwuvjrwkM3dZRINDFqcM3OqH2NMr6zVf+FezLH0XDbJO9tsfrEwR +hBdB5y3zNgtHhIiRhwSxh6KjRhcSyEFOUvoBI0td1nQ8YLaVuUJ3c8kuHYCuzE+/GL1 4maA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=LWyY7EK6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9-v6si178066pls.108.2018.03.19.14.57.16; Mon, 19 Mar 2018 14:57:17 -0700 (PDT) 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=@microsoft.com header.s=selector1 header.b=LWyY7EK6; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S972092AbeCSV4k (ORCPT + 28 others); Mon, 19 Mar 2018 17:56:40 -0400 Received: from mail-by2nam01on0117.outbound.protection.outlook.com ([104.47.34.117]:58464 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934578AbeCSP4m (ORCPT ); Mon, 19 Mar 2018 11:56:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lP2+1JTv3hRcacjAquh492UERePxfateFV/k+apieqc=; b=LWyY7EK6J1xdT3FGq7zb9bffIJA6y5Sqtgl1pDFQLCF9QUij/RuJIKr1UeoAdbhdqokZRvr++vBYKYxCxuTOm38njTESbtWftyjBYd8FN9uo04vNm2v1v1oXdOsto1A3LKwELVuj424cWU7FgxMY4OeeflMzv4c1UI0gnWbsWiQ= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1031.namprd21.prod.outlook.com (52.132.128.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:56:36 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:56:36 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Paolo Valente , Davide Ferrari , Jens Axboe , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 73/97] block, bfq: put async queues for root bfq groups too Thread-Topic: [PATCH AUTOSEL for 4.14 73/97] block, bfq: put async queues for root bfq groups too Thread-Index: AQHTv5rK/0MSJyfMokSyZfQj+ha28A== Date: Mon, 19 Mar 2018 15:56:07 +0000 Message-ID: <20180319155411.12348-73-alexander.levin@microsoft.com> References: <20180319155411.12348-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155411.12348-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1031; 7:ResibTq1zWSMaKeJJxb2mX9aDgi6NU5rgZgPaFYHrwdqmbRikjJdMwtwD7xiitnyWkWpuXRd/nhjInfkuIDsZuXOLMNBS+RCxn03qVkhHtEuEc1eXQiBpsd0Tj1BsdXPFFn4DlTNKyIN0Sz6bEUT8zzq/PMhyDraFpcI3TMVwSYPeYKKcSOIl626mHW3TLnd97bAWVorzMJKxHcERvFMyApNEqXCmi1b5bU+xlVAVEX21+3ZvcAhMz6Bw0bqxRoj; 20:ILYIjLPyJlTvLbB6SytCWwtLQ0FmHjL0LZ4jpWSxyp8kcy1GbZ2nrNYb1rVDnWA6VKMmz8bDBY5v84wVecH+MxzSx0xlgpSie9ZMXwwSvC4VLZRrjBVZvvCWIUmzqa7oq879NeN/w/8GP3BwwUuag2b/hvTdK5PC6mTUKmLuII4= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3db20565-1bbf-4b55-af22-08d58db1feec x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1031; x-ms-traffictypediagnostic: DM5PR2101MB1031: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231221)(944501300)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:DM5PR2101MB1031; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1031; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(366004)(346002)(396003)(39860400002)(39380400002)(199004)(189003)(25786009)(6506007)(59450400001)(66066001)(99286004)(76176011)(10290500003)(54906003)(68736007)(3660700001)(97736004)(22452003)(107886003)(53936002)(86362001)(110136005)(2501003)(5250100002)(86612001)(14454004)(478600001)(72206003)(316002)(102836004)(26005)(186003)(6116002)(3846002)(7736002)(39060400002)(2950100002)(10090500001)(6436002)(3280700002)(6512007)(6666003)(2900100001)(8676002)(8936002)(36756003)(106356001)(105586002)(4326008)(5660300001)(305945005)(1076002)(81156014)(6486002)(81166006)(2906002)(22906009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1031; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JenArAywIeZBV9cNkpoJZoKjWt5L1BsL6JTkda1qkiXuO/jC0zYyP4De/3H3wFhrU7ORtG47MfppHO6uEntEFCF19wJ4TvfAvODdkJNbGCAh+3Cenc9bMzymkFyglMsvHCJ0SvPsJ/yruZMgMoKT9rkkZOs5bHHjppqHmgHeoxU75wSZgEdLV2oGQD0dRrUXVx7S40iBG4OgaLD8EoF4XDhFsjtwL8o2SiBqX4fpGyyOPIhJtBiABbjqPLSOr8Syhog27JLXqtPEBre6q9/huEZKVZOcPnNMK81r6FfdMExzoi1lL4FtZZTwW4s2/oz4Pq94TbBZHgaBNtOskpL9yQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3db20565-1bbf-4b55-af22-08d58db1feec X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:56:07.0495 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1031 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Valente [ Upstream commit 52257ffbfcaf58d247b13fb148e27ed17c33e526 ] For each pair [device for which bfq is selected as I/O scheduler, group in blkio/io], bfq maintains a corresponding bfq group. Each such bfq group contains a set of async queues, with each async queue created on demand, i.e., when some I/O request arrives for it. On creation, an async queue gets an extra reference, to make sure that the queue is not freed as long as its bfq group exists. Accordingly, to allow the queue to be freed after the group exited, this extra reference must released on group exit. The above holds also for a bfq root group, i.e., for the bfq group corresponding to the root blkio/io root for a given device. Yet, by mistake, the references to the existing async queues of a root group are not released when the latter exits. This causes a memory leak when the instance of bfq for a given device exits. In a similar vein, bfqg_stats_xfer_dead is not executed for a root group. This commit fixes bfq_pd_offline so that the latter executes the above missing operations for a root group too. Reported-by: Holger Hoffstätte Reported-by: Guoqing Jiang Tested-by: Holger Hoffstätte Signed-off-by: Davide Ferrari Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bfq-cgroup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.14.1 diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index ceefb9a706d6..5d53e504acae 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -749,10 +749,11 @@ static void bfq_pd_offline(struct blkg_policy_data *pd) unsigned long flags; int i; + spin_lock_irqsave(&bfqd->lock, flags); + if (!entity) /* root group */ - return; + goto put_async_queues; - spin_lock_irqsave(&bfqd->lock, flags); /* * Empty all service_trees belonging to this group before * deactivating the group itself. @@ -783,6 +784,8 @@ static void bfq_pd_offline(struct blkg_policy_data *pd) } __bfq_deactivate_entity(entity, false); + +put_async_queues: bfq_put_async_queues(bfqd, bfqg); spin_unlock_irqrestore(&bfqd->lock, flags); From patchwork Mon Mar 19 15:56:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 132091 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp93166ljb; Mon, 19 Mar 2018 14:56:18 -0700 (PDT) X-Google-Smtp-Source: AG47ELsoZP96QNz+mEnOyN9dpaKrotwzbSfvYBSVp0Dp8YTWFOvFfvyhYGX3ksMEEa67X2Tt5rxy X-Received: by 10.99.110.133 with SMTP id j127mr10343382pgc.79.1521496578210; Mon, 19 Mar 2018 14:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521496578; cv=none; d=google.com; s=arc-20160816; b=kHoQM95qSuMHuBgdI58HYdPxKAPkCdk07kIZ3EVPdjMPhV4nLXRUqXRz02Fhijk95h f0TljWEPxS99ejTUMlXmd5cD+jU2Fg9zLsI1YRu03oaYNRfucEl2JADlAzn7kXk5g7Y5 zqbyjVtTRAd5+tMErClBbRKfMFdGrffADVPRhi130kGc6gVnDJJdAyJZY+rRQ1GAAlZf zRB5MceDrRAkPbgNC/QDw418TZDwadhp/ZmRsPJWWjYsgoplcoEvAzAcUDJTnzyQCd1N JO0E9hqr4+RUptivSpvoq6MKlFHVXq/AXaGTnORAwjHajQs0N4KDkB0IeVXv45nUPxIp VqRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=NVIGv5mmXsOfVrw7hD6JUTB4zIjRB/twT7NaoOJhcKs=; b=sOnwlN+BGIl/RWNF0mo/+ossJkjTwD8m4w0YxrNC+YEzHZFGB4rcZ4peomnLpEa0oC AHXM0Q3uRQBuWm4nzfFsXCQxMMt6hfVVwg+e4odoloOcmOjGm/nSkEkCJktDB1evcD3T 5v/9fjI0rWJo3l0gRFbZYdiv0BjDMerdMaoMDZJTGe3IETw04NgqAMIhyoSX5aQfAuHs 91+HNgqDzOC80ID8lpj9fUjxrGIKkrA2CJbWH7/Lrw72KnsuU9EkYiW34TVM0FyppHUM 7ZLPcM0bLeZP5iL7NWy7lgzUadmCskD1s5XH+2O03wT9z0MswhRFEqpGNvkZv5+YoBhW BO9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=bMEQ8VPr; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u45si123871pgn.702.2018.03.19.14.56.17; Mon, 19 Mar 2018 14:56:18 -0700 (PDT) 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=@microsoft.com header.s=selector1 header.b=bMEQ8VPr; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S972085AbeCSV4P (ORCPT + 28 others); Mon, 19 Mar 2018 17:56:15 -0400 Received: from mail-sn1nam01on0113.outbound.protection.outlook.com ([104.47.32.113]:22624 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934264AbeCSP4z (ORCPT ); Mon, 19 Mar 2018 11:56:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NVIGv5mmXsOfVrw7hD6JUTB4zIjRB/twT7NaoOJhcKs=; b=bMEQ8VPrJ4jOIX0PQAK7qYVLg//sZyDyIHPrJNbFZ7Zp0Na7fTPt2JGJxMbo9xWLvX0IXIEvZaFQQjFWvUbA/mD2BeRxn3rAKW2f9LGwXpBF8RhyxDQYHe7e5s1fjA5TxPhwGnnnG/He9RyaI9lW+YAeY78iWbahZYzh2Jz4NTM= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1064.namprd21.prod.outlook.com (52.132.130.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:56:48 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:56:48 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Arnd Bergmann , Richard Biener , Jakub Jelinek , Ard Biesheuvel , Herbert Xu , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 88/97] crypto: aes-generic - build with -Os on gcc-7+ Thread-Topic: [PATCH AUTOSEL for 4.14 88/97] crypto: aes-generic - build with -Os on gcc-7+ Thread-Index: AQHTv5rW5wqS8worIUGxKFwE10/18A== Date: Mon, 19 Mar 2018 15:56:27 +0000 Message-ID: <20180319155411.12348-88-alexander.levin@microsoft.com> References: <20180319155411.12348-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155411.12348-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DM5PR2101MB1064; 7:BH3DrWBQlO9Uv76BKgUFp65lym5VHgEKLYal6n/Mz2nhckFmQ1gzNcwwfirUBR6qoAM+vx6pdDTopa2fGBT4HmLAj6M+H2Y5J9tFIqNUlMw35D1sdBULKy6GJOOJk00Vov4YiwI05hsmq/UxNiMBETgx0lzjoI6Q4ZR7gzskFYtK+GfpxvcBe7KCBtj0rejUMLKBgRljn13mmH1OXUU/+7e/7sPOia+t2Je1gV67JNVnYQR0NC9n8010psp8j2aC; 20:pp/wmA0foSeLPaIXbkRl5aBrhG57RIShOhVtH/Jg8ya+u0b9U2C9nsdhbh8hxRtsC6MOQRheOV2Cjoajqm766lqS+sZ/1hSq0+YOVekbsB5m3IQj5xk5v/59nonkF0xZlezkfjj8//eqH2Xm8RZy21K0fAy1JqbcZ2ZvZcTD28c= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 25e0909d-7922-4599-9ec6-08d58db205d8 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:DM5PR2101MB1064; x-ms-traffictypediagnostic: DM5PR2101MB1064: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(22074186197030)(89211679590171)(183786458502308); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DM5PR2101MB1064; BCL:0; PCL:0; RULEID:; SRVR:DM5PR2101MB1064; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(39860400002)(366004)(39380400002)(376002)(346002)(199004)(189003)(1076002)(106356001)(316002)(36756003)(76176011)(8936002)(81156014)(81166006)(22452003)(8676002)(3660700001)(59450400001)(2906002)(2900100001)(97736004)(305945005)(7736002)(53936002)(3280700002)(5660300001)(99286004)(107886003)(2501003)(966005)(5250100002)(6666003)(2950100002)(10290500003)(25786009)(72206003)(3846002)(478600001)(54906003)(6116002)(4326008)(105586002)(14454004)(110136005)(6512007)(6506007)(10090500001)(102836004)(66066001)(68736007)(186003)(86612001)(6486002)(26005)(6436002)(86362001)(6306002)(22906009)(41533002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR2101MB1064; H:DM5PR2101MB1032.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: MvkFMFH9ztT1spnrWeu6fJNKrtHtIjbLQkWQA+9kmgdwTjv1RA/1VvCFIrK6jm0blIUuvWV6pagHN9B0Oghy4MLUdEbZLhKLRWM8plxh7gGSNzCqjYuSLHg4tUjxRD1xwATP0T49AajS7H/qPLPYLKdLkCY/ELx/qU9bKsUn09ptJMMtU/RLhoScww56iERTlA/izU/UhjyI9gjWoLWZxbW+bk3InrDYphOP9vCs8rxMeefrbpxp6+ex8BcquhCC6rrhqyORvhAEpz2WXMHq2M5Cvxwp8LHVSa7aUA0ev1JA45AECtijSS1lcrDwDUDTZTeNt5BNUn/A0Zu++Em6Ww== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25e0909d-7922-4599-9ec6-08d58db205d8 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:56:27.6537 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1064 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann [ Upstream commit 148b974deea927f5dbb6c468af2707b488bfa2de ] While testing other changes, I discovered that gcc-7.2.1 produces badly optimized code for aes_encrypt/aes_decrypt. This is especially true when CONFIG_UBSAN_SANITIZE_ALL is enabled, where it leads to extremely large stack usage that in turn might cause kernel stack overflows: crypto/aes_generic.c: In function 'aes_encrypt': crypto/aes_generic.c:1371:1: warning: the frame size of 4880 bytes is larger than 2048 bytes [-Wframe-larger-than=] crypto/aes_generic.c: In function 'aes_decrypt': crypto/aes_generic.c:1441:1: warning: the frame size of 4864 bytes is larger than 2048 bytes [-Wframe-larger-than=] I verified that this problem exists on all architectures that are supported by gcc-7.2, though arm64 in particular is less affected than the others. I also found that gcc-7.1 and gcc-8 do not show the extreme stack usage but still produce worse code than earlier versions for this file, apparently because of optimization passes that generally provide a substantial improvement in object code quality but understandably fail to find any shortcuts in the AES algorithm. Possible workarounds include a) disabling -ftree-pre and -ftree-sra optimizations, this was an earlier patch I tried, which reliably fixed the stack usage, but caused a serious performance regression in some versions, as later testing found. b) disabling UBSAN on this file or all ciphers, as suggested by Ard Biesheuvel. This would lead to massively better crypto performance in UBSAN-enabled kernels and avoid the stack usage, but there is a concern over whether we should exclude arbitrary files from UBSAN at all. c) Forcing the optimization level in a different way. Similar to a), but rather than deselecting specific optimization stages, this now uses "gcc -Os" for this file, regardless of the CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE/SIZE option. This is a reliable workaround for the stack consumption on all architecture, and I've retested the performance results now on x86, cycles/byte (lower is better) for cbc(aes-generic) with 256 bit keys: -O2 -Os gcc-6.3.1 14.9 15.1 gcc-7.0.1 14.7 15.3 gcc-7.1.1 15.3 14.7 gcc-7.2.1 16.8 15.9 gcc-8.0.0 15.5 15.6 This implements the option c) by enabling forcing -Os on all compiler versions starting with gcc-7.1. As a workaround for PR83356, it would only be needed for gcc-7.2+ with UBSAN enabled, but since it also shows better performance on gcc-7.1 without UBSAN, it seems appropriate to use the faster version here as well. Side note: during testing, I also played with the AES code in libressl, which had a similar performance regression from gcc-6 to gcc-7.2, but was three times slower overall. It might be interesting to investigate that further and possibly port the Linux implementation into that. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83651 Cc: Richard Biener Cc: Jakub Jelinek Cc: Ard Biesheuvel Signed-off-by: Arnd Bergmann Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- crypto/Makefile | 1 + 1 file changed, 1 insertion(+) -- 2.14.1 diff --git a/crypto/Makefile b/crypto/Makefile index da190be60ce2..adaf2c63baeb 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -98,6 +98,7 @@ obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 obj-$(CONFIG_CRYPTO_AES) += aes_generic.o +CFLAGS_aes_generic.o := $(call cc-ifversion, -ge, 0701, -Os) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 obj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o