From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shaun Tancheff Subject: Re: [PATCH v6 2/4] Add support for SCT Write Same Date: Thu, 25 Aug 2016 02:31:22 -0500 Message-ID: References: <20160822042321.24367-1-shaun@tancheff.com> <20160822042321.24367-3-shaun@tancheff.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Tom Yan Cc: Shaun Tancheff , linux-ide@vger.kernel.org, LKML , Tejun Heo , Christoph Hellwig , "Martin K . Petersen" , Damien Le Moal , Hannes Reinecke , Josh Bingaman , Hannes Reinecke List-Id: linux-ide@vger.kernel.org On Thu, Aug 25, 2016 at 1:23 AM, Tom Yan wrote: > You only fill the bytes that you want to to set explicitly: > > + put_unaligned_le16(0x0002, &sctpg[0]); /* SCT_ACT_WRITE_SAME */ > + put_unaligned_le16(0x0101, &sctpg[1]); /* WRITE PTRN FG */ > + put_unaligned_le64(lba, &sctpg[2]); > + put_unaligned_le64(num, &sctpg[6]); > + put_unaligned_le32(0u, &sctpg[10]); > > What I doubted is, if you don't memset (zero-fill) the buffer first, > will other bytes have indeterministic value that causes random > unexpected behavior? No. If there is random or unexpected behaviour the device is broken and some other remedy, such as blacklisting, is required. --- Shaun