Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754036Ab0A3PFt (ORCPT ); Sat, 30 Jan 2010 10:05:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753823Ab0A3PFe (ORCPT ); Sat, 30 Jan 2010 10:05:34 -0500 Received: from fg-out-1718.google.com ([72.14.220.155]:61471 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753742Ab0A3PDX (ORCPT ); Sat, 30 Jan 2010 10:03:23 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=hquT4LihIAfudvYVnXJyXxnFdOn+ZED4+LQrvW2Kh5Y9EdLdKQdF4PhR4dXHQL+1/f Sogh1In8y9PTqGk+sVeaNJ78Cg+ibd8kugREaB5S7Dklz35aaMT9JCG194JqPqXr4d2W t2v5X+WFpKxp3ujMxcB0GY13rzJj61eawYVPk= From: Maxim Levitsky To: David Woodhouse Cc: Artem Bityutskiy , linux-mtd , linux-kernel , Alex Dubov , joern , Thomas Gleixner , Maxim Levitsky Subject: [PATCH 12/17] MTD: nand: make suspend work if device is accessed by kernel threads. Date: Sat, 30 Jan 2010 17:02:43 +0200 Message-Id: <1264863768-27606-13-git-send-email-maximlevitsky@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1264863768-27606-1-git-send-email-maximlevitsky@gmail.com> References: <1264863768-27606-1-git-send-email-maximlevitsky@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 34 Since all userspace threads are frozen at the time the nand_suspend is called, they aren't inside any nand function. We don't call try_to_freeze in nand ether. Thus the only user that can be insize the nand functions is an non freezeable kernel thread. Thus we can safely wait for it to finish. Signed-off-by: Maxim Levitsky --- drivers/mtd/nand/nand_base.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 29e986e..961c98f 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -744,9 +744,6 @@ nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state) chip->state = FL_PM_SUSPENDED; spin_unlock(lock); return 0; - } else { - spin_unlock(lock); - return -EAGAIN; } } set_current_state(TASK_UNINTERRUPTIBLE); -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/