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>] [day] [month] [year] [list]
Message-ID: <4FA7B184.7080806@ammonit.com>
Date:	Mon, 07 May 2012 13:27:00 +0200
From:	Steffen Kühn <sk@...onit.com>
To:	nicolas.ferre@...el.com
CC:	linux-kernel@...r.kernel.org
Subject: [PATCH] solve deadlock problem in atmel-mci (kernel 3.2)

Dear Nicolas,

the appended patch solves a deadlock problem which appears when a SD
card is removing and a process is reading from the card at the same
time. The problem occurs not always but only when there are
error-messages like 'end_request: I/O error, dev mmcblk0, sector XXX'
(probably a timing thing).

When the error occurs, the autodetection for SD card insertion does not
work anymore and unloading of the driver with 'rmmod' is no longer possible.

The patch seems to work very well with our hardware. But I have to say,
that I have not understand the mechanisms in the driver entirely. Please
check, if the patch make sense.

Best regards,
Steffen



diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 94c377d..407648f 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1480,8 +1480,10 @@ static void atmci_tasklet_func(unsigned long priv)
 			}

 			if (!atmci_test_and_clear_pending(host,
-						EVENT_XFER_COMPLETE))
+						EVENT_XFER_COMPLETE)) {
+				host->stop_transfer(host);
 				break;
+			}

 			atmci_set_completed(host, EVENT_XFER_COMPLETE);
 			prev_state = state = STATE_DATA_BUSY;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ