Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 74492
b: refs/heads/master
c: e87cb5d
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Dec 3, 2007
1 parent 42f8e60 commit 5bc4ca4
Show file tree
Hide file tree
Showing 14 changed files with 176 additions and 68 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: 9ec46c6dae343688ff1136a0899b6a3c5e95e44b
refs/heads/master: e87cb5db0dc357473ac71801051954ddd6ff604f
2 changes: 1 addition & 1 deletion trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ S: Maintained

KDUMP
P: Vivek Goyal
M: vgoyal@in.ibm.com
M: vgoyal@redhat.com
P: Haren Myneni
M: hbabu@us.ibm.com
L: kexec@lists.infradead.org
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/um/Kconfig.i386
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ config UML_X86
bool
default y

config X86_32
bool
default y

config RWSEM_XCHGADD_ALGORITHM
def_bool y

config 64BIT
bool
default n
Expand Down
11 changes: 10 additions & 1 deletion trunk/arch/um/drivers/chan_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ void generic_free(void *data)

int generic_console_write(int fd, const char *buf, int n)
{
sigset_t old, no_sigio;
struct termios save, new;
int err;

if (isatty(fd)) {
sigemptyset(&no_sigio);
sigaddset(&no_sigio, SIGIO);
if (sigprocmask(SIG_BLOCK, &no_sigio, &old))
goto error;

CATCH_EINTR(err = tcgetattr(fd, &save));
if (err)
goto error;
Expand All @@ -97,8 +103,11 @@ int generic_console_write(int fd, const char *buf, int n)
* Restore raw mode, in any case; we *must* ignore any error apart
* EINTR, except for debug.
*/
if (isatty(fd))
if (isatty(fd)) {
CATCH_EINTR(tcsetattr(fd, TCSAFLUSH, &save));
sigprocmask(SIG_SETMASK, &old, NULL);
}

return err;
error:
return -errno;
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/um/os-Linux/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ long long os_nsecs(void)
#ifdef UML_CONFIG_NO_HZ
static int after_sleep_interval(struct timespec *ts)
{
return 0;
}
#else
static inline long long timespec_to_us(const struct timespec *ts)
Expand Down
28 changes: 28 additions & 0 deletions trunk/drivers/ata/ata_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,13 @@ static int piix_broken_suspend(void)
DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M3"),
},
},
{
.ident = "TECRA M3",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "Tecra M3"),
},
},
{
.ident = "TECRA M5",
.matches = {
Expand All @@ -980,13 +987,34 @@ static int piix_broken_suspend(void)
DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M7"),
},
},
{
.ident = "TECRA A8",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A8"),
},
},
{
.ident = "Satellite R25",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "Satellite R25"),
},
},
{
.ident = "Satellite U200",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
},
},
{
.ident = "Satellite U200",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE U200"),
},
},
{
.ident = "Satellite Pro U200",
.matches = {
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4185,6 +4185,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
/* Devices which get the IVB wrong */
{ "QUANTUM FIREBALLlct10 05", "A03.0900", ATA_HORKAGE_IVB, },
{ "TSSTcorp CDDVDW SH-S202J", "SB00", ATA_HORKAGE_IVB, },
{ "TSSTcorp CDDVDW SH-S202J", "SB01", ATA_HORKAGE_IVB, },
{ "TSSTcorp CDDVDW SH-S202N", "SB00", ATA_HORKAGE_IVB, },
{ "TSSTcorp CDDVDW SH-S202N", "SB01", ATA_HORKAGE_IVB, },

/* End Marker */
{ }
Expand Down Expand Up @@ -6964,12 +6967,11 @@ int ata_host_start(struct ata_host *host)
if (ap->ops->port_start) {
rc = ap->ops->port_start(ap);
if (rc) {
ata_port_printk(ap, KERN_ERR, "failed to "
"start port (errno=%d)\n", rc);
if (rc != -ENODEV)
dev_printk(KERN_ERR, host->dev, "failed to start port %d (errno=%d)\n", i, rc);
goto err_out;
}
}

ata_eh_freeze_port(ap);
}

Expand Down
42 changes: 33 additions & 9 deletions trunk/drivers/ata/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1850,30 +1850,54 @@ static void ata_eh_link_report(struct ata_link *link)
ehc->i.serror & SERR_DEV_XCHG ? "DevExch " : "");

for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
static const char *dma_str[] = {
[DMA_BIDIRECTIONAL] = "bidi",
[DMA_TO_DEVICE] = "out",
[DMA_FROM_DEVICE] = "in",
[DMA_NONE] = "",
};
struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
struct ata_taskfile *cmd = &qc->tf, *res = &qc->result_tf;
const u8 *cdb = qc->cdb;
char data_buf[20] = "";
char cdb_buf[70] = "";

if (!(qc->flags & ATA_QCFLAG_FAILED) ||
qc->dev->link != link || !qc->err_mask)
continue;

if (qc->dma_dir != DMA_NONE) {
static const char *dma_str[] = {
[DMA_BIDIRECTIONAL] = "bidi",
[DMA_TO_DEVICE] = "out",
[DMA_FROM_DEVICE] = "in",
};
static const char *prot_str[] = {
[ATA_PROT_PIO] = "pio",
[ATA_PROT_DMA] = "dma",
[ATA_PROT_NCQ] = "ncq",
[ATA_PROT_ATAPI] = "pio",
[ATA_PROT_ATAPI_DMA] = "dma",
};

snprintf(data_buf, sizeof(data_buf), " %s %u %s",
prot_str[qc->tf.protocol], qc->nbytes,
dma_str[qc->dma_dir]);
}

if (is_atapi_taskfile(&qc->tf))
snprintf(cdb_buf, sizeof(cdb_buf),
"cdb %02x %02x %02x %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x\n ",
cdb[0], cdb[1], cdb[2], cdb[3],
cdb[4], cdb[5], cdb[6], cdb[7],
cdb[8], cdb[9], cdb[10], cdb[11],
cdb[12], cdb[13], cdb[14], cdb[15]);

ata_dev_printk(qc->dev, KERN_ERR,
"cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
"tag %d cdb 0x%x data %u %s\n "
"tag %d%s\n %s"
"res %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
"Emask 0x%x (%s)%s\n",
cmd->command, cmd->feature, cmd->nsect,
cmd->lbal, cmd->lbam, cmd->lbah,
cmd->hob_feature, cmd->hob_nsect,
cmd->hob_lbal, cmd->hob_lbam, cmd->hob_lbah,
cmd->device, qc->tag, qc->cdb[0], qc->nbytes,
dma_str[qc->dma_dir],
cmd->device, qc->tag, data_buf, cdb_buf,
res->command, res->feature, res->nsect,
res->lbal, res->lbam, res->lbah,
res->hob_feature, res->hob_nsect,
Expand Down
61 changes: 33 additions & 28 deletions trunk/drivers/ata/pata_at32.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <asm/arch/smc.h>

#define DRV_NAME "pata_at32"
#define DRV_VERSION "0.0.2"
#define DRV_VERSION "0.0.3"

/*
* CompactFlash controller memory layout relative to the base address:
Expand Down Expand Up @@ -64,6 +64,8 @@
* Mode 2 | 8.3 | 240 ns | 0x07
* Mode 3 | 11.1 | 180 ns | 0x0f
* Mode 4 | 16.7 | 120 ns | 0x1f
*
* Alter PIO_MASK below according to table to set maximal PIO mode.
*/
#define PIO_MASK (0x1f)

Expand All @@ -85,36 +87,40 @@ struct at32_ide_info {
*/
static int pata_at32_setup_timing(struct device *dev,
struct at32_ide_info *info,
const struct ata_timing *timing)
const struct ata_timing *ata)
{
/* These two values are found through testing */
const int min_recover = 25;
const int ncs_hold = 15;

struct smc_config *smc = &info->smc;
struct smc_timing timing;

int active;
int recover;

memset(&timing, 0, sizeof(struct smc_timing));

/* Total cycle time */
smc->read_cycle = timing->cyc8b;
timing.read_cycle = ata->cyc8b;

/* DIOR <= CFIOR timings */
smc->nrd_setup = timing->setup;
smc->nrd_pulse = timing->act8b;
timing.nrd_setup = ata->setup;
timing.nrd_pulse = ata->act8b;
timing.nrd_recover = ata->rec8b;

/* Convert nanosecond timing to clock cycles */
smc_set_timing(smc, &timing);

/* Compute recover, extend total cycle if needed */
active = smc->nrd_setup + smc->nrd_pulse;
/* Add one extra cycle setup due to signal ring */
smc->nrd_setup = smc->nrd_setup + 1;

active = smc->nrd_setup + smc->nrd_pulse;
recover = smc->read_cycle - active;

if (recover < min_recover) {
smc->read_cycle = active + min_recover;
recover = min_recover;
}
/* Need at least two cycles recovery */
if (recover < 2)
smc->read_cycle = active + 2;

/* (CS0, CS1, DIR, OE) <= (CFCE1, CFCE2, CFRNW, NCSX) timings */
smc->ncs_read_setup = 0;
smc->ncs_read_pulse = active + ncs_hold;
smc->ncs_read_setup = 1;
smc->ncs_read_pulse = smc->read_cycle - 2;

/* Write timings same as read timings */
smc->write_cycle = smc->read_cycle;
Expand All @@ -123,11 +129,13 @@ static int pata_at32_setup_timing(struct device *dev,
smc->ncs_write_setup = smc->ncs_read_setup;
smc->ncs_write_pulse = smc->ncs_read_pulse;

/* Do some debugging output */
dev_dbg(dev, "SMC: C=%d S=%d P=%d R=%d NCSS=%d NCSP=%d NCSR=%d\n",
/* Do some debugging output of ATA and SMC timings */
dev_dbg(dev, "ATA: C=%d S=%d P=%d R=%d\n",
ata->cyc8b, ata->setup, ata->act8b, ata->rec8b);

dev_dbg(dev, "SMC: C=%d S=%d P=%d NS=%d NP=%d\n",
smc->read_cycle, smc->nrd_setup, smc->nrd_pulse,
recover, smc->ncs_read_setup, smc->ncs_read_pulse,
smc->read_cycle - smc->ncs_read_pulse);
smc->ncs_read_setup, smc->ncs_read_pulse);

/* Finally, configure the SMC */
return smc_set_configuration(info->cs, smc);
Expand Down Expand Up @@ -182,7 +190,6 @@ static struct scsi_host_template at32_sht = {
};

static struct ata_port_operations at32_port_ops = {
.port_disable = ata_port_disable,
.set_piomode = pata_at32_set_piomode,
.tf_load = ata_tf_load,
.tf_read = ata_tf_read,
Expand All @@ -203,7 +210,6 @@ static struct ata_port_operations at32_port_ops = {

.irq_clear = pata_at32_irq_clear,
.irq_on = ata_irq_on,
.irq_ack = ata_irq_ack,

.port_start = ata_sff_port_start,
};
Expand All @@ -223,8 +229,7 @@ static int __init pata_at32_init_one(struct device *dev,
/* Setup ATA bindings */
ap->ops = &at32_port_ops;
ap->pio_mask = PIO_MASK;
ap->flags = ATA_FLAG_MMIO | ATA_FLAG_SLAVE_POSS
| ATA_FLAG_PIO_POLLING;
ap->flags |= ATA_FLAG_MMIO | ATA_FLAG_SLAVE_POSS;

/*
* Since all 8-bit taskfile transfers has to go on the lower
Expand Down Expand Up @@ -357,12 +362,12 @@ static int __init pata_at32_probe(struct platform_device *pdev)
info->smc.tdf_mode = 0; /* TDF optimization disabled */
info->smc.tdf_cycles = 0; /* No TDF wait cycles */

/* Setup ATA timing */
/* Setup SMC to ATA timing */
ret = pata_at32_setup_timing(dev, info, &initial_timing);
if (ret)
goto err_setup_timing;

/* Setup ATA addresses */
/* Map ATA address space */
ret = -ENOMEM;
info->ide_addr = devm_ioremap(dev, info->res_ide.start, 16);
info->alt_addr = devm_ioremap(dev, info->res_alt.start, 16);
Expand All @@ -373,7 +378,7 @@ static int __init pata_at32_probe(struct platform_device *pdev)
pata_at32_debug_bus(dev, info);
#endif

/* Register ATA device */
/* Setup and register ATA device */
ret = pata_at32_init_one(dev, info);
if (ret)
goto err_ata_device;
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/ata/pata_bf54x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,8 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev)
int board_idx = 0;
struct resource *res;
struct ata_host *host;
unsigned int fsclk = get_sclk();
int udma_mode = 5;
const struct ata_port_info *ppi[] =
{ &bfin_port_info[board_idx], NULL };

Expand All @@ -1507,6 +1509,11 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev)
if (res == NULL)
return -EINVAL;

while (bfin_port_info[board_idx].udma_mask>0 && udma_fsclk[udma_mode] > fsclk) {
udma_mode--;
bfin_port_info[board_idx].udma_mask >>= 1;
}

/*
* Now that that's out of the way, wire up the port..
*/
Expand Down
Loading

0 comments on commit 5bc4ca4

Please sign in to comment.