From 714c48f1bb553a2e5dd8d6ff66accc7c51218ac9 Mon Sep 17 00:00:00 2001 From: Dean Nelson Date: Tue, 3 Feb 2009 15:16:17 -0800 Subject: sgi-xp: link XPNET's net_device_ops to its net_device structure A recent patch by Stephen Hemminger to convert XPNET to use net_device_ops and internal net_device_stats failed to link the net_device_ops structure to the net_device structure. See commit e8ac9c55f28482f5b2f497a8e7eb90985db237c2 ("xpnet: convert devices to new API"). Signed-off-by: Dean Nelson Signed-off-by: David S. Miller --- drivers/misc/sgi-xp/xpnet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/misc') diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c index 7957f52..6faefcf 100644 --- a/drivers/misc/sgi-xp/xpnet.c +++ b/drivers/misc/sgi-xp/xpnet.c @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (C) 1999-2008 Silicon Graphics, Inc. All rights reserved. + * Copyright (C) 1999-2009 Silicon Graphics, Inc. All rights reserved. */ /* @@ -551,6 +551,7 @@ xpnet_init(void) netif_carrier_off(xpnet_device); + xpnet_device->netdev_ops = &xpnet_netdev_ops; xpnet_device->mtu = XPNET_DEF_MTU; /* -- cgit v1.1 From c073b2db006ba9370be1eecc36a1be1d9ce31310 Mon Sep 17 00:00:00 2001 From: David Altobelli Date: Wed, 4 Feb 2009 15:11:58 -0800 Subject: hpilo: open/close fix The device can take a while to respond to an open/close request, so increase the time kernel will wait for response (1 ms to 10ms). Also, properly clean up a channel on a failed open, by calling the channel close routine. Just freeing the memory isn't sufficient, the device needs to be informed that the channel is no longer open, and the device memory cleared of references to freed dma buffer. Signed-off-by: David Altobelli Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/misc/hpilo.c | 6 +++--- drivers/misc/hpilo.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index 10c421b..f26667a 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c @@ -207,7 +207,7 @@ static void ilo_ccb_close(struct pci_dev *pdev, struct ccb_data *data) &device_ccb->recv_ctrl); /* give iLO some time to process stop request */ - for (retries = 1000; retries > 0; retries--) { + for (retries = MAX_WAIT; retries > 0; retries--) { doorbell_set(driver_ccb); udelay(1); if (!(ioread32(&device_ccb->send_ctrl) & (1 << CTRL_BITPOS_A)) @@ -309,7 +309,7 @@ static int ilo_ccb_open(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) doorbell_clr(driver_ccb); /* make sure iLO is really handling requests */ - for (i = 1000; i > 0; i--) { + for (i = MAX_WAIT; i > 0; i--) { if (ilo_pkt_dequeue(hw, driver_ccb, SENDQ, &pkt_id, NULL, NULL)) break; udelay(1); @@ -326,7 +326,7 @@ static int ilo_ccb_open(struct ilo_hwinfo *hw, struct ccb_data *data, int slot) return 0; free: - pci_free_consistent(pdev, data->dma_size, data->dma_va, data->dma_pa); + ilo_ccb_close(pdev, data); out: return error; } diff --git a/drivers/misc/hpilo.h b/drivers/misc/hpilo.h index a281207..b64a20e 100644 --- a/drivers/misc/hpilo.h +++ b/drivers/misc/hpilo.h @@ -19,6 +19,8 @@ #define MAX_ILO_DEV 1 /* max number of files */ #define MAX_OPEN (MAX_CCB * MAX_ILO_DEV) +/* spin counter for open/close delay */ +#define MAX_WAIT 10000 /* * Per device, used to track global memory allocations. -- cgit v1.1 From 77a592655cdb8d838b85fd7ecf8f36fd2870abfc Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 4 Feb 2009 15:12:00 -0800 Subject: misc: dell-laptop should depend on POWER_SUPPLY dell-laptop makes use of the power supply class information to choose which backlight interface to change. Add a depends on it. Signed-off-by: Matthew Garrett Cc: Ingo Molnar Cc: "Rafael J. Wysocki" Cc: Len Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/misc/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/misc') diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 5607319..c64e679 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -217,6 +217,7 @@ config DELL_LAPTOP depends on EXPERIMENTAL depends on BACKLIGHT_CLASS_DEVICE depends on RFKILL + depends on POWER_SUPPLY default n ---help--- This driver adds support for rfkill and backlight control to Dell -- cgit v1.1 From dfecb7164eb81fbfae93fee1ad1da2ac58bb224d Mon Sep 17 00:00:00 2001 From: Hans-Christian Egtvedt Date: Wed, 4 Feb 2009 15:12:17 -0800 Subject: atmel-ssc: fix misuse of dev_dbg when requested ssc instance is not found The ssc pointer is not valid when the id is not found in the list. Convert the message from a debug one into an error message and avoid dereferencing the bad pointer. Signed-off-by: Hans-Christian Egtvedt Cc: Kay Sievers Cc: Huang Weiyi Acked-by: Haavard Skinnemoen Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/misc/atmel-ssc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc') diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index bf5e4d0..558bf3f 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -35,7 +35,7 @@ struct ssc_device *ssc_request(unsigned int ssc_num) if (!ssc_valid) { spin_unlock(&user_lock); - dev_dbg(&ssc->pdev->dev, "could not find requested device\n"); + pr_err("ssc: ssc%d platform device is missing\n", ssc_num); return ERR_PTR(-ENODEV); } -- cgit v1.1 From 361916a943cd9dbda1c0b00879d0225cc919d868 Mon Sep 17 00:00:00 2001 From: Dean Nelson Date: Wed, 4 Feb 2009 15:12:24 -0800 Subject: sgi-xp: fix writing past the end of kzalloc()'d space A missing type cast results in writing way beyond the end of a kzalloc()'d memory segment resulting in slab corruption. But it seems like the better solution is to define ->recv_msg_slots as a 'void *' rather than a 'struct xpc_notify_mq_msg_uv *' and add the type cast. Signed-off-by: Dean Nelson Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/misc/sgi-xp/xpc.h | 5 +++-- drivers/misc/sgi-xp/xpc_uv.c | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/misc') diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h index a5bd658..275b788 100644 --- a/drivers/misc/sgi-xp/xpc.h +++ b/drivers/misc/sgi-xp/xpc.h @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2004-2008 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2004-2009 Silicon Graphics, Inc. All Rights Reserved. */ /* @@ -514,7 +514,8 @@ struct xpc_channel_uv { /* partition's notify mq */ struct xpc_send_msg_slot_uv *send_msg_slots; - struct xpc_notify_mq_msg_uv *recv_msg_slots; + void *recv_msg_slots; /* each slot will hold a xpc_notify_mq_msg_uv */ + /* structure plus the user's payload */ struct xpc_fifo_head_uv msg_slot_free_list; struct xpc_fifo_head_uv recv_msg_list; /* deliverable payloads */ diff --git a/drivers/misc/sgi-xp/xpc_uv.c b/drivers/misc/sgi-xp/xpc_uv.c index f17f7d4..29c0502 100644 --- a/drivers/misc/sgi-xp/xpc_uv.c +++ b/drivers/misc/sgi-xp/xpc_uv.c @@ -3,7 +3,7 @@ * License. See the file "COPYING" in the main directory of this archive * for more details. * - * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. + * Copyright (c) 2008-2009 Silicon Graphics, Inc. All Rights Reserved. */ /* @@ -1010,8 +1010,8 @@ xpc_allocate_recv_msg_slot_uv(struct xpc_channel *ch) continue; for (entry = 0; entry < nentries; entry++) { - msg_slot = ch_uv->recv_msg_slots + entry * - ch->entry_size; + msg_slot = ch_uv->recv_msg_slots + + entry * ch->entry_size; msg_slot->hdr.msg_slot_number = entry; } @@ -1308,9 +1308,8 @@ xpc_handle_notify_mq_msg_uv(struct xpc_partition *part, /* we're dealing with a normal message sent via the notify_mq */ ch_uv = &ch->sn.uv; - msg_slot = (struct xpc_notify_mq_msg_uv *)((u64)ch_uv->recv_msg_slots + - (msg->hdr.msg_slot_number % ch->remote_nentries) * - ch->entry_size); + msg_slot = ch_uv->recv_msg_slots + + (msg->hdr.msg_slot_number % ch->remote_nentries) * ch->entry_size; BUG_ON(msg->hdr.msg_slot_number != msg_slot->hdr.msg_slot_number); BUG_ON(msg_slot->hdr.size != 0); -- cgit v1.1