Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-3.12-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

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

+116 -50
+1 -1
drivers/hv/connection.c
··· 195 195 196 196 do { 197 197 ret = vmbus_negotiate_version(msginfo, version); 198 - if (ret) 198 + if (ret == -ETIMEDOUT) 199 199 goto cleanup; 200 200 201 201 if (vmbus_connection.conn_state == CONNECTED)
+26 -12
drivers/hv/hv_kvp.c
··· 32 32 /* 33 33 * Pre win8 version numbers used in ws2008 and ws 2008 r2 (win7) 34 34 */ 35 + #define WS2008_SRV_MAJOR 1 36 + #define WS2008_SRV_MINOR 0 37 + #define WS2008_SRV_VERSION (WS2008_SRV_MAJOR << 16 | WS2008_SRV_MINOR) 38 + 35 39 #define WIN7_SRV_MAJOR 3 36 40 #define WIN7_SRV_MINOR 0 37 - #define WIN7_SRV_MAJOR_MINOR (WIN7_SRV_MAJOR << 16 | WIN7_SRV_MINOR) 41 + #define WIN7_SRV_VERSION (WIN7_SRV_MAJOR << 16 | WIN7_SRV_MINOR) 38 42 39 43 #define WIN8_SRV_MAJOR 4 40 44 #define WIN8_SRV_MINOR 0 41 - #define WIN8_SRV_MAJOR_MINOR (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR) 45 + #define WIN8_SRV_VERSION (WIN8_SRV_MAJOR << 16 | WIN8_SRV_MINOR) 42 46 43 47 /* 44 48 * Global state maintained for transaction that is being processed. ··· 591 587 592 588 struct icmsg_hdr *icmsghdrp; 593 589 struct icmsg_negotiate *negop = NULL; 590 + int util_fw_version; 591 + int kvp_srv_version; 594 592 595 593 if (kvp_transaction.active) { 596 594 /* ··· 612 606 613 607 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { 614 608 /* 615 - * We start with win8 version and if the host cannot 616 - * support that we use the previous version. 609 + * Based on the host, select appropriate 610 + * framework and service versions we will 611 + * negotiate. 617 612 */ 618 - if (vmbus_prep_negotiate_resp(icmsghdrp, negop, 619 - recv_buffer, UTIL_FW_MAJOR_MINOR, 620 - WIN8_SRV_MAJOR_MINOR)) 621 - goto done; 622 - 613 + switch (vmbus_proto_version) { 614 + case (VERSION_WS2008): 615 + util_fw_version = UTIL_WS2K8_FW_VERSION; 616 + kvp_srv_version = WS2008_SRV_VERSION; 617 + break; 618 + case (VERSION_WIN7): 619 + util_fw_version = UTIL_FW_VERSION; 620 + kvp_srv_version = WIN7_SRV_VERSION; 621 + break; 622 + default: 623 + util_fw_version = UTIL_FW_VERSION; 624 + kvp_srv_version = WIN8_SRV_VERSION; 625 + } 623 626 vmbus_prep_negotiate_resp(icmsghdrp, negop, 624 - recv_buffer, UTIL_FW_MAJOR_MINOR, 625 - WIN7_SRV_MAJOR_MINOR); 627 + recv_buffer, util_fw_version, 628 + kvp_srv_version); 626 629 627 630 } else { 628 631 kvp_msg = (struct hv_kvp_msg *)&recv_buffer[ ··· 664 649 return; 665 650 666 651 } 667 - done: 668 652 669 653 icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION 670 654 | ICMSGHDRFLAG_RESPONSE;
+3 -3
drivers/hv/hv_snapshot.c
··· 26 26 27 27 #define VSS_MAJOR 5 28 28 #define VSS_MINOR 0 29 - #define VSS_MAJOR_MINOR (VSS_MAJOR << 16 | VSS_MINOR) 29 + #define VSS_VERSION (VSS_MAJOR << 16 | VSS_MINOR) 30 30 31 31 32 32 ··· 190 190 191 191 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { 192 192 vmbus_prep_negotiate_resp(icmsghdrp, negop, 193 - recv_buffer, UTIL_FW_MAJOR_MINOR, 194 - VSS_MAJOR_MINOR); 193 + recv_buffer, UTIL_FW_VERSION, 194 + VSS_VERSION); 195 195 } else { 196 196 vss_msg = (struct hv_vss_msg *)&recv_buffer[ 197 197 sizeof(struct vmbuspipe_hdr) +
+54 -17
drivers/hv/hv_util.c
··· 28 28 #include <linux/reboot.h> 29 29 #include <linux/hyperv.h> 30 30 31 - #define SHUTDOWN_MAJOR 3 32 - #define SHUTDOWN_MINOR 0 33 - #define SHUTDOWN_MAJOR_MINOR (SHUTDOWN_MAJOR << 16 | SHUTDOWN_MINOR) 34 31 35 - #define TIMESYNCH_MAJOR 3 36 - #define TIMESYNCH_MINOR 0 37 - #define TIMESYNCH_MAJOR_MINOR (TIMESYNCH_MAJOR << 16 | TIMESYNCH_MINOR) 32 + #define SD_MAJOR 3 33 + #define SD_MINOR 0 34 + #define SD_VERSION (SD_MAJOR << 16 | SD_MINOR) 38 35 39 - #define HEARTBEAT_MAJOR 3 40 - #define HEARTBEAT_MINOR 0 41 - #define HEARTBEAT_MAJOR_MINOR (HEARTBEAT_MAJOR << 16 | HEARTBEAT_MINOR) 36 + #define SD_WS2008_MAJOR 1 37 + #define SD_WS2008_VERSION (SD_WS2008_MAJOR << 16 | SD_MINOR) 38 + 39 + #define TS_MAJOR 3 40 + #define TS_MINOR 0 41 + #define TS_VERSION (TS_MAJOR << 16 | TS_MINOR) 42 + 43 + #define TS_WS2008_MAJOR 1 44 + #define TS_WS2008_VERSION (TS_WS2008_MAJOR << 16 | TS_MINOR) 45 + 46 + #define HB_MAJOR 3 47 + #define HB_MINOR 0 48 + #define HB_VERSION (HB_MAJOR << 16 | HB_MINOR) 49 + 50 + #define HB_WS2008_MAJOR 1 51 + #define HB_WS2008_VERSION (HB_WS2008_MAJOR << 16 | HB_MINOR) 52 + 53 + static int sd_srv_version; 54 + static int ts_srv_version; 55 + static int hb_srv_version; 56 + static int util_fw_version; 42 57 43 58 static void shutdown_onchannelcallback(void *context); 44 59 static struct hv_util_service util_shutdown = { ··· 114 99 115 100 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { 116 101 vmbus_prep_negotiate_resp(icmsghdrp, negop, 117 - shut_txf_buf, UTIL_FW_MAJOR_MINOR, 118 - SHUTDOWN_MAJOR_MINOR); 102 + shut_txf_buf, util_fw_version, 103 + sd_srv_version); 119 104 } else { 120 105 shutdown_msg = 121 106 (struct shutdown_msg_data *)&shut_txf_buf[ ··· 231 216 struct icmsg_hdr *icmsghdrp; 232 217 struct ictimesync_data *timedatap; 233 218 u8 *time_txf_buf = util_timesynch.recv_buffer; 219 + struct icmsg_negotiate *negop = NULL; 234 220 235 221 vmbus_recvpacket(channel, time_txf_buf, 236 222 PAGE_SIZE, &recvlen, &requestid); ··· 241 225 sizeof(struct vmbuspipe_hdr)]; 242 226 243 227 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { 244 - vmbus_prep_negotiate_resp(icmsghdrp, NULL, time_txf_buf, 245 - UTIL_FW_MAJOR_MINOR, 246 - TIMESYNCH_MAJOR_MINOR); 228 + vmbus_prep_negotiate_resp(icmsghdrp, negop, 229 + time_txf_buf, 230 + util_fw_version, 231 + ts_srv_version); 247 232 } else { 248 233 timedatap = (struct ictimesync_data *)&time_txf_buf[ 249 234 sizeof(struct vmbuspipe_hdr) + ··· 274 257 struct icmsg_hdr *icmsghdrp; 275 258 struct heartbeat_msg_data *heartbeat_msg; 276 259 u8 *hbeat_txf_buf = util_heartbeat.recv_buffer; 260 + struct icmsg_negotiate *negop = NULL; 277 261 278 262 vmbus_recvpacket(channel, hbeat_txf_buf, 279 263 PAGE_SIZE, &recvlen, &requestid); ··· 284 266 sizeof(struct vmbuspipe_hdr)]; 285 267 286 268 if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) { 287 - vmbus_prep_negotiate_resp(icmsghdrp, NULL, 288 - hbeat_txf_buf, UTIL_FW_MAJOR_MINOR, 289 - HEARTBEAT_MAJOR_MINOR); 269 + vmbus_prep_negotiate_resp(icmsghdrp, negop, 270 + hbeat_txf_buf, util_fw_version, 271 + hb_srv_version); 290 272 } else { 291 273 heartbeat_msg = 292 274 (struct heartbeat_msg_data *)&hbeat_txf_buf[ ··· 339 321 goto error; 340 322 341 323 hv_set_drvdata(dev, srv); 324 + /* 325 + * Based on the host; initialize the framework and 326 + * service version numbers we will negotiate. 327 + */ 328 + switch (vmbus_proto_version) { 329 + case (VERSION_WS2008): 330 + util_fw_version = UTIL_WS2K8_FW_VERSION; 331 + sd_srv_version = SD_WS2008_VERSION; 332 + ts_srv_version = TS_WS2008_VERSION; 333 + hb_srv_version = HB_WS2008_VERSION; 334 + break; 335 + 336 + default: 337 + util_fw_version = UTIL_FW_VERSION; 338 + sd_srv_version = SD_VERSION; 339 + ts_srv_version = TS_VERSION; 340 + hb_srv_version = HB_VERSION; 341 + } 342 + 342 343 return 0; 343 344 344 345 error:
+1
drivers/misc/mei/amthif.c
··· 57 57 dev->iamthif_ioctl = false; 58 58 dev->iamthif_state = MEI_IAMTHIF_IDLE; 59 59 dev->iamthif_timer = 0; 60 + dev->iamthif_stall_timer = 0; 60 61 } 61 62 62 63 /**
+4 -1
drivers/misc/mei/bus.c
··· 297 297 298 298 if (cl->reading_state != MEI_READ_COMPLETE && 299 299 !waitqueue_active(&cl->rx_wait)) { 300 + 300 301 mutex_unlock(&dev->device_lock); 301 302 302 303 if (wait_event_interruptible(cl->rx_wait, 303 - (MEI_READ_COMPLETE == cl->reading_state))) { 304 + cl->reading_state == MEI_READ_COMPLETE || 305 + mei_cl_is_transitioning(cl))) { 306 + 304 307 if (signal_pending(current)) 305 308 return -EINTR; 306 309 return -ERESTARTSYS;
+6
drivers/misc/mei/client.h
··· 90 90 cl->dev->dev_state == MEI_DEV_ENABLED && 91 91 cl->state == MEI_FILE_CONNECTED); 92 92 } 93 + static inline bool mei_cl_is_transitioning(struct mei_cl *cl) 94 + { 95 + return (MEI_FILE_INITIALIZING == cl->state || 96 + MEI_FILE_DISCONNECTED == cl->state || 97 + MEI_FILE_DISCONNECTING == cl->state); 98 + } 93 99 94 100 bool mei_cl_is_other_connecting(struct mei_cl *cl); 95 101 int mei_cl_disconnect(struct mei_cl *cl);
+6 -4
drivers/misc/mei/hbm.c
··· 35 35 struct mei_me_client *clients; 36 36 int b; 37 37 38 + dev->me_clients_num = 0; 39 + dev->me_client_presentation_num = 0; 40 + dev->me_client_index = 0; 41 + 38 42 /* count how many ME clients we have */ 39 43 for_each_set_bit(b, dev->me_clients_map, MEI_CLIENTS_MAX) 40 44 dev->me_clients_num++; 41 45 42 - if (dev->me_clients_num <= 0) 46 + if (dev->me_clients_num == 0) 43 47 return; 44 48 45 49 kfree(dev->me_clients); ··· 225 221 struct hbm_props_request *prop_req; 226 222 const size_t len = sizeof(struct hbm_props_request); 227 223 unsigned long next_client_index; 228 - u8 client_num; 224 + unsigned long client_num; 229 225 230 226 231 227 client_num = dev->me_client_presentation_num; ··· 681 677 if (dev->dev_state == MEI_DEV_INIT_CLIENTS && 682 678 dev->hbm_state == MEI_HBM_ENUM_CLIENTS) { 683 679 dev->init_clients_timer = 0; 684 - dev->me_client_presentation_num = 0; 685 - dev->me_client_index = 0; 686 680 mei_hbm_me_cl_allocate(dev); 687 681 dev->hbm_state = MEI_HBM_CLIENT_PROPERTIES; 688 682
+3
drivers/misc/mei/init.c
··· 175 175 memset(&dev->wr_ext_msg, 0, sizeof(dev->wr_ext_msg)); 176 176 } 177 177 178 + /* we're already in reset, cancel the init timer */ 179 + dev->init_clients_timer = 0; 180 + 178 181 dev->me_clients_num = 0; 179 182 dev->rd_msg_hdr = 0; 180 183 dev->wd_pending = false;
+4 -7
drivers/misc/mei/main.c
··· 249 249 mutex_unlock(&dev->device_lock); 250 250 251 251 if (wait_event_interruptible(cl->rx_wait, 252 - (MEI_READ_COMPLETE == cl->reading_state || 253 - MEI_FILE_INITIALIZING == cl->state || 254 - MEI_FILE_DISCONNECTED == cl->state || 255 - MEI_FILE_DISCONNECTING == cl->state))) { 252 + MEI_READ_COMPLETE == cl->reading_state || 253 + mei_cl_is_transitioning(cl))) { 254 + 256 255 if (signal_pending(current)) 257 256 return -EINTR; 258 257 return -ERESTARTSYS; 259 258 } 260 259 261 260 mutex_lock(&dev->device_lock); 262 - if (MEI_FILE_INITIALIZING == cl->state || 263 - MEI_FILE_DISCONNECTED == cl->state || 264 - MEI_FILE_DISCONNECTING == cl->state) { 261 + if (mei_cl_is_transitioning(cl)) { 265 262 rets = -EBUSY; 266 263 goto out; 267 264 }
+3 -3
drivers/misc/mei/mei_dev.h
··· 396 396 struct mei_me_client *me_clients; /* Note: memory has to be allocated */ 397 397 DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX); 398 398 DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX); 399 - u8 me_clients_num; 400 - u8 me_client_presentation_num; 401 - u8 me_client_index; 399 + unsigned long me_clients_num; 400 + unsigned long me_client_presentation_num; 401 + unsigned long me_client_index; 402 402 403 403 struct mei_cl wd_cl; 404 404 enum mei_wd_states wd_state;
+5 -2
include/linux/hyperv.h
··· 30 30 /* 31 31 * Framework version for util services. 32 32 */ 33 + #define UTIL_FW_MINOR 0 34 + 35 + #define UTIL_WS2K8_FW_MAJOR 1 36 + #define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 | UTIL_FW_MINOR) 33 37 34 38 #define UTIL_FW_MAJOR 3 35 - #define UTIL_FW_MINOR 0 36 - #define UTIL_FW_MAJOR_MINOR (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR) 39 + #define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR) 37 40 38 41 39 42 /*