Commit Graph

153 Commits

Author SHA1 Message Date
David S. Miller
32e5897da1 openprom: Squelch useless GCC warning.
drivers/sbus/char/openprom.c: In function ‘openprom_sunos_ioctl’:
drivers/sbus/char/openprom.c:306: warning: ‘opp’ may be used uninitialized in this function

Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-16 04:56:57 -07:00
Tejun Heo
9934c8c045 block: implement and enforce request peek/start/fetch
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>
2009-05-11 09:52:18 +02:00
Tejun Heo
6b0bf407b5 jsflash: dequeue in-flight request
jsflash processes requests one-by-one synchronously from a kthread and
can be easily converted to dequeueing model.  Convert it.

[ Impact: dequeue in-flight request ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11 09:52:17 +02:00
Tejun Heo
1011c1b9f2 block: blk_rq_[cur_]_{sectors|bytes}() usage cleanup
With the previous changes, the followings are now guaranteed for all
requests in any valid state.

* blk_rq_sectors() == blk_rq_bytes() >> 9
* blk_rq_cur_sectors() == blk_rq_cur_bytes() >> 9

Clean up accessor usages.  Notable changes are

* nbd,i2o_block: end_all used instead of explicit byte count
* scsi_lib: unnecessary conditional on request type removed

[ Impact: cleanup ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Paul Clements <paul.clements@steeleye.com>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11 09:50:55 +02:00
Tejun Heo
83096ebf12 block: convert to pos and nr_sectors accessors
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>
2009-05-11 09:50:54 +02:00
Tejun Heo
f06d9a2b52 block: replace end_request() with [__]blk_end_request_cur()
end_request() has been kept around for backward compatibility;
however, it's about time for it to go away.

* There aren't too many users left.

* Its use of @updtodate is pretty confusing.

* In some cases, newer code ends up using mixture of end_request() and
  [__]blk_end_request[_all](), which is way too confusing.

So, add [__]blk_end_request_cur() and replace end_request() with it.
Most conversions are straightforward.  Noteworthy ones are...

* paride/pcd: next_request() updated to take 0/-errno instead of 1/0.

* paride/pf: pf_end_request() and next_request() updated to take
  0/-errno instead of 1/0.

* xd: xd_readwrite() updated to return 0/-errno instead of 1/0.

* mtd/mtd_blkdevs: blktrans_discard_request() updated to return
  0/-errno instead of 1/0.  Unnecessary local variable res
  initialization removed from mtd_blktrans_thread().

[ Impact: cleanup ]

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Joerg Dorchain <joerg@dorchain.net>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Laurent Vivier <Laurent@lvivier.info>
Cc: Tim Waugh <tim@cyberelk.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Markus Lidel <Markus.Lidel@shadowconnect.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Pete Zaitcev <zaitcev@redhat.com>
Cc: unsik Kim <donari75@gmail.com>
2009-04-28 07:37:36 +02:00
Stoyan Gaydarov
6c0f8bc772 sbus: changed ioctls to unlocked
Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-14 19:46:19 -07:00
Scott James Remnant
1c339eb183 sbus: Auto-load openprom module when device opened.
The openprom module is missing the char-major-10-139 alias that would
cause it to be auto-loaded when a device of that type is opened.  This
patch adds the alias.

Signed-off-by: Scott James Remnant <scott@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-13 14:30:08 -07:00
Roel Kluin
f4c1363818 sparc64: wait_event_interruptible_timeout may return -ERESTARTSYS
wait_event_interruptible_timeout may return -ERESTARTSYS.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-04 00:19:28 -08:00
Christoph Hellwig
c21986a762 jsflash: stop defining MAJOR_NR
Ever since early 2.5 kernels block drivers don't need to define MAJOR_NR
anymore, so use the JSFD_MAJOR defined directly and kill it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-04 00:18:11 -08:00
Sam Ravnborg
3f4528d6e9 sparc64: Fix unsigned long long warnings in drivers.
Fix warnings caused by the unsigned long long usage in sparc
specific drivers.

The drivers were considered sparc specific more or less from the
filename alone.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-06 13:20:38 -08:00
Linus Torvalds
33b07db9f3 Revert "of_platform_driver noise on sparce"
This reverts commit e669dae614, since it
is incomplete, and clashes with fuller patches and the sparc 32/64
unification effort.

Requested-by: David Miller <davem@davemloft.net>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-12-01 07:55:14 -08:00
Al Viro
e669dae614 of_platform_driver noise on sparce
switch to __init for those; unlike powerpc sparc has no hotplug support
for that stuff and their ->probe() tends to call __init functions while
being declared __devinit.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-30 10:03:36 -08:00
Jianjun Kong
54074d5932 drivers: remove duplicated #include
Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-04 08:18:19 -08:00
David S. Miller
eed795bf1f sparc: Kill sbus mostek RTC driver.
No longer used.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-09-03 15:55:32 -07:00
David S. Miller
fd098316ef sparc: Annotate of_device_id arrays with const or __initdata.
As suggested by Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-31 01:23:17 -07:00
David S. Miller
39890072b3 bbc_envctrl: Fix build errors from bbc_i2c OF conversion.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 22:55:14 -07:00
David S. Miller
e21e245bcd bbc_i2c: Convert to pure OF driver.
This thing was a mess, who wrote this junk? :)

Luckily we'll soon have nice generic I2C layer drivers for this PCF
based I2C stuff on sparc64.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 22:34:14 -07:00
David S. Miller
6b8c90f24e envctrl: Convert to pure OF driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 21:05:15 -07:00
David S. Miller
95d4390579 display7seg: Convert to pure OF device driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 18:01:58 -07:00
David S. Miller
8ab0dc333e cpwatchdog: Move to drivers/watchdog/cpwd.c
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 17:07:01 -07:00
David S. Miller
c5f8556cb5 cpwatchdog: Cleanup and convert to pure OF driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 17:05:51 -07:00
David S. Miller
957183f32e riowatchdog: Move under drivers/watchdog
The config stuff was already in drivers/watchdog/Kconfig

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 15:40:24 -07:00
David S. Miller
e42311d751 riowatchdog: Convert to pure OF driver.
This also cleans up a lot of crud in this driver:

1) Don't touch the BBC regs, just leave the watchdog trigger
   behavior whatever the firmware programmed it to.

2) Use WATCHDOG_MINOR instead of hardcoded and not properly
   allocated RIOWD_MINOR.

Hey, I haven't touched it since I wrote it years ago :-)

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 15:35:59 -07:00
David S. Miller
046e26a8ba sparc: Remove generic SBUS probing layer.
The individual SBUS IOMMU arch code now sets the IOMMU information
directly into the OF device objects.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:21 -07:00
David S. Miller
f8e4d32cb5 sparc: Kill sbus_arch_preinit().
32-bit sparc just needed it to register the ioport procfs bits, do this
via an arch_initcall() instead.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:19 -07:00
David S. Miller
c6e5f661ee sparc: Kill OBP property members of sbus_dev and sbus_bus
Unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:18 -07:00
David S. Miller
98261dd1a3 sparc: Remove dinky old-style SBUS probing facilities.
No drivers or code uses this stuff any more, every driver has been
converted over to OF device probing.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:12 -07:00
David S. Miller
104364810f sparc: Remove SBUS layer resource and irq handling.
All the drivers use OF device objects now for this
information.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:11 -07:00
David S. Miller
33c4655c00 sparc: Kill SBUS layer IRQ hooks.
IRQs are obtained by drivers from the of_device struct.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:10 -07:00
David S. Miller
237f8aafa3 sparc: Convert uctrl driver to OF driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:01 -07:00
David S. Miller
a9540d3422 sparc: Convert flash driver to OF device probing.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:15:00 -07:00
David S. Miller
5778002874 sparc: Propagate SBUS iommu archdata into real of_device objects.
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:12 -07:00
David S. Miller
334ae61477 sparc: Kill SBUS DVMA layer.
This thing was completely pointless.

Just find the OF device in the parent of drivers that want to program
this device, and map the DMA regs inside such drivers too.

This also moves the dummy claim_dma_lock() and release_dma_lock()
implementation to floppy_32.h, which makes it handle this issue
just like floppy_64.h does.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:10 -07:00
David S. Miller
7f06a3b2c1 sparc: Kill videopix SBUS driver.
This has been marked BROKEN for a long time and it's more likely
to get rewritten from scratch than to be fixed up and made usable.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:09 -07:00
David S. Miller
902663f6ea sparc: Delete bare sbus char bpp driver, obsoleted by parport_sunbpp
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-29 02:13:08 -07:00
Stephen Rothwell
c6ed413ddc sparc/drivers: use linux/of_device.h instead of asm/of_device.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-08-11 14:30:53 -07:00
Greg Kroah-Hartman
2222c313e9 sparc64: fix up bus_id changes in sparc core code
This converts all instances of bus_id in the sparc core kernel to use
either dev_set_name(), or dev_name() depending on the need.

This is done in anticipation of removing the bus_id field from struct
driver.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:55:03 -07:00
Adrian Bunk
960681450f drivers/sbus/: cleanups
This patch contains the following cleanups:
- make the following needlessly global code static:
  - char/uctrl.c: uctrl_get_event_status()
  - char/uctrl.c: uctrl_get_external_status()
  - char/vfc_dev.c: struct vfc_dev_lst
  - char/vfc_dev.c: vfc_lock_device()
  - char/vfc_dev.c: vfc_unlock_device()
  - char/vfc_dev.c: vfc_captstat_reset()
  - char/vfc_dev.c: vfc_memptr_reset()
  - char/vfc_dev.c: vfc_csr_init()
  - char/vfc_dev.c: vfc_saa9051_init()
  - char/vfc_dev.c: init_vfc_hw()
  - char/vfc_dev.c: init_vfc_devstruct()
  - char/vfc_dev.c: init_vfc_device()
  - char/vfc_dev.c: vfc_get_dev_ptr()
  - char/vfc_dev.c: vfc_capture_start()
  - char/vfc_dev.c: vfc_capture_poll()
  - char/vfc_dev.c: vfc_port_change_ioctl()
  - char/vfc_dev.c: vfc_set_video_ioctl()
  - char/vfc_dev.c: vfc_get_video_ioctl()
  - char/vfc_i2c.c: vfc_i2c_wait_for_bus()
  - char/vfc_i2c.c: vfc_i2c_wait_for_pin()
  - char/vfc_i2c.c: vfc_i2c_xmit_addr()
  - char/vfc_i2c.c: vfc_i2c_xmit_byte()
  - char/vfc_i2c.c: vfc_i2c_recv_byte()
  - dvma.c: init_one_dvma()
- remove an unused variable from a function:
  - char/uctrl.c: ts102_uctrl_init()
- remove the following unused and empty function:
  - char/uctrl.c: uctrl_set_video()

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-07-17 21:38:17 -07:00
Jonathan Corbet
2fceef397f Merge commit 'v2.6.26' into bkl-removal 2008-07-14 15:29:34 -06:00
Arnd Bergmann
f138e4814a uctrl: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-07-02 15:06:25 -06:00
Arnd Bergmann
5ab0854dd7 sbus-rtc: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-07-02 15:06:24 -06:00
Arnd Bergmann
f29b889ede riowatchdog: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-07-02 15:06:24 -06:00
Arnd Bergmann
7bcc3209be openprom: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-07-02 15:06:24 -06:00
Arnd Bergmann
28fbbf4913 jsflash: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-06-20 14:05:58 -06:00
Arnd Bergmann
78abb6ac91 flash: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-06-20 14:05:57 -06:00
Arnd Bergmann
1d17bf0c08 envctrl: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-06-20 14:05:56 -06:00
Arnd Bergmann
009228dfb6 display7seg: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-06-20 14:05:55 -06:00
Arnd Bergmann
b05c9e6cd9 cpwatchdog: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2008-06-20 14:05:55 -06:00
Jonathan Corbet
9aaf20cbf5 videopix: BKL pushdown
Add explicit lock_kernel() calls to vfc_open().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2008-06-20 14:05:52 -06:00