From: Lukasz Majewski Date: Fri, 27 Jul 2012 12:38:32 +0200 Subject: [U-Boot] [PATCH 0/2] New abstraction layer for handling MMC and FAT commands In-Reply-To: <20120727092914.387C3200347@gemini.denx.de> References: <1343378116-5569-1-git-send-email-l.majewski@samsung.com> <20120727092914.387C3200347@gemini.denx.de> Message-ID: <20120727123832.69195dcd@amdc308.digital.local> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang Denk, > Dear Lukasz Majewski, > > In message <1343378116-5569-1-git-send-email-l.majewski@samsung.com> > you wrote: > > New abstraction layer for performing MMC and FAT operations has > > been added. It is necessary for using MMC and FAT operations from > > other subsystems without the need to call "sprintf" and > > "run_command" afterwards. > > > > MMC/FAT function call allows for better type checking during > > compilation time. For FAT, common code has been encapsulated to a > > separate function. > > > > Lukasz Majewski (2): > > mmc: New abstract function (do_mmcops_safe) for MMC subsystem > > fat: New abstract function (do_fat_safe) for FAT subsystem > > Sorry if I don't understand, but what exactly is special with MMC and > FAT here? Those patches are a follow up of a discussion about DFU support in u-boot. "[PATCH 4/7] dfu: MMC specific routines for DFU operation" http://article.gmane.org/gmane.comp.boot-loaders.u-boot/134401/match=dfu+mmc+specific+routines+dfu+operation In short - during this discussion it has been suggested, that sprintf() + run_command() call shall be replaced with a "_safe" function call, which decouples "real" e.g. MMC write from parsing user data from prompt. > > Why are the same changes as to the MMC code not also needed for > example for the IDE, SATA, SCSI or USB code? I need the FAT and MMC for DFU patches, on which I work now. Those patches (actually v2) have already been posted to ML and are under review. > > Why are the same changes as for FAT not also needed for the other file > systems? It is because DFU is not supporting other file systems for now. I only changed the code which I use. > > > And what exactly are you changing anyway? The commit messages in the > patches give neither sufficient information to understand why you make > a change at all, nor how the new code is supposed to be used, nor in > which way he is better ("more safe" ?) than the existing code? The problem is as follows: 1. DFU patches requires access to FAT and MMC 2. I'm using sprintf() + run_command() approach to execute e.g. "mmc write 0x44000000 60 100" to store data from DFU in a proper place. 3. The approach presented at 2. was under discussion on ML. Reviewers suggested, that run_command() approach is unsafe and for compilation time type checking I shall write mmc with using special "_safe" function. For more details, please visit link, which I've posted. In this discussion we are arguing about pros and cons of using sprintf + run_command approach. -- Best regards, Lukasz Majewski Samsung Poland R&D Center | Linux Platform Group