From owner-freebsd-embedded@FreeBSD.ORG Sun Mar 14 07:58:31 2010 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 448D9106564A for ; Sun, 14 Mar 2010 07:58:31 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 11F5B8FC13 for ; Sun, 14 Mar 2010 07:58:31 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8FA8CE577B; Sun, 14 Mar 2010 03:58:30 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 14 Mar 2010 03:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=date:from:to:cc:subject:message-id:in-reply-to:references:mime-version:content-type:content-transfer-encoding; s=smtpout; bh=AISuPADFqIbRHzkzwsEIV8FleoI=; b=hAGTKrNS0inK7FHsUOvJA1/TFATf7eqyLNT1ZA1yCut8vb4ApCexDk/B6X5Z5zA2AtgmnEpWYQ1DLWEAB9noY77UiZo0wHInPJ25h2nPbZQZLCBzSfau12Vxe2aRuEUfj3o0bjdhqx5isnhQW2nCIcgMBTzxZW6Z6RE1DLihvBE= X-Sasl-enc: fCMU/BFe+d5vBIwA0Vapo2uuVMM+KTc2ePhzqH7LQufG 1268553509 Received: from localhost (197.214.32.202.bf.2iij.net [202.32.214.197]) by mail.messagingengine.com (Postfix) with ESMTPA id 2131C51FC; Sun, 14 Mar 2010 03:58:28 -0400 (EDT) Date: Sun, 14 Mar 2010 16:58:25 +0900 From: Andrew Turner To: Rafal Jaworowski Message-ID: <20100314165825.121d346b@fubar.geek.nz> In-Reply-To: <0AE04EFA-A3EB-4939-BD81-607C00355B67@semihalf.com> References: <0AE04EFA-A3EB-4939-BD81-607C00355B67@semihalf.com> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd8.0) X-Pirate: Arrrr Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Grzegorz Bernacki , embedded@freebsd.org, loos.br@gmail.com Subject: Re: NAND Flash Framework for review X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Mar 2010 07:58:31 -0000 On Tue, 9 Mar 2010 00:28:53 +0100 Rafal Jaworowski wrote: > We are looking for review, comments and any other feedback. Below is my first set of notes from reading the code. I haven't ported the driver to my hardware yet so these are only from using with nandsim. Chip drivers: - lnand and snand have magic numbers to figure out which drive to use. We should move these to a flag in the chip parameters. - nand_read_pages should be a device method so we can customise how we handle reading of pages. - Split nand_generic into separate files with different device options so we can compile only the one we need. - nand_generic.c should be split into multiple files to allow us to support only the chips we have. nandbus: - nandbus should not know what commands to send to nand chips. These requests should be moved up to the chip driver. - Why is nandbus not exposing it's interface via NEWBUS? - Where is nandbus_destroy used? - Why is malloc called with M_NOWAIT when allocating the nandbus ivar? - What should happen when nandbus_send_command, nandbus_send_address, nandbus_start_command, nandbus_read_buffer or nandbus_write_buffer fail? - Why does nandbus need to know if we are an ONFi part or not? We can push the check into the onand driver's probe function. nandsim: - nandsim sample config has invalid time values (too small. - There is a kernel crash in nandsim_log. General: - malloc with M_WAITOK will always succeed, no need to check return value. - Should define our own malloc type. Ideas: - Can we move ecc and bbt handling into GEOM? This will allow us to bypass them when required. Andrew