summaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd.c
Commit message (Collapse)AuthorAgeFilesLines
* [S390] dasd: unit check handling during internal cio I/OStefan Haberland2010-05-261-0/+23
| | | | | | | | React on unit checks during cio internal I/O. Handle as unsolicited interrupt and advice cio to retry. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: add dynamic pav tolerationStefan Haberland2010-05-171-0/+22
| | | | | | | | | | | | For base Parallel Access Volume (PAV) there is a fixed mapping of base and alias devices. With dynamic PAV this mapping can be changed so that an alias device is used with another base device. This patch enables the DASD device driver to tolerate dynamic PAV changes. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix race between tasklet and dasd_sleep_onStefan Weinhuber2010-05-121-7/+10
| | | | | | | | | | | | | | | | | | The various dasd_sleep_on functions use a global wait queue when waiting for a cqr. The wait condition checks the status and devlist fields of the cqr to determine if it is safe to continue. This evaluation may return true, although the tasklet has not finished processing of the cqr and the callback function has not been called yet. When the callback is finally called, the data in the cqr may already be invalid. The sleep_on wait condition needs a safe way to determine if the tasklet has finished processing. Use the callback_data field of the cqr to store a token, which is set by the callback function itself. Cc: <stable@kernel.org> Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix endless loop in erpStefan Haberland2010-04-221-1/+2
| | | | | | | | | If not enough memory is available to build a new erp request it ended up in an endless loop trying to build erp requests. Fixed the loop to proceed the next request instead. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: automatic recognition of read-only devicesStefan Weinhuber2010-03-081-0/+36
| | | | | | | | | | In z/VM it is possible to attach a device as read-only. To prevent unintentional write requests and subsequent I/O errors, we can detect this configuration using the z/VM DIAG 210 interface and set the respective linux block device to read-only as well. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* Merge branch 'for-2.6.34' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds2010-03-011-3/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-2.6.34' of git://git.kernel.dk/linux-2.6-block: (38 commits) block: don't access jiffies when initialising io_context cfq: remove 8 bytes of padding from cfq_rb_root on 64 bit builds block: fix for "Consolidate phys_segment and hw_segment limits" cfq-iosched: quantum check tweak blktrace: perform cleanup after setup error blkdev: fix merge_bvec_fn return value checks cfq-iosched: requests "in flight" vs "in driver" clarification cciss: Fix problem with scatter gather elements in the scsi half of the driver cciss: eliminate unnecessary pointer use in cciss scsi code cciss: do not use void pointer for scsi hba data cciss: factor out scatter gather chain block mapping code cciss: fix scatter gather chain block dma direction kludge cciss: simplify scatter gather code cciss: factor out scatter gather chain block allocation and freeing cciss: detect bad alignment of scsi commands at build time cciss: clarify command list padding calculation cfq-iosched: rethink seeky detection for SSDs cfq-iosched: rework seeky detection block: remove padding from io_context on 64bit builds block: Consolidate phys_segment and hw_segment limits ...
| * block: Consolidate phys_segment and hw_segment limitsMartin K. Petersen2010-02-261-2/+1
| | | | | | | | | | | | | | | | | | Except for SCSI no device drivers distinguish between physical and hardware segment limits. Consolidate the two into a single segment limit. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
| * block: Rename blk_queue_max_sectors to blk_queue_max_hw_sectorsMartin K. Petersen2010-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The block layer calling convention is blk_queue_<limit name>. blk_queue_max_sectors predates this practice, leading to some confusion. Rename the function to appropriately reflect that its intended use is to set max_hw_sectors. Also introduce a temporary wrapper for backwards compability. This can be removed after the merge window is closed. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* | [S390] dasd: correct offline processingStefan Haberland2010-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Flushing the dasd ccw request queue may stop the processing of the block device request queue. Destroy partitions may wait for outstanding requests and thus hang. Swapping dasd_destroy_partitions and dasd_flush_request_queue so that the request queue is empty before dasd_destroy_partitions is called. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* | [S390] dasd: fix refcounting.Stefan Haberland2010-02-261-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | The function dasd_device_from_cdev returns a reference to the dasd device and increases the refcount by one. If an exception occurs, the refcount was not decreased in all cases e.g. in dasd_discipline_show. Prevent the offline processing from hang by correcting two functions to decrease the refcount even if an error occured. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* | [S390] dasd: fix online/offline raceStefan Haberland2010-02-261-8/+14
|/ | | | | | | | | | | | | | Setting a DASD online and offline in quick succession may cause a kernel panic or let the chhccwdev command wait forever. The Online process is split into two parts. After the first part is finished the offline process may be called. This may result in a situation where the second online processing part tries to set the DASD offline as well. Use a mutex to protect online and offline against each other. Also correct some checking. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix possible NULL pointer errorsStefan Haberland2010-01-271-4/+4
| | | | | | | | Fix possible NULL pointer in DASD messages and correct discipline checking. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: remove strings from s390dbfStefan Haberland2009-12-071-11/+11
| | | | | | | | | Remove strings from s390 debugfeature entries that could lead to a crash when the data is read from dbf because the strings do not exist any more. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: improve error recovery for internal I/OStefan Weinhuber2009-12-071-55/+152
| | | | | | | | | | | | | | | | | | | Most of the error conditions reported by a FICON storage server indicate situations which can be recovered. Sometimes the host just needs to retry an I/O request, but sometimes the recovery is more complex and requires the device driver to wait, choose a different path, etc. The DASD device driver has a fully featured error recovery for normal block layer I/O, but not for internal I/O request which are for example used during the device bring up. This can lead to situations where the IPL of a system fails because DASD devices are not properly recognized. This patch will extend the internal I/O handling to use the existing error recovery procedures. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: remove dead codeChristian Borntraeger2009-12-071-1/+0
| | | | | | | the todclk.h header file is dead code. Remove it. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] cio: split PGID settings and statusPeter Oberparleiter2009-12-071-7/+0
| | | | | | | | | | | Split setting (driver wants feature enabled) and status (feature setup was successful) for PGID related ccw device features so that setup errors can be detected. Previously, incorrectly handled setup errors could in rare cases lead to erratic I/O behavior and permanently unusuable devices. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: use idal for device characteristicsStefan Haberland2009-10-141-2/+11
| | | | | | | | | If the rdc_buffer is above 2G we need indirect addresssing so we have to use an idaw to give the rdc_buffer to the ccw. If the rdc_buffer is under 2G nothing changes. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix race condition in resume codeStefan Haberland2009-10-061-2/+3
| | | | | | | | | | | | | | | | There is a race while re-reading the device characteristics. After cleaning the memory area a cqr is build which reads the device characteristics. This may take a rather long time and the device characteristics structure is zero during this. Now it could be possible that the block tasklet starts working and a new cqr will be build. The build_cp command refers to the device characteristics structure and this may lead into a divide by zero exception. Fix this by re-reading the device characteristics into a temporary structur and copy the data to the original structure. Also take the ccwdev_lock. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* const: make block_device_operations constAlexey Dobriyan2009-09-221-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>
* [S390] dasd: optimize cpu usage in goodcaseStefan Haberland2009-09-111-13/+8
| | | | | | | remove unnecessary dbf call, remove string operations for magic Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fail requests when device state is less then readyStefan Weinhuber2009-09-111-1/+4
| | | | | | | | | A DASD device that is not ready or online has no defined disk layout, so all requests that arrive in such a state need to be returned as failed. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] drivers/s390: put NULL test before dereferenceJulia Lawall2009-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | If the NULL test on block is needed, it should be before the dereference of the base field. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ expression E1,E2; identifier fld; statement S1,S2; @@ E1 = E2->fld; ( if (E1 == NULL) S1 else S2 | *if (E2 == NULL) S1 else S2 ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix refcounting in dasd_change_stateSebastian Ott2009-06-221-3/+5
| | | | | | | | | | | | | | | | | | To set a dasd online dasd_change_state is called twice. The first cycle will schedule initial analysis of the device, set the rc to -EAGAIN and will not touch the device state any more. The initial analysis will in turn call dasd_change_state to increase the state to the final DASD_STATE_ONLINE. If the dasd_change_state on the second thread outruns the other one both finish with the state set to DASD_STATE_ONLINE and the device refcount will be decreased by 2. Fix this by leaving dasd_change_state on rc == -EAGAIN so that the refcount will always be decreased by 1. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd_pm: fix stop flag handlingStefan Haberland2009-06-221-1/+11
| | | | | | | | The stop flags are handled in the generic restore function so the stop flag is removed also for FBA and DIAG devices. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] pm: dasd power management callbacks.Stefan Haberland2009-06-161-2/+107
| | | | | | | | | | | | | | Introduce the power management callbacks to the dasd driver. On suspend the dasd devices are stopped and removed from the focus of alias management. On resume they are reinitialized by rereading the device characteristics and adding the device to the alias management. In case the device has gone away during suspend it will caught in the suspend state with stopped flag set to UNRESUMED. After it appears again the restore function is called again. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: forward internal errors to dasd_sleep_on callerStefan Weinhuber2009-06-121-6/+24
| | | | | | | | | | | If a DASD requests is started with dasd_sleep_on and fails, then the calling function may need to know the reason for the failure. In cases of hardware errors it can inspect the sense data in the irb, but when the reason is internal (e.g. start_IO failed) then it needs a meaningfull return code. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: check_characteristics cleanupSebastian Ott2009-06-121-2/+2
| | | | | | | | Fix a broken memset (sizeof pointer vs sizeof the underlying structure) by cleaning up the involved functions. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* block: Do away with the notion of hardsect_sizeMartin K. Petersen2009-05-221-1/+1
| | | | | | | | | | | | | | Until now we have had a 1:1 mapping between storage device physical block size and the logical block sized used when addressing the device. With SATA 4KB drives coming out that will no longer be the case. The sector size will be 4KB but the logical block size will remain 512-bytes. Hence we need to distinguish between the physical block size and the logical ditto. This patch renames hardsect_size to logical_block_size. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* block: implement and enforce request peek/start/fetchTejun Heo2009-05-111-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Till now block layer allowed two separate modes of request execution. A request is always acquired from the request queue via elv_next_request(). After that, drivers are free to either dequeue it or process it without dequeueing. Dequeue allows elv_next_request() to return the next request so that multiple requests can be in flight. Executing requests without dequeueing has its merits mostly in allowing drivers for simpler devices which can't do sg to deal with segments only without considering request boundary. However, the benefit this brings is dubious and declining while the cost of the API ambiguity is increasing. Segment based drivers are usually for very old or limited devices and as converting to dequeueing model isn't difficult, it doesn't justify the API overhead it puts on block layer and its more modern users. Previous patches converted all block low level drivers to dequeueing model. This patch completes the API transition by... * renaming elv_next_request() to blk_peek_request() * renaming blkdev_dequeue_request() to blk_start_request() * adding blk_fetch_request() which is combination of peek and start * disallowing completion of queued (not started) requests * applying new API to all LLDs Renamings are for consistency and to break out of tree code so that it's apparent that out of tree drivers need updating. [ Impact: block request issue API cleanup, no functional change ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Mike Miller <mike.miller@hp.com> Cc: unsik Kim <donari75@gmail.com> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Tim Waugh <tim@cyberelk.net> Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Cc: David S. Miller <davem@davemloft.net> Cc: Laurent Vivier <Laurent@lvivier.info> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: Pierre Ossman <drzeus@drzeus.cx> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Markus Lidel <Markus.Lidel@shadowconnect.com> Cc: Stefan Weinhuber <wein@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* block: convert to pos and nr_sectors accessorsTejun Heo2009-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With recent cleanups, there is no place where low level driver directly manipulates request fields. This means that the 'hard' request fields always equal the !hard fields. Convert all rq->sectors, nr_sectors and current_nr_sectors references to accessors. While at it, drop superflous blk_rq_pos() < 0 test in swim.c. [ Impact: use pos and nr_sectors accessors ] Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Tested-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Grant Likely <grant.likely@secretlab.ca> Tested-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Acked-by: Adrian McMenamin <adrian@mcmen.demon.co.uk> Acked-by: Mike Miller <mike.miller@hp.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Eric Moore <Eric.Moore@lsi.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Pete Zaitcev <zaitcev@redhat.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Paul Clements <paul.clements@steeleye.com> Cc: Tim Waugh <tim@cyberelk.net> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Dario Ballabio <ballabio_dario@emc.com> Cc: David S. Miller <davem@davemloft.net> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: unsik Kim <donari75@gmail.com> Cc: Laurent Vivier <Laurent@lvivier.info> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* block: implement and use [__]blk_end_request_all()Tejun Heo2009-04-281-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many [__]blk_end_request() call sites which call it with full request length and expect full completion. Many of them ensure that the request actually completes by doing BUG_ON() the return value, which is awkward and error-prone. This patch adds [__]blk_end_request_all() which takes @rq and @error and fully completes the request. BUG_ON() is added to to ensure that this actually happens. Most conversions are simple but there are a few noteworthy ones. * cdrom/viocd: viocd_end_request() replaced with direct calls to __blk_end_request_all(). * s390/block/dasd: dasd_end_request() replaced with direct calls to __blk_end_request_all(). * s390/char/tape_block: tapeblock_end_request() replaced with direct calls to blk_end_request_all(). [ Impact: cleanup ] Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Mike Miller <mike.miller@hp.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Cc: Alex Dubov <oakad@yahoo.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
* [S390] dasd: Use the new async framework for autoonlining.Cornelia Huck2009-04-141-12/+25
| | | | | | | | | | | | | | The dasd driver can automatically online detected dasds, which especially important for finding the root device. Currently, it will wait for each online operation to finish individually, which may take long if many dasds need to be onlined. When using the new async framework, these onlining operations can run in parallel and presence of the root device is ensured by the fact that prepare_namespace() waits for all async threads to finish. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] cio: introduce notifier for boxed stateSebastian Ott2009-03-311-0/+1
| | | | | | | | | | | | | If a ccw device did not respond in time during internal io, we set it into boxed state. With this patch we have the following behaviour: * the ccw driver will get a notification if the device was online and goes into the boxed state * if the device was disconnected and got boxed nothing special is to be done (it will be handled in reprobing later) * if the device got boxed while initial sensing it will be unregistered Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: message cleanupStefan Haberland2009-03-261-88/+88
| | | | | | | | Moved some Messages into s390 debug feature and changed remaining messages to use the dev_xxx and pr_xxx macros. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: add High Performance FICON supportStefan Weinhuber2009-03-261-12/+58
| | | | | | | | | To support High Performance FICON, the DASD device driver has to translate I/O requests into the new transport mode control words (TCW) instead of the traditional (command mode) CCW requests. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: enable compat ioctlsHeiko Carstens2009-03-261-1/+2
| | | | | | | All of the ioctls are compatible. Just enable them. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix race in dasd timer handlingStefan Weinhuber2009-02-111-30/+16
| | | | | | | | | | | | | In dasd_device_set_timer and dasd_block_set_timer we interpret the return value of mod_timer in a wrong way. If the timer expires in the small window between our check of timer_pending and the call to mod_timer, then the timer will be set, mod_timer returns zero and we will call add_timer for a timer that is already pending. As del_timer and mod_timer do all the necessary checking themselves, we can simplify our code and remove the race a the same time. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: send change uevents for dasd block devicesStefan Weinhuber2009-01-091-1/+20
| | | | | | | | | | | When a DASD device enters or leaves the 'online' state we need to trigger change events for the respective disk and partitions. These extra events are needed because when disk and partitions are first added, udev rules that try to read disk labels or other data may fail as the disk may not yet be ready. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: call cleanup_cqr with request_queue_lockStefan Haberland2008-12-251-0/+4
| | | | | | | | __dasd_cleanup_cqr should be called with request_queue_lock held and __dasd_block_process_erp with queue_lock Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: log sense for fatal errorsStefan Haberland2008-11-141-0/+5
| | | | | | | | The logging of sense data for fatal errors was accidentally removed during Hyper PAV implementation. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [PATCH] switch dasdAl Viro2008-10-211-9/+6
| | | | | | | ->compat_ioctl() actually had been useless here; generic logics works fine. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
* [PATCH] beginning of methods conversionAl Viro2008-10-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* [S390] bus_id -> dev_name conversionsKay Sievers2008-10-101-16/+16
| | | | | | | | | | bus_id -> dev_name() conversions in s390 code. [cornelia.huck@de.ibm.com: minor adaptions] Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] cio: call ccw driver notify function with lock heldPeter Oberparleiter2008-08-211-4/+1
| | | | | | | | | | | | | | Calling a ccw driver's notify function without the ccw device lock held opens up a race window between discovery and handling of a change in the device operational state. As a result, the device driver may encounter unexpected device malfunction, leading to out-of-retry situations or similar. Remove race by extending the ccw device lock from state change discovery to the calling of the notify function. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] cio: introduce fcx enabled scsw formatPeter Oberparleiter2008-07-141-9/+9
| | | | | | | | | | Extend the scsw data structure to the format required by fcx. Also provide helper functions for easier access to fields which are present in both the traditional as well as the modified format. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* [S390] dasd: use a generic wait_queue for sleep_onStefan Haberland2008-05-301-14/+14
| | | | | | | | | Use a generic wait_queue to prevent the wait_queue in dasd_sleep_on_ functions from being referenced by callback_data while it does not exist any more. Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] dasd: fix timeout handling in interrupt handlerStefan Weinhuber2008-05-151-2/+3
| | | | | | | | | | When the dasd_int_handler is called with an error code instead of an irb, the associated request should be restarted. This handling was missing from the -ETIMEDOUT case. In fact it should be done in any case. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
* [S390] Fix a lot of sparse warnings.Heiko Carstens2008-04-171-3/+2
| | | | | | | | | | | Most noteable part of this commit is the new local header file entry.h which contains all the function declarations of functions that get only called from asm code or are arch internal. That way we can avoid extern declarations in C files. This is more or less the same that was done for sparc64. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* [S390] replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-171-2/+2
| | | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* [S390] dasd: fix double elevator_exit call when deadline iosched fails to loadJosef 'Jeff' Sipek2008-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I compiled the kernel without deadline, and the dasd code exits the old scheduler (CFQ), fails to load the new one (deadline), and then things just hang - with one of these (sorry about the weird chars - I copy & pasted it from a 3270 console): dasd(eckd): 0.0.0151: 3390/0A(CU:3990/01) Cyl:3338 Head:15 Sec:224 ------------ cut here ------------ Badness at kernel/mutex.c:134 Modules linked in: dasd_eckd_mod dasd_mod CPU: 0 Not tainted 2.6.25-rc3 #9 Process exe (pid: 538, task: 000000000d172000, ksp: 000000000d21ef88) Krnl PSW : 0404000180000000 000000000022fb5c (mutex_lock_nested+0x2a4/0x2cc) R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:0 CC:0 PM:0 EA:3 Krnl GPRS: 0000000000024218 000000000076fc78 0000000000000000 000000000000000f 000000000022f92e 0000000000449898 000000000f921c00 000003e000162590 00000000001539c4 000000000d172000 070000007fffffff 000000000d21f400 000000000f8f2560 00000000002413f8 000000000022fb44 000000000d21f400 Krnl Code: 000000000022fb50: bf2f1000 icm %r2,15,0(%r1) 000000000022fb54: a774fef6 brc 7,22f940 000000000022fb58: a7f40001 brc 15,22fb5a >000000000022fb5c: a7f4fef2 brc 15,22f940 000000000022fb60: c0e5fffa112a brasl %r14,171db4 000000000022fb66: 1222 ltr %r2,%r2 000000000022fb68: a784fedb brc 8,22f91e 000000000022fb6c: c010002a0086 larl %r1,76fc78 Call Trace: (<000000000022f92e> mutex_lock_nested+0x76/0x2cc) <00000000001539c4> elevator_exit+0x38/0x80 <0000000000156ffe> blk_cleanup_queue+0x62/0x7c <000003e0001d5414> dasd_change_state+0xe0/0x8ec <000003e0001d5cae> dasd_set_target_state+0x8e/0x9c <000003e0001d5f74> dasd_generic_set_online+0x160/0x284 <000003e00011e83a> dasd_eckd_set_online+0x2e/0x40 <0000000000199bf4> ccw_device_set_online+0x170/0x2c0 <0000000000199d9e> online_store_recog_and_online+0x5a/0x14c <000000000019a08a> online_store+0xbe/0x2ec <000000000018456c> dev_attr_store+0x38/0x58 <000000000010efbc> sysfs_write_file+0x130/0x190 <00000000000af582> vfs_write+0xb2/0x160 <00000000000afc7c> sys_write+0x54/0x9c <0000000000025e16> sys32_write+0x2e/0x50 <0000000000024218> sysc_noemu+0x10/0x16 <0000000077e82bd2> 0x77e82bd2 Set elevator pointer to NULL in order to avoid double elevator_exit calls when elevator_init call for deadline iosched fails. Also make sure the dasd device driver depends on IOSCHED_DEADLINE so the default IO scheduler of the dasd driver is present. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
OpenPOWER on IntegriCloud