From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [PATCH 4/4] ide: preserve Host Protected Area by default Date: Tue, 02 Jun 2009 23:12:15 +0400 Message-ID: <4A25798F.3030700@ru.mvista.com> References: <20090531143911.7164.26834.sendpatchset@localhost.localdomain> <20090531143939.7164.82399.sendpatchset@localhost.localdomain> <200906012333.29159.bzolnier@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from h155.mvista.com ([63.81.120.155]:27852 "EHLO imap.sh.mvista.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751131AbZFBTK5 (ORCPT ); Tue, 2 Jun 2009 15:10:57 -0400 In-Reply-To: <200906012333.29159.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Bartlomiej Zolnierkiewicz Cc: linux-ide@vger.kernel.org, "Andries E. Brouwer" , linux-kernel@vger.kernel.org, Robert Hancock , Al Viro , Frans Pop Hello. Bartlomiej Zolnierkiewicz wrote: >>From: Bartlomiej Zolnierkiewicz >>Subject: [PATCH] ide: preserve Host Protected Area by default >>>From the perspective of most users of recent systems, disabling Host >>Protected Area (HPA) can break vendor RAID formats, GPT partitions and >>risks corrupting firmware or overwriting vendor system recovery tools. >>Unfortunately the original (kernels < 2.6.30) behavior (unconditionally >>disabling HPA and using full disk capacity) was introduced at the time >>when the main use of HPA was to make the drive look small enough for the >>BIOS to allow the system to boot with large capacity drives. >>Thus to allow the maximum compatibility with the existing setups (using >>HPA and partitioned with HPA disabled) we automatically disable HPA if >>any partitions overlapping HPA are detected. Additionally HPA can also >>be disabled using the "nohpa" module parameter (i.e. "ide_core.nohpa=0.0" >>to disable HPA on /dev/hda). >>While at it: >>- remove stale "idebus=" entry from Documentation/kernel-parameters.txt >>Cc: Robert Hancock >>Cc: Frans Pop >>Cc: "Andries E. Brouwer" >>Cc: Al Viro >>[patch description was based on input from Alan Cox and Frans Pop] >>Signed-off-by: Bartlomiej Zolnierkiewicz Acked-by: Sergei Shtylyov > v2 interdiff > v2: > Fix ->resume HPA support. > diff -u b/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c > --- b/drivers/ide/ide-disk.c > +++ b/drivers/ide/ide-disk.c > @@ -433,8 +433,11 @@ > goto out; > > set = ide_disk_hpa_set_capacity(drive, set, lba48); > - if (set) > + if (set) { Well, this seems to be a useful check after all. :-) > + /* needed for ->resume to disable HPA */ > + drive->dev_flags |= IDE_DFLAG_NOHPA; > return set; > + } > out: > return drive->capacity64; > } MBR, Sergei