aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-gd.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-09-22const: make block_device_operations constAlexey Dobriyan1-1/+1
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-07ide-gd: implement block device ->set_capacity method (v2)Bartlomiej Zolnierkiewicz1-0/+14
* Use ->probed_capacity to store native device capacity for ATA disks. * Add ->set_capacity method to struct ide_disk_ops. * Implement disk device ->set_capacity method for ATA disks. * Implement block device ->set_capacity method. v2: * Check if LBA and HPA are supported in ide_disk_set_capacity(). * According to the spec the SET MAX ADDRESS command shall be immediately preceded by a READ NATIVE MAX ADDRESS command. * Add ide_disk_hpa_{get_native,set}_capacity() helpers. Together with the previous patch adding ->set_capacity block device method this allows automatic disabling of Host Protected Area (HPA) if any partitions overlapping HPA are detected. Cc: Robert Hancock <hancockrwd@gmail.com> Cc: Frans Pop <elendil@planet.nl> Cc: "Andries E. Brouwer" <Andries.Brouwer@cwi.nl> Cc: Al Viro <viro@zeniv.linux.org.uk> Emphatically-Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-04-22ide: Stop disks on reboot for laptop which cuts powerBruno Prémont1-1/+16
My laptop (Acer Travelmate 660) always cuts the power when rebooting which causes the disk to emergency-park it's head. Add a dmi check to stop disk as for shutdown on this laptop. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-27ide: remove ->end_request methodBartlomiej Zolnierkiewicz1-6/+0
* Handle completion of private driver requests explicitly for ide_floppy and ide_tape media in ide_kill_rq(). * Remove no longer needed ->end_request method. There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-03-27ide: improve debugging schemeBorislav Petkov1-2/+2
and more specifically, push __func__ into debug macro thus making ide_debug_log() calls shorter and more readable. Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
2009-02-25ide: fix refcounting in device driversBartlomiej Zolnierkiewicz1-9/+17
During host driver module removal del_gendisk() results in a final put on drive->gendev and freeing the drive by drive_release_dev(). Convert device drivers from using struct kref to use struct device so device driver's object holds reference on ->gendev and prevents drive from prematurely going away. Also fix ->remove methods to not erroneously drop reference on a host driver by using only put_device() instead of ide*_put(). Reported-by: Stanislaw Gruszka <stf_xl@wp.pl> Tested-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: remove ->error method from struct ide_driverBartlomiej Zolnierkiewicz1-1/+0
* Remove (now superfluous) ->error method from struct ide_driver. * Unexport __ide_error() and make it static. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2009-01-06ide: remove ide_driver_t typedefBartlomiej Zolnierkiewicz1-1/+1
While at it: - s/struct ide_driver_s/struct ide_driver/ - use to_ide_driver() macro in ide-proc.c Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-11-02ide-gd: re-get capacity on revalidateBorislav Petkov1-1/+6
We need to re-get a removable media's capacity when revalidating the disk so that its partitions get rescanned by the block layer. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Cc: Tejun Heo <tj@kernel.org> Cc: axboe@kernel.dk Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-21[PATCH] switch ide-gdAl Viro1-13/+11
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-10-21[PATCH] beginning of methods conversionAl Viro1-3/+3
To keep the size of changesets sane we split the switch by drivers; to keep the damn thing bisectable we do the following: 1) rename the affected methods, add ones with correct prototypes, make (few) callers handle both. That's this changeset. 2) for each driver convert to new methods. *ALL* drivers are converted in this series. 3) kill the old (renamed) methods. Note that it _is_ a flagday; all in-tree drivers are converted and by the end of this series no trace of old methods remain. The only reason why we do that this way is to keep the damn thing bisectable and allow per-driver debugging if anything goes wrong. New methods: open(bdev, mode) release(disk, mode) ioctl(bdev, mode, cmd, arg) /* Called without BKL */ compat_ioctl(bdev, mode, cmd, arg) locked_ioctl(bdev, mode, cmd, arg) /* Called with BKL, legacy */ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-10-21[PATCH] switch ide_disk_ops ->ioctl() to sane prototypeAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-10-21[PATCH] eliminate use of ->f_flags in block methodsAl Viro1-1/+1
store needed information in f_mode Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-10-21[PATCH] introduce fmode_t, do annotationsAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-10-17ide: add generic ATA/ATAPI disk driverBartlomiej Zolnierkiewicz1-18/+104
* Add struct ide_disk_ops containing protocol specific methods. * Add 'struct ide_disk_ops *' to ide_drive_t. * Convert ide-{disk,floppy} drivers to use struct ide_disk_ops. * Merge ide-{disk,floppy} drivers into generic ide-gd driver. While at it: - ide_disk_init_capacity() -> ide_disk_get_capacity() Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-17ide: allow device drivers to specify per-device type /proc settingsBartlomiej Zolnierkiewicz1-2/+14
Turn ide_driver_t's 'proc' field into ->proc_entries method (and also 'settings' field into ->proc_devsets method). Then update all device drivers accordingly. There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-17ide-disk: use IDE_DFLAG_MEDIA_CHANGEDBartlomiej Zolnierkiewicz1-2/+6
Set IDE_DFLAG_MEDIA_CHANGED in ide_gd_open() to signalize ide_gd_media_changed() that that media has changed (instead of relying on IDE_DFLAG_REMOVABLE). There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-10-17ide-disk: factor out generic disk handling code to ide-gd.cBartlomiej Zolnierkiewicz1-0/+296
While at it: - IDEDISK_VERSION -> IDE_GD_VERSION - ide_cacheflush_p() -> ide_disk_flush() - init_idedisk_capacity() -> ide_disk_init_capacity() - idedisk_set_doorlock() -> ide_disk_set_doorlock() - idedisk_setup() -> ide_disk_setup() - ide_disk_capacity() -> ide_gd_capacity() - ide_disk_remove() -> ide_gd_remove() - ide_disk_probe() -> ide_gd_probe() - ide_disk_resume() -> ide_gd_resume() - ide_device_shutdown() -> ide_gd_shutdown() - idedisk_driver -> ide_gd_driver - idedisk_open() -> ide_gd_open() - idedisk_release() -> ide_gd_release() - idedisk_getgeo() -> ide_gd_getgeo() - idedisk_media_changed() -> ide_gd_media_changed() - idedisk_revalidate_disk() -> ide_gd_revalidate_disk() - idedisk_ops -> ide_gd_ops - idedisk_init() -> ide_gd_init() - idedisk_exit() -> ide_gd_exit() There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>