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

Commit 25bfe4f5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull char/misc driver fixes from Greg KH:
 "Here are a few driver fixes for char/misc drivers that resolve
  reported issues.

  All have been in linux-next successfully for a few days"

* tag 'char-misc-3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  Drivers: hv: vmbus: Negotiate version 3.0 when running on ws2012r2 hosts
  Tools: hv: Handle the case when the target file exists correctly
  vme_tsi148: Utilize to_pci_dev() macro
  vme_tsi148: Fix PCI address mapping assumption
  vme_tsi148: Fix typo in tsi148_slave_get()
  w1: avoid recursive device_add
  w1: fix netlink refcnt leak on error path
  misc: Grammar s/addition/additional/
  drivers: mcb: fix memory leak in chameleon_parse_cells() error path
  mei: ignore client writing state during cb completion
  mei: me: do not load the driver if the FW doesn't support MEI interface
  GenWQE: Increase driver version number
  GenWQE: Fix multithreading problems
  GenWQE: Ensure rc is not returning an uninitialized value
  GenWQE: Add wmb before DDCB is started
  GenWQE: Enable access to VPD flash area
parents 60fbf2bd 03367ef5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -55,6 +55,9 @@ static __u32 vmbus_get_next_version(__u32 current_version)
	case (VERSION_WIN8):
		return VERSION_WIN7;

	case (VERSION_WIN8_1):
		return VERSION_WIN8;

	case (VERSION_WS2008):
	default:
		return VERSION_INVAL;
@@ -77,7 +80,7 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
	msg->interrupt_page = virt_to_phys(vmbus_connection.int_page);
	msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages[0]);
	msg->monitor_page2 = virt_to_phys(vmbus_connection.monitor_pages[1]);
	if (version == VERSION_WIN8)
	if (version == VERSION_WIN8_1)
		msg->target_vcpu = hv_context.vp_index[smp_processor_id()];

	/*
+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ int chameleon_parse_cells(struct mcb_bus *bus, phys_addr_t mapbase,
		default:
			pr_err("Invalid chameleon descriptor type 0x%x\n",
				dtype);
			kfree(header);
			return -EINVAL;
		}
		num_cells++;
+2 −2
Original line number Diff line number Diff line
@@ -300,8 +300,8 @@ config SGI_GRU_DEBUG
	depends on SGI_GRU
	default n
	---help---
	This option enables addition debugging code for the SGI GRU driver. If
	you are unsure, say N.
	This option enables additional debugging code for the SGI GRU driver.
	If you are unsure, say N.

config APDS9802ALS
	tristate "Medfield Avago APDS9802 ALS Sensor module"
+39 −19
Original line number Diff line number Diff line
@@ -336,6 +336,44 @@ enum genwqe_requ_state {
	GENWQE_REQU_STATE_MAX,
};

/**
 * struct genwqe_sgl - Scatter gather list describing user-space memory
 * @sgl:            scatter gather list needs to be 128 byte aligned
 * @sgl_dma_addr:   dma address of sgl
 * @sgl_size:       size of area used for sgl
 * @user_addr:      user-space address of memory area
 * @user_size:      size of user-space memory area
 * @page:           buffer for partial pages if needed
 * @page_dma_addr:  dma address partial pages
 */
struct genwqe_sgl {
	dma_addr_t sgl_dma_addr;
	struct sg_entry *sgl;
	size_t sgl_size;	/* size of sgl */

	void __user *user_addr; /* user-space base-address */
	size_t user_size;       /* size of memory area */

	unsigned long nr_pages;
	unsigned long fpage_offs;
	size_t fpage_size;
	size_t lpage_size;

	void *fpage;
	dma_addr_t fpage_dma_addr;

	void *lpage;
	dma_addr_t lpage_dma_addr;
};

int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
			  void __user *user_addr, size_t user_size);

int genwqe_setup_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
		     dma_addr_t *dma_list);

int genwqe_free_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl);

/**
 * struct ddcb_requ - Kernel internal representation of the DDCB request
 * @cmd:          User space representation of the DDCB execution request
@@ -347,9 +385,7 @@ struct ddcb_requ {
	struct ddcb_queue *queue;	  /* associated queue */

	struct dma_mapping  dma_mappings[DDCB_FIXUPS];
	struct sg_entry     *sgl[DDCB_FIXUPS];
	dma_addr_t	    sgl_dma_addr[DDCB_FIXUPS];
	size_t		    sgl_size[DDCB_FIXUPS];
	struct genwqe_sgl sgls[DDCB_FIXUPS];

	/* kernel/user shared content */
	struct genwqe_ddcb_cmd cmd;	/* ddcb_no for this request */
@@ -453,22 +489,6 @@ int genwqe_user_vmap(struct genwqe_dev *cd, struct dma_mapping *m,
int  genwqe_user_vunmap(struct genwqe_dev *cd, struct dma_mapping *m,
			struct ddcb_requ *req);

struct sg_entry *genwqe_alloc_sgl(struct genwqe_dev *cd, int num_pages,
				 dma_addr_t *dma_addr, size_t *sgl_size);

void genwqe_free_sgl(struct genwqe_dev *cd, struct sg_entry *sg_list,
		    dma_addr_t dma_addr, size_t size);

int genwqe_setup_sgl(struct genwqe_dev *cd,
		    unsigned long offs,
		    unsigned long size,
		    struct sg_entry *sgl, /* genwqe sgl */
		    dma_addr_t dma_addr, size_t sgl_size,
		    dma_addr_t *dma_list, int page_offs, int num_pages);

int genwqe_check_sgl(struct genwqe_dev *cd, struct sg_entry *sg_list,
		     int size);

static inline bool dma_mapping_used(struct dma_mapping *m)
{
	if (!m)
+5 −1
Original line number Diff line number Diff line
@@ -305,6 +305,8 @@ static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue,
			break;

		new = (old | DDCB_NEXT_BE32);

		wmb();
		icrc_hsi_shi = cmpxchg(&prev_ddcb->icrc_hsi_shi_32, old, new);

		if (icrc_hsi_shi == old)
@@ -314,6 +316,8 @@ static int enqueue_ddcb(struct genwqe_dev *cd, struct ddcb_queue *queue,
	/* Queue must be re-started by updating QUEUE_OFFSET */
	ddcb_mark_tapped(pddcb);
	num = (u64)ddcb_no << 8;

	wmb();
	__genwqe_writeq(cd, queue->IO_QUEUE_OFFSET, num); /* start queue */

	return RET_DDCB_TAPPED;
@@ -1306,7 +1310,7 @@ static int queue_wake_up_all(struct genwqe_dev *cd)
 */
int genwqe_finish_queue(struct genwqe_dev *cd)
{
	int i, rc, in_flight;
	int i, rc = 0, in_flight;
	int waitmax = genwqe_ddcb_software_timeout;
	struct pci_dev *pci_dev = cd->pci_dev;
	struct ddcb_queue *queue = &cd->queue;
Loading