From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932943Ab1III6J (ORCPT ); Fri, 9 Sep 2011 04:58:09 -0400 Received: from mx1.fusionio.com ([66.114.96.30]:56122 "EHLO mx1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933037Ab1III6H (ORCPT ); Fri, 9 Sep 2011 04:58:07 -0400 X-ASG-Debug-ID: 1315558685-03d6a5396cbb380001-xx1T2L X-Barracuda-Envelope-From: JAxboe@fusionio.com Message-ID: <4E69D519.8070802@fusionio.com> Date: Fri, 9 Sep 2011 10:58:01 +0200 From: Jens Axboe MIME-Version: 1.0 To: Christoph Hellwig CC: "Sam Bradshaw (sbradshaw)" , "alan@lxorguk.ukuu.org.uk" , "linux-ide@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Jeff Garzik , "jmoyer@redhat.com" , "Asai Thambi Samymuthu Pattrayasamy (asamymuthupa) [CONTRACTOR]" Subject: Re: [PATCH v4] drivers/block/mtip32xx: Adding new driver mtip32xx References: <22A973199D2C2F46933448F6E7990A3002C80026@ntxboimbx31.micron.com> <4E44E782.7090309@fusionio.com> <2A9BE4FF6209B644B6F8EB62DE6AEA1E07663ED4@ntxfrembx01.micron.com> <20110909085433.GA9593@infradead.org> X-ASG-Orig-Subj: Re: [PATCH v4] drivers/block/mtip32xx: Adding new driver mtip32xx In-Reply-To: <20110909085433.GA9593@infradead.org> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Barracuda-Connect: UNKNOWN[10.101.1.21] X-Barracuda-Start-Time: 1315558685 X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.74010 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2011-09-09 10:54, Christoph Hellwig wrote: > On Mon, Aug 22, 2011 at 02:28:11PM -0700, Sam Bradshaw (sbradshaw) wrote: >> New patch for mtip32xx driver based on feedback from >> Jens Axboe, Christoph Hellwig, and Alan Cox. > > A few comments that need addressing: > > - the ioctl handler always returns 0 for the BLKFLSBUF ioctl, without > doing anything. Given that the ioctl is supposed to flush all kinds > of higher level cached data this is a serious data integrity issue. > It must simply do the default -ENOTTY return for it and let the block > layer do the right thing. > - handling of REQ_FUA / REQ_FLUSH requests is completely broken. > There is a weird barrier flag to mtip_hw_submit_io which set the > hwardware FUA bit if the FLUSH bit is set on a request. > Please take a look at how this should be handled, the > Documentation/block/writeback_cache_control.txt file is the canonical > resource. Implementing your driver at the make_request layer > unfortunately means you will have to do all the hard work yourself. > - also the call to blk_queue_flush(queue, 0); from ->make_request for > a non-data request is completely wrong. I noticed both of these flush/fua problems too and have fixed them up. > - the 64-bit case in fill_command_sg will blow up on big endian > systems, please use your current 32-bit case unconditionally > - mtip_block_getgeo should just use sector_div instead of the ifdef > mess. > - please check the driver using sparse, and most importantly the > optional endianess checking pass of it. Currently the driver > uses plain unsigned int and similar types for little endian > hardware structures. Take a look at Documentation/sparse.txt > on how to use it. > - the mtip_check_surprise_removal check should be unconditional, not > under #ifdef CONFIG_HOTPLUG In general, the dependency on HOTPLUG_PCI_PCIE is odd as well. > - Given that the driver has a single c implementation file all symbols > should be marked static, and there should be no prototypes in the > header Sam, would be nice if you could send in patches for the other bugs that Christoph have pointed out. I already found and fixed the flush parts. -- Jens Axboe