lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 24 Jun 2021 15:14:17 +0900
From:   Kwon Tae-young <tykwon@....co.kr>
To:     Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Kwon Tae-young <tykwon@....co.kr>, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] mmc: core: Added support for LED trigger only when SD card is connected

led_trigger_event() is always called.
In this case, if the LED trigger is set to the SD Card, the trigger
will occur even when the SD card is not connected and the LED will blink.

In case of SD Card, it is judged based on Card Detection information and
changes to generate LED trigger only when SD Card is connected.

Board tested: NXP i.MX 8M board

Signed-off-by: Kwon Tae-young <tykwon@....co.kr>
---
 drivers/mmc/core/core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index f194940c5974..b3156f6c5cfa 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -352,7 +352,11 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
 	if (err)
 		return err;
 
-	led_trigger_event(host->led, LED_FULL);
+	if (host->ops->get_cd)
+		host->ops->get_cd(host) ? led_trigger_event(host->led, LED_FULL) : NULL;
+	else
+		led_trigger_event(host->led, LED_FULL);
+
 	__mmc_start_request(host, mrq);
 
 	return 0;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ