History

device: Move MSI related data into a struct

The only unconditional part of MSI data in struct device is the irqdomain pointer. Everything else can be allocated on demand. Create a data structure and move the irqdomain pointer into it. The other MSI specific parts are going to be removed from struct device in later steps.

Thomas Gleixner committed 4 years ago

Commit 34fff621 parent ed1533b7 files · +29 −21Browse files

Showing the changes to include (1 of 7 files). Show all

Unified · Split

include/linux/device.h+14−6
@@ -371,6 +371,16 @@ struct dev_links_info { · 370 unmodified lines
371 enum dl_dev_state status;371 enum dl_dev_state status;
372};372};
373 373
374/**
375 * struct dev_msi_info - Device data related to MSI
376 * @domain: The MSI interrupt domain associated to the device
377 */
378struct dev_msi_info {
379#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
380 struct irq_domain *domain;
381#endif
382};
383
374/**384/**
375 * struct device - The basic device structure385 * struct device - The basic device structure
376 * @parent: The device's "parent" device, the device to which it is attached.386 * @parent: The device's "parent" device, the device to which it is attached.
@@ -407,8 +417,8 @@ struct dev_links_info { · 30 unmodified lines
407 * @em_pd: device's energy model performance domain417 * @em_pd: device's energy model performance domain
408 * @pins: For device pin management.418 * @pins: For device pin management.
409 * See Documentation/driver-api/pin-control.rst for details.419 * See Documentation/driver-api/pin-control.rst for details.
420 * @msi: MSI related data
410 * @msi_list: Hosts MSI descriptors421 * @msi_list: Hosts MSI descriptors
411 * @msi_domain: The generic MSI domain this device is using.
412 * @numa_node: NUMA node this device is close to.422 * @numa_node: NUMA node this device is close to.
413 * @dma_ops: DMA mapping operations for this device.423 * @dma_ops: DMA mapping operations for this device.
414 * @dma_mask: Dma mask (if dma'ble device).424 * @dma_mask: Dma mask (if dma'ble device).
@@ -500,12 +510,10 @@ struct device { · 85 unmodified lines
500 struct em_perf_domain *em_pd;510 struct em_perf_domain *em_pd;
501#endif511#endif
502 512
503#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
504 struct irq_domain *msi_domain;
505#endif
506#ifdef CONFIG_PINCTRL513#ifdef CONFIG_PINCTRL
507 struct dev_pin_info *pins;514 struct dev_pin_info *pins;
508#endif515#endif
516 struct dev_msi_info msi;
509#ifdef CONFIG_GENERIC_MSI_IRQ517#ifdef CONFIG_GENERIC_MSI_IRQ
510 struct list_head msi_list;518 struct list_head msi_list;
511#endif519#endif
@@ -666,7 +674,7 @@ static inline void set_dev_node(struct device *dev, int node) · 154 unmodified lines
666static inline struct irq_domain *dev_get_msi_domain(const struct device *dev)674static inline struct irq_domain *dev_get_msi_domain(const struct device *dev)
667{675{
668#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN676#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
669 return dev->msi_domain;677 return dev->msi.domain;
670#else678#else
671 return NULL;679 return NULL;
672#endif680#endif
@@ -675,7 +683,7 @@ static inline struct irq_domain *dev_get_msi_domain(const struct device *dev) · 2 unmodified lines
675static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d)683static inline void dev_set_msi_domain(struct device *dev, struct irq_domain *d)
676{684{
677#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN685#ifdef CONFIG_GENERIC_MSI_IRQ_DOMAIN
678 dev->msi_domain = d;686 dev->msi.domain = d;
679#endif687#endif
680}688}
681 689

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