Only MODE_SENSE_CURRENT (0x00) is ever used so just remove
these defines and then drop no longer needed 'type' argument
from idefloppy_create_mode_sense_cmd().
* Add 'struct ide_atapi_pc queued_pc' to struct ide_{floppy,tape}_obj
and switch ide*_do_request() to use it (there can be only one active
request for a given device).
* Add 'struct ide_atapi_pc request_sense_pc' to struct ide_*_obj
and switch ide*_retry_pc() to use it.
* Remove needless {floppy,tape}->pc assignment from ide*_setup().
* Remove no longer needed ide*_next_pc_storage(), pc_stack[],
rq_stack_index, IDE*_PC_STACK and DBG_PC_STACK.
There should be no functional changes caused by this patch.
* Add 'struct request request_sense_rq' to struct ide_{floppy,tape}_obj
and switch ide*_retry_pc() to use it (there can be only one REQUEST SENSE
request active for a given device).
* Remove no longer needed ide*_next_rq_storage(), rq_stack[]
and rq_stack_index.
* DBG_PCRQ_STACK -> DBG_PC_STACK
* Update comments for IDE*_PC_STACK and idetape_queue_pc_{head,tail}().
There should be no functional changes caused by this patch.
Borislav Petkov [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-generic: handle probing of legacy io-ports v5
Avoid probing the io-ports in case an IDE PCI controller is present and it
uses the legacy iobases. If we still want to enforce the probing, we do
ide_generic.probe_mask=0x3f
on the kernel command line. The iobase checking code is
adapted from drivers/ata/pata_legacy.c after converting hex
pci ids into their corresponding macros in <linux/pci_ids.h>.
Also, check only BAR0/2 resources since those are guaranteed
by the workaround in drivers/pci/probe.c:pci_setup_device().
Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
[bart: trivial printk() fixups] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Borislav Petkov [Fri, 10 Oct 2008 20:39:35 +0000 (22:39 +0200)]
ide-floppy: use scatterlists for pio transfers
Use hwif->sg_table for pio transfers instead of fumbling
with block layer internals in the driver. Also, make debug
statements more informative in .._do_request() while at it.
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
[bart: fixup pc->b_count in idefloppy_blockpc_cmd()]
[bart: add missing include (noticed by Stephen Rothwell)]
[bart: map hwif->sg_{table,nents} on pc->{sg,sg_cnt} (multi-IRQs-per-sg fix)] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Keep pointer to ->init_chipset method also in
struct ide_host and set it in ide_host_alloc_all().
* Add ide_pci_suspend() and ide_pci_resume() helpers
(default ->suspend and ->resume implementations).
* ->init_chipset can no longer be marked __devinit.
* Add proper PCI PM support to IDE PCI host drivers
(rz1000.c and tc86c001.c are skipped for now since
they need to be converted from using ->init_hwif
to use ->init_chipset instead).
v2:
* Cleanup CONFIG_PM #ifdef-s per akpm's suggestion.
Cc: Andrew Morton <akpm@linux-foundation.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Use ata_id_is_cfa() in do_identify() instead of open-coding
check for CompactFlash devices (the inline helper also takes
care of detecting CFs advertising themselves as ATA disks).
ide: check only for CACHE FLUSH command support in ide_id_has_flush_cache()
All devices supporting CACHE FLUSH EXT command should also support
CACHE FLUSH command so it is sufficient to check only for CACHE FLUSH
in ide_id_has_flush_cache().
* Add 'const struct ide_devset **settings' to ide_driver_t.
* Use 'const struct ide_devset **settings' in ide_drive_t instead of
'struct ide_settings_s *settings'. Then convert core code and device
drivers to use struct ide_devset and co.:
- device settings are no longer allocated dynamically for each device
but instead there is an unique struct ide_devset instance per setting
- device driver keeps the pointer to the table of pointers to its
settings in ide_driver_t.settings
- generic settings are kept in ide_generic_setting[]
- ide_proc_[un]register_driver(), ide_find_setting_by_name(),
ide_{read,write}_setting() and proc_ide_{read,write}_settings()
are updated accordingly
- ide*_add_settings() are removed
* Remove no longer used __ide_add_setting(), ide_add_setting(),
__ide_remove_setting() and auto_remove_settings().
* Remove no longer used TYPE_*, SETTING_*, ide_procset_t
and ide_settings_t.
* ->keep_settings, ->using_dma, ->unmask, ->noflush, ->dsc_overlap,
->nice1, ->addressing, ->wcache and ->nowerr ide_drive_t fields
can now be bitfield flags.
While at it:
* Rename ide_find_setting_by_name() to ide_find_setting().
* Rename write_wcache() to set_wcache().
There should be no functional changes caused by this patch.
ide: preparations for /proc/ide/hd*/settings rework
After rework settings will be no longer created dynamically
for each device so we need to make some fixups first.
* Use set_[ksettings,unmaskirq]() as a set function for
["keepsettings","unmaskirq"] setting.
* Allow writes to ["io_32bit","unmaskirq"] settings also when
drive->no_[io_32bit,unmask] is set (this is checked later inside
set_[io_32bit,unmaskirq]() anywyay and keeps consistency with
the corresponding HDIO_SET_[32BIT,UNMASKINTR] ioctls).
* Use max possible multi sectors value (16) as an allowed max for
"multcount" setting. set_multcount() set function checks against
device's max possbile value anyway and it makes the proc setting
consistent with the corresponding HDIO_SET_MULTCOUNT ioctl.
Use multi PIO by default when available and remove no longer
needed CONFIG_IDEDISK_MULTI_MODE (it should be safe nowadays,
despite to what help entry has been saying).
* Make ide_busy_sleep() take timeout value as a parameter
and also allow use of AltStatus Register if requested with
altstatus parameter. Update existing users accordingly.
* Convert ide_driveid_update() and actual_try_to_identify()
to use ide_busy_sleep().
There should be no functional changes caused by this patch.
Linus Torvalds [Fri, 10 Oct 2008 20:39:22 +0000 (22:39 +0200)]
ide: re-code ide_fixstring() loop to be less evil
On Friday 25 July 2008, Linus Torvalds wrote:
>
> On Fri, 25 Jul 2008, Ben Dooks wrote:
> >
> > personally, i would much prefer to see the loop being less evil
> > like:
> >
> > for (p = s; p < end; p += 2)
> > be16_to_cpus((u16 *)p);
>
> Well, in this case, the code actually depends on 'p' being back at the
> start of the buffer by the end of it all, so it would need some more
> changes than that.
>
> But yes, I applied David's patch, but I _also_ suspect that we would be
> better off without code that does horrid things like casts and assignments
> inside the function arguments.
>
> So it would be nice to re-code that loop to be more readable. But due to
> the reliance of 'p' being 's' after the loop, the minimal patch would be
> something like the appended.
>
> Bartlomiej - take this or not, I'm not going to commit it - I haven't
> tested it, nor do I even have any machines that would trigger it. So this
> is more a "maybe something like this" than anything else.
From: Linus Torvalds <torvalds@linux-foundation.org> CC: Ben Dooks <ben-linux@fluff.org> Cc: David Miller <davem@davemloft.net> Cc: harvey.harrison@gmail.com Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Make drive->id an unnamed union so id can be accessed either by using
'u16 *id' or 'struct hd_driveid *driveid'. Then convert all existing
drive->id users accordingly (using 'u16 *id' when possible).
This is an intermediate step to make ide 'struct hd_driveid'-free.
While at it:
- Add missing KERN_CONTs in it821x.c.
- Use ATA_ID_WORDS and ATA_ID_*_LEN defines.
- Remove unnecessary checks for drive->id.
- s/drive_table/table/ in ide_in_drive_list().
- Cleanup ide_config_drive_speed() a bit.
- s/drive1/dev1/ & s/drive0/dev0/ in ide_undecoded_slave().
v2:
Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell)
There should be no functional changes caused by this patch.
Mark de Wever [Fri, 10 Oct 2008 20:39:17 +0000 (22:39 +0200)]
ide-tape: Buildfix when IDETAPE_DEBUG_LOG is set to 1.
The format specifier for rq->sector didn't specify the proper size and
signedness. Borislav Petkov discovered that the signedness for
rq->nr_sectors and rq->current_nr_sectors also were incorrect.
Signed-off-by: Mark de Wever <koraq@xs4all.nl> Acked-by: Borislav Petkov <petkovbb@gmail.com>
[bart: remove trailing whitespace] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: skcipher - Use RNG interface instead of get_random_bytes
crypto: rng - RNG interface and implementation
crypto: api - Add fips_enable flag
crypto: skcipher - Move IV generators into their own modules
crypto: cryptomgr - Test ciphers using ECB
crypto: api - Use test infrastructure
crypto: cryptomgr - Add test infrastructure
crypto: tcrypt - Add alg_test interface
crypto: tcrypt - Abort and only log if there is an error
crypto: crc32c - Use Intel CRC32 instruction
crypto: tcrypt - Avoid using contiguous pages
crypto: api - Display larval objects properly
crypto: api - Export crypto_alg_lookup instead of __crypto_alg_lookup
crypto: Kconfig - Replace leading spaces with tabs
Linus Torvalds [Fri, 10 Oct 2008 18:16:33 +0000 (11:16 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (29 commits)
RDMA/nes: Fix slab corruption
IB/mlx4: Set RLKEY bit for kernel QPs
RDMA/nes: Correct error_module bit mask
RDMA/nes: Fix routed RDMA connections
RDMA/nes: Enhanced PFT management scheme
RDMA/nes: Handle AE bounds violation
RDMA/nes: Limit critical error interrupts
RDMA/nes: Stop spurious MAC interrupts
RDMA/nes: Correct tso_wqe_length
RDMA/nes: Fill in firmware version for ethtool
RDMA/nes: Use ethtool timer value
RDMA/nes: Correct MAX TSO frags value
RDMA/nes: Enable MC/UC after changing MTU
RDMA/nes: Free NIC TX buffers when destroying NIC QP
RDMA/nes: Fix MDC setting
RDMA/nes: Add wqm_quanta module option
RDMA/nes: Module parameter permissions
RDMA/cxgb3: Set active_mtu in ib_port_attr
RDMA/nes: Add support for 4-port 1G HP blade card
RDMA/nes: Make mini_cm_connect() static
...
Currently we disable barriers as soon as we get a buffer in xlog_iodone
that has the XBF_ORDERED flag cleared. But this can be the case not only
for buffers where the barrier failed, but also the first buffer of a
split log write in case of a log wraparound. Due to the disabled
barriers we can easily get directory corruption on unclean shutdowns.
So instead of using this check add a new buffer flag for failed barrier
writes.
This is a regression vs 2.6.26 caused by patch to use the right macro
to check for the ORDERED flag, as we previously got true returned for
every buffer.
Thanks to Toei Rei for reporting the bug.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net> Reviewed-by: David Chinner <david@fromorbit.com> Signed-off-by: Tim Shimmin <tes@sgi.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw:
GFS2: Support for I/O barriers
GFS2: Add UUID to GFS2 sb
GFS2: high time to take some time over atime
GFS2: The war on bloat
GFS2: GFS2 will panic if you misspell any mount options
GFS2: Direct IO write at end of file error
GFS2: Use an IS_ERR test rather than a NULL test
GFS2: Fix race relating to glock min-hold time
GFS2: Fix & clean up GFS2 rename
GFS2: rm on multiple nodes causes panic
GFS2: Fix metafs mounts
GFS2: Fix debugfs glock file iterator
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (37 commits)
[SCSI] zfcp: fix double dbf id usage
[SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev
[SCSI] zfcp: fix erp list usage without using locks
[SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport
[SCSI] zfcp: fix deadlock caused by shared work queue tasks
[SCSI] zfcp: put threshold data in hba trace
[SCSI] zfcp: Simplify zfcp data structures
[SCSI] zfcp: Simplify get_adapter_by_busid
[SCSI] zfcp: remove all typedefs and replace them with standards
[SCSI] zfcp: attach and release SAN nameserver port on demand
[SCSI] zfcp: remove unused references, declarations and flags
[SCSI] zfcp: Update message with input from review
[SCSI] zfcp: add queue_full sysfs attribute
[SCSI] scsi_dh: suppress comparison warning
[SCSI] scsi_dh: add Dell product information into rdac device handler
[SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option
[SCSI] qla2xxx: fix printk format warnings
[SCSI] qla2xxx: Update version number to 8.02.01-k8.
[SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
[SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
...
Linus Torvalds [Fri, 10 Oct 2008 17:52:45 +0000 (10:52 -0700)]
Merge branch 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block: (132 commits)
doc/cdrom: Trvial documentation error, file not present
block_dev: fix kernel-doc in new functions
block: add some comments around the bio read-write flags
block: mark bio_split_pool static
block: Find bio sector offset given idx and offset
block: gendisk integrity wrapper
block: Switch blk_integrity_compare from bdev to gendisk
block: Fix double put in blk_integrity_unregister
block: Introduce integrity data ownership flag
block: revert part of d7533ad0e132f92e75c1b2eb7c26387b25a583c1
bio.h: Remove unused conditional code
block: remove end_{queued|dequeued}_request()
block: change elevator to use __blk_end_request()
gdrom: change to use __blk_end_request()
memstick: change to use __blk_end_request()
virtio_blk: change to use __blk_end_request()
blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure
block: add lld busy state exporting interface
block: Fix blk_start_queueing() to not kick a stopped queue
include blktrace_api.h in headers_install
...
and as Ingo says: "these are the easiest, purely independent x86 topics
with no conflicts, in one nice Octopus merge".
* 'x86-v28-for-linus-phase1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (147 commits)
x86: mtrr_cleanup: treat WRPROT as UNCACHEABLE
x86: mtrr_cleanup: first 1M may be covered in var mtrrs
x86: mtrr_cleanup: print out correct type v2
x86: trivial printk fix in efi.c
x86, debug: mtrr_cleanup print out var mtrr before change it
x86: mtrr_cleanup try gran_size to less than 1M, v3
x86: mtrr_cleanup try gran_size to less than 1M, cleanup
x86: change MTRR_SANITIZER to def_bool y
x86, debug printouts: IOMMU setup failures should not be KERN_ERR
x86: export set_memory_ro and set_memory_rw
x86: mtrr_cleanup try gran_size to less than 1M
x86: mtrr_cleanup prepare to make gran_size to less 1M
x86: mtrr_cleanup safe to get more spare regs now
x86_64: be less annoying on boot, v2
x86: mtrr_cleanup hole size should be less than half of chunk_size, v2
x86: add mtrr_cleanup_debug command line
x86: mtrr_cleanup optimization, v2
x86: don't need to go to chunksize to 4G
x86_64: be less annoying on boot
x86, olpc: fix endian bug in openfirmware workaround
...
Linus Torvalds [Fri, 10 Oct 2008 15:00:17 +0000 (08:00 -0700)]
PnP: move pnpacpi/pnpbios_init to after PCI init
We already did that a long time ago for pnp_system_init, but
pnpacpi_init and pnpbios_init remained as subsys_initcalls, and get
linked into the kernel before the arch-specific routines that finalize
the PCI resources (pci_subsys_init).
This means that the PnP routines would either register their resources
before the PCI layer could, or would be unable to check whether a PCI
resource had already been registered. Both are problematic.
I wanted to do this before 2.6.27, but every time we change something
like this, something breaks. That said, _every_ single time we trust
some firmware (like PnP tables) more than we trust the hardware itself
(like PCI probing), the problems have been worse.
Linus Torvalds [Fri, 10 Oct 2008 14:46:45 +0000 (07:46 -0700)]
Merge branch 'upstream-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
ata_piix: IDE Mode SATA patch for Intel Ibex Peak DeviceIDs
libata-eh: clear UNIT ATTENTION after reset
ata_piix: add Hercules EC-900 mini-notebook to ich_laptop short cable list
libata: reorder ata_device to remove 8 bytes of padding on 64 bits
[libata] pata_bf54x: Add proper PM operation
pata_sil680: convert CONFIG_PPC_MERGE to CONFIG_PPC
libata: Implement disk shock protection support
[libata] Introduce ata_id_has_unload()
PATA: RPC now selects HAVE_PATA_PLATFORM for pata platform driver
ata_piix: drop merged SCR access and use slave_link instead
libata: implement slave_link
libata: misc updates to prepare for slave link
libata: reimplement link iterator
libata: make SCR access ops per-link
Milan Broz [Fri, 10 Oct 2008 12:37:08 +0000 (13:37 +0100)]
dm crypt: avoid unnecessary wait when splitting bio
Don't wait between submitting crypt requests for a bio unless
we are short of memory.
There are two situations when we must split an encrypted bio:
1) there are no free pages;
2) the new bio would violate underlying device restrictions
(e.g. max hw segments).
In case (2) we do not need to wait.
Add output variable to crypt_alloc_buffer() to distinguish between
these cases.
Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Milan Broz [Fri, 10 Oct 2008 12:37:07 +0000 (13:37 +0100)]
dm crypt: fix async inc_pending
The pending reference count must be incremented *before* the async work is
queued to another thread, not after. Otherwise there's a race if the
work completes and decrements the reference count before it gets incremented.
Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Make the caller reponsible for incrementing the pending count before calling
kcryptd_crypt_write_io_submit() in the non-async case to bring it into line
with the async case.
Jonathan Brassow [Fri, 10 Oct 2008 12:36:59 +0000 (13:36 +0100)]
dm raid1: kcopyd should stop on error if errors handled
dm-raid1 is setting the 'DM_KCOPYD_IGNORE_ERROR' flag unconditionally
when assigning kcopyd work. kcopyd is responsible for copying an
assigned section of disk to one or more other disks. The
'DM_KCOPYD_IGNORE_ERROR' flag affects kcopyd in the following way:
When not set:
kcopyd will immediately stop the copy operation when an error is
encountered.
When set:
kcopyd will try to proceed regardless of errors and try to continue
copying any remaining amount.
Since dm-raid1 tracks regions of the address space that are (or
are not) in sync and it now has the ability to handle these
errors, we can safely enable this optimization. This optimization
is conditional on whether mirror error handling has been enabled.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>