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

Commit c23c2234 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull char/misc driver fixes from Greg KH:
 "Here are some HyperV and MEI driver fixes for 3.12-rc3.  They resolve
  some issues that people have been reporting for them"

* tag 'char-misc-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  Drivers: hv: vmbus: Terminate vmbus version negotiation on timeout
  Drivers: hv: util: Correctly support ws2008R2 and earlier
  mei: cancel stall timers in mei_reset
  mei: bus: stop wait for read during cl state transition
  mei: make me client counters less error prone
parents cac66535 8bbf9f44
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ int vmbus_connect(void)

	do {
		ret = vmbus_negotiate_version(msginfo, version);
		if (ret)
		if (ret == -ETIMEDOUT)
			goto cleanup;

		if (vmbus_connection.conn_state == CONNECTED)
+26 −12
Original line number Diff line number Diff line
@@ -32,13 +32,17 @@
/*
 * Pre win8 version numbers used in ws2008 and ws 2008 r2 (win7)
 */
#define WS2008_SRV_MAJOR	1
#define WS2008_SRV_MINOR	0
#define WS2008_SRV_VERSION     (WS2008_SRV_MAJOR << 16 | WS2008_SRV_MINOR)

#define WIN7_SRV_MAJOR   3
#define WIN7_SRV_MINOR   0
#define WIN7_SRV_MAJOR_MINOR     (WIN7_SRV_MAJOR << 16 | WIN7_SRV_MINOR)
#define WIN7_SRV_VERSION     (WIN7_SRV_MAJOR << 16 | WIN7_SRV_MINOR)

#define WIN8_SRV_MAJOR   4
#define WIN8_SRV_MINOR   0
#define WIN8_SRV_MAJOR_MINOR     (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR)
#define WIN8_SRV_VERSION     (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR)

/*
 * Global state maintained for transaction that is being processed.
@@ -587,6 +591,8 @@ void hv_kvp_onchannelcallback(void *context)

	struct icmsg_hdr *icmsghdrp;
	struct icmsg_negotiate *negop = NULL;
	int util_fw_version;
	int kvp_srv_version;

	if (kvp_transaction.active) {
		/*
@@ -606,17 +612,26 @@ void hv_kvp_onchannelcallback(void *context)

		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
			/*
			 * We start with win8 version and if the host cannot
			 * support that we use the previous version.
			 * Based on the host, select appropriate
			 * framework and service versions we will
			 * negotiate.
			 */
			if (vmbus_prep_negotiate_resp(icmsghdrp, negop,
				 recv_buffer, UTIL_FW_MAJOR_MINOR,
				 WIN8_SRV_MAJOR_MINOR))
				goto done;

			switch (vmbus_proto_version) {
			case (VERSION_WS2008):
				util_fw_version = UTIL_WS2K8_FW_VERSION;
				kvp_srv_version = WS2008_SRV_VERSION;
				break;
			case (VERSION_WIN7):
				util_fw_version = UTIL_FW_VERSION;
				kvp_srv_version = WIN7_SRV_VERSION;
				break;
			default:
				util_fw_version = UTIL_FW_VERSION;
				kvp_srv_version = WIN8_SRV_VERSION;
			}
			vmbus_prep_negotiate_resp(icmsghdrp, negop,
				 recv_buffer, UTIL_FW_MAJOR_MINOR,
				 WIN7_SRV_MAJOR_MINOR);
				 recv_buffer, util_fw_version,
				 kvp_srv_version);

		} else {
			kvp_msg = (struct hv_kvp_msg *)&recv_buffer[
@@ -649,7 +664,6 @@ void hv_kvp_onchannelcallback(void *context)
			return;

		}
done:

		icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
			| ICMSGHDRFLAG_RESPONSE;
+3 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@

#define VSS_MAJOR  5
#define VSS_MINOR  0
#define VSS_MAJOR_MINOR    (VSS_MAJOR << 16 | VSS_MINOR)
#define VSS_VERSION    (VSS_MAJOR << 16 | VSS_MINOR)



@@ -190,8 +190,8 @@ void hv_vss_onchannelcallback(void *context)

		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
			vmbus_prep_negotiate_resp(icmsghdrp, negop,
				 recv_buffer, UTIL_FW_MAJOR_MINOR,
				 VSS_MAJOR_MINOR);
				 recv_buffer, UTIL_FW_VERSION,
				 VSS_VERSION);
		} else {
			vss_msg = (struct hv_vss_msg *)&recv_buffer[
				sizeof(struct vmbuspipe_hdr) +
+54 −17
Original line number Diff line number Diff line
@@ -28,17 +28,32 @@
#include <linux/reboot.h>
#include <linux/hyperv.h>

#define SHUTDOWN_MAJOR	3
#define SHUTDOWN_MINOR  0
#define SHUTDOWN_MAJOR_MINOR	(SHUTDOWN_MAJOR << 16 | SHUTDOWN_MINOR)

#define TIMESYNCH_MAJOR	3
#define TIMESYNCH_MINOR 0
#define TIMESYNCH_MAJOR_MINOR	(TIMESYNCH_MAJOR << 16 | TIMESYNCH_MINOR)
#define SD_MAJOR	3
#define SD_MINOR	0
#define SD_VERSION	(SD_MAJOR << 16 | SD_MINOR)

#define HEARTBEAT_MAJOR	3
#define HEARTBEAT_MINOR 0
#define HEARTBEAT_MAJOR_MINOR	(HEARTBEAT_MAJOR << 16 | HEARTBEAT_MINOR)
#define SD_WS2008_MAJOR		1
#define SD_WS2008_VERSION	(SD_WS2008_MAJOR << 16 | SD_MINOR)

#define TS_MAJOR	3
#define TS_MINOR	0
#define TS_VERSION	(TS_MAJOR << 16 | TS_MINOR)

#define TS_WS2008_MAJOR		1
#define TS_WS2008_VERSION	(TS_WS2008_MAJOR << 16 | TS_MINOR)

#define HB_MAJOR	3
#define HB_MINOR 0
#define HB_VERSION	(HB_MAJOR << 16 | HB_MINOR)

#define HB_WS2008_MAJOR	1
#define HB_WS2008_VERSION	(HB_WS2008_MAJOR << 16 | HB_MINOR)

static int sd_srv_version;
static int ts_srv_version;
static int hb_srv_version;
static int util_fw_version;

static void shutdown_onchannelcallback(void *context);
static struct hv_util_service util_shutdown = {
@@ -99,8 +114,8 @@ static void shutdown_onchannelcallback(void *context)

		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
			vmbus_prep_negotiate_resp(icmsghdrp, negop,
					shut_txf_buf, UTIL_FW_MAJOR_MINOR,
					SHUTDOWN_MAJOR_MINOR);
					shut_txf_buf, util_fw_version,
					sd_srv_version);
		} else {
			shutdown_msg =
				(struct shutdown_msg_data *)&shut_txf_buf[
@@ -216,6 +231,7 @@ static void timesync_onchannelcallback(void *context)
	struct icmsg_hdr *icmsghdrp;
	struct ictimesync_data *timedatap;
	u8 *time_txf_buf = util_timesynch.recv_buffer;
	struct icmsg_negotiate *negop = NULL;

	vmbus_recvpacket(channel, time_txf_buf,
			 PAGE_SIZE, &recvlen, &requestid);
@@ -225,9 +241,10 @@ static void timesync_onchannelcallback(void *context)
				sizeof(struct vmbuspipe_hdr)];

		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
			vmbus_prep_negotiate_resp(icmsghdrp, NULL, time_txf_buf,
						UTIL_FW_MAJOR_MINOR,
						TIMESYNCH_MAJOR_MINOR);
			vmbus_prep_negotiate_resp(icmsghdrp, negop,
						time_txf_buf,
						util_fw_version,
						ts_srv_version);
		} else {
			timedatap = (struct ictimesync_data *)&time_txf_buf[
				sizeof(struct vmbuspipe_hdr) +
@@ -257,6 +274,7 @@ static void heartbeat_onchannelcallback(void *context)
	struct icmsg_hdr *icmsghdrp;
	struct heartbeat_msg_data *heartbeat_msg;
	u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
	struct icmsg_negotiate *negop = NULL;

	vmbus_recvpacket(channel, hbeat_txf_buf,
			 PAGE_SIZE, &recvlen, &requestid);
@@ -266,9 +284,9 @@ static void heartbeat_onchannelcallback(void *context)
				sizeof(struct vmbuspipe_hdr)];

		if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
			vmbus_prep_negotiate_resp(icmsghdrp, NULL,
				hbeat_txf_buf, UTIL_FW_MAJOR_MINOR,
				HEARTBEAT_MAJOR_MINOR);
			vmbus_prep_negotiate_resp(icmsghdrp, negop,
				hbeat_txf_buf, util_fw_version,
				hb_srv_version);
		} else {
			heartbeat_msg =
				(struct heartbeat_msg_data *)&hbeat_txf_buf[
@@ -321,6 +339,25 @@ static int util_probe(struct hv_device *dev,
		goto error;

	hv_set_drvdata(dev, srv);
	/*
	 * Based on the host; initialize the framework and
	 * service version numbers we will negotiate.
	 */
	switch (vmbus_proto_version) {
	case (VERSION_WS2008):
		util_fw_version = UTIL_WS2K8_FW_VERSION;
		sd_srv_version = SD_WS2008_VERSION;
		ts_srv_version = TS_WS2008_VERSION;
		hb_srv_version = HB_WS2008_VERSION;
		break;

	default:
		util_fw_version = UTIL_FW_VERSION;
		sd_srv_version = SD_VERSION;
		ts_srv_version = TS_VERSION;
		hb_srv_version = HB_VERSION;
	}

	return 0;

error:
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ void mei_amthif_reset_params(struct mei_device *dev)
	dev->iamthif_ioctl = false;
	dev->iamthif_state = MEI_IAMTHIF_IDLE;
	dev->iamthif_timer = 0;
	dev->iamthif_stall_timer = 0;
}

/**
Loading