Received: by 10.223.176.5 with SMTP id f5csp809030wra; Sat, 3 Feb 2018 10:46:32 -0800 (PST) X-Google-Smtp-Source: AH8x2246JWjmfrIcubUUI1Zri7EGeD6Hj0SoAy2ecKwwpNOnMA8SRQrE5oqjbsx6zzuFeAGUW/DB X-Received: by 2002:a17:902:2468:: with SMTP id m37-v6mr29522698plg.149.1517683592242; Sat, 03 Feb 2018 10:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517683592; cv=none; d=google.com; s=arc-20160816; b=SByV1Nw0yI9gYJFnsZvvKgT9DwbtqPMp5QtvWQ0MeNIxjsBMJjXbHME50gkpDKt/gX cuYlgNDVGLIAxda+hWBNvOZrOlovfpA7GA1js9PhBBrGIovc6MVhY21UcR92VOB6eaZh kTsF3Y1r7SWk20aXSNoX0/vWnnjEiLxsLvN4uEaj9PpQ3OiLpvOQ37BJ+bZD56deZWRX 7XAozl+i1Xc5bP6hNXGGEElWicBQk3U5KZmENt3lAIXYp/Z0GDDKuC5f0q5AsT2kvp+4 qyS5tEe2jvEGXEbJ9gvSK4EliH03aSxiSM6uAhbPrCspvAyfpS8JMuKhPoyhBmnWC0kO sRNw== 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=dJasXMeycfFnWjeD8PY+5J6NT8IaQLYs2J69AR7CCEQ=; b=mrCekijia29eldJAKA3Hk521g3vzdKGBfl7f3Tz3aHaNn2cah4HzrnvEAHSZYRWLSC K/ICKa7o+Xs1i5rQf0jWY3Ifoksi9DiDkYtJQQ9/RHX72TdouPZGtubxxKu6QHICKXrt Wn089GdPsHkvZ8JEHjSPpKhpMqhOSErsvm+CiQ+NMNcldI/r2+G1HOo7vD8kKSe+fVxH mWcAvwXch00qLpzQJ24IoKO9R0BFAdU5bbnb9H0dqC6Ir7R0IrL/Sw8jSO8zm3P7fCjU /pYFXzw3xAb/RooTSSaExjKe1rT78B23XL0NHnCJ2hkQkWrP2nRfMEZjgzFFm20vDuh/ F9RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=dgvHL1La; 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 k189si1586345pgc.505.2018.02.03.10.46.17; Sat, 03 Feb 2018 10:46:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=dgvHL1La; 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 S1755278AbeBCSpZ (ORCPT + 99 others); Sat, 3 Feb 2018 13:45:25 -0500 Received: from mail-by2nam03on0111.outbound.protection.outlook.com ([104.47.42.111]:44500 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753157AbeBCSCx (ORCPT ); Sat, 3 Feb 2018 13:02:53 -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=dJasXMeycfFnWjeD8PY+5J6NT8IaQLYs2J69AR7CCEQ=; b=dgvHL1La2f4jK0euUPFj2Z8OLmfwnt3eSgZf03DqILdoODsfw1my7URRDmJgzwxNgi0wOELZPdp3eytmzyjI5GiV3lbvz/Q+gzyUBSmPhTW4/iC8V8gvvh8eN4/8rAtVE/EwEDb+2MgEZUEZMC+lYF0dpl7l5XXKdWImc81uNdo= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1105.namprd21.prod.outlook.com (52.132.24.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.485.5; Sat, 3 Feb 2018 18:02:04 +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:04 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Matthieu CASTET , "linux-leds@vger.kernel.org" , Jacek Anaszewski , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 065/110] led: core: Fix brightness setting when setting delay_off=0 Thread-Topic: [PATCH AUTOSEL for 4.14 065/110] led: core: Fix brightness setting when setting delay_off=0 Thread-Index: AQHTnRjyue81aK36CEu9eh05vWJz5Q== Date: Sat, 3 Feb 2018 18:00:59 +0000 Message-ID: <20180203180015.29073-65-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;BL0PR2101MB1105;7:xlMB0UUuIoGAS9iADOX+8IrmKFul4aSOyIdTPGC77NJVmHb/ghECSl+TtFt6SQnv5bt0ME+xjYH1NT1oP9zXXxxZhW109Tgk2EOOe63zOXr5wnLX5Bu99YC9kswT76lEXRMgsi8OzXFOQlxGcH8lzvOrSq07D+hHw4YSfyFMLmbreYayHagrWy2HVTfU1G8UkPbh4HwUYwpE+qBwLzJNVtn7Y06Iz8UFDu7mhFUwMqaOh1iKHO5uybvV1kl/9TUD x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3dbc116f-b74e-41ba-52fd-08d56b303b89 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1105; x-ms-traffictypediagnostic: BL0PR2101MB1105: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(9452136761055)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(2400082)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:BL0PR2101MB1105;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1105; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39380400002)(39860400002)(346002)(376002)(199004)(189003)(6346003)(97736004)(6512007)(7736002)(26005)(305945005)(102836004)(105586002)(68736007)(5250100002)(8936002)(59450400001)(6486002)(6436002)(106356001)(6506007)(81166006)(81156014)(2501003)(2906002)(10090500001)(99286004)(66066001)(54906003)(6116002)(3846002)(36756003)(1076002)(8676002)(110136005)(575784001)(39060400002)(107886003)(72206003)(2950100002)(478600001)(10290500003)(22452003)(6666003)(5660300001)(2900100001)(4326008)(25786009)(14454004)(316002)(86362001)(53936002)(3280700002)(186003)(3660700001)(76176011)(86612001)(22906009)(21314002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1105;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX: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: a1UqKDT3gn8ZYDKxmRUwq3OICx1ZPUZyuAT7O5nflVdBA0G5pCm1GjOn84V1t43KySuM5a420Huyy1kPBOXpPA== 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: 3dbc116f-b74e-41ba-52fd-08d56b303b89 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:00:59.6596 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1105 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matthieu CASTET [ Upstream commit 2b83ff96f51d0b039c4561b9f95c824d7bddb85c ] With the current code, the following sequence won't work : echo timer > trigger echo 0 > delay_off * at this point we call ** led_delay_off_store ** led_blink_set *** stop timer ** led_blink_setup ** led_set_software_blink *** if !delay_on, led off *** if !delay_off, set led_set_brightness_nosleep <--- LED_BLINK_SW is set = but timer is stop *** otherwise start timer/set LED_BLINK_SW flag echo xxx > brightness * led_set_brightness ** if LED_BLINK_SW *** if brightness=3D0, led off *** else apply brightness if next timer <--- timer is stop, and will never = apply new setting ** otherwise set led_set_brightness_nosleep To fix that, when we delete the timer, we should clear LED_BLINK_SW. Cc: linux-leds@vger.kernel.org Signed-off-by: Matthieu CASTET Signed-off-by: Jacek Anaszewski Signed-off-by: Sasha Levin --- drivers/leds/led-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c index ef1360445413..af630c11c284 100644 --- a/drivers/leds/led-core.c +++ b/drivers/leds/led-core.c @@ -187,7 +187,7 @@ void led_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off) { - del_timer_sync(&led_cdev->blink_timer); + led_stop_software_blink(led_cdev); =20 clear_bit(LED_BLINK_ONESHOT, &led_cdev->work_flags); clear_bit(LED_BLINK_ONESHOT_STOP, &led_cdev->work_flags); --=20 2.11.0