Received: by 10.223.176.5 with SMTP id f5csp891590wra; Sat, 3 Feb 2018 12:43:12 -0800 (PST) X-Google-Smtp-Source: AH8x226SAJ60rUzHDtRf/o0OI2eEg+FxW5GlFywSp5kteZBb8q7WelcbTxxZTWOZvuLhYL/3XHSS X-Received: by 2002:a17:902:7581:: with SMTP id j1-v6mr17499571pll.86.1517690592485; Sat, 03 Feb 2018 12:43:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517690592; cv=none; d=google.com; s=arc-20160816; b=u4fFtowsrqT8O6iJlxxqBo2bpN5alMe3wRtthE81e5uhFGeqNYMRo36HiE5KunUGJr 3He6eHNzPECzW6eL5gMMSZczScAmHydplWTNts0MtJG1ef2StKEMvDkHmH/82fM3TAKk ImpwJP5s8mSW4PFuX/3qMOI5gG91LCCLWffOpU4L6Jxp6aPk+wGAeDYypfCCmE4cf139 7LDEcEFgFPs9BJZQSX1OzcjwjHZLKXJssCkqp8lv7MuJr+Xy5rW74sBnn/VZ4fUQM6ce 2wbiVJ/aUZeL96H6s15MtIR5IGicLevMKJIIx7gmLTmne9e2xEcEjj5vPZDaUbWk67OH 8h0Q== 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=FaLwfX4BzormDuOd5QxJoHMI4j1BxYGqBXbZLvHIKEA=; b=j0WQRZWo3cDx9d9LKzhjf6QBofuR5dxQ+2lU5XcX7hGxZ+rlpyEn1w5XCJazqpjePB 1spzh+7h2DdjUkHEo/gsjeDBbEu2DwwQk6dfsAqjy1Z/bE6Gb2KKA6F09dPx1KrF7jEP UBmpeTyei/amwS+/ONo2biCmk6NjJ4fWeKdE7g+uOtgidYzJ4fXPvIGCj2Aa08Z7lPJx MbBW/V4M2fL0L/vOZ1vxFAVCxobAVY2kwduK9qim3UQhdaK81hYKryvfegIvA0gDCiC5 hFgz8quqN6jh03j1M0sbpwy7ZQPrd3SLNdLcVOgTo6AV2E/Y6aWI1kDuBzf1ChxieLl8 I7tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=md3SRhDe; 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 c193si1768589pfc.90.2018.02.03.12.42.58; Sat, 03 Feb 2018 12:43:12 -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=@microsoft.com header.s=selector1 header.b=md3SRhDe; 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 S1754656AbeBCS3d (ORCPT + 99 others); Sat, 3 Feb 2018 13:29:33 -0500 Received: from mail-bl2nam02on0109.outbound.protection.outlook.com ([104.47.38.109]:45293 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753039AbeBCSFA (ORCPT ); Sat, 3 Feb 2018 13:05:00 -0500 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=FaLwfX4BzormDuOd5QxJoHMI4j1BxYGqBXbZLvHIKEA=; b=md3SRhDeQptUk5Umvp+35JXz4Sjgz60ZV6Fg2LVildaxfKe3FsXtlshxt4zU8faSxj8MSGhM3N30CPkyc5VsSvgPujx6CwGeKailfYL0Zc6pACHRjRB7SFdplzCh/cp3hYxCZNKKdN9i8q9M16sAmge/QQz/d0OwhW+8OUj3bsM= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1041.namprd21.prod.outlook.com (52.132.23.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.506.3; Sat, 3 Feb 2018 18:02:48 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:48 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jacek Anaszewski , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 094/110] leds: core: Fix regression caused by commit 2b83ff96f51d Thread-Topic: [PATCH AUTOSEL for 4.14 094/110] leds: core: Fix regression caused by commit 2b83ff96f51d Thread-Index: AQHTnRkDfUnjDm9BfEW/CBSMf+PRKg== Date: Sat, 3 Feb 2018 18:01:28 +0000 Message-ID: <20180203180015.29073-94-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-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;BL0PR2101MB1041;7:tt3oQfYjUD7IBr1+evj2t2OrLRgHyKcW8w1qvEj6bFaDJEf0gwrhgj8CU2DiS+ktKduJ95p1bsXm6ZfFObFuQDvO4xML77kFor0TOqdWSY+LFKI3cHFU6Wh93v3CsVCoar8lTCnn4P/WwSLOGen3xgsGSCJeUVmQBtp3l15MkepTxXz/6qRekdmhnNbAORwolfFglAWDueTpgaYK1oeenHUvkVBk9ac1KYU48lED8LyXCtzlO+uZcdNRbpC5Oi0T x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 214a1a50-65e7-42c3-fff4-08d56b3055bb x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1041; x-ms-traffictypediagnostic: BL0PR2101MB1041: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3231101)(2400082)(944501161)(93006095)(93001095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011);SRVR:BL0PR2101MB1041;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1041; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(366004)(39860400002)(376002)(346002)(189003)(199004)(2501003)(305945005)(3660700001)(5250100002)(81156014)(99286004)(81166006)(36756003)(7736002)(10290500003)(106356001)(53936002)(5660300001)(316002)(22452003)(8936002)(54906003)(110136005)(3280700002)(478600001)(72206003)(4326008)(39060400002)(25786009)(107886003)(102836004)(97736004)(76176011)(59450400001)(6666003)(66066001)(6506007)(2950100002)(2900100001)(68736007)(8676002)(6116002)(3846002)(186003)(1076002)(6346003)(105586002)(26005)(10090500001)(2906002)(6512007)(86612001)(14454004)(86362001)(6436002)(6486002)(22906009)(98903001)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1041;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: DqxZpaODTRY2K72lLzDaYvA3XnHRufh1eegJWR7gISuMc425XoSzh82LJCtxufWDGnUfv2itgQfJNjDJM5FwAA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 214a1a50-65e7-42c3-fff4-08d56b3055bb X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:28.1752 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1041 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jacek Anaszewski [ Upstream commit 7b6af2c53192f1766892ef40c8f48a413509ed72 ] Commit 2b83ff96f51d ("led: core: Fix brightness setting when setting delay_= off=3D0") replaced del_timer_sync(&led_cdev->blink_timer) with led_stop_software_blin= k() in led_blink_set(), which additionally clears LED_BLINK_SW flag as well as zeroes blink_delay_on and blink_delay_off properties of the struct led_clas= sdev. Cleansing of the latter ones wasn't required to fix the original issue but wasn't considered harmful. It nonetheless turned out to be so in case when pointer to one or both props is passed to led_blink_set() like in the ledtrig-timer.c. In such cases zeroes are passed later in delay_on and/or delay_off arguments to led_blink_setup(), which results either in stopping the software blinking or setting blinking frequency always to 1Hz. Avoid using led_stop_software_blink() and add a single call required to clear LED_BLINK_SW flag, which was the only needed modification to fix the original issue. Fixes 2b83ff96f51d ("led: core: Fix brightness setting when setting delay_o= ff=3D0") Signed-off-by: Jacek Anaszewski Signed-off-by: Sasha Levin --- drivers/leds/led-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index af630c11c284..9ce6b32f52a1 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c @@ -187,8 +187,9 @@ void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off) { - led_stop_software_blink(led_cdev); + del_timer_sync(&led_cdev->blink_timer); =20 + clear_bit(LED_BLINK_SW, &led_cdev->work_flags); clear_bit(LED_BLINK_ONESHOT, &led_cdev->work_flags); clear_bit(LED_BLINK_ONESHOT_STOP, &led_cdev->work_flags); =20 --=20 2.11.0