From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gw1.transmode.se ([213.115.205.20]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1PlJCF-0000Hc-8w for linux-mtd@lists.infradead.org; Fri, 04 Feb 2011 10:47:24 +0000 In-Reply-To: <4D4B37D4.4050204@keymile.com> References: <16826B66-31FE-41AD-A6EF-E668A45AF1FE@prograde.net> <25631ED7-C6A0-44B1-B33D-F48DC48C812E@prograde.net> <626D0191-85FC-41E2-94C7-CBFF9D9629BE@prograde.net> <6FC0E416-EEBD-453F-AAB9-88BB6D90BFAB@prograde.net> <4D4AD9ED.8060104@keymile.com> <4D4B37D4.4050204@keymile.com> Subject: Re: Numonyx NOR and chip->mutex bug? To: stefan.bigler@keymile.com Message-ID: From: Joakim Tjernlund Date: Fri, 4 Feb 2011 11:47:19 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Cc: linux-mtd@lists.infradead.org, Holger brunck , Michael Cashwell List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Stefan Bigler wrote on 2011/02/04 00:18:44: > > Hi > > Now I have a patch that fix my problem. I did not yet do a lot of tests > and I did > not yet analyzed correctness in all cases. > I check in the inval_cache_and_wait_for_operation() of the status is > status_OK > the if the chip->state and the chip_state (the current chip state and > the chip state > when the function is called) are equal or not. If equal break and exit > (set the > chip->state= FL_STATUS) and if not equal add the thread in the wait queue. > > I think we are not finished when not equal so we have do not have to > take the mutex. > > Now why this code worked with the older Flash chips. I don't know, but > eventually > they are slower after the write buffer command 0xe8 and they are still > busy when > inval_cache_and_wait_for_operation() checks if status_OK. > Tomorrow I'll check if this is the case. Now I do not have access to the HW. > > Regards Stefan I havn't looked into this but I think I would rather see something like: - if (map_word_andequal(map, status, status_OK, status_OK)) + if (map_word_andequal(map, status, status_OK, status_OK) && + (chip->state == chip_state)) Does this work for you too? Jocke