Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8bef0bb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] implement early_io{re,un}map for ia64
  [IA64] Replace old style lock initializer
  [IA64] fix SBA IOMMU to handle allocation failure properly
  [IA64] Save I-resources to ia64_sal_os_state
  [IA64] preallocate IA64_IRQ_MOVE_VECTOR
parents 37c24b37 43067713
Loading
Loading
Loading
Loading
+29 −9
Original line number Diff line number Diff line
@@ -677,12 +677,19 @@ sba_alloc_range(struct ioc *ioc, struct device *dev, size_t size)
			spin_unlock_irqrestore(&ioc->saved_lock, flags);

			pide = sba_search_bitmap(ioc, dev, pages_needed, 0);
			if (unlikely(pide >= (ioc->res_size << 3)))
				panic(__FILE__ ": I/O MMU @ %p is out of mapping resources\n",
				      ioc->ioc_hpa);
			if (unlikely(pide >= (ioc->res_size << 3))) {
				printk(KERN_WARNING "%s: I/O MMU @ %p is"
				       "out of mapping resources, %u %u %lx\n",
				       __func__, ioc->ioc_hpa, ioc->res_size,
				       pages_needed, dma_get_seg_boundary(dev));
				return -1;
			}
#else
			panic(__FILE__ ": I/O MMU @ %p is out of mapping resources\n",
			      ioc->ioc_hpa);
			printk(KERN_WARNING "%s: I/O MMU @ %p is"
			       "out of mapping resources, %u %u %lx\n",
			       __func__, ioc->ioc_hpa, ioc->res_size,
			       pages_needed, dma_get_seg_boundary(dev));
			return -1;
#endif
		}
	}
@@ -965,6 +972,8 @@ static dma_addr_t sba_map_page(struct device *dev, struct page *page,
#endif

	pide = sba_alloc_range(ioc, dev, size);
	if (pide < 0)
		return 0;

	iovp = (dma_addr_t) pide << iovp_shift;

@@ -1320,6 +1329,7 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev,
	unsigned long dma_offset, dma_len; /* start/len of DMA stream */
	int n_mappings = 0;
	unsigned int max_seg_size = dma_get_max_seg_size(dev);
	int idx;

	while (nents > 0) {
		unsigned long vaddr = (unsigned long) sba_sg_address(startsg);
@@ -1418,8 +1428,12 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev,
		vcontig_sg->dma_length = vcontig_len;
		dma_len = (dma_len + dma_offset + ~iovp_mask) & iovp_mask;
		ASSERT(dma_len <= DMA_CHUNK_SIZE);
		dma_sg->dma_address = (dma_addr_t) (PIDE_FLAG
			| (sba_alloc_range(ioc, dev, dma_len) << iovp_shift)
		idx = sba_alloc_range(ioc, dev, dma_len);
		if (idx < 0) {
			dma_sg->dma_length = 0;
			return -1;
		}
		dma_sg->dma_address = (dma_addr_t)(PIDE_FLAG | (idx << iovp_shift)
						   | dma_offset);
		n_mappings++;
	}
@@ -1427,7 +1441,9 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev,
	return n_mappings;
}


static void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist,
			       int nents, enum dma_data_direction dir,
			       struct dma_attrs *attrs);
/**
 * sba_map_sg - map Scatter/Gather list
 * @dev: instance of PCI owned by the driver that's asking.
@@ -1493,6 +1509,10 @@ static int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist,
	** Access to the virtual address is what forces a two pass algorithm.
	*/
	coalesced = sba_coalesce_chunks(ioc, dev, sglist, nents);
	if (coalesced < 0) {
		sba_unmap_sg_attrs(dev, sglist, nents, dir, attrs);
		return 0;
	}

	/*
	** Program the I/O Pdir
+6 −0
Original line number Diff line number Diff line
@@ -59,7 +59,13 @@ typedef u16 ia64_vector;
extern int ia64_first_device_vector;
extern int ia64_last_device_vector;

#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined (CONFIG_IA64_DIG))
/* Reserve the lower priority vector than device vectors for "move IRQ" IPI */
#define IA64_IRQ_MOVE_VECTOR		0x30	/* "move IRQ" IPI */
#define IA64_DEF_FIRST_DEVICE_VECTOR	0x31
#else
#define IA64_DEF_FIRST_DEVICE_VECTOR	0x30
#endif
#define IA64_DEF_LAST_DEVICE_VECTOR	0xe7
#define IA64_FIRST_DEVICE_VECTOR	ia64_first_device_vector
#define IA64_LAST_DEVICE_VECTOR		ia64_last_device_vector
+5 −0
Original line number Diff line number Diff line
@@ -106,6 +106,11 @@ struct ia64_sal_os_state {
	unsigned long		os_status;		/* OS status to SAL, enum below */
	unsigned long		context;		/* 0 if return to same context
							   1 if return to new context */

	/* I-resources */
	unsigned long		iip;
	unsigned long		ipsr;
	unsigned long		ifs;
};

enum {
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ struct rw_semaphore {
#define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)

#define __RWSEM_INITIALIZER(name) \
	{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
	{ RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \
	  LIST_HEAD_INIT((name).wait_list) }

#define DECLARE_RWSEM(name) \
+1 −5
Original line number Diff line number Diff line
@@ -260,7 +260,6 @@ void __setup_vector_irq(int cpu)
}

#if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
#define IA64_IRQ_MOVE_VECTOR	IA64_DEF_FIRST_DEVICE_VECTOR

static enum vector_domain_type {
	VECTOR_DOMAIN_NONE,
@@ -659,11 +658,8 @@ init_IRQ (void)
	register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL);
#ifdef CONFIG_SMP
#if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG)
	if (vector_domain_type != VECTOR_DOMAIN_NONE) {
		BUG_ON(IA64_FIRST_DEVICE_VECTOR != IA64_IRQ_MOVE_VECTOR);
		IA64_FIRST_DEVICE_VECTOR++;
	if (vector_domain_type != VECTOR_DOMAIN_NONE)
		register_percpu_irq(IA64_IRQ_MOVE_VECTOR, &irq_move_irqaction);
	}
#endif
#endif
#ifdef CONFIG_PERFMON
Loading