Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73040
b: refs/heads/master
c: 1bf617b
h: refs/heads/master
v: v3
  • Loading branch information
Li Yang authored and Jeff Garzik committed Nov 3, 2007
1 parent 656f31f commit 0803b68
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 34 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: ebab89909e0dc716282d5e7f6e73a3155fe66d4a
refs/heads/master: 1bf617b712380940ed357cb94b488fb262069594
31 changes: 18 additions & 13 deletions trunk/drivers/ata/sata_fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ enum {

SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
ATA_FLAG_NCQ | ATA_FLAG_SKIP_D2H_BSY),
ATA_FLAG_NCQ),
SATA_FSL_HOST_LFLAGS = ATA_LFLAG_SKIP_D2H_BSY,

SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH,
SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */
Expand Down Expand Up @@ -728,9 +729,10 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap)
return ata_dev_classify(&tf);
}

static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
static int sata_fsl_softreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
struct ata_port *ap = link->ap;
struct sata_fsl_port_priv *pp = ap->private_data;
struct sata_fsl_host_priv *host_priv = ap->host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
Expand Down Expand Up @@ -811,7 +813,7 @@ static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
*/

temp = ata_wait_register(hcr_base + HSTATUS, 0xFF, 0, 1, 500);
if ((!(temp & 0x10)) || ata_port_offline(ap)) {
if ((!(temp & 0x10)) || ata_link_offline(link)) {
ata_port_printk(ap, KERN_WARNING,
"No Device OR PHYRDY change,Hstatus = 0x%x\n",
ioread32(hcr_base + HSTATUS));
Expand Down Expand Up @@ -842,12 +844,12 @@ static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
* reached here, we can send a command to the target device
*/

if (ap->sactive)
if (link->sactive)
goto skip_srst_do_ncq_error_handling;

DPRINTK("Sending SRST/device reset\n");

ata_tf_init(ap->device, &tf);
ata_tf_init(link->device, &tf);
cfis = (u8 *) & pp->cmdentry->cfis;

/* device reset/SRST is a control register update FIS, uses tag0 */
Expand Down Expand Up @@ -919,7 +921,7 @@ static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
VPRINTK("Sending read log ext(10h) command\n");

memset(&qc, 0, sizeof(struct ata_queued_cmd));
ata_tf_init(ap->device, &tf);
ata_tf_init(link->device, &tf);

tf.command = ATA_CMD_READ_LOG_EXT;
tf.lbal = ATA_LOG_SATA_NCQ;
Expand All @@ -931,7 +933,7 @@ static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
qc.tag = ATA_TAG_INTERNAL;
qc.scsicmd = NULL;
qc.ap = ap;
qc.dev = ap->device;
qc.dev = link->device;

qc.tf = tf;
qc.flags |= ATA_QCFLAG_RESULT_TF;
Expand Down Expand Up @@ -981,7 +983,7 @@ static int sata_fsl_softreset(struct ata_port *ap, unsigned int *class,
*class = ATA_DEV_NONE;

/* Verify if SStatus indicates device presence */
if (ata_port_online(ap)) {
if (ata_link_online(link)) {
/*
* if we are here, device presence has been detected,
* 1st D2H FIS would have been received, but sfis in
Expand Down Expand Up @@ -1042,7 +1044,8 @@ static void sata_fsl_irq_clear(struct ata_port *ap)

static void sata_fsl_error_intr(struct ata_port *ap)
{
struct ata_eh_info *ehi = &ap->eh_info;
struct ata_link *link = &ap->link;
struct ata_eh_info *ehi = &link->eh_info;
struct sata_fsl_host_priv *host_priv = ap->host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
u32 hstatus, dereg, cereg = 0, SError = 0;
Expand Down Expand Up @@ -1111,7 +1114,7 @@ static void sata_fsl_error_intr(struct ata_port *ap)
}

/* record error info */
qc = ata_qc_from_tag(ap, ap->active_tag);
qc = ata_qc_from_tag(ap, link->active_tag);

if (qc) {
sata_fsl_cache_taskfile_from_d2h_fis(qc, qc->ap);
Expand Down Expand Up @@ -1139,6 +1142,7 @@ static void sata_fsl_qc_complete(struct ata_queued_cmd *qc)

static void sata_fsl_host_intr(struct ata_port *ap)
{
struct ata_link *link = &ap->link;
struct sata_fsl_host_priv *host_priv = ap->host->private_data;
void __iomem *hcr_base = host_priv->hcr_base;
u32 hstatus, qc_active = 0;
Expand All @@ -1161,7 +1165,7 @@ static void sata_fsl_host_intr(struct ata_port *ap)
return;
}

if (ap->sactive) { /* only true for NCQ commands */
if (link->sactive) { /* only true for NCQ commands */
int i;
/* Read command completed register */
qc_active = ioread32(hcr_base + CC);
Expand Down Expand Up @@ -1190,10 +1194,10 @@ static void sata_fsl_host_intr(struct ata_port *ap)

} else if (ap->qc_active) {
iowrite32(1, hcr_base + CC);
qc = ata_qc_from_tag(ap, ap->active_tag);
qc = ata_qc_from_tag(ap, link->active_tag);

DPRINTK("completing non-ncq cmd, tag=%d,CC=0x%x\n",
ap->active_tag, ioread32(hcr_base + CC));
link->active_tag, ioread32(hcr_base + CC));

if (qc) {
sata_fsl_qc_complete(qc);
Expand Down Expand Up @@ -1348,6 +1352,7 @@ static const struct ata_port_operations sata_fsl_ops = {
static const struct ata_port_info sata_fsl_port_info[] = {
{
.flags = SATA_FSL_HOST_FLAGS,
.link_flags = SATA_FSL_HOST_LFLAGS,
.pio_mask = 0x1f, /* pio 0-4 */
.udma_mask = 0x7f, /* udma 0-6 */
.port_ops = &sata_fsl_ops,
Expand Down
10 changes: 1 addition & 9 deletions trunk/fs/ntfs/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,6 @@ static int ntfs_readpage(struct file *file, struct page *page)

retry_readpage:
BUG_ON(!PageLocked(page));
vi = page->mapping->host;
i_size = i_size_read(vi);
/* Is the page fully outside i_size? (truncate in progress) */
if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >>
PAGE_CACHE_SHIFT)) {
zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
ntfs_debug("Read outside i_size - truncated?");
goto done;
}
/*
* This can potentially happen because we clear PageUptodate() during
* ntfs_writepage() of MstProtected() attributes.
Expand All @@ -422,6 +413,7 @@ static int ntfs_readpage(struct file *file, struct page *page)
unlock_page(page);
return 0;
}
vi = page->mapping->host;
ni = NTFS_I(vi);
/*
* Only $DATA attributes can be encrypted and only unnamed $DATA
Expand Down
5 changes: 4 additions & 1 deletion trunk/fs/ntfs/attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx)
* ntfs_mapping_pairs_decompress() fails.
*/
end_vcn = sle64_to_cpu(a->data.non_resident.highest_vcn) + 1;
if (unlikely(vcn && vcn >= end_vcn)) {
if (!a->data.non_resident.lowest_vcn && end_vcn == 1)
end_vcn = sle64_to_cpu(a->data.non_resident.allocated_size) >>
ni->vol->cluster_size_bits;
if (unlikely(vcn >= end_vcn)) {
err = -ENOENT;
goto err_out;
}
Expand Down
10 changes: 0 additions & 10 deletions trunk/fs/ntfs/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,16 +561,6 @@ int ntfs_read_compressed_block(struct page *page)
read_unlock_irqrestore(&ni->size_lock, flags);
max_page = ((i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) -
offset;
/* Is the page fully outside i_size? (truncate in progress) */
if (xpage >= max_page) {
kfree(bhs);
kfree(pages);
zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
ntfs_debug("Compressed read outside i_size - truncated?");
SetPageUptodate(page);
unlock_page(page);
return 0;
}
if (nr_pages < max_page)
max_page = nr_pages;
for (i = 0; i < max_page; i++, offset++) {
Expand Down

0 comments on commit 0803b68

Please sign in to comment.