Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75251
b: refs/heads/master
c: 90b2628
h: refs/heads/master
i:
  75249: 880274a
  75247: 3cb6806
v: v3
  • Loading branch information
Ingo Molnar committed Dec 30, 2007
1 parent 56a7c6a commit 25deb1a
Show file tree
Hide file tree
Showing 37 changed files with 153 additions and 312 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c5d63d8f013f232fc6e353d9151b35ec7282d52
refs/heads/master: 90b2628f1fe94a667330d425a7fb76ec8d2a49ec
9 changes: 9 additions & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ void do_notify_spus_active(void)
mutex_unlock(&cbe_spu_info[node].list_mutex);
}
}
EXPORT_SYMBOL_GPL(do_notify_spus_active);

#ifndef MODULE
void notify_spus_active(void)
{
do_notify_spus_active();
}
EXPORT_SYMBOL_GPL(notify_spus_active);
#endif

/**
* spu_bind_context - bind spu context to physical spu
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ default_entry:
/* Do an early initialization of the fixmap area */
movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
addl $0x67, %eax /* 0x67 == _PAGE_TABLE */
addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
movl %eax, 4092(%edx)

xorl %ebx,%ebx /* This is the boot CPU (BSP) */
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/leds/led-class.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
goto err_out;

/* add to the list of leds */
down_write(&leds_list_lock);
write_lock(&leds_list_lock);
list_add_tail(&led_cdev->node, &leds_list);
up_write(&leds_list_lock);
write_unlock(&leds_list_lock);

#ifdef CONFIG_LEDS_TRIGGERS
init_rwsem(&led_cdev->trigger_lock);
Expand Down Expand Up @@ -155,9 +155,9 @@ void led_classdev_unregister(struct led_classdev *led_cdev)

device_unregister(led_cdev->dev);

down_write(&leds_list_lock);
write_lock(&leds_list_lock);
list_del(&led_cdev->node);
up_write(&leds_list_lock);
write_unlock(&leds_list_lock);
}
EXPORT_SYMBOL_GPL(led_classdev_unregister);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/leds/led-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/rwsem.h>
#include <linux/spinlock.h>
#include <linux/leds.h>
#include "leds.h"

DECLARE_RWSEM(leds_list_lock);
DEFINE_RWLOCK(leds_list_lock);
LIST_HEAD(leds_list);

EXPORT_SYMBOL_GPL(leds_list);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/leds/led-triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ int led_trigger_register(struct led_trigger *trigger)
up_write(&triggers_list_lock);

/* Register with any LEDs that have this as a default trigger */
down_read(&leds_list_lock);
read_lock(&leds_list_lock);
list_for_each_entry(led_cdev, &leds_list, node) {
down_write(&led_cdev->trigger_lock);
if (!led_cdev->trigger && led_cdev->default_trigger &&
!strcmp(led_cdev->default_trigger, trigger->name))
led_trigger_set(led_cdev, trigger);
up_write(&led_cdev->trigger_lock);
}
up_read(&leds_list_lock);
read_unlock(&leds_list_lock);

return 0;
}
Expand Down Expand Up @@ -212,14 +212,14 @@ void led_trigger_unregister(struct led_trigger *trigger)
up_write(&triggers_list_lock);

/* Remove anyone actively using this trigger */
down_read(&leds_list_lock);
read_lock(&leds_list_lock);
list_for_each_entry(led_cdev, &leds_list, node) {
down_write(&led_cdev->trigger_lock);
if (led_cdev->trigger == trigger)
led_trigger_set(led_cdev, NULL);
up_write(&led_cdev->trigger_lock);
}
up_read(&leds_list_lock);
read_unlock(&leds_list_lock);
}

void led_trigger_unregister_simple(struct led_trigger *trigger)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/leds/leds-locomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
static void locomoled_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value, int offset)
{
struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->dev->parent);
struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->dev);
unsigned long flags;

local_irq_save(flags);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/leds/leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#define __LEDS_H_INCLUDED

#include <linux/device.h>
#include <linux/rwsem.h>
#include <linux/leds.h>

static inline void led_set_brightness(struct led_classdev *led_cdev,
Expand All @@ -27,7 +26,7 @@ static inline void led_set_brightness(struct led_classdev *led_cdev,
led_cdev->brightness_set(led_cdev, value);
}

extern struct rw_semaphore leds_list_lock;
extern rwlock_t leds_list_lock;
extern struct list_head leds_list;

#ifdef CONFIG_LEDS_TRIGGERS
Expand Down
20 changes: 17 additions & 3 deletions trunk/drivers/scsi/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_tcq.h>
Expand Down Expand Up @@ -367,9 +368,8 @@ void scsi_log_send(struct scsi_cmnd *cmd)
scsi_print_command(cmd);
if (level > 3) {
printk(KERN_INFO "buffer = 0x%p, bufflen = %d,"
" done = 0x%p, queuecommand 0x%p\n",
" queuecommand 0x%p\n",
scsi_sglist(cmd), scsi_bufflen(cmd),
cmd->done,
cmd->device->host->hostt->queuecommand);

}
Expand Down Expand Up @@ -654,6 +654,12 @@ void __scsi_done(struct scsi_cmnd *cmd)
blk_complete_request(rq);
}

/* Move this to a header if it becomes more generally useful */
static struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
{
return *(struct scsi_driver **)cmd->request->rq_disk->private_data;
}

/*
* Function: scsi_finish_command
*
Expand All @@ -665,6 +671,8 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
{
struct scsi_device *sdev = cmd->device;
struct Scsi_Host *shost = sdev->host;
struct scsi_driver *drv;
unsigned int good_bytes;

scsi_device_unbusy(sdev);

Expand All @@ -690,7 +698,13 @@ void scsi_finish_command(struct scsi_cmnd *cmd)
"Notifying upper driver of completion "
"(result %x)\n", cmd->result));

cmd->done(cmd);
good_bytes = cmd->request_bufflen;
if (cmd->request->cmd_type != REQ_TYPE_BLOCK_PC) {
drv = scsi_cmd_to_driver(cmd);
if (drv->done)
good_bytes = drv->done(cmd);
}
scsi_io_completion(cmd, good_bytes);
}
EXPORT_SYMBOL(scsi_finish_command);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1699,7 +1699,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd));

scmd->scsi_done = scsi_reset_provider_done_command;
scmd->done = NULL;
scmd->request_buffer = NULL;
scmd->request_bufflen = 0;

Expand Down
16 changes: 1 addition & 15 deletions trunk/drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,6 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
}
scsi_end_request(cmd, 0, this_count, !result);
}
EXPORT_SYMBOL(scsi_io_completion);

/*
* Function: scsi_init_io()
Expand Down Expand Up @@ -1171,18 +1170,6 @@ static struct scsi_cmnd *scsi_get_cmd_from_req(struct scsi_device *sdev,
return cmd;
}

static void scsi_blk_pc_done(struct scsi_cmnd *cmd)
{
BUG_ON(!blk_pc_request(cmd->request));
/*
* This will complete the whole command with uptodate=1 so
* as far as the block layer is concerned the command completed
* successfully. Since this is a REQ_BLOCK_PC command the
* caller should check the request's errors value
*/
scsi_io_completion(cmd, cmd->request_bufflen);
}

int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
{
struct scsi_cmnd *cmd;
Expand Down Expand Up @@ -1232,7 +1219,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
cmd->transfersize = req->data_len;
cmd->allowed = req->retries;
cmd->timeout_per_command = req->timeout;
cmd->done = scsi_blk_pc_done;
return BLKPREP_OK;
}
EXPORT_SYMBOL(scsi_setup_blk_pc_cmnd);
Expand Down Expand Up @@ -1346,7 +1332,7 @@ int scsi_prep_return(struct request_queue *q, struct request *req, int ret)
}
EXPORT_SYMBOL(scsi_prep_return);

int scsi_prep_fn(struct request_queue *q, struct request *req)
static int scsi_prep_fn(struct request_queue *q, struct request *req)
{
struct scsi_device *sdev = q->queuedata;
int ret = BLKPREP_KILL;
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/scsi/scsi_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ extern int scsi_maybe_unblock_host(struct scsi_device *sdev);
extern void scsi_device_unbusy(struct scsi_device *sdev);
extern int scsi_queue_insert(struct scsi_cmnd *cmd, int reason);
extern void scsi_next_command(struct scsi_cmnd *cmd);
extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
extern void scsi_run_host_queues(struct Scsi_Host *shost);
extern struct request_queue *scsi_alloc_queue(struct scsi_device *sdev);
extern void scsi_free_queue(struct request_queue *q);
extern int scsi_init_queue(void);
extern void scsi_exit_queue(void);
struct request_queue;
struct request;
extern int scsi_prep_fn(struct request_queue *, struct request *);

/* scsi_proc.c */
#ifdef CONFIG_SCSI_PROC_FS
Expand Down
17 changes: 0 additions & 17 deletions trunk/drivers/scsi/scsi_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,29 +373,12 @@ static int scsi_bus_resume(struct device * dev)
return err;
}

static int scsi_bus_remove(struct device *dev)
{
struct device_driver *drv = dev->driver;
struct scsi_device *sdev = to_scsi_device(dev);
int err = 0;

/* reset the prep_fn back to the default since the
* driver may have altered it and it's being removed */
blk_queue_prep_rq(sdev->request_queue, scsi_prep_fn);

if (drv && drv->remove)
err = drv->remove(dev);

return 0;
}

struct bus_type scsi_bus_type = {
.name = "scsi",
.match = scsi_bus_match,
.uevent = scsi_bus_uevent,
.suspend = scsi_bus_suspend,
.resume = scsi_bus_resume,
.remove = scsi_bus_remove,
};

int scsi_sysfs_register(void)
Expand Down
28 changes: 18 additions & 10 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK);
MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD);
MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC);

static int sd_revalidate_disk(struct gendisk *);
static int sd_probe(struct device *);
static int sd_remove(struct device *);
static void sd_shutdown(struct device *);
static int sd_suspend(struct device *, pm_message_t state);
static int sd_resume(struct device *);
static void sd_rescan(struct device *);
static int sd_done(struct scsi_cmnd *);
static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer);
static void scsi_disk_release(struct class_device *cdev);
static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
static void sd_print_result(struct scsi_disk *, int);

static DEFINE_IDR(sd_index_idr);
static DEFINE_SPINLOCK(sd_index_lock);

Expand Down Expand Up @@ -240,6 +253,7 @@ static struct scsi_driver sd_template = {
.shutdown = sd_shutdown,
},
.rescan = sd_rescan,
.done = sd_done,
};

/*
Expand Down Expand Up @@ -508,12 +522,6 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq)
SCpnt->allowed = SD_MAX_RETRIES;
SCpnt->timeout_per_command = timeout;

/*
* This is the completion routine we use. This is matched in terms
* of capability to this function.
*/
SCpnt->done = sd_rw_intr;

/*
* This indicates that the command is ready from our end to be
* queued.
Expand Down Expand Up @@ -887,13 +895,13 @@ static struct block_device_operations sd_fops = {
};

/**
* sd_rw_intr - bottom half handler: called when the lower level
* sd_done - bottom half handler: called when the lower level
* driver has completed (successfully or otherwise) a scsi command.
* @SCpnt: mid-level's per command structure.
*
* Note: potentially run from within an ISR. Must not block.
**/
static void sd_rw_intr(struct scsi_cmnd * SCpnt)
static int sd_done(struct scsi_cmnd *SCpnt)
{
int result = SCpnt->result;
unsigned int xfer_size = SCpnt->request_bufflen;
Expand All @@ -914,7 +922,7 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
SCSI_LOG_HLCOMPLETE(1, scsi_print_result(SCpnt));
if (sense_valid) {
SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt,
"sd_rw_intr: sb[respc,sk,asc,"
"sd_done: sb[respc,sk,asc,"
"ascq]=%x,%x,%x,%x\n",
sshdr.response_code,
sshdr.sense_key, sshdr.asc,
Expand Down Expand Up @@ -986,7 +994,7 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
break;
}
out:
scsi_io_completion(SCpnt, good_bytes);
return good_bytes;
}

static int media_not_present(struct scsi_disk *sdkp,
Expand Down
Loading

0 comments on commit 25deb1a

Please sign in to comment.