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
44
55 #include <linux/stddef.h>
66
7+
78 struct device;
89
10+/**
11+ * struct component_ops - callbacks for component drivers
12+ *
13+ * Components are registered with component_add() and unregistered with
14+ * component_del().
15+ */
916 struct 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+ */
1023 int (*bind)(struct device *comp, struct device *master,
1124 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+ */
1232 void (*unbind)(struct device *comp, struct device *master,
1333 void *master_data);
1434 };
1535
1636 int component_add(struct device *, const struct component_ops *);
37+int component_add_typed(struct device *dev, const struct component_ops *ops,
38+ int subcomponent);
1739 void component_del(struct device *, const struct component_ops *);
1840
1941 int 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
2143
2244 struct master;
2345
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+ */
2452 struct 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+ */
2574 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+ */
2682 void (*unbind)(struct device *master);
2783 };
2884
@@ -37,7 +93,27 @@ void component_match_add_release(struct device *master, · 8 unmodified lines
3793 struct component_match **matchptr,
3894 void (*release)(struct device *, void *),
3995 int (*compare)(struct device *, void *), void *compare_data);
96+void component_match_add_typed(struct device *master,
97+ struct component_match **matchptr,
98+ int (*compare_typed)(struct device *, int, void *), void *compare_data);
4099
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+ */
41117 static inline void component_match_add(struct device *master,
42118 struct component_match **matchptr,
43119 int (*compare)(struct device *, void *), void *compare_data)
include/linux/gnss.h+1−0
@@ -22,6 +22,7 @@ enum gnss_type { · 21 unmodified lines
2222 GNSS_TYPE_NMEA = 0,
2323 GNSS_TYPE_SIRF,
2424 GNSS_TYPE_UBX,
25+ GNSS_TYPE_MTK,
2526
2627 GNSS_TYPE_COUNT
2728 };
include/linux/hyperv.h+95−49
@@ -222,8 +222,8 @@ static inline u32 hv_get_avail_to_write_percent( · 221 unmodified lines
222222 * struct contains the fundamental information about an offer.
223223 */
224224 struct vmbus_channel_offer {
225− uuid_le if_type;
226− uuid_le if_instance;
225+ guid_t if_type;
226+ guid_t if_instance;
227227
228228 /*
229229 * These two fields are not currently used.
@@ -614,8 +614,8 @@ struct vmbus_channel_initiate_contact { · 384 unmodified lines
614614 /* Hyper-V socket: guest's connect()-ing to host */
615615 struct vmbus_channel_tl_connect_request {
616616 struct vmbus_channel_message_header header;
617− uuid_le guest_endpoint_id;
618− uuid_le host_service_id;
617+ guid_t guest_endpoint_id;
618+ guid_t host_service_id;
619619 } __packed;
620620
621621 struct vmbus_channel_version_response {
@@ -714,7 +714,7 @@ enum vmbus_device_type { · 92 unmodified lines
714714
715715 struct vmbus_device {
716716 u16 dev_type;
717− uuid_le guid;
717+ guid_t guid;
718718 bool perf_device;
719719 };
720720
@@ -751,6 +751,19 @@ struct vmbus_channel { · 30 unmodified lines
751751 u64 interrupts; /* Host to Guest interrupts */
752752 u64 sig_events; /* Guest to Host events */
753753
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+
754767 /* Channel callback's invoked in softirq context */
755768 struct tasklet_struct callback_event;
756769 void (*onchannel_callback)(void *context);
@@ -903,6 +916,24 @@ struct vmbus_channel { · 146 unmodified lines
903916 * vmbus_connection.work_queue and hang: see vmbus_process_offer().
904917 */
905918 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;
906937 };
907938
908939 static 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
936967 static inline void set_channel_pending_send_size(struct vmbus_channel *c,
937968 u32 size)
938969 {
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+
939985 c->outbound.ring_buffer->pending_send_sz = size;
940986 }
941987
@@ -1096,7 +1142,7 @@ struct hv_driver { · 154 unmodified lines
10961142 bool hvsock;
10971143
10981144 /* the device type supported by this driver */
1099− uuid_le dev_type;
1145+ guid_t dev_type;
11001146 const struct hv_vmbus_device_id *id_table;
11011147
11021148 struct device_driver driver;
@@ -1116,10 +1162,10 @@ struct hv_driver { · 13 unmodified lines
11161162 /* Base device object */
11171163 struct hv_device {
11181164 /* the device type id of this device */
1119− uuid_le dev_type;
1165+ guid_t dev_type;
11201166
11211167 /* the device instance id of this device */
1122− uuid_le dev_instance;
1168+ guid_t dev_instance;
11231169 u16 vendor_id;
11241170 u16 device_id;
11251171
@@ -1188,102 +1234,102 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 62 unmodified lines
11881234 * {f8615163-df3e-46c5-913f-f2d2f965ed0e}
11891235 */
11901236 #define HV_NIC_GUID \
1191− .guid = UUID_LE(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \
1192− 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)
1237+ .guid = GUID_INIT(0xf8615163, 0xdf3e, 0x46c5, 0x91, 0x3f, \
1238+ 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e)
11931239
11941240 /*
11951241 * IDE GUID
11961242 * {32412632-86cb-44a2-9b5c-50d1417354f5}
11971243 */
11981244 #define HV_IDE_GUID \
1199− .guid = UUID_LE(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \
1200− 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
1245+ .guid = GUID_INIT(0x32412632, 0x86cb, 0x44a2, 0x9b, 0x5c, \
1246+ 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
12011247
12021248 /*
12031249 * SCSI GUID
12041250 * {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f}
12051251 */
12061252 #define HV_SCSI_GUID \
1207− .guid = UUID_LE(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \
1208− 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
1253+ .guid = GUID_INIT(0xba6163d9, 0x04a1, 0x4d29, 0xb6, 0x05, \
1254+ 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
12091255
12101256 /*
12111257 * Shutdown GUID
12121258 * {0e0b6031-5213-4934-818b-38d90ced39db}
12131259 */
12141260 #define HV_SHUTDOWN_GUID \
1215− .guid = UUID_LE(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \
1216− 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)
1261+ .guid = GUID_INIT(0x0e0b6031, 0x5213, 0x4934, 0x81, 0x8b, \
1262+ 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb)
12171263
12181264 /*
12191265 * Time Synch GUID
12201266 * {9527E630-D0AE-497b-ADCE-E80AB0175CAF}
12211267 */
12221268 #define HV_TS_GUID \
1223− .guid = UUID_LE(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \
1224− 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
1269+ .guid = GUID_INIT(0x9527e630, 0xd0ae, 0x497b, 0xad, 0xce, \
1270+ 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
12251271
12261272 /*
12271273 * Heartbeat GUID
12281274 * {57164f39-9115-4e78-ab55-382f3bd5422d}
12291275 */
12301276 #define HV_HEART_BEAT_GUID \
1231− .guid = UUID_LE(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \
1232− 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
1277+ .guid = GUID_INIT(0x57164f39, 0x9115, 0x4e78, 0xab, 0x55, \
1278+ 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
12331279
12341280 /*
12351281 * KVP GUID
12361282 * {a9a0f4e7-5a45-4d96-b827-8a841e8c03e6}
12371283 */
12381284 #define HV_KVP_GUID \
1239− .guid = UUID_LE(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \
1240− 0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)
1285+ .guid = GUID_INIT(0xa9a0f4e7, 0x5a45, 0x4d96, 0xb8, 0x27, \
1286+ 0x8a, 0x84, 0x1e, 0x8c, 0x03, 0xe6)
12411287
12421288 /*
12431289 * Dynamic memory GUID
12441290 * {525074dc-8985-46e2-8057-a307dc18a502}
12451291 */
12461292 #define HV_DM_GUID \
1247− .guid = UUID_LE(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \
1248− 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)
1293+ .guid = GUID_INIT(0x525074dc, 0x8985, 0x46e2, 0x80, 0x57, \
1294+ 0xa3, 0x07, 0xdc, 0x18, 0xa5, 0x02)
12491295
12501296 /*
12511297 * Mouse GUID
12521298 * {cfa8b69e-5b4a-4cc0-b98b-8ba1a1f3f95a}
12531299 */
12541300 #define HV_MOUSE_GUID \
1255− .guid = UUID_LE(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \
1256− 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)
1301+ .guid = GUID_INIT(0xcfa8b69e, 0x5b4a, 0x4cc0, 0xb9, 0x8b, \
1302+ 0x8b, 0xa1, 0xa1, 0xf3, 0xf9, 0x5a)
12571303
12581304 /*
12591305 * Keyboard GUID
12601306 * {f912ad6d-2b17-48ea-bd65-f927a61c7684}
12611307 */
12621308 #define HV_KBD_GUID \
1263− .guid = UUID_LE(0xf912ad6d, 0x2b17, 0x48ea, 0xbd, 0x65, \
1264− 0xf9, 0x27, 0xa6, 0x1c, 0x76, 0x84)
1309+ .guid = GUID_INIT(0xf912ad6d, 0x2b17, 0x48ea, 0xbd, 0x65, \
1310+ 0xf9, 0x27, 0xa6, 0x1c, 0x76, 0x84)
12651311
12661312 /*
12671313 * VSS (Backup/Restore) GUID
12681314 */
12691315 #define HV_VSS_GUID \
1270− .guid = UUID_LE(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \
1271− 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)
1316+ .guid = GUID_INIT(0x35fa2e29, 0xea23, 0x4236, 0x96, 0xae, \
1317+ 0x3a, 0x6e, 0xba, 0xcb, 0xa4, 0x40)
12721318 /*
12731319 * Synthetic Video GUID
12741320 * {DA0A7802-E377-4aac-8E77-0558EB1073F8}
12751321 */
12761322 #define HV_SYNTHVID_GUID \
1277− .guid = UUID_LE(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \
1278− 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)
1323+ .guid = GUID_INIT(0xda0a7802, 0xe377, 0x4aac, 0x8e, 0x77, \
1324+ 0x05, 0x58, 0xeb, 0x10, 0x73, 0xf8)
12791325
12801326 /*
12811327 * Synthetic FC GUID
12821328 * {2f9bcc4a-0069-4af3-b76b-6fd0be528cda}
12831329 */
12841330 #define HV_SYNTHFC_GUID \
1285− .guid = UUID_LE(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \
1286− 0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)
1331+ .guid = GUID_INIT(0x2f9bcc4a, 0x0069, 0x4af3, 0xb7, 0x6b, \
1332+ 0x6f, 0xd0, 0xbe, 0x52, 0x8c, 0xda)
12871333
12881334 /*
12891335 * Guest File Copy Service
@@ -1291,16 +1337,16 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 1 unmodified line
12911337 */
12921338
12931339 #define HV_FCOPY_GUID \
1294− .guid = UUID_LE(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \
1295− 0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)
1340+ .guid = GUID_INIT(0x34d14be3, 0xdee4, 0x41c8, 0x9a, 0xe7, \
1341+ 0x6b, 0x17, 0x49, 0x77, 0xc1, 0x92)
12961342
12971343 /*
12981344 * NetworkDirect. This is the guest RDMA service.
12991345 * {8c2eaf3d-32a7-4b09-ab99-bd1f1c86b501}
13001346 */
13011347 #define HV_ND_GUID \
1302− .guid = UUID_LE(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \
1303− 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)
1348+ .guid = GUID_INIT(0x8c2eaf3d, 0x32a7, 0x4b09, 0xab, 0x99, \
1349+ 0xbd, 0x1f, 0x1c, 0x86, 0xb5, 0x01)
13041350
13051351 /*
13061352 * PCI Express Pass Through
@@ -1308,8 +1354,8 @@ void vmbus_free_mmio(resource_size_t start, resource_size_t size); · 1 unmodified line
13081354 */
13091355
13101356 #define HV_PCIE_GUID \
1311− .guid = UUID_LE(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
1312− 0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
1357+ .guid = GUID_INIT(0x44c4f61d, 0x4444, 0x4400, 0x9d, 0x52, \
1358+ 0x80, 0x2e, 0x27, 0xed, 0xe1, 0x9f)
13131359
13141360 /*
13151361 * 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
13211367 */
13221368
13231369 #define HV_AVMA1_GUID \
1324− .guid = UUID_LE(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \
1325− 0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)
1370+ .guid = GUID_INIT(0xf8e65716, 0x3cb3, 0x4a06, 0x9a, 0x60, \
1371+ 0x18, 0x89, 0xc5, 0xcc, 0xca, 0xb5)
13261372
13271373 #define HV_AVMA2_GUID \
1328− .guid = UUID_LE(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \
1329− 0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)
1374+ .guid = GUID_INIT(0x3375baf4, 0x9e15, 0x4b30, 0xb7, 0x65, \
1375+ 0x67, 0xac, 0xb1, 0x0d, 0x60, 0x7b)
13301376
13311377 #define HV_RDV_GUID \
1332− .guid = UUID_LE(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \
1333− 0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)
1378+ .guid = GUID_INIT(0x276aacf4, 0xac15, 0x426c, 0x98, 0xdd, \
1379+ 0x75, 0x21, 0xad, 0x3f, 0x01, 0xfe)
13341380
13351381 /*
13361382 * Common header for Hyper-V ICs
@@ -1432,7 +1478,7 @@ struct ictimesync_ref_data { · 95 unmodified lines
14321478 struct hyperv_service_callback {
14331479 u8 msg_type;
14341480 char *log_msg;
1435− uuid_le data;
1481+ guid_t data;
14361482 struct vmbus_channel *channel;
14371483 void (*callback)(void *context);
14381484 };
@@ -1452,8 +1498,8 @@ void vmbus_setevent(struct vmbus_channel *channel); · 13 unmodified lines
14521498
14531499 extern __u32 vmbus_proto_version;
14541500
1455−int vmbus_send_tl_connect_request(const uuid_le *shv_guest_servie_id,
1456− const uuid_le *shv_host_servie_id);
1501+int vmbus_send_tl_connect_request(const guid_t *shv_guest_servie_id,
1502+ const guid_t *shv_host_servie_id);
14571503 void vmbus_set_event(struct vmbus_channel *channel);
14581504
14591505 /* 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+
14+struct icc_node;
15+struct 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+ */
23+struct icc_onecell_data {
24+ unsigned int num_nodes;
25+ struct icc_node *nodes[];
26+};
27+
28+struct 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+ */
44+struct 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+ */
73+struct 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+
92+struct icc_node *icc_node_create(int id);
93+void icc_node_destroy(int id);
94+int icc_link_create(struct icc_node *node, const int dst_id);
95+int icc_link_destroy(struct icc_node *src, struct icc_node *dst);
96+void icc_node_add(struct icc_node *node, struct icc_provider *provider);
97+void icc_node_del(struct icc_node *node);
98+int icc_provider_add(struct icc_provider *provider);
99+int icc_provider_del(struct icc_provider *provider);
100+
101+#else
102+
103+static inline struct icc_node *icc_node_create(int id)
104+{
105+ return ERR_PTR(-ENOTSUPP);
106+}
107+
108+void icc_node_destroy(int id)
109+{
110+}
111+
112+static inline int icc_link_create(struct icc_node *node, const int dst_id)
113+{
114+ return -ENOTSUPP;
115+}
116+
117+int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
118+{
119+ return -ENOTSUPP;
120+}
121+
122+void icc_node_add(struct icc_node *node, struct icc_provider *provider)
123+{
124+}
125+
126+void icc_node_del(struct icc_node *node)
127+{
128+}
129+
130+static inline int icc_provider_add(struct icc_provider *provider)
131+{
132+ return -ENOTSUPP;
133+}
134+
135+static 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+
23+struct icc_path;
24+struct device;
25+
26+#if IS_ENABLED(CONFIG_INTERCONNECT)
27+
28+struct icc_path *icc_get(struct device *dev, const int src_id,
29+ const int dst_id);
30+struct icc_path *of_icc_get(struct device *dev, const char *name);
31+void icc_put(struct icc_path *path);
32+int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
33+
34+#else
35+
36+static inline struct icc_path *icc_get(struct device *dev, const int src_id,
37+ const int dst_id)
38+{
39+ return NULL;
40+}
41+
42+static inline struct icc_path *of_icc_get(struct device *dev,
43+ const char *name)
44+{
45+ return NULL;
46+}
47+
48+static inline void icc_put(struct icc_path *path)
49+{
50+}
51+
52+static 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
5555 #define writeq_relaxed hi_lo_writeq_relaxed
5656 #endif
5757
58+#ifndef ioread64_hi_lo
59+#define ioread64_hi_lo ioread64_hi_lo
60+static 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
73+static 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
82+static 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
95+static 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+
58122 #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
5555 #define writeq_relaxed lo_hi_writeq_relaxed
5656 #endif
5757
58+#ifndef ioread64_lo_hi
59+#define ioread64_lo_hi ioread64_lo_hi
60+static 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
73+static 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
82+static 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
95+static 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+
58122 #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
5555 void *priv_data;
5656 };
5757
58+#define to_mei_cl_device(d) container_of(d, struct mei_cl_device, dev)
59+
5860 struct mei_cl_driver {
5961 struct device_driver driver;
6062 const char *name;
include/linux/nvram.h+126−7
@@ -2,13 +2,132 @@ · 1 unmodified line
22 #ifndef _LINUX_NVRAM_H
33 #define _LINUX_NVRAM_H
44
5+#include <linux/errno.h>
56 #include <uapi/linux/nvram.h>
67
7−/* __foo is foo without grabbing the rtc_lock - get it yourself */
8−extern unsigned char __nvram_read_byte(int i);
9−extern unsigned char nvram_read_byte(int i);
10−extern void __nvram_write_byte(unsigned char c, int i);
11−extern void nvram_write_byte(unsigned char c, int i);
12−extern int __nvram_check_checksum(void);
13−extern int nvram_check_checksum(void);
8+#ifdef CONFIG_PPC
9+#include <asm/machdep.h>
10+#endif
11+
12+/**
13+ * struct nvram_ops - NVRAM functionality made available to drivers
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+
32+struct 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+
44+extern const struct nvram_ops arch_nvram_ops;
45+
46+static 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+
58+static 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+
70+static 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+
81+static 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+
95+static 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+
109+static 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+
121+static 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+
14133 #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
460460 void *, size_t, int);
461461
462462 /* IEEE1284.3 functions */
463+#define daisy_dev_name "Device ID probe"
463464 extern int parport_daisy_init (struct parport *port);
464465 extern void parport_daisy_fini (struct parport *port);
465466 extern 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
468469 extern void parport_daisy_deselect_all (struct parport *port);
469470 extern int parport_daisy_select (struct parport *port, int daisy, int mode);
470471
472+#ifdef CONFIG_PARPORT_1284
473+extern int daisy_drv_init(void);
474+extern void daisy_drv_exit(void);
475+#else
476+static inline int daisy_drv_init(void)
477+{
478+ return 0;
479+}
480+
481+static inline void daisy_drv_exit(void) {}
482+#endif
483+
471484 /* Lowlevel drivers _can_ call this support function to handle irqs. */
472485 static inline void parport_generic_irq(struct parport *port)
473486 {
include/linux/vmw_vmci_defs.h+5−2
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #define VMCI_CAPS_GUESTCALL 0x2
4646 #define VMCI_CAPS_DATAGRAM 0x4
4747 #define VMCI_CAPS_NOTIFICATIONS 0x8
48+#define VMCI_CAPS_PPN64 0x10
4849
4950 /* Interrupt Cause register bits. */
5051 #define VMCI_ICR_DATAGRAM 0x1
@@ -569,8 +570,10 @@ struct vmci_resource_query_msg { · 518 unmodified lines
569570 */
570571 struct vmci_notify_bm_set_msg {
571572 struct vmci_datagram hdr;
572− u32 bitmap_ppn;
573− u32 _pad;
573+ union {
574+ u32 bitmap_ppn32;
575+ u64 bitmap_ppn64;
576+ };
574577 };
575578
576579 /*

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