Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87128
b: refs/heads/master
c: aeb24d2
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Mar 11, 2008
1 parent 3e3af08 commit ff41a8b
Show file tree
Hide file tree
Showing 52 changed files with 2,492 additions and 735 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: 1ef36fa64e65079de18ff5179a51af58e44d49a6
refs/heads/master: aeb24d2fb08653a39abb50281b1ffa2d2a6879ab
4 changes: 2 additions & 2 deletions trunk/Documentation/pci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ initialization with a pointer to a structure describing the driver


The ID table is an array of struct pci_device_id entries ending with an
all-zero entry; use of the macro DECLARE_PCI_DEVICE_TABLE is the preferred
all-zero entry; use of the macro DEFINE_PCI_DEVICE_TABLE is the preferred
method of declaring the table. Each entry consists of:

vendor,device Vendor and device ID to match (or PCI_ANY_ID)
Expand Down Expand Up @@ -193,7 +193,7 @@ Tips on when/where to use the above attributes:
o Do not mark the struct pci_driver.

o The ID table array should be marked __devinitconst; this is done
automatically if the table is declared with DECLARE_PCI_DEVICE_TABLE().
automatically if the table is declared with DEFINE_PCI_DEVICE_TABLE().

o The probe() and remove() functions should be marked __devinit
and __devexit respectively. All initialization functions
Expand Down
2 changes: 1 addition & 1 deletion trunk/Documentation/scheduler/sched-stats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ of idleness (idle, busy, and newly idle):

/proc/<pid>/schedstat
----------------
schedstats also adds a new /proc/<pid/schedstat file to include some of
schedstats also adds a new /proc/<pid>/schedstat file to include some of
the same information on a per-process level. There are three fields in
this file correlating for that process to:
1) time spent on the cpu
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/char/riscom8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1620,14 +1620,8 @@ static int __init rc_init_drivers(void)

static void rc_release_drivers(void)
{
unsigned long flags;

spin_lock_irqsave(&riscom_lock, flags);

tty_unregister_driver(riscom_driver);
put_tty_driver(riscom_driver);

spin_unlock_irqrestore(&riscom_lock, flags);
}

#ifndef MODULE
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpio/pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
gc->direction_output = pca953x_gpio_direction_output;
gc->get = pca953x_gpio_get_value;
gc->set = pca953x_gpio_set_value;
gc->can_sleep = 1;

gc->base = chip->gpio_start;
gc->ngpio = gpios;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/serio/i8042.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#if defined(CONFIG_MACH_JAZZ)
#include "i8042-jazzio.h"
#elif defined(CONFIG_SGI_IP22)
#elif defined(CONFIG_SGI_HAS_I8042)
#include "i8042-ip22io.h"
#elif defined(CONFIG_PPC)
#include "i8042-ppcio.h"
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,8 @@ void bitmap_daemon_work(struct bitmap *bitmap)
if (bitmap == NULL)
return;
if (time_before(jiffies, bitmap->daemon_lastrun + bitmap->daemon_sleep*HZ))
return;
goto done;

bitmap->daemon_lastrun = jiffies;
if (bitmap->allclean) {
bitmap->mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;
Expand Down Expand Up @@ -1142,6 +1143,7 @@ void bitmap_daemon_work(struct bitmap *bitmap)
}
}

done:
if (bitmap->allclean == 0)
bitmap->mddev->thread->timeout = bitmap->daemon_sleep * HZ;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -5149,7 +5149,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
if (mddev->ro==1)
seq_printf(seq, " (read-only)");
if (mddev->ro==2)
seq_printf(seq, "(auto-read-only)");
seq_printf(seq, " (auto-read-only)");
seq_printf(seq, " %s", mddev->pers->name);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/memstick/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ menuconfig MEMSTICK
Sony MemoryStick is a proprietary storage/extension card protocol.

If you want MemoryStick support, you should say Y here and also
to the specific driver for your MMC interface.
to the specific driver for your MemoryStick interface.

if MEMSTICK

Expand Down
33 changes: 28 additions & 5 deletions trunk/drivers/memstick/core/memstick.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <linux/delay.h>

#define DRIVER_NAME "memstick"
#define DRIVER_VERSION "0.2"

static unsigned int cmd_retries = 3;
module_param(cmd_retries, uint, 0644);
Expand Down Expand Up @@ -236,7 +235,7 @@ int memstick_next_req(struct memstick_host *host, struct memstick_request **mrq)
rc = host->card->next_request(host->card, mrq);

if (!rc)
host->retries = cmd_retries;
host->retries = cmd_retries > 1 ? cmd_retries - 1 : 1;
else
*mrq = NULL;

Expand Down Expand Up @@ -271,7 +270,7 @@ void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc,
mrq->data_dir = READ;

mrq->sg = *sg;
mrq->io_type = MEMSTICK_IO_SG;
mrq->long_data = 1;

if (tpc == MS_TPC_SET_CMD || tpc == MS_TPC_EX_SET_CMD)
mrq->need_card_int = 1;
Expand Down Expand Up @@ -306,7 +305,7 @@ void memstick_init_req(struct memstick_request *mrq, unsigned char tpc,
if (mrq->data_dir == WRITE)
memcpy(mrq->data, buf, mrq->data_len);

mrq->io_type = MEMSTICK_IO_VAL;
mrq->long_data = 0;

if (tpc == MS_TPC_SET_CMD || tpc == MS_TPC_EX_SET_CMD)
mrq->need_card_int = 1;
Expand Down Expand Up @@ -561,6 +560,31 @@ void memstick_free_host(struct memstick_host *host)
}
EXPORT_SYMBOL(memstick_free_host);

/**
* memstick_suspend_host - notify bus driver of host suspension
* @host - host to use
*/
void memstick_suspend_host(struct memstick_host *host)
{
mutex_lock(&host->lock);
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
mutex_unlock(&host->lock);
}
EXPORT_SYMBOL(memstick_suspend_host);

/**
* memstick_resume_host - notify bus driver of host resumption
* @host - host to use
*/
void memstick_resume_host(struct memstick_host *host)
{
mutex_lock(&host->lock);
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON);
mutex_unlock(&host->lock);
memstick_detect_change(host);
}
EXPORT_SYMBOL(memstick_resume_host);

int memstick_register_driver(struct memstick_driver *drv)
{
drv->driver.bus = &memstick_bus_type;
Expand Down Expand Up @@ -611,4 +635,3 @@ module_exit(memstick_exit);
MODULE_AUTHOR("Alex Dubov");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Sony MemoryStick core driver");
MODULE_VERSION(DRIVER_VERSION);
106 changes: 92 additions & 14 deletions trunk/drivers/memstick/core/mspro_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#include <linux/idr.h>
#include <linux/hdreg.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/memstick.h>

#define DRIVER_NAME "mspro_block"
#define DRIVER_VERSION "0.2"

static int major;
module_param(major, int, 0644);
Expand Down Expand Up @@ -110,6 +110,17 @@ struct mspro_mbr {
unsigned int sectors_per_partition;
} __attribute__((packed));

struct mspro_specfile {
char name[8];
char ext[3];
unsigned char attr;
unsigned char reserved[10];
unsigned short time;
unsigned short date;
unsigned short cluster;
unsigned int size;
} __attribute__((packed));

struct mspro_devinfo {
unsigned short cylinders;
unsigned short heads;
Expand Down Expand Up @@ -293,6 +304,20 @@ static ssize_t mspro_block_attr_show_sysinfo(struct device *dev,
dev_attr);
struct mspro_sys_info *x_sys = x_attr->data;
ssize_t rc = 0;
int date_tz = 0, date_tz_f = 0;

if (x_sys->assembly_date[0] > 0x80U) {
date_tz = (~x_sys->assembly_date[0]) + 1;
date_tz_f = date_tz & 3;
date_tz >>= 2;
date_tz = -date_tz;
date_tz_f *= 15;
} else if (x_sys->assembly_date[0] < 0x80U) {
date_tz = x_sys->assembly_date[0];
date_tz_f = date_tz & 3;
date_tz >>= 2;
date_tz_f *= 15;
}

rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "class: %x\n",
x_sys->class);
Expand All @@ -305,8 +330,8 @@ static ssize_t mspro_block_attr_show_sysinfo(struct device *dev,
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "page size: %x\n",
be16_to_cpu(x_sys->page_size));
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "assembly date: "
"%d %04u-%02u-%02u %02u:%02u:%02u\n",
x_sys->assembly_date[0],
"GMT%+d:%d %04u-%02u-%02u %02u:%02u:%02u\n",
date_tz, date_tz_f,
be16_to_cpu(*(unsigned short *)
&x_sys->assembly_date[1]),
x_sys->assembly_date[3], x_sys->assembly_date[4],
Expand Down Expand Up @@ -398,6 +423,41 @@ static ssize_t mspro_block_attr_show_mbr(struct device *dev,
return rc;
}

static ssize_t mspro_block_attr_show_specfile(struct device *dev,
struct device_attribute *attr,
char *buffer)
{
struct mspro_sys_attr *x_attr = container_of(attr,
struct mspro_sys_attr,
dev_attr);
struct mspro_specfile *x_spfile = x_attr->data;
char name[9], ext[4];
ssize_t rc = 0;

memcpy(name, x_spfile->name, 8);
name[8] = 0;
memcpy(ext, x_spfile->ext, 3);
ext[3] = 0;

rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "name: %s\n", name);
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "ext: %s\n", ext);
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "attribute: %x\n",
x_spfile->attr);
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "time: %d:%d:%d\n",
x_spfile->time >> 11,
(x_spfile->time >> 5) & 0x3f,
(x_spfile->time & 0x1f) * 2);
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "date: %d-%d-%d\n",
(x_spfile->date >> 9) + 1980,
(x_spfile->date >> 5) & 0xf,
x_spfile->date & 0x1f);
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "start cluster: %x\n",
x_spfile->cluster);
rc += scnprintf(buffer + rc, PAGE_SIZE - rc, "size: %x\n",
x_spfile->size);
return rc;
}

static ssize_t mspro_block_attr_show_devinfo(struct device *dev,
struct device_attribute *attr,
char *buffer)
Expand Down Expand Up @@ -430,6 +490,9 @@ static sysfs_show_t mspro_block_attr_show(unsigned char tag)
return mspro_block_attr_show_modelname;
case MSPRO_BLOCK_ID_MBR:
return mspro_block_attr_show_mbr;
case MSPRO_BLOCK_ID_SPECFILEVALUES1:
case MSPRO_BLOCK_ID_SPECFILEVALUES2:
return mspro_block_attr_show_specfile;
case MSPRO_BLOCK_ID_DEVINFO:
return mspro_block_attr_show_devinfo;
default:
Expand Down Expand Up @@ -629,7 +692,7 @@ static void mspro_block_process_request(struct memstick_dev *card,
param.system = msb->system;
param.data_count = cpu_to_be16(page_count);
param.data_address = cpu_to_be32((uint32_t)t_sec);
param.cmd_param = 0;
param.tpc_param = 0;

msb->data_dir = rq_data_dir(req);
msb->transfer_cmd = msb->data_dir == READ
Expand Down Expand Up @@ -758,10 +821,10 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card)
struct memstick_host *host = card->host;
struct mspro_block_data *msb = memstick_get_drvdata(card);
struct mspro_param_register param = {
.system = 0,
.system = MEMSTICK_SYS_PAR4,
.data_count = 0,
.data_address = 0,
.cmd_param = 0
.tpc_param = 0
};

card->next_request = h_mspro_block_req_init;
Expand All @@ -773,8 +836,8 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card)
if (card->current_mrq.error)
return card->current_mrq.error;

msb->system = 0;
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PARALLEL);
msb->system = MEMSTICK_SYS_PAR4;
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_PAR4);

card->next_request = h_mspro_block_req_init;
msb->mrq_handler = h_mspro_block_default;
Expand All @@ -783,8 +846,24 @@ static int mspro_block_switch_to_parallel(struct memstick_dev *card)
wait_for_completion(&card->mrq_complete);

if (card->current_mrq.error) {
msb->system = 0x80;
msb->system = MEMSTICK_SYS_SERIAL;
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_OFF);
msleep(1000);
host->set_param(host, MEMSTICK_POWER, MEMSTICK_POWER_ON);
host->set_param(host, MEMSTICK_INTERFACE, MEMSTICK_SERIAL);

if (memstick_set_rw_addr(card))
return card->current_mrq.error;

param.system = msb->system;

card->next_request = h_mspro_block_req_init;
msb->mrq_handler = h_mspro_block_default;
memstick_init_req(&card->current_mrq, MS_TPC_WRITE_REG, &param,
sizeof(param));
memstick_new_req(host);
wait_for_completion(&card->mrq_complete);

return -EFAULT;
}

Expand All @@ -802,7 +881,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
.system = msb->system,
.data_count = cpu_to_be16(1),
.data_address = 0,
.cmd_param = 0
.tpc_param = 0
};
struct mspro_attribute *attr = NULL;
struct mspro_sys_attr *s_attr = NULL;
Expand Down Expand Up @@ -922,7 +1001,7 @@ static int mspro_block_read_attributes(struct memstick_dev *card)
param.system = msb->system;
param.data_count = cpu_to_be16((rc / msb->page_size) + 1);
param.data_address = cpu_to_be32(addr / msb->page_size);
param.cmd_param = 0;
param.tpc_param = 0;

sg_init_one(&msb->req_sg[0], buffer,
be16_to_cpu(param.data_count) * msb->page_size);
Expand Down Expand Up @@ -964,7 +1043,7 @@ static int mspro_block_init_card(struct memstick_dev *card)
struct memstick_host *host = card->host;
int rc = 0;

msb->system = 0x80;
msb->system = MEMSTICK_SYS_SERIAL;
card->reg_addr.r_offset = offsetof(struct mspro_register, status);
card->reg_addr.r_length = sizeof(struct ms_status_register);
card->reg_addr.w_offset = offsetof(struct mspro_register, param);
Expand All @@ -973,7 +1052,7 @@ static int mspro_block_init_card(struct memstick_dev *card)
if (memstick_set_rw_addr(card))
return -EIO;

if (host->caps & MEMSTICK_CAP_PARALLEL) {
if (host->caps & MEMSTICK_CAP_PAR4) {
if (mspro_block_switch_to_parallel(card))
printk(KERN_WARNING "%s: could not switch to "
"parallel interface\n", card->dev.bus_id);
Expand Down Expand Up @@ -1348,4 +1427,3 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Alex Dubov");
MODULE_DESCRIPTION("Sony MemoryStickPro block device driver");
MODULE_DEVICE_TABLE(memstick, mspro_block_id_tbl);
MODULE_VERSION(DRIVER_VERSION);
10 changes: 10 additions & 0 deletions trunk/drivers/memstick/host/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,13 @@ config MEMSTICK_TIFM_MS
To compile this driver as a module, choose M here: the
module will be called tifm_ms.

config MEMSTICK_JMICRON_38X
tristate "JMicron JMB38X MemoryStick interface support (EXPERIMENTAL)"
depends on EXPERIMENTAL && PCI

help
Say Y here if you want to be able to access MemoryStick cards with
the JMicron(R) JMB38X MemoryStick card reader.

To compile this driver as a module, choose M here: the
module will be called jmb38x_ms.
Loading

0 comments on commit ff41a8b

Please sign in to comment.