Factor out HDIO_{GET,SET}_NICE ioctl handling from
generic_ide_ioctl() to ide_{get,set}_nice_ioctl().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Use drive->media and drive->scsi to check if ->dsc_overlap
can be set by HDIO_SET_NICE ioctl in generic_ide_ioctl().
* Remove unused ->supports_dsc_overlap field from ide_driver_t.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Factor out the common code from check_prefetch()
and set_prefetch_mode() to __set_prefetch_mode().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Add struct ide_devset, S_* flags, *DEVSET() & ide*_devset_*() macros.
* 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.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Call ide_proc_register_driver() in ide*_setup() (just before
ide*_add_settings() call) instead of in ->probe method.
Despite being basically a preparation for /proc/ide/hd*/settings
rework this is a nice cleanup in itself.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Include <linux/ata.h> directly in <linux/ide.h>
instead of through <linux/hdreg.h>.
* Include <linux/hdreg.h> only when needed.
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Change ide_get_paired_drive() to return NULL if peer device
is not present and update all users accordingly.
While at it:
* ide_get_paired_drive() -> ide_get_pair_dev()
* Use ide_get_pair_dev() in cs5530.c, sc1200.c and via82cxxx.c.
There should be no functional changes caused by this patch.
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Remove needless drive->present checks from ->probe methods
(device model takes care of that).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
init_irq() is now called only during initial host registration
so these BUG_ON()-s are no loner needed (+ the last one was done
too late anyway).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* 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.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fix EXABYTENEST handling in probe_for_drive() (so drive->present
is checked for "nested" device) and cleanup enable_nest().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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>
* Use ATA_CMD_* defines instead of WIN_* ones.
* Include <linux/ata.h> directly instead of through <linux/hdreg.h>.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Use ATA_CMD_* defines instead of WIN_* ones.
While at it:
* EXABYTE_ENABLE_NEXT -> ATA_EXABYTE_ENABLE_NEST
* SETFEATURES_{EN,DIS}_WCACHE -> SETFEATURES_WC_{ON,OFF}
* SETFEATURES_{EN,DIS}_AAM -> SETFEATURES_AAM_{ON,OFF}
* SMART_* -> ATA_SMART_*
* Remove stale comment from ide-proc.c.
Partially based on earlier work by Chris Wedgwood.
Acked-by: Chris Wedgwood <cw@f00f.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
idedisk_supports_hpa() -> ata_id_hpa_enabled().
The latter one also checks validity of words 82 & 85.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Replace open-coded check by ata_id_wcache_enabled()
(which also checks validity of word 85).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Replace open-coded checks by ata_id_current_chs_valid().
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Factor out HDIO_[OBSOLETE,GET]_IDENTITY ioctls handling
to ide_get_identity_ioctl().
* Use temporary buffer in ide_get_identity_ioctl() instead
of accessing drive->id directly.
* Add ide_id_to_hd_driveid() inline to convert raw id into
struct hd_driveid format (needed on big-endian).
* Use ide_id_to_hd_driveid() in ide_get_identity_ioctl(),
cleanup ide_fix_driveid() and switch ide to use use raw id.
* Remove no longer needed drive->driveid.
This leaves us with 3 users of struct hd_driveid in tree:
- arch/um/drivers/ubd_kern.c
- drivers/block/xsysace.c
- drivers/usb/storage/isd200.c
While at it:
* Use ata_id_u{32,64}() and ata_id_has_{dma,lba,iordy}() macros.
There should be no functional changes caused by this patch.
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.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* Remove superfluous checks for drive->mult_req.
* No need to zero drive's fields.
* Move the common code out of #ifdef scope.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This condition is checked by both ide_disk_init_mult_count()
and set_multcount() so no need to do it again in ide_disk_special().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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>
* 'rcu-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (21 commits)
rcu: RCU-based detection of stalled CPUs for Classic RCU, fix
rcu: RCU-based detection of stalled CPUs for Classic RCU
rcu: add rcu_read_lock_sched() / rcu_read_unlock_sched()
rcu: fix sparse shadowed variable warning
doc/RCU: fix pseudocode in rcuref.txt
rcuclassic: fix compiler warning
rcu: use irq-safe locks
rcuclassic: fix compilation NG
rcu: fix locking cleanup fallout
rcu: remove redundant ACCESS_ONCE definition from rcupreempt.c
rcu: fix classic RCU locking cleanup lockdep problem
rcu: trace fix possible mem-leak
rcu: just rename call_rcu_bh instead of making it a macro
rcu: remove list_for_each_rcu()
rcu: fixes to include/linux/rcupreempt.h
rcu: classic RCU locking and memory-barrier cleanups
rcu: prevent console flood when one CPU sees another AWOL via RCU
rcu, debug: detect stalled grace periods, cleanups
rcu, debug: detect stalled grace periods
rcu classic: new algorithm for callbacks-processing(v2)
...
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
selinux: Fix an uninitialized variable BUG/panic in selinux_secattr_to_sid()
selinux: use default proc sid on symlinks
file capabilities: uninline cap_safe_nice
Update selinux info in MAINTAINERS and Kconfig help text
SELinux: add gitignore file for mdp script
SELinux: add boundary support and thread context assignment
securityfs: do not depend on CONFIG_SECURITY
selinux: add support for installing a dummy policy (v2)
security: add/fix security kernel-doc
selinux: Unify for- and while-loop style
selinux: conditional expression type validation was off-by-one
smack: limit privilege by label
SELinux: Fix a potentially uninitialised variable in SELinux hooks
SELinux: trivial, remove unneeded local variable
SELinux: Trivial minor fixes that change C null character style
make selinux_write_opts() static
* 'sched-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (38 commits)
sched debug: add name to sched_domain sysctl entries
sched: sync wakeups vs avg_overlap
sched: remove redundant code in cpu_cgroup_create()
sched_rt.c: resch needed in rt_rq_enqueue() for the root rt_rq
cpusets: scan_for_empty_cpusets(), cpuset doesn't seem to be so const
sched: minor optimizations in wake_affine and select_task_rq_fair
sched: maintain only task entities in cfs_rq->tasks list
sched: fixup buddy selection
sched: more sanity checks on the bandwidth settings
sched: add some comments to the bandwidth code
sched: fixlet for group load balance
sched: rework wakeup preemption
CFS scheduler: documentation about scheduling policies
sched: clarify ifdef tangle
sched: fix list traversal to use _rcu variant
sched: turn off WAKEUP_OVERLAP
sched: wakeup preempt when small overlap
kernel/cpu.c: create a CPU_STARTING cpu_chain notifier
kernel/cpu.c: Move the CPU_DYING notifiers
sched: fix __load_balance_iterator() for cfq with only one task
...
With -march=z990 and later gcc can use the long displacement facility
insruction lay for stack register handling. This patch adopts checkstack
to catch lay in addition to ahi and aghi.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
chsc_sstpc returns -EIO on error and 0 on success but stp_reset checks
against 1 instead of 0. chsc_sstpc used to return 1 on success, one
call location has not been updated ..
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
The 3215 console irq handler used to schedule a tasklet. However the
console irq handler also gets called from the infamous cio_tpi()
function. Which in turn does something like
local_bh_disable()
[call console irq handler]
_local_bh_enable()
_local_bh_enable() prevents execution of softirqs, which is intended
within cio_tpi(). However there might be a new softirq pending because
irq handler scheduled a tasklet.
In order to prevent this behaviour we just get rid of the tasklet.
It's not doing much anyway.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
The s390 console drivers use the unblank callback of the console
structure to flush the console buffer. In case of a panic or a
reboot the CPU doing the callback can block on the console i/o.
The other CPUs in the system continue to work. For panic this is
not a good idea.
Replace the unblank callback with proper panic/reboot notifier.
These get called after all but one CPU have been stopped.
Signed-off-by: Holger Smolinski <Holger.Smolinski@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This patch defines a dirty bit in the PGSTE that can be used to implement
dirty pages logging for KVM's live migration. The bit is set in the
ptep_rcp_copy function, which is called to save dirty and referenced information
from the storage key in the PGSTE. The bit can be tested and reset by KVM using
the kvm_s390_test_and_clear_page_dirty function that is introduced by this patch.
Acked-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Florian Funke <ffunke@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
EMC Symmetrix Subsystem Control I/O through CKD dasd requires a
specific parameter list sent to the array via a Perform Subsystem
Function CCW. The Symmetrix response is retrieved from the array
via a Read Subsystem Data CCW.
Signed-off-by: Nigel Hislop <hislop_nigel@emc.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
The xpram driver uses a single block device queue for all of its
devices so far. With recent kernels removing xpram module fails to
clean up all sysfs files. The next time the xpram module is loaded
you'll get warnings:
WARNING: at fs/sysfs/dir.c:463 sysfs_add_one+0x5e/0x64()
sysfs: duplicate filename '35:0' can not be created
Modules linked in: xpram(+) [last unloaded: xpram]
Followed by the usual WARN_ON output, followed by an error message
from kobject_add_internal, followed by a badness in genhd. Allocating
a block queue per device fixes this.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
In the unsolicited interupt handler fake IRBs from CIO have to be
ignored because there is nothing to do.
The function dump_sense should not be called if there is no sense
data available.
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Move cio's private simple udelay function to lib/delay.c and turn it
into something much more readable. So we have all implementations
at one place.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
The DCSS block device driver is modified to add >2G DCSSs support and
allow a DCSS block device to map to a set of contiguous DCSSs. The
extmem code is also modified to use new Diagnose x'64' subcodes for
>2G DCSSs.
Signed-off-by: Hongjie Yang <hongjie@us.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* System call parameter and result access functions
* Add tracehook calls
* Split syscall_trace into two functions do_syscall_trace_enter and
do_syscall_trace_exit
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
sys32_pause is a useless copy of the generic sys_pause.
(and it's certainly not there for old sparc32 binaries..)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Add support for z10 HiperSockets multiwrite SBALs on output
queues. This is used on LPAR with EDDP enabled devices.
Signed-off-by: Klaus-Dieter Wacker <kdwacker@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>