From patchwork Thu Feb 4 23:30:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 44577 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4F729B6F08 for ; Fri, 5 Feb 2010 10:36:30 +1100 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NdBCw-0008Sx-PE; Thu, 04 Feb 2010 23:33:58 +0000 Received: from mail-fx0-f228.google.com ([209.85.220.228]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NdBAf-0007DH-2N for linux-mtd@lists.infradead.org; Thu, 04 Feb 2010 23:31:43 +0000 Received: by fxm28 with SMTP id 28so3537900fxm.20 for ; Thu, 04 Feb 2010 15:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=ylSmxk9LUSw6EjNRf07HYr0W+enFhgP+74vK2IVHuMU=; b=UT4L6pXwygOK9Gnmq21sgeg/Q2sz2dkoI8Fu6/a6WwfM2Ws6nDwrV09XznJwmp+GDS 4fUZuNoI6+KLQbdx5dbGaPhnZ6QPiNl+y9HKmyq7EQ9wRNsBBWqc/4DO2IglTNVTBSyq wULWbfUiSZFGrXlYD4oWwazi9bFQcvisvOvnw= 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=cxzEFaF0hnbvmyXYO+kkzafS64rgHMQqVYy84Eb5LlhNqdjAVm8FwhqRnKy1Lmv17N KMdqefZZJWT4QUaduSBMC3eBxtmrORkwGGchDKzmH6HufKOSDanZZL6LzUceU38a2KEP Foww7FR+I+n2ONuWT1UD/kMii7KYUuRB+Mh3U= Received: by 10.102.204.2 with SMTP id b2mr1197128mug.80.1265326296250; Thu, 04 Feb 2010 15:31:36 -0800 (PST) Received: from localhost.localdomain (IGLD-84-229-248-49.inter.net.il [84.229.248.49]) by mx.google.com with ESMTPS id u9sm3865749muf.18.2010.02.04.15.31.34 (version=SSLv3 cipher=RC4-MD5); Thu, 04 Feb 2010 15:31:35 -0800 (PST) From: Maxim Levitsky To: David Woodhouse Subject: [PATCH 12/17] MTD: nand: make suspend work if device is accessed by kernel threads. Date: Fri, 5 Feb 2010 01:30:52 +0200 Message-Id: <1265326257-4446-13-git-send-email-maximlevitsky@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1265326257-4446-1-git-send-email-maximlevitsky@gmail.com> References: <1265326257-4446-1-git-send-email-maximlevitsky@gmail.com> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100204_183137_418914_8FBC8658 X-CRM114-Status: GOOD ( 14.88 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.2.5 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- _SUMMARY_ Cc: Maxim Levitsky , Alex Dubov , Artem Bityutskiy , joern , linux-kernel , linux-mtd , Thomas Gleixner X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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);