Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Mar 2008 14:48:23 +0000 (07:48 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Mar 2008 14:48:23 +0000 (07:48 -0700)
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
  ACPI: Set flag DOCK_UNDOCKING when triggered via sysfs
  Revert "ACPI: video: Ignore devices that aren't present in hardware"
  asus_acpi: remove misleading mask
  Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
  thermal: delete "default y"
  thermal: re-document thermal units
  Revert "thermal: fix generic thermal I/F for hwmon"
  ACPI: fix ATA_ACPI build
  ACPI: battery: Don't return -EFAIL on broken packages.
  ACPI: lockdep warning on boot, 2.6.25-rc5

32 files changed:
Documentation/input/notifier.txt [new file with mode: 0644]
Documentation/kernel-parameters.txt
Documentation/mca.txt
drivers/block/Kconfig
drivers/block/Makefile
drivers/block/ps2esdi.c [deleted file]
drivers/char/drm/ati_pcigart.c
drivers/char/drm/drmP.h
drivers/char/drm/drm_fops.c
drivers/char/drm/drm_lock.c
drivers/char/drm/drm_pciids.h
drivers/char/drm/r128_cce.c
drivers/char/drm/radeon_cp.c
drivers/char/drm/via_dma.c
drivers/char/drm/via_dmablit.c
drivers/input/misc/cobalt_btns.c
drivers/input/mouse/alps.c
drivers/input/serio/i8042-snirm.h [new file with mode: 0644]
drivers/input/serio/i8042-x86ia64io.h
drivers/input/serio/i8042.c
drivers/input/serio/i8042.h
drivers/input/tablet/wacom.h
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.c
drivers/input/tablet/wacom_wac.h
drivers/input/touchscreen/ads7846.c
drivers/pci/hotplug/pciehp_core.c
fs/bio.c
include/linux/Kbuild
include/linux/ps2esdi.h [deleted file]
kernel/relay.c
security/selinux/hooks.c

diff --git a/Documentation/input/notifier.txt b/Documentation/input/notifier.txt
new file mode 100644 (file)
index 0000000..95172ca
--- /dev/null
@@ -0,0 +1,52 @@
+Keyboard notifier
+
+One can use register_keyboard_notifier to get called back on keyboard
+events (see kbd_keycode() function for details).  The passed structure is
+keyboard_notifier_param:
+
+- 'vc' always provide the VC for which the keyboard event applies;
+- 'down' is 1 for a key press event, 0 for a key release;
+- 'shift' is the current modifier state, mask bit indexes are KG_*;
+- 'value' depends on the type of event.
+
+- KBD_KEYCODE events are always sent before other events, value is the keycode.
+- KBD_UNBOUND_KEYCODE events are sent if the keycode is not bound to a keysym.
+  value is the keycode.
+- KBD_UNICODE events are sent if the keycode -> keysym translation produced a
+  unicode character. value is the unicode value.
+- KBD_KEYSYM events are sent if the keycode -> keysym translation produced a
+  non-unicode character. value is the keysym.
+- KBD_POST_KEYSYM events are sent after the treatment of non-unicode keysyms.
+  That permits one to inspect the resulting LEDs for instance.
+
+For each kind of event but the last, the callback may return NOTIFY_STOP in
+order to "eat" the event: the notify loop is stopped and the keyboard event is
+dropped.
+
+In a rough C snippet, we have:
+
+kbd_keycode(keycode) {
+       ...
+       params.value = keycode;
+       if (notifier_call_chain(KBD_KEYCODE,&params) == NOTIFY_STOP)
+           || !bound) {
+               notifier_call_chain(KBD_UNBOUND_KEYCODE,&params);
+               return;
+       }
+
+       if (unicode) {
+               param.value = unicode;
+               if (notifier_call_chain(KBD_UNICODE,&params) == NOTIFY_STOP)
+                       return;
+               emit unicode;
+               return;
+       }
+
+       params.value = keysym;
+       if (notifier_call_chain(KBD_KEYSYM,&params) == NOTIFY_STOP)
+               return;
+       apply keysym;
+       notifier_call_chain(KBD_POST_KEYSYM,&params);
+}
+
+NOTE: This notifier is usually called from interrupt context.
index 622f7849edb968024f6879927aa7c6a2e008f695..650b0d8aa89b7bde17ca17c1ee54ad37e57f7480 100644 (file)
@@ -732,6 +732,8 @@ and is between 256 and 4096 characters. It is defined in the file
                             (Don't attempt to blink the leds)
        i8042.noaux     [HW] Don't check for auxiliary (== mouse) port
        i8042.nokbd     [HW] Don't check/create keyboard port
+       i8042.noloop    [HW] Disable the AUX Loopback command while probing
+                            for the AUX port
        i8042.nomux     [HW] Don't check presence of an active multiplexing
                             controller
        i8042.nopnp     [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX
index aabce4ad90f98fefce10850c04bbae8ab81b7ef3..510375d4209a608c2452dc7b631fb045ba7e83fa 100644 (file)
@@ -143,14 +143,7 @@ MCA Device Drivers
 
 Currently, there are a number of MCA-specific device drivers.
 
-1) PS/2 ESDI
-       drivers/block/ps2esdi.c
-       include/linux/ps2esdi.h
-   Uses major number 36, and should use /dev files /dev/eda, /dev/edb.
-   Supports two drives, but only one controller.  May use the
-   command-line args "ed=cyl,head,sec" and "tp720".
-
-2) PS/2 SCSI
+1) PS/2 SCSI
        drivers/scsi/ibmmca.c
        drivers/scsi/ibmmca.h
    The driver for the IBM SCSI subsystem.  Includes both integrated
@@ -159,25 +152,25 @@ Currently, there are a number of MCA-specific device drivers.
    machine with a front-panel display (i.e. model 95), you can use
    "ibmmcascsi=display" to enable a drive activity indicator.
 
-3) 3c523
+2) 3c523
        drivers/net/3c523.c
        drivers/net/3c523.h
    3Com 3c523 Etherlink/MC ethernet driver.
 
-4) SMC Ultra/MCA and IBM Adapter/A
+3) SMC Ultra/MCA and IBM Adapter/A
        drivers/net/smc-mca.c
        drivers/net/smc-mca.h
        Driver for the MCA version of the SMC Ultra and various other
        OEM'ed and work-alike cards (Elite, Adapter/A, etc).
 
-5) NE/2
+4) NE/2
        driver/net/ne2.c
        driver/net/ne2.h
        The NE/2 is the MCA version of the NE2000.  This may not work
        with clones that have a different adapter id than the original
        NE/2.
 
-6) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and
+5) Future Domain MCS-600/700, OEM'd IBM Fast SCSI Adapter/A and
    Reply Sound Blaster/SCSI (SCSI part)
        Better support for these cards than the driver for ISA.
    Supports multiple cards with IRQ sharing.
index b6d230b3209f24567be22208be6d8236af88282d..0d1d2133d9bc239fe800a3e64c05ceef6c1e898a 100644 (file)
@@ -44,16 +44,6 @@ config MAC_FLOPPY
          If you have a SWIM-3 (Super Woz Integrated Machine 3; from Apple)
          floppy controller, say Y here. Most commonly found in PowerMacs.
 
-config BLK_DEV_PS2
-       tristate "PS/2 ESDI hard disk support"
-       depends on MCA && MCA_LEGACY && BROKEN
-       help
-         Say Y here if you have a PS/2 machine with a MCA bus and an ESDI
-         hard disk.
-
-         To compile this driver as a module, choose M here: the
-         module will be called ps2esdi.
-
 config AMIGA_Z2RAM
        tristate "Amiga Zorro II ramdisk support"
        depends on ZORRO
index 01c972415cb29c8ed5fcfae76972d622e4833b0c..5e584306be9992aae29c39a0c7221bdc82f053c8 100644 (file)
@@ -13,7 +13,6 @@ obj-$(CONFIG_ATARI_FLOPPY)    += ataflop.o
 obj-$(CONFIG_AMIGA_Z2RAM)      += z2ram.o
 obj-$(CONFIG_BLK_DEV_RAM)      += brd.o
 obj-$(CONFIG_BLK_DEV_LOOP)     += loop.o
-obj-$(CONFIG_BLK_DEV_PS2)      += ps2esdi.o
 obj-$(CONFIG_BLK_DEV_XD)       += xd.o
 obj-$(CONFIG_BLK_CPQ_DA)       += cpqarray.o
 obj-$(CONFIG_BLK_CPQ_CISS_DA)  += cciss.o
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
deleted file mode 100644 (file)
index 3c796e2..0000000
+++ /dev/null
@@ -1,1079 +0,0 @@
-/* ps2esdi driver based on assembler code by Arindam Banerji,
-   written by Peter De Schrijver */
-/* Reassuring note to IBM : This driver was NOT developed by vice-versa
-   engineering the PS/2's BIOS */
-/* Dedicated to Wannes, Tofke, Ykke, Godot, Killroy and all those 
-   other lovely fish out there... */
-/* This code was written during the long and boring WINA 
-   elections 1994 */
-/* Thanks to Arindam Banerij for giving me the source of his driver */
-/* This code may be freely distributed and modified in any way, 
-   as long as these notes remain intact */
-
-/*  Revised: 05/07/94 by Arindam Banerji (axb@cse.nd.edu) */
-/*  Revised: 09/08/94 by Peter De Schrijver (stud11@cc4.kuleuven.ac.be)
-   Thanks to Arindam Banerij for sending me the docs of the adapter */
-
-/* BA Modified for ThinkPad 720 by Boris Ashkinazi */
-/*                    (bash@vnet.ibm.com) 08/08/95 */
-
-/* Modified further for ThinkPad-720C by Uri Blumenthal */
-/*                    (uri@watson.ibm.com) Sep 11, 1995 */
-
-/* TODO : 
-   + Timeouts
-   + Get disk parameters
-   + DMA above 16MB
-   + reset after read/write error
- */
-
-#define DEVICE_NAME "PS/2 ESDI"
-
-#include <linux/major.h>
-#include <linux/errno.h>
-#include <linux/wait.h>
-#include <linux/interrupt.h>
-#include <linux/fs.h>
-#include <linux/kernel.h>
-#include <linux/genhd.h>
-#include <linux/ps2esdi.h>
-#include <linux/blkdev.h>
-#include <linux/mca-legacy.h>
-#include <linux/init.h>
-#include <linux/ioport.h>
-#include <linux/module.h>
-#include <linux/hdreg.h>
-
-#include <asm/system.h>
-#include <asm/io.h>
-#include <asm/dma.h>
-#include <asm/mca_dma.h>
-#include <asm/uaccess.h>
-
-#define PS2ESDI_IRQ 14
-#define MAX_HD 2
-#define MAX_RETRIES 5
-#define MAX_16BIT 65536
-#define ESDI_TIMEOUT   0xf000
-#define ESDI_STAT_TIMEOUT 4
-
-#define TYPE_0_CMD_BLK_LENGTH 2
-#define TYPE_1_CMD_BLK_LENGTH 4
-
-static void reset_ctrl(void);
-
-static int ps2esdi_geninit(void);
-
-static void do_ps2esdi_request(struct request_queue * q);
-
-static void ps2esdi_readwrite(int cmd, struct request *req);
-
-static void ps2esdi_fill_cmd_block(u_short * cmd_blk, u_short cmd,
-u_short cyl, u_short head, u_short sector, u_short length, u_char drive);
-
-static int ps2esdi_out_cmd_blk(u_short * cmd_blk);
-
-static void ps2esdi_prep_dma(char *buffer, u_short length, u_char dma_xmode);
-
-static irqreturn_t ps2esdi_interrupt_handler(int irq, void *dev_id);
-static void (*current_int_handler) (u_int) = NULL;
-static void ps2esdi_normal_interrupt_handler(u_int);
-static void ps2esdi_initial_reset_int_handler(u_int);
-static void ps2esdi_geometry_int_handler(u_int);
-static int ps2esdi_getgeo(struct block_device *bdev, struct hd_geometry *geo);
-
-static int ps2esdi_read_status_words(int num_words, int max_words, u_short * buffer);
-
-static void dump_cmd_complete_status(u_int int_ret_code);
-
-static void ps2esdi_get_device_cfg(void);
-
-static void ps2esdi_reset_timer(unsigned long unused);
-
-static u_int dma_arb_level;            /* DMA arbitration level */
-
-static DECLARE_WAIT_QUEUE_HEAD(ps2esdi_int);
-
-static int no_int_yet;
-static int ps2esdi_drives;
-static u_short io_base;
-static DEFINE_TIMER(esdi_timer, ps2esdi_reset_timer, 0, 0);
-static int reset_status;
-static int ps2esdi_slot = -1;
-static int tp720esdi = 0;      /* Is it Integrated ESDI of ThinkPad-720? */
-static int intg_esdi = 0;       /* If integrated adapter */
-struct ps2esdi_i_struct {
-       unsigned int head, sect, cyl, wpcom, lzone, ctl;
-};
-static DEFINE_SPINLOCK(ps2esdi_lock);
-static struct request_queue *ps2esdi_queue;
-static struct request *current_req;
-
-#if 0
-#if 0                          /* try both - I don't know which one is better... UB */
-static struct ps2esdi_i_struct ps2esdi_info[MAX_HD] =
-{
-       {4, 48, 1553, 0, 0, 0},
-       {0, 0, 0, 0, 0, 0}};
-#else
-static struct ps2esdi_i_struct ps2esdi_info[MAX_HD] =
-{
-       {64, 32, 161, 0, 0, 0},
-       {0, 0, 0, 0, 0, 0}};
-#endif
-#endif
-static struct ps2esdi_i_struct ps2esdi_info[MAX_HD] =
-{
-       {0, 0, 0, 0, 0, 0},
-       {0, 0, 0, 0, 0, 0}};
-
-static struct block_device_operations ps2esdi_fops =
-{
-       .owner          = THIS_MODULE,
-       .getgeo         = ps2esdi_getgeo,
-};
-
-static struct gendisk *ps2esdi_gendisk[2];
-
-/* initialization routine called by ll_rw_blk.c   */
-static int __init ps2esdi_init(void)
-{
-
-       int error = 0;
-
-       /* register the device - pass the name and major number */
-       if (register_blkdev(PS2ESDI_MAJOR, "ed"))
-               return -EBUSY;
-
-       /* set up some global information - indicating device specific info */
-       ps2esdi_queue = blk_init_queue(do_ps2esdi_request, &ps2esdi_lock);
-       if (!ps2esdi_queue) {
-               unregister_blkdev(PS2ESDI_MAJOR, "ed");
-               return -ENOMEM;
-       }
-
-       /* some minor housekeeping - setup the global gendisk structure */
-       error = ps2esdi_geninit();
-       if (error) {
-               printk(KERN_WARNING "PS2ESDI: error initialising"
-                       " device, releasing resources\n");
-               unregister_blkdev(PS2ESDI_MAJOR, "ed");
-               blk_cleanup_queue(ps2esdi_queue);
-               return error;
-       }
-       return 0;
-}                              /* ps2esdi_init */
-
-#ifndef MODULE
-
-module_init(ps2esdi_init);
-
-#else
-
-static int cyl[MAX_HD] = {-1,-1};
-static int head[MAX_HD] = {-1, -1};
-static int sect[MAX_HD] = {-1, -1};
-
-module_param(tp720esdi, bool, 0);
-module_param_array(cyl, int, NULL, 0);
-module_param_array(head, int, NULL, 0);
-module_param_array(sect, int, NULL, 0);
-MODULE_LICENSE("GPL");
-
-int init_module(void) {
-       int drive;
-
-       for(drive = 0; drive < MAX_HD; drive++) {
-               struct ps2esdi_i_struct *info = &ps2esdi_info[drive];
-
-               if (cyl[drive] != -1) {
-                       info->cyl = info->lzone = cyl[drive];
-                       info->wpcom = 0;
-               }
-               if (head[drive] != -1) {
-                       info->head = head[drive];
-                       info->ctl = (head[drive] > 8 ? 8 : 0);
-               }
-               if (sect[drive] != -1) info->sect = sect[drive];
-       }
-       return ps2esdi_init();
-}
-
-void
-cleanup_module(void) {
-       int i;
-       if(ps2esdi_slot) {
-               mca_mark_as_unused(ps2esdi_slot);
-               mca_set_adapter_procfn(ps2esdi_slot, NULL, NULL);
-       }
-       release_region(io_base, 4);
-       free_dma(dma_arb_level);
-       free_irq(PS2ESDI_IRQ, &ps2esdi_gendisk);
-       unregister_blkdev(PS2ESDI_MAJOR, "ed");
-       blk_cleanup_queue(ps2esdi_queue);
-       for (i = 0; i < ps2esdi_drives; i++) {
-               del_gendisk(ps2esdi_gendisk[i]);
-               put_disk(ps2esdi_gendisk[i]);
-       }
-}
-#endif /* MODULE */
-
-/* handles boot time command line parameters */
-void __init tp720_setup(char *str, int *ints)
-{
-       /* no params, just sets the tp720esdi flag if it exists */
-
-       printk("%s: TP 720 ESDI flag set\n", DEVICE_NAME);
-       tp720esdi = 1;
-}
-
-void __init ed_setup(char *str, int *ints)
-{
-       int hdind = 0;
-
-       /* handles 3 parameters only - corresponding to
-          1. Number of cylinders
-          2. Number of heads
-          3. Sectors/track
-        */
-
-       if (ints[0] != 3)
-               return;
-
-       /* print out the information - seen at boot time */
-       printk("%s: ints[0]=%d ints[1]=%d ints[2]=%d ints[3]=%d\n",
-              DEVICE_NAME, ints[0], ints[1], ints[2], ints[3]);
-
-       /* set the index into device specific information table */
-       if (ps2esdi_info[0].head != 0)
-               hdind = 1;
-
-       /* set up all the device information */
-       ps2esdi_info[hdind].head = ints[2];
-       ps2esdi_info[hdind].sect = ints[3];
-       ps2esdi_info[hdind].cyl = ints[1];
-       ps2esdi_info[hdind].wpcom = 0;
-       ps2esdi_info[hdind].lzone = ints[1];
-       ps2esdi_info[hdind].ctl = (ints[2] > 8 ? 8 : 0);
-#if 0                          /* this may be needed for PS2/Mod.80, but it hurts ThinkPad! */
-       ps2esdi_drives = hdind + 1;     /* increment index for the next time */
-#endif
-}                              /* ed_setup */
-
-static int ps2esdi_getinfo(char *buf, int slot, void *d)
-{
-       int len = 0;
-
-       len += sprintf(buf + len, "DMA Arbitration Level: %d\n",
-                      dma_arb_level);
-       len += sprintf(buf + len, "IO Port: %x\n", io_base);
-       len += sprintf(buf + len, "IRQ: 14\n");
-       len += sprintf(buf + len, "Drives: %d\n", ps2esdi_drives);
-
-       return len;
-}
-
-/* ps2 esdi specific initialization - called thru the gendisk chain */
-static int __init ps2esdi_geninit(void)
-{
-       /*
-          The first part contains the initialization code
-          for the ESDI disk subsystem.  All we really do
-          is search for the POS registers of the controller
-          to do some simple setup operations.  First, we
-          must ensure that the controller is installed,
-          enabled, and configured as PRIMARY.  Then we must
-          determine the DMA arbitration level being used by
-          the controller so we can handle data transfer
-          operations properly.  If all of this works, then
-          we will set the INIT_FLAG to a non-zero value.
-        */
-
-       int slot = 0, i, reset_start, reset_end;
-       u_char status;
-       unsigned short adapterID;
-       int error = 0;
-
-       if ((slot = mca_find_adapter(INTG_ESDI_ID, 0)) != MCA_NOTFOUND) {
-               adapterID = INTG_ESDI_ID;
-               printk("%s: integrated ESDI adapter found in slot %d\n",
-                      DEVICE_NAME, slot+1);
-#ifndef MODULE
-               mca_set_adapter_name(slot, "PS/2 Integrated ESDI");
-#endif
-       } else if ((slot = mca_find_adapter(NRML_ESDI_ID, 0)) != -1) {
-               adapterID = NRML_ESDI_ID;
-               printk("%s: normal ESDI adapter found in slot %d\n",
-                      DEVICE_NAME, slot+1);
-               mca_set_adapter_name(slot, "PS/2 ESDI");
-       } else {
-               return -ENODEV;
-       }
-
-       ps2esdi_slot = slot;
-       mca_mark_as_used(slot);
-       mca_set_adapter_procfn(slot, (MCA_ProcFn) ps2esdi_getinfo, NULL);
-
-       /* Found the slot - read the POS register 2 to get the necessary
-          configuration and status information.  POS register 2 has the
-          following information :
-          Bit           Function
-          7             reserved = 0
-          6             arbitration method
-          0 - fairness enabled
-          1 - fairness disabled, linear priority assignment
-          5-2           arbitration level
-          1             alternate address
-          1              alternate address
-          0 - use addresses 0x3510 - 0x3517
-          0             adapter enable
-        */
-
-       status = mca_read_stored_pos(slot, 2);
-       /* is it enabled ? */
-       if (!(status & STATUS_ENABLED)) {
-               printk("%s: ESDI adapter disabled\n", DEVICE_NAME);
-               error = -ENODEV;
-               goto err_out1;
-       }
-       /* try to grab IRQ, and try to grab a slow IRQ if it fails, so we can
-          share with the SCSI driver */
-       if (request_irq(PS2ESDI_IRQ, ps2esdi_interrupt_handler,
-                 IRQF_DISABLED | IRQF_SHARED, "PS/2 ESDI", &ps2esdi_gendisk)
-           && request_irq(PS2ESDI_IRQ, ps2esdi_interrupt_handler,
-                          IRQF_SHARED, "PS/2 ESDI", &ps2esdi_gendisk)
-           ) {
-               printk("%s: Unable to get IRQ %d\n", DEVICE_NAME, PS2ESDI_IRQ);
-               error = -EBUSY;
-               goto err_out1;
-       }
-       if (status & STATUS_ALTERNATE)
-               io_base = ALT_IO_BASE;
-       else
-               io_base = PRIMARY_IO_BASE;
-
-       if (!request_region(io_base, 4, "ed")) {
-               printk(KERN_WARNING"Unable to request region 0x%x\n", io_base);
-               error = -EBUSY;
-               goto err_out2;
-       }
-       /* get the dma arbitration level */
-       dma_arb_level = (status >> 2) & 0xf;
-
-       /* BA */
-       printk("%s: DMA arbitration level : %d\n",
-              DEVICE_NAME, dma_arb_level);
-
-       LITE_ON;
-       current_int_handler = ps2esdi_initial_reset_int_handler;
-       reset_ctrl();
-       reset_status = 0;
-       reset_start = jiffies;
-       while (!reset_status) {
-               init_timer(&esdi_timer);
-               esdi_timer.expires = jiffies + HZ;
-               esdi_timer.data = 0;
-               add_timer(&esdi_timer);
-               sleep_on(&ps2esdi_int);
-       }
-       reset_end = jiffies;
-       LITE_OFF;
-       printk("%s: reset interrupt after %d jiffies,  %u.%02u secs\n",
-              DEVICE_NAME, reset_end - reset_start, (reset_end - reset_start) / HZ,
-              (reset_end - reset_start) % HZ);
-
-
-       /* Integrated ESDI Disk and Controller has only one drive! */
-       if (adapterID == INTG_ESDI_ID) {/* if not "normal" PS2 ESDI adapter */
-               ps2esdi_drives = 1;     /* then we have only one physical disk! */              intg_esdi = 1;
-       }
-
-
-
-       /* finally this part sets up some global data structures etc. */
-
-       ps2esdi_get_device_cfg();
-
-       /* some annoyance in the above routine returns TWO drives?
-        Is something else happining in the background?
-        Regaurdless we fix the # of drives again. AJK */
-       /* Integrated ESDI Disk and Controller has only one drive! */
-       if (adapterID == INTG_ESDI_ID)  /* if not "normal" PS2 ESDI adapter */
-               ps2esdi_drives = 1;     /* Not three or two, ONE DAMNIT! */
-
-       current_int_handler = ps2esdi_normal_interrupt_handler;
-
-       if (request_dma(dma_arb_level, "ed") !=0) {
-               printk(KERN_WARNING "PS2ESDI: Can't request dma-channel %d\n"
-                       ,(int) dma_arb_level);
-               error = -EBUSY;
-               goto err_out3;
-       }
-       blk_queue_max_sectors(ps2esdi_queue, 128);
-
-       error = -ENOMEM;
-       for (i = 0; i < ps2esdi_drives; i++) {
-               struct gendisk *disk = alloc_disk(64);
-               if (!disk)
-                       goto err_out4;
-               disk->major = PS2ESDI_MAJOR;
-               disk->first_minor = i<<6;
-               sprintf(disk->disk_name, "ed%c", 'a'+i);
-               disk->fops = &ps2esdi_fops;
-               ps2esdi_gendisk[i] = disk;
-       }
-
-       for (i = 0; i < ps2esdi_drives; i++) {
-               struct gendisk *disk = ps2esdi_gendisk[i];
-               set_capacity(disk, ps2esdi_info[i].head * ps2esdi_info[i].sect *
-                               ps2esdi_info[i].cyl);
-               disk->queue = ps2esdi_queue;
-               disk->private_data = &ps2esdi_info[i];
-               add_disk(disk);
-       }
-       return 0;
-err_out4:
-       while (i--)
-               put_disk(ps2esdi_gendisk[i]);
-err_out3:
-       release_region(io_base, 4);
-err_out2:
-       free_irq(PS2ESDI_IRQ, &ps2esdi_gendisk);
-err_out1:
-       if(ps2esdi_slot) {
-               mca_mark_as_unused(ps2esdi_slot);
-               mca_set_adapter_procfn(ps2esdi_slot, NULL, NULL);
-       }
-       return error;
-}
-
-static void __init ps2esdi_get_device_cfg(void)
-{
-       u_short cmd_blk[TYPE_0_CMD_BLK_LENGTH];
-
-       /*BA */ printk("%s: Drive 0\n", DEVICE_NAME);
-       current_int_handler = ps2esdi_geometry_int_handler;
-       cmd_blk[0] = CMD_GET_DEV_CONFIG | 0x600;
-       cmd_blk[1] = 0;
-       no_int_yet = TRUE;
-       ps2esdi_out_cmd_blk(cmd_blk);
-       if (no_int_yet)
-               sleep_on(&ps2esdi_int);
-
-       if (ps2esdi_drives > 1) {
-               printk("%s: Drive 1\n", DEVICE_NAME);   /*BA */
-               cmd_blk[0] = CMD_GET_DEV_CONFIG | (1 << 5) | 0x600;
-               cmd_blk[1] = 0;
-               no_int_yet = TRUE;
-               ps2esdi_out_cmd_blk(cmd_blk);
-               if (no_int_yet)
-                       sleep_on(&ps2esdi_int);
-       }                       /* if second physical drive is present */
-       return;
-}
-
-/* strategy routine that handles most of the IO requests */
-static void do_ps2esdi_request(struct request_queue * q)
-{
-       struct request *req;
-       /* since, this routine is called with interrupts cleared - they 
-          must be before it finishes  */
-
-       req = elv_next_request(q);
-       if (!req)
-               return;
-
-#if 0
-       printk("%s:got request. device : %s command : %d  sector : %ld count : %ld, buffer: %p\n",
-              DEVICE_NAME,
-              req->rq_disk->disk_name,
-              req->cmd, req->sector,
-              req->current_nr_sectors, req->buffer);
-#endif
-
-       /* check for above 16Mb dmas */
-       if (isa_virt_to_bus(req->buffer + req->current_nr_sectors * 512) > 16 * MB) {
-               printk("%s: DMA above 16MB not supported\n", DEVICE_NAME);
-               end_request(req, FAIL);
-               return;
-       }
-
-       if (req->sector+req->current_nr_sectors > get_capacity(req->rq_disk)) {
-               printk("Grrr. error. ps2esdi_drives: %d, %llu %llu\n",
-                   ps2esdi_drives, req->sector,
-                   (unsigned long long)get_capacity(req->rq_disk));
-               end_request(req, FAIL);
-               return;
-       }
-
-       switch (rq_data_dir(req)) {
-       case READ:
-               ps2esdi_readwrite(READ, req);
-               break;
-       case WRITE:
-               ps2esdi_readwrite(WRITE, req);
-               break;
-       default:
-               printk("%s: Unknown command\n", req->rq_disk->disk_name);
-               end_request(req, FAIL);
-               break;
-       }               /* handle different commands */
-}                              /* main strategy routine */
-
-/* resets the ESDI adapter */
-static void reset_ctrl(void)
-{
-
-       u_long expire;
-       u_short status;
-
-       /* enable interrupts on the controller */
-       status = inb(ESDI_INTRPT);
-       outb((status & 0xe0) | ATT_EOI, ESDI_ATTN);     /* to be sure we don't have
-                                                          any interrupt pending... */
-       outb_p(CTRL_ENABLE_INTR, ESDI_CONTROL);
-
-       /* read the ESDI status port - if the controller is not busy,
-          simply do a soft reset (fast) - otherwise we'll have to do a
-          hard (slow) reset.  */
-       if (!(inb_p(ESDI_STATUS) & STATUS_BUSY)) {
-               /*BA */ printk("%s: soft reset...\n", DEVICE_NAME);
-               outb_p(CTRL_SOFT_RESET, ESDI_ATTN);
-       }
-       /* soft reset */ 
-       else {
-               /*BA */
-               printk("%s: hard reset...\n", DEVICE_NAME);
-               outb_p(CTRL_HARD_RESET, ESDI_CONTROL);
-               expire = jiffies + 2*HZ;
-               while (time_before(jiffies, expire));
-               outb_p(1, ESDI_CONTROL);
-       }                       /* hard reset */
-
-
-}                              /* reset the controller */
-
-/* called by the strategy routine to handle read and write requests */
-static void ps2esdi_readwrite(int cmd, struct request *req)
-{
-       struct ps2esdi_i_struct *p = req->rq_disk->private_data;
-       unsigned block = req->sector;
-       unsigned count = req->current_nr_sectors;
-       int drive = p - ps2esdi_info;
-       u_short track, head, cylinder, sector;
-       u_short cmd_blk[TYPE_1_CMD_BLK_LENGTH];
-
-       /* do some relevant arithmatic */
-       track = block / p->sect;
-       head = track % p->head;
-       cylinder = track / p->head;
-       sector = block % p->sect;
-
-#if 0
-       printk("%s: cyl=%d head=%d sect=%d\n", DEVICE_NAME, cylinder, head, sector);
-#endif
-       /* call the routine that actually fills out a command block */
-       ps2esdi_fill_cmd_block
-           (cmd_blk,
-            (cmd == READ) ? CMD_READ : CMD_WRITE,
-            cylinder, head, sector, count, drive);
-
-       /* send the command block to the controller */
-       current_req = req;
-       spin_unlock_irq(&ps2esdi_lock);
-       if (ps2esdi_out_cmd_blk(cmd_blk)) {
-               spin_lock_irq(&ps2esdi_lock);
-               printk("%s: Controller failed\n", DEVICE_NAME);
-               if ((++req->errors) >= MAX_RETRIES)
-                       end_request(req, FAIL);
-       }
-       /* check for failure to put out the command block */ 
-       else {
-               spin_lock_irq(&ps2esdi_lock);
-#if 0
-               printk("%s: waiting for xfer\n", DEVICE_NAME);
-#endif
-               /* turn disk lights on */
-               LITE_ON;
-       }
-
-}                              /* ps2esdi_readwrite */
-
-/* fill out the command block */
-static void ps2esdi_fill_cmd_block(u_short * cmd_blk, u_short cmd,
- u_short cyl, u_short head, u_short sector, u_short length, u_char drive)
-{
-
-       cmd_blk[0] = (drive << 5) | cmd;
-       cmd_blk[1] = length;
-       cmd_blk[2] = ((cyl & 0x1f) << 11) | (head << 5) | sector;
-       cmd_blk[3] = (cyl & 0x3E0) >> 5;
-
-}                              /* fill out the command block */
-
-/* write a command block to the controller */
-static int ps2esdi_out_cmd_blk(u_short * cmd_blk)
-{
-
-       int i;
-       unsigned long jif;
-       u_char status;
-
-       /* enable interrupts */
-       outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-
-       /* do not write to the controller, if it is busy */
-       for (jif = jiffies + ESDI_STAT_TIMEOUT;
-               time_after(jif, jiffies) &&
-                       (inb(ESDI_STATUS) & STATUS_BUSY); )
-               ;
-
-#if 0
-       printk("%s: i(1)=%ld\n", DEVICE_NAME, jif);
-#endif
-
-       /* if device is still busy - then just time out */
-       if (inb(ESDI_STATUS) & STATUS_BUSY) {
-               printk("%s: ps2esdi_out_cmd timed out (1)\n", DEVICE_NAME);
-               return ERROR;
-       }                       /* timeout ??? */
-       /* Set up the attention register in the controller */
-       outb(((*cmd_blk) & 0xE0) | 1, ESDI_ATTN);
-
-#if 0
-       printk("%s: sending %d words to controller\n", DEVICE_NAME, (((*cmd_blk) >> 14) + 1) << 1);
-#endif
-
-       /* one by one send each word out */
-       for (i = (((*cmd_blk) >> 14) + 1) << 1; i; i--) {
-               status = inb(ESDI_STATUS);
-               for (jif = jiffies + ESDI_STAT_TIMEOUT;
-                    time_after(jif, jiffies) && (status & STATUS_BUSY) &&
-                  (status & STATUS_CMD_INF); status = inb(ESDI_STATUS));
-               if ((status & (STATUS_BUSY | STATUS_CMD_INF)) == STATUS_BUSY) {
-#if 0
-                       printk("%s: sending %04X\n", DEVICE_NAME, *cmd_blk);
-#endif
-                       outw(*cmd_blk++, ESDI_CMD_INT);
-               } else {
-                       printk("%s: ps2esdi_out_cmd timed out while sending command (status=%02X)\n",
-                              DEVICE_NAME, status);
-                       return ERROR;
-               }
-       }                       /* send all words out */
-       return OK;
-}                              /* send out the commands */
-
-
-/* prepare for dma - do all the necessary setup */
-static void ps2esdi_prep_dma(char *buffer, u_short length, u_char dma_xmode)
-{
-       unsigned long flags = claim_dma_lock();
-
-       mca_disable_dma(dma_arb_level);
-
-       mca_set_dma_addr(dma_arb_level, isa_virt_to_bus(buffer));
-
-       mca_set_dma_count(dma_arb_level, length * 512 / 2);
-
-       mca_set_dma_mode(dma_arb_level, dma_xmode);
-
-       mca_enable_dma(dma_arb_level);
-
-       release_dma_lock(flags);
-
-}                              /* prepare for dma */
-
-
-
-static irqreturn_t ps2esdi_interrupt_handler(int irq, void *dev_id)
-{
-       u_int int_ret_code;
-
-       if (inb(ESDI_STATUS) & STATUS_INTR) {
-               int_ret_code = inb(ESDI_INTRPT);
-               if (current_int_handler) {
-                       /* Disable adapter interrupts till processing is finished */
-                       outb(CTRL_DISABLE_INTR, ESDI_CONTROL);
-                       current_int_handler(int_ret_code);
-               } else
-                       printk("%s: help ! No interrupt handler.\n", DEVICE_NAME);
-       } else {
-               return IRQ_NONE;
-       }
-       return IRQ_HANDLED;
-}
-
-static void ps2esdi_initial_reset_int_handler(u_int int_ret_code)
-{
-
-       switch (int_ret_code & 0xf) {
-       case INT_RESET:
-               /*BA */
-               printk("%s: initial reset completed.\n", DEVICE_NAME);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               wake_up(&ps2esdi_int);
-               break;
-       case INT_ATTN_ERROR:
-               printk("%s: Attention error. interrupt status : %02X\n", DEVICE_NAME,
-                      int_ret_code);
-               printk("%s: status: %02x\n", DEVICE_NAME, inb(ESDI_STATUS));
-               break;
-       default:
-               printk("%s: initial reset handler received interrupt: %02X\n",
-                      DEVICE_NAME, int_ret_code);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               break;
-       }
-       outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-}
-
-
-static void ps2esdi_geometry_int_handler(u_int int_ret_code)
-{
-       u_int status, drive_num;
-       unsigned long rba;
-       int i;
-
-       drive_num = int_ret_code >> 5;
-       switch (int_ret_code & 0xf) {
-       case INT_CMD_COMPLETE:
-               for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
-               if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
-                       printk("%s: timeout reading status word\n", DEVICE_NAME);
-                       outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-                       break;
-               }
-               status = inw(ESDI_STT_INT);
-               if ((status & 0x1F) == CMD_GET_DEV_CONFIG) {
-#define REPLY_WORDS 5          /* we already read word 0 */
-                       u_short reply[REPLY_WORDS];
-
-                       if (ps2esdi_read_status_words((status >> 8) - 1, REPLY_WORDS, reply)) {
-                               /*BA */
-                               printk("%s: Device Configuration Status for drive %u\n",
-                                      DEVICE_NAME, drive_num);
-
-                               printk("%s: Spares/cyls: %u", DEVICE_NAME, reply[0] >> 8);
-
-                               printk
-                                   ("Config bits: %s%s%s%s%s\n",
-                                    (reply[0] & CONFIG_IS) ? "Invalid Secondary, " : "",
-                                    ((reply[0] & CONFIG_ZD) && !(reply[0] & CONFIG_IS))
-                                ? "Zero Defect, " : "Defects Present, ",
-                                    (reply[0] & CONFIG_SF) ? "Skewed Format, " : "",
-                                    (reply[0] & CONFIG_FR) ? "Removable, " : "Non-Removable, ",
-                                    (reply[0] & CONFIG_RT) ? "No Retries" : "Retries");
-
-                               rba = reply[1] | ((unsigned long) reply[2] << 16);
-                               printk("%s: Number of RBA's: %lu\n", DEVICE_NAME, rba);
-
-                               printk("%s: Physical number of cylinders: %u, Sectors/Track: %u, Heads: %u\n",
-                                      DEVICE_NAME, reply[3], reply[4] >> 8, reply[4] & 0xff);
-
-                               if (!ps2esdi_info[drive_num].head) {
-                                       ps2esdi_info[drive_num].head = 64;
-                                       ps2esdi_info[drive_num].sect = 32;
-                                       ps2esdi_info[drive_num].cyl = rba / (64 * 32);
-                                       ps2esdi_info[drive_num].wpcom = 0;
-                                       ps2esdi_info[drive_num].lzone = ps2esdi_info[drive_num].cyl;
-                                       ps2esdi_info[drive_num].ctl = 8;
-                                       if (tp720esdi) {        /* store the retrieved parameters */
-                                               ps2esdi_info[0].head = reply[4] & 0Xff;
-                                               ps2esdi_info[0].sect = reply[4] >> 8;
-                                               ps2esdi_info[0].cyl = reply[3];
-                                               ps2esdi_info[0].wpcom = 0;
-                                               ps2esdi_info[0].lzone = reply[3];
-                                       } else {
-                                               if (!intg_esdi)
-                                                       ps2esdi_drives++;
-                                       }
-                               }
-#ifdef OBSOLETE
-                               if (!ps2esdi_info[drive_num].head) {
-                                       ps2esdi_info[drive_num].head = reply[4] & 0Xff;
-                                       ps2esdi_info[drive_num].sect = reply[4] >> 8;
-                                       ps2esdi_info[drive_num].cyl = reply[3];
-                                       ps2esdi_info[drive_num].wpcom = 0;
-                                       ps2esdi_info[drive_num].lzone = reply[3];
-                                       if (tp720esdi) {        /* store the retrieved parameters */
-                                               ps2esdi_info[0].head = reply[4] & 0Xff;
-                                               ps2esdi_info[0].sect = reply[4] >> 8;
-                                               ps2esdi_info[0].cyl = reply[3];
-                                               ps2esdi_info[0].wpcom = 0;
-                                               ps2esdi_info[0].lzone = reply[3];
-                                       } else {
-                                               ps2esdi_drives++;
-                                       }
-                               }
-#endif
-
-                       } else
-                               printk("%s: failed while getting device config\n", DEVICE_NAME);
-#undef REPLY_WORDS
-               } else
-                       printk("%s: command %02X unknown by geometry handler\n",
-                              DEVICE_NAME, status & 0x1f);
-
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               break;
-
-       case INT_ATTN_ERROR:
-               printk("%s: Attention error. interrupt status : %02X\n", DEVICE_NAME,
-                      int_ret_code);
-               printk("%s: Device not available\n", DEVICE_NAME);
-               break;
-       case INT_CMD_ECC:
-       case INT_CMD_RETRY:
-       case INT_CMD_ECC_RETRY:
-       case INT_CMD_WARNING:
-       case INT_CMD_ABORT:
-       case INT_CMD_FAILED:
-       case INT_DMA_ERR:
-       case INT_CMD_BLK_ERR:
-               /*BA */ printk("%s: Whaa. Error occurred...\n", DEVICE_NAME);
-               dump_cmd_complete_status(int_ret_code);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               break;
-       default:
-               printk("%s: Unknown interrupt reason: %02X\n",
-                      DEVICE_NAME, int_ret_code & 0xf);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               break;
-       }
-
-       wake_up(&ps2esdi_int);
-       no_int_yet = FALSE;
-       outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-
-}
-
-static void ps2esdi_normal_interrupt_handler(u_int int_ret_code)
-{
-       unsigned long flags;
-       u_int status;
-       u_int ending;
-       int i;
-
-       switch (int_ret_code & 0x0f) {
-       case INT_TRANSFER_REQ:
-               ps2esdi_prep_dma(current_req->buffer,
-                                current_req->current_nr_sectors,
-                   (rq_data_dir(current_req) == READ)
-                   ? MCA_DMA_MODE_16 | MCA_DMA_MODE_WRITE | MCA_DMA_MODE_XFER
-                   : MCA_DMA_MODE_16 | MCA_DMA_MODE_READ);
-               outb(CTRL_ENABLE_DMA | CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = -1;
-               break;
-
-       case INT_ATTN_ERROR:
-               printk("%s: Attention error. interrupt status : %02X\n", DEVICE_NAME,
-                      int_ret_code);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = FAIL;
-               break;
-
-       case INT_CMD_COMPLETE:
-               for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
-               if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
-                       printk("%s: timeout reading status word\n", DEVICE_NAME);
-                       outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-                       outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-                       if ((++current_req->errors) >= MAX_RETRIES)
-                               ending = FAIL;
-                       else
-                               ending = -1;
-                       break;
-               }
-               status = inw(ESDI_STT_INT);
-               switch (status & 0x1F) {
-               case (CMD_READ & 0xff):
-               case (CMD_WRITE & 0xff):
-                       LITE_OFF;
-                       outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-                       outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-                       ending = SUCCES;
-                       break;
-               default:
-                       printk("%s: interrupt for unknown command %02X\n",
-                              DEVICE_NAME, status & 0x1f);
-                       outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-                       outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-                       ending = -1;
-                       break;
-               }
-               break;
-       case INT_CMD_ECC:
-       case INT_CMD_RETRY:
-       case INT_CMD_ECC_RETRY:
-               LITE_OFF;
-               dump_cmd_complete_status(int_ret_code);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = SUCCES;
-               break;
-       case INT_CMD_WARNING:
-       case INT_CMD_ABORT:
-       case INT_CMD_FAILED:
-       case INT_DMA_ERR:
-               LITE_OFF;
-               dump_cmd_complete_status(int_ret_code);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               if ((++current_req->errors) >= MAX_RETRIES)
-                       ending = FAIL;
-               else
-                       ending = -1;
-               break;
-
-       case INT_CMD_BLK_ERR:
-               dump_cmd_complete_status(int_ret_code);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = FAIL;
-               break;
-
-       case INT_CMD_FORMAT:
-               printk("%s: huh ? Who issued this format command ?\n"
-                      ,DEVICE_NAME);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = -1;
-               break;
-
-       case INT_RESET:
-               /* BA printk("%s: reset completed.\n", DEVICE_NAME) */ ;
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = -1;
-               break;
-
-       default:
-               printk("%s: Unknown interrupt reason: %02X\n",
-                      DEVICE_NAME, int_ret_code & 0xf);
-               outb((int_ret_code & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               ending = -1;
-               break;
-       }
-       if(ending != -1) {
-               spin_lock_irqsave(&ps2esdi_lock, flags);
-               end_request(current_req, ending);
-               current_req = NULL;
-               do_ps2esdi_request(ps2esdi_queue);
-               spin_unlock_irqrestore(&ps2esdi_lock, flags);
-       }
-}                              /* handle interrupts */
-
-
-
-static int ps2esdi_read_status_words(int num_words,
-                                    int max_words,
-                                    u_short * buffer)
-{
-       int i;
-
-       for (; max_words && num_words; max_words--, num_words--, buffer++) {
-               for (i = ESDI_TIMEOUT; i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL); i--);
-               if (!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) {
-                       printk("%s: timeout reading status word\n", DEVICE_NAME);
-                       return FAIL;
-               }
-               *buffer = inw(ESDI_STT_INT);
-       }
-       return SUCCES;
-}
-
-
-
-
-static void dump_cmd_complete_status(u_int int_ret_code)
-{
-#define WAIT_FOR_STATUS \
-  for(i=ESDI_TIMEOUT;i && !(inb(ESDI_STATUS) & STATUS_STAT_AVAIL);i--); \
-    if(!(inb(ESDI_STATUS) & STATUS_STAT_AVAIL)) { \
-    printk("%s: timeout reading status word\n",DEVICE_NAME); \
-    return; \
-    }
-
-       int i, word_count;
-       u_short stat_word;
-       u_long rba;
-
-       printk("%s: Device: %u, interrupt ID: %02X\n",
-              DEVICE_NAME, int_ret_code >> 5,
-              int_ret_code & 0xf);
-
-       WAIT_FOR_STATUS;
-       stat_word = inw(ESDI_STT_INT);
-       word_count = (stat_word >> 8) - 1;
-       printk("%s: %u status words, command: %02X\n", DEVICE_NAME, word_count,
-              stat_word & 0xff);
-
-       if (word_count--) {
-               WAIT_FOR_STATUS;
-               stat_word = inw(ESDI_STT_INT);
-               printk("%s: command status code: %02X, command error code: %02X\n",
-                      DEVICE_NAME, stat_word >> 8, stat_word & 0xff);
-       }
-       if (word_count--) {
-               WAIT_FOR_STATUS;
-               stat_word = inw(ESDI_STT_INT);
-               printk("%s: device error code: %s%s%s%s%s,%02X\n", DEVICE_NAME,
-                      (stat_word & 0x1000) ? "Ready, " : "Not Ready, ",
-                 (stat_word & 0x0800) ? "Selected, " : "Not Selected, ",
-                      (stat_word & 0x0400) ? "Write Fault, " : "",
-                      (stat_word & 0x0200) ? "Track 0, " : "",
-               (stat_word & 0x0100) ? "Seek or command complete, " : "",
-                      stat_word >> 8);
-       }
-       if (word_count--) {
-               WAIT_FOR_STATUS;
-               stat_word = inw(ESDI_STT_INT);
-               printk("%s: Blocks to do: %u", DEVICE_NAME, stat_word);
-       }
-       if (word_count -= 2) {
-               WAIT_FOR_STATUS;
-               rba = inw(ESDI_STT_INT);
-               WAIT_FOR_STATUS;
-               rba |= inw(ESDI_STT_INT) << 16;
-               printk(", Last Cyl: %u Head: %u Sector: %u\n",
-                      (u_short) ((rba & 0x1ff80000) >> 11),
-                (u_short) ((rba & 0x7E0) >> 5), (u_short) (rba & 0x1f));
-       } else
-               printk("\n");
-
-       if (word_count--) {
-               WAIT_FOR_STATUS;
-               stat_word = inw(ESDI_STT_INT);
-               printk("%s: Blocks required ECC: %u", DEVICE_NAME, stat_word);
-       }
-       printk("\n");
-
-#undef WAIT_FOR_STATUS
-
-}
-
-static int ps2esdi_getgeo(struct block_device *bdev, struct hd_geometry *geo)
-{
-       struct ps2esdi_i_struct *p = bdev->bd_disk->private_data;
-
-       geo->heads = p->head;
-       geo->sectors = p->sect;
-       geo->cylinders = p->cyl;
-       return 0;
-}
-
-static void ps2esdi_reset_timer(unsigned long unused)
-{
-
-       int status;
-
-       status = inb(ESDI_INTRPT);
-       if ((status & 0xf) == INT_RESET) {
-               outb((status & 0xe0) | ATT_EOI, ESDI_ATTN);
-               outb(CTRL_ENABLE_INTR, ESDI_CONTROL);
-               reset_status = 1;
-       }
-       wake_up(&ps2esdi_int);
-}
index d352dbb4ccf7423f9bddca0bb9cc83cc055164f4..e5a0e97cfdda63b1e386013239d549368eaf4bf4 100644 (file)
 
 # define ATI_PCIGART_PAGE_SIZE         4096    /**< PCI GART page size */
 
-static void *drm_ati_alloc_pcigart_table(int order)
+static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
+                                      struct drm_ati_pcigart_info *gart_info)
 {
-       unsigned long address;
-       struct page *page;
-       int i;
-
-       DRM_DEBUG("%d order\n", order);
-
-       address = __get_free_pages(GFP_KERNEL | __GFP_COMP,
-                                  order);
-       if (address == 0UL) {
-               return NULL;
-       }
-
-       page = virt_to_page(address);
+       gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size,
+                                               PAGE_SIZE,
+                                               gart_info->table_mask);
+       if (gart_info->table_handle == NULL)
+               return -ENOMEM;
 
-       for (i = 0; i < order; i++, page++)
-               SetPageReserved(page);
-
-       DRM_DEBUG("returning 0x%08lx\n", address);
-       return (void *)address;
+       return 0;
 }
 
-static void drm_ati_free_pcigart_table(void *address, int order)
+static void drm_ati_free_pcigart_table(struct drm_device *dev,
+                                      struct drm_ati_pcigart_info *gart_info)
 {
-       struct page *page;
-       int i;
-       int num_pages = 1 << order;
-       DRM_DEBUG("\n");
-
-       page = virt_to_page((unsigned long)address);
-
-       for (i = 0; i < num_pages; i++, page++)
-               ClearPageReserved(page);
-
-       free_pages((unsigned long)address, order);
+       drm_pci_free(dev, gart_info->table_handle);
+       gart_info->table_handle = NULL;
 }
 
 int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info)
@@ -78,8 +59,7 @@ int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info
        struct drm_sg_mem *entry = dev->sg;
        unsigned long pages;
        int i;
-       int order;
-       int num_pages, max_pages;
+       int max_pages;
 
        /* we need to support large memory configurations */
        if (!entry) {
@@ -87,15 +67,7 @@ int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info
                return 0;
        }
 
-       order = drm_order((gart_info->table_size + (PAGE_SIZE-1)) / PAGE_SIZE);
-       num_pages = 1 << order;
-
        if (gart_info->bus_addr) {
-               if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
-                       pci_unmap_single(dev->pdev, gart_info->bus_addr,
-                                        num_pages * PAGE_SIZE,
-                                        PCI_DMA_TODEVICE);
-               }
 
                max_pages = (gart_info->table_size / sizeof(u32));
                pages = (entry->pages <= max_pages)
@@ -112,10 +84,9 @@ int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info
                        gart_info->bus_addr = 0;
        }
 
-       if (gart_info->gart_table_location == DRM_ATI_GART_MAIN
-           && gart_info->addr) {
-               drm_ati_free_pcigart_table(gart_info->addr, order);
-               gart_info->addr = NULL;
+       if (gart_info->gart_table_location == DRM_ATI_GART_MAIN &&
+           gart_info->table_handle) {
+               drm_ati_free_pcigart_table(dev, gart_info);
        }
 
        return 1;
@@ -127,11 +98,10 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
        struct drm_sg_mem *entry = dev->sg;
        void *address = NULL;
        unsigned long pages;
-       u32 *pci_gart, page_base, bus_address = 0;
+       u32 *pci_gart, page_base;
+       dma_addr_t bus_address = 0;
        int i, j, ret = 0;
-       int order;
        int max_pages;
-       int num_pages;
 
        if (!entry) {
                DRM_ERROR("no scatter/gather memory!\n");
@@ -141,31 +111,14 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
        if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
                DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
 
-               order = drm_order((gart_info->table_size +
-                                  (PAGE_SIZE-1)) / PAGE_SIZE);
-               num_pages = 1 << order;
-               address = drm_ati_alloc_pcigart_table(order);
-               if (!address) {
+               ret = drm_ati_alloc_pcigart_table(dev, gart_info);
+               if (ret) {
                        DRM_ERROR("cannot allocate PCI GART page!\n");
                        goto done;
                }
 
-               if (!dev->pdev) {
-                       DRM_ERROR("PCI device unknown!\n");
-                       goto done;
-               }
-
-               bus_address = pci_map_single(dev->pdev, address,
-                                            num_pages * PAGE_SIZE,
-                                            PCI_DMA_TODEVICE);
-               if (bus_address == 0) {
-                       DRM_ERROR("unable to map PCIGART pages!\n");
-                       order = drm_order((gart_info->table_size +
-                                          (PAGE_SIZE-1)) / PAGE_SIZE);
-                       drm_ati_free_pcigart_table(address, order);
-                       address = NULL;
-                       goto done;
-               }
+               address = gart_info->table_handle->vaddr;
+               bus_address = gart_info->table_handle->busaddr;
        } else {
                address = gart_info->addr;
                bus_address = gart_info->bus_addr;
index a6789f25009b4858c1370104883601220f83be79..8ea9dd1717a9dc9b383120e7bbe730229d4e678c 100644 (file)
@@ -54,6 +54,7 @@
 #include <linux/pci.h>
 #include <linux/jiffies.h>
 #include <linux/smp_lock.h>    /* For (un)lock_kernel */
+#include <linux/dma-mapping.h>
 #include <linux/mm.h>
 #include <linux/cdev.h>
 #include <linux/mutex.h>
@@ -551,6 +552,8 @@ struct drm_ati_pcigart_info {
        int gart_reg_if;
        void *addr;
        dma_addr_t bus_addr;
+       dma_addr_t table_mask;
+       struct drm_dma_handle *table_handle;
        drm_local_map_t mapping;
        int table_size;
 };
index 3992f73299cc8e161ffd67db642040051a9c8243..f09d4b5002b0f19e8ec9421cce760d03ce7d7178 100644 (file)
@@ -326,6 +326,7 @@ int drm_release(struct inode *inode, struct file *filp)
        struct drm_file *file_priv = filp->private_data;
        struct drm_device *dev = file_priv->head->dev;
        int retcode = 0;
+       unsigned long irqflags;
 
        lock_kernel();
 
@@ -357,9 +358,11 @@ int drm_release(struct inode *inode, struct file *filp)
                         */
 
                        do{
-                               spin_lock(&dev->lock.spinlock);
+                               spin_lock_irqsave(&dev->lock.spinlock,
+                                                 irqflags);
                                locked = dev->lock.idle_has_lock;
-                               spin_unlock(&dev->lock.spinlock);
+                               spin_unlock_irqrestore(&dev->lock.spinlock,
+                                                      irqflags);
                                if (locked)
                                        break;
                                schedule();
index bea2a7d5b2b22f695d3c6131d2068450ed55f074..12dcdd1832f080b57574d02ecd4acfc6076ecd88 100644 (file)
@@ -53,6 +53,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
        DECLARE_WAITQUEUE(entry, current);
        struct drm_lock *lock = data;
        int ret = 0;
+       unsigned long irqflags;
 
        ++file_priv->lock_count;
 
@@ -71,9 +72,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
                        return -EINVAL;
 
        add_wait_queue(&dev->lock.lock_queue, &entry);
-       spin_lock(&dev->lock.spinlock);
+       spin_lock_irqsave(&dev->lock.spinlock, irqflags);
        dev->lock.user_waiters++;
-       spin_unlock(&dev->lock.spinlock);
+       spin_unlock_irqrestore(&dev->lock.spinlock, irqflags);
        for (;;) {
                __set_current_state(TASK_INTERRUPTIBLE);
                if (!dev->lock.hw_lock) {
@@ -95,9 +96,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
                        break;
                }
        }
-       spin_lock(&dev->lock.spinlock);
+       spin_lock_irqsave(&dev->lock.spinlock, irqflags);
        dev->lock.user_waiters--;
-       spin_unlock(&dev->lock.spinlock);
+       spin_unlock_irqrestore(&dev->lock.spinlock, irqflags);
        __set_current_state(TASK_RUNNING);
        remove_wait_queue(&dev->lock.lock_queue, &entry);
 
@@ -198,8 +199,9 @@ int drm_lock_take(struct drm_lock_data *lock_data,
 {
        unsigned int old, new, prev;
        volatile unsigned int *lock = &lock_data->hw_lock->lock;
+       unsigned long irqflags;
 
-       spin_lock(&lock_data->spinlock);
+       spin_lock_irqsave(&lock_data->spinlock, irqflags);
        do {
                old = *lock;
                if (old & _DRM_LOCK_HELD)
@@ -211,7 +213,7 @@ int drm_lock_take(struct drm_lock_data *lock_data,
                }
                prev = cmpxchg(lock, old, new);
        } while (prev != old);
-       spin_unlock(&lock_data->spinlock);
+       spin_unlock_irqrestore(&lock_data->spinlock, irqflags);
 
        if (_DRM_LOCKING_CONTEXT(old) == context) {
                if (old & _DRM_LOCK_HELD) {
@@ -272,15 +274,16 @@ int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context)
 {
        unsigned int old, new, prev;
        volatile unsigned int *lock = &lock_data->hw_lock->lock;
+       unsigned long irqflags;
 
-       spin_lock(&lock_data->spinlock);
+       spin_lock_irqsave(&lock_data->spinlock, irqflags);
        if (lock_data->kernel_waiters != 0) {
                drm_lock_transfer(lock_data, 0);
                lock_data->idle_has_lock = 1;
-               spin_unlock(&lock_data->spinlock);
+               spin_unlock_irqrestore(&lock_data->spinlock, irqflags);
                return 1;
        }
-       spin_unlock(&lock_data->spinlock);
+       spin_unlock_irqrestore(&lock_data->spinlock, irqflags);
 
        do {
                old = *lock;
@@ -344,19 +347,20 @@ static int drm_notifier(void *priv)
 void drm_idlelock_take(struct drm_lock_data *lock_data)
 {
        int ret = 0;
+       unsigned long irqflags;
 
-       spin_lock(&lock_data->spinlock);
+       spin_lock_irqsave(&lock_data->spinlock, irqflags);
        lock_data->kernel_waiters++;
        if (!lock_data->idle_has_lock) {
 
-               spin_unlock(&lock_data->spinlock);
+               spin_unlock_irqrestore(&lock_data->spinlock, irqflags);
                ret = drm_lock_take(lock_data, DRM_KERNEL_CONTEXT);
-               spin_lock(&lock_data->spinlock);
+               spin_lock_irqsave(&lock_data->spinlock, irqflags);
 
                if (ret == 1)
                        lock_data->idle_has_lock = 1;
        }
-       spin_unlock(&lock_data->spinlock);
+       spin_unlock_irqrestore(&lock_data->spinlock, irqflags);
 }
 EXPORT_SYMBOL(drm_idlelock_take);
 
@@ -364,8 +368,9 @@ void drm_idlelock_release(struct drm_lock_data *lock_data)
 {
        unsigned int old, prev;
        volatile unsigned int *lock = &lock_data->hw_lock->lock;
+       unsigned long irqflags;
 
-       spin_lock(&lock_data->spinlock);
+       spin_lock_irqsave(&lock_data->spinlock, irqflags);
        if (--lock_data->kernel_waiters == 0) {
                if (lock_data->idle_has_lock) {
                        do {
@@ -376,7 +381,7 @@ void drm_idlelock_release(struct drm_lock_data *lock_data)
                        lock_data->idle_has_lock = 0;
                }
        }
-       spin_unlock(&lock_data->spinlock);
+       spin_unlock_irqrestore(&lock_data->spinlock, irqflags);
 }
 EXPORT_SYMBOL(drm_idlelock_release);
 
index 715b361f0c2b37d39bb27f9b663b305c58761fbb..a6a499f97e2281980221fb65e172fb922fc12314 100644 (file)
        {0x1002, 0x71D6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV530|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x71DA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV530|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x71DE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV530|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-       {0x1002, 0x7200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV530|RADEON_NEW_MEMMAP}, \
-       {0x1002, 0x7210, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV530|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
-       {0x1002, 0x7211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV530|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+       {0x1002, 0x7200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV515|RADEON_NEW_MEMMAP}, \
+       {0x1002, 0x7210, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV515|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
+       {0x1002, 0x7211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV515|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x7240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R580|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x7243, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R580|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x7244, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R580|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x7834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x7835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS300|RADEON_IS_IGP|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
        {0x1002, 0x791e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
+       {0x1002, 0x791f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS690|RADEON_IS_IGP|RADEON_NEW_MEMMAP|RADEON_IS_IGPGART}, \
        {0, 0, 0}
 
 #define r128_PCI_IDS \
index 892e0a58984669ccbfdce83aba673e23fadb7cb1..f36adbd3aaf5cccac2db4e48921f484f3d3d076e 100644 (file)
@@ -558,6 +558,7 @@ static int r128_do_init_cce(struct drm_device * dev, drm_r128_init_t * init)
 #if __OS_HAS_AGP
        if (dev_priv->is_pci) {
 #endif
+               dev_priv->gart_info.table_mask = DMA_BIT_MASK(32);
                dev_priv->gart_info.gart_table_location = DRM_ATI_GART_MAIN;
                dev_priv->gart_info.table_size = R128_PCIGART_TABLE_SIZE;
                dev_priv->gart_info.addr = NULL;
index 833abc7e55fb35d4032d8dc2306ca48ddae9ab2b..9072e4a1894e4d773a64b82cf72865f04b4db1fb 100644 (file)
@@ -1807,6 +1807,7 @@ static int radeon_do_init_cp(struct drm_device * dev, drm_radeon_init_t * init)
        } else
 #endif
        {
+               dev_priv->gart_info.table_mask = DMA_BIT_MASK(32);
                /* if we have an offset set from userspace */
                if (dev_priv->pcigart_offset_set) {
                        dev_priv->gart_info.bus_addr =
index 94baec692b57713fe6f246d3a296edefafe40c7b..7a339dba6a69c2fb4d961a73851c048a0807f823 100644 (file)
@@ -126,6 +126,8 @@ via_cmdbuf_wait(drm_via_private_t * dev_priv, unsigned int size)
                             hw_addr, cur_addr, next_addr);
                        return -1;
                }
+               if  ((cur_addr < hw_addr) && (next_addr >= hw_addr))
+                       msleep(1);
        } while ((cur_addr < hw_addr) && (next_addr >= hw_addr));
        return 0;
 }
@@ -416,27 +418,50 @@ static int via_hook_segment(drm_via_private_t * dev_priv,
        int paused, count;
        volatile uint32_t *paused_at = dev_priv->last_pause_ptr;
        uint32_t reader,ptr;
+       uint32_t diff;
 
        paused = 0;
        via_flush_write_combine();
        (void) *(volatile uint32_t *)(via_get_dma(dev_priv) -1);
+
        *paused_at = pause_addr_lo;
        via_flush_write_combine();
        (void) *paused_at;
+
        reader = *(dev_priv->hw_addr_ptr);
        ptr = ((volatile char *)paused_at - dev_priv->dma_ptr) +
                dev_priv->dma_offset + (uint32_t) dev_priv->agpAddr + 4;
+
        dev_priv->last_pause_ptr = via_get_dma(dev_priv) - 1;
 
-       if ((ptr - reader) <= dev_priv->dma_diff ) {
-               count = 10000000;
-               while (!(paused = (VIA_READ(0x41c) & 0x80000000)) && count--);
+       /*
+        * If there is a possibility that the command reader will 
+        * miss the new pause address and pause on the old one,
+        * In that case we need to program the new start address
+        * using PCI.
+        */
+
+       diff = (uint32_t) (ptr - reader) - dev_priv->dma_diff;
+       count = 10000000;
+       while(diff == 0 && count--) {
+               paused = (VIA_READ(0x41c) & 0x80000000);
+               if (paused) 
+                       break;
+               reader = *(dev_priv->hw_addr_ptr);
+               diff = (uint32_t) (ptr - reader) - dev_priv->dma_diff;
        }
 
+       paused = VIA_READ(0x41c) & 0x80000000;
+
        if (paused && !no_pci_fire) {
                reader = *(dev_priv->hw_addr_ptr);
-               if ((ptr - reader) == dev_priv->dma_diff) {
-
+               diff = (uint32_t) (ptr - reader) - dev_priv->dma_diff;
+               diff &= (dev_priv->dma_high - 1);
+               if (diff != 0 && diff < (dev_priv->dma_high >> 1)) {
+                       DRM_ERROR("Paused at incorrect address. "
+                                 "0x%08x, 0x%08x 0x%08x\n",
+                                 ptr, reader, dev_priv->dma_diff);
+               } else if (diff == 0) {
                        /*
                         * There is a concern that these writes may stall the PCI bus
                         * if the GPU is not idle. However, idling the GPU first
@@ -577,6 +602,7 @@ static void via_cmdbuf_jump(drm_via_private_t * dev_priv)
        uint32_t pause_addr_lo, pause_addr_hi;
        uint32_t jump_addr_lo, jump_addr_hi;
        volatile uint32_t *last_pause_ptr;
+       uint32_t dma_low_save1, dma_low_save2;
 
        agp_base = dev_priv->dma_offset + (uint32_t) dev_priv->agpAddr;
        via_align_cmd(dev_priv, HC_HAGPBpID_JUMP, 0, &jump_addr_hi,
@@ -603,8 +629,29 @@ static void via_cmdbuf_jump(drm_via_private_t * dev_priv)
                      &pause_addr_lo, 0);
 
        *last_pause_ptr = pause_addr_lo;
+       dma_low_save1 = dev_priv->dma_low;
 
-       via_hook_segment( dev_priv, jump_addr_hi, jump_addr_lo, 0);
+       /*
+        * Now, set a trap that will pause the regulator if it tries to rerun the old
+        * command buffer. (Which may happen if via_hook_segment detecs a command regulator pause
+        * and reissues the jump command over PCI, while the regulator has already taken the jump
+        * and actually paused at the current buffer end).
+        * There appears to be no other way to detect this condition, since the hw_addr_pointer
+        * does not seem to get updated immediately when a jump occurs.
+        */
+
+       last_pause_ptr =
+               via_align_cmd(dev_priv, HC_HAGPBpID_PAUSE, 0, &pause_addr_hi,
+                             &pause_addr_lo, 0) - 1;
+       via_align_cmd(dev_priv, HC_HAGPBpID_PAUSE, 0, &pause_addr_hi,
+                     &pause_addr_lo, 0);
+       *last_pause_ptr = pause_addr_lo;
+
+       dma_low_save2 = dev_priv->dma_low;
+       dev_priv->dma_low = dma_low_save1;
+       via_hook_segment(dev_priv, jump_addr_hi, jump_addr_lo, 0);
+       dev_priv->dma_low = dma_low_save2;
+       via_hook_segment(dev_priv, pause_addr_hi, pause_addr_lo, 0);
 }
 
 
index 33c5197b73c4a79b9c6b95849debe94b68dda549..409e00afdd0754f6eb60707810a262df43a75fe9 100644 (file)
@@ -603,7 +603,7 @@ via_build_sg_info(struct drm_device *dev, drm_via_sg_info_t *vsg, drm_via_dmabli
         * (Not a big limitation anyway.)
         */
 
-       if ((xfer->mem_stride - xfer->line_length) >PAGE_SIZE) {
+       if ((xfer->mem_stride - xfer->line_length) > 2*PAGE_SIZE) {
                DRM_ERROR("Too large system memory stride. Stride: %d, "
                          "Length: %d\n", xfer->mem_stride, xfer->line_length);
                return -EINVAL;
index 4833b1a826239c62c3fd641ba96dd0b92a3ab0ff..5511ef006a66c591cf59df2ffde421001f282758 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Cobalt button interface driver.
  *
- *  Copyright (C) 2007  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
+ *  Copyright (C) 2007-2008  Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
  *
  *  You should have received a copy of the GNU General Public License
  *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include <linux/init.h>
 #include <linux/input-polldev.h>
@@ -55,7 +55,7 @@ static void handle_buttons(struct input_polled_dev *dev)
        status = ~readl(bdev->reg) >> 24;
 
        for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
-               if (status & (1UL << i)) {
+               if (status & (1U << i)) {
                        if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
                                input_event(input, EV_MSC, MSC_SCAN, i);
                                input_report_key(input, bdev->keymap[i], 1);
@@ -97,16 +97,16 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
        input->name = "Cobalt buttons";
        input->phys = "cobalt/input0";
        input->id.bustype = BUS_HOST;
-       input->cdev.dev = &pdev->dev;
+       input->dev.parent = &pdev->dev;
 
-       input->keycode = pdev->keymap;
-       input->keycodemax = ARRAY_SIZE(pdev->keymap);
+       input->keycode = bdev->keymap;
+       input->keycodemax = ARRAY_SIZE(bdev->keymap);
        input->keycodesize = sizeof(unsigned short);
 
        input_set_capability(input, EV_MSC, MSC_SCAN);
        __set_bit(EV_KEY, input->evbit);
-       for (i = 0; i < ARRAY_SIZE(buttons_map); i++)
-               __set_bit(input->keycode[i], input->keybit);
+       for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
+               __set_bit(bdev->keymap[i], input->keybit);
        __clear_bit(KEY_RESERVED, input->keybit);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
index b346a3b418ea78d60d4a129b911d7fe7a37035cb..385e32bcf6a6e0ed7328f8c7ffd39badb7e4d45e 100644 (file)
@@ -116,8 +116,8 @@ static void alps_process_packet(struct psmouse *psmouse)
        }
 
        if (priv->i->flags & ALPS_FW_BK_1) {
-               back = packet[2] & 4;
-               forward = packet[0] & 0x10;
+               back = packet[0] & 0x10;
+               forward = packet[2] & 4;
        }
 
        if (priv->i->flags & ALPS_FW_BK_2) {
@@ -483,6 +483,7 @@ int alps_init(struct psmouse *psmouse)
        dev2->id.vendor  = 0x0002;
        dev2->id.product = PSMOUSE_ALPS;
        dev2->id.version = 0x0000;
+       dev2->dev.parent = &psmouse->ps2dev.serio->dev;
 
        dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
        dev2->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
diff --git a/drivers/input/serio/i8042-snirm.h b/drivers/input/serio/i8042-snirm.h
new file mode 100644 (file)
index 0000000..409a934
--- /dev/null
@@ -0,0 +1,75 @@
+#ifndef _I8042_SNIRM_H
+#define _I8042_SNIRM_H
+
+#include <asm/sni.h>
+
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+/*
+ * Names.
+ */
+
+#define I8042_KBD_PHYS_DESC "onboard/serio0"
+#define I8042_AUX_PHYS_DESC "onboard/serio1"
+#define I8042_MUX_PHYS_DESC "onboard/serio%d"
+
+/*
+ * IRQs.
+ */
+static int i8042_kbd_irq;
+static int i8042_aux_irq;
+#define I8042_KBD_IRQ i8042_kbd_irq
+#define I8042_AUX_IRQ i8042_aux_irq
+
+static void __iomem *kbd_iobase;
+
+#define I8042_COMMAND_REG      (kbd_iobase + 0x64UL)
+#define I8042_DATA_REG         (kbd_iobase + 0x60UL)
+
+static inline int i8042_read_data(void)
+{
+       return readb(kbd_iobase + 0x60UL);
+}
+
+static inline int i8042_read_status(void)
+{
+       return readb(kbd_iobase + 0x64UL);
+}
+
+static inline void i8042_write_data(int val)
+{
+       writeb(val, kbd_iobase + 0x60UL);
+}
+
+static inline void i8042_write_command(int val)
+{
+       writeb(val, kbd_iobase + 0x64UL);
+}
+static inline int i8042_platform_init(void)
+{
+       /* RM200 is strange ... */
+       if (sni_brd_type == SNI_BRD_RM200) {
+               kbd_iobase = ioremap(0x16000000, 4);
+               i8042_kbd_irq = 33;
+               i8042_aux_irq = 44;
+       } else {
+               kbd_iobase = ioremap(0x14000000, 4);
+               i8042_kbd_irq = 1;
+               i8042_aux_irq = 12;
+       }
+       if (!kbd_iobase)
+               return -ENOMEM;
+
+       return 0;
+}
+
+static inline void i8042_platform_exit(void)
+{
+
+}
+
+#endif /* _I8042_SNIRM_H */
index 662e84482c2601827e92882bd9bae5debf80dd34..60931aceb8282f42e217f1dd9eb2c451b2e55479 100644 (file)
@@ -277,6 +277,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
                        DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
                },
        },
+       {
+               .ident = "Lenovo 3000 n100",
+               .matches = {
+                       DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+                       DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
+               },
+       },
        { }
 };
 
index 2763394869d2b59fb14dfbaaf584bdc80d22d785..65a74cfc187b12199bb3f291775e9223da504198 100644 (file)
@@ -1151,7 +1151,6 @@ static int __devinit i8042_setup_kbd(void)
 static int __devinit i8042_probe(struct platform_device *dev)
 {
        int error;
-       char param;
 
        error = i8042_controller_selftest();
        if (error)
@@ -1174,7 +1173,7 @@ static int __devinit i8042_probe(struct platform_device *dev)
        }
 #ifdef CONFIG_X86
        if (i8042_dritek) {
-               param = 0x90;
+               char param = 0x90;
                error = i8042_command(&param, 0x1059);
                if (error)
                        goto out_fail;
index c972e5d03a3fa6ce2a1e42c13333fb7cb02cf4ab..cbc1beb66574d51d8e15f70845b78631e8349e4c 100644 (file)
@@ -18,6 +18,8 @@
 #include "i8042-jazzio.h"
 #elif defined(CONFIG_SGI_HAS_I8042)
 #include "i8042-ip22io.h"
+#elif defined(CONFIG_SNI_RM)
+#include "i8042-snirm.h"
 #elif defined(CONFIG_PPC)
 #include "i8042-ppcio.h"
 #elif defined(CONFIG_SPARC)
index 6542edb6f76efe505629b8690dfa4e50b8267329..acf9830698cb7ab3cadd94c077270bd49d12cff1 100644 (file)
@@ -11,7 +11,7 @@
  *  Copyright (c) 2000 Daniel Egger            <egger@suse.de>
  *  Copyright (c) 2001 Frederic Lepied         <flepied@mandrakesoft.com>
  *  Copyright (c) 2004 Panagiotis Issaris      <panagiotis.issaris@mech.kuleuven.ac.be>
- *  Copyright (c) 2002-2007 Ping Cheng         <pingc@wacom.com>
+ *  Copyright (c) 2002-2008 Ping Cheng         <pingc@wacom.com>
  *
  *  ChangeLog:
  *      v0.1 (vp)  - Initial release
@@ -65,6 +65,7 @@
  *                - and wacom_wac.c deals with Wacom specific code
  *                - Support Intuos3 4x6
  *      v1.47 (pc) - Added support for Bamboo
+ *      v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX
  */
 
 /*
@@ -85,7 +86,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.47"
+#define DRIVER_VERSION "v1.48"
 #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
 #define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
 #define DRIVER_LICENSE "GPL"
@@ -125,6 +126,7 @@ extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac
 extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
+extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
 extern __u16 wacom_le16_to_cpu(unsigned char *data);
 extern __u16 wacom_be16_to_cpu(unsigned char *data);
 extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
index d64b1ea136b35c1a79ee18ca658f717e27f408f2..41caaef8e2d72c3a8e098086f9f0edbe44be48c8 100644 (file)
@@ -171,6 +171,7 @@ void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
        input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) |
                BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
        input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
+       input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
 }
 
 void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
@@ -180,6 +181,11 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
        input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
 }
 
+void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
+{
+       input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
+}
+
 void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
 {
        input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL);
index fc03ba256f4c54c540e200c23e7d0b25bccda9fb..ffe33842143f1178eff883568e51b19fc1eca136 100644 (file)
@@ -163,7 +163,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
        }
 
        id = STYLUS_DEVICE_ID;
-       if (data[1] & 0x80) { /* in prox */
+       if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4]
+                       || data[5] || data[6] || (data[7] & 0x07))) {
+               /* in prox and not a pad data */
 
                switch ((data[1] >> 5) & 3) {
 
@@ -233,7 +235,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
                if (data[7] & 0xf8) {
                        wacom_input_sync(wcombo); /* sync last event */
                        wacom->id[1] = 1;
-                       wacom->serial[1] = (data[7] & 0xf8);
                        wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
                        wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
                        rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
@@ -252,10 +253,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
                }
                break;
            case WACOM_MO:
-               if ((data[7] & 0xf8) || (data[8] & 0x80)) {
+               if ((data[7] & 0xf8) || (data[8] & 0xff)) {
                        wacom_input_sync(wcombo); /* sync last event */
                        wacom->id[1] = 1;
-                       wacom->serial[1] = (data[7] & 0xf8);
                        wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
                        wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
                        wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
@@ -434,10 +434,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
                wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
                wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
                wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
+               wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
+               wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
                wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
                wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
 
-               if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) |
+               if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
                        data[2] | (data[3] & 0x1f) | data[4])
                        wacom_report_key(wcombo, wacom->tool[1], 1);
                else
@@ -481,13 +483,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
                if (data[1] & 0x02) {
                        /* Rotation packet */
                        if (wacom->features->type >= INTUOS3S) {
-                               /* I3 marker pen rotation reported as wheel
-                                * due to valuator limitation
-                                */
+                               /* I3 marker pen rotation */
                                t = (data[6] << 3) | ((data[7] >> 5) & 7);
                                t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :
                                        ((t-1) / 2 + 450)) : (450 - t / 2) ;
-                               wacom_report_abs(wcombo, ABS_WHEEL, t);
+                               wacom_report_abs(wcombo, ABS_Z, t);
                        } else {
                                /* 4D mouse rotation packet */
                                t = (data[6] << 3) | ((data[7] >> 5) & 7);
@@ -558,6 +558,7 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
                case INTUOS3:
                case INTUOS3L:
                case CINTIQ:
+               case WACOM_BEE:
                        return (wacom_intuos_irq(wacom_wac, wcombo));
                        break;
                default:
@@ -577,6 +578,8 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
                case GRAPHIRE:
                        input_dev_g(input_dev, wacom_wac);
                        break;
+               case WACOM_BEE:
+                       input_dev_bee(input_dev, wacom_wac);
                case INTUOS3:
                case INTUOS3L:
                case CINTIQ:
@@ -607,12 +610,15 @@ static struct wacom_features wacom_features[] = {
        { "Wacom Graphire3 6x8", 8,  16704, 12064,  511, 63, GRAPHIRE },
        { "Wacom Graphire4 4x5", 8,  10208,  7424,  511, 63, WACOM_G4 },
        { "Wacom Graphire4 6x8", 8,  16704, 12064,  511, 63, WACOM_G4 },
+       { "Wacom BambooFun 4x5", 9,  14760,  9225,  511, 63, WACOM_MO },
+       { "Wacom BambooFun 6x8", 9,  21648, 13530,  511, 63, WACOM_MO },
        { "Wacom Volito",        8,   5104,  3712,  511, 63, GRAPHIRE },
        { "Wacom PenStation2",   8,   3250,  2320,  255, 63, GRAPHIRE },
        { "Wacom Volito2 4x5",   8,   5104,  3712,  511, 63, GRAPHIRE },
        { "Wacom Volito2 2x3",   8,   3248,  2320,  511, 63, GRAPHIRE },
-       { "Wacom PenPartner2",   8,   3250,  2320,  255, 63, GRAPHIRE },
+       { "Wacom PenPartner2",   8,   3250,  2320,  511, 63, GRAPHIRE },
        { "Wacom Bamboo",        9,  14760,  9225,  511, 63, WACOM_MO },
+       { "Wacom Bamboo1",       8,   5104,  3712,  511, 63, GRAPHIRE },
        { "Wacom Intuos 4x5",   10,  12700, 10600, 1023, 31, INTUOS },
        { "Wacom Intuos 6x8",   10,  20320, 16240, 1023, 31, INTUOS },
        { "Wacom Intuos 9x12",  10,  30480, 24060, 1023, 31, INTUOS },
@@ -643,6 +649,7 @@ static struct wacom_features wacom_features[] = {
        { "Wacom Intuos3 6x11",  10, 54204, 31750, 1023, 63, INTUOS3 },
        { "Wacom Intuos3 4x6",   10, 31496, 19685, 1023, 63, INTUOS3S },
        { "Wacom Cintiq 21UX",   10, 87200, 65600, 1023, 63, CINTIQ },
+       { "Wacom Cintiq 12WX",   10, 53020, 33440, 1023, 63, WACOM_BEE },
        { "Wacom Intuos2 6x8",   10, 20320, 16240, 1023, 31, INTUOS },
        { }
 };
@@ -656,12 +663,15 @@ static struct usb_device_id wacom_ids[] = {
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) },
+       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) },
+       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) },
+       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x69) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
@@ -692,6 +702,7 @@ static struct usb_device_id wacom_ids[] = {
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
+       { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
        { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
        { }
 };
index a302e229bb8a7d005d65f62f6831245b2bbcd96a..3342bc05847d68e60f5d610dcb69e06a3c4aa5d1 100644 (file)
@@ -25,6 +25,7 @@ enum {
        INTUOS3,
        INTUOS3L,
        CINTIQ,
+       WACOM_BEE,
        WACOM_MO,
        MAX_TYPE
 };
index 58934a40f5ce5ff90abfbe071327370598d0e631..57a1c28bf1226e0a37a904154bc3e540c4463db7 100644 (file)
@@ -213,7 +213,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
        struct ads7846          *ts = dev_get_drvdata(dev);
        struct ser_req          *req = kzalloc(sizeof *req, GFP_KERNEL);
        int                     status;
-       int                     sample;
+       int                     uninitialized_var(sample);
        int                     use_internal;
 
        if (!req)
index 7f4836b8e71e31e9c68071d120114d9a4b8a3317..5fa4ba0d9934e42418eb5e07451685dc7ac5956a 100644 (file)
@@ -467,7 +467,7 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_
        t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);
 
        t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */
-       if (value) {
+       if (value && pciehp_force) {
                rc = pciehp_enable_slot(t_slot);
                if (rc) /* -ENODEV: shouldn't happen, but deal with it */
                        value = 0;
index 3312fcc3c0986401511c1fc7c3948a6af6c69876..553b5b7960ad1a3f380f03afbf780f0867767972 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1194,6 +1194,8 @@ EXPORT_SYMBOL(bio_hw_segments);
 EXPORT_SYMBOL(bio_add_page);
 EXPORT_SYMBOL(bio_add_pc_page);
 EXPORT_SYMBOL(bio_get_nr_vecs);
+EXPORT_SYMBOL(bio_map_user);
+EXPORT_SYMBOL(bio_unmap_user);
 EXPORT_SYMBOL(bio_map_kern);
 EXPORT_SYMBOL(bio_pair_release);
 EXPORT_SYMBOL(bio_split);
index 0fac822c115727c36822e232963b9cc49ef3cb1a..4108b38ebb16f2c3e9f715e62915d1e29c64f513 100644 (file)
@@ -127,7 +127,6 @@ header-y += pkt_sched.h
 header-y += posix_types.h
 header-y += ppdev.h
 header-y += prctl.h
-header-y += ps2esdi.h
 header-y += qnxtypes.h
 header-y += quotaio_v1.h
 header-y += quotaio_v2.h
diff --git a/include/linux/ps2esdi.h b/include/linux/ps2esdi.h
deleted file mode 100644 (file)
index c0e050b..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-#ifndef _PS2ESDI_H_
-#define _PS2ESDI_H_
-
-#define NRML_ESDI_ID 0xddff
-#define INTG_ESDI_ID 0xdf9f
-
-#define PRIMARY_IO_BASE 0x3510
-#define ALT_IO_BASE 0x3518
-
-#define ESDI_CMD_INT (io_base+0)
-#define ESDI_STT_INT (io_base+0)
-#define ESDI_CONTROL (io_base+2)
-#define ESDI_STATUS  (io_base+2)
-#define ESDI_ATTN    (io_base+3)
-#define ESDI_INTRPT  (io_base+3)
-
-#define STATUS_ENABLED    0x01
-#define STATUS_ALTERNATE  0x02
-#define STATUS_BUSY       0x10
-#define STATUS_STAT_AVAIL 0x08
-#define STATUS_INTR       0x01
-#define STATUS_RESET_FAIL 0xea
-#define STATUS_CMD_INF   0x04
-
-#define CTRL_SOFT_RESET   0xe4
-#define CTRL_HARD_RESET   0x80
-#define CTRL_EOI          0xe2
-#define CTRL_ENABLE_DMA   0x02
-#define CTRL_ENABLE_INTR  0x01
-#define CTRL_DISABLE_INTR  0x00
-
-#define ATT_EOI 0x02
-
-/* bits of word 0 of configuration status block. more info see p.38 of tech ref */
-#define CONFIG_IS 0x10 /* Invalid Secondary */
-#define CONFIG_ZD 0x08 /* Zero Defect */
-#define CONFIG_SF 0x04 /* Skewed Format */
-#define CONFIG_FR 0x02 /* Removable */
-#define CONFIG_RT 0x01 /* Retries */
-
-#define PORT_SYS_A   0x92
-#define PORT_DMA_FN  0x18
-#define PORT_DMA_EX  0x1a
-
-#define ON (unsigned char)0x40
-#define OFF (unsigned char)~ON
-#define LITE_ON outb(inb(PORT_SYS_A) | ON,PORT_SYS_A)
-#define LITE_OFF outb((inb(PORT_SYS_A) & OFF),PORT_SYS_A)
-
-#define FAIL 0
-#define SUCCES 1
-
-#define INT_CMD_COMPLETE 0x01
-#define INT_CMD_ECC      0x03
-#define INT_CMD_RETRY    0x05
-#define INT_CMD_FORMAT   0x06
-#define INT_CMD_ECC_RETRY 0x07
-#define INT_CMD_WARNING  0x08
-#define INT_CMD_ABORT    0x09
-#define INT_RESET        0x0A
-#define INT_TRANSFER_REQ 0x0B
-#define INT_CMD_FAILED   0x0C
-#define INT_DMA_ERR      0x0D
-#define INT_CMD_BLK_ERR  0x0E
-#define INT_ATTN_ERROR   0x0F
-
-#define DMA_MASK_CHAN 0x90
-#define DMA_UNMASK_CHAN 0xA0
-#define DMA_WRITE_ADDR 0x20
-#define DMA_WRITE_TC 0x40
-#define DMA_WRITE_MODE 0x70
-
-#define CMD_GET_DEV_CONFIG 0x09
-#define CMD_READ 0x4601
-#define CMD_WRITE 0x4602
-#define DMA_READ_16 0x4C
-#define DMA_WRITE_16 0x44
-
-
-#define MB 1024*1024
-#define SECT_SIZE 512   
-
-#define ERROR 1
-#define OK 0
-
-#define HDIO_GETGEO 0x0301
-
-#define FALSE 0
-#define TRUE !FALSE
-
-struct ps2esdi_geometry {
-       unsigned char heads;
-       unsigned char sectors;
-       unsigned short cylinders;
-       unsigned long start;
-};
-
-#endif /* _PS2ESDI_H_ */
index d080b9d161a75eee95bbf6d7aed235354bda9e9c..4c035a8a248c2bfabea85bfd616c9562fcf4f440 100644 (file)
@@ -1066,7 +1066,7 @@ static int subbuf_splice_actor(struct file *in,
                               unsigned int flags,
                               int *nonpad_ret)
 {
-       unsigned int pidx, poff, total_len, subbuf_pages, ret;
+       unsigned int pidx, poff, total_len, subbuf_pages, nr_pages, ret;
        struct rchan_buf *rbuf = in->private_data;
        unsigned int subbuf_size = rbuf->chan->subbuf_size;
        uint64_t pos = (uint64_t) *ppos;
@@ -1097,8 +1097,9 @@ static int subbuf_splice_actor(struct file *in,
        subbuf_pages = rbuf->chan->alloc_size >> PAGE_SHIFT;
        pidx = (read_start / PAGE_SIZE) % subbuf_pages;
        poff = read_start & ~PAGE_MASK;
+       nr_pages = min_t(unsigned int, subbuf_pages, PIPE_BUFFERS);
 
-       for (total_len = 0; spd.nr_pages < subbuf_pages; spd.nr_pages++) {
+       for (total_len = 0; spd.nr_pages < nr_pages; spd.nr_pages++) {
                unsigned int this_len, this_end, private;
                unsigned int cur_pos = read_start + total_len;
 
index 4bf4807f2d44351f9a46084a21e26567e8602448..41a049f50f58f43e131219c2318df9c265d76782 100644 (file)
@@ -800,7 +800,8 @@ static void selinux_sb_clone_mnt_opts(const struct super_block *oldsb,
        mutex_unlock(&newsbsec->lock);
 }
 
-int selinux_parse_opts_str(char *options, struct security_mnt_opts *opts)
+static int selinux_parse_opts_str(char *options,
+                                 struct security_mnt_opts *opts)
 {
        char *p;
        char *context = NULL, *defcontext = NULL;