/********************************************************************* * * Filename: parameters.h * Version: 1.0 * Description: A more general way to handle (pi,pl,pv) parameters * Status: Experimental. * Author: Dag Brattli * Created at: Mon Jun 7 08:47:28 1999 * Modified at: Sun Jan 30 14:05:14 2000 * Modified by: Dag Brattli * * Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . * * Michel Dänzer , 10/2001 * - simplify irda_pv_t to avoid endianness issues * ********************************************************************/ #ifndef IRDA_PARAMS_H #define IRDA_PARAMS_H /* * The currently supported types. Beware not to change the sequence since * it a good reason why the sized integers has a value equal to their size */ typedef enum { PV_INTEGER, /* Integer of any (pl) length */ PV_INT_8_BITS, /* Integer of 8 bits in length */ PV_INT_16_BITS, /* Integer of 16 bits in length */ PV_STRING, /* \0 terminated string */ PV_INT_32_BITS, /* Integer of 32 bits in length */ PV_OCT_SEQ, /* Octet sequence */ PV_NO_VALUE /* Does not contain any value (pl=0) */ } PV_TYPE; /* Bit 7 of type field */ #define PV_BIG_ENDIAN 0x80 #define PV_LITTLE_ENDIAN 0x00 #define PV_MASK 0x7f /* To mask away endian bit */ #define PV_PUT 0 #define PV_GET 1 typedef union { char *c; __u32 i; __u32 *ip; } irda_pv_t; typedef struct { __u8 pi; __u8 pl; irda_pv_t pv; } irda_param_t; typedef int (*PI_HANDLER)(void *self, irda_param_t *param, int get); typedef int (*PV_HANDLER)(void *self, __u8 *buf, int len, __u8 pi, PV_TYPE type, PI_HANDLER func); typedef struct { const PI_HANDLER func; /* Handler for this parameter identifier */ PV_TYPE type; /* Data type for this parameter */ } pi_minor_info_t; typedef struct { const pi_minor_info_t *pi_minor_call_table; int len; } pi_major_info_t; typedef struct { const pi_major_info_t *tables; int len; __u8 pi_mask; int pi_major_offset; } pi_param_info_t; int irda_param_pack(__u8 *buf, char *fmt, ...); int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, pi_param_info_t *info); int irda_param_extract_all(void *self, __u8 *buf, int len, pi_param_info_t *info); #define irda_param_insert_byte(buf,pi,pv) irda_param_pack(buf,"bbb",pi,1,pv) #endif /* IRDA_PARAMS_H */ 3.c?id=433e19cf33d34bb6751c874a9c00980552fe508c'>wm8993.c
diff options
context:
space:
mode:
authorDexuan Cui <decui@microsoft.com>2017-01-28 11:46:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-31 10:59:48 +0100
commit433e19cf33d34bb6751c874a9c00980552fe508c (patch)
treece6547ef2987fbb289fa28f03536328a42781651 /sound/soc/codecs/wm8993.c
parent191e885a2e130e639bb0c8ee350d7047294f2ce6 (diff)
Drivers: hv: vmbus: finally fix hv_need_to_signal_on_read()
Commit a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()") added the proper mb(), but removed the test "prev_write_sz < pending_sz" when making the signal decision. As a result, the guest can signal the host unnecessarily, and then the host can throttle the guest because the host thinks the guest is buggy or malicious; finally the user running stress test can perceive intermittent freeze of the guest. This patch brings back the test, and properly handles the in-place consumption APIs used by NetVSC (see get_next_pkt_raw(), put_pkt_raw() and commit_rd_index()). Fixes: a389fcfd2cb5 ("Drivers: hv: vmbus: Fix signaling logic in hv_need_to_signal_on_read()") Signed-off-by: Dexuan Cui <decui@microsoft.com> Reported-by: Rolf Neugebauer <rolf.neugebauer@docker.com> Tested-by: Rolf Neugebauer <rolf.neugebauer@docker.com> Cc: "K. Y. Srinivasan" <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Stephen Hemminger <sthemmin@microsoft.com> Cc: <stable@vger.kernel.org> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/soc/codecs/wm8993.c')