diff options
| -rw-r--r-- | drivers/char/ipmi/ipmi_devintf.c | 6 | ||||
| -rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 102 | ||||
| -rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 121 | ||||
| -rw-r--r-- | drivers/char/ipmi/ipmi_ssif.c | 6 |
4 files changed, 110 insertions, 125 deletions
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c index ec318bf434a6..1786574536b2 100644 --- a/drivers/char/ipmi/ipmi_devintf.c +++ b/drivers/char/ipmi/ipmi_devintf.c | |||
| @@ -157,12 +157,16 @@ static int ipmi_release(struct inode *inode, struct file *file) | |||
| 157 | { | 157 | { |
| 158 | struct ipmi_file_private *priv = file->private_data; | 158 | struct ipmi_file_private *priv = file->private_data; |
| 159 | int rv; | 159 | int rv; |
| 160 | struct ipmi_recv_msg *msg, *next; | ||
| 160 | 161 | ||
| 161 | rv = ipmi_destroy_user(priv->user); | 162 | rv = ipmi_destroy_user(priv->user); |
| 162 | if (rv) | 163 | if (rv) |
| 163 | return rv; | 164 | return rv; |
| 164 | 165 | ||
| 165 | /* FIXME - free the messages in the list. */ | 166 | list_for_each_entry_safe(msg, next, &priv->recv_msgs, link) |
| 167 | ipmi_free_recv_msg(msg); | ||
| 168 | |||
| 169 | |||
| 166 | kfree(priv); | 170 | kfree(priv); |
| 167 | 171 | ||
| 168 | return 0; | 172 | return 0; |
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 6b65fa4e0c55..9bb592872532 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c | |||
| @@ -1483,14 +1483,10 @@ static inline void format_lan_msg(struct ipmi_smi_msg *smi_msg, | |||
| 1483 | smi_msg->msgid = msgid; | 1483 | smi_msg->msgid = msgid; |
| 1484 | } | 1484 | } |
| 1485 | 1485 | ||
| 1486 | static void smi_send(ipmi_smi_t intf, struct ipmi_smi_handlers *handlers, | 1486 | static struct ipmi_smi_msg *smi_add_send_msg(ipmi_smi_t intf, |
| 1487 | struct ipmi_smi_msg *smi_msg, int priority) | 1487 | struct ipmi_smi_msg *smi_msg, |
| 1488 | int priority) | ||
| 1488 | { | 1489 | { |
| 1489 | int run_to_completion = intf->run_to_completion; | ||
| 1490 | unsigned long flags; | ||
| 1491 | |||
| 1492 | if (!run_to_completion) | ||
| 1493 | spin_lock_irqsave(&intf->xmit_msgs_lock, flags); | ||
| 1494 | if (intf->curr_msg) { | 1490 | if (intf->curr_msg) { |
| 1495 | if (priority > 0) | 1491 | if (priority > 0) |
| 1496 | list_add_tail(&smi_msg->link, &intf->hp_xmit_msgs); | 1492 | list_add_tail(&smi_msg->link, &intf->hp_xmit_msgs); |
| @@ -1500,8 +1496,25 @@ static void smi_send(ipmi_smi_t intf, struct ipmi_smi_handlers *handlers, | |||
| 1500 | } else { | 1496 | } else { |
| 1501 | intf->curr_msg = smi_msg; | 1497 | intf->curr_msg = smi_msg; |
| 1502 | } | 1498 | } |
| 1503 | if (!run_to_completion) | 1499 | |
| 1500 | return smi_msg; | ||
| 1501 | } | ||
| 1502 | |||
| 1503 | |||
| 1504 | static void smi_send(ipmi_smi_t intf, struct ipmi_smi_handlers *handlers, | ||
| 1505 | struct ipmi_smi_msg *smi_msg, int priority) | ||
| 1506 | { | ||
| 1507 | int run_to_completion = intf->run_to_completion; | ||
| 1508 | |||
| 1509 | if (run_to_completion) { | ||
| 1510 | smi_msg = smi_add_send_msg(intf, smi_msg, priority); | ||
| 1511 | } else { | ||
| 1512 | unsigned long flags; | ||
| 1513 | |||
| 1514 | spin_lock_irqsave(&intf->xmit_msgs_lock, flags); | ||
| 1515 | smi_msg = smi_add_send_msg(intf, smi_msg, priority); | ||
| 1504 | spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags); | 1516 | spin_unlock_irqrestore(&intf->xmit_msgs_lock, flags); |
| 1517 | } | ||
| 1505 | 1518 | ||
| 1506 | if (smi_msg) | 1519 | if (smi_msg) |
| 1507 | handlers->sender(intf->send_info, smi_msg); | 1520 | handlers->sender(intf->send_info, smi_msg); |
| @@ -1985,7 +1998,9 @@ static int smi_ipmb_proc_show(struct seq_file *m, void *v) | |||
| 1985 | seq_printf(m, "%x", intf->channels[0].address); | 1998 | seq_printf(m, "%x", intf->channels[0].address); |
| 1986 | for (i = 1; i < IPMI_MAX_CHANNELS; i++) | 1999 | for (i = 1; i < IPMI_MAX_CHANNELS; i++) |
| 1987 | seq_printf(m, " %x", intf->channels[i].address); | 2000 | seq_printf(m, " %x", intf->channels[i].address); |
| 1988 | return seq_putc(m, '\n'); | 2001 | seq_putc(m, '\n'); |
| 2002 | |||
| 2003 | return seq_has_overflowed(m); | ||
| 1989 | } | 2004 | } |
| 1990 | 2005 | ||
| 1991 | static int smi_ipmb_proc_open(struct inode *inode, struct file *file) | 2006 | static int smi_ipmb_proc_open(struct inode *inode, struct file *file) |
| @@ -2004,9 +2019,11 @@ static int smi_version_proc_show(struct seq_file *m, void *v) | |||
| 2004 | { | 2019 | { |
| 2005 | ipmi_smi_t intf = m->private; | 2020 | ipmi_smi_t intf = m->private; |
| 2006 | 2021 | ||
| 2007 | return seq_printf(m, "%u.%u\n", | 2022 | seq_printf(m, "%u.%u\n", |
| 2008 | ipmi_version_major(&intf->bmc->id), | 2023 | ipmi_version_major(&intf->bmc->id), |
| 2009 | ipmi_version_minor(&intf->bmc->id)); | 2024 | ipmi_version_minor(&intf->bmc->id)); |
| 2025 | |||
| 2026 | return seq_has_overflowed(m); | ||
| 2010 | } | 2027 | } |
| 2011 | 2028 | ||
| 2012 | static int smi_version_proc_open(struct inode *inode, struct file *file) | 2029 | static int smi_version_proc_open(struct inode *inode, struct file *file) |
| @@ -2353,11 +2370,28 @@ static struct attribute *bmc_dev_attrs[] = { | |||
| 2353 | &dev_attr_additional_device_support.attr, | 2370 | &dev_attr_additional_device_support.attr, |
| 2354 | &dev_attr_manufacturer_id.attr, | 2371 | &dev_attr_manufacturer_id.attr, |
| 2355 | &dev_attr_product_id.attr, | 2372 | &dev_attr_product_id.attr, |
| 2373 | &dev_attr_aux_firmware_revision.attr, | ||
| 2374 | &dev_attr_guid.attr, | ||
| 2356 | NULL | 2375 | NULL |
| 2357 | }; | 2376 | }; |
| 2358 | 2377 | ||
| 2378 | static umode_t bmc_dev_attr_is_visible(struct kobject *kobj, | ||
| 2379 | struct attribute *attr, int idx) | ||
| 2380 | { | ||
| 2381 | struct device *dev = kobj_to_dev(kobj); | ||
| 2382 | struct bmc_device *bmc = to_bmc_device(dev); | ||
| 2383 | umode_t mode = attr->mode; | ||
| 2384 | |||
| 2385 | if (attr == &dev_attr_aux_firmware_revision.attr) | ||
| 2386 | return bmc->id.aux_firmware_revision_set ? mode : 0; | ||
| 2387 | if (attr == &dev_attr_guid.attr) | ||
| 2388 | return bmc->guid_set ? mode : 0; | ||
| 2389 | return mode; | ||
| 2390 | } | ||
| 2391 | |||
| 2359 | static struct attribute_group bmc_dev_attr_group = { | 2392 | static struct attribute_group bmc_dev_attr_group = { |
| 2360 | .attrs = bmc_dev_attrs, | 2393 | .attrs = bmc_dev_attrs, |
| 2394 | .is_visible = bmc_dev_attr_is_visible, | ||
| 2361 | }; | 2395 | }; |
| 2362 | 2396 | ||
| 2363 | static const struct attribute_group *bmc_dev_attr_groups[] = { | 2397 | static const struct attribute_group *bmc_dev_attr_groups[] = { |
| @@ -2380,13 +2414,6 @@ cleanup_bmc_device(struct kref *ref) | |||
| 2380 | { | 2414 | { |
| 2381 | struct bmc_device *bmc = container_of(ref, struct bmc_device, usecount); | 2415 | struct bmc_device *bmc = container_of(ref, struct bmc_device, usecount); |
| 2382 | 2416 | ||
| 2383 | if (bmc->id.aux_firmware_revision_set) | ||
| 2384 | device_remove_file(&bmc->pdev.dev, | ||
| 2385 | &dev_attr_aux_firmware_revision); | ||
| 2386 | if (bmc->guid_set) | ||
| 2387 | device_remove_file(&bmc->pdev.dev, | ||
| 2388 | &dev_attr_guid); | ||
| 2389 | |||
| 2390 | platform_device_unregister(&bmc->pdev); | 2417 | platform_device_unregister(&bmc->pdev); |
| 2391 | } | 2418 | } |
| 2392 | 2419 | ||
| @@ -2407,33 +2434,6 @@ static void ipmi_bmc_unregister(ipmi_smi_t intf) | |||
| 2407 | mutex_unlock(&ipmidriver_mutex); | 2434 | mutex_unlock(&ipmidriver_mutex); |
| 2408 | } | 2435 | } |
| 2409 | 2436 | ||
| 2410 | static int create_bmc_files(struct bmc_device *bmc) | ||
| 2411 | { | ||
| 2412 | int err; | ||
| 2413 | |||
| 2414 | if (bmc->id.aux_firmware_revision_set) { | ||
| 2415 | err = device_create_file(&bmc->pdev.dev, | ||
| 2416 | &dev_attr_aux_firmware_revision); | ||
| 2417 | if (err) | ||
| 2418 | goto out; | ||
| 2419 | } | ||
| 2420 | if (bmc->guid_set) { | ||
| 2421 | err = device_create_file(&bmc->pdev.dev, | ||
| 2422 | &dev_attr_guid); | ||
| 2423 | if (err) | ||
| 2424 | goto out_aux_firm; | ||
| 2425 | } | ||
| 2426 | |||
| 2427 | return 0; | ||
| 2428 | |||
| 2429 | out_aux_firm: | ||
| 2430 | if (bmc->id.aux_firmware_revision_set) | ||
| 2431 | device_remove_file(&bmc->pdev.dev, | ||
| 2432 | &dev_attr_aux_firmware_revision); | ||
| 2433 | out: | ||
| 2434 | return err; | ||
| 2435 | } | ||
| 2436 | |||
| 2437 | static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum) | 2437 | static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum) |
| 2438 | { | 2438 | { |
| 2439 | int rv; | 2439 | int rv; |
| @@ -2522,15 +2522,6 @@ static int ipmi_bmc_register(ipmi_smi_t intf, int ifnum) | |||
| 2522 | return rv; | 2522 | return rv; |
| 2523 | } | 2523 | } |
| 2524 | 2524 | ||
| 2525 | rv = create_bmc_files(bmc); | ||
| 2526 | if (rv) { | ||
| 2527 | mutex_lock(&ipmidriver_mutex); | ||
| 2528 | platform_device_unregister(&bmc->pdev); | ||
| 2529 | mutex_unlock(&ipmidriver_mutex); | ||
| 2530 | |||
| 2531 | return rv; | ||
| 2532 | } | ||
| 2533 | |||
| 2534 | dev_info(intf->si_dev, "Found new BMC (man_id: 0x%6.6x, " | 2525 | dev_info(intf->si_dev, "Found new BMC (man_id: 0x%6.6x, " |
| 2535 | "prod_id: 0x%4.4x, dev_id: 0x%2.2x)\n", | 2526 | "prod_id: 0x%4.4x, dev_id: 0x%2.2x)\n", |
| 2536 | bmc->id.manufacturer_id, | 2527 | bmc->id.manufacturer_id, |
| @@ -4212,7 +4203,6 @@ static void need_waiter(ipmi_smi_t intf) | |||
| 4212 | static atomic_t smi_msg_inuse_count = ATOMIC_INIT(0); | 4203 | static atomic_t smi_msg_inuse_count = ATOMIC_INIT(0); |
| 4213 | static atomic_t recv_msg_inuse_count = ATOMIC_INIT(0); | 4204 | static atomic_t recv_msg_inuse_count = ATOMIC_INIT(0); |
| 4214 | 4205 | ||
| 4215 | /* FIXME - convert these to slabs. */ | ||
| 4216 | static void free_smi_msg(struct ipmi_smi_msg *msg) | 4206 | static void free_smi_msg(struct ipmi_smi_msg *msg) |
| 4217 | { | 4207 | { |
| 4218 | atomic_dec(&smi_msg_inuse_count); | 4208 | atomic_dec(&smi_msg_inuse_count); |
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 967b73aa4e66..f6646ed3047e 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
| @@ -321,6 +321,18 @@ static int try_smi_init(struct smi_info *smi); | |||
| 321 | static void cleanup_one_si(struct smi_info *to_clean); | 321 | static void cleanup_one_si(struct smi_info *to_clean); |
| 322 | static void cleanup_ipmi_si(void); | 322 | static void cleanup_ipmi_si(void); |
| 323 | 323 | ||
| 324 | #ifdef DEBUG_TIMING | ||
| 325 | void debug_timestamp(char *msg) | ||
| 326 | { | ||
| 327 | struct timespec64 t; | ||
| 328 | |||
| 329 | getnstimeofday64(&t); | ||
| 330 | pr_debug("**%s: %lld.%9.9ld\n", msg, (long long) t.tv_sec, t.tv_nsec); | ||
| 331 | } | ||
| 332 | #else | ||
| 333 | #define debug_timestamp(x) | ||
| 334 | #endif | ||
| 335 | |||
| 324 | static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list); | 336 | static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list); |
| 325 | static int register_xaction_notifier(struct notifier_block *nb) | 337 | static int register_xaction_notifier(struct notifier_block *nb) |
| 326 | { | 338 | { |
| @@ -358,9 +370,6 @@ static void return_hosed_msg(struct smi_info *smi_info, int cCode) | |||
| 358 | static enum si_sm_result start_next_msg(struct smi_info *smi_info) | 370 | static enum si_sm_result start_next_msg(struct smi_info *smi_info) |
| 359 | { | 371 | { |
| 360 | int rv; | 372 | int rv; |
| 361 | #ifdef DEBUG_TIMING | ||
| 362 | struct timeval t; | ||
| 363 | #endif | ||
| 364 | 373 | ||
| 365 | if (!smi_info->waiting_msg) { | 374 | if (!smi_info->waiting_msg) { |
| 366 | smi_info->curr_msg = NULL; | 375 | smi_info->curr_msg = NULL; |
| @@ -370,10 +379,7 @@ static enum si_sm_result start_next_msg(struct smi_info *smi_info) | |||
| 370 | 379 | ||
| 371 | smi_info->curr_msg = smi_info->waiting_msg; | 380 | smi_info->curr_msg = smi_info->waiting_msg; |
| 372 | smi_info->waiting_msg = NULL; | 381 | smi_info->waiting_msg = NULL; |
| 373 | #ifdef DEBUG_TIMING | 382 | debug_timestamp("Start2"); |
| 374 | do_gettimeofday(&t); | ||
| 375 | printk(KERN_DEBUG "**Start2: %d.%9.9d\n", t.tv_sec, t.tv_usec); | ||
| 376 | #endif | ||
| 377 | err = atomic_notifier_call_chain(&xaction_notifier_list, | 383 | err = atomic_notifier_call_chain(&xaction_notifier_list, |
| 378 | 0, smi_info); | 384 | 0, smi_info); |
| 379 | if (err & NOTIFY_STOP_MASK) { | 385 | if (err & NOTIFY_STOP_MASK) { |
| @@ -582,12 +588,8 @@ static void check_bt_irq(struct smi_info *smi_info, bool irq_on) | |||
| 582 | static void handle_transaction_done(struct smi_info *smi_info) | 588 | static void handle_transaction_done(struct smi_info *smi_info) |
| 583 | { | 589 | { |
| 584 | struct ipmi_smi_msg *msg; | 590 | struct ipmi_smi_msg *msg; |
| 585 | #ifdef DEBUG_TIMING | ||
| 586 | struct timeval t; | ||
| 587 | 591 | ||
| 588 | do_gettimeofday(&t); | 592 | debug_timestamp("Done"); |
| 589 | printk(KERN_DEBUG "**Done: %d.%9.9d\n", t.tv_sec, t.tv_usec); | ||
| 590 | #endif | ||
| 591 | switch (smi_info->si_state) { | 593 | switch (smi_info->si_state) { |
| 592 | case SI_NORMAL: | 594 | case SI_NORMAL: |
| 593 | if (!smi_info->curr_msg) | 595 | if (!smi_info->curr_msg) |
| @@ -929,24 +931,15 @@ static void sender(void *send_info, | |||
| 929 | struct smi_info *smi_info = send_info; | 931 | struct smi_info *smi_info = send_info; |
| 930 | enum si_sm_result result; | 932 | enum si_sm_result result; |
| 931 | unsigned long flags; | 933 | unsigned long flags; |
| 932 | #ifdef DEBUG_TIMING | ||
| 933 | struct timeval t; | ||
| 934 | #endif | ||
| 935 | |||
| 936 | BUG_ON(smi_info->waiting_msg); | ||
| 937 | smi_info->waiting_msg = msg; | ||
| 938 | 934 | ||
| 939 | #ifdef DEBUG_TIMING | 935 | debug_timestamp("Enqueue"); |
| 940 | do_gettimeofday(&t); | ||
| 941 | printk("**Enqueue: %d.%9.9d\n", t.tv_sec, t.tv_usec); | ||
| 942 | #endif | ||
| 943 | 936 | ||
| 944 | if (smi_info->run_to_completion) { | 937 | if (smi_info->run_to_completion) { |
| 945 | /* | 938 | /* |
| 946 | * If we are running to completion, start it and run | 939 | * If we are running to completion, start it and run |
| 947 | * transactions until everything is clear. | 940 | * transactions until everything is clear. |
| 948 | */ | 941 | */ |
| 949 | smi_info->curr_msg = smi_info->waiting_msg; | 942 | smi_info->curr_msg = msg; |
| 950 | smi_info->waiting_msg = NULL; | 943 | smi_info->waiting_msg = NULL; |
| 951 | 944 | ||
| 952 | /* | 945 | /* |
| @@ -964,6 +957,15 @@ static void sender(void *send_info, | |||
| 964 | } | 957 | } |
| 965 | 958 | ||
| 966 | spin_lock_irqsave(&smi_info->si_lock, flags); | 959 | spin_lock_irqsave(&smi_info->si_lock, flags); |
| 960 | /* | ||
| 961 | * The following two lines don't need to be under the lock for | ||
| 962 | * the lock's sake, but they do need SMP memory barriers to | ||
| 963 | * avoid getting things out of order. We are already claiming | ||
| 964 | * the lock, anyway, so just do it under the lock to avoid the | ||
| 965 | * ordering problem. | ||
| 966 | */ | ||
| 967 | BUG_ON(smi_info->waiting_msg); | ||
| 968 | smi_info->waiting_msg = msg; | ||
| 967 | check_start_timer_thread(smi_info); | 969 | check_start_timer_thread(smi_info); |
| 968 | spin_unlock_irqrestore(&smi_info->si_lock, flags); | 970 | spin_unlock_irqrestore(&smi_info->si_lock, flags); |
| 969 | } | 971 | } |
| @@ -989,18 +991,18 @@ static void set_run_to_completion(void *send_info, bool i_run_to_completion) | |||
| 989 | * we are spinning in kipmid looking for something and not delaying | 991 | * we are spinning in kipmid looking for something and not delaying |
| 990 | * between checks | 992 | * between checks |
| 991 | */ | 993 | */ |
| 992 | static inline void ipmi_si_set_not_busy(struct timespec *ts) | 994 | static inline void ipmi_si_set_not_busy(struct timespec64 *ts) |
| 993 | { | 995 | { |
| 994 | ts->tv_nsec = -1; | 996 | ts->tv_nsec = -1; |
| 995 | } | 997 | } |
| 996 | static inline int ipmi_si_is_busy(struct timespec *ts) | 998 | static inline int ipmi_si_is_busy(struct timespec64 *ts) |
| 997 | { | 999 | { |
| 998 | return ts->tv_nsec != -1; | 1000 | return ts->tv_nsec != -1; |
| 999 | } | 1001 | } |
| 1000 | 1002 | ||
| 1001 | static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result, | 1003 | static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result, |
| 1002 | const struct smi_info *smi_info, | 1004 | const struct smi_info *smi_info, |
| 1003 | struct timespec *busy_until) | 1005 | struct timespec64 *busy_until) |
| 1004 | { | 1006 | { |
| 1005 | unsigned int max_busy_us = 0; | 1007 | unsigned int max_busy_us = 0; |
| 1006 | 1008 | ||
| @@ -1009,12 +1011,13 @@ static inline int ipmi_thread_busy_wait(enum si_sm_result smi_result, | |||
| 1009 | if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY) | 1011 | if (max_busy_us == 0 || smi_result != SI_SM_CALL_WITH_DELAY) |
| 1010 | ipmi_si_set_not_busy(busy_until); | 1012 | ipmi_si_set_not_busy(busy_until); |
| 1011 | else if (!ipmi_si_is_busy(busy_until)) { | 1013 | else if (!ipmi_si_is_busy(busy_until)) { |
| 1012 | getnstimeofday(busy_until); | 1014 | getnstimeofday64(busy_until); |
| 1013 | timespec_add_ns(busy_until, max_busy_us*NSEC_PER_USEC); | 1015 | timespec64_add_ns(busy_until, max_busy_us*NSEC_PER_USEC); |
| 1014 | } else { | 1016 | } else { |
| 1015 | struct timespec now; | 1017 | struct timespec64 now; |
| 1016 | getnstimeofday(&now); | 1018 | |
| 1017 | if (unlikely(timespec_compare(&now, busy_until) > 0)) { | 1019 | getnstimeofday64(&now); |
| 1020 | if (unlikely(timespec64_compare(&now, busy_until) > 0)) { | ||
| 1018 | ipmi_si_set_not_busy(busy_until); | 1021 | ipmi_si_set_not_busy(busy_until); |
| 1019 | return 0; | 1022 | return 0; |
| 1020 | } | 1023 | } |
| @@ -1037,7 +1040,7 @@ static int ipmi_thread(void *data) | |||
| 1037 | struct smi_info *smi_info = data; | 1040 | struct smi_info *smi_info = data; |
| 1038 | unsigned long flags; | 1041 | unsigned long flags; |
| 1039 | enum si_sm_result smi_result; | 1042 | enum si_sm_result smi_result; |
| 1040 | struct timespec busy_until; | 1043 | struct timespec64 busy_until; |
| 1041 | 1044 | ||
| 1042 | ipmi_si_set_not_busy(&busy_until); | 1045 | ipmi_si_set_not_busy(&busy_until); |
| 1043 | set_user_nice(current, MAX_NICE); | 1046 | set_user_nice(current, MAX_NICE); |
| @@ -1128,15 +1131,10 @@ static void smi_timeout(unsigned long data) | |||
| 1128 | unsigned long jiffies_now; | 1131 | unsigned long jiffies_now; |
| 1129 | long time_diff; | 1132 | long time_diff; |
| 1130 | long timeout; | 1133 | long timeout; |
| 1131 | #ifdef DEBUG_TIMING | ||
| 1132 | struct timeval t; | ||
| 1133 | #endif | ||
| 1134 | 1134 | ||
| 1135 | spin_lock_irqsave(&(smi_info->si_lock), flags); | 1135 | spin_lock_irqsave(&(smi_info->si_lock), flags); |
| 1136 | #ifdef DEBUG_TIMING | 1136 | debug_timestamp("Timer"); |
| 1137 | do_gettimeofday(&t); | 1137 | |
| 1138 | printk(KERN_DEBUG "**Timer: %d.%9.9d\n", t.tv_sec, t.tv_usec); | ||
| 1139 | #endif | ||
| 1140 | jiffies_now = jiffies; | 1138 | jiffies_now = jiffies; |
| 1141 | time_diff = (((long)jiffies_now - (long)smi_info->last_timeout_jiffies) | 1139 | time_diff = (((long)jiffies_now - (long)smi_info->last_timeout_jiffies) |
| 1142 | * SI_USEC_PER_JIFFY); | 1140 | * SI_USEC_PER_JIFFY); |
| @@ -1173,18 +1171,13 @@ static irqreturn_t si_irq_handler(int irq, void *data) | |||
| 1173 | { | 1171 | { |
| 1174 | struct smi_info *smi_info = data; | 1172 | struct smi_info *smi_info = data; |
| 1175 | unsigned long flags; | 1173 | unsigned long flags; |
| 1176 | #ifdef DEBUG_TIMING | ||
| 1177 | struct timeval t; | ||
| 1178 | #endif | ||
| 1179 | 1174 | ||
| 1180 | spin_lock_irqsave(&(smi_info->si_lock), flags); | 1175 | spin_lock_irqsave(&(smi_info->si_lock), flags); |
| 1181 | 1176 | ||
| 1182 | smi_inc_stat(smi_info, interrupts); | 1177 | smi_inc_stat(smi_info, interrupts); |
| 1183 | 1178 | ||
| 1184 | #ifdef DEBUG_TIMING | 1179 | debug_timestamp("Interrupt"); |
| 1185 | do_gettimeofday(&t); | 1180 | |
| 1186 | printk(KERN_DEBUG "**Interrupt: %d.%9.9d\n", t.tv_sec, t.tv_usec); | ||
| 1187 | #endif | ||
| 1188 | smi_event_handler(smi_info, 0); | 1181 | smi_event_handler(smi_info, 0); |
| 1189 | spin_unlock_irqrestore(&(smi_info->si_lock), flags); | 1182 | spin_unlock_irqrestore(&(smi_info->si_lock), flags); |
| 1190 | return IRQ_HANDLED; | 1183 | return IRQ_HANDLED; |
| @@ -2038,18 +2031,13 @@ static u32 ipmi_acpi_gpe(acpi_handle gpe_device, | |||
| 2038 | { | 2031 | { |
| 2039 | struct smi_info *smi_info = context; | 2032 | struct smi_info *smi_info = context; |
| 2040 | unsigned long flags; | 2033 | unsigned long flags; |
| 2041 | #ifdef DEBUG_TIMING | ||
| 2042 | struct timeval t; | ||
| 2043 | #endif | ||
| 2044 | 2034 | ||
| 2045 | spin_lock_irqsave(&(smi_info->si_lock), flags); | 2035 | spin_lock_irqsave(&(smi_info->si_lock), flags); |
| 2046 | 2036 | ||
| 2047 | smi_inc_stat(smi_info, interrupts); | 2037 | smi_inc_stat(smi_info, interrupts); |
| 2048 | 2038 | ||
| 2049 | #ifdef DEBUG_TIMING | 2039 | debug_timestamp("ACPI_GPE"); |
| 2050 | do_gettimeofday(&t); | 2040 | |
| 2051 | printk("**ACPI_GPE: %d.%9.9d\n", t.tv_sec, t.tv_usec); | ||
| 2052 | #endif | ||
| 2053 | smi_event_handler(smi_info, 0); | 2041 | smi_event_handler(smi_info, 0); |
| 2054 | spin_unlock_irqrestore(&(smi_info->si_lock), flags); | 2042 | spin_unlock_irqrestore(&(smi_info->si_lock), flags); |
| 2055 | 2043 | ||
| @@ -2071,7 +2059,6 @@ static int acpi_gpe_irq_setup(struct smi_info *info) | |||
| 2071 | if (!info->irq) | 2059 | if (!info->irq) |
| 2072 | return 0; | 2060 | return 0; |
| 2073 | 2061 | ||
| 2074 | /* FIXME - is level triggered right? */ | ||
| 2075 | status = acpi_install_gpe_handler(NULL, | 2062 | status = acpi_install_gpe_handler(NULL, |
| 2076 | info->irq, | 2063 | info->irq, |
| 2077 | ACPI_GPE_LEVEL_TRIGGERED, | 2064 | ACPI_GPE_LEVEL_TRIGGERED, |
| @@ -2998,7 +2985,9 @@ static int smi_type_proc_show(struct seq_file *m, void *v) | |||
| 2998 | { | 2985 | { |
| 2999 | struct smi_info *smi = m->private; | 2986 | struct smi_info *smi = m->private; |
| 3000 | 2987 | ||
| 3001 | return seq_printf(m, "%s\n", si_to_str[smi->si_type]); | 2988 | seq_printf(m, "%s\n", si_to_str[smi->si_type]); |
| 2989 | |||
| 2990 | return seq_has_overflowed(m); | ||
| 3002 | } | 2991 | } |
| 3003 | 2992 | ||
| 3004 | static int smi_type_proc_open(struct inode *inode, struct file *file) | 2993 | static int smi_type_proc_open(struct inode *inode, struct file *file) |
| @@ -3060,16 +3049,18 @@ static int smi_params_proc_show(struct seq_file *m, void *v) | |||
| 3060 | { | 3049 | { |
| 3061 | struct smi_info *smi = m->private; | 3050 | struct smi_info *smi = m->private; |
| 3062 | 3051 | ||
| 3063 | return seq_printf(m, | 3052 | seq_printf(m, |
| 3064 | "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n", | 3053 | "%s,%s,0x%lx,rsp=%d,rsi=%d,rsh=%d,irq=%d,ipmb=%d\n", |
| 3065 | si_to_str[smi->si_type], | 3054 | si_to_str[smi->si_type], |
| 3066 | addr_space_to_str[smi->io.addr_type], | 3055 | addr_space_to_str[smi->io.addr_type], |
| 3067 | smi->io.addr_data, | 3056 | smi->io.addr_data, |
| 3068 | smi->io.regspacing, | 3057 | smi->io.regspacing, |
| 3069 | smi->io.regsize, | 3058 | smi->io.regsize, |
| 3070 | smi->io.regshift, | 3059 | smi->io.regshift, |
| 3071 | smi->irq, | 3060 | smi->irq, |
| 3072 | smi->slave_addr); | 3061 | smi->slave_addr); |
| 3062 | |||
| 3063 | return seq_has_overflowed(m); | ||
| 3073 | } | 3064 | } |
| 3074 | 3065 | ||
| 3075 | static int smi_params_proc_open(struct inode *inode, struct file *file) | 3066 | static int smi_params_proc_open(struct inode *inode, struct file *file) |
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 982b96323f82..f6e378dac5f5 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c | |||
| @@ -1097,8 +1097,6 @@ static int ssif_remove(struct i2c_client *client) | |||
| 1097 | if (!ssif_info) | 1097 | if (!ssif_info) |
| 1098 | return 0; | 1098 | return 0; |
| 1099 | 1099 | ||
| 1100 | i2c_set_clientdata(client, NULL); | ||
| 1101 | |||
| 1102 | /* | 1100 | /* |
| 1103 | * After this point, we won't deliver anything asychronously | 1101 | * After this point, we won't deliver anything asychronously |
| 1104 | * to the message handler. We can unregister ourself. | 1102 | * to the message handler. We can unregister ourself. |
| @@ -1198,7 +1196,9 @@ static int ssif_detect(struct i2c_client *client, struct i2c_board_info *info) | |||
| 1198 | 1196 | ||
| 1199 | static int smi_type_proc_show(struct seq_file *m, void *v) | 1197 | static int smi_type_proc_show(struct seq_file *m, void *v) |
| 1200 | { | 1198 | { |
| 1201 | return seq_puts(m, "ssif\n"); | 1199 | seq_puts(m, "ssif\n"); |
| 1200 | |||
| 1201 | return seq_has_overflowed(m); | ||
| 1202 | } | 1202 | } |
| 1203 | 1203 | ||
| 1204 | static int smi_type_proc_open(struct inode *inode, struct file *file) | 1204 | static int smi_type_proc_open(struct inode *inode, struct file *file) |
