Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2291
b: refs/heads/master
c: 8830f04
h: refs/heads/master
i:
  2289: 1f45ade
  2287: 98cbd69
v: v3
  • Loading branch information
Russell King committed Jun 20, 2005
1 parent d0adc7f commit 91a5298
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 63 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: bcc408b75b707f46da1f81058ffa3c9df6f0170f
refs/heads/master: 8830f04a092b47f3d246271b24685cd9eab82027
31 changes: 11 additions & 20 deletions trunk/arch/arm/mm/fault-armv.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,15 @@ static int adjust_pte(struct vm_area_struct *vma, unsigned long address)
}

static void
make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page, int dirty)
make_coherent(struct address_space *mapping, struct vm_area_struct *vma, unsigned long addr, unsigned long pfn)
{
struct address_space *mapping = page_mapping(page);
struct mm_struct *mm = vma->vm_mm;
struct vm_area_struct *mpnt;
struct prio_tree_iter iter;
unsigned long offset;
pgoff_t pgoff;
int aliases = 0;

if (!mapping)
return;

pgoff = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT);

/*
Expand All @@ -115,9 +111,11 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
if (aliases)
adjust_pte(vma, addr);
else
flush_cache_page(vma, addr, page_to_pfn(page));
flush_cache_page(vma, addr, pfn);
}

void __flush_dcache_page(struct address_space *mapping, struct page *page);

/*
* Take care of architecture specific things when placing a new PTE into
* a page table, or changing an existing PTE. Basically, there are two
Expand All @@ -134,29 +132,22 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
void update_mmu_cache(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
{
unsigned long pfn = pte_pfn(pte);
struct address_space *mapping;
struct page *page;

if (!pfn_valid(pfn))
return;

page = pfn_to_page(pfn);
if (page_mapping(page)) {
mapping = page_mapping(page);
if (mapping) {
int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags);

if (dirty) {
/*
* This is our first userspace mapping of this page.
* Ensure that the physical page is coherent with
* the kernel mapping.
*
* FIXME: only need to do this on VIVT and aliasing
* VIPT cache architectures. We can do that
* by choosing whether to set this bit...
*/
__cpuc_flush_dcache_page(page_address(page));
}
if (dirty)
__flush_dcache_page(mapping, page);

if (cache_is_vivt())
make_coherent(vma, addr, page, dirty);
make_coherent(mapping, vma, addr, pfn);
}
}

Expand Down
44 changes: 18 additions & 26 deletions trunk/arch/arm/mm/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr)
#define flush_pfn_alias(pfn,vaddr) do { } while (0)
#endif

static void __flush_dcache_page(struct address_space *mapping, struct page *page)
void __flush_dcache_page(struct address_space *mapping, struct page *page)
{
struct mm_struct *mm = current->active_mm;
struct vm_area_struct *mpnt;
struct prio_tree_iter iter;
pgoff_t pgoff;

/*
* Writeback any data associated with the kernel mapping of this
* page. This ensures that data in the physical page is mutually
Expand All @@ -52,24 +47,21 @@ static void __flush_dcache_page(struct address_space *mapping, struct page *page
__cpuc_flush_dcache_page(page_address(page));

/*
* If there's no mapping pointer here, then this page isn't
* visible to userspace yet, so there are no cache lines
* associated with any other aliases.
*/
if (!mapping)
return;

/*
* This is a page cache page. If we have a VIPT cache, we
* only need to do one flush - which would be at the relevant
* If this is a page cache page, and we have an aliasing VIPT cache,
* we only need to do one flush - which would be at the relevant
* userspace colour, which is congruent with page->index.
*/
if (cache_is_vipt()) {
if (cache_is_vipt_aliasing())
flush_pfn_alias(page_to_pfn(page),
page->index << PAGE_CACHE_SHIFT);
return;
}
if (mapping && cache_is_vipt_aliasing())
flush_pfn_alias(page_to_pfn(page),
page->index << PAGE_CACHE_SHIFT);
}

static void __flush_dcache_aliases(struct address_space *mapping, struct page *page)
{
struct mm_struct *mm = current->active_mm;
struct vm_area_struct *mpnt;
struct prio_tree_iter iter;
pgoff_t pgoff;

/*
* There are possible user space mappings of this page:
Expand Down Expand Up @@ -116,12 +108,12 @@ void flush_dcache_page(struct page *page)
{
struct address_space *mapping = page_mapping(page);

if (cache_is_vipt_nonaliasing())
return;

if (mapping && !mapping_mapped(mapping))
set_bit(PG_dcache_dirty, &page->flags);
else
else {
__flush_dcache_page(mapping, page);
if (mapping && cache_is_vivt())
__flush_dcache_aliases(mapping, page);
}
}
EXPORT_SYMBOL(flush_dcache_page);
3 changes: 0 additions & 3 deletions trunk/arch/ppc64/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,6 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl)
tbl->it_largehint = tbl->it_halfpoint;
spin_lock_init(&tbl->it_lock);

/* Clear the hardware table in case firmware left allocations in it */
ppc_md.tce_free(tbl, tbl->it_offset, tbl->it_size);

if (!welcomed) {
printk(KERN_INFO "IOMMU table initialized, virtual merging %s\n",
novmerge ? "disabled" : "enabled");
Expand Down
9 changes: 4 additions & 5 deletions trunk/arch/ppc64/kernel/pSeries_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr)
* cpus are assumed to be secondary threads.
*/
if (system_state < SYSTEM_RUNNING &&
cpu_has_feature(CPU_FTR_SMT) &&
cur_cpu_spec->cpu_features & CPU_FTR_SMT &&
!smt_enabled_at_boot && nr % 2 != 0)
return 0;

Expand Down Expand Up @@ -419,18 +419,17 @@ void __init smp_init_pSeries(void)
#endif

/* Mark threads which are still spinning in hold loops. */
if (cpu_has_feature(CPU_FTR_SMT)) {
for_each_present_cpu(i) {
if (cur_cpu_spec->cpu_features & CPU_FTR_SMT)
for_each_present_cpu(i) {
if (i % 2 == 0)
/*
* Even-numbered logical cpus correspond to
* primary threads.
*/
cpu_set(i, of_spin_map);
}
} else {
else
of_spin_map = cpu_present_map;
}

cpu_clear(boot_cpuid, of_spin_map);

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/ppc64/kernel/rtasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ static int rtasd(void *unused)
goto error;
}

printk(KERN_INFO "RTAS daemon started\n");
printk(KERN_ERR "RTAS daemon started\n");

DEBUG("will sleep for %d jiffies\n", (HZ*60/rtas_event_scan_rate) / 2);

Expand Down Expand Up @@ -485,7 +485,7 @@ static int __init rtas_init(void)
/* No RTAS, only warn if we are on a pSeries box */
if (rtas_token("event-scan") == RTAS_UNKNOWN_SERVICE) {
if (systemcfg->platform & PLATFORM_PSERIES)
printk(KERN_INFO "rtasd: no event-scan on system\n");
printk(KERN_ERR "rtasd: no event-scan on system\n");
return 1;
}

Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/fc4/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,8 @@ void fcp_release(fc_channel *fcchain, int count) /* count must > 0 */

static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
{
unsigned long flags;

if (FCP_CMND(SCpnt)->done)
FCP_CMND(SCpnt)->done(SCpnt);
}
Expand Down Expand Up @@ -905,6 +907,8 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
*/

if (++fc->abort_count < (fc->can_queue >> 1)) {
unsigned long flags;

SCpnt->result = DID_ABORT;
fcmd->done(SCpnt);
printk("FC: soft abort\n");
Expand All @@ -927,7 +931,6 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)

int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
{
unsigned long flags;
fcp_cmd *cmd;
fcp_cmnd *fcmd;
fc_channel *fc = FC_SCMND(SCpnt);
Expand Down Expand Up @@ -1025,7 +1028,6 @@ static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)

int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
{
unsigned long flags;
int rc;

spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/scsi/aic7xxx/aic79xx_osm.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
*/
cmd->scsi_done = scsi_done;

ahd_midlayer_entrypoint_lock(ahd, &flags);
ahd_lock(ahd, &flags);

/*
* Close the race of a command that was in the process of
Expand All @@ -955,7 +955,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
ahd_cmd_set_transaction_status(cmd, CAM_REQUEUE_REQ);
ahd_linux_queue_cmd_complete(ahd, cmd);
ahd_schedule_completeq(ahd);
ahd_midlayer_entrypoint_unlock(ahd, &flags);
ahd_unlock(ahd, &flags);
return (0);
}
dev = ahd_linux_get_device(ahd, cmd->device->channel,
Expand All @@ -965,7 +965,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
ahd_cmd_set_transaction_status(cmd, CAM_RESRC_UNAVAIL);
ahd_linux_queue_cmd_complete(ahd, cmd);
ahd_schedule_completeq(ahd);
ahd_midlayer_entrypoint_unlock(ahd, &flags);
ahd_unlock(ahd, &flags);
printf("%s: aic79xx_linux_queue - Unable to allocate device!\n",
ahd_name(ahd));
return (0);
Expand All @@ -979,7 +979,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
dev->flags |= AHD_DEV_ON_RUN_LIST;
ahd_linux_run_device_queues(ahd);
}
ahd_midlayer_entrypoint_unlock(ahd, &flags);
ahd_unlock(ahd, &flags);
return (0);
}

Expand Down

0 comments on commit 91a5298

Please sign in to comment.