diff options
Diffstat (limited to 'drivers')
130 files changed, 3148 insertions, 916 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index ddeb819c8f87..fc466531260e 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
| @@ -357,7 +357,7 @@ static void fw_dev_release(struct device *dev) | |||
| 357 | kfree(fw_priv->pages); | 357 | kfree(fw_priv->pages); |
| 358 | kfree(fw_priv->fw_id); | 358 | kfree(fw_priv->fw_id); |
| 359 | kfree(fw_priv); | 359 | kfree(fw_priv); |
| 360 | put_device(dev); | 360 | kfree(dev); |
| 361 | 361 | ||
| 362 | module_put(THIS_MODULE); | 362 | module_put(THIS_MODULE); |
| 363 | } | 363 | } |
| @@ -408,13 +408,11 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, | |||
| 408 | if (retval) { | 408 | if (retval) { |
| 409 | dev_err(device, "%s: device_register failed\n", __func__); | 409 | dev_err(device, "%s: device_register failed\n", __func__); |
| 410 | put_device(f_dev); | 410 | put_device(f_dev); |
| 411 | goto error_kfree_fw_id; | 411 | return retval; |
| 412 | } | 412 | } |
| 413 | *dev_p = f_dev; | 413 | *dev_p = f_dev; |
| 414 | return 0; | 414 | return 0; |
| 415 | 415 | ||
| 416 | error_kfree_fw_id: | ||
| 417 | kfree(fw_priv->fw_id); | ||
| 418 | error_kfree: | 416 | error_kfree: |
| 419 | kfree(f_dev); | 417 | kfree(f_dev); |
| 420 | kfree(fw_priv); | 418 | kfree(fw_priv); |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index fae725458981..58a3e572f2c9 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -762,6 +762,7 @@ static int dpm_prepare(pm_message_t state) | |||
| 762 | dev->power.status = DPM_ON; | 762 | dev->power.status = DPM_ON; |
| 763 | if (error == -EAGAIN) { | 763 | if (error == -EAGAIN) { |
| 764 | put_device(dev); | 764 | put_device(dev); |
| 765 | error = 0; | ||
| 765 | continue; | 766 | continue; |
| 766 | } | 767 | } |
| 767 | printk(KERN_ERR "PM: Failed to prepare device %s " | 768 | printk(KERN_ERR "PM: Failed to prepare device %s " |
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index bb72ada9f074..1d886e079c58 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
| @@ -298,6 +298,22 @@ config BLK_DEV_NBD | |||
| 298 | 298 | ||
| 299 | If unsure, say N. | 299 | If unsure, say N. |
| 300 | 300 | ||
| 301 | config BLK_DEV_OSD | ||
| 302 | tristate "OSD object-as-blkdev support" | ||
| 303 | depends on SCSI_OSD_ULD | ||
| 304 | ---help--- | ||
| 305 | Saying Y or M here will allow the exporting of a single SCSI | ||
| 306 | OSD (object-based storage) object as a Linux block device. | ||
| 307 | |||
| 308 | For example, if you create a 2G object on an OSD device, | ||
| 309 | you can then use this module to present that 2G object as | ||
| 310 | a Linux block device. | ||
| 311 | |||
| 312 | To compile this driver as a module, choose M here: the | ||
| 313 | module will be called osdblk. | ||
| 314 | |||
| 315 | If unsure, say N. | ||
| 316 | |||
| 301 | config BLK_DEV_SX8 | 317 | config BLK_DEV_SX8 |
| 302 | tristate "Promise SATA SX8 support" | 318 | tristate "Promise SATA SX8 support" |
| 303 | depends on PCI | 319 | depends on PCI |
diff --git a/drivers/block/Makefile b/drivers/block/Makefile index 7755a5e2a85e..cdaa3f8fddf0 100644 --- a/drivers/block/Makefile +++ b/drivers/block/Makefile | |||
| @@ -23,6 +23,7 @@ obj-$(CONFIG_XILINX_SYSACE) += xsysace.o | |||
| 23 | obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o | 23 | obj-$(CONFIG_CDROM_PKTCDVD) += pktcdvd.o |
| 24 | obj-$(CONFIG_MG_DISK) += mg_disk.o | 24 | obj-$(CONFIG_MG_DISK) += mg_disk.o |
| 25 | obj-$(CONFIG_SUNVDC) += sunvdc.o | 25 | obj-$(CONFIG_SUNVDC) += sunvdc.o |
| 26 | obj-$(CONFIG_BLK_DEV_OSD) += osdblk.o | ||
| 26 | 27 | ||
| 27 | obj-$(CONFIG_BLK_DEV_UMEM) += umem.o | 28 | obj-$(CONFIG_BLK_DEV_UMEM) += umem.o |
| 28 | obj-$(CONFIG_BLK_DEV_NBD) += nbd.o | 29 | obj-$(CONFIG_BLK_DEV_NBD) += nbd.o |
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c index 9c6e5b0fe894..2f07b7c99a95 100644 --- a/drivers/block/amiflop.c +++ b/drivers/block/amiflop.c | |||
| @@ -1645,7 +1645,7 @@ static int __init fd_probe_drives(void) | |||
| 1645 | { | 1645 | { |
| 1646 | int drive,drives,nomem; | 1646 | int drive,drives,nomem; |
| 1647 | 1647 | ||
| 1648 | printk(KERN_INFO "FD: probing units\n" KERN_INFO "found "); | 1648 | printk(KERN_INFO "FD: probing units\nfound "); |
| 1649 | drives=0; | 1649 | drives=0; |
| 1650 | nomem=0; | 1650 | nomem=0; |
| 1651 | for(drive=0;drive<FD_MAX_UNITS;drive++) { | 1651 | for(drive=0;drive<FD_MAX_UNITS;drive++) { |
diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c new file mode 100644 index 000000000000..13c1aee6aa3f --- /dev/null +++ b/drivers/block/osdblk.c | |||
| @@ -0,0 +1,701 @@ | |||
| 1 | |||
| 2 | /* | ||
| 3 | osdblk.c -- Export a single SCSI OSD object as a Linux block device | ||
| 4 | |||
| 5 | |||
| 6 | Copyright 2009 Red Hat, Inc. | ||
| 7 | |||
| 8 | This program is free software; you can redistribute it and/or modify | ||
| 9 | it under the terms of the GNU General Public License as published by | ||
| 10 | the Free Software Foundation. | ||
| 11 | |||
| 12 | This program is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with this program; see the file COPYING. If not, write to | ||
| 19 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 20 | |||
| 21 | |||
| 22 | Instructions for use | ||
| 23 | -------------------- | ||
| 24 | |||
| 25 | 1) Map a Linux block device to an existing OSD object. | ||
| 26 | |||
| 27 | In this example, we will use partition id 1234, object id 5678, | ||
| 28 | OSD device /dev/osd1. | ||
| 29 | |||
| 30 | $ echo "1234 5678 /dev/osd1" > /sys/class/osdblk/add | ||
| 31 | |||
| 32 | |||
| 33 | 2) List all active blkdev<->object mappings. | ||
| 34 | |||
| 35 | In this example, we have performed step #1 twice, creating two blkdevs, | ||
| 36 | mapped to two separate OSD objects. | ||
| 37 | |||
| 38 | $ cat /sys/class/osdblk/list | ||
| 39 | 0 174 1234 5678 /dev/osd1 | ||
| 40 | 1 179 1994 897123 /dev/osd0 | ||
| 41 | |||
| 42 | The columns, in order, are: | ||
| 43 | - blkdev unique id | ||
| 44 | - blkdev assigned major | ||
| 45 | - OSD object partition id | ||
| 46 | - OSD object id | ||
| 47 | - OSD device | ||
| 48 | |||
| 49 | |||
| 50 | 3) Remove an active blkdev<->object mapping. | ||
| 51 | |||
| 52 | In this example, we remove the mapping with blkdev unique id 1. | ||
| 53 | |||
| 54 | $ echo 1 > /sys/class/osdblk/remove | ||
| 55 | |||
| 56 | |||
| 57 | NOTE: The actual creation and deletion of OSD objects is outside the scope | ||
| 58 | of this driver. | ||
| 59 | |||
| 60 | */ | ||
| 61 | |||
| 62 | #include <linux/kernel.h> | ||
| 63 | #include <linux/device.h> | ||
| 64 | #include <linux/module.h> | ||
| 65 | #include <linux/fs.h> | ||
| 66 | #include <scsi/osd_initiator.h> | ||
| 67 | #include <scsi/osd_attributes.h> | ||
| 68 | #include <scsi/osd_sec.h> | ||
| 69 | #include <scsi/scsi_device.h> | ||
| 70 | |||
| 71 | #define DRV_NAME "osdblk" | ||
| 72 | #define PFX DRV_NAME ": " | ||
| 73 | |||
| 74 | /* #define _OSDBLK_DEBUG */ | ||
| 75 | #ifdef _OSDBLK_DEBUG | ||
| 76 | #define OSDBLK_DEBUG(fmt, a...) \ | ||
| 77 | printk(KERN_NOTICE "osdblk @%s:%d: " fmt, __func__, __LINE__, ##a) | ||
| 78 | #else | ||
| 79 | #define OSDBLK_DEBUG(fmt, a...) \ | ||
| 80 | do { if (0) printk(fmt, ##a); } while (0) | ||
| 81 | #endif | ||
| 82 | |||
| 83 | MODULE_AUTHOR("Jeff Garzik <jeff@garzik.org>"); | ||
| 84 | MODULE_DESCRIPTION("block device inside an OSD object osdblk.ko"); | ||
| 85 | MODULE_LICENSE("GPL"); | ||
| 86 | |||
| 87 | struct osdblk_device; | ||
| 88 | |||
| 89 | enum { | ||
| 90 | OSDBLK_MINORS_PER_MAJOR = 256, /* max minors per blkdev */ | ||
| 91 | OSDBLK_MAX_REQ = 32, /* max parallel requests */ | ||
| 92 | OSDBLK_OP_TIMEOUT = 4 * 60, /* sync OSD req timeout */ | ||
| 93 | }; | ||
| 94 | |||
| 95 | struct osdblk_request { | ||
| 96 | struct request *rq; /* blk layer request */ | ||
| 97 | struct bio *bio; /* cloned bio */ | ||
| 98 | struct osdblk_device *osdev; /* associated blkdev */ | ||
| 99 | }; | ||
| 100 | |||
| 101 | struct osdblk_device { | ||
| 102 | int id; /* blkdev unique id */ | ||
| 103 | |||
| 104 | int major; /* blkdev assigned major */ | ||
| 105 | struct gendisk *disk; /* blkdev's gendisk and rq */ | ||
| 106 | struct request_queue *q; | ||
| 107 | |||
| 108 | struct osd_dev *osd; /* associated OSD */ | ||
| 109 | |||
| 110 | char name[32]; /* blkdev name, e.g. osdblk34 */ | ||
| 111 | |||
| 112 | spinlock_t lock; /* queue lock */ | ||
| 113 | |||
| 114 | struct osd_obj_id obj; /* OSD partition, obj id */ | ||
| 115 | uint8_t obj_cred[OSD_CAP_LEN]; /* OSD cred */ | ||
| 116 | |||
| 117 | struct osdblk_request req[OSDBLK_MAX_REQ]; /* request table */ | ||
| 118 | |||
| 119 | struct list_head node; | ||
| 120 | |||
| 121 | char osd_path[0]; /* OSD device path */ | ||
| 122 | }; | ||
| 123 | |||
| 124 | static struct class *class_osdblk; /* /sys/class/osdblk */ | ||
| 125 | static DEFINE_MUTEX(ctl_mutex); /* Serialize open/close/setup/teardown */ | ||
| 126 | static LIST_HEAD(osdblkdev_list); | ||
| 127 | |||
| 128 | static struct block_device_operations osdblk_bd_ops = { | ||
| 129 | .owner = THIS_MODULE, | ||
| 130 | }; | ||
| 131 | |||
| 132 | static const struct osd_attr g_attr_logical_length = ATTR_DEF( | ||
| 133 | OSD_APAGE_OBJECT_INFORMATION, OSD_ATTR_OI_LOGICAL_LENGTH, 8); | ||
| 134 | |||
| 135 | static void osdblk_make_credential(u8 cred_a[OSD_CAP_LEN], | ||
| 136 | const struct osd_obj_id *obj) | ||
| 137 | { | ||
| 138 | osd_sec_init_nosec_doall_caps(cred_a, obj, false, true); | ||
| 139 | } | ||
| 140 | |||
| 141 | /* copied from exofs; move to libosd? */ | ||
| 142 | /* | ||
| 143 | * Perform a synchronous OSD operation. copied from exofs; move to libosd? | ||
| 144 | */ | ||
| 145 | static int osd_sync_op(struct osd_request *or, int timeout, uint8_t *credential) | ||
| 146 | { | ||
| 147 | int ret; | ||
| 148 | |||
| 149 | or->timeout = timeout; | ||
| 150 | ret = osd_finalize_request(or, 0, credential, NULL); | ||
| 151 | if (ret) | ||
| 152 | return ret; | ||
| 153 | |||
| 154 | ret = osd_execute_request(or); | ||
| 155 | |||
| 156 | /* osd_req_decode_sense(or, ret); */ | ||
| 157 | return ret; | ||
| 158 | } | ||
| 159 | |||
| 160 | /* | ||
| 161 | * Perform an asynchronous OSD operation. copied from exofs; move to libosd? | ||
| 162 | */ | ||
| 163 | static int osd_async_op(struct osd_request *or, osd_req_done_fn *async_done, | ||
| 164 | void *caller_context, u8 *cred) | ||
| 165 | { | ||
| 166 | int ret; | ||
| 167 | |||
| 168 | ret = osd_finalize_request(or, 0, cred, NULL); | ||
| 169 | if (ret) | ||
| 170 | return ret; | ||
| 171 | |||
| 172 | ret = osd_execute_request_async(or, async_done, caller_context); | ||
| 173 | |||
| 174 | return ret; | ||
| 175 | } | ||
| 176 | |||
| 177 | /* copied from exofs; move to libosd? */ | ||
| 178 | static int extract_attr_from_req(struct osd_request *or, struct osd_attr *attr) | ||
| 179 | { | ||
| 180 | struct osd_attr cur_attr = {.attr_page = 0}; /* start with zeros */ | ||
| 181 | void *iter = NULL; | ||
| 182 | int nelem; | ||
| 183 | |||
| 184 | do { | ||
| 185 | nelem = 1; | ||
| 186 | osd_req_decode_get_attr_list(or, &cur_attr, &nelem, &iter); | ||
| 187 | if ((cur_attr.attr_page == attr->attr_page) && | ||
| 188 | (cur_attr.attr_id == attr->attr_id)) { | ||
| 189 | attr->len = cur_attr.len; | ||
| 190 | attr->val_ptr = cur_attr.val_ptr; | ||
| 191 | return 0; | ||
| 192 | } | ||
| 193 | } while (iter); | ||
| 194 | |||
| 195 | return -EIO; | ||
| 196 | } | ||
| 197 | |||
| 198 | static int osdblk_get_obj_size(struct osdblk_device *osdev, u64 *size_out) | ||
| 199 | { | ||
| 200 | struct osd_request *or; | ||
| 201 | struct osd_attr attr; | ||
| 202 | int ret; | ||
| 203 | |||
| 204 | /* start request */ | ||
| 205 | or = osd_start_request(osdev->osd, GFP_KERNEL); | ||
| 206 | if (!or) | ||
| 207 | return -ENOMEM; | ||
| 208 | |||
| 209 | /* create a get-attributes(length) request */ | ||
| 210 | osd_req_get_attributes(or, &osdev->obj); | ||
| 211 | |||
| 212 | osd_req_add_get_attr_list(or, &g_attr_logical_length, 1); | ||
| 213 | |||
| 214 | /* execute op synchronously */ | ||
| 215 | ret = osd_sync_op(or, OSDBLK_OP_TIMEOUT, osdev->obj_cred); | ||
| 216 | if (ret) | ||
| 217 | goto out; | ||
| 218 | |||
| 219 | /* extract length from returned attribute info */ | ||
| 220 | attr = g_attr_logical_length; | ||
| 221 | ret = extract_attr_from_req(or, &attr); | ||
| 222 | if (ret) | ||
| 223 | goto out; | ||
| 224 | |||
| 225 | *size_out = get_unaligned_be64(attr.val_ptr); | ||
| 226 | |||
| 227 | out: | ||
| 228 | osd_end_request(or); | ||
| 229 | return ret; | ||
| 230 | |||
| 231 | } | ||
| 232 | |||
| 233 | static void osdblk_osd_complete(struct osd_request *or, void *private) | ||
| 234 | { | ||
| 235 | struct osdblk_request *orq = private; | ||
| 236 | struct osd_sense_info osi; | ||
| 237 | int ret = osd_req_decode_sense(or, &osi); | ||
| 238 | |||
| 239 | if (ret) { | ||
| 240 | ret = -EIO; | ||
| 241 | OSDBLK_DEBUG("osdblk_osd_complete with err=%d\n", ret); | ||
| 242 | } | ||
| 243 | |||
| 244 | /* complete OSD request */ | ||
| 245 | osd_end_request(or); | ||
| 246 | |||
| 247 | /* complete request passed to osdblk by block layer */ | ||
| 248 | __blk_end_request_all(orq->rq, ret); | ||
| 249 | } | ||
| 250 | |||
| 251 | static void bio_chain_put(struct bio *chain) | ||
| 252 | { | ||
| 253 | struct bio *tmp; | ||
| 254 | |||
| 255 | while (chain) { | ||
| 256 | tmp = chain; | ||
| 257 | chain = chain->bi_next; | ||
| 258 | |||
| 259 | bio_put(tmp); | ||
| 260 | } | ||
| 261 | } | ||
| 262 | |||
| 263 | static struct bio *bio_chain_clone(struct bio *old_chain, gfp_t gfpmask) | ||
| 264 | { | ||
| 265 | struct bio *tmp, *new_chain = NULL, *tail = NULL; | ||
| 266 | |||
| 267 | while (old_chain) { | ||
| 268 | tmp = bio_kmalloc(gfpmask, old_chain->bi_max_vecs); | ||
| 269 | if (!tmp) | ||
| 270 | goto err_out; | ||
| 271 | |||
| 272 | __bio_clone(tmp, old_chain); | ||
| 273 | tmp->bi_bdev = NULL; | ||
| 274 | gfpmask &= ~__GFP_WAIT; | ||
| 275 | tmp->bi_next = NULL; | ||
| 276 | |||
| 277 | if (!new_chain) | ||
| 278 | new_chain = tail = tmp; | ||
| 279 | else { | ||
| 280 | tail->bi_next = tmp; | ||
| 281 | tail = tmp; | ||
| 282 | } | ||
| 283 | |||
| 284 | old_chain = old_chain->bi_next; | ||
| 285 | } | ||
| 286 | |||
| 287 | return new_chain; | ||
| 288 | |||
| 289 | err_out: | ||
| 290 | OSDBLK_DEBUG("bio_chain_clone with err\n"); | ||
| 291 | bio_chain_put(new_chain); | ||
| 292 | return NULL; | ||
| 293 | } | ||
| 294 | |||
| 295 | static void osdblk_rq_fn(struct request_queue *q) | ||
| 296 | { | ||
| 297 | struct osdblk_device *osdev = q->queuedata; | ||
| 298 | |||
| 299 | while (1) { | ||
| 300 | struct request *rq; | ||
| 301 | struct osdblk_request *orq; | ||
| 302 | struct osd_request *or; | ||
| 303 | struct bio *bio; | ||
| 304 | bool do_write, do_flush; | ||
| 305 | |||
| 306 | /* peek at request from block layer */ | ||
| 307 | rq = blk_fetch_request(q); | ||
| 308 | if (!rq) | ||
| 309 | break; | ||
| 310 | |||
| 311 | /* filter out block requests we don't understand */ | ||
| 312 | if (!blk_fs_request(rq) && !blk_barrier_rq(rq)) { | ||
| 313 | blk_end_request_all(rq, 0); | ||
| 314 | continue; | ||
| 315 | } | ||
| 316 | |||
| 317 | /* deduce our operation (read, write, flush) */ | ||
| 318 | /* I wish the block layer simplified cmd_type/cmd_flags/cmd[] | ||
| 319 | * into a clearly defined set of RPC commands: | ||
| 320 | * read, write, flush, scsi command, power mgmt req, | ||
| 321 | * driver-specific, etc. | ||
| 322 | */ | ||
| 323 | |||
| 324 | do_flush = (rq->special == (void *) 0xdeadbeefUL); | ||
| 325 | do_write = (rq_data_dir(rq) == WRITE); | ||
| 326 | |||
| 327 | if (!do_flush) { /* osd_flush does not use a bio */ | ||
| 328 | /* a bio clone to be passed down to OSD request */ | ||
| 329 | bio = bio_chain_clone(rq->bio, GFP_ATOMIC); | ||
| 330 | if (!bio) | ||
| 331 | break; | ||
| 332 | } else | ||
| 333 | bio = NULL; | ||
| 334 | |||
| 335 | /* alloc internal OSD request, for OSD command execution */ | ||
| 336 | or = osd_start_request(osdev->osd, GFP_ATOMIC); | ||
| 337 | if (!or) { | ||
| 338 | bio_chain_put(bio); | ||
| 339 | OSDBLK_DEBUG("osd_start_request with err\n"); | ||
| 340 | break; | ||
| 341 | } | ||
| 342 | |||
| 343 | orq = &osdev->req[rq->tag]; | ||
| 344 | orq->rq = rq; | ||
| 345 | orq->bio = bio; | ||
| 346 | orq->osdev = osdev; | ||
| 347 | |||
| 348 | /* init OSD command: flush, write or read */ | ||
| 349 | if (do_flush) | ||
| 350 | osd_req_flush_object(or, &osdev->obj, | ||
| 351 | OSD_CDB_FLUSH_ALL, 0, 0); | ||
| 352 | else if (do_write) | ||
| 353 | osd_req_write(or, &osdev->obj, blk_rq_pos(rq) * 512ULL, | ||
| 354 | bio, blk_rq_bytes(rq)); | ||
| 355 | else | ||
| 356 | osd_req_read(or, &osdev->obj, blk_rq_pos(rq) * 512ULL, | ||
| 357 | bio, blk_rq_bytes(rq)); | ||
| 358 | |||
| 359 | OSDBLK_DEBUG("%s 0x%x bytes at 0x%llx\n", | ||
| 360 | do_flush ? "flush" : do_write ? | ||
| 361 | "write" : "read", blk_rq_bytes(rq), | ||
| 362 | blk_rq_pos(rq) * 512ULL); | ||
| 363 | |||
| 364 | /* begin OSD command execution */ | ||
| 365 | if (osd_async_op(or, osdblk_osd_complete, orq, | ||
| 366 | osdev->obj_cred)) { | ||
| 367 | osd_end_request(or); | ||
| 368 | blk_requeue_request(q, rq); | ||
| 369 | bio_chain_put(bio); | ||
| 370 | OSDBLK_DEBUG("osd_execute_request_async with err\n"); | ||
| 371 | break; | ||
| 372 | } | ||
| 373 | |||
| 374 | /* remove the special 'flush' marker, now that the command | ||
| 375 | * is executing | ||
| 376 | */ | ||
| 377 | rq->special = NULL; | ||
| 378 | } | ||
| 379 | } | ||
| 380 | |||
| 381 | static void osdblk_prepare_flush(struct request_queue *q, struct request *rq) | ||
| 382 | { | ||
| 383 | /* add driver-specific marker, to indicate that this request | ||
| 384 | * is a flush command | ||
| 385 | */ | ||
| 386 | rq->special = (void *) 0xdeadbeefUL; | ||
| 387 | } | ||
| 388 | |||
| 389 | static void osdblk_free_disk(struct osdblk_device *osdev) | ||
| 390 | { | ||
| 391 | struct gendisk *disk = osdev->disk; | ||
| 392 | |||
| 393 | if (!disk) | ||
| 394 | return; | ||
| 395 | |||
| 396 | if (disk->flags & GENHD_FL_UP) | ||
| 397 | del_gendisk(disk); | ||
| 398 | if (disk->queue) | ||
| 399 | blk_cleanup_queue(disk->queue); | ||
| 400 | put_disk(disk); | ||
| 401 | } | ||
| 402 | |||
| 403 | static int osdblk_init_disk(struct osdblk_device *osdev) | ||
| 404 | { | ||
| 405 | struct gendisk *disk; | ||
| 406 | struct request_queue *q; | ||
| 407 | int rc; | ||
| 408 | u64 obj_size = 0; | ||
| 409 | |||
| 410 | /* contact OSD, request size info about the object being mapped */ | ||
| 411 | rc = osdblk_get_obj_size(osdev, &obj_size); | ||
| 412 | if (rc) | ||
| 413 | return rc; | ||
| 414 | |||
| 415 | /* create gendisk info */ | ||
| 416 | disk = alloc_disk(OSDBLK_MINORS_PER_MAJOR); | ||
| 417 | if (!disk) | ||
| 418 | return -ENOMEM; | ||
| 419 | |||
| 420 | sprintf(disk->disk_name, DRV_NAME "%d", osdev->id); | ||
| 421 | disk->major = osdev->major; | ||
| 422 | disk->first_minor = 0; | ||
| 423 | disk->fops = &osdblk_bd_ops; | ||
| 424 | disk->private_data = osdev; | ||
| 425 | |||
| 426 | /* init rq */ | ||
| 427 | q = blk_init_queue(osdblk_rq_fn, &osdev->lock); | ||
| 428 | if (!q) { | ||
| 429 | put_disk(disk); | ||
| 430 | return -ENOMEM; | ||
| 431 | } | ||
| 432 | |||
| 433 | /* switch queue to TCQ mode; allocate tag map */ | ||
| 434 | rc = blk_queue_init_tags(q, OSDBLK_MAX_REQ, NULL); | ||
| 435 | if (rc) { | ||
| 436 | blk_cleanup_queue(q); | ||
| 437 | put_disk(disk); | ||
| 438 | return rc; | ||
| 439 | } | ||
| 440 | |||
| 441 | /* Set our limits to the lower device limits, because osdblk cannot | ||
| 442 | * sleep when allocating a lower-request and therefore cannot be | ||
| 443 | * bouncing. | ||
| 444 | */ | ||
| 445 | blk_queue_stack_limits(q, osd_request_queue(osdev->osd)); | ||
| 446 | |||
| 447 | blk_queue_prep_rq(q, blk_queue_start_tag); | ||
| 448 | blk_queue_ordered(q, QUEUE_ORDERED_DRAIN_FLUSH, osdblk_prepare_flush); | ||
| 449 | |||
| 450 | disk->queue = q; | ||
| 451 | |||
| 452 | q->queuedata = osdev; | ||
| 453 | |||
| 454 | osdev->disk = disk; | ||
| 455 | osdev->q = q; | ||
| 456 | |||
| 457 | /* finally, announce the disk to the world */ | ||
| 458 | set_capacity(disk, obj_size / 512ULL); | ||
| 459 | add_disk(disk); | ||
| 460 | |||
| 461 | printk(KERN_INFO "%s: Added of size 0x%llx\n", | ||
| 462 | disk->disk_name, (unsigned long long)obj_size); | ||
| 463 | |||
| 464 | return 0; | ||
| 465 | } | ||
| 466 | |||
| 467 | /******************************************************************** | ||
| 468 | * /sys/class/osdblk/ | ||
| 469 | * add map OSD object to blkdev | ||
| 470 | * remove unmap OSD object | ||
| 471 | * list show mappings | ||
| 472 | *******************************************************************/ | ||
| 473 | |||
| 474 | static void class_osdblk_release(struct class *cls) | ||
| 475 | { | ||
| 476 | kfree(cls); | ||
| 477 | } | ||
| 478 | |||
| 479 | static ssize_t class_osdblk_list(struct class *c, char *data) | ||
| 480 | { | ||
| 481 | int n = 0; | ||
| 482 | struct list_head *tmp; | ||
| 483 | |||
| 484 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 485 | |||
| 486 | list_for_each(tmp, &osdblkdev_list) { | ||
| 487 | struct osdblk_device *osdev; | ||
| 488 | |||
| 489 | osdev = list_entry(tmp, struct osdblk_device, node); | ||
| 490 | |||
| 491 | n += sprintf(data+n, "%d %d %llu %llu %s\n", | ||
| 492 | osdev->id, | ||
| 493 | osdev->major, | ||
| 494 | osdev->obj.partition, | ||
| 495 | osdev->obj.id, | ||
| 496 | osdev->osd_path); | ||
| 497 | } | ||
| 498 | |||
| 499 | mutex_unlock(&ctl_mutex); | ||
| 500 | return n; | ||
| 501 | } | ||
| 502 | |||
| 503 | static ssize_t class_osdblk_add(struct class *c, const char *buf, size_t count) | ||
| 504 | { | ||
| 505 | struct osdblk_device *osdev; | ||
| 506 | ssize_t rc; | ||
| 507 | int irc, new_id = 0; | ||
| 508 | struct list_head *tmp; | ||
| 509 | |||
| 510 | if (!try_module_get(THIS_MODULE)) | ||
| 511 | return -ENODEV; | ||
| 512 | |||
| 513 | /* new osdblk_device object */ | ||
| 514 | osdev = kzalloc(sizeof(*osdev) + strlen(buf) + 1, GFP_KERNEL); | ||
| 515 | if (!osdev) { | ||
| 516 | rc = -ENOMEM; | ||
| 517 | goto err_out_mod; | ||
| 518 | } | ||
| 519 | |||
| 520 | /* static osdblk_device initialization */ | ||
| 521 | spin_lock_init(&osdev->lock); | ||
| 522 | INIT_LIST_HEAD(&osdev->node); | ||
| 523 | |||
| 524 | /* generate unique id: find highest unique id, add one */ | ||
| 525 | |||
| 526 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 527 | |||
| 528 | list_for_each(tmp, &osdblkdev_list) { | ||
| 529 | struct osdblk_device *osdev; | ||
| 530 | |||
| 531 | osdev = list_entry(tmp, struct osdblk_device, node); | ||
| 532 | if (osdev->id > new_id) | ||
| 533 | new_id = osdev->id + 1; | ||
| 534 | } | ||
| 535 | |||
| 536 | osdev->id = new_id; | ||
| 537 | |||
| 538 | /* add to global list */ | ||
| 539 | list_add_tail(&osdev->node, &osdblkdev_list); | ||
| 540 | |||
| 541 | mutex_unlock(&ctl_mutex); | ||
| 542 | |||
| 543 | /* parse add command */ | ||
| 544 | if (sscanf(buf, "%llu %llu %s", &osdev->obj.partition, &osdev->obj.id, | ||
| 545 | osdev->osd_path) != 3) { | ||
| 546 | rc = -EINVAL; | ||
| 547 | goto err_out_slot; | ||
| 548 | } | ||
| 549 | |||
| 550 | /* initialize rest of new object */ | ||
| 551 | sprintf(osdev->name, DRV_NAME "%d", osdev->id); | ||
| 552 | |||
| 553 | /* contact requested OSD */ | ||
| 554 | osdev->osd = osduld_path_lookup(osdev->osd_path); | ||
| 555 | if (IS_ERR(osdev->osd)) { | ||
| 556 | rc = PTR_ERR(osdev->osd); | ||
| 557 | goto err_out_slot; | ||
| 558 | } | ||
| 559 | |||
| 560 | /* build OSD credential */ | ||
| 561 | osdblk_make_credential(osdev->obj_cred, &osdev->obj); | ||
| 562 | |||
| 563 | /* register our block device */ | ||
| 564 | irc = register_blkdev(0, osdev->name); | ||
| 565 | if (irc < 0) { | ||
| 566 | rc = irc; | ||
| 567 | goto err_out_osd; | ||
| 568 | } | ||
| 569 | |||
| 570 | osdev->major = irc; | ||
| 571 | |||
| 572 | /* set up and announce blkdev mapping */ | ||
| 573 | rc = osdblk_init_disk(osdev); | ||
| 574 | if (rc) | ||
| 575 | goto err_out_blkdev; | ||
| 576 | |||
| 577 | return count; | ||
| 578 | |||
| 579 | err_out_blkdev: | ||
| 580 | unregister_blkdev(osdev->major, osdev->name); | ||
| 581 | err_out_osd: | ||
| 582 | osduld_put_device(osdev->osd); | ||
| 583 | err_out_slot: | ||
| 584 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 585 | list_del_init(&osdev->node); | ||
| 586 | mutex_unlock(&ctl_mutex); | ||
| 587 | |||
| 588 | kfree(osdev); | ||
| 589 | err_out_mod: | ||
| 590 | OSDBLK_DEBUG("Error adding device %s\n", buf); | ||
| 591 | module_put(THIS_MODULE); | ||
| 592 | return rc; | ||
| 593 | } | ||
| 594 | |||
| 595 | static ssize_t class_osdblk_remove(struct class *c, const char *buf, | ||
| 596 | size_t count) | ||
| 597 | { | ||
| 598 | struct osdblk_device *osdev = NULL; | ||
| 599 | int target_id, rc; | ||
| 600 | unsigned long ul; | ||
| 601 | struct list_head *tmp; | ||
| 602 | |||
| 603 | rc = strict_strtoul(buf, 10, &ul); | ||
| 604 | if (rc) | ||
| 605 | return rc; | ||
| 606 | |||
| 607 | /* convert to int; abort if we lost anything in the conversion */ | ||
| 608 | target_id = (int) ul; | ||
| 609 | if (target_id != ul) | ||
| 610 | return -EINVAL; | ||
| 611 | |||
| 612 | /* remove object from list immediately */ | ||
| 613 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 614 | |||
| 615 | list_for_each(tmp, &osdblkdev_list) { | ||
| 616 | osdev = list_entry(tmp, struct osdblk_device, node); | ||
| 617 | if (osdev->id == target_id) { | ||
| 618 | list_del_init(&osdev->node); | ||
| 619 | break; | ||
| 620 | } | ||
| 621 | osdev = NULL; | ||
| 622 | } | ||
| 623 | |||
| 624 | mutex_unlock(&ctl_mutex); | ||
| 625 | |||
| 626 | if (!osdev) | ||
| 627 | return -ENOENT; | ||
| 628 | |||
| 629 | /* clean up and free blkdev and associated OSD connection */ | ||
| 630 | osdblk_free_disk(osdev); | ||
| 631 | unregister_blkdev(osdev->major, osdev->name); | ||
| 632 | osduld_put_device(osdev->osd); | ||
| 633 | kfree(osdev); | ||
| 634 | |||
| 635 | /* release module ref */ | ||
| 636 | module_put(THIS_MODULE); | ||
| 637 | |||
| 638 | return count; | ||
| 639 | } | ||
| 640 | |||
| 641 | static struct class_attribute class_osdblk_attrs[] = { | ||
| 642 | __ATTR(add, 0200, NULL, class_osdblk_add), | ||
| 643 | __ATTR(remove, 0200, NULL, class_osdblk_remove), | ||
| 644 | __ATTR(list, 0444, class_osdblk_list, NULL), | ||
| 645 | __ATTR_NULL | ||
| 646 | }; | ||
| 647 | |||
| 648 | static int osdblk_sysfs_init(void) | ||
| 649 | { | ||
| 650 | int ret = 0; | ||
| 651 | |||
| 652 | /* | ||
| 653 | * create control files in sysfs | ||
| 654 | * /sys/class/osdblk/... | ||
| 655 | */ | ||
| 656 | class_osdblk = kzalloc(sizeof(*class_osdblk), GFP_KERNEL); | ||
| 657 | if (!class_osdblk) | ||
| 658 | return -ENOMEM; | ||
| 659 | |||
| 660 | class_osdblk->name = DRV_NAME; | ||
| 661 | class_osdblk->owner = THIS_MODULE; | ||
| 662 | class_osdblk->class_release = class_osdblk_release; | ||
| 663 | class_osdblk->class_attrs = class_osdblk_attrs; | ||
| 664 | |||
| 665 | ret = class_register(class_osdblk); | ||
| 666 | if (ret) { | ||
| 667 | kfree(class_osdblk); | ||
| 668 | class_osdblk = NULL; | ||
| 669 | printk(PFX "failed to create class osdblk\n"); | ||
| 670 | return ret; | ||
| 671 | } | ||
| 672 | |||
| 673 | return 0; | ||
| 674 | } | ||
| 675 | |||
| 676 | static void osdblk_sysfs_cleanup(void) | ||
| 677 | { | ||
| 678 | if (class_osdblk) | ||
| 679 | class_destroy(class_osdblk); | ||
| 680 | class_osdblk = NULL; | ||
| 681 | } | ||
| 682 | |||
| 683 | static int __init osdblk_init(void) | ||
| 684 | { | ||
| 685 | int rc; | ||
| 686 | |||
| 687 | rc = osdblk_sysfs_init(); | ||
| 688 | if (rc) | ||
| 689 | return rc; | ||
| 690 | |||
| 691 | return 0; | ||
| 692 | } | ||
| 693 | |||
| 694 | static void __exit osdblk_exit(void) | ||
| 695 | { | ||
| 696 | osdblk_sysfs_cleanup(); | ||
| 697 | } | ||
| 698 | |||
| 699 | module_init(osdblk_init); | ||
| 700 | module_exit(osdblk_exit); | ||
| 701 | |||
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 83650e00632d..99a506f619b7 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
| @@ -1372,8 +1372,10 @@ try_next_bio: | |||
| 1372 | wakeup = (pd->write_congestion_on > 0 | 1372 | wakeup = (pd->write_congestion_on > 0 |
| 1373 | && pd->bio_queue_size <= pd->write_congestion_off); | 1373 | && pd->bio_queue_size <= pd->write_congestion_off); |
| 1374 | spin_unlock(&pd->lock); | 1374 | spin_unlock(&pd->lock); |
| 1375 | if (wakeup) | 1375 | if (wakeup) { |
| 1376 | clear_bdi_congested(&pd->disk->queue->backing_dev_info, WRITE); | 1376 | clear_bdi_congested(&pd->disk->queue->backing_dev_info, |
| 1377 | BLK_RW_ASYNC); | ||
| 1378 | } | ||
| 1377 | 1379 | ||
| 1378 | pkt->sleep_time = max(PACKET_WAIT_TIME, 1); | 1380 | pkt->sleep_time = max(PACKET_WAIT_TIME, 1); |
| 1379 | pkt_set_state(pkt, PACKET_WAITING_STATE); | 1381 | pkt_set_state(pkt, PACKET_WAITING_STATE); |
| @@ -2592,10 +2594,10 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio) | |||
| 2592 | spin_lock(&pd->lock); | 2594 | spin_lock(&pd->lock); |
| 2593 | if (pd->write_congestion_on > 0 | 2595 | if (pd->write_congestion_on > 0 |
| 2594 | && pd->bio_queue_size >= pd->write_congestion_on) { | 2596 | && pd->bio_queue_size >= pd->write_congestion_on) { |
| 2595 | set_bdi_congested(&q->backing_dev_info, WRITE); | 2597 | set_bdi_congested(&q->backing_dev_info, BLK_RW_ASYNC); |
| 2596 | do { | 2598 | do { |
| 2597 | spin_unlock(&pd->lock); | 2599 | spin_unlock(&pd->lock); |
| 2598 | congestion_wait(WRITE, HZ); | 2600 | congestion_wait(BLK_RW_ASYNC, HZ); |
| 2599 | spin_lock(&pd->lock); | 2601 | spin_lock(&pd->lock); |
| 2600 | } while(pd->bio_queue_size > pd->write_congestion_off); | 2602 | } while(pd->bio_queue_size > pd->write_congestion_off); |
| 2601 | } | 2603 | } |
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c index f08491a3a813..b20abe102a2b 100644 --- a/drivers/block/xsysace.c +++ b/drivers/block/xsysace.c | |||
| @@ -390,9 +390,10 @@ static inline void ace_dump_mem(void *base, int len) | |||
| 390 | 390 | ||
| 391 | static void ace_dump_regs(struct ace_device *ace) | 391 | static void ace_dump_regs(struct ace_device *ace) |
| 392 | { | 392 | { |
| 393 | dev_info(ace->dev, " ctrl: %.8x seccnt/cmd: %.4x ver:%.4x\n" | 393 | dev_info(ace->dev, |
| 394 | KERN_INFO " status:%.8x mpu_lba:%.8x busmode:%4x\n" | 394 | " ctrl: %.8x seccnt/cmd: %.4x ver:%.4x\n" |
| 395 | KERN_INFO " error: %.8x cfg_lba:%.8x fatstat:%.4x\n", | 395 | " status:%.8x mpu_lba:%.8x busmode:%4x\n" |
| 396 | " error: %.8x cfg_lba:%.8x fatstat:%.4x\n", | ||
| 396 | ace_in32(ace, ACE_CTRL), | 397 | ace_in32(ace, ACE_CTRL), |
| 397 | ace_in(ace, ACE_SECCNTCMD), | 398 | ace_in(ace, ACE_SECCNTCMD), |
| 398 | ace_in(ace, ACE_VERSION), | 399 | ace_in(ace, ACE_VERSION), |
diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c index 5dcbe603eca2..91b53eb1c053 100644 --- a/drivers/char/hw_random/intel-rng.c +++ b/drivers/char/hw_random/intel-rng.c | |||
| @@ -305,10 +305,11 @@ static int __init intel_init_hw_struct(struct intel_rng_hw *intel_rng_hw, | |||
| 305 | (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK)) | 305 | (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK)) |
| 306 | == BIOS_CNTL_LOCK_ENABLE_MASK) { | 306 | == BIOS_CNTL_LOCK_ENABLE_MASK) { |
| 307 | static __initdata /*const*/ char warning[] = | 307 | static __initdata /*const*/ char warning[] = |
| 308 | KERN_WARNING PFX "Firmware space is locked read-only. If you can't or\n" | 308 | KERN_WARNING |
| 309 | KERN_WARNING PFX "don't want to disable this in firmware setup, and if\n" | 309 | PFX "Firmware space is locked read-only. If you can't or\n" |
| 310 | KERN_WARNING PFX "you are certain that your system has a functional\n" | 310 | PFX "don't want to disable this in firmware setup, and if\n" |
| 311 | KERN_WARNING PFX "RNG, try using the 'no_fwh_detect' option.\n"; | 311 | PFX "you are certain that your system has a functional\n" |
| 312 | PFX "RNG, try using the 'no_fwh_detect' option.\n"; | ||
| 312 | 313 | ||
| 313 | if (no_fwh_detect) | 314 | if (no_fwh_detect) |
| 314 | return -ENODEV; | 315 | return -ENODEV; |
diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index 4159292e35cf..621d1184673c 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c | |||
| @@ -1478,10 +1478,10 @@ static int __devinit load_firmware(struct pci_dev *pdev, | |||
| 1478 | status = inw(base + 0x4); | 1478 | status = inw(base + 0x4); |
| 1479 | if (status != 0) { | 1479 | if (status != 0) { |
| 1480 | dev_warn(&pdev->dev, "Card%d rejected load header:\n" | 1480 | dev_warn(&pdev->dev, "Card%d rejected load header:\n" |
| 1481 | KERN_WARNING "Address:0x%x\n" | 1481 | "Address:0x%x\n" |
| 1482 | KERN_WARNING "Count:0x%x\n" | 1482 | "Count:0x%x\n" |
| 1483 | KERN_WARNING "Status:0x%x\n", | 1483 | "Status:0x%x\n", |
| 1484 | index + 1, frame->addr, frame->count, status); | 1484 | index + 1, frame->addr, frame->count, status); |
| 1485 | goto errrelfw; | 1485 | goto errrelfw; |
| 1486 | } | 1486 | } |
| 1487 | outsw(base, frame->data, word_count); | 1487 | outsw(base, frame->data, word_count); |
| @@ -1526,10 +1526,10 @@ static int __devinit load_firmware(struct pci_dev *pdev, | |||
| 1526 | status = inw(base + 0x4); | 1526 | status = inw(base + 0x4); |
| 1527 | if (status != 0) { | 1527 | if (status != 0) { |
| 1528 | dev_warn(&pdev->dev, "Card%d rejected verify header:\n" | 1528 | dev_warn(&pdev->dev, "Card%d rejected verify header:\n" |
| 1529 | KERN_WARNING "Address:0x%x\n" | 1529 | "Address:0x%x\n" |
| 1530 | KERN_WARNING "Count:0x%x\n" | 1530 | "Count:0x%x\n" |
| 1531 | KERN_WARNING "Status: 0x%x\n", | 1531 | "Status: 0x%x\n", |
| 1532 | index + 1, frame->addr, frame->count, status); | 1532 | index + 1, frame->addr, frame->count, status); |
| 1533 | goto errrelfw; | 1533 | goto errrelfw; |
| 1534 | } | 1534 | } |
| 1535 | 1535 | ||
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index daebe1ba43d4..9d1b4f548f67 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
| @@ -75,114 +75,88 @@ static void pty_close(struct tty_struct *tty, struct file *filp) | |||
| 75 | */ | 75 | */ |
| 76 | static void pty_unthrottle(struct tty_struct *tty) | 76 | static void pty_unthrottle(struct tty_struct *tty) |
| 77 | { | 77 | { |
| 78 | struct tty_struct *o_tty = tty->link; | 78 | tty_wakeup(tty->link); |
| 79 | |||
| 80 | if (!o_tty) | ||
| 81 | return; | ||
| 82 | |||
| 83 | tty_wakeup(o_tty); | ||
| 84 | set_bit(TTY_THROTTLED, &tty->flags); | 79 | set_bit(TTY_THROTTLED, &tty->flags); |
| 85 | } | 80 | } |
| 86 | 81 | ||
| 87 | /* | 82 | /** |
| 88 | * WSH 05/24/97: modified to | 83 | * pty_space - report space left for writing |
| 89 | * (1) use space in tty->flip instead of a shared temp buffer | 84 | * @to: tty we are writing into |
| 90 | * The flip buffers aren't being used for a pty, so there's lots | ||
| 91 | * of space available. The buffer is protected by a per-pty | ||
| 92 | * semaphore that should almost never come under contention. | ||
| 93 | * (2) avoid redundant copying for cases where count >> receive_room | ||
| 94 | * N.B. Calls from user space may now return an error code instead of | ||
| 95 | * a count. | ||
| 96 | * | 85 | * |
| 97 | * FIXME: Our pty_write method is called with our ldisc lock held but | 86 | * The tty buffers allow 64K but we sneak a peak and clip at 8K this |
| 98 | * not our partners. We can't just wait on the other one blindly without | 87 | * allows a lot of overspill room for echo and other fun messes to |
| 99 | * risking deadlocks. At some point when everything has settled down we need | 88 | * be handled properly |
| 100 | * to look into making pty_write at least able to sleep over an ldisc change. | 89 | */ |
| 90 | |||
| 91 | static int pty_space(struct tty_struct *to) | ||
| 92 | { | ||
| 93 | int n = 8192 - to->buf.memory_used; | ||
| 94 | if (n < 0) | ||
| 95 | return 0; | ||
| 96 | return n; | ||
| 97 | } | ||
| 98 | |||
| 99 | /** | ||
| 100 | * pty_write - write to a pty | ||
| 101 | * @tty: the tty we write from | ||
| 102 | * @buf: kernel buffer of data | ||
| 103 | * @count: bytes to write | ||
| 101 | * | 104 | * |
| 102 | * The return on no ldisc is a bit counter intuitive but the logic works | 105 | * Our "hardware" write method. Data is coming from the ldisc which |
| 103 | * like this. During an ldisc change the other end will flush its buffers. We | 106 | * may be in a non sleeping state. We simply throw this at the other |
| 104 | * thus return the full length which is identical to the case where we had | 107 | * end of the link as if we were an IRQ handler receiving stuff for |
| 105 | * proper locking and happened to queue the bytes just before the flush during | 108 | * the other side of the pty/tty pair. |
| 106 | * the ldisc change. | ||
| 107 | */ | 109 | */ |
| 110 | |||
| 108 | static int pty_write(struct tty_struct *tty, const unsigned char *buf, | 111 | static int pty_write(struct tty_struct *tty, const unsigned char *buf, |
| 109 | int count) | 112 | int count) |
| 110 | { | 113 | { |
| 111 | struct tty_struct *to = tty->link; | 114 | struct tty_struct *to = tty->link; |
| 112 | struct tty_ldisc *ld; | 115 | int c; |
| 113 | int c = count; | ||
| 114 | 116 | ||
| 115 | if (!to || tty->stopped) | 117 | if (tty->stopped) |
| 116 | return 0; | 118 | return 0; |
| 117 | ld = tty_ldisc_ref(to); | 119 | |
| 118 | 120 | /* This isn't locked but our 8K is quite sloppy so no | |
| 119 | if (ld) { | 121 | big deal */ |
| 120 | c = to->receive_room; | 122 | |
| 121 | if (c > count) | 123 | c = pty_space(to); |
| 122 | c = count; | 124 | if (c > count) |
| 123 | ld->ops->receive_buf(to, buf, NULL, c); | 125 | c = count; |
| 124 | tty_ldisc_deref(ld); | 126 | if (c > 0) { |
| 127 | /* Stuff the data into the input queue of the other end */ | ||
| 128 | c = tty_insert_flip_string(to, buf, c); | ||
| 129 | /* And shovel */ | ||
| 130 | tty_flip_buffer_push(to); | ||
| 131 | tty_wakeup(tty); | ||
| 125 | } | 132 | } |
| 126 | return c; | 133 | return c; |
| 127 | } | 134 | } |
| 128 | 135 | ||
| 136 | /** | ||
| 137 | * pty_write_room - write space | ||
| 138 | * @tty: tty we are writing from | ||
| 139 | * | ||
| 140 | * Report how many bytes the ldisc can send into the queue for | ||
| 141 | * the other device. | ||
| 142 | */ | ||
| 143 | |||
| 129 | static int pty_write_room(struct tty_struct *tty) | 144 | static int pty_write_room(struct tty_struct *tty) |
| 130 | { | 145 | { |
| 131 | struct tty_struct *to = tty->link; | 146 | return pty_space(tty->link); |
| 132 | |||
| 133 | if (!to || tty->stopped) | ||
| 134 | return 0; | ||
| 135 | |||
| 136 | return to->receive_room; | ||
| 137 | } | 147 | } |
| 138 | 148 | ||
| 139 | /* | 149 | /** |
| 140 | * WSH 05/24/97: Modified for asymmetric MASTER/SLAVE behavior | 150 | * pty_chars_in_buffer - characters currently in our tx queue |
| 141 | * The chars_in_buffer() value is used by the ldisc select() function | 151 | * @tty: our tty |
| 142 | * to hold off writing when chars_in_buffer > WAKEUP_CHARS (== 256). | ||
| 143 | * The pty driver chars_in_buffer() Master/Slave must behave differently: | ||
| 144 | * | ||
| 145 | * The Master side needs to allow typed-ahead commands to accumulate | ||
| 146 | * while being canonicalized, so we report "our buffer" as empty until | ||
| 147 | * some threshold is reached, and then report the count. (Any count > | ||
| 148 | * WAKEUP_CHARS is regarded by select() as "full".) To avoid deadlock | ||
| 149 | * the count returned must be 0 if no canonical data is available to be | ||
| 150 | * read. (The N_TTY ldisc.chars_in_buffer now knows this.) | ||
| 151 | * | 152 | * |
| 152 | * The Slave side passes all characters in raw mode to the Master side's | 153 | * Report how much we have in the transmit queue. As everything is |
| 153 | * buffer where they can be read immediately, so in this case we can | 154 | * instantly at the other end this is easy to implement. |
| 154 | * return the true count in the buffer. | ||
| 155 | */ | 155 | */ |
| 156 | |||
| 156 | static int pty_chars_in_buffer(struct tty_struct *tty) | 157 | static int pty_chars_in_buffer(struct tty_struct *tty) |
| 157 | { | 158 | { |
| 158 | struct tty_struct *to = tty->link; | 159 | return 0; |
| 159 | struct tty_ldisc *ld; | ||
| 160 | int count = 0; | ||
| 161 | |||
| 162 | /* We should get the line discipline lock for "tty->link" */ | ||
| 163 | if (!to) | ||
| 164 | return 0; | ||
| 165 | /* We cannot take a sleeping reference here without deadlocking with | ||
| 166 | an ldisc change - but it doesn't really matter */ | ||
| 167 | ld = tty_ldisc_ref(to); | ||
| 168 | if (ld == NULL) | ||
| 169 | return 0; | ||
| 170 | |||
| 171 | /* The ldisc must report 0 if no characters available to be read */ | ||
| 172 | if (ld->ops->chars_in_buffer) | ||
| 173 | count = ld->ops->chars_in_buffer(to); | ||
| 174 | |||
| 175 | tty_ldisc_deref(ld); | ||
| 176 | |||
| 177 | if (tty->driver->subtype == PTY_TYPE_SLAVE) | ||
| 178 | return count; | ||
| 179 | |||
| 180 | /* Master side driver ... if the other side's read buffer is less than | ||
| 181 | * half full, return 0 to allow writers to proceed; otherwise return | ||
| 182 | * the count. This leaves a comfortable margin to avoid overflow, | ||
| 183 | * and still allows half a buffer's worth of typed-ahead commands. | ||
| 184 | */ | ||
| 185 | return (count < N_TTY_BUF_SIZE/2) ? 0 : count; | ||
| 186 | } | 160 | } |
| 187 | 161 | ||
| 188 | /* Set the lock flag on a pty */ | 162 | /* Set the lock flag on a pty */ |
| @@ -202,20 +176,10 @@ static void pty_flush_buffer(struct tty_struct *tty) | |||
| 202 | { | 176 | { |
| 203 | struct tty_struct *to = tty->link; | 177 | struct tty_struct *to = tty->link; |
| 204 | unsigned long flags; | 178 | unsigned long flags; |
| 205 | struct tty_ldisc *ld; | ||
| 206 | 179 | ||
| 207 | if (!to) | 180 | if (!to) |
| 208 | return; | 181 | return; |
| 209 | ld = tty_ldisc_ref(to); | 182 | /* tty_buffer_flush(to); FIXME */ |
| 210 | |||
| 211 | /* The other end is changing discipline */ | ||
| 212 | if (!ld) | ||
| 213 | return; | ||
| 214 | |||
| 215 | if (ld->ops->flush_buffer) | ||
| 216 | to->ldisc->ops->flush_buffer(to); | ||
| 217 | tty_ldisc_deref(ld); | ||
| 218 | |||
| 219 | if (to->packet) { | 183 | if (to->packet) { |
| 220 | spin_lock_irqsave(&tty->ctrl_lock, flags); | 184 | spin_lock_irqsave(&tty->ctrl_lock, flags); |
| 221 | tty->ctrl_status |= TIOCPKT_FLUSHWRITE; | 185 | tty->ctrl_status |= TIOCPKT_FLUSHWRITE; |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6e2ec0b18948..b90eda8b3440 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
| @@ -761,6 +761,10 @@ static struct kobj_type ktype_cpufreq = { | |||
| 761 | * cpufreq_add_dev - add a CPU device | 761 | * cpufreq_add_dev - add a CPU device |
| 762 | * | 762 | * |
| 763 | * Adds the cpufreq interface for a CPU device. | 763 | * Adds the cpufreq interface for a CPU device. |
| 764 | * | ||
| 765 | * The Oracle says: try running cpufreq registration/unregistration concurrently | ||
| 766 | * with with cpu hotplugging and all hell will break loose. Tried to clean this | ||
| 767 | * mess up, but more thorough testing is needed. - Mathieu | ||
| 764 | */ | 768 | */ |
| 765 | static int cpufreq_add_dev(struct sys_device *sys_dev) | 769 | static int cpufreq_add_dev(struct sys_device *sys_dev) |
| 766 | { | 770 | { |
| @@ -772,9 +776,6 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 772 | struct sys_device *cpu_sys_dev; | 776 | struct sys_device *cpu_sys_dev; |
| 773 | unsigned long flags; | 777 | unsigned long flags; |
| 774 | unsigned int j; | 778 | unsigned int j; |
| 775 | #ifdef CONFIG_SMP | ||
| 776 | struct cpufreq_policy *managed_policy; | ||
| 777 | #endif | ||
| 778 | 779 | ||
| 779 | if (cpu_is_offline(cpu)) | 780 | if (cpu_is_offline(cpu)) |
| 780 | return 0; | 781 | return 0; |
| @@ -804,15 +805,12 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 804 | goto nomem_out; | 805 | goto nomem_out; |
| 805 | } | 806 | } |
| 806 | if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL)) { | 807 | if (!alloc_cpumask_var(&policy->cpus, GFP_KERNEL)) { |
| 807 | kfree(policy); | ||
| 808 | ret = -ENOMEM; | 808 | ret = -ENOMEM; |
| 809 | goto nomem_out; | 809 | goto err_free_policy; |
| 810 | } | 810 | } |
| 811 | if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL)) { | 811 | if (!zalloc_cpumask_var(&policy->related_cpus, GFP_KERNEL)) { |
| 812 | free_cpumask_var(policy->cpus); | ||
| 813 | kfree(policy); | ||
| 814 | ret = -ENOMEM; | 812 | ret = -ENOMEM; |
| 815 | goto nomem_out; | 813 | goto err_free_cpumask; |
| 816 | } | 814 | } |
| 817 | 815 | ||
| 818 | policy->cpu = cpu; | 816 | policy->cpu = cpu; |
| @@ -820,7 +818,8 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 820 | 818 | ||
| 821 | /* Initially set CPU itself as the policy_cpu */ | 819 | /* Initially set CPU itself as the policy_cpu */ |
| 822 | per_cpu(policy_cpu, cpu) = cpu; | 820 | per_cpu(policy_cpu, cpu) = cpu; |
| 823 | lock_policy_rwsem_write(cpu); | 821 | ret = (lock_policy_rwsem_write(cpu) < 0); |
| 822 | WARN_ON(ret); | ||
| 824 | 823 | ||
| 825 | init_completion(&policy->kobj_unregister); | 824 | init_completion(&policy->kobj_unregister); |
| 826 | INIT_WORK(&policy->update, handle_update); | 825 | INIT_WORK(&policy->update, handle_update); |
| @@ -833,7 +832,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 833 | ret = cpufreq_driver->init(policy); | 832 | ret = cpufreq_driver->init(policy); |
| 834 | if (ret) { | 833 | if (ret) { |
| 835 | dprintk("initialization failed\n"); | 834 | dprintk("initialization failed\n"); |
| 836 | goto err_out; | 835 | goto err_unlock_policy; |
| 837 | } | 836 | } |
| 838 | policy->user_policy.min = policy->min; | 837 | policy->user_policy.min = policy->min; |
| 839 | policy->user_policy.max = policy->max; | 838 | policy->user_policy.max = policy->max; |
| @@ -852,21 +851,29 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 852 | #endif | 851 | #endif |
| 853 | 852 | ||
| 854 | for_each_cpu(j, policy->cpus) { | 853 | for_each_cpu(j, policy->cpus) { |
| 854 | struct cpufreq_policy *managed_policy; | ||
| 855 | |||
| 855 | if (cpu == j) | 856 | if (cpu == j) |
| 856 | continue; | 857 | continue; |
| 857 | 858 | ||
| 858 | /* Check for existing affected CPUs. | 859 | /* Check for existing affected CPUs. |
| 859 | * They may not be aware of it due to CPU Hotplug. | 860 | * They may not be aware of it due to CPU Hotplug. |
| 860 | */ | 861 | */ |
| 861 | managed_policy = cpufreq_cpu_get(j); /* FIXME: Where is this released? What about error paths? */ | 862 | managed_policy = cpufreq_cpu_get(j); |
| 862 | if (unlikely(managed_policy)) { | 863 | if (unlikely(managed_policy)) { |
| 863 | 864 | ||
| 864 | /* Set proper policy_cpu */ | 865 | /* Set proper policy_cpu */ |
| 865 | unlock_policy_rwsem_write(cpu); | 866 | unlock_policy_rwsem_write(cpu); |
| 866 | per_cpu(policy_cpu, cpu) = managed_policy->cpu; | 867 | per_cpu(policy_cpu, cpu) = managed_policy->cpu; |
| 867 | 868 | ||
| 868 | if (lock_policy_rwsem_write(cpu) < 0) | 869 | if (lock_policy_rwsem_write(cpu) < 0) { |
| 869 | goto err_out_driver_exit; | 870 | /* Should not go through policy unlock path */ |
| 871 | if (cpufreq_driver->exit) | ||
| 872 | cpufreq_driver->exit(policy); | ||
| 873 | ret = -EBUSY; | ||
| 874 | cpufreq_cpu_put(managed_policy); | ||
| 875 | goto err_free_cpumask; | ||
| 876 | } | ||
| 870 | 877 | ||
| 871 | spin_lock_irqsave(&cpufreq_driver_lock, flags); | 878 | spin_lock_irqsave(&cpufreq_driver_lock, flags); |
| 872 | cpumask_copy(managed_policy->cpus, policy->cpus); | 879 | cpumask_copy(managed_policy->cpus, policy->cpus); |
| @@ -877,12 +884,14 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 877 | ret = sysfs_create_link(&sys_dev->kobj, | 884 | ret = sysfs_create_link(&sys_dev->kobj, |
| 878 | &managed_policy->kobj, | 885 | &managed_policy->kobj, |
| 879 | "cpufreq"); | 886 | "cpufreq"); |
| 880 | if (ret) | 887 | if (!ret) |
| 881 | goto err_out_driver_exit; | 888 | cpufreq_cpu_put(managed_policy); |
| 882 | 889 | /* | |
| 883 | cpufreq_debug_enable_ratelimit(); | 890 | * Success. We only needed to be added to the mask. |
| 884 | ret = 0; | 891 | * Call driver->exit() because only the cpu parent of |
| 885 | goto err_out_driver_exit; /* call driver->exit() */ | 892 | * the kobj needed to call init(). |
| 893 | */ | ||
| 894 | goto out_driver_exit; /* call driver->exit() */ | ||
| 886 | } | 895 | } |
| 887 | } | 896 | } |
| 888 | #endif | 897 | #endif |
| @@ -892,25 +901,25 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 892 | ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj, | 901 | ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, &sys_dev->kobj, |
| 893 | "cpufreq"); | 902 | "cpufreq"); |
| 894 | if (ret) | 903 | if (ret) |
| 895 | goto err_out_driver_exit; | 904 | goto out_driver_exit; |
| 896 | 905 | ||
| 897 | /* set up files for this cpu device */ | 906 | /* set up files for this cpu device */ |
| 898 | drv_attr = cpufreq_driver->attr; | 907 | drv_attr = cpufreq_driver->attr; |
| 899 | while ((drv_attr) && (*drv_attr)) { | 908 | while ((drv_attr) && (*drv_attr)) { |
| 900 | ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)); | 909 | ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)); |
| 901 | if (ret) | 910 | if (ret) |
| 902 | goto err_out_driver_exit; | 911 | goto err_out_kobj_put; |
| 903 | drv_attr++; | 912 | drv_attr++; |
| 904 | } | 913 | } |
| 905 | if (cpufreq_driver->get) { | 914 | if (cpufreq_driver->get) { |
| 906 | ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr); | 915 | ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr); |
| 907 | if (ret) | 916 | if (ret) |
| 908 | goto err_out_driver_exit; | 917 | goto err_out_kobj_put; |
| 909 | } | 918 | } |
| 910 | if (cpufreq_driver->target) { | 919 | if (cpufreq_driver->target) { |
| 911 | ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr); | 920 | ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr); |
| 912 | if (ret) | 921 | if (ret) |
| 913 | goto err_out_driver_exit; | 922 | goto err_out_kobj_put; |
| 914 | } | 923 | } |
| 915 | 924 | ||
| 916 | spin_lock_irqsave(&cpufreq_driver_lock, flags); | 925 | spin_lock_irqsave(&cpufreq_driver_lock, flags); |
| @@ -922,18 +931,22 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
| 922 | 931 | ||
| 923 | /* symlink affected CPUs */ | 932 | /* symlink affected CPUs */ |
| 924 | for_each_cpu(j, policy->cpus) { | 933 | for_each_cpu(j, policy->cpus) { |
| 934 | struct cpufreq_policy *managed_policy; | ||
| 935 | |||
| 925 | if (j == cpu) | 936 | if (j == cpu) |
| 926 | continue; | 937 | continue; |
| 927 | if (!cpu_online(j)) | 938 | if (!cpu_online(j)) |
| 928 | continue; | 939 | continue; |
| 929 | 940 | ||
| 930 | dprintk("CPU %u already managed, adding link\n", j); | 941 | dprintk("CPU %u already managed, adding link\n", j); |
| 931 | cpufreq_cpu_get(cpu); | 942 | managed_policy = cpufreq_cpu_get(cpu); |
| 932 | cpu_sys_dev = get_cpu_sysdev(j); | 943 | cpu_sys_dev = get_cpu_sysdev(j); |
| 933 | ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, | 944 | ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, |
| 934 | "cpufreq"); | 945 | "cpufreq"); |
| 935 | if (ret) | 946 | if (ret) { |
| 947 | cpufreq_cpu_put(managed_policy); | ||
| 936 | goto err_out_unregister; | 948 | goto err_out_unregister; |
| 949 | } | ||
| 937 | } | 950 | } |
| 938 | 951 | ||
| 939 | policy->governor = NULL; /* to assure that the starting sequence is | 952 | policy->governor = NULL; /* to assure that the starting sequence is |
| @@ -965,17 +978,20 @@ err_out_unregister: | |||
| 965 | per_cpu(cpufreq_cpu_data, j) = NULL; | 978 | per_cpu(cpufreq_cpu_data, j) = NULL; |
| 966 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 979 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
| 967 | 980 | ||
| 981 | err_out_kobj_put: | ||
| 968 | kobject_put(&policy->kobj); | 982 | kobject_put(&policy->kobj); |
| 969 | wait_for_completion(&policy->kobj_unregister); | 983 | wait_for_completion(&policy->kobj_unregister); |
| 970 | 984 | ||
| 971 | err_out_driver_exit: | 985 | out_driver_exit: |
| 972 | if (cpufreq_driver->exit) | 986 | if (cpufreq_driver->exit) |
| 973 | cpufreq_driver->exit(policy); | 987 | cpufreq_driver->exit(policy); |
| 974 | 988 | ||
| 975 | err_out: | 989 | err_unlock_policy: |
| 976 | unlock_policy_rwsem_write(cpu); | 990 | unlock_policy_rwsem_write(cpu); |
| 991 | err_free_cpumask: | ||
| 992 | free_cpumask_var(policy->cpus); | ||
| 993 | err_free_policy: | ||
| 977 | kfree(policy); | 994 | kfree(policy); |
| 978 | |||
| 979 | nomem_out: | 995 | nomem_out: |
| 980 | module_put(cpufreq_driver->owner); | 996 | module_put(cpufreq_driver->owner); |
| 981 | module_out: | 997 | module_out: |
| @@ -1070,8 +1086,6 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
| 1070 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1086 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
| 1071 | #endif | 1087 | #endif |
| 1072 | 1088 | ||
| 1073 | unlock_policy_rwsem_write(cpu); | ||
| 1074 | |||
| 1075 | if (cpufreq_driver->target) | 1089 | if (cpufreq_driver->target) |
| 1076 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); | 1090 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); |
| 1077 | 1091 | ||
| @@ -1088,6 +1102,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
| 1088 | if (cpufreq_driver->exit) | 1102 | if (cpufreq_driver->exit) |
| 1089 | cpufreq_driver->exit(data); | 1103 | cpufreq_driver->exit(data); |
| 1090 | 1104 | ||
| 1105 | unlock_policy_rwsem_write(cpu); | ||
| 1106 | |||
| 1091 | free_cpumask_var(data->related_cpus); | 1107 | free_cpumask_var(data->related_cpus); |
| 1092 | free_cpumask_var(data->cpus); | 1108 | free_cpumask_var(data->cpus); |
| 1093 | kfree(data); | 1109 | kfree(data); |
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 7fc58af748b4..57490502b21c 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
| @@ -63,22 +63,20 @@ struct cpu_dbs_info_s { | |||
| 63 | unsigned int down_skip; | 63 | unsigned int down_skip; |
| 64 | unsigned int requested_freq; | 64 | unsigned int requested_freq; |
| 65 | int cpu; | 65 | int cpu; |
| 66 | unsigned int enable:1; | 66 | /* |
| 67 | * percpu mutex that serializes governor limit change with | ||
| 68 | * do_dbs_timer invocation. We do not want do_dbs_timer to run | ||
| 69 | * when user is changing the governor or limits. | ||
| 70 | */ | ||
| 71 | struct mutex timer_mutex; | ||
| 67 | }; | 72 | }; |
| 68 | static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); | 73 | static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); |
| 69 | 74 | ||
| 70 | static unsigned int dbs_enable; /* number of CPUs using this policy */ | 75 | static unsigned int dbs_enable; /* number of CPUs using this policy */ |
| 71 | 76 | ||
| 72 | /* | 77 | /* |
| 73 | * DEADLOCK ALERT! There is a ordering requirement between cpu_hotplug | 78 | * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on |
| 74 | * lock and dbs_mutex. cpu_hotplug lock should always be held before | 79 | * different CPUs. It protects dbs_enable in governor start/stop. |
| 75 | * dbs_mutex. If any function that can potentially take cpu_hotplug lock | ||
| 76 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then | ||
| 77 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock | ||
| 78 | * is recursive for the same process. -Venki | ||
| 79 | * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it | ||
| 80 | * would deadlock with cancel_delayed_work_sync(), which is needed for proper | ||
| 81 | * raceless workqueue teardown. | ||
| 82 | */ | 80 | */ |
| 83 | static DEFINE_MUTEX(dbs_mutex); | 81 | static DEFINE_MUTEX(dbs_mutex); |
| 84 | 82 | ||
| @@ -143,9 +141,6 @@ dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | |||
| 143 | 141 | ||
| 144 | struct cpufreq_policy *policy; | 142 | struct cpufreq_policy *policy; |
| 145 | 143 | ||
| 146 | if (!this_dbs_info->enable) | ||
| 147 | return 0; | ||
| 148 | |||
| 149 | policy = this_dbs_info->cur_policy; | 144 | policy = this_dbs_info->cur_policy; |
| 150 | 145 | ||
| 151 | /* | 146 | /* |
| @@ -488,18 +483,12 @@ static void do_dbs_timer(struct work_struct *work) | |||
| 488 | 483 | ||
| 489 | delay -= jiffies % delay; | 484 | delay -= jiffies % delay; |
| 490 | 485 | ||
| 491 | if (lock_policy_rwsem_write(cpu) < 0) | 486 | mutex_lock(&dbs_info->timer_mutex); |
| 492 | return; | ||
| 493 | |||
| 494 | if (!dbs_info->enable) { | ||
| 495 | unlock_policy_rwsem_write(cpu); | ||
| 496 | return; | ||
| 497 | } | ||
| 498 | 487 | ||
| 499 | dbs_check_cpu(dbs_info); | 488 | dbs_check_cpu(dbs_info); |
| 500 | 489 | ||
| 501 | queue_delayed_work_on(cpu, kconservative_wq, &dbs_info->work, delay); | 490 | queue_delayed_work_on(cpu, kconservative_wq, &dbs_info->work, delay); |
| 502 | unlock_policy_rwsem_write(cpu); | 491 | mutex_unlock(&dbs_info->timer_mutex); |
| 503 | } | 492 | } |
| 504 | 493 | ||
| 505 | static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | 494 | static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) |
| @@ -508,7 +497,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 508 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | 497 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); |
| 509 | delay -= jiffies % delay; | 498 | delay -= jiffies % delay; |
| 510 | 499 | ||
| 511 | dbs_info->enable = 1; | ||
| 512 | INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); | 500 | INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); |
| 513 | queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work, | 501 | queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work, |
| 514 | delay); | 502 | delay); |
| @@ -516,7 +504,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 516 | 504 | ||
| 517 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) | 505 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) |
| 518 | { | 506 | { |
| 519 | dbs_info->enable = 0; | ||
| 520 | cancel_delayed_work_sync(&dbs_info->work); | 507 | cancel_delayed_work_sync(&dbs_info->work); |
| 521 | } | 508 | } |
| 522 | 509 | ||
| @@ -535,9 +522,6 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 535 | if ((!cpu_online(cpu)) || (!policy->cur)) | 522 | if ((!cpu_online(cpu)) || (!policy->cur)) |
| 536 | return -EINVAL; | 523 | return -EINVAL; |
| 537 | 524 | ||
| 538 | if (this_dbs_info->enable) /* Already enabled */ | ||
| 539 | break; | ||
| 540 | |||
| 541 | mutex_lock(&dbs_mutex); | 525 | mutex_lock(&dbs_mutex); |
| 542 | 526 | ||
| 543 | rc = sysfs_create_group(&policy->kobj, &dbs_attr_group); | 527 | rc = sysfs_create_group(&policy->kobj, &dbs_attr_group); |
| @@ -561,6 +545,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 561 | this_dbs_info->down_skip = 0; | 545 | this_dbs_info->down_skip = 0; |
| 562 | this_dbs_info->requested_freq = policy->cur; | 546 | this_dbs_info->requested_freq = policy->cur; |
| 563 | 547 | ||
| 548 | mutex_init(&this_dbs_info->timer_mutex); | ||
| 564 | dbs_enable++; | 549 | dbs_enable++; |
| 565 | /* | 550 | /* |
| 566 | * Start the timerschedule work, when this governor | 551 | * Start the timerschedule work, when this governor |
| @@ -590,17 +575,19 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 590 | &dbs_cpufreq_notifier_block, | 575 | &dbs_cpufreq_notifier_block, |
| 591 | CPUFREQ_TRANSITION_NOTIFIER); | 576 | CPUFREQ_TRANSITION_NOTIFIER); |
| 592 | } | 577 | } |
| 593 | dbs_timer_init(this_dbs_info); | ||
| 594 | |||
| 595 | mutex_unlock(&dbs_mutex); | 578 | mutex_unlock(&dbs_mutex); |
| 596 | 579 | ||
| 580 | dbs_timer_init(this_dbs_info); | ||
| 581 | |||
| 597 | break; | 582 | break; |
| 598 | 583 | ||
| 599 | case CPUFREQ_GOV_STOP: | 584 | case CPUFREQ_GOV_STOP: |
| 600 | mutex_lock(&dbs_mutex); | ||
| 601 | dbs_timer_exit(this_dbs_info); | 585 | dbs_timer_exit(this_dbs_info); |
| 586 | |||
| 587 | mutex_lock(&dbs_mutex); | ||
| 602 | sysfs_remove_group(&policy->kobj, &dbs_attr_group); | 588 | sysfs_remove_group(&policy->kobj, &dbs_attr_group); |
| 603 | dbs_enable--; | 589 | dbs_enable--; |
| 590 | mutex_destroy(&this_dbs_info->timer_mutex); | ||
| 604 | 591 | ||
| 605 | /* | 592 | /* |
| 606 | * Stop the timerschedule work, when this governor | 593 | * Stop the timerschedule work, when this governor |
| @@ -616,7 +603,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 616 | break; | 603 | break; |
| 617 | 604 | ||
| 618 | case CPUFREQ_GOV_LIMITS: | 605 | case CPUFREQ_GOV_LIMITS: |
| 619 | mutex_lock(&dbs_mutex); | 606 | mutex_lock(&this_dbs_info->timer_mutex); |
| 620 | if (policy->max < this_dbs_info->cur_policy->cur) | 607 | if (policy->max < this_dbs_info->cur_policy->cur) |
| 621 | __cpufreq_driver_target( | 608 | __cpufreq_driver_target( |
| 622 | this_dbs_info->cur_policy, | 609 | this_dbs_info->cur_policy, |
| @@ -625,7 +612,7 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 625 | __cpufreq_driver_target( | 612 | __cpufreq_driver_target( |
| 626 | this_dbs_info->cur_policy, | 613 | this_dbs_info->cur_policy, |
| 627 | policy->min, CPUFREQ_RELATION_L); | 614 | policy->min, CPUFREQ_RELATION_L); |
| 628 | mutex_unlock(&dbs_mutex); | 615 | mutex_unlock(&this_dbs_info->timer_mutex); |
| 629 | 616 | ||
| 630 | break; | 617 | break; |
| 631 | } | 618 | } |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 1911d1729353..d6ba14276bb1 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
| @@ -70,23 +70,21 @@ struct cpu_dbs_info_s { | |||
| 70 | unsigned int freq_lo_jiffies; | 70 | unsigned int freq_lo_jiffies; |
| 71 | unsigned int freq_hi_jiffies; | 71 | unsigned int freq_hi_jiffies; |
| 72 | int cpu; | 72 | int cpu; |
| 73 | unsigned int enable:1, | 73 | unsigned int sample_type:1; |
| 74 | sample_type:1; | 74 | /* |
| 75 | * percpu mutex that serializes governor limit change with | ||
| 76 | * do_dbs_timer invocation. We do not want do_dbs_timer to run | ||
| 77 | * when user is changing the governor or limits. | ||
| 78 | */ | ||
| 79 | struct mutex timer_mutex; | ||
| 75 | }; | 80 | }; |
| 76 | static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); | 81 | static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info); |
| 77 | 82 | ||
| 78 | static unsigned int dbs_enable; /* number of CPUs using this policy */ | 83 | static unsigned int dbs_enable; /* number of CPUs using this policy */ |
| 79 | 84 | ||
| 80 | /* | 85 | /* |
| 81 | * DEADLOCK ALERT! There is a ordering requirement between cpu_hotplug | 86 | * dbs_mutex protects data in dbs_tuners_ins from concurrent changes on |
| 82 | * lock and dbs_mutex. cpu_hotplug lock should always be held before | 87 | * different CPUs. It protects dbs_enable in governor start/stop. |
| 83 | * dbs_mutex. If any function that can potentially take cpu_hotplug lock | ||
| 84 | * (like __cpufreq_driver_target()) is being called with dbs_mutex taken, then | ||
| 85 | * cpu_hotplug lock should be taken before that. Note that cpu_hotplug lock | ||
| 86 | * is recursive for the same process. -Venki | ||
| 87 | * DEADLOCK ALERT! (2) : do_dbs_timer() must not take the dbs_mutex, because it | ||
| 88 | * would deadlock with cancel_delayed_work_sync(), which is needed for proper | ||
| 89 | * raceless workqueue teardown. | ||
| 90 | */ | 88 | */ |
| 91 | static DEFINE_MUTEX(dbs_mutex); | 89 | static DEFINE_MUTEX(dbs_mutex); |
| 92 | 90 | ||
| @@ -192,13 +190,18 @@ static unsigned int powersave_bias_target(struct cpufreq_policy *policy, | |||
| 192 | return freq_hi; | 190 | return freq_hi; |
| 193 | } | 191 | } |
| 194 | 192 | ||
| 193 | static void ondemand_powersave_bias_init_cpu(int cpu) | ||
| 194 | { | ||
| 195 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, cpu); | ||
| 196 | dbs_info->freq_table = cpufreq_frequency_get_table(cpu); | ||
| 197 | dbs_info->freq_lo = 0; | ||
| 198 | } | ||
| 199 | |||
| 195 | static void ondemand_powersave_bias_init(void) | 200 | static void ondemand_powersave_bias_init(void) |
| 196 | { | 201 | { |
| 197 | int i; | 202 | int i; |
| 198 | for_each_online_cpu(i) { | 203 | for_each_online_cpu(i) { |
| 199 | struct cpu_dbs_info_s *dbs_info = &per_cpu(cpu_dbs_info, i); | 204 | ondemand_powersave_bias_init_cpu(i); |
| 200 | dbs_info->freq_table = cpufreq_frequency_get_table(i); | ||
| 201 | dbs_info->freq_lo = 0; | ||
| 202 | } | 205 | } |
| 203 | } | 206 | } |
| 204 | 207 | ||
| @@ -240,12 +243,10 @@ static ssize_t store_sampling_rate(struct cpufreq_policy *unused, | |||
| 240 | unsigned int input; | 243 | unsigned int input; |
| 241 | int ret; | 244 | int ret; |
| 242 | ret = sscanf(buf, "%u", &input); | 245 | ret = sscanf(buf, "%u", &input); |
| 246 | if (ret != 1) | ||
| 247 | return -EINVAL; | ||
| 243 | 248 | ||
| 244 | mutex_lock(&dbs_mutex); | 249 | mutex_lock(&dbs_mutex); |
| 245 | if (ret != 1) { | ||
| 246 | mutex_unlock(&dbs_mutex); | ||
| 247 | return -EINVAL; | ||
| 248 | } | ||
| 249 | dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); | 250 | dbs_tuners_ins.sampling_rate = max(input, min_sampling_rate); |
| 250 | mutex_unlock(&dbs_mutex); | 251 | mutex_unlock(&dbs_mutex); |
| 251 | 252 | ||
| @@ -259,13 +260,12 @@ static ssize_t store_up_threshold(struct cpufreq_policy *unused, | |||
| 259 | int ret; | 260 | int ret; |
| 260 | ret = sscanf(buf, "%u", &input); | 261 | ret = sscanf(buf, "%u", &input); |
| 261 | 262 | ||
| 262 | mutex_lock(&dbs_mutex); | ||
| 263 | if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || | 263 | if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || |
| 264 | input < MIN_FREQUENCY_UP_THRESHOLD) { | 264 | input < MIN_FREQUENCY_UP_THRESHOLD) { |
| 265 | mutex_unlock(&dbs_mutex); | ||
| 266 | return -EINVAL; | 265 | return -EINVAL; |
| 267 | } | 266 | } |
| 268 | 267 | ||
| 268 | mutex_lock(&dbs_mutex); | ||
| 269 | dbs_tuners_ins.up_threshold = input; | 269 | dbs_tuners_ins.up_threshold = input; |
| 270 | mutex_unlock(&dbs_mutex); | 270 | mutex_unlock(&dbs_mutex); |
| 271 | 271 | ||
| @@ -363,9 +363,6 @@ static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) | |||
| 363 | struct cpufreq_policy *policy; | 363 | struct cpufreq_policy *policy; |
| 364 | unsigned int j; | 364 | unsigned int j; |
| 365 | 365 | ||
| 366 | if (!this_dbs_info->enable) | ||
| 367 | return; | ||
| 368 | |||
| 369 | this_dbs_info->freq_lo = 0; | 366 | this_dbs_info->freq_lo = 0; |
| 370 | policy = this_dbs_info->cur_policy; | 367 | policy = this_dbs_info->cur_policy; |
| 371 | 368 | ||
| @@ -493,14 +490,7 @@ static void do_dbs_timer(struct work_struct *work) | |||
| 493 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | 490 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); |
| 494 | 491 | ||
| 495 | delay -= jiffies % delay; | 492 | delay -= jiffies % delay; |
| 496 | 493 | mutex_lock(&dbs_info->timer_mutex); | |
| 497 | if (lock_policy_rwsem_write(cpu) < 0) | ||
| 498 | return; | ||
| 499 | |||
| 500 | if (!dbs_info->enable) { | ||
| 501 | unlock_policy_rwsem_write(cpu); | ||
| 502 | return; | ||
| 503 | } | ||
| 504 | 494 | ||
| 505 | /* Common NORMAL_SAMPLE setup */ | 495 | /* Common NORMAL_SAMPLE setup */ |
| 506 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; | 496 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; |
| @@ -517,7 +507,7 @@ static void do_dbs_timer(struct work_struct *work) | |||
| 517 | dbs_info->freq_lo, CPUFREQ_RELATION_H); | 507 | dbs_info->freq_lo, CPUFREQ_RELATION_H); |
| 518 | } | 508 | } |
| 519 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); | 509 | queue_delayed_work_on(cpu, kondemand_wq, &dbs_info->work, delay); |
| 520 | unlock_policy_rwsem_write(cpu); | 510 | mutex_unlock(&dbs_info->timer_mutex); |
| 521 | } | 511 | } |
| 522 | 512 | ||
| 523 | static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | 513 | static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) |
| @@ -526,8 +516,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 526 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); | 516 | int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); |
| 527 | delay -= jiffies % delay; | 517 | delay -= jiffies % delay; |
| 528 | 518 | ||
| 529 | dbs_info->enable = 1; | ||
| 530 | ondemand_powersave_bias_init(); | ||
| 531 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; | 519 | dbs_info->sample_type = DBS_NORMAL_SAMPLE; |
| 532 | INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); | 520 | INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); |
| 533 | queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work, | 521 | queue_delayed_work_on(dbs_info->cpu, kondemand_wq, &dbs_info->work, |
| @@ -536,7 +524,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) | |||
| 536 | 524 | ||
| 537 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) | 525 | static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) |
| 538 | { | 526 | { |
| 539 | dbs_info->enable = 0; | ||
| 540 | cancel_delayed_work_sync(&dbs_info->work); | 527 | cancel_delayed_work_sync(&dbs_info->work); |
| 541 | } | 528 | } |
| 542 | 529 | ||
| @@ -555,19 +542,15 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 555 | if ((!cpu_online(cpu)) || (!policy->cur)) | 542 | if ((!cpu_online(cpu)) || (!policy->cur)) |
| 556 | return -EINVAL; | 543 | return -EINVAL; |
| 557 | 544 | ||
| 558 | if (this_dbs_info->enable) /* Already enabled */ | ||
| 559 | break; | ||
| 560 | |||
| 561 | mutex_lock(&dbs_mutex); | 545 | mutex_lock(&dbs_mutex); |
| 562 | dbs_enable++; | ||
| 563 | 546 | ||
| 564 | rc = sysfs_create_group(&policy->kobj, &dbs_attr_group); | 547 | rc = sysfs_create_group(&policy->kobj, &dbs_attr_group); |
| 565 | if (rc) { | 548 | if (rc) { |
| 566 | dbs_enable--; | ||
| 567 | mutex_unlock(&dbs_mutex); | 549 | mutex_unlock(&dbs_mutex); |
| 568 | return rc; | 550 | return rc; |
| 569 | } | 551 | } |
| 570 | 552 | ||
| 553 | dbs_enable++; | ||
| 571 | for_each_cpu(j, policy->cpus) { | 554 | for_each_cpu(j, policy->cpus) { |
| 572 | struct cpu_dbs_info_s *j_dbs_info; | 555 | struct cpu_dbs_info_s *j_dbs_info; |
| 573 | j_dbs_info = &per_cpu(cpu_dbs_info, j); | 556 | j_dbs_info = &per_cpu(cpu_dbs_info, j); |
| @@ -581,6 +564,8 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 581 | } | 564 | } |
| 582 | } | 565 | } |
| 583 | this_dbs_info->cpu = cpu; | 566 | this_dbs_info->cpu = cpu; |
| 567 | ondemand_powersave_bias_init_cpu(cpu); | ||
| 568 | mutex_init(&this_dbs_info->timer_mutex); | ||
| 584 | /* | 569 | /* |
| 585 | * Start the timerschedule work, when this governor | 570 | * Start the timerschedule work, when this governor |
| 586 | * is used for first time | 571 | * is used for first time |
| @@ -598,29 +583,31 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | |||
| 598 | max(min_sampling_rate, | 583 | max(min_sampling_rate, |
| 599 | latency * LATENCY_MULTIPLIER); | 584 | latency * LATENCY_MULTIPLIER); |
| 600 | } | 585 | } |
| 601 | dbs_timer_init(this_dbs_info); | ||
| 602 | |||
| 603 | mutex_unlock(&dbs_mutex); | 586 | mutex_unlock(&dbs_mutex); |
| 587 | |||
| 588 | dbs_timer_init(this_dbs_info); | ||
| 604 | break; | 589 | break; |
| 605 | 590 | ||
| 606 | case CPUFREQ_GOV_STOP: | 591 | case CPUFREQ_GOV_STOP: |
| 607 | mutex_lock(&dbs_mutex); | ||
| 608 | dbs_timer_exit(this_dbs_info); | 592 | dbs_timer_exit(this_dbs_info); |
| 593 | |||
| 594 | mutex_lock(&dbs_mutex); | ||
| 609 | sysfs_remove_group(&policy->kobj, &dbs_attr_group); | 595 | sysfs_remove_group(&policy->kobj, &dbs_attr_group); |
| 596 | mutex_destroy(&this_dbs_info->timer_mutex); | ||
| 610 | dbs_enable--; | 597 | dbs_enable--; |
| 611 | mutex_unlock(&dbs_mutex); | 598 | mutex_unlock(&dbs_mutex); |
| 612 | 599 | ||
| 613 | break; | 600 | break; |
| 614 | 601 | ||
| 615 | case CPUFREQ_GOV_LIMITS: | 602 | case CPUFREQ_GOV_LIMITS: |
| 616 | mutex_lock(&dbs_mutex); | 603 | mutex_lock(&this_dbs_info->timer_mutex); |
| 617 | if (policy->max < this_dbs_info->cur_policy->cur) | 604 | if (policy->max < this_dbs_info->cur_policy->cur) |
| 618 | __cpufreq_driver_target(this_dbs_info->cur_policy, | 605 | __cpufreq_driver_target(this_dbs_info->cur_policy, |
| 619 | policy->max, CPUFREQ_RELATION_H); | 606 | policy->max, CPUFREQ_RELATION_H); |
| 620 | else if (policy->min > this_dbs_info->cur_policy->cur) | 607 | else if (policy->min > this_dbs_info->cur_policy->cur) |
| 621 | __cpufreq_driver_target(this_dbs_info->cur_policy, | 608 | __cpufreq_driver_target(this_dbs_info->cur_policy, |
| 622 | policy->min, CPUFREQ_RELATION_L); | 609 | policy->min, CPUFREQ_RELATION_L); |
| 623 | mutex_unlock(&dbs_mutex); | 610 | mutex_unlock(&this_dbs_info->timer_mutex); |
| 624 | break; | 611 | break; |
| 625 | } | 612 | } |
| 626 | return 0; | 613 | return 0; |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index a6f73f1e99d9..3da9cfa31848 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -1090,6 +1090,8 @@ int drm_helper_resume_force_mode(struct drm_device *dev) | |||
| 1090 | if (ret == false) | 1090 | if (ret == false) |
| 1091 | DRM_ERROR("failed to set mode on crtc %p\n", crtc); | 1091 | DRM_ERROR("failed to set mode on crtc %p\n", crtc); |
| 1092 | } | 1092 | } |
| 1093 | /* disable the unused connectors while restoring the modesetting */ | ||
| 1094 | drm_helper_disable_unused_functions(dev); | ||
| 1093 | return 0; | 1095 | return 0; |
| 1094 | } | 1096 | } |
| 1095 | EXPORT_SYMBOL(drm_helper_resume_force_mode); | 1097 | EXPORT_SYMBOL(drm_helper_resume_force_mode); |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index f112c769d533..8c4783180bf6 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -846,7 +846,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data, | |||
| 846 | return 0; | 846 | return 0; |
| 847 | } | 847 | } |
| 848 | 848 | ||
| 849 | printk(KERN_DEBUG "set status page addr 0x%08x\n", (u32)hws->addr); | 849 | DRM_DEBUG("set status page addr 0x%08x\n", (u32)hws->addr); |
| 850 | 850 | ||
| 851 | dev_priv->status_gfx_addr = hws->addr & (0x1ffff<<12); | 851 | dev_priv->status_gfx_addr = hws->addr & (0x1ffff<<12); |
| 852 | 852 | ||
| @@ -885,8 +885,8 @@ static int i915_set_status_page(struct drm_device *dev, void *data, | |||
| 885 | * some RAM for the framebuffer at early boot. This code figures out | 885 | * some RAM for the framebuffer at early boot. This code figures out |
| 886 | * how much was set aside so we can use it for our own purposes. | 886 | * how much was set aside so we can use it for our own purposes. |
| 887 | */ | 887 | */ |
| 888 | static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size, | 888 | static int i915_probe_agp(struct drm_device *dev, uint32_t *aperture_size, |
| 889 | unsigned long *preallocated_size) | 889 | uint32_t *preallocated_size) |
| 890 | { | 890 | { |
| 891 | struct pci_dev *bridge_dev; | 891 | struct pci_dev *bridge_dev; |
| 892 | u16 tmp = 0; | 892 | u16 tmp = 0; |
| @@ -984,10 +984,11 @@ static int i915_probe_agp(struct drm_device *dev, unsigned long *aperture_size, | |||
| 984 | return 0; | 984 | return 0; |
| 985 | } | 985 | } |
| 986 | 986 | ||
| 987 | static int i915_load_modeset_init(struct drm_device *dev) | 987 | static int i915_load_modeset_init(struct drm_device *dev, |
| 988 | unsigned long prealloc_size, | ||
| 989 | unsigned long agp_size) | ||
| 988 | { | 990 | { |
| 989 | struct drm_i915_private *dev_priv = dev->dev_private; | 991 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 990 | unsigned long agp_size, prealloc_size; | ||
| 991 | int fb_bar = IS_I9XX(dev) ? 2 : 0; | 992 | int fb_bar = IS_I9XX(dev) ? 2 : 0; |
| 992 | int ret = 0; | 993 | int ret = 0; |
| 993 | 994 | ||
| @@ -1002,10 +1003,6 @@ static int i915_load_modeset_init(struct drm_device *dev) | |||
| 1002 | if (IS_I965G(dev) || IS_G33(dev)) | 1003 | if (IS_I965G(dev) || IS_G33(dev)) |
| 1003 | dev_priv->cursor_needs_physical = false; | 1004 | dev_priv->cursor_needs_physical = false; |
| 1004 | 1005 | ||
| 1005 | ret = i915_probe_agp(dev, &agp_size, &prealloc_size); | ||
| 1006 | if (ret) | ||
| 1007 | goto out; | ||
| 1008 | |||
| 1009 | /* Basic memrange allocator for stolen space (aka vram) */ | 1006 | /* Basic memrange allocator for stolen space (aka vram) */ |
| 1010 | drm_mm_init(&dev_priv->vram, 0, prealloc_size); | 1007 | drm_mm_init(&dev_priv->vram, 0, prealloc_size); |
| 1011 | 1008 | ||
| @@ -1082,6 +1079,44 @@ void i915_master_destroy(struct drm_device *dev, struct drm_master *master) | |||
| 1082 | master->driver_priv = NULL; | 1079 | master->driver_priv = NULL; |
| 1083 | } | 1080 | } |
| 1084 | 1081 | ||
| 1082 | static void i915_get_mem_freq(struct drm_device *dev) | ||
| 1083 | { | ||
| 1084 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
| 1085 | u32 tmp; | ||
| 1086 | |||
| 1087 | if (!IS_IGD(dev)) | ||
| 1088 | return; | ||
| 1089 | |||
| 1090 | tmp = I915_READ(CLKCFG); | ||
| 1091 | |||
| 1092 | switch (tmp & CLKCFG_FSB_MASK) { | ||
| 1093 | case CLKCFG_FSB_533: | ||
| 1094 | dev_priv->fsb_freq = 533; /* 133*4 */ | ||
| 1095 | break; | ||
| 1096 | case CLKCFG_FSB_800: | ||
| 1097 | dev_priv->fsb_freq = 800; /* 200*4 */ | ||
| 1098 | break; | ||
| 1099 | case CLKCFG_FSB_667: | ||
| 1100 | dev_priv->fsb_freq = 667; /* 167*4 */ | ||
| 1101 | break; | ||
| 1102 | case CLKCFG_FSB_400: | ||
| 1103 | dev_priv->fsb_freq = 400; /* 100*4 */ | ||
| 1104 | break; | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | switch (tmp & CLKCFG_MEM_MASK) { | ||
| 1108 | case CLKCFG_MEM_533: | ||
| 1109 | dev_priv->mem_freq = 533; | ||
| 1110 | break; | ||
| 1111 | case CLKCFG_MEM_667: | ||
| 1112 | dev_priv->mem_freq = 667; | ||
| 1113 | break; | ||
| 1114 | case CLKCFG_MEM_800: | ||
| 1115 | dev_priv->mem_freq = 800; | ||
| 1116 | break; | ||
| 1117 | } | ||
| 1118 | } | ||
| 1119 | |||
| 1085 | /** | 1120 | /** |
| 1086 | * i915_driver_load - setup chip and create an initial config | 1121 | * i915_driver_load - setup chip and create an initial config |
| 1087 | * @dev: DRM device | 1122 | * @dev: DRM device |
| @@ -1098,6 +1133,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 1098 | struct drm_i915_private *dev_priv = dev->dev_private; | 1133 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1099 | resource_size_t base, size; | 1134 | resource_size_t base, size; |
| 1100 | int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1; | 1135 | int ret = 0, mmio_bar = IS_I9XX(dev) ? 0 : 1; |
| 1136 | uint32_t agp_size, prealloc_size; | ||
| 1101 | 1137 | ||
| 1102 | /* i915 has 4 more counters */ | 1138 | /* i915 has 4 more counters */ |
| 1103 | dev->counters += 4; | 1139 | dev->counters += 4; |
| @@ -1146,9 +1182,22 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 1146 | "performance may suffer.\n"); | 1182 | "performance may suffer.\n"); |
| 1147 | } | 1183 | } |
| 1148 | 1184 | ||
| 1185 | ret = i915_probe_agp(dev, &agp_size, &prealloc_size); | ||
| 1186 | if (ret) | ||
| 1187 | goto out_iomapfree; | ||
| 1188 | |||
| 1149 | /* enable GEM by default */ | 1189 | /* enable GEM by default */ |
| 1150 | dev_priv->has_gem = 1; | 1190 | dev_priv->has_gem = 1; |
| 1151 | 1191 | ||
| 1192 | if (prealloc_size > agp_size * 3 / 4) { | ||
| 1193 | DRM_ERROR("Detected broken video BIOS with %d/%dkB of video " | ||
| 1194 | "memory stolen.\n", | ||
| 1195 | prealloc_size / 1024, agp_size / 1024); | ||
| 1196 | DRM_ERROR("Disabling GEM. (try reducing stolen memory or " | ||
| 1197 | "updating the BIOS to fix).\n"); | ||
| 1198 | dev_priv->has_gem = 0; | ||
| 1199 | } | ||
| 1200 | |||
| 1152 | dev->driver->get_vblank_counter = i915_get_vblank_counter; | 1201 | dev->driver->get_vblank_counter = i915_get_vblank_counter; |
| 1153 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ | 1202 | dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ |
| 1154 | if (IS_G4X(dev) || IS_IGDNG(dev)) { | 1203 | if (IS_G4X(dev) || IS_IGDNG(dev)) { |
| @@ -1165,6 +1214,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 1165 | goto out_iomapfree; | 1214 | goto out_iomapfree; |
| 1166 | } | 1215 | } |
| 1167 | 1216 | ||
| 1217 | i915_get_mem_freq(dev); | ||
| 1218 | |||
| 1168 | /* On the 945G/GM, the chipset reports the MSI capability on the | 1219 | /* On the 945G/GM, the chipset reports the MSI capability on the |
| 1169 | * integrated graphics even though the support isn't actually there | 1220 | * integrated graphics even though the support isn't actually there |
| 1170 | * according to the published specs. It doesn't appear to function | 1221 | * according to the published specs. It doesn't appear to function |
| @@ -1180,6 +1231,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 1180 | pci_enable_msi(dev->pdev); | 1231 | pci_enable_msi(dev->pdev); |
| 1181 | 1232 | ||
| 1182 | spin_lock_init(&dev_priv->user_irq_lock); | 1233 | spin_lock_init(&dev_priv->user_irq_lock); |
| 1234 | spin_lock_init(&dev_priv->error_lock); | ||
| 1183 | dev_priv->user_irq_refcount = 0; | 1235 | dev_priv->user_irq_refcount = 0; |
| 1184 | 1236 | ||
| 1185 | ret = drm_vblank_init(dev, I915_NUM_PIPE); | 1237 | ret = drm_vblank_init(dev, I915_NUM_PIPE); |
| @@ -1190,7 +1242,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 1190 | } | 1242 | } |
| 1191 | 1243 | ||
| 1192 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | 1244 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { |
| 1193 | ret = i915_load_modeset_init(dev); | 1245 | ret = i915_load_modeset_init(dev, prealloc_size, agp_size); |
| 1194 | if (ret < 0) { | 1246 | if (ret < 0) { |
| 1195 | DRM_ERROR("failed to init modeset\n"); | 1247 | DRM_ERROR("failed to init modeset\n"); |
| 1196 | goto out_rmmap; | 1248 | goto out_rmmap; |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index e3cb4025e323..fc4b68aa2d05 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | 35 | ||
| 36 | #include "drm_pciids.h" | 36 | #include "drm_pciids.h" |
| 37 | #include <linux/console.h> | 37 | #include <linux/console.h> |
| 38 | #include "drm_crtc_helper.h" | ||
| 38 | 39 | ||
| 39 | static unsigned int i915_modeset = -1; | 40 | static unsigned int i915_modeset = -1; |
| 40 | module_param_named(modeset, i915_modeset, int, 0400); | 41 | module_param_named(modeset, i915_modeset, int, 0400); |
| @@ -57,8 +58,8 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state) | |||
| 57 | struct drm_i915_private *dev_priv = dev->dev_private; | 58 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 58 | 59 | ||
| 59 | if (!dev || !dev_priv) { | 60 | if (!dev || !dev_priv) { |
| 60 | printk(KERN_ERR "dev: %p, dev_priv: %p\n", dev, dev_priv); | 61 | DRM_ERROR("dev: %p, dev_priv: %p\n", dev, dev_priv); |
| 61 | printk(KERN_ERR "DRM not initialized, aborting suspend.\n"); | 62 | DRM_ERROR("DRM not initialized, aborting suspend.\n"); |
| 62 | return -ENODEV; | 63 | return -ENODEV; |
| 63 | } | 64 | } |
| 64 | 65 | ||
| @@ -115,6 +116,10 @@ static int i915_resume(struct drm_device *dev) | |||
| 115 | 116 | ||
| 116 | drm_irq_install(dev); | 117 | drm_irq_install(dev); |
| 117 | } | 118 | } |
| 119 | if (drm_core_check_feature(dev, DRIVER_MODESET)) { | ||
| 120 | /* Resume the modeset for every activated CRTC */ | ||
| 121 | drm_helper_resume_force_mode(dev); | ||
| 122 | } | ||
| 118 | 123 | ||
| 119 | return ret; | 124 | return ret; |
| 120 | } | 125 | } |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index bb4c2d387b6c..d08752875885 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -133,6 +133,22 @@ struct sdvo_device_mapping { | |||
| 133 | u8 initialized; | 133 | u8 initialized; |
| 134 | }; | 134 | }; |
| 135 | 135 | ||
| 136 | struct drm_i915_error_state { | ||
| 137 | u32 eir; | ||
| 138 | u32 pgtbl_er; | ||
| 139 | u32 pipeastat; | ||
| 140 | u32 pipebstat; | ||
| 141 | u32 ipeir; | ||
| 142 | u32 ipehr; | ||
| 143 | u32 instdone; | ||
| 144 | u32 acthd; | ||
| 145 | u32 instpm; | ||
| 146 | u32 instps; | ||
| 147 | u32 instdone1; | ||
| 148 | u32 seqno; | ||
| 149 | struct timeval time; | ||
| 150 | }; | ||
| 151 | |||
| 136 | typedef struct drm_i915_private { | 152 | typedef struct drm_i915_private { |
| 137 | struct drm_device *dev; | 153 | struct drm_device *dev; |
| 138 | 154 | ||
| @@ -209,6 +225,11 @@ typedef struct drm_i915_private { | |||
| 209 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ | 225 | int fence_reg_start; /* 4 if userland hasn't ioctl'd us yet */ |
| 210 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ | 226 | int num_fence_regs; /* 8 on pre-965, 16 otherwise */ |
| 211 | 227 | ||
| 228 | unsigned int fsb_freq, mem_freq; | ||
| 229 | |||
| 230 | spinlock_t error_lock; | ||
| 231 | struct drm_i915_error_state *first_error; | ||
| 232 | |||
| 212 | /* Register state */ | 233 | /* Register state */ |
| 213 | u8 saveLBB; | 234 | u8 saveLBB; |
| 214 | u32 saveDSPACNTR; | 235 | u32 saveDSPACNTR; |
| @@ -468,9 +489,6 @@ struct drm_i915_gem_object { | |||
| 468 | */ | 489 | */ |
| 469 | int fence_reg; | 490 | int fence_reg; |
| 470 | 491 | ||
| 471 | /** Boolean whether this object has a valid gtt offset. */ | ||
| 472 | int gtt_bound; | ||
| 473 | |||
| 474 | /** How many users have pinned this object in GTT space */ | 492 | /** How many users have pinned this object in GTT space */ |
| 475 | int pin_count; | 493 | int pin_count; |
| 476 | 494 | ||
| @@ -655,6 +673,7 @@ void i915_gem_free_object(struct drm_gem_object *obj); | |||
| 655 | int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment); | 673 | int i915_gem_object_pin(struct drm_gem_object *obj, uint32_t alignment); |
| 656 | void i915_gem_object_unpin(struct drm_gem_object *obj); | 674 | void i915_gem_object_unpin(struct drm_gem_object *obj); |
| 657 | int i915_gem_object_unbind(struct drm_gem_object *obj); | 675 | int i915_gem_object_unbind(struct drm_gem_object *obj); |
| 676 | void i915_gem_release_mmap(struct drm_gem_object *obj); | ||
| 658 | void i915_gem_lastclose(struct drm_device *dev); | 677 | void i915_gem_lastclose(struct drm_device *dev); |
| 659 | uint32_t i915_get_gem_seqno(struct drm_device *dev); | 678 | uint32_t i915_get_gem_seqno(struct drm_device *dev); |
| 660 | int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); | 679 | int i915_gem_object_get_fence_reg(struct drm_gem_object *obj); |
| @@ -870,6 +889,8 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
| 870 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | 889 | #define SUPPORTS_INTEGRATED_HDMI(dev) (IS_G4X(dev) || IS_IGDNG(dev)) |
| 871 | #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | 890 | #define SUPPORTS_INTEGRATED_DP(dev) (IS_G4X(dev) || IS_IGDNG(dev)) |
| 872 | #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev)) | 891 | #define I915_HAS_HOTPLUG(dev) (IS_I945G(dev) || IS_I945GM(dev) || IS_I965G(dev)) |
| 892 | /* dsparb controlled by hw only */ | ||
| 893 | #define DSPARB_HWCONTROL(dev) (IS_G4X(dev) || IS_IGDNG(dev)) | ||
| 873 | 894 | ||
| 874 | #define PRIMARY_RINGBUFFER_SIZE (128*1024) | 895 | #define PRIMARY_RINGBUFFER_SIZE (128*1024) |
| 875 | 896 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 876b65cb7629..5bf420378b6d 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -1252,6 +1252,31 @@ out_free_list: | |||
| 1252 | return ret; | 1252 | return ret; |
| 1253 | } | 1253 | } |
| 1254 | 1254 | ||
| 1255 | /** | ||
| 1256 | * i915_gem_release_mmap - remove physical page mappings | ||
| 1257 | * @obj: obj in question | ||
| 1258 | * | ||
| 1259 | * Preserve the reservation of the mmaping with the DRM core code, but | ||
| 1260 | * relinquish ownership of the pages back to the system. | ||
| 1261 | * | ||
| 1262 | * It is vital that we remove the page mapping if we have mapped a tiled | ||
| 1263 | * object through the GTT and then lose the fence register due to | ||
| 1264 | * resource pressure. Similarly if the object has been moved out of the | ||
| 1265 | * aperture, than pages mapped into userspace must be revoked. Removing the | ||
| 1266 | * mapping will then trigger a page fault on the next user access, allowing | ||
| 1267 | * fixup by i915_gem_fault(). | ||
| 1268 | */ | ||
| 1269 | void | ||
| 1270 | i915_gem_release_mmap(struct drm_gem_object *obj) | ||
| 1271 | { | ||
| 1272 | struct drm_device *dev = obj->dev; | ||
| 1273 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | ||
| 1274 | |||
| 1275 | if (dev->dev_mapping) | ||
| 1276 | unmap_mapping_range(dev->dev_mapping, | ||
| 1277 | obj_priv->mmap_offset, obj->size, 1); | ||
| 1278 | } | ||
| 1279 | |||
| 1255 | static void | 1280 | static void |
| 1256 | i915_gem_free_mmap_offset(struct drm_gem_object *obj) | 1281 | i915_gem_free_mmap_offset(struct drm_gem_object *obj) |
| 1257 | { | 1282 | { |
| @@ -1861,7 +1886,6 @@ i915_gem_object_unbind(struct drm_gem_object *obj) | |||
| 1861 | { | 1886 | { |
| 1862 | struct drm_device *dev = obj->dev; | 1887 | struct drm_device *dev = obj->dev; |
| 1863 | struct drm_i915_gem_object *obj_priv = obj->driver_private; | 1888 | struct drm_i915_gem_object *obj_priv = obj->driver_private; |
| 1864 | loff_t offset; | ||
| 1865 | int ret = 0; | 1889 | int ret = 0; |
| 1866 | 1890 | ||
| 1867 | #if WATCH_BUF | 1891 | #if WATCH_BUF |
| @@ -1898,9 +1922,7 @@ i915_gem_object_unbind(struct drm_gem_object *obj) | |||
| 1898 | BUG_ON(obj_priv->active); | 1922 | BUG_ON(obj_priv->active); |
| 1899 | 1923 | ||
| 1900 | /* blow away mappings if mapped through GTT */ | 1924 | /* blow away mappings if mapped through GTT */ |
| 1901 | offset = ((loff_t) obj->map_list.hash.key) << PAGE_SHIFT; | 1925 | i915_gem_release_mmap(obj); |
| 1902 | if (dev->dev_mapping) | ||
| 1903 | unmap_mapping_range(dev->dev_mapping, offset, obj->size, 1); | ||
| 1904 | 1926 | ||
| 1905 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) | 1927 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) |
| 1906 | i915_gem_clear_fence_reg(obj); | 1928 | i915_gem_clear_fence_reg(obj); |
| @@ -2222,7 +2244,6 @@ try_again: | |||
| 2222 | /* None available, try to steal one or wait for a user to finish */ | 2244 | /* None available, try to steal one or wait for a user to finish */ |
| 2223 | if (i == dev_priv->num_fence_regs) { | 2245 | if (i == dev_priv->num_fence_regs) { |
| 2224 | uint32_t seqno = dev_priv->mm.next_gem_seqno; | 2246 | uint32_t seqno = dev_priv->mm.next_gem_seqno; |
| 2225 | loff_t offset; | ||
| 2226 | 2247 | ||
| 2227 | if (avail == 0) | 2248 | if (avail == 0) |
| 2228 | return -ENOSPC; | 2249 | return -ENOSPC; |
| @@ -2274,10 +2295,7 @@ try_again: | |||
| 2274 | * Zap this virtual mapping so we can set up a fence again | 2295 | * Zap this virtual mapping so we can set up a fence again |
| 2275 | * for this object next time we need it. | 2296 | * for this object next time we need it. |
| 2276 | */ | 2297 | */ |
| 2277 | offset = ((loff_t) reg->obj->map_list.hash.key) << PAGE_SHIFT; | 2298 | i915_gem_release_mmap(reg->obj); |
| 2278 | if (dev->dev_mapping) | ||
| 2279 | unmap_mapping_range(dev->dev_mapping, offset, | ||
| 2280 | reg->obj->size, 1); | ||
| 2281 | old_obj_priv->fence_reg = I915_FENCE_REG_NONE; | 2299 | old_obj_priv->fence_reg = I915_FENCE_REG_NONE; |
| 2282 | } | 2300 | } |
| 2283 | 2301 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_debugfs.c b/drivers/gpu/drm/i915/i915_gem_debugfs.c index 28146e405e87..9a44bfcb8139 100644 --- a/drivers/gpu/drm/i915/i915_gem_debugfs.c +++ b/drivers/gpu/drm/i915/i915_gem_debugfs.c | |||
| @@ -75,11 +75,10 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
| 75 | case ACTIVE_LIST: | 75 | case ACTIVE_LIST: |
| 76 | seq_printf(m, "Active:\n"); | 76 | seq_printf(m, "Active:\n"); |
| 77 | lock = &dev_priv->mm.active_list_lock; | 77 | lock = &dev_priv->mm.active_list_lock; |
| 78 | spin_lock(lock); | ||
| 79 | head = &dev_priv->mm.active_list; | 78 | head = &dev_priv->mm.active_list; |
| 80 | break; | 79 | break; |
| 81 | case INACTIVE_LIST: | 80 | case INACTIVE_LIST: |
| 82 | seq_printf(m, "Inctive:\n"); | 81 | seq_printf(m, "Inactive:\n"); |
| 83 | head = &dev_priv->mm.inactive_list; | 82 | head = &dev_priv->mm.inactive_list; |
| 84 | break; | 83 | break; |
| 85 | case FLUSHING_LIST: | 84 | case FLUSHING_LIST: |
| @@ -91,6 +90,8 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
| 91 | return 0; | 90 | return 0; |
| 92 | } | 91 | } |
| 93 | 92 | ||
| 93 | if (lock) | ||
| 94 | spin_lock(lock); | ||
| 94 | list_for_each_entry(obj_priv, head, list) | 95 | list_for_each_entry(obj_priv, head, list) |
| 95 | { | 96 | { |
| 96 | struct drm_gem_object *obj = obj_priv->obj; | 97 | struct drm_gem_object *obj = obj_priv->obj; |
| @@ -104,7 +105,10 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
| 104 | if (obj->name) | 105 | if (obj->name) |
| 105 | seq_printf(m, " (name: %d)", obj->name); | 106 | seq_printf(m, " (name: %d)", obj->name); |
| 106 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) | 107 | if (obj_priv->fence_reg != I915_FENCE_REG_NONE) |
| 107 | seq_printf(m, " (fence: %d)\n", obj_priv->fence_reg); | 108 | seq_printf(m, " (fence: %d)", obj_priv->fence_reg); |
| 109 | if (obj_priv->gtt_space != NULL) | ||
| 110 | seq_printf(m, " (gtt_offset: %08x)", obj_priv->gtt_offset); | ||
| 111 | |||
| 108 | seq_printf(m, "\n"); | 112 | seq_printf(m, "\n"); |
| 109 | } | 113 | } |
| 110 | 114 | ||
| @@ -323,6 +327,39 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data) | |||
| 323 | return 0; | 327 | return 0; |
| 324 | } | 328 | } |
| 325 | 329 | ||
| 330 | static int i915_error_state(struct seq_file *m, void *unused) | ||
| 331 | { | ||
| 332 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
| 333 | struct drm_device *dev = node->minor->dev; | ||
| 334 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
| 335 | struct drm_i915_error_state *error; | ||
| 336 | unsigned long flags; | ||
| 337 | |||
| 338 | spin_lock_irqsave(&dev_priv->error_lock, flags); | ||
| 339 | if (!dev_priv->first_error) { | ||
| 340 | seq_printf(m, "no error state collected\n"); | ||
| 341 | goto out; | ||
| 342 | } | ||
| 343 | |||
| 344 | error = dev_priv->first_error; | ||
| 345 | |||
| 346 | seq_printf(m, "EIR: 0x%08x\n", error->eir); | ||
| 347 | seq_printf(m, " PGTBL_ER: 0x%08x\n", error->pgtbl_er); | ||
| 348 | seq_printf(m, " INSTPM: 0x%08x\n", error->instpm); | ||
| 349 | seq_printf(m, " IPEIR: 0x%08x\n", error->ipeir); | ||
| 350 | seq_printf(m, " IPEHR: 0x%08x\n", error->ipehr); | ||
| 351 | seq_printf(m, " INSTDONE: 0x%08x\n", error->instdone); | ||
| 352 | seq_printf(m, " ACTHD: 0x%08x\n", error->acthd); | ||
| 353 | if (IS_I965G(dev)) { | ||
| 354 | seq_printf(m, " INSTPS: 0x%08x\n", error->instps); | ||
| 355 | seq_printf(m, " INSTDONE1: 0x%08x\n", error->instdone1); | ||
| 356 | } | ||
| 357 | |||
| 358 | out: | ||
| 359 | spin_unlock_irqrestore(&dev_priv->error_lock, flags); | ||
| 360 | |||
| 361 | return 0; | ||
| 362 | } | ||
| 326 | 363 | ||
| 327 | static struct drm_info_list i915_gem_debugfs_list[] = { | 364 | static struct drm_info_list i915_gem_debugfs_list[] = { |
| 328 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, | 365 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, |
| @@ -336,6 +373,7 @@ static struct drm_info_list i915_gem_debugfs_list[] = { | |||
| 336 | {"i915_ringbuffer_data", i915_ringbuffer_data, 0}, | 373 | {"i915_ringbuffer_data", i915_ringbuffer_data, 0}, |
| 337 | {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, | 374 | {"i915_ringbuffer_info", i915_ringbuffer_info, 0}, |
| 338 | {"i915_batchbuffers", i915_batchbuffer_info, 0}, | 375 | {"i915_batchbuffers", i915_batchbuffer_info, 0}, |
| 376 | {"i915_error_state", i915_error_state, 0}, | ||
| 339 | }; | 377 | }; |
| 340 | #define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list) | 378 | #define I915_GEM_DEBUGFS_ENTRIES ARRAY_SIZE(i915_gem_debugfs_list) |
| 341 | 379 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index daeae62e1c28..a2d527b22ec4 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
| @@ -521,6 +521,12 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, | |||
| 521 | goto err; | 521 | goto err; |
| 522 | } | 522 | } |
| 523 | 523 | ||
| 524 | /* If we've changed tiling, GTT-mappings of the object | ||
| 525 | * need to re-fault to ensure that the correct fence register | ||
| 526 | * setup is in place. | ||
| 527 | */ | ||
| 528 | i915_gem_release_mmap(obj); | ||
| 529 | |||
| 524 | obj_priv->tiling_mode = args->tiling_mode; | 530 | obj_priv->tiling_mode = args->tiling_mode; |
| 525 | obj_priv->stride = args->stride; | 531 | obj_priv->stride = args->stride; |
| 526 | } | 532 | } |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 228546f6eaa4..7ba23a69a0c0 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | * | 26 | * |
| 27 | */ | 27 | */ |
| 28 | 28 | ||
| 29 | #include <linux/sysrq.h> | ||
| 29 | #include "drmP.h" | 30 | #include "drmP.h" |
| 30 | #include "drm.h" | 31 | #include "drm.h" |
| 31 | #include "i915_drm.h" | 32 | #include "i915_drm.h" |
| @@ -41,9 +42,10 @@ | |||
| 41 | * we leave them always unmasked in IMR and then control enabling them through | 42 | * we leave them always unmasked in IMR and then control enabling them through |
| 42 | * PIPESTAT alone. | 43 | * PIPESTAT alone. |
| 43 | */ | 44 | */ |
| 44 | #define I915_INTERRUPT_ENABLE_FIX (I915_ASLE_INTERRUPT | \ | 45 | #define I915_INTERRUPT_ENABLE_FIX (I915_ASLE_INTERRUPT | \ |
| 45 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ | 46 | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | \ |
| 46 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT) | 47 | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | \ |
| 48 | I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT) | ||
| 47 | 49 | ||
| 48 | /** Interrupts that we mask and unmask at runtime. */ | 50 | /** Interrupts that we mask and unmask at runtime. */ |
| 49 | #define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) | 51 | #define I915_INTERRUPT_ENABLE_VAR (I915_USER_INTERRUPT) |
| @@ -288,6 +290,47 @@ irqreturn_t igdng_irq_handler(struct drm_device *dev) | |||
| 288 | return ret; | 290 | return ret; |
| 289 | } | 291 | } |
| 290 | 292 | ||
| 293 | static void i915_capture_error_state(struct drm_device *dev) | ||
| 294 | { | ||
| 295 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 296 | struct drm_i915_error_state *error; | ||
| 297 | unsigned long flags; | ||
| 298 | |||
| 299 | spin_lock_irqsave(&dev_priv->error_lock, flags); | ||
| 300 | if (dev_priv->first_error) | ||
| 301 | goto out; | ||
| 302 | |||
| 303 | error = kmalloc(sizeof(*error), GFP_ATOMIC); | ||
| 304 | if (!error) { | ||
| 305 | DRM_DEBUG("out ot memory, not capturing error state\n"); | ||
| 306 | goto out; | ||
| 307 | } | ||
| 308 | |||
| 309 | error->eir = I915_READ(EIR); | ||
| 310 | error->pgtbl_er = I915_READ(PGTBL_ER); | ||
| 311 | error->pipeastat = I915_READ(PIPEASTAT); | ||
| 312 | error->pipebstat = I915_READ(PIPEBSTAT); | ||
| 313 | error->instpm = I915_READ(INSTPM); | ||
| 314 | if (!IS_I965G(dev)) { | ||
| 315 | error->ipeir = I915_READ(IPEIR); | ||
| 316 | error->ipehr = I915_READ(IPEHR); | ||
| 317 | error->instdone = I915_READ(INSTDONE); | ||
| 318 | error->acthd = I915_READ(ACTHD); | ||
| 319 | } else { | ||
| 320 | error->ipeir = I915_READ(IPEIR_I965); | ||
| 321 | error->ipehr = I915_READ(IPEHR_I965); | ||
| 322 | error->instdone = I915_READ(INSTDONE_I965); | ||
| 323 | error->instps = I915_READ(INSTPS); | ||
| 324 | error->instdone1 = I915_READ(INSTDONE1); | ||
| 325 | error->acthd = I915_READ(ACTHD_I965); | ||
| 326 | } | ||
| 327 | |||
| 328 | dev_priv->first_error = error; | ||
| 329 | |||
| 330 | out: | ||
| 331 | spin_unlock_irqrestore(&dev_priv->error_lock, flags); | ||
| 332 | } | ||
| 333 | |||
| 291 | irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | 334 | irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) |
| 292 | { | 335 | { |
| 293 | struct drm_device *dev = (struct drm_device *) arg; | 336 | struct drm_device *dev = (struct drm_device *) arg; |
| @@ -333,11 +376,15 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
| 333 | * Clear the PIPE(A|B)STAT regs before the IIR | 376 | * Clear the PIPE(A|B)STAT regs before the IIR |
| 334 | */ | 377 | */ |
| 335 | if (pipea_stats & 0x8000ffff) { | 378 | if (pipea_stats & 0x8000ffff) { |
| 379 | if (pipea_stats & PIPE_FIFO_UNDERRUN_STATUS) | ||
| 380 | DRM_DEBUG("pipe a underrun\n"); | ||
| 336 | I915_WRITE(PIPEASTAT, pipea_stats); | 381 | I915_WRITE(PIPEASTAT, pipea_stats); |
| 337 | irq_received = 1; | 382 | irq_received = 1; |
| 338 | } | 383 | } |
| 339 | 384 | ||
| 340 | if (pipeb_stats & 0x8000ffff) { | 385 | if (pipeb_stats & 0x8000ffff) { |
| 386 | if (pipeb_stats & PIPE_FIFO_UNDERRUN_STATUS) | ||
| 387 | DRM_DEBUG("pipe b underrun\n"); | ||
| 341 | I915_WRITE(PIPEBSTAT, pipeb_stats); | 388 | I915_WRITE(PIPEBSTAT, pipeb_stats); |
| 342 | irq_received = 1; | 389 | irq_received = 1; |
| 343 | } | 390 | } |
| @@ -362,6 +409,80 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
| 362 | I915_READ(PORT_HOTPLUG_STAT); | 409 | I915_READ(PORT_HOTPLUG_STAT); |
| 363 | } | 410 | } |
| 364 | 411 | ||
| 412 | if (iir & I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT) { | ||
| 413 | u32 eir = I915_READ(EIR); | ||
| 414 | |||
| 415 | i915_capture_error_state(dev); | ||
| 416 | |||
| 417 | printk(KERN_ERR "render error detected, EIR: 0x%08x\n", | ||
| 418 | eir); | ||
| 419 | if (eir & I915_ERROR_PAGE_TABLE) { | ||
| 420 | u32 pgtbl_err = I915_READ(PGTBL_ER); | ||
| 421 | printk(KERN_ERR "page table error\n"); | ||
| 422 | printk(KERN_ERR " PGTBL_ER: 0x%08x\n", | ||
| 423 | pgtbl_err); | ||
| 424 | I915_WRITE(PGTBL_ER, pgtbl_err); | ||
| 425 | (void)I915_READ(PGTBL_ER); | ||
| 426 | } | ||
| 427 | if (eir & I915_ERROR_MEMORY_REFRESH) { | ||
| 428 | printk(KERN_ERR "memory refresh error\n"); | ||
| 429 | printk(KERN_ERR "PIPEASTAT: 0x%08x\n", | ||
| 430 | pipea_stats); | ||
| 431 | printk(KERN_ERR "PIPEBSTAT: 0x%08x\n", | ||
| 432 | pipeb_stats); | ||
| 433 | /* pipestat has already been acked */ | ||
| 434 | } | ||
| 435 | if (eir & I915_ERROR_INSTRUCTION) { | ||
| 436 | printk(KERN_ERR "instruction error\n"); | ||
| 437 | printk(KERN_ERR " INSTPM: 0x%08x\n", | ||
| 438 | I915_READ(INSTPM)); | ||
| 439 | if (!IS_I965G(dev)) { | ||
| 440 | u32 ipeir = I915_READ(IPEIR); | ||
| 441 | |||
| 442 | printk(KERN_ERR " IPEIR: 0x%08x\n", | ||
| 443 | I915_READ(IPEIR)); | ||
| 444 | printk(KERN_ERR " IPEHR: 0x%08x\n", | ||
| 445 | I915_READ(IPEHR)); | ||
| 446 | printk(KERN_ERR " INSTDONE: 0x%08x\n", | ||
| 447 | I915_READ(INSTDONE)); | ||
| 448 | printk(KERN_ERR " ACTHD: 0x%08x\n", | ||
| 449 | I915_READ(ACTHD)); | ||
| 450 | I915_WRITE(IPEIR, ipeir); | ||
| 451 | (void)I915_READ(IPEIR); | ||
| 452 | } else { | ||
| 453 | u32 ipeir = I915_READ(IPEIR_I965); | ||
| 454 | |||
| 455 | printk(KERN_ERR " IPEIR: 0x%08x\n", | ||
| 456 | I915_READ(IPEIR_I965)); | ||
| 457 | printk(KERN_ERR " IPEHR: 0x%08x\n", | ||
| 458 | I915_READ(IPEHR_I965)); | ||
| 459 | printk(KERN_ERR " INSTDONE: 0x%08x\n", | ||
| 460 | I915_READ(INSTDONE_I965)); | ||
| 461 | printk(KERN_ERR " INSTPS: 0x%08x\n", | ||
| 462 | I915_READ(INSTPS)); | ||
| 463 | printk(KERN_ERR " INSTDONE1: 0x%08x\n", | ||
| 464 | I915_READ(INSTDONE1)); | ||
| 465 | printk(KERN_ERR " ACTHD: 0x%08x\n", | ||
| 466 | I915_READ(ACTHD_I965)); | ||
| 467 | I915_WRITE(IPEIR_I965, ipeir); | ||
| 468 | (void)I915_READ(IPEIR_I965); | ||
| 469 | } | ||
| 470 | } | ||
| 471 | |||
| 472 | I915_WRITE(EIR, eir); | ||
| 473 | (void)I915_READ(EIR); | ||
| 474 | eir = I915_READ(EIR); | ||
| 475 | if (eir) { | ||
| 476 | /* | ||
| 477 | * some errors might have become stuck, | ||
| 478 | * mask them. | ||
| 479 | */ | ||
| 480 | DRM_ERROR("EIR stuck: 0x%08x, masking\n", eir); | ||
| 481 | I915_WRITE(EMR, I915_READ(EMR) | eir); | ||
| 482 | I915_WRITE(IIR, I915_RENDER_COMMAND_PARSER_ERROR_INTERRUPT); | ||
| 483 | } | ||
| 484 | } | ||
| 485 | |||
| 365 | I915_WRITE(IIR, iir); | 486 | I915_WRITE(IIR, iir); |
| 366 | new_iir = I915_READ(IIR); /* Flush posted writes */ | 487 | new_iir = I915_READ(IIR); /* Flush posted writes */ |
| 367 | 488 | ||
| @@ -732,6 +853,7 @@ int i915_driver_irq_postinstall(struct drm_device *dev) | |||
| 732 | { | 853 | { |
| 733 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 854 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
| 734 | u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; | 855 | u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR; |
| 856 | u32 error_mask; | ||
| 735 | 857 | ||
| 736 | DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); | 858 | DRM_INIT_WAITQUEUE(&dev_priv->irq_queue); |
| 737 | 859 | ||
| @@ -768,6 +890,21 @@ int i915_driver_irq_postinstall(struct drm_device *dev) | |||
| 768 | i915_enable_irq(dev_priv, I915_DISPLAY_PORT_INTERRUPT); | 890 | i915_enable_irq(dev_priv, I915_DISPLAY_PORT_INTERRUPT); |
| 769 | } | 891 | } |
| 770 | 892 | ||
| 893 | /* | ||
| 894 | * Enable some error detection, note the instruction error mask | ||
| 895 | * bit is reserved, so we leave it masked. | ||
| 896 | */ | ||
| 897 | if (IS_G4X(dev)) { | ||
| 898 | error_mask = ~(GM45_ERROR_PAGE_TABLE | | ||
| 899 | GM45_ERROR_MEM_PRIV | | ||
| 900 | GM45_ERROR_CP_PRIV | | ||
| 901 | I915_ERROR_MEMORY_REFRESH); | ||
| 902 | } else { | ||
| 903 | error_mask = ~(I915_ERROR_PAGE_TABLE | | ||
| 904 | I915_ERROR_MEMORY_REFRESH); | ||
| 905 | } | ||
| 906 | I915_WRITE(EMR, error_mask); | ||
| 907 | |||
| 771 | /* Disable pipe interrupt enables, clear pending pipe status */ | 908 | /* Disable pipe interrupt enables, clear pending pipe status */ |
| 772 | I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff); | 909 | I915_WRITE(PIPEASTAT, I915_READ(PIPEASTAT) & 0x8000ffff); |
| 773 | I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff); | 910 | I915_WRITE(PIPEBSTAT, I915_READ(PIPEBSTAT) & 0x8000ffff); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 88bf7521405f..6c0858484094 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -206,6 +206,7 @@ | |||
| 206 | /* | 206 | /* |
| 207 | * Instruction and interrupt control regs | 207 | * Instruction and interrupt control regs |
| 208 | */ | 208 | */ |
| 209 | #define PGTBL_ER 0x02024 | ||
| 209 | #define PRB0_TAIL 0x02030 | 210 | #define PRB0_TAIL 0x02030 |
| 210 | #define PRB0_HEAD 0x02034 | 211 | #define PRB0_HEAD 0x02034 |
| 211 | #define PRB0_START 0x02038 | 212 | #define PRB0_START 0x02038 |
| @@ -226,11 +227,18 @@ | |||
| 226 | #define PRB1_HEAD 0x02044 /* 915+ only */ | 227 | #define PRB1_HEAD 0x02044 /* 915+ only */ |
| 227 | #define PRB1_START 0x02048 /* 915+ only */ | 228 | #define PRB1_START 0x02048 /* 915+ only */ |
| 228 | #define PRB1_CTL 0x0204c /* 915+ only */ | 229 | #define PRB1_CTL 0x0204c /* 915+ only */ |
| 230 | #define IPEIR_I965 0x02064 | ||
| 231 | #define IPEHR_I965 0x02068 | ||
| 232 | #define INSTDONE_I965 0x0206c | ||
| 233 | #define INSTPS 0x02070 /* 965+ only */ | ||
| 234 | #define INSTDONE1 0x0207c /* 965+ only */ | ||
| 229 | #define ACTHD_I965 0x02074 | 235 | #define ACTHD_I965 0x02074 |
| 230 | #define HWS_PGA 0x02080 | 236 | #define HWS_PGA 0x02080 |
| 231 | #define HWS_ADDRESS_MASK 0xfffff000 | 237 | #define HWS_ADDRESS_MASK 0xfffff000 |
| 232 | #define HWS_START_ADDRESS_SHIFT 4 | 238 | #define HWS_START_ADDRESS_SHIFT 4 |
| 233 | #define IPEIR 0x02088 | 239 | #define IPEIR 0x02088 |
| 240 | #define IPEHR 0x0208c | ||
| 241 | #define INSTDONE 0x02090 | ||
| 234 | #define NOPID 0x02094 | 242 | #define NOPID 0x02094 |
| 235 | #define HWSTAM 0x02098 | 243 | #define HWSTAM 0x02098 |
| 236 | #define SCPD0 0x0209c /* 915+ only */ | 244 | #define SCPD0 0x0209c /* 915+ only */ |
| @@ -258,10 +266,22 @@ | |||
| 258 | #define EIR 0x020b0 | 266 | #define EIR 0x020b0 |
| 259 | #define EMR 0x020b4 | 267 | #define EMR 0x020b4 |
| 260 | #define ESR 0x020b8 | 268 | #define ESR 0x020b8 |
| 269 | #define GM45_ERROR_PAGE_TABLE (1<<5) | ||
| 270 | #define GM45_ERROR_MEM_PRIV (1<<4) | ||
| 271 | #define I915_ERROR_PAGE_TABLE (1<<4) | ||
| 272 | #define GM45_ERROR_CP_PRIV (1<<3) | ||
| 273 | #define I915_ERROR_MEMORY_REFRESH (1<<1) | ||
| 274 | #define I915_ERROR_INSTRUCTION (1<<0) | ||
| 261 | #define INSTPM 0x020c0 | 275 | #define INSTPM 0x020c0 |
| 262 | #define ACTHD 0x020c8 | 276 | #define ACTHD 0x020c8 |
| 263 | #define FW_BLC 0x020d8 | 277 | #define FW_BLC 0x020d8 |
| 278 | #define FW_BLC2 0x020dc | ||
| 264 | #define FW_BLC_SELF 0x020e0 /* 915+ only */ | 279 | #define FW_BLC_SELF 0x020e0 /* 915+ only */ |
| 280 | #define FW_BLC_SELF_EN (1<<15) | ||
| 281 | #define MM_BURST_LENGTH 0x00700000 | ||
| 282 | #define MM_FIFO_WATERMARK 0x0001F000 | ||
| 283 | #define LM_BURST_LENGTH 0x00000700 | ||
| 284 | #define LM_FIFO_WATERMARK 0x0000001F | ||
| 265 | #define MI_ARB_STATE 0x020e4 /* 915+ only */ | 285 | #define MI_ARB_STATE 0x020e4 /* 915+ only */ |
| 266 | #define CACHE_MODE_0 0x02120 /* 915+ only */ | 286 | #define CACHE_MODE_0 0x02120 /* 915+ only */ |
| 267 | #define CM0_MASK_SHIFT 16 | 287 | #define CM0_MASK_SHIFT 16 |
| @@ -571,17 +591,21 @@ | |||
| 571 | 591 | ||
| 572 | /* Clocking configuration register */ | 592 | /* Clocking configuration register */ |
| 573 | #define CLKCFG 0x10c00 | 593 | #define CLKCFG 0x10c00 |
| 574 | #define CLKCFG_FSB_400 (0 << 0) /* hrawclk 100 */ | 594 | #define CLKCFG_FSB_400 (5 << 0) /* hrawclk 100 */ |
| 575 | #define CLKCFG_FSB_533 (1 << 0) /* hrawclk 133 */ | 595 | #define CLKCFG_FSB_533 (1 << 0) /* hrawclk 133 */ |
| 576 | #define CLKCFG_FSB_667 (3 << 0) /* hrawclk 166 */ | 596 | #define CLKCFG_FSB_667 (3 << 0) /* hrawclk 166 */ |
| 577 | #define CLKCFG_FSB_800 (2 << 0) /* hrawclk 200 */ | 597 | #define CLKCFG_FSB_800 (2 << 0) /* hrawclk 200 */ |
| 578 | #define CLKCFG_FSB_1067 (6 << 0) /* hrawclk 266 */ | 598 | #define CLKCFG_FSB_1067 (6 << 0) /* hrawclk 266 */ |
| 579 | #define CLKCFG_FSB_1333 (7 << 0) /* hrawclk 333 */ | 599 | #define CLKCFG_FSB_1333 (7 << 0) /* hrawclk 333 */ |
| 580 | /* this is a guess, could be 5 as well */ | 600 | /* Note, below two are guess */ |
| 581 | #define CLKCFG_FSB_1600 (4 << 0) /* hrawclk 400 */ | 601 | #define CLKCFG_FSB_1600 (4 << 0) /* hrawclk 400 */ |
| 582 | #define CLKCFG_FSB_1600_ALT (5 << 0) /* hrawclk 400 */ | 602 | #define CLKCFG_FSB_1600_ALT (0 << 0) /* hrawclk 400 */ |
| 583 | #define CLKCFG_FSB_MASK (7 << 0) | 603 | #define CLKCFG_FSB_MASK (7 << 0) |
| 584 | 604 | #define CLKCFG_MEM_533 (1 << 4) | |
| 605 | #define CLKCFG_MEM_667 (2 << 4) | ||
| 606 | #define CLKCFG_MEM_800 (3 << 4) | ||
| 607 | #define CLKCFG_MEM_MASK (7 << 4) | ||
| 608 | |||
| 585 | /** GM965 GM45 render standby register */ | 609 | /** GM965 GM45 render standby register */ |
| 586 | #define MCHBAR_RENDER_STANDBY 0x111B8 | 610 | #define MCHBAR_RENDER_STANDBY 0x111B8 |
| 587 | 611 | ||
| @@ -1581,6 +1605,34 @@ | |||
| 1581 | #define DSPARB_CSTART_SHIFT 7 | 1605 | #define DSPARB_CSTART_SHIFT 7 |
| 1582 | #define DSPARB_BSTART_MASK (0x7f) | 1606 | #define DSPARB_BSTART_MASK (0x7f) |
| 1583 | #define DSPARB_BSTART_SHIFT 0 | 1607 | #define DSPARB_BSTART_SHIFT 0 |
| 1608 | #define DSPARB_BEND_SHIFT 9 /* on 855 */ | ||
| 1609 | #define DSPARB_AEND_SHIFT 0 | ||
| 1610 | |||
| 1611 | #define DSPFW1 0x70034 | ||
| 1612 | #define DSPFW2 0x70038 | ||
| 1613 | #define DSPFW3 0x7003c | ||
| 1614 | #define IGD_SELF_REFRESH_EN (1<<30) | ||
| 1615 | |||
| 1616 | /* FIFO watermark sizes etc */ | ||
| 1617 | #define I915_FIFO_LINE_SIZE 64 | ||
| 1618 | #define I830_FIFO_LINE_SIZE 32 | ||
| 1619 | #define I945_FIFO_SIZE 127 /* 945 & 965 */ | ||
| 1620 | #define I915_FIFO_SIZE 95 | ||
| 1621 | #define I855GM_FIFO_SIZE 255 | ||
| 1622 | #define I830_FIFO_SIZE 95 | ||
| 1623 | #define I915_MAX_WM 0x3f | ||
| 1624 | |||
| 1625 | #define IGD_DISPLAY_FIFO 512 /* in 64byte unit */ | ||
| 1626 | #define IGD_FIFO_LINE_SIZE 64 | ||
| 1627 | #define IGD_MAX_WM 0x1ff | ||
| 1628 | #define IGD_DFT_WM 0x3f | ||
| 1629 | #define IGD_DFT_HPLLOFF_WM 0 | ||
| 1630 | #define IGD_GUARD_WM 10 | ||
| 1631 | #define IGD_CURSOR_FIFO 64 | ||
| 1632 | #define IGD_CURSOR_MAX_WM 0x3f | ||
| 1633 | #define IGD_CURSOR_DFT_WM 0 | ||
| 1634 | #define IGD_CURSOR_GUARD_WM 5 | ||
| 1635 | |||
| 1584 | /* | 1636 | /* |
| 1585 | * The two pipe frame counter registers are not synchronized, so | 1637 | * The two pipe frame counter registers are not synchronized, so |
| 1586 | * reading a stable value is somewhat tricky. The following code | 1638 | * reading a stable value is somewhat tricky. The following code |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 8d8e083d14ab..9e1d16e5c3ea 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
| @@ -222,23 +222,12 @@ static void i915_restore_vga(struct drm_device *dev) | |||
| 222 | I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK); | 222 | I915_WRITE8(VGA_DACMASK, dev_priv->saveDACMASK); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | int i915_save_state(struct drm_device *dev) | 225 | static void i915_save_modeset_reg(struct drm_device *dev) |
| 226 | { | 226 | { |
| 227 | struct drm_i915_private *dev_priv = dev->dev_private; | 227 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 228 | int i; | ||
| 229 | |||
| 230 | pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB); | ||
| 231 | |||
| 232 | /* Render Standby */ | ||
| 233 | if (IS_I965G(dev) && IS_MOBILE(dev)) | ||
| 234 | dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY); | ||
| 235 | |||
| 236 | /* Hardware status page */ | ||
| 237 | dev_priv->saveHWS = I915_READ(HWS_PGA); | ||
| 238 | |||
| 239 | /* Display arbitration control */ | ||
| 240 | dev_priv->saveDSPARB = I915_READ(DSPARB); | ||
| 241 | 228 | ||
| 229 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 230 | return; | ||
| 242 | /* Pipe & plane A info */ | 231 | /* Pipe & plane A info */ |
| 243 | dev_priv->savePIPEACONF = I915_READ(PIPEACONF); | 232 | dev_priv->savePIPEACONF = I915_READ(PIPEACONF); |
| 244 | dev_priv->savePIPEASRC = I915_READ(PIPEASRC); | 233 | dev_priv->savePIPEASRC = I915_READ(PIPEASRC); |
| @@ -294,7 +283,122 @@ int i915_save_state(struct drm_device *dev) | |||
| 294 | } | 283 | } |
| 295 | i915_save_palette(dev, PIPE_B); | 284 | i915_save_palette(dev, PIPE_B); |
| 296 | dev_priv->savePIPEBSTAT = I915_READ(PIPEBSTAT); | 285 | dev_priv->savePIPEBSTAT = I915_READ(PIPEBSTAT); |
| 286 | return; | ||
| 287 | } | ||
| 288 | static void i915_restore_modeset_reg(struct drm_device *dev) | ||
| 289 | { | ||
| 290 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 291 | |||
| 292 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | ||
| 293 | return; | ||
| 294 | |||
| 295 | /* Pipe & plane A info */ | ||
| 296 | /* Prime the clock */ | ||
| 297 | if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) { | ||
| 298 | I915_WRITE(DPLL_A, dev_priv->saveDPLL_A & | ||
| 299 | ~DPLL_VCO_ENABLE); | ||
| 300 | DRM_UDELAY(150); | ||
| 301 | } | ||
| 302 | I915_WRITE(FPA0, dev_priv->saveFPA0); | ||
| 303 | I915_WRITE(FPA1, dev_priv->saveFPA1); | ||
| 304 | /* Actually enable it */ | ||
| 305 | I915_WRITE(DPLL_A, dev_priv->saveDPLL_A); | ||
| 306 | DRM_UDELAY(150); | ||
| 307 | if (IS_I965G(dev)) | ||
| 308 | I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD); | ||
| 309 | DRM_UDELAY(150); | ||
| 310 | |||
| 311 | /* Restore mode */ | ||
| 312 | I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A); | ||
| 313 | I915_WRITE(HBLANK_A, dev_priv->saveHBLANK_A); | ||
| 314 | I915_WRITE(HSYNC_A, dev_priv->saveHSYNC_A); | ||
| 315 | I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A); | ||
| 316 | I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A); | ||
| 317 | I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A); | ||
| 318 | I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A); | ||
| 319 | |||
| 320 | /* Restore plane info */ | ||
| 321 | I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE); | ||
| 322 | I915_WRITE(DSPAPOS, dev_priv->saveDSPAPOS); | ||
| 323 | I915_WRITE(PIPEASRC, dev_priv->savePIPEASRC); | ||
| 324 | I915_WRITE(DSPAADDR, dev_priv->saveDSPAADDR); | ||
| 325 | I915_WRITE(DSPASTRIDE, dev_priv->saveDSPASTRIDE); | ||
| 326 | if (IS_I965G(dev)) { | ||
| 327 | I915_WRITE(DSPASURF, dev_priv->saveDSPASURF); | ||
| 328 | I915_WRITE(DSPATILEOFF, dev_priv->saveDSPATILEOFF); | ||
| 329 | } | ||
| 330 | |||
| 331 | I915_WRITE(PIPEACONF, dev_priv->savePIPEACONF); | ||
| 332 | |||
| 333 | i915_restore_palette(dev, PIPE_A); | ||
| 334 | /* Enable the plane */ | ||
| 335 | I915_WRITE(DSPACNTR, dev_priv->saveDSPACNTR); | ||
| 336 | I915_WRITE(DSPAADDR, I915_READ(DSPAADDR)); | ||
| 337 | |||
| 338 | /* Pipe & plane B info */ | ||
| 339 | if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) { | ||
| 340 | I915_WRITE(DPLL_B, dev_priv->saveDPLL_B & | ||
| 341 | ~DPLL_VCO_ENABLE); | ||
| 342 | DRM_UDELAY(150); | ||
| 343 | } | ||
| 344 | I915_WRITE(FPB0, dev_priv->saveFPB0); | ||
| 345 | I915_WRITE(FPB1, dev_priv->saveFPB1); | ||
| 346 | /* Actually enable it */ | ||
| 347 | I915_WRITE(DPLL_B, dev_priv->saveDPLL_B); | ||
| 348 | DRM_UDELAY(150); | ||
| 349 | if (IS_I965G(dev)) | ||
| 350 | I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD); | ||
| 351 | DRM_UDELAY(150); | ||
| 352 | |||
| 353 | /* Restore mode */ | ||
| 354 | I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B); | ||
| 355 | I915_WRITE(HBLANK_B, dev_priv->saveHBLANK_B); | ||
| 356 | I915_WRITE(HSYNC_B, dev_priv->saveHSYNC_B); | ||
| 357 | I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B); | ||
| 358 | I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B); | ||
| 359 | I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B); | ||
| 360 | I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B); | ||
| 361 | |||
| 362 | /* Restore plane info */ | ||
| 363 | I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE); | ||
| 364 | I915_WRITE(DSPBPOS, dev_priv->saveDSPBPOS); | ||
| 365 | I915_WRITE(PIPEBSRC, dev_priv->savePIPEBSRC); | ||
| 366 | I915_WRITE(DSPBADDR, dev_priv->saveDSPBADDR); | ||
| 367 | I915_WRITE(DSPBSTRIDE, dev_priv->saveDSPBSTRIDE); | ||
| 368 | if (IS_I965G(dev)) { | ||
| 369 | I915_WRITE(DSPBSURF, dev_priv->saveDSPBSURF); | ||
| 370 | I915_WRITE(DSPBTILEOFF, dev_priv->saveDSPBTILEOFF); | ||
| 371 | } | ||
| 372 | |||
| 373 | I915_WRITE(PIPEBCONF, dev_priv->savePIPEBCONF); | ||
| 374 | |||
| 375 | i915_restore_palette(dev, PIPE_B); | ||
| 376 | /* Enable the plane */ | ||
| 377 | I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); | ||
| 378 | I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); | ||
| 297 | 379 | ||
| 380 | return; | ||
| 381 | } | ||
| 382 | int i915_save_state(struct drm_device *dev) | ||
| 383 | { | ||
| 384 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 385 | int i; | ||
| 386 | |||
| 387 | pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB); | ||
| 388 | |||
| 389 | /* Render Standby */ | ||
| 390 | if (IS_I965G(dev) && IS_MOBILE(dev)) | ||
| 391 | dev_priv->saveRENDERSTANDBY = I915_READ(MCHBAR_RENDER_STANDBY); | ||
| 392 | |||
| 393 | /* Hardware status page */ | ||
| 394 | dev_priv->saveHWS = I915_READ(HWS_PGA); | ||
| 395 | |||
| 396 | /* Display arbitration control */ | ||
| 397 | dev_priv->saveDSPARB = I915_READ(DSPARB); | ||
| 398 | |||
| 399 | /* This is only meaningful in non-KMS mode */ | ||
| 400 | /* Don't save them in KMS mode */ | ||
| 401 | i915_save_modeset_reg(dev); | ||
| 298 | /* Cursor state */ | 402 | /* Cursor state */ |
| 299 | dev_priv->saveCURACNTR = I915_READ(CURACNTR); | 403 | dev_priv->saveCURACNTR = I915_READ(CURACNTR); |
| 300 | dev_priv->saveCURAPOS = I915_READ(CURAPOS); | 404 | dev_priv->saveCURAPOS = I915_READ(CURAPOS); |
| @@ -430,92 +534,9 @@ int i915_restore_state(struct drm_device *dev) | |||
| 430 | I915_WRITE(PIPEA_DP_LINK_N, dev_priv->savePIPEA_DP_LINK_N); | 534 | I915_WRITE(PIPEA_DP_LINK_N, dev_priv->savePIPEA_DP_LINK_N); |
| 431 | I915_WRITE(PIPEB_DP_LINK_N, dev_priv->savePIPEB_DP_LINK_N); | 535 | I915_WRITE(PIPEB_DP_LINK_N, dev_priv->savePIPEB_DP_LINK_N); |
| 432 | } | 536 | } |
| 433 | 537 | /* This is only meaningful in non-KMS mode */ | |
| 434 | /* Pipe & plane A info */ | 538 | /* Don't restore them in KMS mode */ |
| 435 | /* Prime the clock */ | 539 | i915_restore_modeset_reg(dev); |
| 436 | if (dev_priv->saveDPLL_A & DPLL_VCO_ENABLE) { | ||
| 437 | I915_WRITE(DPLL_A, dev_priv->saveDPLL_A & | ||
| 438 | ~DPLL_VCO_ENABLE); | ||
| 439 | DRM_UDELAY(150); | ||
| 440 | } | ||
| 441 | I915_WRITE(FPA0, dev_priv->saveFPA0); | ||
| 442 | I915_WRITE(FPA1, dev_priv->saveFPA1); | ||
| 443 | /* Actually enable it */ | ||
| 444 | I915_WRITE(DPLL_A, dev_priv->saveDPLL_A); | ||
| 445 | DRM_UDELAY(150); | ||
| 446 | if (IS_I965G(dev)) | ||
| 447 | I915_WRITE(DPLL_A_MD, dev_priv->saveDPLL_A_MD); | ||
| 448 | DRM_UDELAY(150); | ||
| 449 | |||
| 450 | /* Restore mode */ | ||
| 451 | I915_WRITE(HTOTAL_A, dev_priv->saveHTOTAL_A); | ||
| 452 | I915_WRITE(HBLANK_A, dev_priv->saveHBLANK_A); | ||
| 453 | I915_WRITE(HSYNC_A, dev_priv->saveHSYNC_A); | ||
| 454 | I915_WRITE(VTOTAL_A, dev_priv->saveVTOTAL_A); | ||
| 455 | I915_WRITE(VBLANK_A, dev_priv->saveVBLANK_A); | ||
| 456 | I915_WRITE(VSYNC_A, dev_priv->saveVSYNC_A); | ||
| 457 | I915_WRITE(BCLRPAT_A, dev_priv->saveBCLRPAT_A); | ||
| 458 | |||
| 459 | /* Restore plane info */ | ||
| 460 | I915_WRITE(DSPASIZE, dev_priv->saveDSPASIZE); | ||
| 461 | I915_WRITE(DSPAPOS, dev_priv->saveDSPAPOS); | ||
| 462 | I915_WRITE(PIPEASRC, dev_priv->savePIPEASRC); | ||
| 463 | I915_WRITE(DSPAADDR, dev_priv->saveDSPAADDR); | ||
| 464 | I915_WRITE(DSPASTRIDE, dev_priv->saveDSPASTRIDE); | ||
| 465 | if (IS_I965G(dev)) { | ||
| 466 | I915_WRITE(DSPASURF, dev_priv->saveDSPASURF); | ||
| 467 | I915_WRITE(DSPATILEOFF, dev_priv->saveDSPATILEOFF); | ||
| 468 | } | ||
| 469 | |||
| 470 | I915_WRITE(PIPEACONF, dev_priv->savePIPEACONF); | ||
| 471 | |||
| 472 | i915_restore_palette(dev, PIPE_A); | ||
| 473 | /* Enable the plane */ | ||
| 474 | I915_WRITE(DSPACNTR, dev_priv->saveDSPACNTR); | ||
| 475 | I915_WRITE(DSPAADDR, I915_READ(DSPAADDR)); | ||
| 476 | |||
| 477 | /* Pipe & plane B info */ | ||
| 478 | if (dev_priv->saveDPLL_B & DPLL_VCO_ENABLE) { | ||
| 479 | I915_WRITE(DPLL_B, dev_priv->saveDPLL_B & | ||
| 480 | ~DPLL_VCO_ENABLE); | ||
| 481 | DRM_UDELAY(150); | ||
| 482 | } | ||
| 483 | I915_WRITE(FPB0, dev_priv->saveFPB0); | ||
| 484 | I915_WRITE(FPB1, dev_priv->saveFPB1); | ||
| 485 | /* Actually enable it */ | ||
| 486 | I915_WRITE(DPLL_B, dev_priv->saveDPLL_B); | ||
| 487 | DRM_UDELAY(150); | ||
| 488 | if (IS_I965G(dev)) | ||
| 489 | I915_WRITE(DPLL_B_MD, dev_priv->saveDPLL_B_MD); | ||
| 490 | DRM_UDELAY(150); | ||
| 491 | |||
| 492 | /* Restore mode */ | ||
| 493 | I915_WRITE(HTOTAL_B, dev_priv->saveHTOTAL_B); | ||
| 494 | I915_WRITE(HBLANK_B, dev_priv->saveHBLANK_B); | ||
| 495 | I915_WRITE(HSYNC_B, dev_priv->saveHSYNC_B); | ||
| 496 | I915_WRITE(VTOTAL_B, dev_priv->saveVTOTAL_B); | ||
| 497 | I915_WRITE(VBLANK_B, dev_priv->saveVBLANK_B); | ||
| 498 | I915_WRITE(VSYNC_B, dev_priv->saveVSYNC_B); | ||
| 499 | I915_WRITE(BCLRPAT_B, dev_priv->saveBCLRPAT_B); | ||
| 500 | |||
| 501 | /* Restore plane info */ | ||
| 502 | I915_WRITE(DSPBSIZE, dev_priv->saveDSPBSIZE); | ||
| 503 | I915_WRITE(DSPBPOS, dev_priv->saveDSPBPOS); | ||
| 504 | I915_WRITE(PIPEBSRC, dev_priv->savePIPEBSRC); | ||
| 505 | I915_WRITE(DSPBADDR, dev_priv->saveDSPBADDR); | ||
| 506 | I915_WRITE(DSPBSTRIDE, dev_priv->saveDSPBSTRIDE); | ||
| 507 | if (IS_I965G(dev)) { | ||
| 508 | I915_WRITE(DSPBSURF, dev_priv->saveDSPBSURF); | ||
| 509 | I915_WRITE(DSPBTILEOFF, dev_priv->saveDSPBTILEOFF); | ||
| 510 | } | ||
| 511 | |||
| 512 | I915_WRITE(PIPEBCONF, dev_priv->savePIPEBCONF); | ||
| 513 | |||
| 514 | i915_restore_palette(dev, PIPE_B); | ||
| 515 | /* Enable the plane */ | ||
| 516 | I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); | ||
| 517 | I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); | ||
| 518 | |||
| 519 | /* Cursor state */ | 540 | /* Cursor state */ |
| 520 | I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); | 541 | I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); |
| 521 | I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); | 542 | I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 716409a57244..7cc447191028 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
| @@ -97,6 +97,7 @@ static void | |||
| 97 | parse_lfp_panel_data(struct drm_i915_private *dev_priv, | 97 | parse_lfp_panel_data(struct drm_i915_private *dev_priv, |
| 98 | struct bdb_header *bdb) | 98 | struct bdb_header *bdb) |
| 99 | { | 99 | { |
| 100 | struct drm_device *dev = dev_priv->dev; | ||
| 100 | struct bdb_lvds_options *lvds_options; | 101 | struct bdb_lvds_options *lvds_options; |
| 101 | struct bdb_lvds_lfp_data *lvds_lfp_data; | 102 | struct bdb_lvds_lfp_data *lvds_lfp_data; |
| 102 | struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs; | 103 | struct bdb_lvds_lfp_data_ptrs *lvds_lfp_data_ptrs; |
| @@ -132,7 +133,14 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
| 132 | entry = (struct bdb_lvds_lfp_data_entry *) | 133 | entry = (struct bdb_lvds_lfp_data_entry *) |
| 133 | ((uint8_t *)lvds_lfp_data->data + (lfp_data_size * | 134 | ((uint8_t *)lvds_lfp_data->data + (lfp_data_size * |
| 134 | lvds_options->panel_type)); | 135 | lvds_options->panel_type)); |
| 135 | dvo_timing = &entry->dvo_timing; | 136 | |
| 137 | /* On IGDNG mobile, LVDS data block removes panel fitting registers. | ||
| 138 | So dec 2 dword from dvo_timing offset */ | ||
| 139 | if (IS_IGDNG(dev)) | ||
| 140 | dvo_timing = (struct lvds_dvo_timing *) | ||
| 141 | ((u8 *)&entry->dvo_timing - 8); | ||
| 142 | else | ||
| 143 | dvo_timing = &entry->dvo_timing; | ||
| 136 | 144 | ||
| 137 | panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); | 145 | panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL); |
| 138 | 146 | ||
| @@ -195,10 +203,12 @@ parse_general_features(struct drm_i915_private *dev_priv, | |||
| 195 | dev_priv->lvds_use_ssc = general->enable_ssc; | 203 | dev_priv->lvds_use_ssc = general->enable_ssc; |
| 196 | 204 | ||
| 197 | if (dev_priv->lvds_use_ssc) { | 205 | if (dev_priv->lvds_use_ssc) { |
| 198 | if (IS_I855(dev_priv->dev)) | 206 | if (IS_I85X(dev_priv->dev)) |
| 199 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 66 : 48; | 207 | dev_priv->lvds_ssc_freq = |
| 200 | else | 208 | general->ssc_freq ? 66 : 48; |
| 201 | dev_priv->lvds_ssc_freq = general->ssc_freq ? 100 : 96; | 209 | else |
| 210 | dev_priv->lvds_ssc_freq = | ||
| 211 | general->ssc_freq ? 100 : 96; | ||
| 202 | } | 212 | } |
| 203 | } | 213 | } |
| 204 | } | 214 | } |
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index 6de97fc66029..d6a1a6e5539a 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c | |||
| @@ -46,7 +46,7 @@ static void intel_crt_dpms(struct drm_encoder *encoder, int mode) | |||
| 46 | 46 | ||
| 47 | temp = I915_READ(reg); | 47 | temp = I915_READ(reg); |
| 48 | temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE); | 48 | temp &= ~(ADPA_HSYNC_CNTL_DISABLE | ADPA_VSYNC_CNTL_DISABLE); |
| 49 | temp |= ADPA_DAC_ENABLE; | 49 | temp &= ~ADPA_DAC_ENABLE; |
| 50 | 50 | ||
| 51 | switch(mode) { | 51 | switch(mode) { |
| 52 | case DRM_MODE_DPMS_ON: | 52 | case DRM_MODE_DPMS_ON: |
| @@ -428,8 +428,34 @@ static void intel_crt_destroy(struct drm_connector *connector) | |||
| 428 | 428 | ||
| 429 | static int intel_crt_get_modes(struct drm_connector *connector) | 429 | static int intel_crt_get_modes(struct drm_connector *connector) |
| 430 | { | 430 | { |
| 431 | int ret; | ||
| 431 | struct intel_output *intel_output = to_intel_output(connector); | 432 | struct intel_output *intel_output = to_intel_output(connector); |
| 432 | return intel_ddc_get_modes(intel_output); | 433 | struct i2c_adapter *ddcbus; |
| 434 | struct drm_device *dev = connector->dev; | ||
| 435 | |||
| 436 | |||
| 437 | ret = intel_ddc_get_modes(intel_output); | ||
| 438 | if (ret || !IS_G4X(dev)) | ||
| 439 | goto end; | ||
| 440 | |||
| 441 | ddcbus = intel_output->ddc_bus; | ||
| 442 | /* Try to probe digital port for output in DVI-I -> VGA mode. */ | ||
| 443 | intel_output->ddc_bus = | ||
| 444 | intel_i2c_create(connector->dev, GPIOD, "CRTDDC_D"); | ||
| 445 | |||
| 446 | if (!intel_output->ddc_bus) { | ||
| 447 | intel_output->ddc_bus = ddcbus; | ||
| 448 | dev_printk(KERN_ERR, &connector->dev->pdev->dev, | ||
| 449 | "DDC bus registration failed for CRTDDC_D.\n"); | ||
| 450 | goto end; | ||
| 451 | } | ||
| 452 | /* Try to get modes by GPIOD port */ | ||
| 453 | ret = intel_ddc_get_modes(intel_output); | ||
| 454 | intel_i2c_destroy(ddcbus); | ||
| 455 | |||
| 456 | end: | ||
| 457 | return ret; | ||
| 458 | |||
| 433 | } | 459 | } |
| 434 | 460 | ||
| 435 | static int intel_crt_set_property(struct drm_connector *connector, | 461 | static int intel_crt_set_property(struct drm_connector *connector, |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 73e7b9cecac8..508838ee31e0 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | */ | 25 | */ |
| 26 | 26 | ||
| 27 | #include <linux/i2c.h> | 27 | #include <linux/i2c.h> |
| 28 | #include <linux/kernel.h> | ||
| 28 | #include "drmP.h" | 29 | #include "drmP.h" |
| 29 | #include "intel_drv.h" | 30 | #include "intel_drv.h" |
| 30 | #include "i915_drm.h" | 31 | #include "i915_drm.h" |
| @@ -34,6 +35,7 @@ | |||
| 34 | #include "drm_crtc_helper.h" | 35 | #include "drm_crtc_helper.h" |
| 35 | 36 | ||
| 36 | bool intel_pipe_has_type (struct drm_crtc *crtc, int type); | 37 | bool intel_pipe_has_type (struct drm_crtc *crtc, int type); |
| 38 | static void intel_update_watermarks(struct drm_device *dev); | ||
| 37 | 39 | ||
| 38 | typedef struct { | 40 | typedef struct { |
| 39 | /* given values */ | 41 | /* given values */ |
| @@ -814,24 +816,21 @@ intel_find_pll_g4x_dp(const intel_limit_t *limit, struct drm_crtc *crtc, | |||
| 814 | { | 816 | { |
| 815 | intel_clock_t clock; | 817 | intel_clock_t clock; |
| 816 | if (target < 200000) { | 818 | if (target < 200000) { |
| 817 | clock.dot = 161670; | ||
| 818 | clock.p = 20; | ||
| 819 | clock.p1 = 2; | 819 | clock.p1 = 2; |
| 820 | clock.p2 = 10; | 820 | clock.p2 = 10; |
| 821 | clock.n = 0x01; | 821 | clock.n = 2; |
| 822 | clock.m = 97; | 822 | clock.m1 = 23; |
| 823 | clock.m1 = 0x10; | 823 | clock.m2 = 8; |
| 824 | clock.m2 = 0x05; | ||
| 825 | } else { | 824 | } else { |
| 826 | clock.dot = 270000; | ||
| 827 | clock.p = 10; | ||
| 828 | clock.p1 = 1; | 825 | clock.p1 = 1; |
| 829 | clock.p2 = 10; | 826 | clock.p2 = 10; |
| 830 | clock.n = 0x02; | 827 | clock.n = 1; |
| 831 | clock.m = 108; | 828 | clock.m1 = 14; |
| 832 | clock.m1 = 0x12; | 829 | clock.m2 = 2; |
| 833 | clock.m2 = 0x06; | ||
| 834 | } | 830 | } |
| 831 | clock.m = 5 * (clock.m1 + 2) + (clock.m2 + 2); | ||
| 832 | clock.p = (clock.p1 * clock.p2); | ||
| 833 | clock.dot = 96000 * clock.m / (clock.n + 2) / clock.p; | ||
| 835 | memcpy(best_clock, &clock, sizeof(intel_clock_t)); | 834 | memcpy(best_clock, &clock, sizeof(intel_clock_t)); |
| 836 | return true; | 835 | return true; |
| 837 | } | 836 | } |
| @@ -1005,7 +1004,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 1005 | struct drm_i915_private *dev_priv = dev->dev_private; | 1004 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1006 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1005 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
| 1007 | int pipe = intel_crtc->pipe; | 1006 | int pipe = intel_crtc->pipe; |
| 1008 | int plane = intel_crtc->pipe; | 1007 | int plane = intel_crtc->plane; |
| 1009 | int pch_dpll_reg = (pipe == 0) ? PCH_DPLL_A : PCH_DPLL_B; | 1008 | int pch_dpll_reg = (pipe == 0) ? PCH_DPLL_A : PCH_DPLL_B; |
| 1010 | int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; | 1009 | int pipeconf_reg = (pipe == 0) ? PIPEACONF : PIPEBCONF; |
| 1011 | int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR; | 1010 | int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR; |
| @@ -1335,8 +1334,10 @@ static void i9xx_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 1335 | 1334 | ||
| 1336 | /* Give the overlay scaler a chance to enable if it's on this pipe */ | 1335 | /* Give the overlay scaler a chance to enable if it's on this pipe */ |
| 1337 | //intel_crtc_dpms_video(crtc, true); TODO | 1336 | //intel_crtc_dpms_video(crtc, true); TODO |
| 1337 | intel_update_watermarks(dev); | ||
| 1338 | break; | 1338 | break; |
| 1339 | case DRM_MODE_DPMS_OFF: | 1339 | case DRM_MODE_DPMS_OFF: |
| 1340 | intel_update_watermarks(dev); | ||
| 1340 | /* Give the overlay scaler a chance to disable if it's on this pipe */ | 1341 | /* Give the overlay scaler a chance to disable if it's on this pipe */ |
| 1341 | //intel_crtc_dpms_video(crtc, FALSE); TODO | 1342 | //intel_crtc_dpms_video(crtc, FALSE); TODO |
| 1342 | 1343 | ||
| @@ -1515,7 +1516,6 @@ static int intel_get_core_clock_speed(struct drm_device *dev) | |||
| 1515 | return 0; /* Silence gcc warning */ | 1516 | return 0; /* Silence gcc warning */ |
| 1516 | } | 1517 | } |
| 1517 | 1518 | ||
| 1518 | |||
| 1519 | /** | 1519 | /** |
| 1520 | * Return the pipe currently connected to the panel fitter, | 1520 | * Return the pipe currently connected to the panel fitter, |
| 1521 | * or -1 if the panel fitter is not present or not in use | 1521 | * or -1 if the panel fitter is not present or not in use |
| @@ -1574,7 +1574,7 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes, | |||
| 1574 | 1574 | ||
| 1575 | temp = (u64) DATA_N * pixel_clock; | 1575 | temp = (u64) DATA_N * pixel_clock; |
| 1576 | temp = div_u64(temp, link_clock); | 1576 | temp = div_u64(temp, link_clock); |
| 1577 | m_n->gmch_m = (temp * bytes_per_pixel) / nlanes; | 1577 | m_n->gmch_m = div_u64(temp * bytes_per_pixel, nlanes); |
| 1578 | m_n->gmch_n = DATA_N; | 1578 | m_n->gmch_n = DATA_N; |
| 1579 | fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); | 1579 | fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); |
| 1580 | 1580 | ||
| @@ -1585,6 +1585,420 @@ igdng_compute_m_n(int bytes_per_pixel, int nlanes, | |||
| 1585 | } | 1585 | } |
| 1586 | 1586 | ||
| 1587 | 1587 | ||
| 1588 | struct intel_watermark_params { | ||
| 1589 | unsigned long fifo_size; | ||
| 1590 | unsigned long max_wm; | ||
| 1591 | unsigned long default_wm; | ||
| 1592 | unsigned long guard_size; | ||
| 1593 | unsigned long cacheline_size; | ||
| 1594 | }; | ||
| 1595 | |||
| 1596 | /* IGD has different values for various configs */ | ||
| 1597 | static struct intel_watermark_params igd_display_wm = { | ||
| 1598 | IGD_DISPLAY_FIFO, | ||
| 1599 | IGD_MAX_WM, | ||
| 1600 | IGD_DFT_WM, | ||
| 1601 | IGD_GUARD_WM, | ||
| 1602 | IGD_FIFO_LINE_SIZE | ||
| 1603 | }; | ||
| 1604 | static struct intel_watermark_params igd_display_hplloff_wm = { | ||
| 1605 | IGD_DISPLAY_FIFO, | ||
| 1606 | IGD_MAX_WM, | ||
| 1607 | IGD_DFT_HPLLOFF_WM, | ||
| 1608 | IGD_GUARD_WM, | ||
| 1609 | IGD_FIFO_LINE_SIZE | ||
| 1610 | }; | ||
| 1611 | static struct intel_watermark_params igd_cursor_wm = { | ||
| 1612 | IGD_CURSOR_FIFO, | ||
| 1613 | IGD_CURSOR_MAX_WM, | ||
| 1614 | IGD_CURSOR_DFT_WM, | ||
| 1615 | IGD_CURSOR_GUARD_WM, | ||
| 1616 | IGD_FIFO_LINE_SIZE, | ||
| 1617 | }; | ||
| 1618 | static struct intel_watermark_params igd_cursor_hplloff_wm = { | ||
| 1619 | IGD_CURSOR_FIFO, | ||
| 1620 | IGD_CURSOR_MAX_WM, | ||
| 1621 | IGD_CURSOR_DFT_WM, | ||
| 1622 | IGD_CURSOR_GUARD_WM, | ||
| 1623 | IGD_FIFO_LINE_SIZE | ||
| 1624 | }; | ||
| 1625 | static struct intel_watermark_params i945_wm_info = { | ||
| 1626 | I915_FIFO_LINE_SIZE, | ||
| 1627 | I915_MAX_WM, | ||
| 1628 | 1, | ||
| 1629 | 0, | ||
| 1630 | IGD_FIFO_LINE_SIZE | ||
| 1631 | }; | ||
| 1632 | static struct intel_watermark_params i915_wm_info = { | ||
| 1633 | I945_FIFO_SIZE, | ||
| 1634 | I915_MAX_WM, | ||
| 1635 | 1, | ||
| 1636 | 0, | ||
| 1637 | I915_FIFO_LINE_SIZE | ||
| 1638 | }; | ||
| 1639 | static struct intel_watermark_params i855_wm_info = { | ||
| 1640 | I855GM_FIFO_SIZE, | ||
| 1641 | I915_MAX_WM, | ||
| 1642 | 1, | ||
| 1643 | 0, | ||
| 1644 | I830_FIFO_LINE_SIZE | ||
| 1645 | }; | ||
| 1646 | static struct intel_watermark_params i830_wm_info = { | ||
| 1647 | I830_FIFO_SIZE, | ||
| 1648 | I915_MAX_WM, | ||
| 1649 | 1, | ||
| 1650 | 0, | ||
| 1651 | I830_FIFO_LINE_SIZE | ||
| 1652 | }; | ||
| 1653 | |||
| 1654 | static unsigned long intel_calculate_wm(unsigned long clock_in_khz, | ||
| 1655 | struct intel_watermark_params *wm, | ||
| 1656 | int pixel_size, | ||
| 1657 | unsigned long latency_ns) | ||
| 1658 | { | ||
| 1659 | unsigned long bytes_required, wm_size; | ||
| 1660 | |||
| 1661 | bytes_required = (clock_in_khz * pixel_size * latency_ns) / 1000000; | ||
| 1662 | bytes_required /= wm->cacheline_size; | ||
| 1663 | wm_size = wm->fifo_size - bytes_required - wm->guard_size; | ||
| 1664 | |||
| 1665 | if (wm_size > wm->max_wm) | ||
| 1666 | wm_size = wm->max_wm; | ||
| 1667 | if (wm_size == 0) | ||
| 1668 | wm_size = wm->default_wm; | ||
| 1669 | return wm_size; | ||
| 1670 | } | ||
| 1671 | |||
| 1672 | struct cxsr_latency { | ||
| 1673 | int is_desktop; | ||
| 1674 | unsigned long fsb_freq; | ||
| 1675 | unsigned long mem_freq; | ||
| 1676 | unsigned long display_sr; | ||
| 1677 | unsigned long display_hpll_disable; | ||
| 1678 | unsigned long cursor_sr; | ||
| 1679 | unsigned long cursor_hpll_disable; | ||
| 1680 | }; | ||
| 1681 | |||
| 1682 | static struct cxsr_latency cxsr_latency_table[] = { | ||
| 1683 | {1, 800, 400, 3382, 33382, 3983, 33983}, /* DDR2-400 SC */ | ||
| 1684 | {1, 800, 667, 3354, 33354, 3807, 33807}, /* DDR2-667 SC */ | ||
| 1685 | {1, 800, 800, 3347, 33347, 3763, 33763}, /* DDR2-800 SC */ | ||
| 1686 | |||
| 1687 | {1, 667, 400, 3400, 33400, 4021, 34021}, /* DDR2-400 SC */ | ||
| 1688 | {1, 667, 667, 3372, 33372, 3845, 33845}, /* DDR2-667 SC */ | ||
| 1689 | {1, 667, 800, 3386, 33386, 3822, 33822}, /* DDR2-800 SC */ | ||
| 1690 | |||
| 1691 | {1, 400, 400, 3472, 33472, 4173, 34173}, /* DDR2-400 SC */ | ||
| 1692 | {1, 400, 667, 3443, 33443, 3996, 33996}, /* DDR2-667 SC */ | ||
| 1693 | {1, 400, 800, 3430, 33430, 3946, 33946}, /* DDR2-800 SC */ | ||
| 1694 | |||
| 1695 | {0, 800, 400, 3438, 33438, 4065, 34065}, /* DDR2-400 SC */ | ||
| 1696 | {0, 800, 667, 3410, 33410, 3889, 33889}, /* DDR2-667 SC */ | ||
| 1697 | {0, 800, 800, 3403, 33403, 3845, 33845}, /* DDR2-800 SC */ | ||
| 1698 | |||
| 1699 | {0, 667, 400, 3456, 33456, 4103, 34106}, /* DDR2-400 SC */ | ||
| 1700 | {0, 667, 667, 3428, 33428, 3927, 33927}, /* DDR2-667 SC */ | ||
| 1701 | {0, 667, 800, 3443, 33443, 3905, 33905}, /* DDR2-800 SC */ | ||
| 1702 | |||
| 1703 | {0, 400, 400, 3528, 33528, 4255, 34255}, /* DDR2-400 SC */ | ||
| 1704 | {0, 400, 667, 3500, 33500, 4079, 34079}, /* DDR2-667 SC */ | ||
| 1705 | {0, 400, 800, 3487, 33487, 4029, 34029}, /* DDR2-800 SC */ | ||
| 1706 | }; | ||
| 1707 | |||
| 1708 | static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int fsb, | ||
| 1709 | int mem) | ||
| 1710 | { | ||
| 1711 | int i; | ||
| 1712 | struct cxsr_latency *latency; | ||
| 1713 | |||
| 1714 | if (fsb == 0 || mem == 0) | ||
| 1715 | return NULL; | ||
| 1716 | |||
| 1717 | for (i = 0; i < ARRAY_SIZE(cxsr_latency_table); i++) { | ||
| 1718 | latency = &cxsr_latency_table[i]; | ||
| 1719 | if (is_desktop == latency->is_desktop && | ||
| 1720 | fsb == latency->fsb_freq && mem == latency->mem_freq) | ||
| 1721 | break; | ||
| 1722 | } | ||
| 1723 | if (i >= ARRAY_SIZE(cxsr_latency_table)) { | ||
| 1724 | DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n"); | ||
| 1725 | return NULL; | ||
| 1726 | } | ||
| 1727 | return latency; | ||
| 1728 | } | ||
| 1729 | |||
| 1730 | static void igd_disable_cxsr(struct drm_device *dev) | ||
| 1731 | { | ||
| 1732 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1733 | u32 reg; | ||
| 1734 | |||
| 1735 | /* deactivate cxsr */ | ||
| 1736 | reg = I915_READ(DSPFW3); | ||
| 1737 | reg &= ~(IGD_SELF_REFRESH_EN); | ||
| 1738 | I915_WRITE(DSPFW3, reg); | ||
| 1739 | DRM_INFO("Big FIFO is disabled\n"); | ||
| 1740 | } | ||
| 1741 | |||
| 1742 | static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock, | ||
| 1743 | int pixel_size) | ||
| 1744 | { | ||
| 1745 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1746 | u32 reg; | ||
| 1747 | unsigned long wm; | ||
| 1748 | struct cxsr_latency *latency; | ||
| 1749 | |||
| 1750 | latency = intel_get_cxsr_latency(IS_IGDG(dev), dev_priv->fsb_freq, | ||
| 1751 | dev_priv->mem_freq); | ||
| 1752 | if (!latency) { | ||
| 1753 | DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n"); | ||
| 1754 | igd_disable_cxsr(dev); | ||
| 1755 | return; | ||
| 1756 | } | ||
| 1757 | |||
| 1758 | /* Display SR */ | ||
| 1759 | wm = intel_calculate_wm(clock, &igd_display_wm, pixel_size, | ||
| 1760 | latency->display_sr); | ||
| 1761 | reg = I915_READ(DSPFW1); | ||
| 1762 | reg &= 0x7fffff; | ||
| 1763 | reg |= wm << 23; | ||
| 1764 | I915_WRITE(DSPFW1, reg); | ||
| 1765 | DRM_DEBUG("DSPFW1 register is %x\n", reg); | ||
| 1766 | |||
| 1767 | /* cursor SR */ | ||
| 1768 | wm = intel_calculate_wm(clock, &igd_cursor_wm, pixel_size, | ||
| 1769 | latency->cursor_sr); | ||
| 1770 | reg = I915_READ(DSPFW3); | ||
| 1771 | reg &= ~(0x3f << 24); | ||
| 1772 | reg |= (wm & 0x3f) << 24; | ||
| 1773 | I915_WRITE(DSPFW3, reg); | ||
| 1774 | |||
| 1775 | /* Display HPLL off SR */ | ||
| 1776 | wm = intel_calculate_wm(clock, &igd_display_hplloff_wm, | ||
| 1777 | latency->display_hpll_disable, I915_FIFO_LINE_SIZE); | ||
| 1778 | reg = I915_READ(DSPFW3); | ||
| 1779 | reg &= 0xfffffe00; | ||
| 1780 | reg |= wm & 0x1ff; | ||
| 1781 | I915_WRITE(DSPFW3, reg); | ||
| 1782 | |||
| 1783 | /* cursor HPLL off SR */ | ||
| 1784 | wm = intel_calculate_wm(clock, &igd_cursor_hplloff_wm, pixel_size, | ||
| 1785 | latency->cursor_hpll_disable); | ||
| 1786 | reg = I915_READ(DSPFW3); | ||
| 1787 | reg &= ~(0x3f << 16); | ||
| 1788 | reg |= (wm & 0x3f) << 16; | ||
| 1789 | I915_WRITE(DSPFW3, reg); | ||
| 1790 | DRM_DEBUG("DSPFW3 register is %x\n", reg); | ||
| 1791 | |||
| 1792 | /* activate cxsr */ | ||
| 1793 | reg = I915_READ(DSPFW3); | ||
| 1794 | reg |= IGD_SELF_REFRESH_EN; | ||
| 1795 | I915_WRITE(DSPFW3, reg); | ||
| 1796 | |||
| 1797 | DRM_INFO("Big FIFO is enabled\n"); | ||
| 1798 | |||
| 1799 | return; | ||
| 1800 | } | ||
| 1801 | |||
| 1802 | const static int latency_ns = 5000; /* default for non-igd platforms */ | ||
| 1803 | |||
| 1804 | |||
| 1805 | static void i965_update_wm(struct drm_device *dev) | ||
| 1806 | { | ||
| 1807 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1808 | |||
| 1809 | DRM_DEBUG("Setting FIFO watermarks - A: 8, B: 8, C: 8, SR 8\n"); | ||
| 1810 | |||
| 1811 | /* 965 has limitations... */ | ||
| 1812 | I915_WRITE(DSPFW1, (8 << 16) | (8 << 8) | (8 << 0)); | ||
| 1813 | I915_WRITE(DSPFW2, (8 << 8) | (8 << 0)); | ||
| 1814 | } | ||
| 1815 | |||
| 1816 | static void i9xx_update_wm(struct drm_device *dev, int planea_clock, | ||
| 1817 | int planeb_clock, int sr_hdisplay, int pixel_size) | ||
| 1818 | { | ||
| 1819 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1820 | uint32_t fwater_lo = I915_READ(FW_BLC) & MM_FIFO_WATERMARK; | ||
| 1821 | uint32_t fwater_hi = I915_READ(FW_BLC2) & LM_FIFO_WATERMARK; | ||
| 1822 | int bsize, asize, cwm, bwm = 1, awm = 1, srwm = 1; | ||
| 1823 | uint32_t dsparb = I915_READ(DSPARB); | ||
| 1824 | int planea_entries, planeb_entries; | ||
| 1825 | struct intel_watermark_params *wm_params; | ||
| 1826 | unsigned long line_time_us; | ||
| 1827 | int sr_clock, sr_entries = 0; | ||
| 1828 | |||
| 1829 | if (IS_I965GM(dev) || IS_I945GM(dev)) | ||
| 1830 | wm_params = &i945_wm_info; | ||
| 1831 | else if (IS_I9XX(dev)) | ||
| 1832 | wm_params = &i915_wm_info; | ||
| 1833 | else | ||
| 1834 | wm_params = &i855_wm_info; | ||
| 1835 | |||
| 1836 | planea_entries = intel_calculate_wm(planea_clock, wm_params, | ||
| 1837 | pixel_size, latency_ns); | ||
| 1838 | planeb_entries = intel_calculate_wm(planeb_clock, wm_params, | ||
| 1839 | pixel_size, latency_ns); | ||
| 1840 | |||
| 1841 | DRM_DEBUG("FIFO entries - A: %d, B: %d\n", planea_entries, | ||
| 1842 | planeb_entries); | ||
| 1843 | |||
| 1844 | if (IS_I9XX(dev)) { | ||
| 1845 | asize = dsparb & 0x7f; | ||
| 1846 | bsize = (dsparb >> DSPARB_CSTART_SHIFT) & 0x7f; | ||
| 1847 | } else { | ||
| 1848 | asize = dsparb & 0x1ff; | ||
| 1849 | bsize = (dsparb >> DSPARB_BEND_SHIFT) & 0x1ff; | ||
| 1850 | } | ||
| 1851 | DRM_DEBUG("FIFO size - A: %d, B: %d\n", asize, bsize); | ||
| 1852 | |||
| 1853 | /* Two extra entries for padding */ | ||
| 1854 | awm = asize - (planea_entries + 2); | ||
| 1855 | bwm = bsize - (planeb_entries + 2); | ||
| 1856 | |||
| 1857 | /* Sanity check against potentially bad FIFO allocations */ | ||
| 1858 | if (awm <= 0) { | ||
| 1859 | /* pipe is on but has too few FIFO entries */ | ||
| 1860 | if (planea_entries != 0) | ||
| 1861 | DRM_DEBUG("plane A needs more FIFO entries\n"); | ||
| 1862 | awm = 1; | ||
| 1863 | } | ||
| 1864 | if (bwm <= 0) { | ||
| 1865 | if (planeb_entries != 0) | ||
| 1866 | DRM_DEBUG("plane B needs more FIFO entries\n"); | ||
| 1867 | bwm = 1; | ||
| 1868 | } | ||
| 1869 | |||
| 1870 | /* | ||
| 1871 | * Overlay gets an aggressive default since video jitter is bad. | ||
| 1872 | */ | ||
| 1873 | cwm = 2; | ||
| 1874 | |||
| 1875 | /* Calc sr entries for one pipe configs */ | ||
| 1876 | if (!planea_clock || !planeb_clock) { | ||
| 1877 | sr_clock = planea_clock ? planea_clock : planeb_clock; | ||
| 1878 | line_time_us = (sr_hdisplay * 1000) / sr_clock; | ||
| 1879 | sr_entries = (((latency_ns / line_time_us) + 1) * pixel_size * | ||
| 1880 | sr_hdisplay) / 1000; | ||
| 1881 | sr_entries = roundup(sr_entries / wm_params->cacheline_size, 1); | ||
| 1882 | if (sr_entries < wm_params->fifo_size) | ||
| 1883 | srwm = wm_params->fifo_size - sr_entries; | ||
| 1884 | } | ||
| 1885 | |||
| 1886 | DRM_DEBUG("Setting FIFO watermarks - A: %d, B: %d, C: %d, SR %d\n", | ||
| 1887 | awm, bwm, cwm, srwm); | ||
| 1888 | |||
| 1889 | fwater_lo = fwater_lo | ((bwm & 0x3f) << 16) | (awm & 0x3f); | ||
| 1890 | fwater_hi = fwater_hi | (cwm & 0x1f); | ||
| 1891 | |||
| 1892 | I915_WRITE(FW_BLC, fwater_lo); | ||
| 1893 | I915_WRITE(FW_BLC2, fwater_hi); | ||
| 1894 | if (IS_I9XX(dev)) | ||
| 1895 | I915_WRITE(FW_BLC_SELF, FW_BLC_SELF_EN | (srwm & 0x3f)); | ||
| 1896 | } | ||
| 1897 | |||
| 1898 | static void i830_update_wm(struct drm_device *dev, int planea_clock, | ||
| 1899 | int pixel_size) | ||
| 1900 | { | ||
| 1901 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1902 | uint32_t dsparb = I915_READ(DSPARB); | ||
| 1903 | uint32_t fwater_lo = I915_READ(FW_BLC) & MM_FIFO_WATERMARK; | ||
| 1904 | unsigned int asize, awm; | ||
| 1905 | int planea_entries; | ||
| 1906 | |||
| 1907 | planea_entries = intel_calculate_wm(planea_clock, &i830_wm_info, | ||
| 1908 | pixel_size, latency_ns); | ||
| 1909 | |||
| 1910 | asize = dsparb & 0x7f; | ||
| 1911 | |||
| 1912 | awm = asize - planea_entries; | ||
| 1913 | |||
| 1914 | fwater_lo = fwater_lo | awm; | ||
| 1915 | |||
| 1916 | I915_WRITE(FW_BLC, fwater_lo); | ||
| 1917 | } | ||
| 1918 | |||
| 1919 | /** | ||
| 1920 | * intel_update_watermarks - update FIFO watermark values based on current modes | ||
| 1921 | * | ||
| 1922 | * Calculate watermark values for the various WM regs based on current mode | ||
| 1923 | * and plane configuration. | ||
| 1924 | * | ||
| 1925 | * There are several cases to deal with here: | ||
| 1926 | * - normal (i.e. non-self-refresh) | ||
| 1927 | * - self-refresh (SR) mode | ||
| 1928 | * - lines are large relative to FIFO size (buffer can hold up to 2) | ||
| 1929 | * - lines are small relative to FIFO size (buffer can hold more than 2 | ||
| 1930 | * lines), so need to account for TLB latency | ||
| 1931 | * | ||
| 1932 | * The normal calculation is: | ||
| 1933 | * watermark = dotclock * bytes per pixel * latency | ||
| 1934 | * where latency is platform & configuration dependent (we assume pessimal | ||
| 1935 | * values here). | ||
| 1936 | * | ||
| 1937 | * The SR calculation is: | ||
| 1938 | * watermark = (trunc(latency/line time)+1) * surface width * | ||
| 1939 | * bytes per pixel | ||
| 1940 | * where | ||
| 1941 | * line time = htotal / dotclock | ||
| 1942 | * and latency is assumed to be high, as above. | ||
| 1943 | * | ||
| 1944 | * The final value programmed to the register should always be rounded up, | ||
| 1945 | * and include an extra 2 entries to account for clock crossings. | ||
| 1946 | * | ||
| 1947 | * We don't use the sprite, so we can ignore that. And on Crestline we have | ||
| 1948 | * to set the non-SR watermarks to 8. | ||
| 1949 | */ | ||
| 1950 | static void intel_update_watermarks(struct drm_device *dev) | ||
| 1951 | { | ||
| 1952 | struct drm_crtc *crtc; | ||
| 1953 | struct intel_crtc *intel_crtc; | ||
| 1954 | int sr_hdisplay = 0; | ||
| 1955 | unsigned long planea_clock = 0, planeb_clock = 0, sr_clock = 0; | ||
| 1956 | int enabled = 0, pixel_size = 0; | ||
| 1957 | |||
| 1958 | if (DSPARB_HWCONTROL(dev)) | ||
| 1959 | return; | ||
| 1960 | |||
| 1961 | /* Get the clock config from both planes */ | ||
| 1962 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | ||
| 1963 | intel_crtc = to_intel_crtc(crtc); | ||
| 1964 | if (crtc->enabled) { | ||
| 1965 | enabled++; | ||
| 1966 | if (intel_crtc->plane == 0) { | ||
| 1967 | DRM_DEBUG("plane A (pipe %d) clock: %d\n", | ||
| 1968 | intel_crtc->pipe, crtc->mode.clock); | ||
| 1969 | planea_clock = crtc->mode.clock; | ||
| 1970 | } else { | ||
| 1971 | DRM_DEBUG("plane B (pipe %d) clock: %d\n", | ||
| 1972 | intel_crtc->pipe, crtc->mode.clock); | ||
| 1973 | planeb_clock = crtc->mode.clock; | ||
| 1974 | } | ||
| 1975 | sr_hdisplay = crtc->mode.hdisplay; | ||
| 1976 | sr_clock = crtc->mode.clock; | ||
| 1977 | if (crtc->fb) | ||
| 1978 | pixel_size = crtc->fb->bits_per_pixel / 8; | ||
| 1979 | else | ||
| 1980 | pixel_size = 4; /* by default */ | ||
| 1981 | } | ||
| 1982 | } | ||
| 1983 | |||
| 1984 | if (enabled <= 0) | ||
| 1985 | return; | ||
| 1986 | |||
| 1987 | /* Single pipe configs can enable self refresh */ | ||
| 1988 | if (enabled == 1 && IS_IGD(dev)) | ||
| 1989 | igd_enable_cxsr(dev, sr_clock, pixel_size); | ||
| 1990 | else if (IS_IGD(dev)) | ||
| 1991 | igd_disable_cxsr(dev); | ||
| 1992 | |||
| 1993 | if (IS_I965G(dev)) | ||
| 1994 | i965_update_wm(dev); | ||
| 1995 | else if (IS_I9XX(dev) || IS_MOBILE(dev)) | ||
| 1996 | i9xx_update_wm(dev, planea_clock, planeb_clock, sr_hdisplay, | ||
| 1997 | pixel_size); | ||
| 1998 | else | ||
| 1999 | i830_update_wm(dev, planea_clock, pixel_size); | ||
| 2000 | } | ||
| 2001 | |||
| 1588 | static int intel_crtc_mode_set(struct drm_crtc *crtc, | 2002 | static int intel_crtc_mode_set(struct drm_crtc *crtc, |
| 1589 | struct drm_display_mode *mode, | 2003 | struct drm_display_mode *mode, |
| 1590 | struct drm_display_mode *adjusted_mode, | 2004 | struct drm_display_mode *adjusted_mode, |
| @@ -1951,6 +2365,9 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 1951 | 2365 | ||
| 1952 | /* Flush the plane changes */ | 2366 | /* Flush the plane changes */ |
| 1953 | ret = intel_pipe_set_base(crtc, x, y, old_fb); | 2367 | ret = intel_pipe_set_base(crtc, x, y, old_fb); |
| 2368 | |||
| 2369 | intel_update_watermarks(dev); | ||
| 2370 | |||
| 1954 | drm_vblank_post_modeset(dev, pipe); | 2371 | drm_vblank_post_modeset(dev, pipe); |
| 1955 | 2372 | ||
| 1956 | return ret; | 2373 | return ret; |
| @@ -2439,6 +2856,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) | |||
| 2439 | 2856 | ||
| 2440 | drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256); | 2857 | drm_mode_crtc_set_gamma_size(&intel_crtc->base, 256); |
| 2441 | intel_crtc->pipe = pipe; | 2858 | intel_crtc->pipe = pipe; |
| 2859 | intel_crtc->plane = pipe; | ||
| 2442 | for (i = 0; i < 256; i++) { | 2860 | for (i = 0; i < 256; i++) { |
| 2443 | intel_crtc->lut_r[i] = i; | 2861 | intel_crtc->lut_r[i] = i; |
| 2444 | intel_crtc->lut_g[i] = i; | 2862 | intel_crtc->lut_g[i] = i; |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 8f8d37d5663a..6770ae88370d 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -246,7 +246,7 @@ intel_dp_aux_ch(struct intel_output *intel_output, | |||
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | if ((status & DP_AUX_CH_CTL_DONE) == 0) { | 248 | if ((status & DP_AUX_CH_CTL_DONE) == 0) { |
| 249 | printk(KERN_ERR "dp_aux_ch not done status 0x%08x\n", status); | 249 | DRM_ERROR("dp_aux_ch not done status 0x%08x\n", status); |
| 250 | return -EBUSY; | 250 | return -EBUSY; |
| 251 | } | 251 | } |
| 252 | 252 | ||
| @@ -254,11 +254,14 @@ intel_dp_aux_ch(struct intel_output *intel_output, | |||
| 254 | * Timeouts occur when the sink is not connected | 254 | * Timeouts occur when the sink is not connected |
| 255 | */ | 255 | */ |
| 256 | if (status & DP_AUX_CH_CTL_RECEIVE_ERROR) { | 256 | if (status & DP_AUX_CH_CTL_RECEIVE_ERROR) { |
| 257 | printk(KERN_ERR "dp_aux_ch receive error status 0x%08x\n", status); | 257 | DRM_ERROR("dp_aux_ch receive error status 0x%08x\n", status); |
| 258 | return -EIO; | 258 | return -EIO; |
| 259 | } | 259 | } |
| 260 | |||
| 261 | /* Timeouts occur when the device isn't connected, so they're | ||
| 262 | * "normal" -- don't fill the kernel log with these */ | ||
| 260 | if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR) { | 263 | if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR) { |
| 261 | printk(KERN_ERR "dp_aux_ch timeout status 0x%08x\n", status); | 264 | DRM_DEBUG("dp_aux_ch timeout status 0x%08x\n", status); |
| 262 | return -ETIMEDOUT; | 265 | return -ETIMEDOUT; |
| 263 | } | 266 | } |
| 264 | 267 | ||
| @@ -411,7 +414,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 411 | dp_priv->link_bw = bws[clock]; | 414 | dp_priv->link_bw = bws[clock]; |
| 412 | dp_priv->lane_count = lane_count; | 415 | dp_priv->lane_count = lane_count; |
| 413 | adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw); | 416 | adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw); |
| 414 | printk(KERN_ERR "link bw %02x lane count %d clock %d\n", | 417 | DRM_DEBUG("Display port link bw %02x lane count %d clock %d\n", |
| 415 | dp_priv->link_bw, dp_priv->lane_count, | 418 | dp_priv->link_bw, dp_priv->lane_count, |
| 416 | adjusted_mode->clock); | 419 | adjusted_mode->clock); |
| 417 | return true; | 420 | return true; |
diff --git a/drivers/gpu/drm/i915/intel_dp_i2c.c b/drivers/gpu/drm/i915/intel_dp_i2c.c index 4e60f14b1a6d..a63b6f57d2d4 100644 --- a/drivers/gpu/drm/i915/intel_dp_i2c.c +++ b/drivers/gpu/drm/i915/intel_dp_i2c.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/sched.h> | 29 | #include <linux/sched.h> |
| 30 | #include <linux/i2c.h> | 30 | #include <linux/i2c.h> |
| 31 | #include "intel_dp.h" | 31 | #include "intel_dp.h" |
| 32 | #include "drmP.h" | ||
| 32 | 33 | ||
| 33 | /* Run a single AUX_CH I2C transaction, writing/reading data as necessary */ | 34 | /* Run a single AUX_CH I2C transaction, writing/reading data as necessary */ |
| 34 | 35 | ||
| @@ -84,7 +85,7 @@ i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode, | |||
| 84 | msg, msg_bytes, | 85 | msg, msg_bytes, |
| 85 | reply, reply_bytes); | 86 | reply, reply_bytes); |
| 86 | if (ret < 0) { | 87 | if (ret < 0) { |
| 87 | printk(KERN_ERR "aux_ch failed %d\n", ret); | 88 | DRM_DEBUG("aux_ch failed %d\n", ret); |
| 88 | return ret; | 89 | return ret; |
| 89 | } | 90 | } |
| 90 | switch (reply[0] & AUX_I2C_REPLY_MASK) { | 91 | switch (reply[0] & AUX_I2C_REPLY_MASK) { |
| @@ -94,14 +95,14 @@ i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode, | |||
| 94 | } | 95 | } |
| 95 | return reply_bytes - 1; | 96 | return reply_bytes - 1; |
| 96 | case AUX_I2C_REPLY_NACK: | 97 | case AUX_I2C_REPLY_NACK: |
| 97 | printk(KERN_ERR "aux_ch nack\n"); | 98 | DRM_DEBUG("aux_ch nack\n"); |
| 98 | return -EREMOTEIO; | 99 | return -EREMOTEIO; |
| 99 | case AUX_I2C_REPLY_DEFER: | 100 | case AUX_I2C_REPLY_DEFER: |
| 100 | printk(KERN_ERR "aux_ch defer\n"); | 101 | DRM_DEBUG("aux_ch defer\n"); |
| 101 | udelay(100); | 102 | udelay(100); |
| 102 | break; | 103 | break; |
| 103 | default: | 104 | default: |
| 104 | printk(KERN_ERR "aux_ch invalid reply 0x%02x\n", reply[0]); | 105 | DRM_ERROR("aux_ch invalid reply 0x%02x\n", reply[0]); |
| 105 | return -EREMOTEIO; | 106 | return -EREMOTEIO; |
| 106 | } | 107 | } |
| 107 | } | 108 | } |
| @@ -223,7 +224,7 @@ i2c_algo_dp_aux_xfer(struct i2c_adapter *adapter, | |||
| 223 | if (ret >= 0) | 224 | if (ret >= 0) |
| 224 | ret = num; | 225 | ret = num; |
| 225 | i2c_algo_dp_aux_stop(adapter, reading); | 226 | i2c_algo_dp_aux_stop(adapter, reading); |
| 226 | printk(KERN_ERR "dp_aux_xfer return %d\n", ret); | 227 | DRM_DEBUG("dp_aux_xfer return %d\n", ret); |
| 227 | return ret; | 228 | return ret; |
| 228 | } | 229 | } |
| 229 | 230 | ||
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 1af7d68e3807..1d30802e773e 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c | |||
| @@ -453,7 +453,7 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width, | |||
| 453 | size = ALIGN(size, PAGE_SIZE); | 453 | size = ALIGN(size, PAGE_SIZE); |
| 454 | fbo = drm_gem_object_alloc(dev, size); | 454 | fbo = drm_gem_object_alloc(dev, size); |
| 455 | if (!fbo) { | 455 | if (!fbo) { |
| 456 | printk(KERN_ERR "failed to allocate framebuffer\n"); | 456 | DRM_ERROR("failed to allocate framebuffer\n"); |
| 457 | ret = -ENOMEM; | 457 | ret = -ENOMEM; |
| 458 | goto out; | 458 | goto out; |
| 459 | } | 459 | } |
| @@ -610,8 +610,8 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width, | |||
| 610 | par->dev = dev; | 610 | par->dev = dev; |
| 611 | 611 | ||
| 612 | /* To allow resizeing without swapping buffers */ | 612 | /* To allow resizeing without swapping buffers */ |
| 613 | printk("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width, | 613 | DRM_DEBUG("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width, |
| 614 | intel_fb->base.height, obj_priv->gtt_offset, fbo); | 614 | intel_fb->base.height, obj_priv->gtt_offset, fbo); |
| 615 | 615 | ||
| 616 | mutex_unlock(&dev->struct_mutex); | 616 | mutex_unlock(&dev->struct_mutex); |
| 617 | return 0; | 617 | return 0; |
| @@ -698,13 +698,13 @@ static int intelfb_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc * | |||
| 698 | } else | 698 | } else |
| 699 | intelfb_set_par(info); | 699 | intelfb_set_par(info); |
| 700 | 700 | ||
| 701 | printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, | 701 | DRM_INFO("fb%d: %s frame buffer device\n", info->node, |
| 702 | info->fix.id); | 702 | info->fix.id); |
| 703 | 703 | ||
| 704 | /* Switch back to kernel console on panic */ | 704 | /* Switch back to kernel console on panic */ |
| 705 | kernelfb_mode = *modeset; | 705 | kernelfb_mode = *modeset; |
| 706 | atomic_notifier_chain_register(&panic_notifier_list, &paniced); | 706 | atomic_notifier_chain_register(&panic_notifier_list, &paniced); |
| 707 | printk(KERN_INFO "registered panic notifier\n"); | 707 | DRM_DEBUG("registered panic notifier\n"); |
| 708 | 708 | ||
| 709 | return 0; | 709 | return 0; |
| 710 | } | 710 | } |
| @@ -852,13 +852,13 @@ static int intelfb_single_fb_probe(struct drm_device *dev) | |||
| 852 | } else | 852 | } else |
| 853 | intelfb_set_par(info); | 853 | intelfb_set_par(info); |
| 854 | 854 | ||
| 855 | printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, | 855 | DRM_INFO("fb%d: %s frame buffer device\n", info->node, |
| 856 | info->fix.id); | 856 | info->fix.id); |
| 857 | 857 | ||
| 858 | /* Switch back to kernel console on panic */ | 858 | /* Switch back to kernel console on panic */ |
| 859 | kernelfb_mode = *modeset; | 859 | kernelfb_mode = *modeset; |
| 860 | atomic_notifier_chain_register(&panic_notifier_list, &paniced); | 860 | atomic_notifier_chain_register(&panic_notifier_list, &paniced); |
| 861 | printk(KERN_INFO "registered panic notifier\n"); | 861 | DRM_DEBUG("registered panic notifier\n"); |
| 862 | 862 | ||
| 863 | return 0; | 863 | return 0; |
| 864 | } | 864 | } |
| @@ -872,8 +872,8 @@ void intelfb_restore(void) | |||
| 872 | { | 872 | { |
| 873 | int ret; | 873 | int ret; |
| 874 | if ((ret = drm_crtc_helper_set_config(&kernelfb_mode)) != 0) { | 874 | if ((ret = drm_crtc_helper_set_config(&kernelfb_mode)) != 0) { |
| 875 | printk(KERN_ERR "Failed to restore crtc configuration: %d\n", | 875 | DRM_ERROR("Failed to restore crtc configuration: %d\n", |
| 876 | ret); | 876 | ret); |
| 877 | } | 877 | } |
| 878 | } | 878 | } |
| 879 | 879 | ||
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 9564ca44a977..9ab38efffecf 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include "intel_drv.h" | 36 | #include "intel_drv.h" |
| 37 | #include "i915_drm.h" | 37 | #include "i915_drm.h" |
| 38 | #include "i915_drv.h" | 38 | #include "i915_drv.h" |
| 39 | #include <linux/acpi.h> | ||
| 39 | 40 | ||
| 40 | #define I915_LVDS "i915_lvds" | 41 | #define I915_LVDS "i915_lvds" |
| 41 | 42 | ||
| @@ -252,14 +253,14 @@ static bool intel_lvds_mode_fixup(struct drm_encoder *encoder, | |||
| 252 | 253 | ||
| 253 | /* Should never happen!! */ | 254 | /* Should never happen!! */ |
| 254 | if (!IS_I965G(dev) && intel_crtc->pipe == 0) { | 255 | if (!IS_I965G(dev) && intel_crtc->pipe == 0) { |
| 255 | printk(KERN_ERR "Can't support LVDS on pipe A\n"); | 256 | DRM_ERROR("Can't support LVDS on pipe A\n"); |
| 256 | return false; | 257 | return false; |
| 257 | } | 258 | } |
| 258 | 259 | ||
| 259 | /* Should never happen!! */ | 260 | /* Should never happen!! */ |
| 260 | list_for_each_entry(tmp_encoder, &dev->mode_config.encoder_list, head) { | 261 | list_for_each_entry(tmp_encoder, &dev->mode_config.encoder_list, head) { |
| 261 | if (tmp_encoder != encoder && tmp_encoder->crtc == encoder->crtc) { | 262 | if (tmp_encoder != encoder && tmp_encoder->crtc == encoder->crtc) { |
| 262 | printk(KERN_ERR "Can't enable LVDS and another " | 263 | DRM_ERROR("Can't enable LVDS and another " |
| 263 | "encoder on the same pipe\n"); | 264 | "encoder on the same pipe\n"); |
| 264 | return false; | 265 | return false; |
| 265 | } | 266 | } |
| @@ -788,6 +789,65 @@ static const struct dmi_system_id intel_no_lvds[] = { | |||
| 788 | { } /* terminating entry */ | 789 | { } /* terminating entry */ |
| 789 | }; | 790 | }; |
| 790 | 791 | ||
| 792 | #ifdef CONFIG_ACPI | ||
| 793 | /* | ||
| 794 | * check_lid_device -- check whether @handle is an ACPI LID device. | ||
| 795 | * @handle: ACPI device handle | ||
| 796 | * @level : depth in the ACPI namespace tree | ||
| 797 | * @context: the number of LID device when we find the device | ||
| 798 | * @rv: a return value to fill if desired (Not use) | ||
| 799 | */ | ||
| 800 | static acpi_status | ||
| 801 | check_lid_device(acpi_handle handle, u32 level, void *context, | ||
| 802 | void **return_value) | ||
| 803 | { | ||
| 804 | struct acpi_device *acpi_dev; | ||
| 805 | int *lid_present = context; | ||
| 806 | |||
| 807 | acpi_dev = NULL; | ||
| 808 | /* Get the acpi device for device handle */ | ||
| 809 | if (acpi_bus_get_device(handle, &acpi_dev) || !acpi_dev) { | ||
| 810 | /* If there is no ACPI device for handle, return */ | ||
| 811 | return AE_OK; | ||
| 812 | } | ||
| 813 | |||
| 814 | if (!strncmp(acpi_device_hid(acpi_dev), "PNP0C0D", 7)) | ||
| 815 | *lid_present = 1; | ||
| 816 | |||
| 817 | return AE_OK; | ||
| 818 | } | ||
| 819 | |||
| 820 | /** | ||
| 821 | * check whether there exists the ACPI LID device by enumerating the ACPI | ||
| 822 | * device tree. | ||
| 823 | */ | ||
| 824 | static int intel_lid_present(void) | ||
| 825 | { | ||
| 826 | int lid_present = 0; | ||
| 827 | |||
| 828 | if (acpi_disabled) { | ||
| 829 | /* If ACPI is disabled, there is no ACPI device tree to | ||
| 830 | * check, so assume the LID device would have been present. | ||
| 831 | */ | ||
| 832 | return 1; | ||
| 833 | } | ||
| 834 | |||
| 835 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, | ||
| 836 | ACPI_UINT32_MAX, | ||
| 837 | check_lid_device, &lid_present, NULL); | ||
| 838 | |||
| 839 | return lid_present; | ||
| 840 | } | ||
| 841 | #else | ||
| 842 | static int intel_lid_present(void) | ||
| 843 | { | ||
| 844 | /* In the absence of ACPI built in, assume that the LID device would | ||
| 845 | * have been present. | ||
| 846 | */ | ||
| 847 | return 1; | ||
| 848 | } | ||
| 849 | #endif | ||
| 850 | |||
| 791 | /** | 851 | /** |
| 792 | * intel_lvds_init - setup LVDS connectors on this device | 852 | * intel_lvds_init - setup LVDS connectors on this device |
| 793 | * @dev: drm device | 853 | * @dev: drm device |
| @@ -811,6 +871,16 @@ void intel_lvds_init(struct drm_device *dev) | |||
| 811 | if (dmi_check_system(intel_no_lvds)) | 871 | if (dmi_check_system(intel_no_lvds)) |
| 812 | return; | 872 | return; |
| 813 | 873 | ||
| 874 | /* Assume that any device without an ACPI LID device also doesn't | ||
| 875 | * have an integrated LVDS. We would be better off parsing the BIOS | ||
| 876 | * to get a reliable indicator, but that code isn't written yet. | ||
| 877 | * | ||
| 878 | * In the case of all-in-one desktops using LVDS that we've seen, | ||
| 879 | * they're using SDVO LVDS. | ||
| 880 | */ | ||
| 881 | if (!intel_lid_present()) | ||
| 882 | return; | ||
| 883 | |||
| 814 | if (IS_IGDNG(dev)) { | 884 | if (IS_IGDNG(dev)) { |
| 815 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) | 885 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) |
| 816 | return; | 886 | return; |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index f03473779feb..4f0c30948bc4 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -68,12 +68,23 @@ struct intel_sdvo_priv { | |||
| 68 | * This is set if we treat the device as HDMI, instead of DVI. | 68 | * This is set if we treat the device as HDMI, instead of DVI. |
| 69 | */ | 69 | */ |
| 70 | bool is_hdmi; | 70 | bool is_hdmi; |
| 71 | |||
| 71 | /** | 72 | /** |
| 72 | * This is set if we detect output of sdvo device as LVDS. | 73 | * This is set if we detect output of sdvo device as LVDS. |
| 73 | */ | 74 | */ |
| 74 | bool is_lvds; | 75 | bool is_lvds; |
| 75 | 76 | ||
| 76 | /** | 77 | /** |
| 78 | * This is sdvo flags for input timing. | ||
| 79 | */ | ||
| 80 | uint8_t sdvo_flags; | ||
| 81 | |||
| 82 | /** | ||
| 83 | * This is sdvo fixed pannel mode pointer | ||
| 84 | */ | ||
| 85 | struct drm_display_mode *sdvo_lvds_fixed_mode; | ||
| 86 | |||
| 87 | /** | ||
| 77 | * Returned SDTV resolutions allowed for the current format, if the | 88 | * Returned SDTV resolutions allowed for the current format, if the |
| 78 | * device reported it. | 89 | * device reported it. |
| 79 | */ | 90 | */ |
| @@ -592,6 +603,7 @@ intel_sdvo_create_preferred_input_timing(struct intel_output *output, | |||
| 592 | uint16_t height) | 603 | uint16_t height) |
| 593 | { | 604 | { |
| 594 | struct intel_sdvo_preferred_input_timing_args args; | 605 | struct intel_sdvo_preferred_input_timing_args args; |
| 606 | struct intel_sdvo_priv *sdvo_priv = output->dev_priv; | ||
| 595 | uint8_t status; | 607 | uint8_t status; |
| 596 | 608 | ||
| 597 | memset(&args, 0, sizeof(args)); | 609 | memset(&args, 0, sizeof(args)); |
| @@ -599,7 +611,12 @@ intel_sdvo_create_preferred_input_timing(struct intel_output *output, | |||
| 599 | args.width = width; | 611 | args.width = width; |
| 600 | args.height = height; | 612 | args.height = height; |
| 601 | args.interlace = 0; | 613 | args.interlace = 0; |
| 602 | args.scaled = 0; | 614 | |
| 615 | if (sdvo_priv->is_lvds && | ||
| 616 | (sdvo_priv->sdvo_lvds_fixed_mode->hdisplay != width || | ||
| 617 | sdvo_priv->sdvo_lvds_fixed_mode->vdisplay != height)) | ||
| 618 | args.scaled = 1; | ||
| 619 | |||
| 603 | intel_sdvo_write_cmd(output, SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING, | 620 | intel_sdvo_write_cmd(output, SDVO_CMD_CREATE_PREFERRED_INPUT_TIMING, |
| 604 | &args, sizeof(args)); | 621 | &args, sizeof(args)); |
| 605 | status = intel_sdvo_read_response(output, NULL, 0); | 622 | status = intel_sdvo_read_response(output, NULL, 0); |
| @@ -944,12 +961,7 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, | |||
| 944 | struct intel_output *output = enc_to_intel_output(encoder); | 961 | struct intel_output *output = enc_to_intel_output(encoder); |
| 945 | struct intel_sdvo_priv *dev_priv = output->dev_priv; | 962 | struct intel_sdvo_priv *dev_priv = output->dev_priv; |
| 946 | 963 | ||
| 947 | if (!dev_priv->is_tv) { | 964 | if (dev_priv->is_tv) { |
| 948 | /* Make the CRTC code factor in the SDVO pixel multiplier. The | ||
| 949 | * SDVO device will be told of the multiplier during mode_set. | ||
| 950 | */ | ||
| 951 | adjusted_mode->clock *= intel_sdvo_get_pixel_multiplier(mode); | ||
| 952 | } else { | ||
| 953 | struct intel_sdvo_dtd output_dtd; | 965 | struct intel_sdvo_dtd output_dtd; |
| 954 | bool success; | 966 | bool success; |
| 955 | 967 | ||
| @@ -980,6 +992,47 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, | |||
| 980 | intel_sdvo_get_preferred_input_timing(output, | 992 | intel_sdvo_get_preferred_input_timing(output, |
| 981 | &input_dtd); | 993 | &input_dtd); |
| 982 | intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd); | 994 | intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd); |
| 995 | dev_priv->sdvo_flags = input_dtd.part2.sdvo_flags; | ||
| 996 | |||
| 997 | drm_mode_set_crtcinfo(adjusted_mode, 0); | ||
| 998 | |||
| 999 | mode->clock = adjusted_mode->clock; | ||
| 1000 | |||
| 1001 | adjusted_mode->clock *= | ||
| 1002 | intel_sdvo_get_pixel_multiplier(mode); | ||
| 1003 | } else { | ||
| 1004 | return false; | ||
| 1005 | } | ||
| 1006 | } else if (dev_priv->is_lvds) { | ||
| 1007 | struct intel_sdvo_dtd output_dtd; | ||
| 1008 | bool success; | ||
| 1009 | |||
| 1010 | drm_mode_set_crtcinfo(dev_priv->sdvo_lvds_fixed_mode, 0); | ||
| 1011 | /* Set output timings */ | ||
| 1012 | intel_sdvo_get_dtd_from_mode(&output_dtd, | ||
| 1013 | dev_priv->sdvo_lvds_fixed_mode); | ||
| 1014 | |||
| 1015 | intel_sdvo_set_target_output(output, | ||
| 1016 | dev_priv->controlled_output); | ||
| 1017 | intel_sdvo_set_output_timing(output, &output_dtd); | ||
| 1018 | |||
| 1019 | /* Set the input timing to the screen. Assume always input 0. */ | ||
| 1020 | intel_sdvo_set_target_input(output, true, false); | ||
| 1021 | |||
| 1022 | |||
| 1023 | success = intel_sdvo_create_preferred_input_timing( | ||
| 1024 | output, | ||
| 1025 | mode->clock / 10, | ||
| 1026 | mode->hdisplay, | ||
| 1027 | mode->vdisplay); | ||
| 1028 | |||
| 1029 | if (success) { | ||
| 1030 | struct intel_sdvo_dtd input_dtd; | ||
| 1031 | |||
| 1032 | intel_sdvo_get_preferred_input_timing(output, | ||
| 1033 | &input_dtd); | ||
| 1034 | intel_sdvo_get_mode_from_dtd(adjusted_mode, &input_dtd); | ||
| 1035 | dev_priv->sdvo_flags = input_dtd.part2.sdvo_flags; | ||
| 983 | 1036 | ||
| 984 | drm_mode_set_crtcinfo(adjusted_mode, 0); | 1037 | drm_mode_set_crtcinfo(adjusted_mode, 0); |
| 985 | 1038 | ||
| @@ -990,6 +1043,12 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, | |||
| 990 | } else { | 1043 | } else { |
| 991 | return false; | 1044 | return false; |
| 992 | } | 1045 | } |
| 1046 | |||
| 1047 | } else { | ||
| 1048 | /* Make the CRTC code factor in the SDVO pixel multiplier. The | ||
| 1049 | * SDVO device will be told of the multiplier during mode_set. | ||
| 1050 | */ | ||
| 1051 | adjusted_mode->clock *= intel_sdvo_get_pixel_multiplier(mode); | ||
| 993 | } | 1052 | } |
| 994 | return true; | 1053 | return true; |
| 995 | } | 1054 | } |
| @@ -1033,15 +1092,16 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1033 | 1092 | ||
| 1034 | /* We have tried to get input timing in mode_fixup, and filled into | 1093 | /* We have tried to get input timing in mode_fixup, and filled into |
| 1035 | adjusted_mode */ | 1094 | adjusted_mode */ |
| 1036 | if (sdvo_priv->is_tv) | 1095 | if (sdvo_priv->is_tv || sdvo_priv->is_lvds) { |
| 1037 | intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); | 1096 | intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); |
| 1038 | else | 1097 | input_dtd.part2.sdvo_flags = sdvo_priv->sdvo_flags; |
| 1098 | } else | ||
| 1039 | intel_sdvo_get_dtd_from_mode(&input_dtd, mode); | 1099 | intel_sdvo_get_dtd_from_mode(&input_dtd, mode); |
| 1040 | 1100 | ||
| 1041 | /* If it's a TV, we already set the output timing in mode_fixup. | 1101 | /* If it's a TV, we already set the output timing in mode_fixup. |
| 1042 | * Otherwise, the output timing is equal to the input timing. | 1102 | * Otherwise, the output timing is equal to the input timing. |
| 1043 | */ | 1103 | */ |
| 1044 | if (!sdvo_priv->is_tv) { | 1104 | if (!sdvo_priv->is_tv && !sdvo_priv->is_lvds) { |
| 1045 | /* Set the output timing to the screen */ | 1105 | /* Set the output timing to the screen */ |
| 1046 | intel_sdvo_set_target_output(output, | 1106 | intel_sdvo_set_target_output(output, |
| 1047 | sdvo_priv->controlled_output); | 1107 | sdvo_priv->controlled_output); |
| @@ -1116,6 +1176,8 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1116 | sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT; | 1176 | sdvox |= (sdvo_pixel_multiply - 1) << SDVO_PORT_MULTIPLY_SHIFT; |
| 1117 | } | 1177 | } |
| 1118 | 1178 | ||
| 1179 | if (sdvo_priv->sdvo_flags & SDVO_NEED_TO_STALL) | ||
| 1180 | sdvox |= SDVO_STALL_SELECT; | ||
| 1119 | intel_sdvo_write_sdvox(output, sdvox); | 1181 | intel_sdvo_write_sdvox(output, sdvox); |
| 1120 | } | 1182 | } |
| 1121 | 1183 | ||
| @@ -1276,6 +1338,17 @@ static int intel_sdvo_mode_valid(struct drm_connector *connector, | |||
| 1276 | if (sdvo_priv->pixel_clock_max < mode->clock) | 1338 | if (sdvo_priv->pixel_clock_max < mode->clock) |
| 1277 | return MODE_CLOCK_HIGH; | 1339 | return MODE_CLOCK_HIGH; |
| 1278 | 1340 | ||
| 1341 | if (sdvo_priv->is_lvds == true) { | ||
| 1342 | if (sdvo_priv->sdvo_lvds_fixed_mode == NULL) | ||
| 1343 | return MODE_PANEL; | ||
| 1344 | |||
| 1345 | if (mode->hdisplay > sdvo_priv->sdvo_lvds_fixed_mode->hdisplay) | ||
| 1346 | return MODE_PANEL; | ||
| 1347 | |||
| 1348 | if (mode->vdisplay > sdvo_priv->sdvo_lvds_fixed_mode->vdisplay) | ||
| 1349 | return MODE_PANEL; | ||
| 1350 | } | ||
| 1351 | |||
| 1279 | return MODE_OK; | 1352 | return MODE_OK; |
| 1280 | } | 1353 | } |
| 1281 | 1354 | ||
| @@ -1549,6 +1622,8 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) | |||
| 1549 | { | 1622 | { |
| 1550 | struct intel_output *intel_output = to_intel_output(connector); | 1623 | struct intel_output *intel_output = to_intel_output(connector); |
| 1551 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | 1624 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |
| 1625 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
| 1626 | struct drm_display_mode *newmode; | ||
| 1552 | 1627 | ||
| 1553 | /* | 1628 | /* |
| 1554 | * Attempt to get the mode list from DDC. | 1629 | * Attempt to get the mode list from DDC. |
| @@ -1557,11 +1632,10 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) | |||
| 1557 | */ | 1632 | */ |
| 1558 | intel_ddc_get_modes(intel_output); | 1633 | intel_ddc_get_modes(intel_output); |
| 1559 | if (list_empty(&connector->probed_modes) == false) | 1634 | if (list_empty(&connector->probed_modes) == false) |
| 1560 | return; | 1635 | goto end; |
| 1561 | 1636 | ||
| 1562 | /* Fetch modes from VBT */ | 1637 | /* Fetch modes from VBT */ |
| 1563 | if (dev_priv->sdvo_lvds_vbt_mode != NULL) { | 1638 | if (dev_priv->sdvo_lvds_vbt_mode != NULL) { |
| 1564 | struct drm_display_mode *newmode; | ||
| 1565 | newmode = drm_mode_duplicate(connector->dev, | 1639 | newmode = drm_mode_duplicate(connector->dev, |
| 1566 | dev_priv->sdvo_lvds_vbt_mode); | 1640 | dev_priv->sdvo_lvds_vbt_mode); |
| 1567 | if (newmode != NULL) { | 1641 | if (newmode != NULL) { |
| @@ -1571,6 +1645,16 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) | |||
| 1571 | drm_mode_probed_add(connector, newmode); | 1645 | drm_mode_probed_add(connector, newmode); |
| 1572 | } | 1646 | } |
| 1573 | } | 1647 | } |
| 1648 | |||
| 1649 | end: | ||
| 1650 | list_for_each_entry(newmode, &connector->probed_modes, head) { | ||
| 1651 | if (newmode->type & DRM_MODE_TYPE_PREFERRED) { | ||
| 1652 | sdvo_priv->sdvo_lvds_fixed_mode = | ||
| 1653 | drm_mode_duplicate(connector->dev, newmode); | ||
| 1654 | break; | ||
| 1655 | } | ||
| 1656 | } | ||
| 1657 | |||
| 1574 | } | 1658 | } |
| 1575 | 1659 | ||
| 1576 | static int intel_sdvo_get_modes(struct drm_connector *connector) | 1660 | static int intel_sdvo_get_modes(struct drm_connector *connector) |
| @@ -1593,14 +1677,20 @@ static int intel_sdvo_get_modes(struct drm_connector *connector) | |||
| 1593 | static void intel_sdvo_destroy(struct drm_connector *connector) | 1677 | static void intel_sdvo_destroy(struct drm_connector *connector) |
| 1594 | { | 1678 | { |
| 1595 | struct intel_output *intel_output = to_intel_output(connector); | 1679 | struct intel_output *intel_output = to_intel_output(connector); |
| 1680 | struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv; | ||
| 1596 | 1681 | ||
| 1597 | if (intel_output->i2c_bus) | 1682 | if (intel_output->i2c_bus) |
| 1598 | intel_i2c_destroy(intel_output->i2c_bus); | 1683 | intel_i2c_destroy(intel_output->i2c_bus); |
| 1599 | if (intel_output->ddc_bus) | 1684 | if (intel_output->ddc_bus) |
| 1600 | intel_i2c_destroy(intel_output->ddc_bus); | 1685 | intel_i2c_destroy(intel_output->ddc_bus); |
| 1601 | 1686 | ||
| 1687 | if (sdvo_priv->sdvo_lvds_fixed_mode != NULL) | ||
| 1688 | drm_mode_destroy(connector->dev, | ||
| 1689 | sdvo_priv->sdvo_lvds_fixed_mode); | ||
| 1690 | |||
| 1602 | drm_sysfs_connector_remove(connector); | 1691 | drm_sysfs_connector_remove(connector); |
| 1603 | drm_connector_cleanup(connector); | 1692 | drm_connector_cleanup(connector); |
| 1693 | |||
| 1604 | kfree(intel_output); | 1694 | kfree(intel_output); |
| 1605 | } | 1695 | } |
| 1606 | 1696 | ||
diff --git a/drivers/gpu/drm/i915/intel_sdvo_regs.h b/drivers/gpu/drm/i915/intel_sdvo_regs.h index 193938b7d7f9..ba5cdf8ae40b 100644 --- a/drivers/gpu/drm/i915/intel_sdvo_regs.h +++ b/drivers/gpu/drm/i915/intel_sdvo_regs.h | |||
| @@ -715,6 +715,7 @@ struct intel_sdvo_enhancements_arg { | |||
| 715 | #define SDVO_HBUF_TX_ONCE (2 << 6) | 715 | #define SDVO_HBUF_TX_ONCE (2 << 6) |
| 716 | #define SDVO_HBUF_TX_VSYNC (3 << 6) | 716 | #define SDVO_HBUF_TX_VSYNC (3 << 6) |
| 717 | #define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c | 717 | #define SDVO_CMD_GET_AUDIO_TX_INFO 0x9c |
| 718 | #define SDVO_NEED_TO_STALL (1 << 7) | ||
| 718 | 719 | ||
| 719 | struct intel_sdvo_encode{ | 720 | struct intel_sdvo_encode{ |
| 720 | u8 dvi_rev; | 721 | u8 dvi_rev; |
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index e4476743f203..b1bc6e277d2a 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
| @@ -85,10 +85,11 @@ static void dump_iic_regs(const char* header, struct ibm_iic_private* dev) | |||
| 85 | { | 85 | { |
| 86 | volatile struct iic_regs __iomem *iic = dev->vaddr; | 86 | volatile struct iic_regs __iomem *iic = dev->vaddr; |
| 87 | printk(KERN_DEBUG "ibm-iic%d: %s\n", dev->idx, header); | 87 | printk(KERN_DEBUG "ibm-iic%d: %s\n", dev->idx, header); |
| 88 | printk(KERN_DEBUG " cntl = 0x%02x, mdcntl = 0x%02x\n" | 88 | printk(KERN_DEBUG |
| 89 | KERN_DEBUG " sts = 0x%02x, extsts = 0x%02x\n" | 89 | " cntl = 0x%02x, mdcntl = 0x%02x\n" |
| 90 | KERN_DEBUG " clkdiv = 0x%02x, xfrcnt = 0x%02x\n" | 90 | " sts = 0x%02x, extsts = 0x%02x\n" |
| 91 | KERN_DEBUG " xtcntlss = 0x%02x, directcntl = 0x%02x\n", | 91 | " clkdiv = 0x%02x, xfrcnt = 0x%02x\n" |
| 92 | " xtcntlss = 0x%02x, directcntl = 0x%02x\n", | ||
| 92 | in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts), | 93 | in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts), |
| 93 | in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt), | 94 | in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt), |
| 94 | in_8(&iic->xtcntlss), in_8(&iic->directcntl)); | 95 | in_8(&iic->xtcntlss), in_8(&iic->directcntl)); |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index 9d8f796c6745..a6b989a9dc07 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -12,6 +12,42 @@ menuconfig INPUT_KEYBOARD | |||
| 12 | 12 | ||
| 13 | if INPUT_KEYBOARD | 13 | if INPUT_KEYBOARD |
| 14 | 14 | ||
| 15 | config KEYBOARD_AAED2000 | ||
| 16 | tristate "AAED-2000 keyboard" | ||
| 17 | depends on MACH_AAED2000 | ||
| 18 | select INPUT_POLLDEV | ||
| 19 | default y | ||
| 20 | help | ||
| 21 | Say Y here to enable the keyboard on the Agilent AAED-2000 | ||
| 22 | development board. | ||
| 23 | |||
| 24 | To compile this driver as a module, choose M here: the | ||
| 25 | module will be called aaed2000_kbd. | ||
| 26 | |||
| 27 | config KEYBOARD_AMIGA | ||
| 28 | tristate "Amiga keyboard" | ||
| 29 | depends on AMIGA | ||
| 30 | help | ||
| 31 | Say Y here if you are running Linux on any AMIGA and have a keyboard | ||
| 32 | attached. | ||
| 33 | |||
| 34 | To compile this driver as a module, choose M here: the | ||
| 35 | module will be called amikbd. | ||
| 36 | |||
| 37 | config ATARI_KBD_CORE | ||
| 38 | bool | ||
| 39 | |||
| 40 | config KEYBOARD_ATARI | ||
| 41 | tristate "Atari keyboard" | ||
| 42 | depends on ATARI | ||
| 43 | select ATARI_KBD_CORE | ||
| 44 | help | ||
| 45 | Say Y here if you are running Linux on any Atari and have a keyboard | ||
| 46 | attached. | ||
| 47 | |||
| 48 | To compile this driver as a module, choose M here: the | ||
| 49 | module will be called atakbd. | ||
| 50 | |||
| 15 | config KEYBOARD_ATKBD | 51 | config KEYBOARD_ATKBD |
| 16 | tristate "AT keyboard" if EMBEDDED || !X86 | 52 | tristate "AT keyboard" if EMBEDDED || !X86 |
| 17 | default y | 53 | default y |
| @@ -68,69 +104,14 @@ config KEYBOARD_ATKBD_RDI_KEYCODES | |||
| 68 | right-hand column will be interpreted as the key shown in the | 104 | right-hand column will be interpreted as the key shown in the |
| 69 | left-hand column. | 105 | left-hand column. |
| 70 | 106 | ||
| 71 | config KEYBOARD_SUNKBD | 107 | config KEYBOARD_BFIN |
| 72 | tristate "Sun Type 4 and Type 5 keyboard" | 108 | tristate "Blackfin BF54x keypad support" |
| 73 | select SERIO | 109 | depends on (BF54x && !BF544) |
| 74 | help | ||
| 75 | Say Y here if you want to use a Sun Type 4 or Type 5 keyboard, | ||
| 76 | connected either to the Sun keyboard connector or to an serial | ||
| 77 | (RS-232) port via a simple adapter. | ||
| 78 | |||
| 79 | To compile this driver as a module, choose M here: the | ||
| 80 | module will be called sunkbd. | ||
| 81 | |||
| 82 | config KEYBOARD_LKKBD | ||
| 83 | tristate "DECstation/VAXstation LK201/LK401 keyboard" | ||
| 84 | select SERIO | ||
| 85 | help | ||
| 86 | Say Y here if you want to use a LK201 or LK401 style serial | ||
| 87 | keyboard. This keyboard is also useable on PCs if you attach | ||
| 88 | it with the inputattach program. The connector pinout is | ||
| 89 | described within lkkbd.c. | ||
| 90 | |||
| 91 | To compile this driver as a module, choose M here: the | ||
| 92 | module will be called lkkbd. | ||
| 93 | |||
| 94 | config KEYBOARD_LOCOMO | ||
| 95 | tristate "LoCoMo Keyboard Support" | ||
| 96 | depends on SHARP_LOCOMO && INPUT_KEYBOARD | ||
| 97 | help | ||
| 98 | Say Y here if you are running Linux on a Sharp Zaurus Collie or Poodle based PDA | ||
| 99 | |||
| 100 | To compile this driver as a module, choose M here: the | ||
| 101 | module will be called locomokbd. | ||
| 102 | |||
| 103 | config KEYBOARD_XTKBD | ||
| 104 | tristate "XT keyboard" | ||
| 105 | select SERIO | ||
| 106 | help | ||
| 107 | Say Y here if you want to use the old IBM PC/XT keyboard (or | ||
| 108 | compatible) on your system. This is only possible with a | ||
| 109 | parallel port keyboard adapter, you cannot connect it to the | ||
| 110 | keyboard port on a PC that runs Linux. | ||
| 111 | |||
| 112 | To compile this driver as a module, choose M here: the | ||
| 113 | module will be called xtkbd. | ||
| 114 | |||
| 115 | config KEYBOARD_NEWTON | ||
| 116 | tristate "Newton keyboard" | ||
| 117 | select SERIO | ||
| 118 | help | ||
| 119 | Say Y here if you have a Newton keyboard on a serial port. | ||
| 120 | |||
| 121 | To compile this driver as a module, choose M here: the | ||
| 122 | module will be called newtonkbd. | ||
| 123 | |||
| 124 | config KEYBOARD_STOWAWAY | ||
| 125 | tristate "Stowaway keyboard" | ||
| 126 | select SERIO | ||
| 127 | help | 110 | help |
| 128 | Say Y here if you have a Stowaway keyboard on a serial port. | 111 | Say Y here if you want to use the BF54x keypad. |
| 129 | Stowaway compatible keyboards like Dicota Input-PDA keyboard | ||
| 130 | are also supported by this driver. | ||
| 131 | 112 | ||
| 132 | To compile this driver as a module, choose M here: the | 113 | To compile this driver as a module, choose M here: the |
| 133 | module will be called stowaway. | 114 | module will be called bf54x-keys. |
| 134 | 115 | ||
| 135 | config KEYBOARD_CORGI | 116 | config KEYBOARD_CORGI |
| 136 | tristate "Corgi keyboard" | 117 | tristate "Corgi keyboard" |
| @@ -143,61 +124,50 @@ config KEYBOARD_CORGI | |||
| 143 | To compile this driver as a module, choose M here: the | 124 | To compile this driver as a module, choose M here: the |
| 144 | module will be called corgikbd. | 125 | module will be called corgikbd. |
| 145 | 126 | ||
| 146 | config KEYBOARD_SPITZ | 127 | config KEYBOARD_LKKBD |
| 147 | tristate "Spitz keyboard" | 128 | tristate "DECstation/VAXstation LK201/LK401 keyboard" |
| 148 | depends on PXA_SHARPSL | 129 | select SERIO |
| 149 | default y | ||
| 150 | help | 130 | help |
| 151 | Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000, | 131 | Say Y here if you want to use a LK201 or LK401 style serial |
| 152 | SL-C3000 and Sl-C3100 series of PDAs. | 132 | keyboard. This keyboard is also useable on PCs if you attach |
| 133 | it with the inputattach program. The connector pinout is | ||
| 134 | described within lkkbd.c. | ||
| 153 | 135 | ||
| 154 | To compile this driver as a module, choose M here: the | 136 | To compile this driver as a module, choose M here: the |
| 155 | module will be called spitzkbd. | 137 | module will be called lkkbd. |
| 156 | 138 | ||
| 157 | config KEYBOARD_TOSA | 139 | config KEYBOARD_EP93XX |
| 158 | tristate "Tosa keyboard" | 140 | tristate "EP93xx Matrix Keypad support" |
| 159 | depends on MACH_TOSA | 141 | depends on ARCH_EP93XX |
| 160 | default y | ||
| 161 | help | 142 | help |
| 162 | Say Y here to enable the keyboard on the Sharp Zaurus SL-6000x (Tosa) | 143 | Say Y here to enable the matrix keypad on the Cirrus EP93XX. |
| 163 | 144 | ||
| 164 | To compile this driver as a module, choose M here: the | 145 | To compile this driver as a module, choose M here: the |
| 165 | module will be called tosakbd. | 146 | module will be called ep93xx_keypad. |
| 166 | 147 | ||
| 167 | config KEYBOARD_TOSA_USE_EXT_KEYCODES | 148 | config KEYBOARD_GPIO |
| 168 | bool "Tosa keyboard: use extended keycodes" | 149 | tristate "GPIO Buttons" |
| 169 | depends on KEYBOARD_TOSA | 150 | depends on GENERIC_GPIO |
| 170 | default n | ||
| 171 | help | 151 | help |
| 172 | Say Y here to enable the tosa keyboard driver to generate extended | 152 | This driver implements support for buttons connected |
| 173 | (>= 127) keycodes. Be aware, that they can't be correctly interpreted | 153 | to GPIO pins of various CPUs (and some other chips). |
| 174 | by either console keyboard driver or by Kdrive keybd driver. | ||
| 175 | |||
| 176 | Say Y only if you know, what you are doing! | ||
| 177 | 154 | ||
| 178 | config KEYBOARD_AMIGA | 155 | Say Y here if your device has buttons connected |
| 179 | tristate "Amiga keyboard" | 156 | directly to such GPIO pins. Your board-specific |
| 180 | depends on AMIGA | 157 | setup logic must also provide a platform device, |
| 181 | help | 158 | with configuration data saying which GPIOs are used. |
| 182 | Say Y here if you are running Linux on any AMIGA and have a keyboard | ||
| 183 | attached. | ||
| 184 | 159 | ||
| 185 | To compile this driver as a module, choose M here: the | 160 | To compile this driver as a module, choose M here: the |
| 186 | module will be called amikbd. | 161 | module will be called gpio_keys. |
| 187 | 162 | ||
| 188 | config ATARI_KBD_CORE | 163 | config KEYBOARD_MATRIX |
| 189 | bool | 164 | tristate "GPIO driven matrix keypad support" |
| 190 | 165 | depends on GENERIC_GPIO | |
| 191 | config KEYBOARD_ATARI | ||
| 192 | tristate "Atari keyboard" | ||
| 193 | depends on ATARI | ||
| 194 | select ATARI_KBD_CORE | ||
| 195 | help | 166 | help |
| 196 | Say Y here if you are running Linux on any Atari and have a keyboard | 167 | Enable support for GPIO driven matrix keypad. |
| 197 | attached. | ||
| 198 | 168 | ||
| 199 | To compile this driver as a module, choose M here: the | 169 | To compile this driver as a module, choose M here: the |
| 200 | module will be called atakbd. | 170 | module will be called matrix_keypad. |
| 201 | 171 | ||
| 202 | config KEYBOARD_HIL_OLD | 172 | config KEYBOARD_HIL_OLD |
| 203 | tristate "HP HIL keyboard support (simple driver)" | 173 | tristate "HP HIL keyboard support (simple driver)" |
| @@ -261,20 +231,39 @@ config KEYBOARD_LM8323 | |||
| 261 | To compile this driver as a module, choose M here: the | 231 | To compile this driver as a module, choose M here: the |
| 262 | module will be called lm8323. | 232 | module will be called lm8323. |
| 263 | 233 | ||
| 264 | config KEYBOARD_OMAP | 234 | config KEYBOARD_LOCOMO |
| 265 | tristate "TI OMAP keypad support" | 235 | tristate "LoCoMo Keyboard Support" |
| 266 | depends on (ARCH_OMAP1 || ARCH_OMAP2) | 236 | depends on SHARP_LOCOMO |
| 267 | help | 237 | help |
| 268 | Say Y here if you want to use the OMAP keypad. | 238 | Say Y here if you are running Linux on a Sharp Zaurus Collie or Poodle based PDA |
| 269 | 239 | ||
| 270 | To compile this driver as a module, choose M here: the | 240 | To compile this driver as a module, choose M here: the |
| 271 | module will be called omap-keypad. | 241 | module will be called locomokbd. |
| 242 | |||
| 243 | config KEYBOARD_MAPLE | ||
| 244 | tristate "Maple bus keyboard" | ||
| 245 | depends on SH_DREAMCAST && MAPLE | ||
| 246 | help | ||
| 247 | Say Y here if you have a Dreamcast console running Linux and have | ||
| 248 | a keyboard attached to its Maple bus. | ||
| 249 | |||
| 250 | To compile this driver as a module, choose M here: the | ||
| 251 | module will be called maple_keyb. | ||
| 252 | |||
| 253 | config KEYBOARD_NEWTON | ||
| 254 | tristate "Newton keyboard" | ||
| 255 | select SERIO | ||
| 256 | help | ||
| 257 | Say Y here if you have a Newton keyboard on a serial port. | ||
| 258 | |||
| 259 | To compile this driver as a module, choose M here: the | ||
| 260 | module will be called newtonkbd. | ||
| 272 | 261 | ||
| 273 | config KEYBOARD_PXA27x | 262 | config KEYBOARD_PXA27x |
| 274 | tristate "PXA27x/PXA3xx keypad support" | 263 | tristate "PXA27x/PXA3xx keypad support" |
| 275 | depends on PXA27x || PXA3xx | 264 | depends on PXA27x || PXA3xx |
| 276 | help | 265 | help |
| 277 | Enable support for PXA27x/PXA3xx keypad controller | 266 | Enable support for PXA27x/PXA3xx keypad controller. |
| 278 | 267 | ||
| 279 | To compile this driver as a module, choose M here: the | 268 | To compile this driver as a module, choose M here: the |
| 280 | module will be called pxa27x_keypad. | 269 | module will be called pxa27x_keypad. |
| @@ -288,51 +277,38 @@ config KEYBOARD_PXA930_ROTARY | |||
| 288 | To compile this driver as a module, choose M here: the | 277 | To compile this driver as a module, choose M here: the |
| 289 | module will be called pxa930_rotary. | 278 | module will be called pxa930_rotary. |
| 290 | 279 | ||
| 291 | config KEYBOARD_AAED2000 | 280 | config KEYBOARD_SPITZ |
| 292 | tristate "AAED-2000 keyboard" | 281 | tristate "Spitz keyboard" |
| 293 | depends on MACH_AAED2000 | 282 | depends on PXA_SHARPSL |
| 294 | select INPUT_POLLDEV | ||
| 295 | default y | 283 | default y |
| 296 | help | 284 | help |
| 297 | Say Y here to enable the keyboard on the Agilent AAED-2000 | 285 | Say Y here to enable the keyboard on the Sharp Zaurus SL-C1000, |
| 298 | development board. | 286 | SL-C3000 and Sl-C3100 series of PDAs. |
| 299 | |||
| 300 | To compile this driver as a module, choose M here: the | ||
| 301 | module will be called aaed2000_kbd. | ||
| 302 | |||
| 303 | config KEYBOARD_GPIO | ||
| 304 | tristate "GPIO Buttons" | ||
| 305 | depends on GENERIC_GPIO | ||
| 306 | help | ||
| 307 | This driver implements support for buttons connected | ||
| 308 | to GPIO pins of various CPUs (and some other chips). | ||
| 309 | |||
| 310 | Say Y here if your device has buttons connected | ||
| 311 | directly to such GPIO pins. Your board-specific | ||
| 312 | setup logic must also provide a platform device, | ||
| 313 | with configuration data saying which GPIOs are used. | ||
| 314 | 287 | ||
| 315 | To compile this driver as a module, choose M here: the | 288 | To compile this driver as a module, choose M here: the |
| 316 | module will be called gpio-keys. | 289 | module will be called spitzkbd. |
| 317 | 290 | ||
| 318 | config KEYBOARD_MAPLE | 291 | config KEYBOARD_STOWAWAY |
| 319 | tristate "Maple bus keyboard" | 292 | tristate "Stowaway keyboard" |
| 320 | depends on SH_DREAMCAST && MAPLE | 293 | select SERIO |
| 321 | help | 294 | help |
| 322 | Say Y here if you have a Dreamcast console running Linux and have | 295 | Say Y here if you have a Stowaway keyboard on a serial port. |
| 323 | a keyboard attached to its Maple bus. | 296 | Stowaway compatible keyboards like Dicota Input-PDA keyboard |
| 297 | are also supported by this driver. | ||
| 324 | 298 | ||
| 325 | To compile this driver as a module, choose M here: the | 299 | To compile this driver as a module, choose M here: the |
| 326 | module will be called maple_keyb. | 300 | module will be called stowaway. |
| 327 | 301 | ||
| 328 | config KEYBOARD_BFIN | 302 | config KEYBOARD_SUNKBD |
| 329 | tristate "Blackfin BF54x keypad support" | 303 | tristate "Sun Type 4 and Type 5 keyboard" |
| 330 | depends on (BF54x && !BF544) | 304 | select SERIO |
| 331 | help | 305 | help |
| 332 | Say Y here if you want to use the BF54x keypad. | 306 | Say Y here if you want to use a Sun Type 4 or Type 5 keyboard, |
| 307 | connected either to the Sun keyboard connector or to an serial | ||
| 308 | (RS-232) port via a simple adapter. | ||
| 333 | 309 | ||
| 334 | To compile this driver as a module, choose M here: the | 310 | To compile this driver as a module, choose M here: the |
| 335 | module will be called bf54x-keys. | 311 | module will be called sunkbd. |
| 336 | 312 | ||
| 337 | config KEYBOARD_SH_KEYSC | 313 | config KEYBOARD_SH_KEYSC |
| 338 | tristate "SuperH KEYSC keypad support" | 314 | tristate "SuperH KEYSC keypad support" |
| @@ -344,13 +320,45 @@ config KEYBOARD_SH_KEYSC | |||
| 344 | To compile this driver as a module, choose M here: the | 320 | To compile this driver as a module, choose M here: the |
| 345 | module will be called sh_keysc. | 321 | module will be called sh_keysc. |
| 346 | 322 | ||
| 347 | config KEYBOARD_EP93XX | 323 | config KEYBOARD_OMAP |
| 348 | tristate "EP93xx Matrix Keypad support" | 324 | tristate "TI OMAP keypad support" |
| 349 | depends on ARCH_EP93XX | 325 | depends on (ARCH_OMAP1 || ARCH_OMAP2) |
| 350 | help | 326 | help |
| 351 | Say Y here to enable the matrix keypad on the Cirrus EP93XX. | 327 | Say Y here if you want to use the OMAP keypad. |
| 352 | 328 | ||
| 353 | To compile this driver as a module, choose M here: the | 329 | To compile this driver as a module, choose M here: the |
| 354 | module will be called ep93xx_keypad. | 330 | module will be called omap-keypad. |
| 331 | |||
| 332 | config KEYBOARD_TOSA | ||
| 333 | tristate "Tosa keyboard" | ||
| 334 | depends on MACH_TOSA | ||
| 335 | default y | ||
| 336 | help | ||
| 337 | Say Y here to enable the keyboard on the Sharp Zaurus SL-6000x (Tosa) | ||
| 338 | |||
| 339 | To compile this driver as a module, choose M here: the | ||
| 340 | module will be called tosakbd. | ||
| 341 | |||
| 342 | config KEYBOARD_TOSA_USE_EXT_KEYCODES | ||
| 343 | bool "Tosa keyboard: use extended keycodes" | ||
| 344 | depends on KEYBOARD_TOSA | ||
| 345 | help | ||
| 346 | Say Y here to enable the tosa keyboard driver to generate extended | ||
| 347 | (>= 127) keycodes. Be aware, that they can't be correctly interpreted | ||
| 348 | by either console keyboard driver or by Kdrive keybd driver. | ||
| 349 | |||
| 350 | Say Y only if you know, what you are doing! | ||
| 351 | |||
| 352 | config KEYBOARD_XTKBD | ||
| 353 | tristate "XT keyboard" | ||
| 354 | select SERIO | ||
| 355 | help | ||
| 356 | Say Y here if you want to use the old IBM PC/XT keyboard (or | ||
| 357 | compatible) on your system. This is only possible with a | ||
| 358 | parallel port keyboard adapter, you cannot connect it to the | ||
| 359 | keyboard port on a PC that runs Linux. | ||
| 360 | |||
| 361 | To compile this driver as a module, choose M here: the | ||
| 362 | module will be called xtkbd. | ||
| 355 | 363 | ||
| 356 | endif | 364 | endif |
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 156b647a259b..b5b5eae9724f 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile | |||
| @@ -4,29 +4,30 @@ | |||
| 4 | 4 | ||
| 5 | # Each configuration option enables a list of files. | 5 | # Each configuration option enables a list of files. |
| 6 | 6 | ||
| 7 | obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o | 7 | obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o |
| 8 | obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o | ||
| 9 | obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o | ||
| 10 | obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o | ||
| 11 | obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o | 8 | obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o |
| 12 | obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o | 9 | obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o |
| 13 | obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o | 10 | obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o |
| 14 | obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o | 11 | obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o |
| 15 | obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o | ||
| 16 | obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o | 12 | obj-$(CONFIG_KEYBOARD_CORGI) += corgikbd.o |
| 17 | obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o | 13 | obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o |
| 18 | obj-$(CONFIG_KEYBOARD_TOSA) += tosakbd.o | 14 | obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o |
| 19 | obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o | 15 | obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o |
| 20 | obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o | 16 | obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o |
| 17 | obj-$(CONFIG_KEYBOARD_HP6XX) += jornada680_kbd.o | ||
| 18 | obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o | ||
| 19 | obj-$(CONFIG_KEYBOARD_LKKBD) += lkkbd.o | ||
| 21 | obj-$(CONFIG_KEYBOARD_LM8323) += lm8323.o | 20 | obj-$(CONFIG_KEYBOARD_LM8323) += lm8323.o |
| 21 | obj-$(CONFIG_KEYBOARD_LOCOMO) += locomokbd.o | ||
| 22 | obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o | ||
| 23 | obj-$(CONFIG_KEYBOARD_MATRIX) += matrix_keypad.o | ||
| 24 | obj-$(CONFIG_KEYBOARD_NEWTON) += newtonkbd.o | ||
| 22 | obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o | 25 | obj-$(CONFIG_KEYBOARD_OMAP) += omap-keypad.o |
| 23 | obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o | 26 | obj-$(CONFIG_KEYBOARD_PXA27x) += pxa27x_keypad.o |
| 24 | obj-$(CONFIG_KEYBOARD_PXA930_ROTARY) += pxa930_rotary.o | 27 | obj-$(CONFIG_KEYBOARD_PXA930_ROTARY) += pxa930_rotary.o |
| 25 | obj-$(CONFIG_KEYBOARD_AAED2000) += aaed2000_kbd.o | ||
| 26 | obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o | ||
| 27 | obj-$(CONFIG_KEYBOARD_HP6XX) += jornada680_kbd.o | ||
| 28 | obj-$(CONFIG_KEYBOARD_HP7XX) += jornada720_kbd.o | ||
| 29 | obj-$(CONFIG_KEYBOARD_MAPLE) += maple_keyb.o | ||
| 30 | obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o | ||
| 31 | obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o | 28 | obj-$(CONFIG_KEYBOARD_SH_KEYSC) += sh_keysc.o |
| 32 | obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o | 29 | obj-$(CONFIG_KEYBOARD_SPITZ) += spitzkbd.o |
| 30 | obj-$(CONFIG_KEYBOARD_STOWAWAY) += stowaway.o | ||
| 31 | obj-$(CONFIG_KEYBOARD_SUNKBD) += sunkbd.o | ||
| 32 | obj-$(CONFIG_KEYBOARD_TOSA) += tosakbd.o | ||
| 33 | obj-$(CONFIG_KEYBOARD_XTKBD) += xtkbd.o | ||
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 2157cd7de00c..efed0c9e242e 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
| @@ -29,7 +29,8 @@ | |||
| 29 | struct gpio_button_data { | 29 | struct gpio_button_data { |
| 30 | struct gpio_keys_button *button; | 30 | struct gpio_keys_button *button; |
| 31 | struct input_dev *input; | 31 | struct input_dev *input; |
| 32 | struct delayed_work work; | 32 | struct timer_list timer; |
| 33 | struct work_struct work; | ||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | struct gpio_keys_drvdata { | 36 | struct gpio_keys_drvdata { |
| @@ -40,7 +41,7 @@ struct gpio_keys_drvdata { | |||
| 40 | static void gpio_keys_report_event(struct work_struct *work) | 41 | static void gpio_keys_report_event(struct work_struct *work) |
| 41 | { | 42 | { |
| 42 | struct gpio_button_data *bdata = | 43 | struct gpio_button_data *bdata = |
| 43 | container_of(work, struct gpio_button_data, work.work); | 44 | container_of(work, struct gpio_button_data, work); |
| 44 | struct gpio_keys_button *button = bdata->button; | 45 | struct gpio_keys_button *button = bdata->button; |
| 45 | struct input_dev *input = bdata->input; | 46 | struct input_dev *input = bdata->input; |
| 46 | unsigned int type = button->type ?: EV_KEY; | 47 | unsigned int type = button->type ?: EV_KEY; |
| @@ -50,17 +51,25 @@ static void gpio_keys_report_event(struct work_struct *work) | |||
| 50 | input_sync(input); | 51 | input_sync(input); |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 54 | static void gpio_keys_timer(unsigned long _data) | ||
| 55 | { | ||
| 56 | struct gpio_button_data *data = (struct gpio_button_data *)_data; | ||
| 57 | |||
| 58 | schedule_work(&data->work); | ||
| 59 | } | ||
| 60 | |||
| 53 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) | 61 | static irqreturn_t gpio_keys_isr(int irq, void *dev_id) |
| 54 | { | 62 | { |
| 55 | struct gpio_button_data *bdata = dev_id; | 63 | struct gpio_button_data *bdata = dev_id; |
| 56 | struct gpio_keys_button *button = bdata->button; | 64 | struct gpio_keys_button *button = bdata->button; |
| 57 | unsigned long delay; | ||
| 58 | 65 | ||
| 59 | BUG_ON(irq != gpio_to_irq(button->gpio)); | 66 | BUG_ON(irq != gpio_to_irq(button->gpio)); |
| 60 | 67 | ||
| 61 | delay = button->debounce_interval ? | 68 | if (button->debounce_interval) |
| 62 | msecs_to_jiffies(button->debounce_interval) : 0; | 69 | mod_timer(&bdata->timer, |
| 63 | schedule_delayed_work(&bdata->work, delay); | 70 | jiffies + msecs_to_jiffies(button->debounce_interval)); |
| 71 | else | ||
| 72 | schedule_work(&bdata->work); | ||
| 64 | 73 | ||
| 65 | return IRQ_HANDLED; | 74 | return IRQ_HANDLED; |
| 66 | } | 75 | } |
| @@ -107,7 +116,9 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
| 107 | 116 | ||
| 108 | bdata->input = input; | 117 | bdata->input = input; |
| 109 | bdata->button = button; | 118 | bdata->button = button; |
| 110 | INIT_DELAYED_WORK(&bdata->work, gpio_keys_report_event); | 119 | setup_timer(&bdata->timer, |
| 120 | gpio_keys_timer, (unsigned long)bdata); | ||
| 121 | INIT_WORK(&bdata->work, gpio_keys_report_event); | ||
| 111 | 122 | ||
| 112 | error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); | 123 | error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); |
| 113 | if (error < 0) { | 124 | if (error < 0) { |
| @@ -166,7 +177,9 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
| 166 | fail2: | 177 | fail2: |
| 167 | while (--i >= 0) { | 178 | while (--i >= 0) { |
| 168 | free_irq(gpio_to_irq(pdata->buttons[i].gpio), &ddata->data[i]); | 179 | free_irq(gpio_to_irq(pdata->buttons[i].gpio), &ddata->data[i]); |
| 169 | cancel_delayed_work_sync(&ddata->data[i].work); | 180 | if (pdata->buttons[i].debounce_interval) |
| 181 | del_timer_sync(&ddata->data[i].timer); | ||
| 182 | cancel_work_sync(&ddata->data[i].work); | ||
| 170 | gpio_free(pdata->buttons[i].gpio); | 183 | gpio_free(pdata->buttons[i].gpio); |
| 171 | } | 184 | } |
| 172 | 185 | ||
| @@ -190,7 +203,9 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev) | |||
| 190 | for (i = 0; i < pdata->nbuttons; i++) { | 203 | for (i = 0; i < pdata->nbuttons; i++) { |
| 191 | int irq = gpio_to_irq(pdata->buttons[i].gpio); | 204 | int irq = gpio_to_irq(pdata->buttons[i].gpio); |
| 192 | free_irq(irq, &ddata->data[i]); | 205 | free_irq(irq, &ddata->data[i]); |
| 193 | cancel_delayed_work_sync(&ddata->data[i].work); | 206 | if (pdata->buttons[i].debounce_interval) |
| 207 | del_timer_sync(&ddata->data[i].timer); | ||
| 208 | cancel_work_sync(&ddata->data[i].work); | ||
| 194 | gpio_free(pdata->buttons[i].gpio); | 209 | gpio_free(pdata->buttons[i].gpio); |
| 195 | } | 210 | } |
| 196 | 211 | ||
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c new file mode 100644 index 000000000000..e9b2e7cb05be --- /dev/null +++ b/drivers/input/keyboard/matrix_keypad.c | |||
| @@ -0,0 +1,453 @@ | |||
| 1 | /* | ||
| 2 | * GPIO driven matrix keyboard driver | ||
| 3 | * | ||
| 4 | * Copyright (c) 2008 Marek Vasut <marek.vasut@gmail.com> | ||
| 5 | * | ||
| 6 | * Based on corgikbd.c | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/delay.h> | ||
| 16 | #include <linux/platform_device.h> | ||
| 17 | #include <linux/init.h> | ||
| 18 | #include <linux/input.h> | ||
| 19 | #include <linux/irq.h> | ||
| 20 | #include <linux/interrupt.h> | ||
| 21 | #include <linux/jiffies.h> | ||
| 22 | #include <linux/module.h> | ||
| 23 | #include <linux/gpio.h> | ||
| 24 | #include <linux/input/matrix_keypad.h> | ||
| 25 | |||
| 26 | struct matrix_keypad { | ||
| 27 | const struct matrix_keypad_platform_data *pdata; | ||
| 28 | struct input_dev *input_dev; | ||
| 29 | unsigned short *keycodes; | ||
| 30 | |||
| 31 | uint32_t last_key_state[MATRIX_MAX_COLS]; | ||
| 32 | struct delayed_work work; | ||
| 33 | bool scan_pending; | ||
| 34 | bool stopped; | ||
| 35 | spinlock_t lock; | ||
| 36 | }; | ||
| 37 | |||
| 38 | /* | ||
| 39 | * NOTE: normally the GPIO has to be put into HiZ when de-activated to cause | ||
| 40 | * minmal side effect when scanning other columns, here it is configured to | ||
| 41 | * be input, and it should work on most platforms. | ||
| 42 | */ | ||
| 43 | static void __activate_col(const struct matrix_keypad_platform_data *pdata, | ||
| 44 | int col, bool on) | ||
| 45 | { | ||
| 46 | bool level_on = !pdata->active_low; | ||
| 47 | |||
| 48 | if (on) { | ||
| 49 | gpio_direction_output(pdata->col_gpios[col], level_on); | ||
| 50 | } else { | ||
| 51 | gpio_set_value_cansleep(pdata->col_gpios[col], !level_on); | ||
| 52 | gpio_direction_input(pdata->col_gpios[col]); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | |||
| 56 | static void activate_col(const struct matrix_keypad_platform_data *pdata, | ||
| 57 | int col, bool on) | ||
| 58 | { | ||
| 59 | __activate_col(pdata, col, on); | ||
| 60 | |||
| 61 | if (on && pdata->col_scan_delay_us) | ||
| 62 | udelay(pdata->col_scan_delay_us); | ||
| 63 | } | ||
| 64 | |||
| 65 | static void activate_all_cols(const struct matrix_keypad_platform_data *pdata, | ||
| 66 | bool on) | ||
| 67 | { | ||
| 68 | int col; | ||
| 69 | |||
| 70 | for (col = 0; col < pdata->num_col_gpios; col++) | ||
| 71 | __activate_col(pdata, col, on); | ||
| 72 | } | ||
| 73 | |||
| 74 | static bool row_asserted(const struct matrix_keypad_platform_data *pdata, | ||
| 75 | int row) | ||
| 76 | { | ||
| 77 | return gpio_get_value_cansleep(pdata->row_gpios[row]) ? | ||
| 78 | !pdata->active_low : pdata->active_low; | ||
| 79 | } | ||
| 80 | |||
| 81 | static void enable_row_irqs(struct matrix_keypad *keypad) | ||
| 82 | { | ||
| 83 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 84 | int i; | ||
| 85 | |||
| 86 | for (i = 0; i < pdata->num_row_gpios; i++) | ||
| 87 | enable_irq(gpio_to_irq(pdata->row_gpios[i])); | ||
| 88 | } | ||
| 89 | |||
| 90 | static void disable_row_irqs(struct matrix_keypad *keypad) | ||
| 91 | { | ||
| 92 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 93 | int i; | ||
| 94 | |||
| 95 | for (i = 0; i < pdata->num_row_gpios; i++) | ||
| 96 | disable_irq_nosync(gpio_to_irq(pdata->row_gpios[i])); | ||
| 97 | } | ||
| 98 | |||
| 99 | /* | ||
| 100 | * This gets the keys from keyboard and reports it to input subsystem | ||
| 101 | */ | ||
| 102 | static void matrix_keypad_scan(struct work_struct *work) | ||
| 103 | { | ||
| 104 | struct matrix_keypad *keypad = | ||
| 105 | container_of(work, struct matrix_keypad, work.work); | ||
| 106 | struct input_dev *input_dev = keypad->input_dev; | ||
| 107 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 108 | uint32_t new_state[MATRIX_MAX_COLS]; | ||
| 109 | int row, col, code; | ||
| 110 | |||
| 111 | /* de-activate all columns for scanning */ | ||
| 112 | activate_all_cols(pdata, false); | ||
| 113 | |||
| 114 | memset(new_state, 0, sizeof(new_state)); | ||
| 115 | |||
| 116 | /* assert each column and read the row status out */ | ||
| 117 | for (col = 0; col < pdata->num_col_gpios; col++) { | ||
| 118 | |||
| 119 | activate_col(pdata, col, true); | ||
| 120 | |||
| 121 | for (row = 0; row < pdata->num_row_gpios; row++) | ||
| 122 | new_state[col] |= | ||
| 123 | row_asserted(pdata, row) ? (1 << row) : 0; | ||
| 124 | |||
| 125 | activate_col(pdata, col, false); | ||
| 126 | } | ||
| 127 | |||
| 128 | for (col = 0; col < pdata->num_col_gpios; col++) { | ||
| 129 | uint32_t bits_changed; | ||
| 130 | |||
| 131 | bits_changed = keypad->last_key_state[col] ^ new_state[col]; | ||
| 132 | if (bits_changed == 0) | ||
| 133 | continue; | ||
| 134 | |||
| 135 | for (row = 0; row < pdata->num_row_gpios; row++) { | ||
| 136 | if ((bits_changed & (1 << row)) == 0) | ||
| 137 | continue; | ||
| 138 | |||
| 139 | code = (row << 4) + col; | ||
| 140 | input_event(input_dev, EV_MSC, MSC_SCAN, code); | ||
| 141 | input_report_key(input_dev, | ||
| 142 | keypad->keycodes[code], | ||
| 143 | new_state[col] & (1 << row)); | ||
| 144 | } | ||
| 145 | } | ||
| 146 | input_sync(input_dev); | ||
| 147 | |||
| 148 | memcpy(keypad->last_key_state, new_state, sizeof(new_state)); | ||
| 149 | |||
| 150 | activate_all_cols(pdata, true); | ||
| 151 | |||
| 152 | /* Enable IRQs again */ | ||
| 153 | spin_lock_irq(&keypad->lock); | ||
| 154 | keypad->scan_pending = false; | ||
| 155 | enable_row_irqs(keypad); | ||
| 156 | spin_unlock_irq(&keypad->lock); | ||
| 157 | } | ||
| 158 | |||
| 159 | static irqreturn_t matrix_keypad_interrupt(int irq, void *id) | ||
| 160 | { | ||
| 161 | struct matrix_keypad *keypad = id; | ||
| 162 | unsigned long flags; | ||
| 163 | |||
| 164 | spin_lock_irqsave(&keypad->lock, flags); | ||
| 165 | |||
| 166 | /* | ||
| 167 | * See if another IRQ beaten us to it and scheduled the | ||
| 168 | * scan already. In that case we should not try to | ||
| 169 | * disable IRQs again. | ||
| 170 | */ | ||
| 171 | if (unlikely(keypad->scan_pending || keypad->stopped)) | ||
| 172 | goto out; | ||
| 173 | |||
| 174 | disable_row_irqs(keypad); | ||
| 175 | keypad->scan_pending = true; | ||
| 176 | schedule_delayed_work(&keypad->work, | ||
| 177 | msecs_to_jiffies(keypad->pdata->debounce_ms)); | ||
| 178 | |||
| 179 | out: | ||
| 180 | spin_unlock_irqrestore(&keypad->lock, flags); | ||
| 181 | return IRQ_HANDLED; | ||
| 182 | } | ||
| 183 | |||
| 184 | static int matrix_keypad_start(struct input_dev *dev) | ||
| 185 | { | ||
| 186 | struct matrix_keypad *keypad = input_get_drvdata(dev); | ||
| 187 | |||
| 188 | keypad->stopped = false; | ||
| 189 | mb(); | ||
| 190 | |||
| 191 | /* | ||
| 192 | * Schedule an immediate key scan to capture current key state; | ||
| 193 | * columns will be activated and IRQs be enabled after the scan. | ||
| 194 | */ | ||
| 195 | schedule_delayed_work(&keypad->work, 0); | ||
| 196 | |||
| 197 | return 0; | ||
| 198 | } | ||
| 199 | |||
| 200 | static void matrix_keypad_stop(struct input_dev *dev) | ||
| 201 | { | ||
| 202 | struct matrix_keypad *keypad = input_get_drvdata(dev); | ||
| 203 | |||
| 204 | keypad->stopped = true; | ||
| 205 | mb(); | ||
| 206 | flush_work(&keypad->work.work); | ||
| 207 | /* | ||
| 208 | * matrix_keypad_scan() will leave IRQs enabled; | ||
| 209 | * we should disable them now. | ||
| 210 | */ | ||
| 211 | disable_row_irqs(keypad); | ||
| 212 | } | ||
| 213 | |||
| 214 | #ifdef CONFIG_PM | ||
| 215 | static int matrix_keypad_suspend(struct platform_device *pdev, pm_message_t state) | ||
| 216 | { | ||
| 217 | struct matrix_keypad *keypad = platform_get_drvdata(pdev); | ||
| 218 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 219 | int i; | ||
| 220 | |||
| 221 | matrix_keypad_stop(keypad->input_dev); | ||
| 222 | |||
| 223 | if (device_may_wakeup(&pdev->dev)) | ||
| 224 | for (i = 0; i < pdata->num_row_gpios; i++) | ||
| 225 | enable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); | ||
| 226 | |||
| 227 | return 0; | ||
| 228 | } | ||
| 229 | |||
| 230 | static int matrix_keypad_resume(struct platform_device *pdev) | ||
| 231 | { | ||
| 232 | struct matrix_keypad *keypad = platform_get_drvdata(pdev); | ||
| 233 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 234 | int i; | ||
| 235 | |||
| 236 | if (device_may_wakeup(&pdev->dev)) | ||
| 237 | for (i = 0; i < pdata->num_row_gpios; i++) | ||
| 238 | disable_irq_wake(gpio_to_irq(pdata->row_gpios[i])); | ||
| 239 | |||
| 240 | matrix_keypad_start(keypad->input_dev); | ||
| 241 | |||
| 242 | return 0; | ||
| 243 | } | ||
| 244 | #else | ||
| 245 | #define matrix_keypad_suspend NULL | ||
| 246 | #define matrix_keypad_resume NULL | ||
| 247 | #endif | ||
| 248 | |||
| 249 | static int __devinit init_matrix_gpio(struct platform_device *pdev, | ||
| 250 | struct matrix_keypad *keypad) | ||
| 251 | { | ||
| 252 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 253 | int i, err = -EINVAL; | ||
| 254 | |||
| 255 | /* initialized strobe lines as outputs, activated */ | ||
| 256 | for (i = 0; i < pdata->num_col_gpios; i++) { | ||
| 257 | err = gpio_request(pdata->col_gpios[i], "matrix_kbd_col"); | ||
| 258 | if (err) { | ||
| 259 | dev_err(&pdev->dev, | ||
| 260 | "failed to request GPIO%d for COL%d\n", | ||
| 261 | pdata->col_gpios[i], i); | ||
| 262 | goto err_free_cols; | ||
| 263 | } | ||
| 264 | |||
| 265 | gpio_direction_output(pdata->col_gpios[i], !pdata->active_low); | ||
| 266 | } | ||
| 267 | |||
| 268 | for (i = 0; i < pdata->num_row_gpios; i++) { | ||
| 269 | err = gpio_request(pdata->row_gpios[i], "matrix_kbd_row"); | ||
| 270 | if (err) { | ||
| 271 | dev_err(&pdev->dev, | ||
| 272 | "failed to request GPIO%d for ROW%d\n", | ||
| 273 | pdata->row_gpios[i], i); | ||
| 274 | goto err_free_rows; | ||
| 275 | } | ||
| 276 | |||
| 277 | gpio_direction_input(pdata->row_gpios[i]); | ||
| 278 | } | ||
| 279 | |||
| 280 | for (i = 0; i < pdata->num_row_gpios; i++) { | ||
| 281 | err = request_irq(gpio_to_irq(pdata->row_gpios[i]), | ||
| 282 | matrix_keypad_interrupt, | ||
| 283 | IRQF_DISABLED | | ||
| 284 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
| 285 | "matrix-keypad", keypad); | ||
| 286 | if (err) { | ||
| 287 | dev_err(&pdev->dev, | ||
| 288 | "Unable to acquire interrupt for GPIO line %i\n", | ||
| 289 | pdata->row_gpios[i]); | ||
| 290 | goto err_free_irqs; | ||
| 291 | } | ||
| 292 | } | ||
| 293 | |||
| 294 | /* initialized as disabled - enabled by input->open */ | ||
| 295 | disable_row_irqs(keypad); | ||
| 296 | return 0; | ||
| 297 | |||
| 298 | err_free_irqs: | ||
| 299 | while (--i >= 0) | ||
| 300 | free_irq(gpio_to_irq(pdata->row_gpios[i]), keypad); | ||
| 301 | i = pdata->num_row_gpios; | ||
| 302 | err_free_rows: | ||
| 303 | while (--i >= 0) | ||
| 304 | gpio_free(pdata->row_gpios[i]); | ||
| 305 | i = pdata->num_col_gpios; | ||
| 306 | err_free_cols: | ||
| 307 | while (--i >= 0) | ||
| 308 | gpio_free(pdata->col_gpios[i]); | ||
| 309 | |||
| 310 | return err; | ||
| 311 | } | ||
| 312 | |||
| 313 | static int __devinit matrix_keypad_probe(struct platform_device *pdev) | ||
| 314 | { | ||
| 315 | const struct matrix_keypad_platform_data *pdata; | ||
| 316 | const struct matrix_keymap_data *keymap_data; | ||
| 317 | struct matrix_keypad *keypad; | ||
| 318 | struct input_dev *input_dev; | ||
| 319 | unsigned short *keycodes; | ||
| 320 | int i; | ||
| 321 | int err; | ||
| 322 | |||
| 323 | pdata = pdev->dev.platform_data; | ||
| 324 | if (!pdata) { | ||
| 325 | dev_err(&pdev->dev, "no platform data defined\n"); | ||
| 326 | return -EINVAL; | ||
| 327 | } | ||
| 328 | |||
| 329 | keymap_data = pdata->keymap_data; | ||
| 330 | if (!keymap_data) { | ||
| 331 | dev_err(&pdev->dev, "no keymap data defined\n"); | ||
| 332 | return -EINVAL; | ||
| 333 | } | ||
| 334 | |||
| 335 | if (!keymap_data->max_keymap_size) { | ||
| 336 | dev_err(&pdev->dev, "invalid keymap data supplied\n"); | ||
| 337 | return -EINVAL; | ||
| 338 | } | ||
| 339 | |||
| 340 | keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); | ||
| 341 | keycodes = kzalloc(keymap_data->max_keymap_size * | ||
| 342 | sizeof(keypad->keycodes), | ||
| 343 | GFP_KERNEL); | ||
| 344 | input_dev = input_allocate_device(); | ||
| 345 | if (!keypad || !keycodes || !input_dev) { | ||
| 346 | err = -ENOMEM; | ||
| 347 | goto err_free_mem; | ||
| 348 | } | ||
| 349 | |||
| 350 | keypad->input_dev = input_dev; | ||
| 351 | keypad->pdata = pdata; | ||
| 352 | keypad->keycodes = keycodes; | ||
| 353 | keypad->stopped = true; | ||
| 354 | INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); | ||
| 355 | spin_lock_init(&keypad->lock); | ||
| 356 | |||
| 357 | input_dev->name = pdev->name; | ||
| 358 | input_dev->id.bustype = BUS_HOST; | ||
| 359 | input_dev->dev.parent = &pdev->dev; | ||
| 360 | input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); | ||
| 361 | input_dev->open = matrix_keypad_start; | ||
| 362 | input_dev->close = matrix_keypad_stop; | ||
| 363 | |||
| 364 | input_dev->keycode = keycodes; | ||
| 365 | input_dev->keycodesize = sizeof(*keycodes); | ||
| 366 | input_dev->keycodemax = keymap_data->max_keymap_size; | ||
| 367 | |||
| 368 | for (i = 0; i < keymap_data->keymap_size; i++) { | ||
| 369 | unsigned int key = keymap_data->keymap[i]; | ||
| 370 | unsigned int row = KEY_ROW(key); | ||
| 371 | unsigned int col = KEY_COL(key); | ||
| 372 | unsigned short code = KEY_VAL(key); | ||
| 373 | |||
| 374 | keycodes[(row << 4) + col] = code; | ||
| 375 | __set_bit(code, input_dev->keybit); | ||
| 376 | } | ||
| 377 | __clear_bit(KEY_RESERVED, input_dev->keybit); | ||
| 378 | |||
| 379 | input_set_capability(input_dev, EV_MSC, MSC_SCAN); | ||
| 380 | input_set_drvdata(input_dev, keypad); | ||
| 381 | |||
| 382 | err = init_matrix_gpio(pdev, keypad); | ||
| 383 | if (err) | ||
| 384 | goto err_free_mem; | ||
| 385 | |||
| 386 | err = input_register_device(keypad->input_dev); | ||
| 387 | if (err) | ||
| 388 | goto err_free_mem; | ||
| 389 | |||
| 390 | device_init_wakeup(&pdev->dev, pdata->wakeup); | ||
| 391 | platform_set_drvdata(pdev, keypad); | ||
| 392 | |||
| 393 | return 0; | ||
| 394 | |||
| 395 | err_free_mem: | ||
| 396 | input_free_device(input_dev); | ||
| 397 | kfree(keycodes); | ||
| 398 | kfree(keypad); | ||
| 399 | return err; | ||
| 400 | } | ||
| 401 | |||
| 402 | static int __devexit matrix_keypad_remove(struct platform_device *pdev) | ||
| 403 | { | ||
| 404 | struct matrix_keypad *keypad = platform_get_drvdata(pdev); | ||
| 405 | const struct matrix_keypad_platform_data *pdata = keypad->pdata; | ||
| 406 | int i; | ||
| 407 | |||
| 408 | device_init_wakeup(&pdev->dev, 0); | ||
| 409 | |||
| 410 | for (i = 0; i < pdata->num_row_gpios; i++) { | ||
| 411 | free_irq(gpio_to_irq(pdata->row_gpios[i]), keypad); | ||
| 412 | gpio_free(pdata->row_gpios[i]); | ||
| 413 | } | ||
| 414 | |||
| 415 | for (i = 0; i < pdata->num_col_gpios; i++) | ||
| 416 | gpio_free(pdata->col_gpios[i]); | ||
| 417 | |||
| 418 | input_unregister_device(keypad->input_dev); | ||
| 419 | platform_set_drvdata(pdev, NULL); | ||
| 420 | kfree(keypad->keycodes); | ||
| 421 | kfree(keypad); | ||
| 422 | |||
| 423 | return 0; | ||
| 424 | } | ||
| 425 | |||
| 426 | static struct platform_driver matrix_keypad_driver = { | ||
| 427 | .probe = matrix_keypad_probe, | ||
| 428 | .remove = __devexit_p(matrix_keypad_remove), | ||
| 429 | .suspend = matrix_keypad_suspend, | ||
| 430 | .resume = matrix_keypad_resume, | ||
| 431 | .driver = { | ||
| 432 | .name = "matrix-keypad", | ||
| 433 | .owner = THIS_MODULE, | ||
| 434 | }, | ||
| 435 | }; | ||
| 436 | |||
| 437 | static int __init matrix_keypad_init(void) | ||
| 438 | { | ||
| 439 | return platform_driver_register(&matrix_keypad_driver); | ||
| 440 | } | ||
| 441 | |||
| 442 | static void __exit matrix_keypad_exit(void) | ||
| 443 | { | ||
| 444 | platform_driver_unregister(&matrix_keypad_driver); | ||
| 445 | } | ||
| 446 | |||
| 447 | module_init(matrix_keypad_init); | ||
| 448 | module_exit(matrix_keypad_exit); | ||
| 449 | |||
| 450 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); | ||
| 451 | MODULE_DESCRIPTION("GPIO Driven Matrix Keypad Driver"); | ||
| 452 | MODULE_LICENSE("GPL v2"); | ||
| 453 | MODULE_ALIAS("platform:matrix-keypad"); | ||
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index 5e5eb88d8d1e..7b6ce178f1b6 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c | |||
| @@ -46,7 +46,7 @@ static void gpio_mouse_scan(struct input_polled_dev *dev) | |||
| 46 | input_sync(input); | 46 | input_sync(input); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | static int __init gpio_mouse_probe(struct platform_device *pdev) | 49 | static int __devinit gpio_mouse_probe(struct platform_device *pdev) |
| 50 | { | 50 | { |
| 51 | struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; | 51 | struct gpio_mouse_platform_data *pdata = pdev->dev.platform_data; |
| 52 | struct input_polled_dev *input_poll; | 52 | struct input_polled_dev *input_poll; |
| @@ -170,10 +170,8 @@ static int __devexit gpio_mouse_remove(struct platform_device *pdev) | |||
| 170 | return 0; | 170 | return 0; |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | /* work with hotplug and coldplug */ | ||
| 174 | MODULE_ALIAS("platform:gpio_mouse"); | ||
| 175 | |||
| 176 | static struct platform_driver gpio_mouse_device_driver = { | 173 | static struct platform_driver gpio_mouse_device_driver = { |
| 174 | .probe = gpio_mouse_probe, | ||
| 177 | .remove = __devexit_p(gpio_mouse_remove), | 175 | .remove = __devexit_p(gpio_mouse_remove), |
| 178 | .driver = { | 176 | .driver = { |
| 179 | .name = "gpio_mouse", | 177 | .name = "gpio_mouse", |
| @@ -183,8 +181,7 @@ static struct platform_driver gpio_mouse_device_driver = { | |||
| 183 | 181 | ||
| 184 | static int __init gpio_mouse_init(void) | 182 | static int __init gpio_mouse_init(void) |
| 185 | { | 183 | { |
| 186 | return platform_driver_probe(&gpio_mouse_device_driver, | 184 | return platform_driver_register(&gpio_mouse_device_driver); |
| 187 | gpio_mouse_probe); | ||
| 188 | } | 185 | } |
| 189 | module_init(gpio_mouse_init); | 186 | module_init(gpio_mouse_init); |
| 190 | 187 | ||
| @@ -197,3 +194,5 @@ module_exit(gpio_mouse_exit); | |||
| 197 | MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); | 194 | MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); |
| 198 | MODULE_DESCRIPTION("GPIO mouse driver"); | 195 | MODULE_DESCRIPTION("GPIO mouse driver"); |
| 199 | MODULE_LICENSE("GPL"); | 196 | MODULE_LICENSE("GPL"); |
| 197 | MODULE_ALIAS("platform:gpio_mouse"); /* work with hotplug and coldplug */ | ||
| 198 | |||
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index fb8a3cd3ffd0..924e8ed7f2cf 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
| @@ -392,6 +392,34 @@ static struct dmi_system_id __initdata i8042_dmi_reset_table[] = { | |||
| 392 | DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."), | 392 | DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."), |
| 393 | }, | 393 | }, |
| 394 | }, | 394 | }, |
| 395 | { | ||
| 396 | .ident = "Acer Aspire One 150", | ||
| 397 | .matches = { | ||
| 398 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 399 | DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"), | ||
| 400 | }, | ||
| 401 | }, | ||
| 402 | { | ||
| 403 | .ident = "Advent 4211", | ||
| 404 | .matches = { | ||
| 405 | DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"), | ||
| 406 | DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"), | ||
| 407 | }, | ||
| 408 | }, | ||
| 409 | { | ||
| 410 | .ident = "Medion Akoya Mini E1210", | ||
| 411 | .matches = { | ||
| 412 | DMI_MATCH(DMI_SYS_VENDOR, "MEDION"), | ||
| 413 | DMI_MATCH(DMI_PRODUCT_NAME, "E1210"), | ||
| 414 | }, | ||
| 415 | }, | ||
| 416 | { | ||
| 417 | .ident = "Mivvy M310", | ||
| 418 | .matches = { | ||
| 419 | DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"), | ||
| 420 | DMI_MATCH(DMI_PRODUCT_NAME, "N10"), | ||
| 421 | }, | ||
| 422 | }, | ||
| 395 | { } | 423 | { } |
| 396 | }; | 424 | }; |
| 397 | 425 | ||
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index f919bf57293c..582245c497eb 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
| @@ -934,10 +934,11 @@ static bool i8042_suspended; | |||
| 934 | 934 | ||
| 935 | static int i8042_suspend(struct platform_device *dev, pm_message_t state) | 935 | static int i8042_suspend(struct platform_device *dev, pm_message_t state) |
| 936 | { | 936 | { |
| 937 | if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) { | 937 | if (!i8042_suspended && state.event == PM_EVENT_SUSPEND) |
| 938 | i8042_controller_reset(); | 938 | i8042_controller_reset(); |
| 939 | i8042_suspended = true; | 939 | |
| 940 | } | 940 | i8042_suspended = state.event == PM_EVENT_SUSPEND || |
| 941 | state.event == PM_EVENT_FREEZE; | ||
| 941 | 942 | ||
| 942 | return 0; | 943 | return 0; |
| 943 | } | 944 | } |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index fb17573f8f2d..d66f4944f2a0 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
| @@ -935,10 +935,11 @@ static int serio_suspend(struct device *dev, pm_message_t state) | |||
| 935 | { | 935 | { |
| 936 | struct serio *serio = to_serio_port(dev); | 936 | struct serio *serio = to_serio_port(dev); |
| 937 | 937 | ||
| 938 | if (!serio->suspended && state.event == PM_EVENT_SUSPEND) { | 938 | if (!serio->suspended && state.event == PM_EVENT_SUSPEND) |
| 939 | serio_cleanup(serio); | 939 | serio_cleanup(serio); |
| 940 | serio->suspended = true; | 940 | |
| 941 | } | 941 | serio->suspended = state.event == PM_EVENT_SUSPEND || |
| 942 | state.event == PM_EVENT_FREEZE; | ||
| 942 | 943 | ||
| 943 | return 0; | 944 | return 0; |
| 944 | } | 945 | } |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 38bf86384aeb..c896d6a21b7e 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -384,6 +384,8 @@ static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo) | |||
| 384 | wacom_report_key(wcombo, BTN_STYLUS2, 0); | 384 | wacom_report_key(wcombo, BTN_STYLUS2, 0); |
| 385 | wacom_report_key(wcombo, BTN_TOUCH, 0); | 385 | wacom_report_key(wcombo, BTN_TOUCH, 0); |
| 386 | wacom_report_abs(wcombo, ABS_WHEEL, 0); | 386 | wacom_report_abs(wcombo, ABS_WHEEL, 0); |
| 387 | if (wacom->features->type >= INTUOS3S) | ||
| 388 | wacom_report_abs(wcombo, ABS_Z, 0); | ||
| 387 | } | 389 | } |
| 388 | wacom_report_key(wcombo, wacom->tool[idx], 0); | 390 | wacom_report_key(wcombo, wacom->tool[idx], 0); |
| 389 | wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ | 391 | wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ |
| @@ -836,6 +838,7 @@ static struct wacom_features wacom_features[] = { | |||
| 836 | { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL }, | 838 | { "Wacom DTU710", 8, 34080, 27660, 511, 0, PL }, |
| 837 | { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL }, | 839 | { "Wacom DTF521", 8, 6282, 4762, 511, 0, PL }, |
| 838 | { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL }, | 840 | { "Wacom DTF720", 8, 6858, 5506, 511, 0, PL }, |
| 841 | { "Wacom DTF720a", 8, 6858, 5506, 511, 0, PL }, | ||
| 839 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU }, | 842 | { "Wacom Cintiq Partner",8, 20480, 15360, 511, 0, PTU }, |
| 840 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS }, | 843 | { "Wacom Intuos2 4x5", 10, 12700, 10600, 1023, 31, INTUOS }, |
| 841 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, | 844 | { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, |
| @@ -897,8 +900,9 @@ static struct usb_device_id wacom_ids[] = { | |||
| 897 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x37) }, | 900 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x37) }, |
| 898 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, | 901 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x38) }, |
| 899 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, | 902 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x39) }, |
| 900 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, | ||
| 901 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC4) }, | 903 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC4) }, |
| 904 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC0) }, | ||
| 905 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC2) }, | ||
| 902 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, | 906 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x03) }, |
| 903 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, | 907 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x41) }, |
| 904 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, | 908 | { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x42) }, |
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 9933eb861c71..529e2ba505c3 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c | |||
| @@ -776,7 +776,7 @@ static void kcryptd_crypt_write_convert(struct dm_crypt_io *io) | |||
| 776 | * But don't wait if split was due to the io size restriction | 776 | * But don't wait if split was due to the io size restriction |
| 777 | */ | 777 | */ |
| 778 | if (unlikely(out_of_pages)) | 778 | if (unlikely(out_of_pages)) |
| 779 | congestion_wait(WRITE, HZ/100); | 779 | congestion_wait(BLK_RW_ASYNC, HZ/100); |
| 780 | 780 | ||
| 781 | /* | 781 | /* |
| 782 | * With async crypto it is unsafe to share the crypto context | 782 | * With async crypto it is unsafe to share the crypto context |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 0f4a70c43ffc..d4351ff0849f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -1756,9 +1756,10 @@ static void print_sb_1(struct mdp_superblock_1 *sb) | |||
| 1756 | __u8 *uuid; | 1756 | __u8 *uuid; |
| 1757 | 1757 | ||
| 1758 | uuid = sb->set_uuid; | 1758 | uuid = sb->set_uuid; |
| 1759 | printk(KERN_INFO "md: SB: (V:%u) (F:0x%08x) Array-ID:<%02x%02x%02x%02x" | 1759 | printk(KERN_INFO |
| 1760 | ":%02x%02x:%02x%02x:%02x%02x:%02x%02x%02x%02x%02x%02x>\n" | 1760 | "md: SB: (V:%u) (F:0x%08x) Array-ID:<%02x%02x%02x%02x" |
| 1761 | KERN_INFO "md: Name: \"%s\" CT:%llu\n", | 1761 | ":%02x%02x:%02x%02x:%02x%02x:%02x%02x%02x%02x%02x%02x>\n" |
| 1762 | "md: Name: \"%s\" CT:%llu\n", | ||
| 1762 | le32_to_cpu(sb->major_version), | 1763 | le32_to_cpu(sb->major_version), |
| 1763 | le32_to_cpu(sb->feature_map), | 1764 | le32_to_cpu(sb->feature_map), |
| 1764 | uuid[0], uuid[1], uuid[2], uuid[3], | 1765 | uuid[0], uuid[1], uuid[2], uuid[3], |
| @@ -1770,12 +1771,13 @@ static void print_sb_1(struct mdp_superblock_1 *sb) | |||
| 1770 | & MD_SUPERBLOCK_1_TIME_SEC_MASK); | 1771 | & MD_SUPERBLOCK_1_TIME_SEC_MASK); |
| 1771 | 1772 | ||
| 1772 | uuid = sb->device_uuid; | 1773 | uuid = sb->device_uuid; |
| 1773 | printk(KERN_INFO "md: L%u SZ%llu RD:%u LO:%u CS:%u DO:%llu DS:%llu SO:%llu" | 1774 | printk(KERN_INFO |
| 1775 | "md: L%u SZ%llu RD:%u LO:%u CS:%u DO:%llu DS:%llu SO:%llu" | ||
| 1774 | " RO:%llu\n" | 1776 | " RO:%llu\n" |
| 1775 | KERN_INFO "md: Dev:%08x UUID: %02x%02x%02x%02x:%02x%02x:%02x%02x:%02x%02x" | 1777 | "md: Dev:%08x UUID: %02x%02x%02x%02x:%02x%02x:%02x%02x:%02x%02x" |
| 1776 | ":%02x%02x%02x%02x%02x%02x\n" | 1778 | ":%02x%02x%02x%02x%02x%02x\n" |
| 1777 | KERN_INFO "md: (F:0x%08x) UT:%llu Events:%llu ResyncOffset:%llu CSUM:0x%08x\n" | 1779 | "md: (F:0x%08x) UT:%llu Events:%llu ResyncOffset:%llu CSUM:0x%08x\n" |
| 1778 | KERN_INFO "md: (MaxDev:%u) \n", | 1780 | "md: (MaxDev:%u) \n", |
| 1779 | le32_to_cpu(sb->level), | 1781 | le32_to_cpu(sb->level), |
| 1780 | (unsigned long long)le64_to_cpu(sb->size), | 1782 | (unsigned long long)le64_to_cpu(sb->size), |
| 1781 | le32_to_cpu(sb->raid_disks), | 1783 | le32_to_cpu(sb->raid_disks), |
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c index 7ac12cb0be4a..5b6e58a3ba46 100644 --- a/drivers/mfd/dm355evm_msp.c +++ b/drivers/mfd/dm355evm_msp.c | |||
| @@ -32,8 +32,7 @@ | |||
| 32 | * This driver was tested with firmware revision A4. | 32 | * This driver was tested with firmware revision A4. |
| 33 | */ | 33 | */ |
| 34 | 34 | ||
| 35 | #if defined(CONFIG_KEYBOARD_DM355EVM) \ | 35 | #if defined(CONFIG_INPUT_DM355EVM) || defined(CONFIG_INPUT_DM355EVM_MODULE) |
| 36 | || defined(CONFIG_KEYBOARD_DM355EVM_MODULE) | ||
| 37 | #define msp_has_keyboard() true | 36 | #define msp_has_keyboard() true |
| 38 | #else | 37 | #else |
| 39 | #define msp_has_keyboard() false | 38 | #define msp_has_keyboard() false |
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 8d1c60a3f0df..5d778ec8cdb2 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c | |||
| @@ -235,7 +235,7 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg) | |||
| 235 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 235 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
| 236 | 236 | ||
| 237 | dev_dbg(xpnet, "passing skb to network layer\n" | 237 | dev_dbg(xpnet, "passing skb to network layer\n" |
| 238 | KERN_DEBUG "\tskb->head=0x%p skb->data=0x%p skb->tail=0x%p " | 238 | "\tskb->head=0x%p skb->data=0x%p skb->tail=0x%p " |
| 239 | "skb->end=0x%p skb->len=%d\n", | 239 | "skb->end=0x%p skb->len=%d\n", |
| 240 | (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb), | 240 | (void *)skb->head, (void *)skb->data, skb_tail_pointer(skb), |
| 241 | skb_end_pointer(skb), skb->len); | 241 | skb_end_pointer(skb), skb->len); |
| @@ -399,7 +399,7 @@ xpnet_send(struct sk_buff *skb, struct xpnet_pending_msg *queued_msg, | |||
| 399 | msg->buf_pa = xp_pa((void *)start_addr); | 399 | msg->buf_pa = xp_pa((void *)start_addr); |
| 400 | 400 | ||
| 401 | dev_dbg(xpnet, "sending XPC message to %d:%d\n" | 401 | dev_dbg(xpnet, "sending XPC message to %d:%d\n" |
| 402 | KERN_DEBUG "msg->buf_pa=0x%lx, msg->size=%u, " | 402 | "msg->buf_pa=0x%lx, msg->size=%u, " |
| 403 | "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n", | 403 | "msg->leadin_ignore=%u, msg->tailout_ignore=%u\n", |
| 404 | dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size, | 404 | dest_partid, XPC_NET_CHANNEL, msg->buf_pa, msg->size, |
| 405 | msg->leadin_ignore, msg->tailout_ignore); | 405 | msg->leadin_ignore, msg->tailout_ignore); |
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c index 85a18175730b..08787f5a22a3 100644 --- a/drivers/net/a2065.c +++ b/drivers/net/a2065.c | |||
| @@ -569,16 +569,8 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
| 569 | 569 | ||
| 570 | #ifdef DEBUG_DRIVER | 570 | #ifdef DEBUG_DRIVER |
| 571 | /* dump the packet */ | 571 | /* dump the packet */ |
| 572 | { | 572 | print_hex_dump(KERN_DEBUG, "skb->data: ", DUMP_PREFIX_NONE, |
| 573 | int i; | 573 | 16, 1, skb->data, 64, true); |
| 574 | |||
| 575 | for (i = 0; i < 64; i++) { | ||
| 576 | if ((i % 16) == 0) | ||
| 577 | printk("\n" KERN_DEBUG); | ||
| 578 | printk ("%2.2x ", skb->data [i]); | ||
| 579 | } | ||
| 580 | printk("\n"); | ||
| 581 | } | ||
| 582 | #endif | 574 | #endif |
| 583 | entry = lp->tx_new & lp->tx_ring_mod_mask; | 575 | entry = lp->tx_new & lp->tx_ring_mod_mask; |
| 584 | ib->btx_ring [entry].length = (-skblen) | 0xf000; | 576 | ib->btx_ring [entry].length = (-skblen) | 0xf000; |
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index d6d4ab3b430c..7d227cdab9f8 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
| @@ -158,15 +158,12 @@ module_exit(arcnet_exit); | |||
| 158 | void arcnet_dump_skb(struct net_device *dev, | 158 | void arcnet_dump_skb(struct net_device *dev, |
| 159 | struct sk_buff *skb, char *desc) | 159 | struct sk_buff *skb, char *desc) |
| 160 | { | 160 | { |
| 161 | int i; | 161 | char hdr[32]; |
| 162 | 162 | ||
| 163 | printk(KERN_DEBUG "%6s: skb dump (%s) follows:", dev->name, desc); | 163 | /* dump the packet */ |
| 164 | for (i = 0; i < skb->len; i++) { | 164 | snprintf(hdr, sizeof(hdr), "%6s:%s skb->data:", dev->name, desc); |
| 165 | if (i % 16 == 0) | 165 | print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET, |
| 166 | printk("\n" KERN_DEBUG "[%04X] ", i); | 166 | 16, 1, skb->data, skb->len, true); |
| 167 | printk("%02X ", ((u_char *) skb->data)[i]); | ||
| 168 | } | ||
| 169 | printk("\n"); | ||
| 170 | } | 167 | } |
| 171 | 168 | ||
| 172 | EXPORT_SYMBOL(arcnet_dump_skb); | 169 | EXPORT_SYMBOL(arcnet_dump_skb); |
| @@ -184,6 +181,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, | |||
| 184 | int i, length; | 181 | int i, length; |
| 185 | unsigned long flags = 0; | 182 | unsigned long flags = 0; |
| 186 | static uint8_t buf[512]; | 183 | static uint8_t buf[512]; |
| 184 | char hdr[32]; | ||
| 187 | 185 | ||
| 188 | /* hw.copy_from_card expects IRQ context so take the IRQ lock | 186 | /* hw.copy_from_card expects IRQ context so take the IRQ lock |
| 189 | to keep it single threaded */ | 187 | to keep it single threaded */ |
| @@ -197,14 +195,10 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum, | |||
| 197 | /* if the offset[0] byte is nonzero, this is a 256-byte packet */ | 195 | /* if the offset[0] byte is nonzero, this is a 256-byte packet */ |
| 198 | length = (buf[2] ? 256 : 512); | 196 | length = (buf[2] ? 256 : 512); |
| 199 | 197 | ||
| 200 | printk(KERN_DEBUG "%6s: packet dump (%s) follows:", dev->name, desc); | 198 | /* dump the packet */ |
| 201 | for (i = 0; i < length; i++) { | 199 | snprintf(hdr, sizeof(hdr), "%6s:%s packet dump:", dev->name, desc); |
| 202 | if (i % 16 == 0) | 200 | print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET, |
| 203 | printk("\n" KERN_DEBUG "[%04X] ", i); | 201 | 16, 1, buf, length, true); |
| 204 | printk("%02X ", buf[i]); | ||
| 205 | } | ||
| 206 | printk("\n"); | ||
| 207 | |||
| 208 | } | 202 | } |
| 209 | 203 | ||
| 210 | #else | 204 | #else |
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 9578a3dfac01..206144f2470f 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
| @@ -428,10 +428,11 @@ bmac_init_phy(struct net_device *dev) | |||
| 428 | printk(KERN_DEBUG "phy registers:"); | 428 | printk(KERN_DEBUG "phy registers:"); |
| 429 | for (addr = 0; addr < 32; ++addr) { | 429 | for (addr = 0; addr < 32; ++addr) { |
| 430 | if ((addr & 7) == 0) | 430 | if ((addr & 7) == 0) |
| 431 | printk("\n" KERN_DEBUG); | 431 | printk(KERN_DEBUG); |
| 432 | printk(" %.4x", bmac_mif_read(dev, addr)); | 432 | printk(KERN_CONT " %.4x", bmac_mif_read(dev, addr)); |
| 433 | } | 433 | } |
| 434 | printk("\n"); | 434 | printk(KERN_CONT "\n"); |
| 435 | |||
| 435 | if (bp->is_bmac_plus) { | 436 | if (bp->is_bmac_plus) { |
| 436 | unsigned int capable, ctrl; | 437 | unsigned int capable, ctrl; |
| 437 | 438 | ||
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 6c67be679764..c36a5f33739f 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
| @@ -484,8 +484,9 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
| 484 | 484 | ||
| 485 | mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); | 485 | mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); |
| 486 | mark = ((mark + 0x3) & ~0x3); | 486 | mark = ((mark + 0x3) & ~0x3); |
| 487 | printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n" KERN_ERR, mark); | 487 | printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n", mark); |
| 488 | 488 | ||
| 489 | printk(KERN_ERR PFX); | ||
| 489 | for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { | 490 | for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { |
| 490 | for (word = 0; word < 8; word++) | 491 | for (word = 0; word < 8; word++) |
| 491 | data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + | 492 | data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + |
| @@ -500,7 +501,7 @@ static void bnx2x_fw_dump(struct bnx2x *bp) | |||
| 500 | data[8] = 0x0; | 501 | data[8] = 0x0; |
| 501 | printk(KERN_CONT "%s", (char *)data); | 502 | printk(KERN_CONT "%s", (char *)data); |
| 502 | } | 503 | } |
| 503 | printk("\n" KERN_ERR PFX "end of fw dump\n"); | 504 | printk(KERN_ERR PFX "end of fw dump\n"); |
| 504 | } | 505 | } |
| 505 | 506 | ||
| 506 | static void bnx2x_panic_dump(struct bnx2x *bp) | 507 | static void bnx2x_panic_dump(struct bnx2x *bp) |
| @@ -7354,7 +7355,7 @@ static void bnx2x_reset_task(struct work_struct *work) | |||
| 7354 | #ifdef BNX2X_STOP_ON_ERROR | 7355 | #ifdef BNX2X_STOP_ON_ERROR |
| 7355 | BNX2X_ERR("reset task called but STOP_ON_ERROR defined" | 7356 | BNX2X_ERR("reset task called but STOP_ON_ERROR defined" |
| 7356 | " so reset not done to allow debug dump,\n" | 7357 | " so reset not done to allow debug dump,\n" |
| 7357 | KERN_ERR " you will need to reboot when done\n"); | 7358 | " you will need to reboot when done\n"); |
| 7358 | return; | 7359 | return; |
| 7359 | #endif | 7360 | #endif |
| 7360 | 7361 | ||
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 538dda4422dc..fb5df5c6203e 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
| @@ -642,8 +642,7 @@ static int setup_sge_qsets(struct adapter *adap) | |||
| 642 | struct port_info *pi = netdev_priv(dev); | 642 | struct port_info *pi = netdev_priv(dev); |
| 643 | 643 | ||
| 644 | pi->qs = &adap->sge.qs[pi->first_qset]; | 644 | pi->qs = &adap->sge.qs[pi->first_qset]; |
| 645 | for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; | 645 | for (j = 0; j < pi->nqsets; ++j, ++qset_idx) { |
| 646 | ++j, ++qset_idx) { | ||
| 647 | set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); | 646 | set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); |
| 648 | err = t3_sge_alloc_qset(adap, qset_idx, 1, | 647 | err = t3_sge_alloc_qset(adap, qset_idx, 1, |
| 649 | (adap->flags & USING_MSIX) ? qset_idx + 1 : | 648 | (adap->flags & USING_MSIX) ? qset_idx + 1 : |
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index 2df8fb0af701..12fd446f9895 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c | |||
| @@ -1820,11 +1820,19 @@ static int emac_dev_setmac_addr(struct net_device *ndev, void *addr) | |||
| 1820 | struct device *emac_dev = &priv->ndev->dev; | 1820 | struct device *emac_dev = &priv->ndev->dev; |
| 1821 | struct sockaddr *sa = addr; | 1821 | struct sockaddr *sa = addr; |
| 1822 | 1822 | ||
| 1823 | if (!is_valid_ether_addr(sa->sa_data)) | ||
| 1824 | return -EINVAL; | ||
| 1825 | |||
| 1823 | /* Store mac addr in priv and rx channel and set it in EMAC hw */ | 1826 | /* Store mac addr in priv and rx channel and set it in EMAC hw */ |
| 1824 | memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len); | 1827 | memcpy(priv->mac_addr, sa->sa_data, ndev->addr_len); |
| 1825 | memcpy(rxch->mac_addr, sa->sa_data, ndev->addr_len); | ||
| 1826 | memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len); | 1828 | memcpy(ndev->dev_addr, sa->sa_data, ndev->addr_len); |
| 1827 | emac_setmac(priv, EMAC_DEF_RX_CH, rxch->mac_addr); | 1829 | |
| 1830 | /* If the interface is down - rxch is NULL. */ | ||
| 1831 | /* MAC address is configured only after the interface is enabled. */ | ||
| 1832 | if (netif_running(ndev)) { | ||
| 1833 | memcpy(rxch->mac_addr, sa->sa_data, ndev->addr_len); | ||
| 1834 | emac_setmac(priv, EMAC_DEF_RX_CH, rxch->mac_addr); | ||
| 1835 | } | ||
| 1828 | 1836 | ||
| 1829 | if (netif_msg_drv(priv)) | 1837 | if (netif_msg_drv(priv)) |
| 1830 | dev_notice(emac_dev, "DaVinci EMAC: emac_dev_setmac_addr %pM\n", | 1838 | dev_notice(emac_dev, "DaVinci EMAC: emac_dev_setmac_addr %pM\n", |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 895d72143ee0..4b6a219fecea 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
| @@ -268,8 +268,9 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 268 | printk(KERN_INFO "tx_coalesce:\t%d packets\n", | 268 | printk(KERN_INFO "tx_coalesce:\t%d packets\n", |
| 269 | tx_coalesce); | 269 | tx_coalesce); |
| 270 | if (np->coalesce) | 270 | if (np->coalesce) |
| 271 | printk(KERN_INFO "rx_coalesce:\t%d packets\n" | 271 | printk(KERN_INFO |
| 272 | KERN_INFO "rx_timeout: \t%d ns\n", | 272 | "rx_coalesce:\t%d packets\n" |
| 273 | "rx_timeout: \t%d ns\n", | ||
| 273 | np->rx_coalesce, np->rx_timeout*640); | 274 | np->rx_coalesce, np->rx_timeout*640); |
| 274 | if (np->vlan) | 275 | if (np->vlan) |
| 275 | printk(KERN_INFO "vlan(id):\t%d\n", np->vlan); | 276 | printk(KERN_INFO "vlan(id):\t%d\n", np->vlan); |
| @@ -1522,9 +1523,9 @@ mii_get_media (struct net_device *dev) | |||
| 1522 | printk (KERN_INFO "Operating at 10 Mbps, "); | 1523 | printk (KERN_INFO "Operating at 10 Mbps, "); |
| 1523 | } | 1524 | } |
| 1524 | if (bmcr & MII_BMCR_DUPLEX_MODE) { | 1525 | if (bmcr & MII_BMCR_DUPLEX_MODE) { |
| 1525 | printk ("Full duplex\n"); | 1526 | printk (KERN_CONT "Full duplex\n"); |
| 1526 | } else { | 1527 | } else { |
| 1527 | printk ("Half duplex\n"); | 1528 | printk (KERN_CONT "Half duplex\n"); |
| 1528 | } | 1529 | } |
| 1529 | } | 1530 | } |
| 1530 | if (np->tx_flow) | 1531 | if (np->tx_flow) |
| @@ -1614,9 +1615,9 @@ mii_set_media (struct net_device *dev) | |||
| 1614 | } | 1615 | } |
| 1615 | if (np->full_duplex) { | 1616 | if (np->full_duplex) { |
| 1616 | bmcr |= MII_BMCR_DUPLEX_MODE; | 1617 | bmcr |= MII_BMCR_DUPLEX_MODE; |
| 1617 | printk ("Full duplex\n"); | 1618 | printk (KERN_CONT "Full duplex\n"); |
| 1618 | } else { | 1619 | } else { |
| 1619 | printk ("Half duplex\n"); | 1620 | printk (KERN_CONT "Half duplex\n"); |
| 1620 | } | 1621 | } |
| 1621 | #if 0 | 1622 | #if 0 |
| 1622 | /* Set 1000BaseT Master/Slave setting */ | 1623 | /* Set 1000BaseT Master/Slave setting */ |
| @@ -1669,9 +1670,9 @@ mii_get_media_pcs (struct net_device *dev) | |||
| 1669 | __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); | 1670 | __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); |
| 1670 | printk (KERN_INFO "Operating at 1000 Mbps, "); | 1671 | printk (KERN_INFO "Operating at 1000 Mbps, "); |
| 1671 | if (bmcr & MII_BMCR_DUPLEX_MODE) { | 1672 | if (bmcr & MII_BMCR_DUPLEX_MODE) { |
| 1672 | printk ("Full duplex\n"); | 1673 | printk (KERN_CONT "Full duplex\n"); |
| 1673 | } else { | 1674 | } else { |
| 1674 | printk ("Half duplex\n"); | 1675 | printk (KERN_CONT "Half duplex\n"); |
| 1675 | } | 1676 | } |
| 1676 | } | 1677 | } |
| 1677 | if (np->tx_flow) | 1678 | if (np->tx_flow) |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index b60e27dfcfa7..88d7ebf31220 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
| @@ -338,8 +338,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
| 338 | #ifndef MODULE | 338 | #ifndef MODULE |
| 339 | static int printed_version; | 339 | static int printed_version; |
| 340 | if (!printed_version++) | 340 | if (!printed_version++) |
| 341 | printk (KERN_INFO "%s" KERN_INFO "%s", | 341 | printk(KERN_INFO "%s%s", version, version2); |
| 342 | version, version2); | ||
| 343 | #endif | 342 | #endif |
| 344 | 343 | ||
| 345 | card_idx++; | 344 | card_idx++; |
| @@ -1600,7 +1599,7 @@ static int __init epic_init (void) | |||
| 1600 | { | 1599 | { |
| 1601 | /* when a module, this is printed whether or not devices are found in probe */ | 1600 | /* when a module, this is printed whether or not devices are found in probe */ |
| 1602 | #ifdef MODULE | 1601 | #ifdef MODULE |
| 1603 | printk (KERN_INFO "%s" KERN_INFO "%s", | 1602 | printk (KERN_INFO "%s%s", |
| 1604 | version, version2); | 1603 | version, version2); |
| 1605 | #endif | 1604 | #endif |
| 1606 | 1605 | ||
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c index 891be28a7d4f..48385c42ab57 100644 --- a/drivers/net/fealnx.c +++ b/drivers/net/fealnx.c | |||
| @@ -1209,17 +1209,20 @@ static void fealnx_tx_timeout(struct net_device *dev) | |||
| 1209 | unsigned long flags; | 1209 | unsigned long flags; |
| 1210 | int i; | 1210 | int i; |
| 1211 | 1211 | ||
| 1212 | printk(KERN_WARNING "%s: Transmit timed out, status %8.8x," | 1212 | printk(KERN_WARNING |
| 1213 | " resetting...\n", dev->name, ioread32(ioaddr + ISR)); | 1213 | "%s: Transmit timed out, status %8.8x, resetting...\n", |
| 1214 | dev->name, ioread32(ioaddr + ISR)); | ||
| 1214 | 1215 | ||
| 1215 | { | 1216 | { |
| 1216 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); | 1217 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); |
| 1217 | for (i = 0; i < RX_RING_SIZE; i++) | 1218 | for (i = 0; i < RX_RING_SIZE; i++) |
| 1218 | printk(" %8.8x", (unsigned int) np->rx_ring[i].status); | 1219 | printk(KERN_CONT " %8.8x", |
| 1219 | printk("\n" KERN_DEBUG " Tx ring %p: ", np->tx_ring); | 1220 | (unsigned int) np->rx_ring[i].status); |
| 1221 | printk(KERN_CONT "\n"); | ||
| 1222 | printk(KERN_DEBUG " Tx ring %p: ", np->tx_ring); | ||
| 1220 | for (i = 0; i < TX_RING_SIZE; i++) | 1223 | for (i = 0; i < TX_RING_SIZE; i++) |
| 1221 | printk(" %4.4x", np->tx_ring[i].status); | 1224 | printk(KERN_CONT " %4.4x", np->tx_ring[i].status); |
| 1222 | printk("\n"); | 1225 | printk(KERN_CONT "\n"); |
| 1223 | } | 1226 | } |
| 1224 | 1227 | ||
| 1225 | spin_lock_irqsave(&np->lock, flags); | 1228 | spin_lock_irqsave(&np->lock, flags); |
diff --git a/drivers/net/fec.h b/drivers/net/fec.h index 30b7dd671336..cc47f3f057c7 100644 --- a/drivers/net/fec.h +++ b/drivers/net/fec.h | |||
| @@ -46,12 +46,12 @@ | |||
| 46 | 46 | ||
| 47 | #else | 47 | #else |
| 48 | 48 | ||
| 49 | #define FEC_ECNTRL; 0x000 /* Ethernet control reg */ | 49 | #define FEC_ECNTRL 0x000 /* Ethernet control reg */ |
| 50 | #define FEC_IEVENT; 0x004 /* Interrupt even reg */ | 50 | #define FEC_IEVENT 0x004 /* Interrupt even reg */ |
| 51 | #define FEC_IMASK; 0x008 /* Interrupt mask reg */ | 51 | #define FEC_IMASK 0x008 /* Interrupt mask reg */ |
| 52 | #define FEC_IVEC; 0x00c /* Interrupt vec status reg */ | 52 | #define FEC_IVEC 0x00c /* Interrupt vec status reg */ |
| 53 | #define FEC_R_DES_ACTIVE; 0x010 /* Receive descriptor reg */ | 53 | #define FEC_R_DES_ACTIVE 0x010 /* Receive descriptor reg */ |
| 54 | #define FEC_X_DES_ACTIVE; 0x01c /* Transmit descriptor reg */ | 54 | #define FEC_X_DES_ACTIVE 0x014 /* Transmit descriptor reg */ |
| 55 | #define FEC_MII_DATA 0x040 /* MII manage frame reg */ | 55 | #define FEC_MII_DATA 0x040 /* MII manage frame reg */ |
| 56 | #define FEC_MII_SPEED 0x044 /* MII speed control reg */ | 56 | #define FEC_MII_SPEED 0x044 /* MII speed control reg */ |
| 57 | #define FEC_R_BOUND 0x08c /* FIFO receive bound reg */ | 57 | #define FEC_R_BOUND 0x08c /* FIFO receive bound reg */ |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 9d5b62cb30f7..d62378cbc149 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
| @@ -173,8 +173,8 @@ static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; | |||
| 173 | 173 | ||
| 174 | static const char version[] __devinitconst = | 174 | static const char version[] __devinitconst = |
| 175 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n" | 175 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n" |
| 176 | KERN_INFO " Some modifications by Eric kasten <kasten@nscl.msu.edu>\n" | 176 | " Some modifications by Eric kasten <kasten@nscl.msu.edu>\n" |
| 177 | KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n"; | 177 | " Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n"; |
| 178 | 178 | ||
| 179 | 179 | ||
| 180 | /* IP_MF appears to be only defined in <netinet/ip.h>, however, | 180 | /* IP_MF appears to be only defined in <netinet/ip.h>, however, |
| @@ -1080,11 +1080,14 @@ static void hamachi_tx_timeout(struct net_device *dev) | |||
| 1080 | { | 1080 | { |
| 1081 | printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); | 1081 | printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); |
| 1082 | for (i = 0; i < RX_RING_SIZE; i++) | 1082 | for (i = 0; i < RX_RING_SIZE; i++) |
| 1083 | printk(" %8.8x", le32_to_cpu(hmp->rx_ring[i].status_n_length)); | 1083 | printk(KERN_CONT " %8.8x", |
| 1084 | printk("\n"KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); | 1084 | le32_to_cpu(hmp->rx_ring[i].status_n_length)); |
| 1085 | printk(KERN_CONT "\n"); | ||
| 1086 | printk(KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); | ||
| 1085 | for (i = 0; i < TX_RING_SIZE; i++) | 1087 | for (i = 0; i < TX_RING_SIZE; i++) |
| 1086 | printk(" %4.4x", le32_to_cpu(hmp->tx_ring[i].status_n_length)); | 1088 | printk(KERN_CONT " %4.4x", |
| 1087 | printk("\n"); | 1089 | le32_to_cpu(hmp->tx_ring[i].status_n_length)); |
| 1090 | printk(KERN_CONT "\n"); | ||
| 1088 | } | 1091 | } |
| 1089 | 1092 | ||
| 1090 | /* Reinit the hardware and make sure the Rx and Tx processes | 1093 | /* Reinit the hardware and make sure the Rx and Tx processes |
| @@ -1753,13 +1756,13 @@ static int hamachi_close(struct net_device *dev) | |||
| 1753 | 1756 | ||
| 1754 | #ifdef __i386__ | 1757 | #ifdef __i386__ |
| 1755 | if (hamachi_debug > 2) { | 1758 | if (hamachi_debug > 2) { |
| 1756 | printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", | 1759 | printk(KERN_DEBUG " Tx ring at %8.8x:\n", |
| 1757 | (int)hmp->tx_ring_dma); | 1760 | (int)hmp->tx_ring_dma); |
| 1758 | for (i = 0; i < TX_RING_SIZE; i++) | 1761 | for (i = 0; i < TX_RING_SIZE; i++) |
| 1759 | printk(" %c #%d desc. %8.8x %8.8x.\n", | 1762 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x.\n", |
| 1760 | readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ', | 1763 | readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ', |
| 1761 | i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr); | 1764 | i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr); |
| 1762 | printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", | 1765 | printk(KERN_DEBUG " Rx ring %8.8x:\n", |
| 1763 | (int)hmp->rx_ring_dma); | 1766 | (int)hmp->rx_ring_dma); |
| 1764 | for (i = 0; i < RX_RING_SIZE; i++) { | 1767 | for (i = 0; i < RX_RING_SIZE; i++) { |
| 1765 | printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n", | 1768 | printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n", |
| @@ -1770,7 +1773,7 @@ static int hamachi_close(struct net_device *dev) | |||
| 1770 | u16 *addr = (u16 *) | 1773 | u16 *addr = (u16 *) |
| 1771 | hmp->rx_skbuff[i]->data; | 1774 | hmp->rx_skbuff[i]->data; |
| 1772 | int j; | 1775 | int j; |
| 1773 | 1776 | printk(KERN_DEBUG "Addr: "); | |
| 1774 | for (j = 0; j < 0x50; j++) | 1777 | for (j = 0; j < 0x50; j++) |
| 1775 | printk(" %4.4x", addr[j]); | 1778 | printk(" %4.4x", addr[j]); |
| 1776 | printk("\n"); | 1779 | printk("\n"); |
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 5e4b7afd0683..352703255bba 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
| @@ -68,7 +68,7 @@ static const char paranoia_str[] = KERN_ERR | |||
| 68 | 68 | ||
| 69 | static const char bc_drvname[] = "baycom_epp"; | 69 | static const char bc_drvname[] = "baycom_epp"; |
| 70 | static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 70 | static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
| 71 | KERN_INFO "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n"; | 71 | "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n"; |
| 72 | 72 | ||
| 73 | /* --------------------------------------------------------------------- */ | 73 | /* --------------------------------------------------------------------- */ |
| 74 | 74 | ||
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c index 2e6fc4dc74b1..5f5af9a606f8 100644 --- a/drivers/net/hamradio/baycom_par.c +++ b/drivers/net/hamradio/baycom_par.c | |||
| @@ -102,7 +102,7 @@ | |||
| 102 | 102 | ||
| 103 | static const char bc_drvname[] = "baycom_par"; | 103 | static const char bc_drvname[] = "baycom_par"; |
| 104 | static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 104 | static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
| 105 | KERN_INFO "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n"; | 105 | "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n"; |
| 106 | 106 | ||
| 107 | /* --------------------------------------------------------------------- */ | 107 | /* --------------------------------------------------------------------- */ |
| 108 | 108 | ||
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c index b6a816e60c0f..aa4488e871b2 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c | |||
| @@ -91,7 +91,7 @@ | |||
| 91 | 91 | ||
| 92 | static const char bc_drvname[] = "baycom_ser_fdx"; | 92 | static const char bc_drvname[] = "baycom_ser_fdx"; |
| 93 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 93 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
| 94 | KERN_INFO "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; | 94 | "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; |
| 95 | 95 | ||
| 96 | /* --------------------------------------------------------------------- */ | 96 | /* --------------------------------------------------------------------- */ |
| 97 | 97 | ||
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c index 3bcc57acbe6d..88c593596020 100644 --- a/drivers/net/hamradio/baycom_ser_hdx.c +++ b/drivers/net/hamradio/baycom_ser_hdx.c | |||
| @@ -79,7 +79,7 @@ | |||
| 79 | 79 | ||
| 80 | static const char bc_drvname[] = "baycom_ser_hdx"; | 80 | static const char bc_drvname[] = "baycom_ser_hdx"; |
| 81 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" | 81 | static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" |
| 82 | KERN_INFO "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; | 82 | "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; |
| 83 | 83 | ||
| 84 | /* --------------------------------------------------------------------- */ | 84 | /* --------------------------------------------------------------------- */ |
| 85 | 85 | ||
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index efd9be214885..ac28dd5a4fd1 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
| @@ -190,6 +190,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
| 190 | phy->ops.write_reg = igb_write_phy_reg_igp; | 190 | phy->ops.write_reg = igb_write_phy_reg_igp; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | /* set lan id */ | ||
| 194 | hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> | ||
| 195 | E1000_STATUS_FUNC_SHIFT; | ||
| 196 | |||
| 193 | /* Set phy->phy_addr and phy->id. */ | 197 | /* Set phy->phy_addr and phy->id. */ |
| 194 | ret_val = igb_get_phy_id_82575(hw); | 198 | ret_val = igb_get_phy_id_82575(hw); |
| 195 | if (ret_val) | 199 | if (ret_val) |
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c index d56890f5c9d5..7c5978ad929a 100644 --- a/drivers/net/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c | |||
| @@ -138,6 +138,10 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
| 138 | adapter->hw.fc.requested_mode = ixgbe_fc_none; | 138 | adapter->hw.fc.requested_mode = ixgbe_fc_none; |
| 139 | } | 139 | } |
| 140 | adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; | 140 | adapter->flags &= ~IXGBE_FLAG_RSS_ENABLED; |
| 141 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) { | ||
| 142 | adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
| 143 | adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | ||
| 144 | } | ||
| 141 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; | 145 | adapter->flags |= IXGBE_FLAG_DCB_ENABLED; |
| 142 | ixgbe_init_interrupt_scheme(adapter); | 146 | ixgbe_init_interrupt_scheme(adapter); |
| 143 | if (netif_running(netdev)) | 147 | if (netif_running(netdev)) |
| @@ -154,6 +158,8 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state) | |||
| 154 | adapter->dcb_cfg.pfc_mode_enable = false; | 158 | adapter->dcb_cfg.pfc_mode_enable = false; |
| 155 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; | 159 | adapter->flags &= ~IXGBE_FLAG_DCB_ENABLED; |
| 156 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 160 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
| 161 | if (adapter->hw.mac.type == ixgbe_mac_82599EB) | ||
| 162 | adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
| 157 | ixgbe_init_interrupt_scheme(adapter); | 163 | ixgbe_init_interrupt_scheme(adapter); |
| 158 | if (netif_running(netdev)) | 164 | if (netif_running(netdev)) |
| 159 | netdev->netdev_ops->ndo_open(netdev); | 165 | netdev->netdev_ops->ndo_open(netdev); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index a3061aacffd8..e3442f47f932 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
| @@ -3130,7 +3130,11 @@ static inline bool ixgbe_set_fcoe_queues(struct ixgbe_adapter *adapter) | |||
| 3130 | #endif | 3130 | #endif |
| 3131 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { | 3131 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { |
| 3132 | DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); | 3132 | DPRINTK(PROBE, INFO, "FCOE enabled with RSS \n"); |
| 3133 | ixgbe_set_rss_queues(adapter); | 3133 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || |
| 3134 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) | ||
| 3135 | ixgbe_set_fdir_queues(adapter); | ||
| 3136 | else | ||
| 3137 | ixgbe_set_rss_queues(adapter); | ||
| 3134 | } | 3138 | } |
| 3135 | /* adding FCoE rx rings to the end */ | 3139 | /* adding FCoE rx rings to the end */ |
| 3136 | f->mask = adapter->num_rx_queues; | 3140 | f->mask = adapter->num_rx_queues; |
| @@ -3388,7 +3392,12 @@ static inline bool ixgbe_cache_ring_fcoe(struct ixgbe_adapter *adapter) | |||
| 3388 | } | 3392 | } |
| 3389 | #endif /* CONFIG_IXGBE_DCB */ | 3393 | #endif /* CONFIG_IXGBE_DCB */ |
| 3390 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { | 3394 | if (adapter->flags & IXGBE_FLAG_RSS_ENABLED) { |
| 3391 | ixgbe_cache_ring_rss(adapter); | 3395 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || |
| 3396 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) | ||
| 3397 | ixgbe_cache_ring_fdir(adapter); | ||
| 3398 | else | ||
| 3399 | ixgbe_cache_ring_rss(adapter); | ||
| 3400 | |||
| 3392 | fcoe_i = f->mask; | 3401 | fcoe_i = f->mask; |
| 3393 | } | 3402 | } |
| 3394 | for (i = 0; i < f->indices; i++, fcoe_i++) | 3403 | for (i = 0; i < f->indices; i++, fcoe_i++) |
| @@ -5578,12 +5587,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
| 5578 | netdev->features |= NETIF_F_FCOE_CRC; | 5587 | netdev->features |= NETIF_F_FCOE_CRC; |
| 5579 | netdev->features |= NETIF_F_FSO; | 5588 | netdev->features |= NETIF_F_FSO; |
| 5580 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | 5589 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; |
| 5581 | DPRINTK(DRV, INFO, "FCoE enabled, " | ||
| 5582 | "disabling Flow Director\n"); | ||
| 5583 | adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; | ||
| 5584 | adapter->flags &= | ||
| 5585 | ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE; | ||
| 5586 | adapter->atr_sample_rate = 0; | ||
| 5587 | } else { | 5590 | } else { |
| 5588 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; | 5591 | adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED; |
| 5589 | } | 5592 | } |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index c9bfe4eea189..78c088331f57 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
| @@ -130,8 +130,8 @@ static int full_duplex[MAX_UNITS]; | |||
| 130 | static const char version[] __devinitconst = | 130 | static const char version[] __devinitconst = |
| 131 | KERN_INFO DRV_NAME " dp8381x driver, version " | 131 | KERN_INFO DRV_NAME " dp8381x driver, version " |
| 132 | DRV_VERSION ", " DRV_RELDATE "\n" | 132 | DRV_VERSION ", " DRV_RELDATE "\n" |
| 133 | KERN_INFO " originally by Donald Becker <becker@scyld.com>\n" | 133 | " originally by Donald Becker <becker@scyld.com>\n" |
| 134 | KERN_INFO " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n"; | 134 | " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n"; |
| 135 | 135 | ||
| 136 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 136 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
| 137 | MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver"); | 137 | MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver"); |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 5c3e242428f1..992dbfffdb05 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
| @@ -321,7 +321,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr) | |||
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | if (ei_debug && version_printed++ == 0) | 323 | if (ei_debug && version_printed++ == 0) |
| 324 | printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2); | 324 | printk(KERN_INFO "%s%s", version1, version2); |
| 325 | 325 | ||
| 326 | printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr); | 326 | printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr); |
| 327 | 327 | ||
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c index 8c1f6988f398..89f7b2ad5231 100644 --- a/drivers/net/pci-skeleton.c +++ b/drivers/net/pci-skeleton.c | |||
| @@ -105,7 +105,7 @@ IVc. Errata | |||
| 105 | 105 | ||
| 106 | static char version[] __devinitdata = | 106 | static char version[] __devinitdata = |
| 107 | KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n" | 107 | KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n" |
| 108 | KERN_INFO " Support available from http://foo.com/bar/baz.html\n"; | 108 | " Support available from http://foo.com/bar/baz.html\n"; |
| 109 | 109 | ||
| 110 | /* define to 1 to enable PIO instead of MMIO */ | 110 | /* define to 1 to enable PIO instead of MMIO */ |
| 111 | #undef USE_IO_OPS | 111 | #undef USE_IO_OPS |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index f51944b28cfa..06618af1a468 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
| @@ -298,14 +298,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) | |||
| 298 | 298 | ||
| 299 | strcpy(info->node.dev_name, dev->name); | 299 | strcpy(info->node.dev_name, dev->name); |
| 300 | 300 | ||
| 301 | printk(KERN_INFO "%s: port %#3lx, irq %d,", | 301 | printk(KERN_INFO |
| 302 | dev->name, dev->base_addr, dev->irq); | 302 | "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n", |
| 303 | printk (" mmio %#5lx,", (u_long)ti->mmio); | 303 | dev->name, dev->base_addr, dev->irq, |
| 304 | printk (" sram %#5lx,", (u_long)ti->sram_base << 12); | 304 | (u_long)ti->mmio, (u_long)(ti->sram_base << 12), |
| 305 | printk ("\n" KERN_INFO " hwaddr="); | 305 | dev->dev_addr); |
| 306 | for (i = 0; i < TR_ALEN; i++) | ||
| 307 | printk("%02X", dev->dev_addr[i]); | ||
| 308 | printk("\n"); | ||
| 309 | return 0; | 306 | return 0; |
| 310 | 307 | ||
| 311 | cs_failed: | 308 | cs_failed: |
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index 02ef63ed1f99..36de91baf238 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
| @@ -1425,15 +1425,12 @@ static void BuildLAF(int *ladrf, int *adr) | |||
| 1425 | ladrf[byte] |= (1 << (hashcode & 7)); | 1425 | ladrf[byte] |= (1 << (hashcode & 7)); |
| 1426 | 1426 | ||
| 1427 | #ifdef PCMCIA_DEBUG | 1427 | #ifdef PCMCIA_DEBUG |
| 1428 | if (pc_debug > 2) { | 1428 | if (pc_debug > 2) |
| 1429 | printk(KERN_DEBUG " adr ="); | 1429 | printk(KERN_DEBUG " adr =%pM\n", adr); |
| 1430 | for (i = 0; i < 6; i++) | 1430 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); |
| 1431 | printk(" %02X", adr[i]); | 1431 | for (i = 0; i < 8; i++) |
| 1432 | printk("\n" KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63]" | 1432 | printk(KERN_CONT " %02X", ladrf[i]); |
| 1433 | " =", hashcode); | 1433 | printk(KERN_CONT "\n"); |
| 1434 | for (i = 0; i < 8; i++) | ||
| 1435 | printk(" %02X", ladrf[i]); | ||
| 1436 | printk("\n"); | ||
| 1437 | } | 1434 | } |
| 1438 | #endif | 1435 | #endif |
| 1439 | } /* BuildLAF */ | 1436 | } /* BuildLAF */ |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index 1c35e1d637a0..28368157dac4 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
| @@ -485,7 +485,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
| 485 | &new_ring_dma_addr); | 485 | &new_ring_dma_addr); |
| 486 | if (new_tx_ring == NULL) { | 486 | if (new_tx_ring == NULL) { |
| 487 | if (netif_msg_drv(lp)) | 487 | if (netif_msg_drv(lp)) |
| 488 | printk("\n" KERN_ERR | 488 | printk(KERN_ERR |
| 489 | "%s: Consistent memory allocation failed.\n", | 489 | "%s: Consistent memory allocation failed.\n", |
| 490 | dev->name); | 490 | dev->name); |
| 491 | return; | 491 | return; |
| @@ -496,7 +496,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
| 496 | GFP_ATOMIC); | 496 | GFP_ATOMIC); |
| 497 | if (!new_dma_addr_list) { | 497 | if (!new_dma_addr_list) { |
| 498 | if (netif_msg_drv(lp)) | 498 | if (netif_msg_drv(lp)) |
| 499 | printk("\n" KERN_ERR | 499 | printk(KERN_ERR |
| 500 | "%s: Memory allocation failed.\n", dev->name); | 500 | "%s: Memory allocation failed.\n", dev->name); |
| 501 | goto free_new_tx_ring; | 501 | goto free_new_tx_ring; |
| 502 | } | 502 | } |
| @@ -505,7 +505,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev, | |||
| 505 | GFP_ATOMIC); | 505 | GFP_ATOMIC); |
| 506 | if (!new_skb_list) { | 506 | if (!new_skb_list) { |
| 507 | if (netif_msg_drv(lp)) | 507 | if (netif_msg_drv(lp)) |
| 508 | printk("\n" KERN_ERR | 508 | printk(KERN_ERR |
| 509 | "%s: Memory allocation failed.\n", dev->name); | 509 | "%s: Memory allocation failed.\n", dev->name); |
| 510 | goto free_new_lists; | 510 | goto free_new_lists; |
| 511 | } | 511 | } |
| @@ -563,7 +563,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
| 563 | &new_ring_dma_addr); | 563 | &new_ring_dma_addr); |
| 564 | if (new_rx_ring == NULL) { | 564 | if (new_rx_ring == NULL) { |
| 565 | if (netif_msg_drv(lp)) | 565 | if (netif_msg_drv(lp)) |
| 566 | printk("\n" KERN_ERR | 566 | printk(KERN_ERR |
| 567 | "%s: Consistent memory allocation failed.\n", | 567 | "%s: Consistent memory allocation failed.\n", |
| 568 | dev->name); | 568 | dev->name); |
| 569 | return; | 569 | return; |
| @@ -574,7 +574,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
| 574 | GFP_ATOMIC); | 574 | GFP_ATOMIC); |
| 575 | if (!new_dma_addr_list) { | 575 | if (!new_dma_addr_list) { |
| 576 | if (netif_msg_drv(lp)) | 576 | if (netif_msg_drv(lp)) |
| 577 | printk("\n" KERN_ERR | 577 | printk(KERN_ERR |
| 578 | "%s: Memory allocation failed.\n", dev->name); | 578 | "%s: Memory allocation failed.\n", dev->name); |
| 579 | goto free_new_rx_ring; | 579 | goto free_new_rx_ring; |
| 580 | } | 580 | } |
| @@ -583,7 +583,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev, | |||
| 583 | GFP_ATOMIC); | 583 | GFP_ATOMIC); |
| 584 | if (!new_skb_list) { | 584 | if (!new_skb_list) { |
| 585 | if (netif_msg_drv(lp)) | 585 | if (netif_msg_drv(lp)) |
| 586 | printk("\n" KERN_ERR | 586 | printk(KERN_ERR |
| 587 | "%s: Memory allocation failed.\n", dev->name); | 587 | "%s: Memory allocation failed.\n", dev->name); |
| 588 | goto free_new_lists; | 588 | goto free_new_lists; |
| 589 | } | 589 | } |
| @@ -1766,38 +1766,38 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev) | |||
| 1766 | /* Version 0x2623 and 0x2624 */ | 1766 | /* Version 0x2623 and 0x2624 */ |
| 1767 | if (((chip_version + 1) & 0xfffe) == 0x2624) { | 1767 | if (((chip_version + 1) & 0xfffe) == 0x2624) { |
| 1768 | i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ | 1768 | i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ |
| 1769 | printk("\n" KERN_INFO " tx_start_pt(0x%04x):", i); | 1769 | printk(KERN_INFO " tx_start_pt(0x%04x):", i); |
| 1770 | switch (i >> 10) { | 1770 | switch (i >> 10) { |
| 1771 | case 0: | 1771 | case 0: |
| 1772 | printk(" 20 bytes,"); | 1772 | printk(KERN_CONT " 20 bytes,"); |
| 1773 | break; | 1773 | break; |
| 1774 | case 1: | 1774 | case 1: |
| 1775 | printk(" 64 bytes,"); | 1775 | printk(KERN_CONT " 64 bytes,"); |
| 1776 | break; | 1776 | break; |
| 1777 | case 2: | 1777 | case 2: |
| 1778 | printk(" 128 bytes,"); | 1778 | printk(KERN_CONT " 128 bytes,"); |
| 1779 | break; | 1779 | break; |
| 1780 | case 3: | 1780 | case 3: |
| 1781 | printk("~220 bytes,"); | 1781 | printk(KERN_CONT "~220 bytes,"); |
| 1782 | break; | 1782 | break; |
| 1783 | } | 1783 | } |
| 1784 | i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ | 1784 | i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ |
| 1785 | printk(" BCR18(%x):", i & 0xffff); | 1785 | printk(KERN_CONT " BCR18(%x):", i & 0xffff); |
| 1786 | if (i & (1 << 5)) | 1786 | if (i & (1 << 5)) |
| 1787 | printk("BurstWrEn "); | 1787 | printk(KERN_CONT "BurstWrEn "); |
| 1788 | if (i & (1 << 6)) | 1788 | if (i & (1 << 6)) |
| 1789 | printk("BurstRdEn "); | 1789 | printk(KERN_CONT "BurstRdEn "); |
| 1790 | if (i & (1 << 7)) | 1790 | if (i & (1 << 7)) |
| 1791 | printk("DWordIO "); | 1791 | printk(KERN_CONT "DWordIO "); |
| 1792 | if (i & (1 << 11)) | 1792 | if (i & (1 << 11)) |
| 1793 | printk("NoUFlow "); | 1793 | printk(KERN_CONT "NoUFlow "); |
| 1794 | i = a->read_bcr(ioaddr, 25); | 1794 | i = a->read_bcr(ioaddr, 25); |
| 1795 | printk("\n" KERN_INFO " SRAMSIZE=0x%04x,", i << 8); | 1795 | printk(KERN_INFO " SRAMSIZE=0x%04x,", i << 8); |
| 1796 | i = a->read_bcr(ioaddr, 26); | 1796 | i = a->read_bcr(ioaddr, 26); |
| 1797 | printk(" SRAM_BND=0x%04x,", i << 8); | 1797 | printk(KERN_CONT " SRAM_BND=0x%04x,", i << 8); |
| 1798 | i = a->read_bcr(ioaddr, 27); | 1798 | i = a->read_bcr(ioaddr, 27); |
| 1799 | if (i & (1 << 14)) | 1799 | if (i & (1 << 14)) |
| 1800 | printk("LowLatRx"); | 1800 | printk(KERN_CONT "LowLatRx"); |
| 1801 | } | 1801 | } |
| 1802 | } | 1802 | } |
| 1803 | 1803 | ||
| @@ -1996,7 +1996,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
| 1996 | &lp->tx_ring_dma_addr); | 1996 | &lp->tx_ring_dma_addr); |
| 1997 | if (lp->tx_ring == NULL) { | 1997 | if (lp->tx_ring == NULL) { |
| 1998 | if (netif_msg_drv(lp)) | 1998 | if (netif_msg_drv(lp)) |
| 1999 | printk("\n" KERN_ERR PFX | 1999 | printk(KERN_ERR PFX |
| 2000 | "%s: Consistent memory allocation failed.\n", | 2000 | "%s: Consistent memory allocation failed.\n", |
| 2001 | name); | 2001 | name); |
| 2002 | return -ENOMEM; | 2002 | return -ENOMEM; |
| @@ -2008,7 +2008,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
| 2008 | &lp->rx_ring_dma_addr); | 2008 | &lp->rx_ring_dma_addr); |
| 2009 | if (lp->rx_ring == NULL) { | 2009 | if (lp->rx_ring == NULL) { |
| 2010 | if (netif_msg_drv(lp)) | 2010 | if (netif_msg_drv(lp)) |
| 2011 | printk("\n" KERN_ERR PFX | 2011 | printk(KERN_ERR PFX |
| 2012 | "%s: Consistent memory allocation failed.\n", | 2012 | "%s: Consistent memory allocation failed.\n", |
| 2013 | name); | 2013 | name); |
| 2014 | return -ENOMEM; | 2014 | return -ENOMEM; |
| @@ -2018,7 +2018,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
| 2018 | GFP_ATOMIC); | 2018 | GFP_ATOMIC); |
| 2019 | if (!lp->tx_dma_addr) { | 2019 | if (!lp->tx_dma_addr) { |
| 2020 | if (netif_msg_drv(lp)) | 2020 | if (netif_msg_drv(lp)) |
| 2021 | printk("\n" KERN_ERR PFX | 2021 | printk(KERN_ERR PFX |
| 2022 | "%s: Memory allocation failed.\n", name); | 2022 | "%s: Memory allocation failed.\n", name); |
| 2023 | return -ENOMEM; | 2023 | return -ENOMEM; |
| 2024 | } | 2024 | } |
| @@ -2027,7 +2027,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
| 2027 | GFP_ATOMIC); | 2027 | GFP_ATOMIC); |
| 2028 | if (!lp->rx_dma_addr) { | 2028 | if (!lp->rx_dma_addr) { |
| 2029 | if (netif_msg_drv(lp)) | 2029 | if (netif_msg_drv(lp)) |
| 2030 | printk("\n" KERN_ERR PFX | 2030 | printk(KERN_ERR PFX |
| 2031 | "%s: Memory allocation failed.\n", name); | 2031 | "%s: Memory allocation failed.\n", name); |
| 2032 | return -ENOMEM; | 2032 | return -ENOMEM; |
| 2033 | } | 2033 | } |
| @@ -2036,7 +2036,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
| 2036 | GFP_ATOMIC); | 2036 | GFP_ATOMIC); |
| 2037 | if (!lp->tx_skbuff) { | 2037 | if (!lp->tx_skbuff) { |
| 2038 | if (netif_msg_drv(lp)) | 2038 | if (netif_msg_drv(lp)) |
| 2039 | printk("\n" KERN_ERR PFX | 2039 | printk(KERN_ERR PFX |
| 2040 | "%s: Memory allocation failed.\n", name); | 2040 | "%s: Memory allocation failed.\n", name); |
| 2041 | return -ENOMEM; | 2041 | return -ENOMEM; |
| 2042 | } | 2042 | } |
| @@ -2045,7 +2045,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name) | |||
| 2045 | GFP_ATOMIC); | 2045 | GFP_ATOMIC); |
| 2046 | if (!lp->rx_skbuff) { | 2046 | if (!lp->rx_skbuff) { |
| 2047 | if (netif_msg_drv(lp)) | 2047 | if (netif_msg_drv(lp)) |
| 2048 | printk("\n" KERN_ERR PFX | 2048 | printk(KERN_ERR PFX |
| 2049 | "%s: Memory allocation failed.\n", name); | 2049 | "%s: Memory allocation failed.\n", name); |
| 2050 | return -ENOMEM; | 2050 | return -ENOMEM; |
| 2051 | } | 2051 | } |
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index ed63d23a6452..961b5397a531 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
| @@ -49,8 +49,8 @@ | |||
| 49 | #include <asm/processor.h> | 49 | #include <asm/processor.h> |
| 50 | 50 | ||
| 51 | #define DRV_NAME "r6040" | 51 | #define DRV_NAME "r6040" |
| 52 | #define DRV_VERSION "0.23" | 52 | #define DRV_VERSION "0.24" |
| 53 | #define DRV_RELDATE "05May2009" | 53 | #define DRV_RELDATE "08Jul2009" |
| 54 | 54 | ||
| 55 | /* PHY CHIP Address */ | 55 | /* PHY CHIP Address */ |
| 56 | #define PHY1_ADDR 1 /* For MAC1 */ | 56 | #define PHY1_ADDR 1 /* For MAC1 */ |
| @@ -704,8 +704,11 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id) | |||
| 704 | /* Read MISR status and clear */ | 704 | /* Read MISR status and clear */ |
| 705 | status = ioread16(ioaddr + MISR); | 705 | status = ioread16(ioaddr + MISR); |
| 706 | 706 | ||
| 707 | if (status == 0x0000 || status == 0xffff) | 707 | if (status == 0x0000 || status == 0xffff) { |
| 708 | /* Restore RDC MAC interrupt */ | ||
| 709 | iowrite16(misr, ioaddr + MIER); | ||
| 708 | return IRQ_NONE; | 710 | return IRQ_NONE; |
| 711 | } | ||
| 709 | 712 | ||
| 710 | /* RX interrupt request */ | 713 | /* RX interrupt request */ |
| 711 | if (status & RX_INTS) { | 714 | if (status & RX_INTS) { |
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index 838cce8b8fff..669253c7bd41 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c | |||
| @@ -180,7 +180,7 @@ static int full_duplex[MAX_UNITS] = {0, }; | |||
| 180 | /* These identify the driver base version and may not be removed. */ | 180 | /* These identify the driver base version and may not be removed. */ |
| 181 | static const char version[] __devinitconst = | 181 | static const char version[] __devinitconst = |
| 182 | KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" | 182 | KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" |
| 183 | KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; | 183 | " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; |
| 184 | 184 | ||
| 185 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 185 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
| 186 | MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); | 186 | MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 545f81b34ad7..d1521c3875b2 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
| @@ -1698,13 +1698,13 @@ static int netdev_close(struct net_device *dev) | |||
| 1698 | 1698 | ||
| 1699 | #ifdef __i386__ | 1699 | #ifdef __i386__ |
| 1700 | if (netif_msg_hw(np)) { | 1700 | if (netif_msg_hw(np)) { |
| 1701 | printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", | 1701 | printk(KERN_DEBUG " Tx ring at %8.8x:\n", |
| 1702 | (int)(np->tx_ring_dma)); | 1702 | (int)(np->tx_ring_dma)); |
| 1703 | for (i = 0; i < TX_RING_SIZE; i++) | 1703 | for (i = 0; i < TX_RING_SIZE; i++) |
| 1704 | printk(" #%d desc. %4.4x %8.8x %8.8x.\n", | 1704 | printk(KERN_DEBUG " #%d desc. %4.4x %8.8x %8.8x.\n", |
| 1705 | i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr, | 1705 | i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr, |
| 1706 | np->tx_ring[i].frag[0].length); | 1706 | np->tx_ring[i].frag[0].length); |
| 1707 | printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", | 1707 | printk(KERN_DEBUG " Rx ring %8.8x:\n", |
| 1708 | (int)(np->rx_ring_dma)); | 1708 | (int)(np->rx_ring_dma)); |
| 1709 | for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) { | 1709 | for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) { |
| 1710 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", | 1710 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", |
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 0f78f99f9b20..7030bd5e9848 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c | |||
| @@ -1132,7 +1132,9 @@ static int tsi108_get_mac(struct net_device *dev) | |||
| 1132 | } | 1132 | } |
| 1133 | 1133 | ||
| 1134 | if (!is_valid_ether_addr(dev->dev_addr)) { | 1134 | if (!is_valid_ether_addr(dev->dev_addr)) { |
| 1135 | printk("KERN_ERR: word1: %08x, word2: %08x\n", word1, word2); | 1135 | printk(KERN_ERR |
| 1136 | "%s: Invalid MAC address. word1: %08x, word2: %08x\n", | ||
| 1137 | dev->name, word1, word2); | ||
| 1136 | return -EINVAL; | 1138 | return -EINVAL; |
| 1137 | } | 1139 | } |
| 1138 | 1140 | ||
| @@ -1201,8 +1203,8 @@ static void tsi108_set_rx_mode(struct net_device *dev) | |||
| 1201 | __set_bit(hash, &data->mc_hash[0]); | 1203 | __set_bit(hash, &data->mc_hash[0]); |
| 1202 | } else { | 1204 | } else { |
| 1203 | printk(KERN_ERR | 1205 | printk(KERN_ERR |
| 1204 | "%s: got multicast address of length %d " | 1206 | "%s: got multicast address of length %d instead of 6.\n", |
| 1205 | "instead of 6.\n", dev->name, | 1207 | dev->name, |
| 1206 | mc->dmi_addrlen); | 1208 | mc->dmi_addrlen); |
| 1207 | } | 1209 | } |
| 1208 | 1210 | ||
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 81f054dbb88d..ef49744a5085 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
| @@ -944,9 +944,10 @@ static void de_set_media (struct de_private *de) | |||
| 944 | macmode &= ~FullDuplex; | 944 | macmode &= ~FullDuplex; |
| 945 | 945 | ||
| 946 | if (netif_msg_link(de)) { | 946 | if (netif_msg_link(de)) { |
| 947 | printk(KERN_INFO "%s: set link %s\n" | 947 | printk(KERN_INFO |
| 948 | KERN_INFO "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" | 948 | "%s: set link %s\n" |
| 949 | KERN_INFO "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", | 949 | "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" |
| 950 | "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", | ||
| 950 | de->dev->name, media_name[media], | 951 | de->dev->name, media_name[media], |
| 951 | de->dev->name, dr32(MacMode), dr32(SIAStatus), | 952 | de->dev->name, dr32(MacMode), dr32(SIAStatus), |
| 952 | dr32(CSR13), dr32(CSR14), dr32(CSR15), | 953 | dr32(CSR13), dr32(CSR14), dr32(CSR15), |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 2abb5d3becc6..99a63649f4fc 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
| @@ -570,16 +570,18 @@ static void tulip_tx_timeout(struct net_device *dev) | |||
| 570 | (unsigned int)tp->rx_ring[i].buffer2, | 570 | (unsigned int)tp->rx_ring[i].buffer2, |
| 571 | buf[0], buf[1], buf[2]); | 571 | buf[0], buf[1], buf[2]); |
| 572 | for (j = 0; buf[j] != 0xee && j < 1600; j++) | 572 | for (j = 0; buf[j] != 0xee && j < 1600; j++) |
| 573 | if (j < 100) printk(" %2.2x", buf[j]); | 573 | if (j < 100) |
| 574 | printk(" j=%d.\n", j); | 574 | printk(KERN_CONT " %2.2x", buf[j]); |
| 575 | printk(KERN_CONT " j=%d.\n", j); | ||
| 575 | } | 576 | } |
| 576 | printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); | 577 | printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); |
| 577 | for (i = 0; i < RX_RING_SIZE; i++) | 578 | for (i = 0; i < RX_RING_SIZE; i++) |
| 578 | printk(" %8.8x", (unsigned int)tp->rx_ring[i].status); | 579 | printk(KERN_CONT " %8.8x", |
| 579 | printk("\n" KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); | 580 | (unsigned int)tp->rx_ring[i].status); |
| 581 | printk(KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); | ||
| 580 | for (i = 0; i < TX_RING_SIZE; i++) | 582 | for (i = 0; i < TX_RING_SIZE; i++) |
| 581 | printk(" %8.8x", (unsigned int)tp->tx_ring[i].status); | 583 | printk(KERN_CONT " %8.8x", (unsigned int)tp->tx_ring[i].status); |
| 582 | printk("\n"); | 584 | printk(KERN_CONT "\n"); |
| 583 | } | 585 | } |
| 584 | #endif | 586 | #endif |
| 585 | 587 | ||
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 842b1a2c40d4..0f15773dae52 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
| @@ -142,7 +142,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; | |||
| 142 | static const char version[] __initconst = | 142 | static const char version[] __initconst = |
| 143 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " | 143 | KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " |
| 144 | DRV_RELDATE " Donald Becker <becker@scyld.com>\n" | 144 | DRV_RELDATE " Donald Becker <becker@scyld.com>\n" |
| 145 | KERN_INFO " http://www.scyld.com/network/drivers.html\n"; | 145 | " http://www.scyld.com/network/drivers.html\n"; |
| 146 | 146 | ||
| 147 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 147 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
| 148 | MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver"); | 148 | MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver"); |
| @@ -939,7 +939,7 @@ static void tx_timeout(struct net_device *dev) | |||
| 939 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); | 939 | printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); |
| 940 | for (i = 0; i < RX_RING_SIZE; i++) | 940 | for (i = 0; i < RX_RING_SIZE; i++) |
| 941 | printk(" %8.8x", (unsigned int)np->rx_ring[i].status); | 941 | printk(" %8.8x", (unsigned int)np->rx_ring[i].status); |
| 942 | printk("\n"KERN_DEBUG" Tx ring %p: ", np->tx_ring); | 942 | printk(KERN_DEBUG" Tx ring %p: ", np->tx_ring); |
| 943 | for (i = 0; i < TX_RING_SIZE; i++) | 943 | for (i = 0; i < TX_RING_SIZE; i++) |
| 944 | printk(" %8.8x", np->tx_ring[i].status); | 944 | printk(" %8.8x", np->tx_ring[i].status); |
| 945 | printk("\n"); | 945 | printk("\n"); |
| @@ -1520,7 +1520,7 @@ static int netdev_close(struct net_device *dev) | |||
| 1520 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n", | 1520 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n", |
| 1521 | i, np->tx_ring[i].length, | 1521 | i, np->tx_ring[i].length, |
| 1522 | np->tx_ring[i].status, np->tx_ring[i].buffer1); | 1522 | np->tx_ring[i].status, np->tx_ring[i].buffer1); |
| 1523 | printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", | 1523 | printk(KERN_DEBUG " Rx ring %8.8x:\n", |
| 1524 | (int)np->rx_ring); | 1524 | (int)np->rx_ring); |
| 1525 | for (i = 0; i < RX_RING_SIZE; i++) { | 1525 | for (i = 0; i < RX_RING_SIZE; i++) { |
| 1526 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", | 1526 | printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", |
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c index 223238de475c..1ea1ef6c3b96 100644 --- a/drivers/net/wan/hd64570.c +++ b/drivers/net/wan/hd64570.c | |||
| @@ -584,8 +584,9 @@ static void sca_dump_rings(struct net_device *dev) | |||
| 584 | sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); | 584 | sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); |
| 585 | for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) | 585 | for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) |
| 586 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); | 586 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); |
| 587 | printk(KERN_CONT "\n"); | ||
| 587 | 588 | ||
| 588 | printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " | 589 | printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " |
| 589 | "last=%u %sactive", | 590 | "last=%u %sactive", |
| 590 | sca_inw(get_dmac_tx(port) + CDAL, card), | 591 | sca_inw(get_dmac_tx(port) + CDAL, card), |
| 591 | sca_inw(get_dmac_tx(port) + EDAL, card), | 592 | sca_inw(get_dmac_tx(port) + EDAL, card), |
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index 497b003d7239..f099c34a3ae2 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
| @@ -529,8 +529,9 @@ static void sca_dump_rings(struct net_device *dev) | |||
| 529 | sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); | 529 | sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); |
| 530 | for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) | 530 | for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) |
| 531 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); | 531 | printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); |
| 532 | printk(KERN_CONT "\n"); | ||
| 532 | 533 | ||
| 533 | printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " | 534 | printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " |
| 534 | "last=%u %sactive", | 535 | "last=%u %sactive", |
| 535 | sca_inl(get_dmac_tx(port) + CDAL, card), | 536 | sca_inl(get_dmac_tx(port) + CDAL, card), |
| 536 | sca_inl(get_dmac_tx(port) + EDAL, card), | 537 | sca_inl(get_dmac_tx(port) + EDAL, card), |
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index 3fb9dbc88a1a..d14e95a08d66 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
| @@ -326,11 +326,9 @@ sbni_pci_probe( struct net_device *dev ) | |||
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) | 328 | if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) |
| 329 | printk( KERN_WARNING " WARNING: The PCI BIOS assigned " | 329 | printk( KERN_WARNING |
| 330 | "this PCI card to IRQ %d, which is unlikely " | 330 | " WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n" |
| 331 | "to work!.\n" | 331 | " You should use the PCI BIOS setup to assign a valid IRQ line.\n", |
| 332 | KERN_WARNING " You should use the PCI BIOS " | ||
| 333 | "setup to assign a valid IRQ line.\n", | ||
| 334 | pci_irq_line ); | 332 | pci_irq_line ); |
| 335 | 333 | ||
| 336 | /* avoiding re-enable dual adapters */ | 334 | /* avoiding re-enable dual adapters */ |
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig index d26e7b485315..eb0337c49546 100644 --- a/drivers/net/wireless/ath/Kconfig +++ b/drivers/net/wireless/ath/Kconfig | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | config ATH_COMMON | 1 | config ATH_COMMON |
| 2 | tristate "Atheros Wireless Cards" | 2 | tristate "Atheros Wireless Cards" |
| 3 | depends on WLAN_80211 | ||
| 3 | depends on ATH5K || ATH9K || AR9170_USB | 4 | depends on ATH5K || ATH9K || AR9170_USB |
| 4 | 5 | ||
| 5 | source "drivers/net/wireless/ath/ath5k/Kconfig" | 6 | source "drivers/net/wireless/ath/ath5k/Kconfig" |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index b61a071788a5..4ccf48e396df 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
| @@ -355,7 +355,14 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | if (bf_next == NULL) { | 357 | if (bf_next == NULL) { |
| 358 | INIT_LIST_HEAD(&bf_head); | 358 | /* |
| 359 | * Make sure the last desc is reclaimed if it | ||
| 360 | * not a holding desc. | ||
| 361 | */ | ||
| 362 | if (!bf_last->bf_stale) | ||
| 363 | list_move_tail(&bf->list, &bf_head); | ||
| 364 | else | ||
| 365 | INIT_LIST_HEAD(&bf_head); | ||
| 359 | } else { | 366 | } else { |
| 360 | ASSERT(!list_empty(bf_q)); | 367 | ASSERT(!list_empty(bf_q)); |
| 361 | list_move_tail(&bf->list, &bf_head); | 368 | list_move_tail(&bf->list, &bf_head); |
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index f580c2812d91..40448067e4cc 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
| @@ -648,6 +648,7 @@ struct b43_wl { | |||
| 648 | u8 nr_devs; | 648 | u8 nr_devs; |
| 649 | 649 | ||
| 650 | bool radiotap_enabled; | 650 | bool radiotap_enabled; |
| 651 | bool radio_enabled; | ||
| 651 | 652 | ||
| 652 | /* The beacon we are currently using (AP or IBSS mode). | 653 | /* The beacon we are currently using (AP or IBSS mode). |
| 653 | * This beacon stuff is protected by the irq_lock. */ | 654 | * This beacon stuff is protected by the irq_lock. */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 6456afebdba1..e71c8d9cd706 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
| @@ -3497,8 +3497,8 @@ static int b43_op_config(struct ieee80211_hw *hw, u32 changed) | |||
| 3497 | if (phy->ops->set_rx_antenna) | 3497 | if (phy->ops->set_rx_antenna) |
| 3498 | phy->ops->set_rx_antenna(dev, antenna); | 3498 | phy->ops->set_rx_antenna(dev, antenna); |
| 3499 | 3499 | ||
| 3500 | if (!!conf->radio_enabled != phy->radio_on) { | 3500 | if (wl->radio_enabled != phy->radio_on) { |
| 3501 | if (conf->radio_enabled) { | 3501 | if (wl->radio_enabled) { |
| 3502 | b43_software_rfkill(dev, false); | 3502 | b43_software_rfkill(dev, false); |
| 3503 | b43info(dev->wl, "Radio turned on by software\n"); | 3503 | b43info(dev->wl, "Radio turned on by software\n"); |
| 3504 | if (!dev->radio_hw_enable) { | 3504 | if (!dev->radio_hw_enable) { |
| @@ -4339,6 +4339,7 @@ static int b43_op_start(struct ieee80211_hw *hw) | |||
| 4339 | wl->beacon0_uploaded = 0; | 4339 | wl->beacon0_uploaded = 0; |
| 4340 | wl->beacon1_uploaded = 0; | 4340 | wl->beacon1_uploaded = 0; |
| 4341 | wl->beacon_templates_virgin = 1; | 4341 | wl->beacon_templates_virgin = 1; |
| 4342 | wl->radio_enabled = 1; | ||
| 4342 | 4343 | ||
| 4343 | mutex_lock(&wl->mutex); | 4344 | mutex_lock(&wl->mutex); |
| 4344 | 4345 | ||
| @@ -4378,6 +4379,7 @@ static void b43_op_stop(struct ieee80211_hw *hw) | |||
| 4378 | if (b43_status(dev) >= B43_STAT_STARTED) | 4379 | if (b43_status(dev) >= B43_STAT_STARTED) |
| 4379 | b43_wireless_core_stop(dev); | 4380 | b43_wireless_core_stop(dev); |
| 4380 | b43_wireless_core_exit(dev); | 4381 | b43_wireless_core_exit(dev); |
| 4382 | wl->radio_enabled = 0; | ||
| 4381 | mutex_unlock(&wl->mutex); | 4383 | mutex_unlock(&wl->mutex); |
| 4382 | 4384 | ||
| 4383 | cancel_work_sync(&(wl->txpower_adjust_work)); | 4385 | cancel_work_sync(&(wl->txpower_adjust_work)); |
| @@ -4560,6 +4562,7 @@ static int b43_wireless_core_attach(struct b43_wldev *dev) | |||
| 4560 | B43_WARN_ON(1); | 4562 | B43_WARN_ON(1); |
| 4561 | 4563 | ||
| 4562 | dev->phy.gmode = have_2ghz_phy; | 4564 | dev->phy.gmode = have_2ghz_phy; |
| 4565 | dev->phy.radio_on = 1; | ||
| 4563 | tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0; | 4566 | tmp = dev->phy.gmode ? B43_TMSLOW_GMODE : 0; |
| 4564 | b43_wireless_core_reset(dev, tmp); | 4567 | b43_wireless_core_reset(dev, tmp); |
| 4565 | 4568 | ||
diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c index 3cfc30307a27..6c3a74964ab8 100644 --- a/drivers/net/wireless/b43/pcmcia.c +++ b/drivers/net/wireless/b43/pcmcia.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | 35 | ||
| 36 | static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = { | 36 | static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = { |
| 37 | PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448), | 37 | PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448), |
| 38 | PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x476), | ||
| 38 | PCMCIA_DEVICE_NULL, | 39 | PCMCIA_DEVICE_NULL, |
| 39 | }; | 40 | }; |
| 40 | 41 | ||
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h index 77fda148ac46..038baa8869e2 100644 --- a/drivers/net/wireless/b43legacy/b43legacy.h +++ b/drivers/net/wireless/b43legacy/b43legacy.h | |||
| @@ -607,6 +607,7 @@ struct b43legacy_wl { | |||
| 607 | u8 nr_devs; | 607 | u8 nr_devs; |
| 608 | 608 | ||
| 609 | bool radiotap_enabled; | 609 | bool radiotap_enabled; |
| 610 | bool radio_enabled; | ||
| 610 | 611 | ||
| 611 | /* The beacon we are currently using (AP or IBSS mode). | 612 | /* The beacon we are currently using (AP or IBSS mode). |
| 612 | * This beacon stuff is protected by the irq_lock. */ | 613 | * This beacon stuff is protected by the irq_lock. */ |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index e5136fb65ddd..c4973c1942bf 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
| @@ -2689,8 +2689,8 @@ static int b43legacy_op_dev_config(struct ieee80211_hw *hw, | |||
| 2689 | /* Antennas for RX and management frame TX. */ | 2689 | /* Antennas for RX and management frame TX. */ |
| 2690 | b43legacy_mgmtframe_txantenna(dev, antenna_tx); | 2690 | b43legacy_mgmtframe_txantenna(dev, antenna_tx); |
| 2691 | 2691 | ||
| 2692 | if (!!conf->radio_enabled != phy->radio_on) { | 2692 | if (wl->radio_enabled != phy->radio_on) { |
| 2693 | if (conf->radio_enabled) { | 2693 | if (wl->radio_enabled) { |
| 2694 | b43legacy_radio_turn_on(dev); | 2694 | b43legacy_radio_turn_on(dev); |
| 2695 | b43legacyinfo(dev->wl, "Radio turned on by software\n"); | 2695 | b43legacyinfo(dev->wl, "Radio turned on by software\n"); |
| 2696 | if (!dev->radio_hw_enable) | 2696 | if (!dev->radio_hw_enable) |
| @@ -3441,6 +3441,7 @@ static int b43legacy_op_start(struct ieee80211_hw *hw) | |||
| 3441 | wl->beacon0_uploaded = 0; | 3441 | wl->beacon0_uploaded = 0; |
| 3442 | wl->beacon1_uploaded = 0; | 3442 | wl->beacon1_uploaded = 0; |
| 3443 | wl->beacon_templates_virgin = 1; | 3443 | wl->beacon_templates_virgin = 1; |
| 3444 | wl->radio_enabled = 1; | ||
| 3444 | 3445 | ||
| 3445 | mutex_lock(&wl->mutex); | 3446 | mutex_lock(&wl->mutex); |
| 3446 | 3447 | ||
| @@ -3479,6 +3480,7 @@ static void b43legacy_op_stop(struct ieee80211_hw *hw) | |||
| 3479 | if (b43legacy_status(dev) >= B43legacy_STAT_STARTED) | 3480 | if (b43legacy_status(dev) >= B43legacy_STAT_STARTED) |
| 3480 | b43legacy_wireless_core_stop(dev); | 3481 | b43legacy_wireless_core_stop(dev); |
| 3481 | b43legacy_wireless_core_exit(dev); | 3482 | b43legacy_wireless_core_exit(dev); |
| 3483 | wl->radio_enabled = 0; | ||
| 3482 | mutex_unlock(&wl->mutex); | 3484 | mutex_unlock(&wl->mutex); |
| 3483 | } | 3485 | } |
| 3484 | 3486 | ||
| @@ -3620,6 +3622,7 @@ static int b43legacy_wireless_core_attach(struct b43legacy_wldev *dev) | |||
| 3620 | have_bphy = 1; | 3622 | have_bphy = 1; |
| 3621 | 3623 | ||
| 3622 | dev->phy.gmode = (have_gphy || have_bphy); | 3624 | dev->phy.gmode = (have_gphy || have_bphy); |
| 3625 | dev->phy.radio_on = 1; | ||
| 3623 | tmp = dev->phy.gmode ? B43legacy_TMSLOW_GMODE : 0; | 3626 | tmp = dev->phy.gmode ? B43legacy_TMSLOW_GMODE : 0; |
| 3624 | b43legacy_wireless_core_reset(dev, tmp); | 3627 | b43legacy_wireless_core_reset(dev, tmp); |
| 3625 | 3628 | ||
diff --git a/drivers/net/wireless/iwmc3200wifi/Kconfig b/drivers/net/wireless/iwmc3200wifi/Kconfig index 1eccb6df46dd..030401d367d3 100644 --- a/drivers/net/wireless/iwmc3200wifi/Kconfig +++ b/drivers/net/wireless/iwmc3200wifi/Kconfig | |||
| @@ -4,6 +4,15 @@ config IWM | |||
| 4 | depends on CFG80211 | 4 | depends on CFG80211 |
| 5 | select WIRELESS_EXT | 5 | select WIRELESS_EXT |
| 6 | select FW_LOADER | 6 | select FW_LOADER |
| 7 | help | ||
| 8 | The Intel Wireless Multicomm 3200 hardware is a combo | ||
| 9 | card with GPS, Bluetooth, WiMax and 802.11 radios. It | ||
| 10 | runs over SDIO and is typically found on Moorestown | ||
| 11 | based platform. This driver takes care of the 802.11 | ||
| 12 | part, which is a fullmac one. | ||
| 13 | |||
| 14 | If you choose to build it as a module, it'll be called | ||
| 15 | iwmc3200wifi.ko. | ||
| 7 | 16 | ||
| 8 | config IWM_DEBUG | 17 | config IWM_DEBUG |
| 9 | bool "Enable full debugging output in iwmc3200wifi" | 18 | bool "Enable full debugging output in iwmc3200wifi" |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index e789c6e9938c..a111bda392e2 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
| @@ -418,6 +418,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw, | |||
| 418 | continue; | 418 | continue; |
| 419 | 419 | ||
| 420 | if (!data2->started || !hwsim_ps_rx_ok(data2, skb) || | 420 | if (!data2->started || !hwsim_ps_rx_ok(data2, skb) || |
| 421 | !data->channel || !data2->channel || | ||
| 421 | data->channel->center_freq != data2->channel->center_freq || | 422 | data->channel->center_freq != data2->channel->center_freq || |
| 422 | !(data->group & data2->group)) | 423 | !(data->group & data2->group)) |
| 423 | continue; | 424 | continue; |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 48d81d98e12d..22ca122bd798 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
| @@ -912,13 +912,14 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
| 912 | } | 912 | } |
| 913 | 913 | ||
| 914 | __skb_unlink(entry, &priv->tx_queue); | 914 | __skb_unlink(entry, &priv->tx_queue); |
| 915 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | ||
| 916 | 915 | ||
| 917 | frame_len = entry->len; | 916 | frame_len = entry->len; |
| 918 | entry_hdr = (struct p54_hdr *) entry->data; | 917 | entry_hdr = (struct p54_hdr *) entry->data; |
| 919 | entry_data = (struct p54_tx_data *) entry_hdr->data; | 918 | entry_data = (struct p54_tx_data *) entry_hdr->data; |
| 920 | priv->tx_stats[entry_data->hw_queue].len--; | 919 | if (priv->tx_stats[entry_data->hw_queue].len) |
| 920 | priv->tx_stats[entry_data->hw_queue].len--; | ||
| 921 | priv->stats.dot11ACKFailureCount += payload->tries - 1; | 921 | priv->stats.dot11ACKFailureCount += payload->tries - 1; |
| 922 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | ||
| 922 | 923 | ||
| 923 | /* | 924 | /* |
| 924 | * Frames in P54_QUEUE_FWSCAN and P54_QUEUE_BEACON are | 925 | * Frames in P54_QUEUE_FWSCAN and P54_QUEUE_BEACON are |
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index b10b0383dfa5..698b11b1cadb 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c | |||
| @@ -2427,11 +2427,10 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len) | |||
| 2427 | 2427 | ||
| 2428 | #ifdef PCMCIA_DEBUG | 2428 | #ifdef PCMCIA_DEBUG |
| 2429 | if (pc_debug > 3) { | 2429 | if (pc_debug > 3) { |
| 2430 | int i; | 2430 | print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ", |
| 2431 | printk(KERN_DEBUG "skb->data before untranslate"); | 2431 | DUMP_PREFIX_NONE, 16, 1, |
| 2432 | for (i = 0; i < 64; i++) | 2432 | skb->data, 64, true); |
| 2433 | printk("%02x ", skb->data[i]); | 2433 | printk(KERN_DEBUG |
| 2434 | printk("\n" KERN_DEBUG | ||
| 2435 | "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n", | 2434 | "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n", |
| 2436 | ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl, | 2435 | ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl, |
| 2437 | psnap->org[0], psnap->org[1], psnap->org[2]); | 2436 | psnap->org[0], psnap->org[1], psnap->org[2]); |
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 6af706408ac0..c6d300666ad8 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
| @@ -3556,17 +3556,8 @@ wv_82593_config(struct net_device * dev) | |||
| 3556 | cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */ | 3556 | cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */ |
| 3557 | 3557 | ||
| 3558 | #ifdef DEBUG_I82593_SHOW | 3558 | #ifdef DEBUG_I82593_SHOW |
| 3559 | { | 3559 | print_hex_dump(KERN_DEBUG, "wavelan_cs: config block: ", DUMP_PREFIX_NONE, |
| 3560 | u_char *c = (u_char *) &cfblk; | 3560 | 16, 1, &cfblk, sizeof(struct i82593_conf_block), false); |
| 3561 | int i; | ||
| 3562 | printk(KERN_DEBUG "wavelan_cs: config block:"); | ||
| 3563 | for(i = 0; i < sizeof(struct i82593_conf_block); i++,c++) | ||
| 3564 | { | ||
| 3565 | if((i % 16) == 0) printk("\n" KERN_DEBUG); | ||
| 3566 | printk("%02x ", *c); | ||
| 3567 | } | ||
| 3568 | printk("\n"); | ||
| 3569 | } | ||
| 3570 | #endif | 3561 | #endif |
| 3571 | 3562 | ||
| 3572 | /* Copy the config block to the i82593 */ | 3563 | /* Copy the config block to the i82593 */ |
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 14a19baff214..0e6e44689cc6 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
| @@ -38,7 +38,6 @@ static struct usb_device_id usb_ids[] = { | |||
| 38 | /* ZD1211 */ | 38 | /* ZD1211 */ |
| 39 | { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 }, | 39 | { USB_DEVICE(0x0ace, 0x1211), .driver_info = DEVICE_ZD1211 }, |
| 40 | { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 }, | 40 | { USB_DEVICE(0x0ace, 0xa211), .driver_info = DEVICE_ZD1211 }, |
| 41 | { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211 }, | ||
| 42 | { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, | 41 | { USB_DEVICE(0x126f, 0xa006), .driver_info = DEVICE_ZD1211 }, |
| 43 | { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, | 42 | { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, |
| 44 | { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, | 43 | { USB_DEVICE(0x0df6, 0x9071), .driver_info = DEVICE_ZD1211 }, |
| @@ -61,6 +60,7 @@ static struct usb_device_id usb_ids[] = { | |||
| 61 | { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 }, | 60 | { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 }, |
| 62 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, | 61 | { USB_DEVICE(0x0105, 0x145f), .driver_info = DEVICE_ZD1211 }, |
| 63 | /* ZD1211B */ | 62 | /* ZD1211B */ |
| 63 | { USB_DEVICE(0x054c, 0x0257), .driver_info = DEVICE_ZD1211B }, | ||
| 64 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, | 64 | { USB_DEVICE(0x0ace, 0x1215), .driver_info = DEVICE_ZD1211B }, |
| 65 | { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, | 65 | { USB_DEVICE(0x0ace, 0xb215), .driver_info = DEVICE_ZD1211B }, |
| 66 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, | 66 | { USB_DEVICE(0x157e, 0x300d), .driver_info = DEVICE_ZD1211B }, |
| @@ -87,6 +87,7 @@ static struct usb_device_id usb_ids[] = { | |||
| 87 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, | 87 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, |
| 88 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, | 88 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, |
| 89 | { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, | 89 | { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, |
| 90 | { USB_DEVICE(0x07b8, 0x6001), .driver_info = DEVICE_ZD1211B }, | ||
| 90 | /* "Driverless" devices that need ejecting */ | 91 | /* "Driverless" devices that need ejecting */ |
| 91 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 92 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
| 92 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | 93 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, |
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index 3c7a5053f1da..a07580138e81 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
| @@ -109,7 +109,7 @@ static int gx_fix; | |||
| 109 | /* These identify the driver base version and may not be removed. */ | 109 | /* These identify the driver base version and may not be removed. */ |
| 110 | static const char version[] __devinitconst = | 110 | static const char version[] __devinitconst = |
| 111 | KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n" | 111 | KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n" |
| 112 | KERN_INFO " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n"; | 112 | " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n"; |
| 113 | 113 | ||
| 114 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); | 114 | MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); |
| 115 | MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); | 115 | MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); |
| @@ -700,12 +700,15 @@ static void yellowfin_tx_timeout(struct net_device *dev) | |||
| 700 | int i; | 700 | int i; |
| 701 | printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring); | 701 | printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring); |
| 702 | for (i = 0; i < RX_RING_SIZE; i++) | 702 | for (i = 0; i < RX_RING_SIZE; i++) |
| 703 | printk(" %8.8x", yp->rx_ring[i].result_status); | 703 | printk(KERN_CONT " %8.8x", |
| 704 | printk("\n"KERN_WARNING" Tx ring %p: ", yp->tx_ring); | 704 | yp->rx_ring[i].result_status); |
| 705 | printk(KERN_CONT "\n"); | ||
| 706 | printk(KERN_WARNING" Tx ring %p: ", yp->tx_ring); | ||
| 705 | for (i = 0; i < TX_RING_SIZE; i++) | 707 | for (i = 0; i < TX_RING_SIZE; i++) |
| 706 | printk(" %4.4x /%8.8x", yp->tx_status[i].tx_errs, | 708 | printk(KERN_CONT " %4.4x /%8.8x", |
| 707 | yp->tx_ring[i].result_status); | 709 | yp->tx_status[i].tx_errs, |
| 708 | printk("\n"); | 710 | yp->tx_ring[i].result_status); |
| 711 | printk(KERN_CONT "\n"); | ||
| 709 | } | 712 | } |
| 710 | 713 | ||
| 711 | /* If the hardware is found to hang regularly, we will update the code | 714 | /* If the hardware is found to hang regularly, we will update the code |
| @@ -1216,20 +1219,20 @@ static int yellowfin_close(struct net_device *dev) | |||
| 1216 | 1219 | ||
| 1217 | #if defined(__i386__) | 1220 | #if defined(__i386__) |
| 1218 | if (yellowfin_debug > 2) { | 1221 | if (yellowfin_debug > 2) { |
| 1219 | printk("\n"KERN_DEBUG" Tx ring at %8.8llx:\n", | 1222 | printk(KERN_DEBUG" Tx ring at %8.8llx:\n", |
| 1220 | (unsigned long long)yp->tx_ring_dma); | 1223 | (unsigned long long)yp->tx_ring_dma); |
| 1221 | for (i = 0; i < TX_RING_SIZE*2; i++) | 1224 | for (i = 0; i < TX_RING_SIZE*2; i++) |
| 1222 | printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", | 1225 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", |
| 1223 | ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', | 1226 | ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', |
| 1224 | i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, | 1227 | i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, |
| 1225 | yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); | 1228 | yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); |
| 1226 | printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); | 1229 | printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); |
| 1227 | for (i = 0; i < TX_RING_SIZE; i++) | 1230 | for (i = 0; i < TX_RING_SIZE; i++) |
| 1228 | printk(" #%d status %4.4x %4.4x %4.4x %4.4x.\n", | 1231 | printk(KERN_DEBUG " #%d status %4.4x %4.4x %4.4x %4.4x.\n", |
| 1229 | i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, | 1232 | i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, |
| 1230 | yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); | 1233 | yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); |
| 1231 | 1234 | ||
| 1232 | printk("\n"KERN_DEBUG " Rx ring %8.8llx:\n", | 1235 | printk(KERN_DEBUG " Rx ring %8.8llx:\n", |
| 1233 | (unsigned long long)yp->rx_ring_dma); | 1236 | (unsigned long long)yp->rx_ring_dma); |
| 1234 | for (i = 0; i < RX_RING_SIZE; i++) { | 1237 | for (i = 0; i < RX_RING_SIZE; i++) { |
| 1235 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", | 1238 | printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", |
diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c index e1f6ce03705e..3c2270a8300c 100644 --- a/drivers/oprofile/oprofile_stats.c +++ b/drivers/oprofile/oprofile_stats.c | |||
| @@ -33,6 +33,7 @@ void oprofile_reset_stats(void) | |||
| 33 | atomic_set(&oprofile_stats.sample_lost_no_mm, 0); | 33 | atomic_set(&oprofile_stats.sample_lost_no_mm, 0); |
| 34 | atomic_set(&oprofile_stats.sample_lost_no_mapping, 0); | 34 | atomic_set(&oprofile_stats.sample_lost_no_mapping, 0); |
| 35 | atomic_set(&oprofile_stats.event_lost_overflow, 0); | 35 | atomic_set(&oprofile_stats.event_lost_overflow, 0); |
| 36 | atomic_set(&oprofile_stats.bt_lost_no_mapping, 0); | ||
| 36 | } | 37 | } |
| 37 | 38 | ||
| 38 | 39 | ||
diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c index c709ecc2b7f7..0be1d50645ab 100644 --- a/drivers/parisc/eisa_enumerator.c +++ b/drivers/parisc/eisa_enumerator.c | |||
| @@ -101,7 +101,7 @@ static int configure_memory(const unsigned char *buf, | |||
| 101 | printk("memory %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); | 101 | printk("memory %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); |
| 102 | result = request_resource(mem_parent, res); | 102 | result = request_resource(mem_parent, res); |
| 103 | if (result < 0) { | 103 | if (result < 0) { |
| 104 | printk("\n" KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n"); | 104 | printk(KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n"); |
| 105 | return result; | 105 | return result; |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| @@ -191,7 +191,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent, | |||
| 191 | printk("ioports %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); | 191 | printk("ioports %lx-%lx ", (unsigned long)res->start, (unsigned long)res->end); |
| 192 | result = request_resource(io_parent, res); | 192 | result = request_resource(io_parent, res); |
| 193 | if (result < 0) { | 193 | if (result < 0) { |
| 194 | printk("\n" KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n"); | 194 | printk(KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n"); |
| 195 | return result; | 195 | return result; |
| 196 | } | 196 | } |
| 197 | } | 197 | } |
| @@ -224,7 +224,7 @@ static int configure_port_init(const unsigned char *buf) | |||
| 224 | case HPEE_PORT_INIT_WIDTH_BYTE: | 224 | case HPEE_PORT_INIT_WIDTH_BYTE: |
| 225 | s=1; | 225 | s=1; |
| 226 | if (c & HPEE_PORT_INIT_MASK) { | 226 | if (c & HPEE_PORT_INIT_MASK) { |
| 227 | printk("\n" KERN_WARNING "port_init: unverified mask attribute\n"); | 227 | printk(KERN_WARNING "port_init: unverified mask attribute\n"); |
| 228 | outb((inb(get_16(buf+len+1) & | 228 | outb((inb(get_16(buf+len+1) & |
| 229 | get_8(buf+len+3)) | | 229 | get_8(buf+len+3)) | |
| 230 | get_8(buf+len+4)), get_16(buf+len+1)); | 230 | get_8(buf+len+4)), get_16(buf+len+1)); |
| @@ -249,7 +249,7 @@ static int configure_port_init(const unsigned char *buf) | |||
| 249 | case HPEE_PORT_INIT_WIDTH_DWORD: | 249 | case HPEE_PORT_INIT_WIDTH_DWORD: |
| 250 | s=4; | 250 | s=4; |
| 251 | if (c & HPEE_PORT_INIT_MASK) { | 251 | if (c & HPEE_PORT_INIT_MASK) { |
| 252 | printk("\n" KERN_WARNING "port_init: unverified mask attribute\n"); | 252 | printk(KERN_WARNING "port_init: unverified mask attribute\n"); |
| 253 | outl((inl(get_16(buf+len+1) & | 253 | outl((inl(get_16(buf+len+1) & |
| 254 | get_32(buf+len+3)) | | 254 | get_32(buf+len+3)) | |
| 255 | get_32(buf+len+7)), get_16(buf+len+1)); | 255 | get_32(buf+len+7)), get_16(buf+len+1)); |
| @@ -259,7 +259,7 @@ static int configure_port_init(const unsigned char *buf) | |||
| 259 | 259 | ||
| 260 | break; | 260 | break; |
| 261 | default: | 261 | default: |
| 262 | printk("\n" KERN_ERR "Invalid port init word %02x\n", c); | 262 | printk(KERN_ERR "Invalid port init word %02x\n", c); |
| 263 | return 0; | 263 | return 0; |
| 264 | } | 264 | } |
| 265 | 265 | ||
| @@ -297,7 +297,7 @@ static int configure_type_string(const unsigned char *buf) | |||
| 297 | /* just skip past the type field */ | 297 | /* just skip past the type field */ |
| 298 | len = get_8(buf); | 298 | len = get_8(buf); |
| 299 | if (len > 80) { | 299 | if (len > 80) { |
| 300 | printk("\n" KERN_ERR "eisa_enumerator: type info field too long (%d, max is 80)\n", len); | 300 | printk(KERN_ERR "eisa_enumerator: type info field too long (%d, max is 80)\n", len); |
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | return 1+len; | 303 | return 1+len; |
| @@ -398,7 +398,7 @@ static int parse_slot_config(int slot, | |||
| 398 | } | 398 | } |
| 399 | 399 | ||
| 400 | if (p0 + function_len < pos) { | 400 | if (p0 + function_len < pos) { |
| 401 | printk("\n" KERN_ERR "eisa_enumerator: function %d length mis-match " | 401 | printk(KERN_ERR "eisa_enumerator: function %d length mis-match " |
| 402 | "got %d, expected %d\n", | 402 | "got %d, expected %d\n", |
| 403 | num_func, pos-p0, function_len); | 403 | num_func, pos-p0, function_len); |
| 404 | res=-1; | 404 | res=-1; |
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index 360fb67a30d7..ebc9b8dca881 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
| @@ -3600,6 +3600,9 @@ static void intel_iommu_unmap_range(struct iommu_domain *domain, | |||
| 3600 | { | 3600 | { |
| 3601 | struct dmar_domain *dmar_domain = domain->priv; | 3601 | struct dmar_domain *dmar_domain = domain->priv; |
| 3602 | 3602 | ||
| 3603 | if (!size) | ||
| 3604 | return; | ||
| 3605 | |||
| 3603 | dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT, | 3606 | dma_pte_clear_range(dmar_domain, iova >> VTD_PAGE_SHIFT, |
| 3604 | (iova + size - 1) >> VTD_PAGE_SHIFT); | 3607 | (iova + size - 1) >> VTD_PAGE_SHIFT); |
| 3605 | 3608 | ||
diff --git a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c index 9ad97ea836e8..8eb04230fec7 100644 --- a/drivers/pcmcia/tcic.c +++ b/drivers/pcmcia/tcic.c | |||
| @@ -472,7 +472,8 @@ static int __init init_tcic(void) | |||
| 472 | init_timer(&poll_timer); | 472 | init_timer(&poll_timer); |
| 473 | 473 | ||
| 474 | /* Build interrupt mask */ | 474 | /* Build interrupt mask */ |
| 475 | printk(", %d sockets\n" KERN_INFO " irq list (", sockets); | 475 | printk(KERN_CONT ", %d sockets\n", sockets); |
| 476 | printk(KERN_INFO " irq list ("); | ||
| 476 | if (irq_list_count == 0) | 477 | if (irq_list_count == 0) |
| 477 | mask = irq_mask; | 478 | mask = irq_mask; |
| 478 | else | 479 | else |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 4ac2311c00af..ca508564a181 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
| @@ -171,7 +171,7 @@ static int hp_wmi_tablet_state(void) | |||
| 171 | static int hp_wmi_set_block(void *data, bool blocked) | 171 | static int hp_wmi_set_block(void *data, bool blocked) |
| 172 | { | 172 | { |
| 173 | unsigned long b = (unsigned long) data; | 173 | unsigned long b = (unsigned long) data; |
| 174 | int query = BIT(b + 8) | ((!!blocked) << b); | 174 | int query = BIT(b + 8) | ((!blocked) << b); |
| 175 | 175 | ||
| 176 | return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, query); | 176 | return hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 1, query); |
| 177 | } | 177 | } |
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 0471f8800483..4240b05aef6d 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
| @@ -2826,8 +2826,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd) | |||
| 2826 | */ | 2826 | */ |
| 2827 | 2827 | ||
| 2828 | local_irq_restore(flags); | 2828 | local_irq_restore(flags); |
| 2829 | printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n" | 2829 | printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO); |
| 2830 | KERN_INFO " before abortion\n", HOSTNO); | ||
| 2831 | 2830 | ||
| 2832 | /* Maybe it is sufficient just to release the ST-DMA lock... (if | 2831 | /* Maybe it is sufficient just to release the ST-DMA lock... (if |
| 2833 | * possible at all) At least, we should check if the lock could be | 2832 | * possible at all) At least, we should check if the lock could be |
diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c index b12ad7c7c673..18735b39b3d3 100644 --- a/drivers/scsi/mac53c94.c +++ b/drivers/scsi/mac53c94.c | |||
| @@ -75,8 +75,9 @@ static int mac53c94_queue(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd * | |||
| 75 | int i; | 75 | int i; |
| 76 | printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd); | 76 | printk(KERN_DEBUG "mac53c94_queue %p: command is", cmd); |
| 77 | for (i = 0; i < cmd->cmd_len; ++i) | 77 | for (i = 0; i < cmd->cmd_len; ++i) |
| 78 | printk(" %.2x", cmd->cmnd[i]); | 78 | printk(KERN_CONT " %.2x", cmd->cmnd[i]); |
| 79 | printk("\n" KERN_DEBUG "use_sg=%d request_bufflen=%d request_buffer=%p\n", | 79 | printk(KERN_CONT "\n"); |
| 80 | printk(KERN_DEBUG "use_sg=%d request_bufflen=%d request_buffer=%p\n", | ||
| 80 | scsi_sg_count(cmd), scsi_bufflen(cmd), scsi_sglist(cmd)); | 81 | scsi_sg_count(cmd), scsi_bufflen(cmd), scsi_sglist(cmd)); |
| 81 | } | 82 | } |
| 82 | #endif | 83 | #endif |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index ef142fd47a83..9230402c45af 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
| @@ -619,7 +619,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos) | |||
| 619 | if (strcmp(current->comm, cmd) && printk_ratelimit()) { | 619 | if (strcmp(current->comm, cmd) && printk_ratelimit()) { |
| 620 | printk(KERN_WARNING | 620 | printk(KERN_WARNING |
| 621 | "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" | 621 | "sg_write: data in/out %d/%d bytes for SCSI command 0x%x--" |
| 622 | "guessing data in;\n" KERN_WARNING " " | 622 | "guessing data in;\n " |
| 623 | "program %s not setting count and/or reply_len properly\n", | 623 | "program %s not setting count and/or reply_len properly\n", |
| 624 | old_hdr.reply_len - (int)SZ_SG_HEADER, | 624 | old_hdr.reply_len - (int)SZ_SG_HEADER, |
| 625 | input_size, (unsigned int) cmnd[0], | 625 | input_size, (unsigned int) cmnd[0], |
| @@ -1656,6 +1656,10 @@ static int sg_start_req(Sg_request *srp, unsigned char *cmd) | |||
| 1656 | md->nr_entries = req_schp->k_use_sg; | 1656 | md->nr_entries = req_schp->k_use_sg; |
| 1657 | md->offset = 0; | 1657 | md->offset = 0; |
| 1658 | md->null_mapped = hp->dxferp ? 0 : 1; | 1658 | md->null_mapped = hp->dxferp ? 0 : 1; |
| 1659 | if (dxfer_dir == SG_DXFER_TO_FROM_DEV) | ||
| 1660 | md->from_user = 1; | ||
| 1661 | else | ||
| 1662 | md->from_user = 0; | ||
| 1659 | } | 1663 | } |
| 1660 | 1664 | ||
| 1661 | if (iov_count) { | 1665 | if (iov_count) { |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index bcaba86060ab..75da6e58ce55 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
| @@ -2860,8 +2860,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) | |||
| 2860 | */ | 2860 | */ |
| 2861 | 2861 | ||
| 2862 | local_irq_restore(flags); | 2862 | local_irq_restore(flags); |
| 2863 | printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n" | 2863 | printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO); |
| 2864 | KERN_INFO " before abortion\n", HOSTNO); | ||
| 2865 | 2864 | ||
| 2866 | return SCSI_ABORT_NOT_RUNNING; | 2865 | return SCSI_ABORT_NOT_RUNNING; |
| 2867 | } | 2866 | } |
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c index 6160e03f410c..e7108e75653d 100644 --- a/drivers/serial/8250_pci.c +++ b/drivers/serial/8250_pci.c | |||
| @@ -60,11 +60,12 @@ struct serial_private { | |||
| 60 | 60 | ||
| 61 | static void moan_device(const char *str, struct pci_dev *dev) | 61 | static void moan_device(const char *str, struct pci_dev *dev) |
| 62 | { | 62 | { |
| 63 | printk(KERN_WARNING "%s: %s\n" | 63 | printk(KERN_WARNING |
| 64 | KERN_WARNING "Please send the output of lspci -vv, this\n" | 64 | "%s: %s\n" |
| 65 | KERN_WARNING "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n" | 65 | "Please send the output of lspci -vv, this\n" |
| 66 | KERN_WARNING "manufacturer and name of serial board or\n" | 66 | "message (0x%04x,0x%04x,0x%04x,0x%04x), the\n" |
| 67 | KERN_WARNING "modem board to rmk+serial@arm.linux.org.uk.\n", | 67 | "manufacturer and name of serial board or\n" |
| 68 | "modem board to rmk+serial@arm.linux.org.uk.\n", | ||
| 68 | pci_name(dev), str, dev->vendor, dev->device, | 69 | pci_name(dev), str, dev->vendor, dev->device, |
| 69 | dev->subsystem_vendor, dev->subsystem_device); | 70 | dev->subsystem_vendor, dev->subsystem_device); |
| 70 | } | 71 | } |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 66f52674ca0c..8e2feb563347 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
| @@ -707,24 +707,25 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr) | |||
| 707 | 707 | ||
| 708 | static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) | 708 | static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) |
| 709 | { | 709 | { |
| 710 | unsigned short ssr_status, scr_status; | 710 | unsigned short ssr_status, scr_status, err_enabled; |
| 711 | struct uart_port *port = ptr; | 711 | struct uart_port *port = ptr; |
| 712 | irqreturn_t ret = IRQ_NONE; | 712 | irqreturn_t ret = IRQ_NONE; |
| 713 | 713 | ||
| 714 | ssr_status = sci_in(port, SCxSR); | 714 | ssr_status = sci_in(port, SCxSR); |
| 715 | scr_status = sci_in(port, SCSCR); | 715 | scr_status = sci_in(port, SCSCR); |
| 716 | err_enabled = scr_status & (SCI_CTRL_FLAGS_REIE | SCI_CTRL_FLAGS_RIE); | ||
| 716 | 717 | ||
| 717 | /* Tx Interrupt */ | 718 | /* Tx Interrupt */ |
| 718 | if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE)) | 719 | if ((ssr_status & SCxSR_TDxE(port)) && (scr_status & SCI_CTRL_FLAGS_TIE)) |
| 719 | ret = sci_tx_interrupt(irq, ptr); | 720 | ret = sci_tx_interrupt(irq, ptr); |
| 720 | /* Rx Interrupt */ | 721 | /* Rx Interrupt */ |
| 721 | if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE)) | 722 | if ((ssr_status & SCxSR_RDxF(port)) && (scr_status & SCI_CTRL_FLAGS_RIE)) |
| 722 | ret = sci_rx_interrupt(irq, ptr); | 723 | ret = sci_rx_interrupt(irq, ptr); |
| 723 | /* Error Interrupt */ | 724 | /* Error Interrupt */ |
| 724 | if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE)) | 725 | if ((ssr_status & SCxSR_ERRORS(port)) && err_enabled) |
| 725 | ret = sci_er_interrupt(irq, ptr); | 726 | ret = sci_er_interrupt(irq, ptr); |
| 726 | /* Break Interrupt */ | 727 | /* Break Interrupt */ |
| 727 | if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE)) | 728 | if ((ssr_status & SCxSR_BRK(port)) && err_enabled) |
| 728 | ret = sci_br_interrupt(irq, ptr); | 729 | ret = sci_br_interrupt(irq, ptr); |
| 729 | 730 | ||
| 730 | return ret; | 731 | return ret; |
diff --git a/drivers/ssb/pcmcia.c b/drivers/ssb/pcmcia.c index fbfadbac67e8..100e7a5c5ea1 100644 --- a/drivers/ssb/pcmcia.c +++ b/drivers/ssb/pcmcia.c | |||
| @@ -583,7 +583,7 @@ static int ssb_pcmcia_sprom_write_all(struct ssb_bus *bus, const u16 *sprom) | |||
| 583 | ssb_printk("."); | 583 | ssb_printk("."); |
| 584 | err = ssb_pcmcia_sprom_write(bus, i, sprom[i]); | 584 | err = ssb_pcmcia_sprom_write(bus, i, sprom[i]); |
| 585 | if (err) { | 585 | if (err) { |
| 586 | ssb_printk("\n" KERN_NOTICE PFX | 586 | ssb_printk(KERN_NOTICE PFX |
| 587 | "Failed to write to SPROM.\n"); | 587 | "Failed to write to SPROM.\n"); |
| 588 | failed = 1; | 588 | failed = 1; |
| 589 | break; | 589 | break; |
| @@ -591,7 +591,7 @@ static int ssb_pcmcia_sprom_write_all(struct ssb_bus *bus, const u16 *sprom) | |||
| 591 | } | 591 | } |
| 592 | err = ssb_pcmcia_sprom_command(bus, SSB_PCMCIA_SPROMCTL_WRITEDIS); | 592 | err = ssb_pcmcia_sprom_command(bus, SSB_PCMCIA_SPROMCTL_WRITEDIS); |
| 593 | if (err) { | 593 | if (err) { |
| 594 | ssb_printk("\n" KERN_NOTICE PFX | 594 | ssb_printk(KERN_NOTICE PFX |
| 595 | "Could not disable SPROM write access.\n"); | 595 | "Could not disable SPROM write access.\n"); |
| 596 | failed = 1; | 596 | failed = 1; |
| 597 | } | 597 | } |
| @@ -678,7 +678,8 @@ int ssb_pcmcia_get_invariants(struct ssb_bus *bus, | |||
| 678 | sprom->board_rev = tuple.TupleData[1]; | 678 | sprom->board_rev = tuple.TupleData[1]; |
| 679 | break; | 679 | break; |
| 680 | case SSB_PCMCIA_CIS_PA: | 680 | case SSB_PCMCIA_CIS_PA: |
| 681 | GOTO_ERROR_ON(tuple.TupleDataLen != 9, | 681 | GOTO_ERROR_ON((tuple.TupleDataLen != 9) && |
| 682 | (tuple.TupleDataLen != 10), | ||
| 682 | "pa tpl size"); | 683 | "pa tpl size"); |
| 683 | sprom->pa0b0 = tuple.TupleData[1] | | 684 | sprom->pa0b0 = tuple.TupleData[1] | |
| 684 | ((u16)tuple.TupleData[2] << 8); | 685 | ((u16)tuple.TupleData[2] << 8); |
| @@ -718,7 +719,8 @@ int ssb_pcmcia_get_invariants(struct ssb_bus *bus, | |||
| 718 | sprom->antenna_gain.ghz5.a3 = tuple.TupleData[1]; | 719 | sprom->antenna_gain.ghz5.a3 = tuple.TupleData[1]; |
| 719 | break; | 720 | break; |
| 720 | case SSB_PCMCIA_CIS_BFLAGS: | 721 | case SSB_PCMCIA_CIS_BFLAGS: |
| 721 | GOTO_ERROR_ON(tuple.TupleDataLen != 3, | 722 | GOTO_ERROR_ON((tuple.TupleDataLen != 3) && |
| 723 | (tuple.TupleDataLen != 5), | ||
| 722 | "bfl tpl size"); | 724 | "bfl tpl size"); |
| 723 | sprom->boardflags_lo = tuple.TupleData[1] | | 725 | sprom->boardflags_lo = tuple.TupleData[1] | |
| 724 | ((u16)tuple.TupleData[2] << 8); | 726 | ((u16)tuple.TupleData[2] << 8); |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index ce3f453f02ef..95ccfa0b9fc5 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
| @@ -648,7 +648,7 @@ void usb_hcd_poll_rh_status(struct usb_hcd *hcd) | |||
| 648 | struct urb *urb; | 648 | struct urb *urb; |
| 649 | int length; | 649 | int length; |
| 650 | unsigned long flags; | 650 | unsigned long flags; |
| 651 | char buffer[4]; /* Any root hubs with > 31 ports? */ | 651 | char buffer[6]; /* Any root hubs with > 31 ports? */ |
| 652 | 652 | ||
| 653 | if (unlikely(!hcd->rh_registered)) | 653 | if (unlikely(!hcd->rh_registered)) |
| 654 | return; | 654 | return; |
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 1576a0520adf..0c03471f0d41 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig | |||
| @@ -337,10 +337,10 @@ config USB_R8A66597_HCD | |||
| 337 | 337 | ||
| 338 | config SUPERH_ON_CHIP_R8A66597 | 338 | config SUPERH_ON_CHIP_R8A66597 |
| 339 | boolean "Enable SuperH on-chip R8A66597 USB" | 339 | boolean "Enable SuperH on-chip R8A66597 USB" |
| 340 | depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723) | 340 | depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7724) |
| 341 | help | 341 | help |
| 342 | This driver enables support for the on-chip R8A66597 in the | 342 | This driver enables support for the on-chip R8A66597 in the |
| 343 | SH7366 and SH7723 processors. | 343 | SH7366, SH7723 and SH7724 processors. |
| 344 | 344 | ||
| 345 | config USB_WHCI_HCD | 345 | config USB_WHCI_HCD |
| 346 | tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" | 346 | tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" |
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index fb8163d181ab..a21efcd10b78 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c | |||
| @@ -226,9 +226,10 @@ static int clcdfb_set_par(struct fb_info *info) | |||
| 226 | clcdfb_enable(fb, regs.cntl); | 226 | clcdfb_enable(fb, regs.cntl); |
| 227 | 227 | ||
| 228 | #ifdef DEBUG | 228 | #ifdef DEBUG |
| 229 | printk(KERN_INFO "CLCD: Registers set to\n" | 229 | printk(KERN_INFO |
| 230 | KERN_INFO " %08x %08x %08x %08x\n" | 230 | "CLCD: Registers set to\n" |
| 231 | KERN_INFO " %08x %08x %08x %08x\n", | 231 | " %08x %08x %08x %08x\n" |
| 232 | " %08x %08x %08x %08x\n", | ||
| 232 | readl(fb->regs + CLCD_TIM0), readl(fb->regs + CLCD_TIM1), | 233 | readl(fb->regs + CLCD_TIM0), readl(fb->regs + CLCD_TIM1), |
| 233 | readl(fb->regs + CLCD_TIM2), readl(fb->regs + CLCD_TIM3), | 234 | readl(fb->regs + CLCD_TIM2), readl(fb->regs + CLCD_TIM3), |
| 234 | readl(fb->regs + CLCD_UBAS), readl(fb->regs + CLCD_LBAS), | 235 | readl(fb->regs + CLCD_UBAS), readl(fb->regs + CLCD_LBAS), |
diff --git a/drivers/video/atafb.c b/drivers/video/atafb.c index 497ff8af03ed..8cd279be74e5 100644 --- a/drivers/video/atafb.c +++ b/drivers/video/atafb.c | |||
| @@ -2405,6 +2405,9 @@ static int do_fb_set_var(struct fb_var_screeninfo *var, int isactive) | |||
| 2405 | return 0; | 2405 | return 0; |
| 2406 | } | 2406 | } |
| 2407 | 2407 | ||
| 2408 | /* fbhw->encode_fix() must be called with fb_info->mm_lock held | ||
| 2409 | * if it is called after the register_framebuffer() - not a case here | ||
| 2410 | */ | ||
| 2408 | static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) | 2411 | static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) |
| 2409 | { | 2412 | { |
| 2410 | struct atafb_par par; | 2413 | struct atafb_par par; |
| @@ -2414,9 +2417,7 @@ static int atafb_get_fix(struct fb_fix_screeninfo *fix, struct fb_info *info) | |||
| 2414 | if (err) | 2417 | if (err) |
| 2415 | return err; | 2418 | return err; |
| 2416 | memset(fix, 0, sizeof(struct fb_fix_screeninfo)); | 2419 | memset(fix, 0, sizeof(struct fb_fix_screeninfo)); |
| 2417 | mutex_lock(&info->mm_lock); | ||
| 2418 | err = fbhw->encode_fix(fix, &par); | 2420 | err = fbhw->encode_fix(fix, &par); |
| 2419 | mutex_unlock(&info->mm_lock); | ||
| 2420 | return err; | 2421 | return err; |
| 2421 | } | 2422 | } |
| 2422 | 2423 | ||
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index cb88394ba995..da05f0801bb7 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
| @@ -261,6 +261,9 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo) | |||
| 261 | /** | 261 | /** |
| 262 | * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory | 262 | * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory |
| 263 | * @sinfo: the frame buffer to allocate memory for | 263 | * @sinfo: the frame buffer to allocate memory for |
| 264 | * | ||
| 265 | * This function is called only from the atmel_lcdfb_probe() | ||
| 266 | * so no locking by fb_info->mm_lock around smem_len setting is needed. | ||
| 264 | */ | 267 | */ |
| 265 | static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo) | 268 | static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo) |
| 266 | { | 269 | { |
| @@ -270,9 +273,7 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo) | |||
| 270 | 273 | ||
| 271 | smem_len = (var->xres_virtual * var->yres_virtual | 274 | smem_len = (var->xres_virtual * var->yres_virtual |
| 272 | * ((var->bits_per_pixel + 7) / 8)); | 275 | * ((var->bits_per_pixel + 7) / 8)); |
| 273 | mutex_lock(&info->mm_lock); | ||
| 274 | info->fix.smem_len = max(smem_len, sinfo->smem_len); | 276 | info->fix.smem_len = max(smem_len, sinfo->smem_len); |
| 275 | mutex_unlock(&info->mm_lock); | ||
| 276 | 277 | ||
| 277 | info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len, | 278 | info->screen_base = dma_alloc_writecombine(info->device, info->fix.smem_len, |
| 278 | (dma_addr_t *)&info->fix.smem_start, GFP_KERNEL); | 279 | (dma_addr_t *)&info->fix.smem_start, GFP_KERNEL); |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 53eb39652791..53ea05645ff8 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
| @@ -1513,6 +1513,8 @@ register_framebuffer(struct fb_info *fb_info) | |||
| 1513 | if (!registered_fb[i]) | 1513 | if (!registered_fb[i]) |
| 1514 | break; | 1514 | break; |
| 1515 | fb_info->node = i; | 1515 | fb_info->node = i; |
| 1516 | mutex_init(&fb_info->lock); | ||
| 1517 | mutex_init(&fb_info->mm_lock); | ||
| 1516 | 1518 | ||
| 1517 | fb_info->dev = device_create(fb_class, fb_info->device, | 1519 | fb_info->dev = device_create(fb_class, fb_info->device, |
| 1518 | MKDEV(FB_MAJOR, i), NULL, "fb%d", i); | 1520 | MKDEV(FB_MAJOR, i), NULL, "fb%d", i); |
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c index afc04df39a03..d4a2c11d9809 100644 --- a/drivers/video/fbsysfs.c +++ b/drivers/video/fbsysfs.c | |||
| @@ -62,9 +62,6 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev) | |||
| 62 | mutex_init(&info->bl_curve_mutex); | 62 | mutex_init(&info->bl_curve_mutex); |
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| 65 | mutex_init(&info->lock); | ||
| 66 | mutex_init(&info->mm_lock); | ||
| 67 | |||
| 68 | return info; | 65 | return info; |
| 69 | #undef PADDING | 66 | #undef PADDING |
| 70 | #undef BYTES_PER_LONG | 67 | #undef BYTES_PER_LONG |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 0bf2190928d0..72d68b3dc478 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
| @@ -1223,12 +1223,6 @@ static int __devinit install_fb(struct fb_info *info) | |||
| 1223 | return -EINVAL; | 1223 | return -EINVAL; |
| 1224 | } | 1224 | } |
| 1225 | 1225 | ||
| 1226 | if (fsl_diu_set_par(info)) { | ||
| 1227 | printk(KERN_ERR "fb_set_par failed"); | ||
| 1228 | fb_dealloc_cmap(&info->cmap); | ||
| 1229 | return -EINVAL; | ||
| 1230 | } | ||
| 1231 | |||
| 1232 | if (register_framebuffer(info) < 0) { | 1226 | if (register_framebuffer(info) < 0) { |
| 1233 | printk(KERN_ERR "register_framebuffer failed"); | 1227 | printk(KERN_ERR "register_framebuffer failed"); |
| 1234 | unmap_video_memory(info); | 1228 | unmap_video_memory(info); |
diff --git a/drivers/video/hitfb.c b/drivers/video/hitfb.c index 020db7fc9153..e7116a6d82d3 100644 --- a/drivers/video/hitfb.c +++ b/drivers/video/hitfb.c | |||
| @@ -44,9 +44,6 @@ static struct fb_fix_screeninfo hitfb_fix __initdata = { | |||
| 44 | .accel = FB_ACCEL_NONE, | 44 | .accel = FB_ACCEL_NONE, |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | static u32 pseudo_palette[16]; | ||
| 48 | static struct fb_info fb_info; | ||
| 49 | |||
| 50 | static inline void hitfb_accel_wait(void) | 47 | static inline void hitfb_accel_wait(void) |
| 51 | { | 48 | { |
| 52 | while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; | 49 | while (fb_readw(HD64461_GRCFGR) & HD64461_GRCFGR_ACCSTATUS) ; |
| @@ -331,6 +328,8 @@ static struct fb_ops hitfb_ops = { | |||
| 331 | static int __init hitfb_probe(struct platform_device *dev) | 328 | static int __init hitfb_probe(struct platform_device *dev) |
| 332 | { | 329 | { |
| 333 | unsigned short lcdclor, ldr3, ldvndr; | 330 | unsigned short lcdclor, ldr3, ldvndr; |
| 331 | struct fb_info *info; | ||
| 332 | int ret; | ||
| 334 | 333 | ||
| 335 | if (fb_get_options("hitfb", NULL)) | 334 | if (fb_get_options("hitfb", NULL)) |
| 336 | return -ENODEV; | 335 | return -ENODEV; |
| @@ -384,32 +383,53 @@ static int __init hitfb_probe(struct platform_device *dev) | |||
| 384 | break; | 383 | break; |
| 385 | } | 384 | } |
| 386 | 385 | ||
| 387 | fb_info.fbops = &hitfb_ops; | 386 | info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev); |
| 388 | fb_info.var = hitfb_var; | 387 | if (unlikely(!info)) |
| 389 | fb_info.fix = hitfb_fix; | 388 | return -ENOMEM; |
| 390 | fb_info.pseudo_palette = pseudo_palette; | 389 | |
| 391 | fb_info.flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | | 390 | info->fbops = &hitfb_ops; |
| 391 | info->var = hitfb_var; | ||
| 392 | info->fix = hitfb_fix; | ||
| 393 | info->pseudo_palette = info->par; | ||
| 394 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN | | ||
| 392 | FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; | 395 | FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_COPYAREA; |
| 393 | 396 | ||
| 394 | fb_info.screen_base = (void *)hitfb_fix.smem_start; | 397 | info->screen_base = (void *)hitfb_fix.smem_start; |
| 395 | 398 | ||
| 396 | fb_alloc_cmap(&fb_info.cmap, 256, 0); | 399 | ret = fb_alloc_cmap(&info->cmap, 256, 0); |
| 400 | if (unlikely(ret < 0)) | ||
| 401 | goto err_fb; | ||
| 397 | 402 | ||
| 398 | if (register_framebuffer(&fb_info) < 0) | 403 | ret = register_framebuffer(info); |
| 399 | return -EINVAL; | 404 | if (unlikely(ret < 0)) |
| 405 | goto err; | ||
| 406 | |||
| 407 | platform_set_drvdata(dev, info); | ||
| 400 | 408 | ||
| 401 | printk(KERN_INFO "fb%d: %s frame buffer device\n", | 409 | printk(KERN_INFO "fb%d: %s frame buffer device\n", |
| 402 | fb_info.node, fb_info.fix.id); | 410 | info->node, info->fix.id); |
| 411 | |||
| 403 | return 0; | 412 | return 0; |
| 413 | |||
| 414 | err: | ||
| 415 | fb_dealloc_cmap(&info->cmap); | ||
| 416 | err_fb: | ||
| 417 | framebuffer_release(info); | ||
| 418 | return ret; | ||
| 404 | } | 419 | } |
| 405 | 420 | ||
| 406 | static int __exit hitfb_remove(struct platform_device *dev) | 421 | static int __exit hitfb_remove(struct platform_device *dev) |
| 407 | { | 422 | { |
| 408 | return unregister_framebuffer(&fb_info); | 423 | struct fb_info *info = platform_get_drvdata(dev); |
| 424 | |||
| 425 | unregister_framebuffer(info); | ||
| 426 | fb_dealloc_cmap(&info->cmap); | ||
| 427 | framebuffer_release(info); | ||
| 428 | |||
| 429 | return 0; | ||
| 409 | } | 430 | } |
| 410 | 431 | ||
| 411 | #ifdef CONFIG_PM | 432 | static int hitfb_suspend(struct device *dev) |
| 412 | static int hitfb_suspend(struct platform_device *dev, pm_message_t state) | ||
| 413 | { | 433 | { |
| 414 | u16 v; | 434 | u16 v; |
| 415 | 435 | ||
| @@ -421,7 +441,7 @@ static int hitfb_suspend(struct platform_device *dev, pm_message_t state) | |||
| 421 | return 0; | 441 | return 0; |
| 422 | } | 442 | } |
| 423 | 443 | ||
| 424 | static int hitfb_resume(struct platform_device *dev) | 444 | static int hitfb_resume(struct device *dev) |
| 425 | { | 445 | { |
| 426 | u16 v; | 446 | u16 v; |
| 427 | 447 | ||
| @@ -435,17 +455,19 @@ static int hitfb_resume(struct platform_device *dev) | |||
| 435 | 455 | ||
| 436 | return 0; | 456 | return 0; |
| 437 | } | 457 | } |
| 438 | #endif | 458 | |
| 459 | static struct dev_pm_ops hitfb_dev_pm_ops = { | ||
| 460 | .suspend = hitfb_suspend, | ||
| 461 | .resume = hitfb_resume, | ||
| 462 | }; | ||
| 439 | 463 | ||
| 440 | static struct platform_driver hitfb_driver = { | 464 | static struct platform_driver hitfb_driver = { |
| 441 | .probe = hitfb_probe, | 465 | .probe = hitfb_probe, |
| 442 | .remove = __exit_p(hitfb_remove), | 466 | .remove = __exit_p(hitfb_remove), |
| 443 | #ifdef CONFIG_PM | ||
| 444 | .suspend = hitfb_suspend, | ||
| 445 | .resume = hitfb_resume, | ||
| 446 | #endif | ||
| 447 | .driver = { | 467 | .driver = { |
| 448 | .name = "hitfb", | 468 | .name = "hitfb", |
| 469 | .owner = THIS_MODULE, | ||
| 470 | .pm = &hitfb_dev_pm_ops, | ||
| 449 | }, | 471 | }, |
| 450 | }; | 472 | }; |
| 451 | 473 | ||
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 71960672d721..5743ea25e818 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
| @@ -2060,8 +2060,7 @@ static int __devinit i810fb_init_pci (struct pci_dev *dev, | |||
| 2060 | 2060 | ||
| 2061 | fb_var_to_videomode(&mode, &info->var); | 2061 | fb_var_to_videomode(&mode, &info->var); |
| 2062 | fb_add_videomode(&mode, &info->modelist); | 2062 | fb_add_videomode(&mode, &info->modelist); |
| 2063 | encode_fix(&info->fix, info); | 2063 | |
| 2064 | |||
| 2065 | i810fb_init_ringbuffer(info); | 2064 | i810fb_init_ringbuffer(info); |
| 2066 | err = register_framebuffer(info); | 2065 | err = register_framebuffer(info); |
| 2067 | 2066 | ||
diff --git a/drivers/video/matrox/matroxfb_DAC1064.c b/drivers/video/matrox/matroxfb_DAC1064.c index 0ce3b0a89798..a74e5da17aa0 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.c +++ b/drivers/video/matrox/matroxfb_DAC1064.c | |||
| @@ -454,9 +454,9 @@ static void DAC1064_restore_2(WPMINFO2) { | |||
| 454 | dprintk(KERN_DEBUG "DAC1064regs "); | 454 | dprintk(KERN_DEBUG "DAC1064regs "); |
| 455 | for (i = 0; i < sizeof(MGA1064_DAC_regs); i++) { | 455 | for (i = 0; i < sizeof(MGA1064_DAC_regs); i++) { |
| 456 | dprintk("R%02X=%02X ", MGA1064_DAC_regs[i], ACCESS_FBINFO(hw).DACreg[i]); | 456 | dprintk("R%02X=%02X ", MGA1064_DAC_regs[i], ACCESS_FBINFO(hw).DACreg[i]); |
| 457 | if ((i & 0x7) == 0x7) dprintk("\n" KERN_DEBUG "continuing... "); | 457 | if ((i & 0x7) == 0x7) dprintk(KERN_DEBUG "continuing... "); |
| 458 | } | 458 | } |
| 459 | dprintk("\n" KERN_DEBUG "DAC1064clk "); | 459 | dprintk(KERN_DEBUG "DAC1064clk "); |
| 460 | for (i = 0; i < 6; i++) | 460 | for (i = 0; i < 6; i++) |
| 461 | dprintk("C%02X=%02X ", i, ACCESS_FBINFO(hw).DACclk[i]); | 461 | dprintk("C%02X=%02X ", i, ACCESS_FBINFO(hw).DACclk[i]); |
| 462 | dprintk("\n"); | 462 | dprintk("\n"); |
diff --git a/drivers/video/matrox/matroxfb_Ti3026.c b/drivers/video/matrox/matroxfb_Ti3026.c index 13524821e242..4e825112a601 100644 --- a/drivers/video/matrox/matroxfb_Ti3026.c +++ b/drivers/video/matrox/matroxfb_Ti3026.c | |||
| @@ -651,9 +651,9 @@ static void Ti3026_restore(WPMINFO2) { | |||
| 651 | dprintk(KERN_DEBUG "3026DACregs "); | 651 | dprintk(KERN_DEBUG "3026DACregs "); |
| 652 | for (i = 0; i < 21; i++) { | 652 | for (i = 0; i < 21; i++) { |
| 653 | dprintk("R%02X=%02X ", DACseq[i], hw->DACreg[i]); | 653 | dprintk("R%02X=%02X ", DACseq[i], hw->DACreg[i]); |
| 654 | if ((i & 0x7) == 0x7) dprintk("\n" KERN_DEBUG "continuing... "); | 654 | if ((i & 0x7) == 0x7) dprintk(KERN_DEBUG "continuing... "); |
| 655 | } | 655 | } |
| 656 | dprintk("\n" KERN_DEBUG "DACclk "); | 656 | dprintk(KERN_DEBUG "DACclk "); |
| 657 | for (i = 0; i < 6; i++) | 657 | for (i = 0; i < 6; i++) |
| 658 | dprintk("C%02X=%02X ", i, hw->DACclk[i]); | 658 | dprintk("C%02X=%02X ", i, hw->DACclk[i]); |
| 659 | dprintk("\n"); | 659 | dprintk("\n"); |
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index 76bc51b616d1..0c1049b308bf 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c | |||
| @@ -1876,7 +1876,6 @@ static int initMatrox2(WPMINFO struct board* b){ | |||
| 1876 | } | 1876 | } |
| 1877 | matroxfb_init_fix(PMINFO2); | 1877 | matroxfb_init_fix(PMINFO2); |
| 1878 | ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)); | 1878 | ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)); |
| 1879 | matroxfb_update_fix(PMINFO2); | ||
| 1880 | /* Normalize values (namely yres_virtual) */ | 1879 | /* Normalize values (namely yres_virtual) */ |
| 1881 | matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon)); | 1880 | matroxfb_check_var(&vesafb_defined, &ACCESS_FBINFO(fbcon)); |
| 1882 | /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over | 1881 | /* And put it into "current" var. Do NOT program hardware yet, or we'll not take over |
| @@ -2083,7 +2082,6 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm | |||
| 2083 | spin_lock_init(&ACCESS_FBINFO(lock.accel)); | 2082 | spin_lock_init(&ACCESS_FBINFO(lock.accel)); |
| 2084 | init_rwsem(&ACCESS_FBINFO(crtc2.lock)); | 2083 | init_rwsem(&ACCESS_FBINFO(crtc2.lock)); |
| 2085 | init_rwsem(&ACCESS_FBINFO(altout.lock)); | 2084 | init_rwsem(&ACCESS_FBINFO(altout.lock)); |
| 2086 | mutex_init(&ACCESS_FBINFO(fbcon).lock); | ||
| 2087 | mutex_init(&ACCESS_FBINFO(fbcon).mm_lock); | 2085 | mutex_init(&ACCESS_FBINFO(fbcon).mm_lock); |
| 2088 | ACCESS_FBINFO(irq_flags) = 0; | 2086 | ACCESS_FBINFO(irq_flags) = 0; |
| 2089 | init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); | 2087 | init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); |
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c index 909e10a11898..ebcb5c6b4962 100644 --- a/drivers/video/matrox/matroxfb_crtc2.c +++ b/drivers/video/matrox/matroxfb_crtc2.c | |||
| @@ -289,16 +289,18 @@ static int matroxfb_dh_release(struct fb_info* info, int user) { | |||
| 289 | #undef m2info | 289 | #undef m2info |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | /* | ||
| 293 | * This function is called before the register_framebuffer so | ||
| 294 | * no locking is needed. | ||
| 295 | */ | ||
| 292 | static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) | 296 | static void matroxfb_dh_init_fix(struct matroxfb_dh_fb_info *m2info) |
| 293 | { | 297 | { |
| 294 | struct fb_fix_screeninfo *fix = &m2info->fbcon.fix; | 298 | struct fb_fix_screeninfo *fix = &m2info->fbcon.fix; |
| 295 | 299 | ||
| 296 | strcpy(fix->id, "MATROX DH"); | 300 | strcpy(fix->id, "MATROX DH"); |
| 297 | 301 | ||
| 298 | mutex_lock(&m2info->fbcon.mm_lock); | ||
| 299 | fix->smem_start = m2info->video.base; | 302 | fix->smem_start = m2info->video.base; |
| 300 | fix->smem_len = m2info->video.len_usable; | 303 | fix->smem_len = m2info->video.len_usable; |
| 301 | mutex_unlock(&m2info->fbcon.mm_lock); | ||
| 302 | fix->ypanstep = 1; | 304 | fix->ypanstep = 1; |
| 303 | fix->ywrapstep = 0; | 305 | fix->ywrapstep = 0; |
| 304 | fix->xpanstep = 8; /* TBD */ | 306 | fix->xpanstep = 8; /* TBD */ |
diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index 567fb944bd2a..f8778cde2183 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c | |||
| @@ -1365,11 +1365,6 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan) | |||
| 1365 | init_completion(&mx3fbi->flip_cmpl); | 1365 | init_completion(&mx3fbi->flip_cmpl); |
| 1366 | disable_irq(ichan->eof_irq); | 1366 | disable_irq(ichan->eof_irq); |
| 1367 | dev_dbg(mx3fb->dev, "disabling irq %d\n", ichan->eof_irq); | 1367 | dev_dbg(mx3fb->dev, "disabling irq %d\n", ichan->eof_irq); |
| 1368 | ret = mx3fb_set_par(fbi); | ||
| 1369 | if (ret < 0) | ||
| 1370 | goto esetpar; | ||
| 1371 | |||
| 1372 | mx3fb_blank(FB_BLANK_UNBLANK, fbi); | ||
| 1373 | 1368 | ||
| 1374 | dev_info(dev, "registered, using mode %s\n", fb_mode); | 1369 | dev_info(dev, "registered, using mode %s\n", fb_mode); |
| 1375 | 1370 | ||
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index da983b720f08..8f24564f77b0 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
| @@ -31,7 +31,7 @@ struct sh_mobile_lcdc_chan { | |||
| 31 | unsigned long enabled; /* ME and SE in LDCNT2R */ | 31 | unsigned long enabled; /* ME and SE in LDCNT2R */ |
| 32 | struct sh_mobile_lcdc_chan_cfg cfg; | 32 | struct sh_mobile_lcdc_chan_cfg cfg; |
| 33 | u32 pseudo_palette[PALETTE_NR]; | 33 | u32 pseudo_palette[PALETTE_NR]; |
| 34 | struct fb_info info; | 34 | struct fb_info *info; |
| 35 | dma_addr_t dma_handle; | 35 | dma_addr_t dma_handle; |
| 36 | struct fb_deferred_io defio; | 36 | struct fb_deferred_io defio; |
| 37 | struct scatterlist *sglist; | 37 | struct scatterlist *sglist; |
| @@ -442,22 +442,22 @@ static int sh_mobile_lcdc_start(struct sh_mobile_lcdc_priv *priv) | |||
| 442 | /* set bpp format in PKF[4:0] */ | 442 | /* set bpp format in PKF[4:0] */ |
| 443 | tmp = lcdc_read_chan(ch, LDDFR); | 443 | tmp = lcdc_read_chan(ch, LDDFR); |
| 444 | tmp &= ~(0x0001001f); | 444 | tmp &= ~(0x0001001f); |
| 445 | tmp |= (priv->ch[k].info.var.bits_per_pixel == 16) ? 3 : 0; | 445 | tmp |= (ch->info->var.bits_per_pixel == 16) ? 3 : 0; |
| 446 | lcdc_write_chan(ch, LDDFR, tmp); | 446 | lcdc_write_chan(ch, LDDFR, tmp); |
| 447 | 447 | ||
| 448 | /* point out our frame buffer */ | 448 | /* point out our frame buffer */ |
| 449 | lcdc_write_chan(ch, LDSA1R, ch->info.fix.smem_start); | 449 | lcdc_write_chan(ch, LDSA1R, ch->info->fix.smem_start); |
| 450 | 450 | ||
| 451 | /* set line size */ | 451 | /* set line size */ |
| 452 | lcdc_write_chan(ch, LDMLSR, ch->info.fix.line_length); | 452 | lcdc_write_chan(ch, LDMLSR, ch->info->fix.line_length); |
| 453 | 453 | ||
| 454 | /* setup deferred io if SYS bus */ | 454 | /* setup deferred io if SYS bus */ |
| 455 | tmp = ch->cfg.sys_bus_cfg.deferred_io_msec; | 455 | tmp = ch->cfg.sys_bus_cfg.deferred_io_msec; |
| 456 | if (ch->ldmt1r_value & (1 << 12) && tmp) { | 456 | if (ch->ldmt1r_value & (1 << 12) && tmp) { |
| 457 | ch->defio.deferred_io = sh_mobile_lcdc_deferred_io; | 457 | ch->defio.deferred_io = sh_mobile_lcdc_deferred_io; |
| 458 | ch->defio.delay = msecs_to_jiffies(tmp); | 458 | ch->defio.delay = msecs_to_jiffies(tmp); |
| 459 | ch->info.fbdefio = &ch->defio; | 459 | ch->info->fbdefio = &ch->defio; |
| 460 | fb_deferred_io_init(&ch->info); | 460 | fb_deferred_io_init(ch->info); |
| 461 | 461 | ||
| 462 | /* one-shot mode */ | 462 | /* one-shot mode */ |
| 463 | lcdc_write_chan(ch, LDSM1R, 1); | 463 | lcdc_write_chan(ch, LDSM1R, 1); |
| @@ -503,12 +503,12 @@ static void sh_mobile_lcdc_stop(struct sh_mobile_lcdc_priv *priv) | |||
| 503 | * flush frame, and wait for frame end interrupt | 503 | * flush frame, and wait for frame end interrupt |
| 504 | * clean up deferred io and enable clock | 504 | * clean up deferred io and enable clock |
| 505 | */ | 505 | */ |
| 506 | if (ch->info.fbdefio) { | 506 | if (ch->info->fbdefio) { |
| 507 | ch->frame_end = 0; | 507 | ch->frame_end = 0; |
| 508 | schedule_delayed_work(&ch->info.deferred_work, 0); | 508 | schedule_delayed_work(&ch->info->deferred_work, 0); |
| 509 | wait_event(ch->frame_end_wait, ch->frame_end); | 509 | wait_event(ch->frame_end_wait, ch->frame_end); |
| 510 | fb_deferred_io_cleanup(&ch->info); | 510 | fb_deferred_io_cleanup(ch->info); |
| 511 | ch->info.fbdefio = NULL; | 511 | ch->info->fbdefio = NULL; |
| 512 | sh_mobile_lcdc_clk_on(priv); | 512 | sh_mobile_lcdc_clk_on(priv); |
| 513 | } | 513 | } |
| 514 | 514 | ||
| @@ -817,9 +817,16 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 817 | priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); | 817 | priv->base = ioremap_nocache(res->start, (res->end - res->start) + 1); |
| 818 | 818 | ||
| 819 | for (i = 0; i < j; i++) { | 819 | for (i = 0; i < j; i++) { |
| 820 | info = &priv->ch[i].info; | ||
| 821 | cfg = &priv->ch[i].cfg; | 820 | cfg = &priv->ch[i].cfg; |
| 822 | 821 | ||
| 822 | priv->ch[i].info = framebuffer_alloc(0, &pdev->dev); | ||
| 823 | if (!priv->ch[i].info) { | ||
| 824 | dev_err(&pdev->dev, "unable to allocate fb_info\n"); | ||
| 825 | error = -ENOMEM; | ||
| 826 | break; | ||
| 827 | } | ||
| 828 | |||
| 829 | info = priv->ch[i].info; | ||
| 823 | info->fbops = &sh_mobile_lcdc_ops; | 830 | info->fbops = &sh_mobile_lcdc_ops; |
| 824 | info->var.xres = info->var.xres_virtual = cfg->lcd_cfg.xres; | 831 | info->var.xres = info->var.xres_virtual = cfg->lcd_cfg.xres; |
| 825 | info->var.yres = info->var.yres_virtual = cfg->lcd_cfg.yres; | 832 | info->var.yres = info->var.yres_virtual = cfg->lcd_cfg.yres; |
| @@ -872,7 +879,7 @@ static int __init sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
| 872 | for (i = 0; i < j; i++) { | 879 | for (i = 0; i < j; i++) { |
| 873 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; | 880 | struct sh_mobile_lcdc_chan *ch = priv->ch + i; |
| 874 | 881 | ||
| 875 | info = &ch->info; | 882 | info = ch->info; |
| 876 | 883 | ||
| 877 | if (info->fbdefio) { | 884 | if (info->fbdefio) { |
| 878 | priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * | 885 | priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * |
| @@ -915,15 +922,15 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
| 915 | int i; | 922 | int i; |
| 916 | 923 | ||
| 917 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) | 924 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) |
| 918 | if (priv->ch[i].info.dev) | 925 | if (priv->ch[i].info->dev) |
| 919 | unregister_framebuffer(&priv->ch[i].info); | 926 | unregister_framebuffer(priv->ch[i].info); |
| 920 | 927 | ||
| 921 | sh_mobile_lcdc_stop(priv); | 928 | sh_mobile_lcdc_stop(priv); |
| 922 | 929 | ||
| 923 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | 930 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { |
| 924 | info = &priv->ch[i].info; | 931 | info = priv->ch[i].info; |
| 925 | 932 | ||
| 926 | if (!info->device) | 933 | if (!info || !info->device) |
| 927 | continue; | 934 | continue; |
| 928 | 935 | ||
| 929 | if (priv->ch[i].sglist) | 936 | if (priv->ch[i].sglist) |
| @@ -932,6 +939,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
| 932 | dma_free_coherent(&pdev->dev, info->fix.smem_len, | 939 | dma_free_coherent(&pdev->dev, info->fix.smem_len, |
| 933 | info->screen_base, priv->ch[i].dma_handle); | 940 | info->screen_base, priv->ch[i].dma_handle); |
| 934 | fb_dealloc_cmap(&info->cmap); | 941 | fb_dealloc_cmap(&info->cmap); |
| 942 | framebuffer_release(info); | ||
| 935 | } | 943 | } |
| 936 | 944 | ||
| 937 | #ifdef CONFIG_HAVE_CLK | 945 | #ifdef CONFIG_HAVE_CLK |
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index 98f24f0ec00d..924d79462780 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c | |||
| @@ -1540,9 +1540,6 @@ static int sm501fb_init_fb(struct fb_info *fb, | |||
| 1540 | if (ret) | 1540 | if (ret) |
| 1541 | dev_err(info->dev, "check_var() failed on initial setup?\n"); | 1541 | dev_err(info->dev, "check_var() failed on initial setup?\n"); |
| 1542 | 1542 | ||
| 1543 | /* ensure we've activated our new configuration */ | ||
| 1544 | (fb->fbops->fb_set_par)(fb); | ||
| 1545 | |||
| 1546 | return 0; | 1543 | return 0; |
| 1547 | } | 1544 | } |
| 1548 | 1545 | ||
| @@ -1624,6 +1621,8 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info, | |||
| 1624 | if (!fbi) | 1621 | if (!fbi) |
| 1625 | return 0; | 1622 | return 0; |
| 1626 | 1623 | ||
| 1624 | mutex_init(&info->fb[head]->mm_lock); | ||
| 1625 | |||
| 1627 | ret = sm501fb_init_fb(info->fb[head], head, drvname); | 1626 | ret = sm501fb_init_fb(info->fb[head], head, drvname); |
| 1628 | if (ret) { | 1627 | if (ret) { |
| 1629 | dev_err(info->dev, "cannot initialise fb %s\n", drvname); | 1628 | dev_err(info->dev, "cannot initialise fb %s\n", drvname); |
diff --git a/drivers/video/stifb.c b/drivers/video/stifb.c index eec9dcb7f599..6120f0c526fe 100644 --- a/drivers/video/stifb.c +++ b/drivers/video/stifb.c | |||
| @@ -1115,10 +1115,9 @@ static int __init stifb_init_fb(struct sti_struct *sti, int bpp_pref) | |||
| 1115 | if the device name contains the string "DX" and tell the | 1115 | if the device name contains the string "DX" and tell the |
| 1116 | user how to reconfigure the card. */ | 1116 | user how to reconfigure the card. */ |
| 1117 | if (strstr(sti->outptr.dev_name, "DX")) { | 1117 | if (strstr(sti->outptr.dev_name, "DX")) { |
| 1118 | printk(KERN_WARNING "WARNING: stifb framebuffer driver does not " | 1118 | printk(KERN_WARNING |
| 1119 | "support '%s' in double-buffer mode.\n" | 1119 | "WARNING: stifb framebuffer driver does not support '%s' in double-buffer mode.\n" |
| 1120 | KERN_WARNING "WARNING: Please disable the double-buffer mode " | 1120 | "WARNING: Please disable the double-buffer mode in IPL menu (the PARISC-BIOS).\n", |
| 1121 | "in IPL menu (the PARISC-BIOS).\n", | ||
| 1122 | sti->outptr.dev_name); | 1121 | sti->outptr.dev_name); |
| 1123 | goto out_err0; | 1122 | goto out_err0; |
| 1124 | } | 1123 | } |
diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c index 8a141c2c637b..2376f688ec8b 100644 --- a/drivers/video/w100fb.c +++ b/drivers/video/w100fb.c | |||
| @@ -748,8 +748,6 @@ int __init w100fb_probe(struct platform_device *pdev) | |||
| 748 | goto out; | 748 | goto out; |
| 749 | } | 749 | } |
| 750 | 750 | ||
| 751 | w100fb_set_par(info); | ||
| 752 | |||
| 753 | if (register_framebuffer(info) < 0) { | 751 | if (register_framebuffer(info) < 0) { |
| 754 | err = -EINVAL; | 752 | err = -EINVAL; |
| 755 | goto out; | 753 | goto out; |
diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index 5c7011cda6a6..751c003864ad 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c | |||
| @@ -161,7 +161,7 @@ static long bcm47xx_wdt_ioctl(struct file *file, | |||
| 161 | { | 161 | { |
| 162 | void __user *argp = (void __user *)arg; | 162 | void __user *argp = (void __user *)arg; |
| 163 | int __user *p = argp; | 163 | int __user *p = argp; |
| 164 | int new_value, retval = -EINVAL;; | 164 | int new_value, retval = -EINVAL; |
| 165 | 165 | ||
| 166 | switch (cmd) { | 166 | switch (cmd) { |
| 167 | case WDIOC_GETSUPPORT: | 167 | case WDIOC_GETSUPPORT: |
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index ee1caae4d33b..016245419fad 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | static unsigned long oscr_freq; | 39 | static unsigned long oscr_freq; |
| 40 | static unsigned long sa1100wdt_users; | 40 | static unsigned long sa1100wdt_users; |
| 41 | static int pre_margin; | 41 | static unsigned int pre_margin; |
| 42 | static int boot_status; | 42 | static int boot_status; |
| 43 | 43 | ||
| 44 | /* | 44 | /* |
| @@ -84,6 +84,7 @@ static const struct watchdog_info ident = { | |||
| 84 | .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT | 84 | .options = WDIOF_CARDRESET | WDIOF_SETTIMEOUT |
| 85 | | WDIOF_KEEPALIVEPING, | 85 | | WDIOF_KEEPALIVEPING, |
| 86 | .identity = "SA1100/PXA255 Watchdog", | 86 | .identity = "SA1100/PXA255 Watchdog", |
| 87 | .firmware_version = 1, | ||
| 87 | }; | 88 | }; |
| 88 | 89 | ||
| 89 | static long sa1100dog_ioctl(struct file *file, unsigned int cmd, | 90 | static long sa1100dog_ioctl(struct file *file, unsigned int cmd, |
| @@ -118,7 +119,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd, | |||
| 118 | if (ret) | 119 | if (ret) |
| 119 | break; | 120 | break; |
| 120 | 121 | ||
| 121 | if (time <= 0 || time > 255) { | 122 | if (time <= 0 || (oscr_freq * (long long)time >= 0xffffffff)) { |
| 122 | ret = -EINVAL; | 123 | ret = -EINVAL; |
| 123 | break; | 124 | break; |
| 124 | } | 125 | } |
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 916890abffdd..f201accc4e3d 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c | |||
| @@ -89,6 +89,11 @@ static void w83627hf_select_wd_register(void) | |||
| 89 | c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */ | 89 | c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */ |
| 90 | outb_p(0x2b, WDT_EFER); | 90 | outb_p(0x2b, WDT_EFER); |
| 91 | outb_p(c, WDT_EFDR); /* set GPIO3 to WDT0 */ | 91 | outb_p(c, WDT_EFDR); /* set GPIO3 to WDT0 */ |
| 92 | } else if (c == 0x88) { /* W83627EHF */ | ||
| 93 | outb_p(0x2d, WDT_EFER); /* select GPIO5 */ | ||
| 94 | c = inb_p(WDT_EFDR) & ~0x01; /* PIN77 -> WDT0# */ | ||
| 95 | outb_p(0x2d, WDT_EFER); | ||
| 96 | outb_p(c, WDT_EFDR); /* set GPIO5 to WDT0 */ | ||
| 92 | } | 97 | } |
| 93 | 98 | ||
| 94 | outb_p(0x07, WDT_EFER); /* point to logical device number reg */ | 99 | outb_p(0x07, WDT_EFER); /* point to logical device number reg */ |
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c index 883b5f79673a..a6c12dec91a1 100644 --- a/drivers/watchdog/w83697ug_wdt.c +++ b/drivers/watchdog/w83697ug_wdt.c | |||
| @@ -149,8 +149,10 @@ static void wdt_ctrl(int timeout) | |||
| 149 | { | 149 | { |
| 150 | spin_lock(&io_lock); | 150 | spin_lock(&io_lock); |
| 151 | 151 | ||
| 152 | if (w83697ug_select_wd_register() < 0) | 152 | if (w83697ug_select_wd_register() < 0) { |
| 153 | spin_unlock(&io_lock); | ||
| 153 | return; | 154 | return; |
| 155 | } | ||
| 154 | 156 | ||
| 155 | outb_p(0xF4, WDT_EFER); /* Select CRF4 */ | 157 | outb_p(0xF4, WDT_EFER); /* Select CRF4 */ |
| 156 | outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */ | 158 | outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF4 */ |
