History

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

Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver patch pull request for 5.1-rc1. The largest thing by far is the new habanalabs driver for their AI accelerator chip. For now it is in the drivers/misc directory but will probably move to a new directory soon along with other drivers of this type. Other than that, just the usual set of individual driver updates and fixes. There's an "odd" merge in here from the DRM tree that they asked me to do as the MEI driver is starting to interact with the i915 driver, and it needed some coordination. All of those patches have been properly acked by the relevant subsystem maintainers. All of these have been in linux-next with no reported issues, most for quite some time" * tag 'char-misc-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (219 commits) habanalabs: adjust Kconfig to fix build errors habanalabs: use %px instead of %p in error print habanalabs: use do_div for 64-bit divisions intel_th: gth: Fix an off-by-one in output unassigning habanalabs: fix little-endian<->cpu conversion warnings habanalabs: use NULL to initialize array of pointers habanalabs: fix little-endian<->cpu conversion warnings habanalabs: soft-reset device if context-switch fails habanalabs: print pointer using %p habanalabs: fix memory leak with CBs with unaligned size habanalabs: return correct error code on MMU mapping failure habanalabs: add comments in uapi/misc/habanalabs.h habanalabs: extend QMAN0 job timeout habanalabs: set DMA0 completion to SOB 1007 habanalabs: fix validation of WREG32 to DMA completion habanalabs: fix mmu cache registers init habanalabs: disable CPU access on timeouts habanalabs: add MMU DRAM default page mapping habanalabs: Dissociate RAZWI info from event types misc/habanalabs: adjust Kconfig to fix build errors ...

Linus Torvalds committed 7 years ago

Commit 45763bf2 parents da2577f 142a0f8315 files · +60732 −1926Browse files

Showing the changes to include/linux (11 of 315 files). Show all

Unified · Split

11 files
  1. include/linux/component.h +76 −0
  2. include/linux/gnss.h +1 −0
  3. include/linux/hyperv.h +95 −49
  4. include/linux/interconnect-provider.h +142 −0
  5. include/linux/interconnect.h +59 −0
  6. include/linux/io-64-nonatomic-hi-lo.h +64 −0
  7. include/linux/io-64-nonatomic-lo-hi.h +64 −0
  8. include/linux/mei_cl_bus.h +2 −0
  9. include/linux/nvram.h +126 −7
  10. include/linux/parport.h +13 −0
  11. include/linux/vmw_vmci_defs.h +5 −2
include/linux/component.h+76−0
@@ -4,16 +4,38 @@ · 3 unmodified lines
4 4
5#include <linux/stddef.h>5#include <linux/stddef.h>
6 6
7
7struct device;8struct device;
8 9
10/**
11 * struct component_ops - callbacks for component drivers
12 *
13 * Components are registered with component_add() and unregistered with
14 * component_del().
15 */
9struct component_ops {16struct component_ops {
17 /**
18 * @bind:
19 *
20 * Called through component_bind_all() when the aggregate driver is
21 * ready to bind the overall driver.
22 */
10 int (*bind)(struct device *comp, struct device *master,23 int (*bind)(struct device *comp, struct device *master,
11 void *master_data);24 void *master_data);
25 /**
26 * @unbind:
27 *
28 * Called through component_unbind_all() when the aggregate driver is
29 * ready to bind the overall driver, or when component_bind_all() fails
30 * part-ways through and needs to unbind some already bound components.
31 */
12 void (*unbind)(struct device *comp, struct device *master,32 void (*unbind)(struct device *comp, struct device *master,
13 void *master_data);33 void *master_data);
14};34};
15 35
16int component_add(struct device *, const struct component_ops *);36int component_add(struct device *, const struct component_ops *);
37int component_add_typed(struct device *dev, const struct component_ops *ops,
38 int subcomponent);
17void component_del(struct device *, const struct component_ops *);39void component_del(struct device *, const struct component_ops *);
18 40
19int component_bind_all(struct device *master, void *master_data);41int component_bind_all(struct device *master, void *master_data);
@@ -21,8 +43,42 @@ void component_unbind_all(struct device *master, void *master_data); · 1 unmodified line
21 43
22struct master;44struct master;
23 45
46/**
47 * struct component_master_ops - callback for the aggregate driver
48 *
49 * Aggregate drivers are registered with component_master_add_with_match() and
50 * unregistered with component_master_del().
51 */
24struct component_master_ops {52struct component_master_ops {
53 /**
54 * @bind:
55 *
56 * Called when all components or the aggregate driver, as specified in
57 * the match list passed to component_master_add_with_match(), are
58 * ready. Usually there are 3 steps to bind an aggregate driver:
59 *
60 * 1. Allocate a structure for the aggregate driver.
61 *
62 * 2. Bind all components to the aggregate driver by calling
63 * component_bind_all() with the aggregate driver structure as opaque
64 * pointer data.
65 *
66 * 3. Register the aggregate driver with the subsystem to publish its
67 * interfaces.
68 *
69 * Note that the lifetime of the aggregate driver does not align with
70 * any of the underlying &struct device instances. Therefore devm cannot
71 * be used and all resources acquired or allocated in this callback must
72 * be explicitly released in the @unbind callback.
73 */
25 int (*bind)(struct device *master);74 int (*bind)(struct device *master);
75 /**
76 * @unbind:
77 *
78 * Called when either the aggregate driver, using
79 * component_master_del(), or one of its components, using
80 * component_del(), is unregistered.
81 */
26 void (*unbind)(struct device *master);82 void (*unbind)(struct device *master);
27};83};
28 84
@@ -37,7 +93,27 @@ void component_match_add_release(struct device *master, · 8 unmodified lines
37 struct component_match **matchptr,93 struct component_match **matchptr,
38 void (*release)(struct device *, void *),94 void (*release)(struct device *, void *),
39 int (*compare)(struct device *, void *), void *compare_data);95 int (*compare)(struct device *, void *), void *compare_data);
96void component_match_add_typed(struct device *master,
97 struct component_match **matchptr,
98 int (*compare_typed)(struct device *, int, void *), void *compare_data);
40 99
100/**
101 * component_match_add - add a compent match
102 * @master: device with the aggregate driver
103 * @matchptr: pointer to the list of component matches
104 * @compare: compare function to match against all components
105 * @compare_data: opaque pointer passed to the @compare function
106 *
107 * Adds a new component match to the list stored in @matchptr, which the @master
108 * aggregate driver needs to function. The list of component matches pointed to
109 * by @matchptr must be initialized to NULL before adding the first match. This
110 * only matches against components added with component_add().
111 *
112 * The allocated match list in @matchptr is automatically released using devm
113 * actions.
114 *
115 * See also component_match_add_release() and component_match_add_typed().
116 */
41static inline void component_match_add(struct device *master,117static inline void component_match_add(struct device *master,
42 struct component_match **matchptr,118 struct component_match **matchptr,
43 int (*compare)(struct device *, void *), void *compare_data)119 int (*compare)(struct device *, void *), void *compare_data)
include/linux/gnss.h+1−0
@@ -22,6 +22,7 @@ enum gnss_type { · 21 unmodified lines
22 GNSS_TYPE_NMEA = 0,22 GNSS_TYPE_NMEA = 0,
23 GNSS_TYPE_SIRF,23 GNSS_TYPE_SIRF,
24 GNSS_TYPE_UBX,24 GNSS_TYPE_UBX,
25 GNSS_TYPE_MTK,
25 26
26 GNSS_TYPE_COUNT27 GNSS_TYPE_COUNT
27};28};
include/linux/hyperv.h+95−49
@@ -222,8 +222,8 @@ static inline u32 hv_get_avail_to_write_percent( · 221 unmodified lines
222 * struct contains the fundamental information about an offer.222 * struct contains the fundamental information about an offer.
223 */223 */
224struct vmbus_channel_offer {224struct vmbus_channel_offer {
225 uuid_le if_type;225 guid_t if_type;
226 uuid_le if_instance;226 guid_t if_instance;
227 227
228 /*228 /*
229 * These two fields are not currently used.229 * These two fields are not currently used.
@@ -614,8 +614,8 @@ struct vmbus_channel_initiate_contact { · 384 unmodified lines
614/* Hyper-V socket: guest's connect()-ing to host */614/* Hyper-V socket: guest's connect()-ing to host */
615struct vmbus_channel_tl_connect_request {615struct vmbus_channel_tl_connect_request {
616 struct vmbus_channel_message_header header;616 struct vmbus_channel_message_header header;
617 uuid_le guest_endpoint_id;617 guid_t guest_endpoint_id;
618 uuid_le host_service_id;618 guid_t host_service_id;
619} __packed;619} __packed;
620 620
621struct vmbus_channel_version_response {621struct vmbus_channel_version_response {
@@ -714,7 +714,7 @@ enum vmbus_device_type { · 92 unmodified lines
714 714
715struct vmbus_device {715struct vmbus_device {
716 u16 dev_type;716 u16 dev_type;
717 uuid_le guid;717 guid_t guid;
718 bool perf_device;718 bool perf_device;
719};719};
720 720
@@ -751,6 +751,19 @@ struct vmbus_channel { · 30 unmodified lines
751 u64 interrupts; /* Host to Guest interrupts */751 u64 interrupts; /* Host to Guest interrupts */
752 u64 sig_events; /* Guest to Host events */752 u64 sig_events; /* Guest to Host events */
753 753
754 /*
755 * Guest to host interrupts caused by the outbound ring buffer changing
756 * from empty to not empty.
757 */
758 u64 intr_out_empty;
759
760 /*
761 * Indicates that a full outbound ring buffer was encountered. The flag
762 * is set to true when a full outbound ring buffer is encountered and
763 * set to false when a write to the outbound ring buffer is completed.
764 */
765 bool out_full_flag;
766
754 /* Channel callback's invoked in softirq context */767 /* Channel callback's invoked in softirq context */
755 struct tasklet_struct callback_event;768 struct tasklet_struct callback_event;
756 void (*onchannel_callback)(void *context);769 void (*onchannel_callback)(void *context);
@@ -903,6 +916,24 @@ struct vmbus_channel { · 146 unmodified lines
903 * vmbus_connection.work_queue and hang: see vmbus_process_offer().916 * vmbus_connection.work_queue and hang: see vmbus_process_offer().
904 */917 */
905 struct work_struct add_channel_work;918 struct work_struct add_channel_work;
919
920 /*
921 * Guest to host interrupts caused by the inbound ring buffer changing
922 * from full to not full while a packet is waiting.
923 */
924 u64 intr_in_full;
925
926 /*
927 * The total number of write operations that encountered a full
928 * outbound ring buffer.
929 */
930 u64 out_full_total;
931
932 /*
933 * The number of write operations that were the first to encounter a
934 * full outbound ring buffer.
935 */
936 u64 out_full_first;
906};937};
907 938
908static inline bool is_hvsock_channel(const struct vmbus_channel *c)939static inline bool is_hvsock_channel(const struct vmbus_channel *c)
@@ -936,6 +967,21 @@ static inline void *get_per_channel_state(struct vmbus_channel *c) · 27 unmodified lines
936static inline void set_channel_pending_send_size(struct vmbus_channel *c,967static inline void set_channel_pending_send_size(struct vmbus_channel *c,
937 u32 size)968 u32 size)
938{969{
970 unsigned long flags;
971
972 if (size) {
973 spin_lock_irqsave(&c->outbound.ring_lock, flags);
974 ++c->out_full_total;
975
976 if (!c->out_full_flag) {
977 ++c->out_full_first;
978 c->out_full_flag = true;
979 }
980 spin_unlock_irqrestore(&c->outbound.ring_lock, flags);
981 } else {
982 c->out_full_flag = false;
983 }
984
939 c->outbound.ring_buffer->pending_send_sz = size;985 c->outbound.ring_buffer->pending_send_sz = size;
940}986}
941 987
@@ -1096,7 +1142,7 @@ struct hv_driver { · 154 unmodified lines
1096 bool hvsock;1142 bool hvsock;
1097 1143
1098 /* the device type supported by this driver */1144 /* the device type supported by this driver */
1099 uuid_le dev_type;1145 guid_t dev_type;
1100 const struct hv_vmbus_device_id *id_table;1146 const struct hv_vmbus_device_id *id_table;
1101 1147
1102 struct device_driver driver;1148 struct device_driver driver;
@@ -1116,10 +1162,10 @@ struct hv_driver { · 13 unmodified lines
1116/* Base device object */1162/* Base device object */
1117struct hv_device {1163struct hv_device {
1118 /* the device type id of this device */1164 /* the device type id of this device */
1119 uuid_le dev_type;1165 guid_t dev_type;
1120 1166
1121 /* the device instance id of this device */1167 /* the device instance id of this device */
1122 uuid_le dev_instance;1168 guid_t dev_instance;
1123 u16 vendor_id;1169 u16 vendor_id;
1124 u16 device_id;1170 u16 device_id;
1125 1171
@@ -1188,102 +1234,102 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 62 unmodified lines
1188 * {f8615163-df3e-46c5-913f-f2d2f965ed0e}1234 * {f8615163-df3e-46c5-913f-f2d2f965ed0e}
1189 */1235 */
1190#define HV_NIC_GUID \1236#define HV_NIC_GUID \
1191 .guid = UUID_LE(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \1237 .guid = GUID_INIT(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \
1192 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)1238 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)
1193 1239
1194/*1240/*
1195 * IDE GUID1241 * IDE GUID
1196 * {32412632-86cb-44a2-9b5c-50d1417354f5}1242 * {32412632-86cb-44a2-9b5c-50d1417354f5}
1197 */1243 */
1198#define HV_IDE_GUID \1244#define HV_IDE_GUID \
1199 .guid = UUID_LE(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \1245 .guid = GUID_INIT(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \
1200 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)1246 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
1201 1247
1202/*1248/*
1203 * SCSI GUID1249 * SCSI GUID
1204 * {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}1250 * {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}
1205 */1251 */
1206#define HV_SCSI_GUID \1252#define HV_SCSI_GUID \
1207 .guid = UUID_LE(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \1253 .guid = GUID_INIT(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \
1208 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)1254 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
1209 1255
1210/*1256/*
1211 * Shutdown GUID1257 * Shutdown GUID
1212 * {0e0b6031-5213-4934-818b-38d90ced39db}1258 * {0e0b6031-5213-4934-818b-38d90ced39db}
1213 */1259 */
1214#define HV_SHUTDOWN_GUID \1260#define HV_SHUTDOWN_GUID \
1215 .guid = UUID_LE(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \1261 .guid = GUID_INIT(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \
1216 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)1262 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)
1217 1263
1218/*1264/*
1219 * Time Synch GUID1265 * Time Synch GUID
1220 * {9527E630-D0AE-497b-ADCE-E80AB0175CAF}1266 * {9527E630-D0AE-497b-ADCE-E80AB0175CAF}
1221 */1267 */
1222#define HV_TS_GUID \1268#define HV_TS_GUID \
1223 .guid = UUID_LE(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \1269 .guid = GUID_INIT(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \
1224 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)1270 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
1225 1271
1226/*1272/*
1227 * Heartbeat GUID1273 * Heartbeat GUID
1228 * {57164f39-9115-4e78-ab55-382f3bd5422d}1274 * {57164f39-9115-4e78-ab55-382f3bd5422d}
1229 */1275 */
1230#define HV_HEART_BEAT_GUID \1276#define HV_HEART_BEAT_GUID \
1231 .guid = UUID_LE(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \1277 .guid = GUID_INIT(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \
1232 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)1278 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
1233 1279
1234/*1280/*
1235 * KVP GUID1281 * KVP GUID
1236 * {a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}1282 * {a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}
1237 */1283 */
1238#define HV_KVP_GUID \1284#define HV_KVP_GUID \
1239 .guid = UUID_LE(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \1285 .guid = GUID_INIT(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \
1240 0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)1286 0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)
1241 1287
1242/*1288/*
1243 * Dynamic memory GUID1289 * Dynamic memory GUID
1244 * {525074dc-8985-46e2-8057-a307dc18a502}1290 * {525074dc-8985-46e2-8057-a307dc18a502}
1245 */1291 */
1246#define HV_DM_GUID \1292#define HV_DM_GUID \
1247 .guid = UUID_LE(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \1293 .guid = GUID_INIT(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \
1248 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)1294 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)
1249 1295
1250/*1296/*
1251 * Mouse GUID1297 * Mouse GUID
1252 * {cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}1298 * {cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}
1253 */1299 */
1254#define HV_MOUSE_GUID \1300#define HV_MOUSE_GUID \
1255 .guid = UUID_LE(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \1301 .guid = GUID_INIT(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \
1256 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)1302 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)
1257 1303
1258/*1304/*
1259 * Keyboard GUID1305 * Keyboard GUID
1260 * {f912ad6d-2b17-48ea-bd65-f927a61c7684}1306 * {f912ad6d-2b17-48ea-bd65-f927a61c7684}
1261 */1307 */
1262#define HV_KBD_GUID \1308#define HV_KBD_GUID \
1263 .guid = UUID_LE(0xf912ad6d, 0x2b17, 0x48ea, 0xbd, 0x65, \1309 .guid = GUID_INIT(0xf912ad6d, 0x2b17, 0x48ea, 0xbd, 0x65, \
1264 0xf9, 0x27, 0xa6, 0x1c, 0x76, 0x84)1310 0xf9, 0x27, 0xa6, 0x1c, 0x76, 0x84)
1265 1311
1266/*1312/*
1267 * VSS (Backup/Restore) GUID1313 * VSS (Backup/Restore) GUID
1268 */1314 */
1269#define HV_VSS_GUID \1315#define HV_VSS_GUID \
1270 .guid = UUID_LE(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \1316 .guid = GUID_INIT(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \
1271 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)1317 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)
1272/*1318/*
1273 * Synthetic Video GUID1319 * Synthetic Video GUID
1274 * {DA0A7802-E377-4aac-8E77-0558EB1073F8}1320 * {DA0A7802-E377-4aac-8E77-0558EB1073F8}
1275 */1321 */
1276#define HV_SYNTHVID_GUID \1322#define HV_SYNTHVID_GUID \
1277 .guid = UUID_LE(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \1323 .guid = GUID_INIT(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \
1278 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)1324 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)
1279 1325
1280/*1326/*
1281 * Synthetic FC GUID1327 * Synthetic FC GUID
1282 * {2f9bcc4a-0069-4af3-b76b-6fd0be528cda}1328 * {2f9bcc4a-0069-4af3-b76b-6fd0be528cda}
1283 */1329 */
1284#define HV_SYNTHFC_GUID \1330#define HV_SYNTHFC_GUID \
1285 .guid = UUID_LE(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \1331 .guid = GUID_INIT(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \
1286 0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)1332 0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)
1287 1333
1288/*1334/*
1289 * Guest File Copy Service1335 * Guest File Copy Service
@@ -1291,16 +1337,16 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 1 unmodified line
1291 */1337 */
1292 1338
1293#define HV_FCOPY_GUID \1339#define HV_FCOPY_GUID \
1294 .guid = UUID_LE(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \1340 .guid = GUID_INIT(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \
1295 0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)1341 0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)
1296 1342
1297/*1343/*
1298 * NetworkDirect. This is the guest RDMA service.1344 * NetworkDirect. This is the guest RDMA service.
1299 * {8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}1345 * {8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}
1300 */1346 */
1301#define HV_ND_GUID \1347#define HV_ND_GUID \
1302 .guid = UUID_LE(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \1348 .guid = GUID_INIT(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \
1303 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)1349 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)
1304 1350
1305/*1351/*
1306 * PCI Express Pass Through1352 * PCI Express Pass Through
@@ -1308,8 +1354,8 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 1 unmodified line
1308 */1354 */
1309 1355
1310#define HV_PCIE_GUID \1356#define HV_PCIE_GUID \
1311 .guid = UUID_LE(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \1357 .guid = GUID_INIT(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
1312 0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)1358 0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
1313 1359
1314/*1360/*
1315 * Linux doesn't support the 3 devices: the first two are for1361 * Linux doesn't support the 3 devices: the first two are for
@@ -1321,16 +1367,16 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 5 unmodified lines
1321 */1367 */
1322 1368
1323#define HV_AVMA1_GUID \1369#define HV_AVMA1_GUID \
1324 .guid = UUID_LE(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \1370 .guid = GUID_INIT(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \
1325 0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)1371 0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)
1326 1372
1327#define HV_AVMA2_GUID \1373#define HV_AVMA2_GUID \
1328 .guid = UUID_LE(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \1374 .guid = GUID_INIT(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \
1329 0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)1375 0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)
1330 1376
1331#define HV_RDV_GUID \1377#define HV_RDV_GUID \
1332 .guid = UUID_LE(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \1378 .guid = GUID_INIT(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \
1333 0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)1379 0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)
1334 1380
1335/*1381/*
1336 * Common header for Hyper-V ICs1382 * Common header for Hyper-V ICs
@@ -1432,7 +1478,7 @@ struct ictimesync_ref_data { · 95 unmodified lines
1432struct hyperv_service_callback {1478struct hyperv_service_callback {
1433 u8 msg_type;1479 u8 msg_type;
1434 char *log_msg;1480 char *log_msg;
1435 uuid_le data;1481 guid_t data;
1436 struct vmbus_channel *channel;1482 struct vmbus_channel *channel;
1437 void (*callback)(void *context);1483 void (*callback)(void *context);
1438};1484};
@@ -1452,8 +1498,8 @@ void vmbus_setevent(struct vmbus_channel *channel); · 13 unmodified lines
1452 1498
1453extern __u32 vmbus_proto_version;1499extern __u32 vmbus_proto_version;
1454 1500
1455int vmbus_send_tl_connect_request(const uuid_le *shv_guest_servie_id,1501int vmbus_send_tl_connect_request(const guid_t *shv_guest_servie_id,
1456 const uuid_le *shv_host_servie_id);1502 const guid_t *shv_host_servie_id);
1457void vmbus_set_event(struct vmbus_channel *channel);1503void vmbus_set_event(struct vmbus_channel *channel);
1458 1504
1459/* Get the start of the ring buffer. */1505/* Get the start of the ring buffer. */
include/linux/interconnect-provider.h+142−0
@@ -0,0 +1,142 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2018, Linaro Ltd.
4 * Author: Georgi Djakov <georgi.djakov@linaro.org>
5 */
6
7#ifndef __LINUX_INTERCONNECT_PROVIDER_H
8#define __LINUX_INTERCONNECT_PROVIDER_H
9
10#include <linux/interconnect.h>
11
12#define icc_units_to_bps(bw) ((bw) * 1000ULL)
13
14struct icc_node;
15struct of_phandle_args;
16
17/**
18 * struct icc_onecell_data - driver data for onecell interconnect providers
19 *
20 * @num_nodes: number of nodes in this device
21 * @nodes: array of pointers to the nodes in this device
22 */
23struct icc_onecell_data {
24 unsigned int num_nodes;
25 struct icc_node *nodes[];
26};
27
28struct icc_node *of_icc_xlate_onecell(struct of_phandle_args *spec,
29 void *data);
30
31/**
32 * struct icc_provider - interconnect provider (controller) entity that might
33 * provide multiple interconnect controls
34 *
35 * @provider_list: list of the registered interconnect providers
36 * @nodes: internal list of the interconnect provider nodes
37 * @set: pointer to device specific set operation function
38 * @aggregate: pointer to device specific aggregate operation function
39 * @xlate: provider-specific callback for mapping nodes from phandle arguments
40 * @dev: the device this interconnect provider belongs to
41 * @users: count of active users
42 * @data: pointer to private data
43 */
44struct icc_provider {
45 struct list_head provider_list;
46 struct list_head nodes;
47 int (*set)(struct icc_node *src, struct icc_node *dst);
48 int (*aggregate)(struct icc_node *node, u32 avg_bw, u32 peak_bw,
49 u32 *agg_avg, u32 *agg_peak);
50 struct icc_node* (*xlate)(struct of_phandle_args *spec, void *data);
51 struct device *dev;
52 int users;
53 void *data;
54};
55
56/**
57 * struct icc_node - entity that is part of the interconnect topology
58 *
59 * @id: platform specific node id
60 * @name: node name used in debugfs
61 * @links: a list of targets pointing to where we can go next when traversing
62 * @num_links: number of links to other interconnect nodes
63 * @provider: points to the interconnect provider of this node
64 * @node_list: the list entry in the parent provider's "nodes" list
65 * @search_list: list used when walking the nodes graph
66 * @reverse: pointer to previous node when walking the nodes graph
67 * @is_traversed: flag that is used when walking the nodes graph
68 * @req_list: a list of QoS constraint requests associated with this node
69 * @avg_bw: aggregated value of average bandwidth requests from all consumers
70 * @peak_bw: aggregated value of peak bandwidth requests from all consumers
71 * @data: pointer to private data
72 */
73struct icc_node {
74 int id;
75 const char *name;
76 struct icc_node **links;
77 size_t num_links;
78
79 struct icc_provider *provider;
80 struct list_head node_list;
81 struct list_head search_list;
82 struct icc_node *reverse;
83 u8 is_traversed:1;
84 struct hlist_head req_list;
85 u32 avg_bw;
86 u32 peak_bw;
87 void *data;
88};
89
90#if IS_ENABLED(CONFIG_INTERCONNECT)
91
92struct icc_node *icc_node_create(int id);
93void icc_node_destroy(int id);
94int icc_link_create(struct icc_node *node, const int dst_id);
95int icc_link_destroy(struct icc_node *src, struct icc_node *dst);
96void icc_node_add(struct icc_node *node, struct icc_provider *provider);
97void icc_node_del(struct icc_node *node);
98int icc_provider_add(struct icc_provider *provider);
99int icc_provider_del(struct icc_provider *provider);
100
101#else
102
103static inline struct icc_node *icc_node_create(int id)
104{
105 return ERR_PTR(-ENOTSUPP);
106}
107
108void icc_node_destroy(int id)
109{
110}
111
112static inline int icc_link_create(struct icc_node *node, const int dst_id)
113{
114 return -ENOTSUPP;
115}
116
117int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
118{
119 return -ENOTSUPP;
120}
121
122void icc_node_add(struct icc_node *node, struct icc_provider *provider)
123{
124}
125
126void icc_node_del(struct icc_node *node)
127{
128}
129
130static inline int icc_provider_add(struct icc_provider *provider)
131{
132 return -ENOTSUPP;
133}
134
135static inline int icc_provider_del(struct icc_provider *provider)
136{
137 return -ENOTSUPP;
138}
139
140#endif /* CONFIG_INTERCONNECT */
141
142#endif /* __LINUX_INTERCONNECT_PROVIDER_H */
include/linux/interconnect.h+59−0
@@ -0,0 +1,59 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2018-2019, Linaro Ltd.
4 * Author: Georgi Djakov <georgi.djakov@linaro.org>
5 */
6
7#ifndef __LINUX_INTERCONNECT_H
8#define __LINUX_INTERCONNECT_H
9
10#include <linux/mutex.h>
11#include <linux/types.h>
12
13/* macros for converting to icc units */
14#define Bps_to_icc(x) ((x) / 1000)
15#define kBps_to_icc(x) (x)
16#define MBps_to_icc(x) ((x) * 1000)
17#define GBps_to_icc(x) ((x) * 1000 * 1000)
18#define bps_to_icc(x) (1)
19#define kbps_to_icc(x) ((x) / 8 + ((x) % 8 ? 1 : 0))
20#define Mbps_to_icc(x) ((x) * 1000 / 8)
21#define Gbps_to_icc(x) ((x) * 1000 * 1000 / 8)
22
23struct icc_path;
24struct device;
25
26#if IS_ENABLED(CONFIG_INTERCONNECT)
27
28struct icc_path *icc_get(struct device *dev, const int src_id,
29 const int dst_id);
30struct icc_path *of_icc_get(struct device *dev, const char *name);
31void icc_put(struct icc_path *path);
32int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
33
34#else
35
36static inline struct icc_path *icc_get(struct device *dev, const int src_id,
37 const int dst_id)
38{
39 return NULL;
40}
41
42static inline struct icc_path *of_icc_get(struct device *dev,
43 const char *name)
44{
45 return NULL;
46}
47
48static inline void icc_put(struct icc_path *path)
49{
50}
51
52static inline int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw)
53{
54 return 0;
55}
56
57#endif /* CONFIG_INTERCONNECT */
58
59#endif /* __LINUX_INTERCONNECT_H */
include/linux/io-64-nonatomic-hi-lo.h+64−0
@@ -55,4 +55,68 @@ static inline void hi_lo_writeq_relaxed(__u64 val, volatile void __iomem *addr) · 54 unmodified lines
55#define writeq_relaxed hi_lo_writeq_relaxed55#define writeq_relaxed hi_lo_writeq_relaxed
56#endif56#endif
57 57
58#ifndef ioread64_hi_lo
59#define ioread64_hi_lo ioread64_hi_lo
60static inline u64 ioread64_hi_lo(void __iomem *addr)
61{
62 u32 low, high;
63
64 high = ioread32(addr + sizeof(u32));
65 low = ioread32(addr);
66
67 return low + ((u64)high << 32);
68}
69#endif
70
71#ifndef iowrite64_hi_lo
72#define iowrite64_hi_lo iowrite64_hi_lo
73static inline void iowrite64_hi_lo(u64 val, void __iomem *addr)
74{
75 iowrite32(val >> 32, addr + sizeof(u32));
76 iowrite32(val, addr);
77}
78#endif
79
80#ifndef ioread64be_hi_lo
81#define ioread64be_hi_lo ioread64be_hi_lo
82static inline u64 ioread64be_hi_lo(void __iomem *addr)
83{
84 u32 low, high;
85
86 high = ioread32be(addr);
87 low = ioread32be(addr + sizeof(u32));
88
89 return low + ((u64)high << 32);
90}
91#endif
92
93#ifndef iowrite64be_hi_lo
94#define iowrite64be_hi_lo iowrite64be_hi_lo
95static inline void iowrite64be_hi_lo(u64 val, void __iomem *addr)
96{
97 iowrite32be(val >> 32, addr);
98 iowrite32be(val, addr + sizeof(u32));
99}
100#endif
101
102#ifndef ioread64
103#define ioread64_is_nonatomic
104#define ioread64 ioread64_hi_lo
105#endif
106
107#ifndef iowrite64
108#define iowrite64_is_nonatomic
109#define iowrite64 iowrite64_hi_lo
110#endif
111
112#ifndef ioread64be
113#define ioread64be_is_nonatomic
114#define ioread64be ioread64be_hi_lo
115#endif
116
117#ifndef iowrite64be
118#define iowrite64be_is_nonatomic
119#define iowrite64be iowrite64be_hi_lo
120#endif
121
58#endif /* _LINUX_IO_64_NONATOMIC_HI_LO_H_ */122#endif /* _LINUX_IO_64_NONATOMIC_HI_LO_H_ */
include/linux/io-64-nonatomic-lo-hi.h+64−0
@@ -55,4 +55,68 @@ static inline void lo_hi_writeq_relaxed(__u64 val, volatile void __iomem *addr) · 54 unmodified lines
55#define writeq_relaxed lo_hi_writeq_relaxed55#define writeq_relaxed lo_hi_writeq_relaxed
56#endif56#endif
57 57
58#ifndef ioread64_lo_hi
59#define ioread64_lo_hi ioread64_lo_hi
60static inline u64 ioread64_lo_hi(void __iomem *addr)
61{
62 u32 low, high;
63
64 low = ioread32(addr);
65 high = ioread32(addr + sizeof(u32));
66
67 return low + ((u64)high << 32);
68}
69#endif
70
71#ifndef iowrite64_lo_hi
72#define iowrite64_lo_hi iowrite64_lo_hi
73static inline void iowrite64_lo_hi(u64 val, void __iomem *addr)
74{
75 iowrite32(val, addr);
76 iowrite32(val >> 32, addr + sizeof(u32));
77}
78#endif
79
80#ifndef ioread64be_lo_hi
81#define ioread64be_lo_hi ioread64be_lo_hi
82static inline u64 ioread64be_lo_hi(void __iomem *addr)
83{
84 u32 low, high;
85
86 low = ioread32be(addr + sizeof(u32));
87 high = ioread32be(addr);
88
89 return low + ((u64)high << 32);
90}
91#endif
92
93#ifndef iowrite64be_lo_hi
94#define iowrite64be_lo_hi iowrite64be_lo_hi
95static inline void iowrite64be_lo_hi(u64 val, void __iomem *addr)
96{
97 iowrite32be(val, addr + sizeof(u32));
98 iowrite32be(val >> 32, addr);
99}
100#endif
101
102#ifndef ioread64
103#define ioread64_is_nonatomic
104#define ioread64 ioread64_lo_hi
105#endif
106
107#ifndef iowrite64
108#define iowrite64_is_nonatomic
109#define iowrite64 iowrite64_lo_hi
110#endif
111
112#ifndef ioread64be
113#define ioread64be_is_nonatomic
114#define ioread64be ioread64be_lo_hi
115#endif
116
117#ifndef iowrite64be
118#define iowrite64be_is_nonatomic
119#define iowrite64be iowrite64be_lo_hi
120#endif
121
58#endif /* _LINUX_IO_64_NONATOMIC_LO_HI_H_ */122#endif /* _LINUX_IO_64_NONATOMIC_LO_HI_H_ */
include/linux/mei_cl_bus.h+2−0
@@ -55,6 +55,8 @@ struct mei_cl_device { · 54 unmodified lines
55 void *priv_data;55 void *priv_data;
56};56};
57 57
58#define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev)
59
58struct mei_cl_driver {60struct mei_cl_driver {
59 struct device_driver driver;61 struct device_driver driver;
60 const char *name;62 const char *name;
include/linux/nvram.h+126−7
@@ -2,13 +2,132 @@ · 1 unmodified line
2#ifndef _LINUX_NVRAM_H2#ifndef _LINUX_NVRAM_H
3#define _LINUX_NVRAM_H3#define _LINUX_NVRAM_H
4 4
5#include <linux/errno.h>
5#include <uapi/linux/nvram.h>6#include <uapi/linux/nvram.h>
6 7
7/* __foo is foo without grabbing the rtc_lock - get it yourself */8#ifdef CONFIG_PPC
8extern unsigned char __nvram_read_byte(int i);9#include <asm/machdep.h>
9extern unsigned char nvram_read_byte(int i);10#endif
10extern void __nvram_write_byte(unsigned char c, int i);11
11extern void nvram_write_byte(unsigned char c, int i);12/**
12extern int __nvram_check_checksum(void);13 * struct nvram_ops - NVRAM functionality made available to drivers
13extern int nvram_check_checksum(void);14 * @read: validate checksum (if any) then load a range of bytes from NVRAM
15 * @write: store a range of bytes to NVRAM then update checksum (if any)
16 * @read_byte: load a single byte from NVRAM
17 * @write_byte: store a single byte to NVRAM
18 * @get_size: return the fixed number of bytes in the NVRAM
19 *
20 * Architectures which provide an nvram ops struct need not implement all
21 * of these methods. If the NVRAM hardware can be accessed only one byte
22 * at a time then it may be sufficient to provide .read_byte and .write_byte.
23 * If the NVRAM has a checksum (and it is to be checked) the .read and
24 * .write methods can be used to implement that efficiently.
25 *
26 * Portable drivers may use the wrapper functions defined here.
27 * The nvram_read() and nvram_write() functions call the .read and .write
28 * methods when available and fall back on the .read_byte and .write_byte
29 * methods otherwise.
30 */
31
32struct nvram_ops {
33 ssize_t (*get_size)(void);
34 unsigned char (*read_byte)(int);
35 void (*write_byte)(unsigned char, int);
36 ssize_t (*read)(char *, size_t, loff_t *);
37 ssize_t (*write)(char *, size_t, loff_t *);
38#if defined(CONFIG_X86) || defined(CONFIG_M68K)
39 long (*initialize)(void);
40 long (*set_checksum)(void);
41#endif
42};
43
44extern const struct nvram_ops arch_nvram_ops;
45
46static inline ssize_t nvram_get_size(void)
47{
48#ifdef CONFIG_PPC
49 if (ppc_md.nvram_size)
50 return ppc_md.nvram_size();
51#else
52 if (arch_nvram_ops.get_size)
53 return arch_nvram_ops.get_size();
54#endif
55 return -ENODEV;
56}
57
58static inline unsigned char nvram_read_byte(int addr)
59{
60#ifdef CONFIG_PPC
61 if (ppc_md.nvram_read_val)
62 return ppc_md.nvram_read_val(addr);
63#else
64 if (arch_nvram_ops.read_byte)
65 return arch_nvram_ops.read_byte(addr);
66#endif
67 return 0xFF;
68}
69
70static inline void nvram_write_byte(unsigned char val, int addr)
71{
72#ifdef CONFIG_PPC
73 if (ppc_md.nvram_write_val)
74 ppc_md.nvram_write_val(addr, val);
75#else
76 if (arch_nvram_ops.write_byte)
77 arch_nvram_ops.write_byte(val, addr);
78#endif
79}
80
81static inline ssize_t nvram_read_bytes(char *buf, size_t count, loff_t *ppos)
82{
83 ssize_t nvram_size = nvram_get_size();
84 loff_t i;
85 char *p = buf;
86
87 if (nvram_size < 0)
88 return nvram_size;
89 for (i = *ppos; count > 0 && i < nvram_size; ++i, ++p, --count)
90 *p = nvram_read_byte(i);
91 *ppos = i;
92 return p - buf;
93}
94
95static inline ssize_t nvram_write_bytes(char *buf, size_t count, loff_t *ppos)
96{
97 ssize_t nvram_size = nvram_get_size();
98 loff_t i;
99 char *p = buf;
100
101 if (nvram_size < 0)
102 return nvram_size;
103 for (i = *ppos; count > 0 && i < nvram_size; ++i, ++p, --count)
104 nvram_write_byte(*p, i);
105 *ppos = i;
106 return p - buf;
107}
108
109static inline ssize_t nvram_read(char *buf, size_t count, loff_t *ppos)
110{
111#ifdef CONFIG_PPC
112 if (ppc_md.nvram_read)
113 return ppc_md.nvram_read(buf, count, ppos);
114#else
115 if (arch_nvram_ops.read)
116 return arch_nvram_ops.read(buf, count, ppos);
117#endif
118 return nvram_read_bytes(buf, count, ppos);
119}
120
121static inline ssize_t nvram_write(char *buf, size_t count, loff_t *ppos)
122{
123#ifdef CONFIG_PPC
124 if (ppc_md.nvram_write)
125 return ppc_md.nvram_write(buf, count, ppos);
126#else
127 if (arch_nvram_ops.write)
128 return arch_nvram_ops.write(buf, count, ppos);
129#endif
130 return nvram_write_bytes(buf, count, ppos);
131}
132
14#endif /* _LINUX_NVRAM_H */133#endif /* _LINUX_NVRAM_H */
include/linux/parport.h+13−0
@@ -460,6 +460,7 @@ extern size_t parport_ieee1284_epp_read_addr (struct parport *, · 459 unmodified lines
460 void *, size_t, int);460 void *, size_t, int);
461 461
462/* IEEE1284.3 functions */462/* IEEE1284.3 functions */
463#define daisy_dev_name "Device ID probe"
463extern int parport_daisy_init (struct parport *port);464extern int parport_daisy_init (struct parport *port);
464extern void parport_daisy_fini (struct parport *port);465extern void parport_daisy_fini (struct parport *port);
465extern struct pardevice *parport_open (int devnum, const char *name);466extern struct pardevice *parport_open (int devnum, const char *name);
@@ -468,6 +469,18 @@ extern ssize_t parport_device_id (int devnum, char *buffer, size_t len); · 2 unmodified lines
468extern void parport_daisy_deselect_all (struct parport *port);469extern void parport_daisy_deselect_all (struct parport *port);
469extern int parport_daisy_select (struct parport *port, int daisy, int mode);470extern int parport_daisy_select (struct parport *port, int daisy, int mode);
470 471
472#ifdef CONFIG_PARPORT_1284
473extern int daisy_drv_init(void);
474extern void daisy_drv_exit(void);
475#else
476static inline int daisy_drv_init(void)
477{
478 return 0;
479}
480
481static inline void daisy_drv_exit(void) {}
482#endif
483
471/* Lowlevel drivers _can_ call this support function to handle irqs. */484/* Lowlevel drivers _can_ call this support function to handle irqs. */
472static inline void parport_generic_irq(struct parport *port)485static inline void parport_generic_irq(struct parport *port)
473{486{
include/linux/vmw_vmci_defs.h+5−2
@@ -45,6 +45,7 @@ · 44 unmodified lines
45#define VMCI_CAPS_GUESTCALL 0x245#define VMCI_CAPS_GUESTCALL 0x2
46#define VMCI_CAPS_DATAGRAM 0x446#define VMCI_CAPS_DATAGRAM 0x4
47#define VMCI_CAPS_NOTIFICATIONS 0x847#define VMCI_CAPS_NOTIFICATIONS 0x8
48#define VMCI_CAPS_PPN64 0x10
48 49
49/* Interrupt Cause register bits. */50/* Interrupt Cause register bits. */
50#define VMCI_ICR_DATAGRAM 0x151#define VMCI_ICR_DATAGRAM 0x1
@@ -569,8 +570,10 @@ struct vmci_resource_query_msg { · 518 unmodified lines
569 */570 */
570struct vmci_notify_bm_set_msg {571struct vmci_notify_bm_set_msg {
571 struct vmci_datagram hdr;572 struct vmci_datagram hdr;
572 u32 bitmap_ppn;573 union {
573 u32 _pad;574 u32 bitmap_ppn32;
575 u64 bitmap_ppn64;
576 };
574};577};
575 578
576/*579/*

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t