NXP/FSL SoC driver updates for v5.8 DPAA2 DPIO driver - Prefer the CPU affined DPIO QUICC Engine drivers - Replace one-element array and use struct_size() helper Cleanups in various drivers * tag 'soc-fsl-next-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: dpio: Remove unused inline function qbman_write_eqcr_am_rt_register soc: fsl: qe: clean up an indentation issue soc: fsl: dpio: Prefer the CPU affine DPIO soc: fsl: qbman: Remove unused inline function qm_eqcr_get_ci_stashing soc: fsl: qe: Replace one-element array and use struct_size() helper treewide: Replace zero-length array with flexible-array
Unified · Split
| @@ -58,7 +58,7 @@ static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d, · 57 unmodified lines | |||
| 58 | * If cpu == -1, choose the current cpu, with no guarantees about | 58 | * If cpu == -1, choose the current cpu, with no guarantees about |
| 59 | * potentially being migrated away. | 59 | * potentially being migrated away. |
| 60 | */ | 60 | */ |
| 61 | if (unlikely(cpu < 0)) | 61 | if (cpu < 0) |
| 62 | cpu = smp_processor_id(); | 62 | cpu = smp_processor_id(); |
| 63 | 63 | ||
| 64 | /* If a specific cpu was requested, pick it up immediately */ | 64 | /* If a specific cpu was requested, pick it up immediately */ |
| @@ -70,6 +70,10 @@ static inline struct dpaa2_io *service_select(struct dpaa2_io *d) · 5 unmodified lines | |||
| 70 | if (d) | 70 | if (d) |
| 71 | return d; | 71 | return d; |
| 72 | 72 | ||
| 73 | d = service_select_by_cpu(d, -1); | ||
| 74 | if (d) | ||
| 75 | return d; | ||
| 76 | |||
| 73 | spin_lock(&dpio_list_lock); | 77 | spin_lock(&dpio_list_lock); |
| 74 | d = list_entry(dpio_list.next, struct dpaa2_io, node); | 78 | d = list_entry(dpio_list.next, struct dpaa2_io, node); |
| 75 | list_del(&d->node); | 79 | list_del(&d->node); |
| @@ -572,18 +572,6 @@ void qbman_eq_desc_set_qd(struct qbman_eq_desc *d, u32 qdid, · 571 unmodified lines | |||
| 572 | #define EQAR_VB(eqar) ((eqar) & 0x80) | 572 | #define EQAR_VB(eqar) ((eqar) & 0x80) |
| 573 | #define EQAR_SUCCESS(eqar) ((eqar) & 0x100) | 573 | #define EQAR_SUCCESS(eqar) ((eqar) & 0x100) |
| 574 | 574 | ||
| 575 | static inline void qbman_write_eqcr_am_rt_register(struct qbman_swp *p, | ||
| 576 | u8 idx) | ||
| 577 | { | ||
| 578 | if (idx < 16) | ||
| 579 | qbman_write_register(p, QBMAN_CINH_SWP_EQCR_AM_RT + idx * 4, | ||
| 580 | QMAN_RT_MODE); | ||
| 581 | else | ||
| 582 | qbman_write_register(p, QBMAN_CINH_SWP_EQCR_AM_RT2 + | ||
| 583 | (idx - 16) * 4, | ||
| 584 | QMAN_RT_MODE); | ||
| 585 | } | ||
| 586 | |||
| 587 | #define QB_RT_BIT ((u32)0x100) | 575 | #define QB_RT_BIT ((u32)0x100) |
| 588 | /** | 576 | /** |
| 589 | * qbman_swp_enqueue_direct() - Issue an enqueue command | 577 | * qbman_swp_enqueue_direct() - Issue an enqueue command |
| @@ -449,11 +449,6 @@ static inline int qm_eqcr_init(struct qm_portal *portal, · 448 unmodified lines | |||
| 449 | return 0; | 449 | return 0; |
| 450 | } | 450 | } |
| 451 | 451 | ||
| 452 | static inline unsigned int qm_eqcr_get_ci_stashing(struct qm_portal *portal) | ||
| 453 | { | ||
| 454 | return (qm_in(portal, QM_REG_CFG) >> 28) & 0x7; | ||
| 455 | } | ||
| 456 | |||
| 457 | static inline void qm_eqcr_finish(struct qm_portal *portal) | 452 | static inline void qm_eqcr_finish(struct qm_portal *portal) |
| 458 | { | 453 | { |
| 459 | struct qm_eqcr *eqcr = &portal->eqcr; | 454 | struct qm_eqcr *eqcr = &portal->eqcr; |
| @@ -448,7 +448,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware) · 447 unmodified lines | |||
| 448 | unsigned int i; | 448 | unsigned int i; |
| 449 | unsigned int j; | 449 | unsigned int j; |
| 450 | u32 crc; | 450 | u32 crc; |
| 451 | size_t calc_size = sizeof(struct qe_firmware); | 451 | size_t calc_size; |
| 452 | size_t length; | 452 | size_t length; |
| 453 | const struct qe_header *hdr; | 453 | const struct qe_header *hdr; |
| 454 | 454 | ||
| @@ -480,7 +480,7 @@ int qe_upload_firmware(const struct qe_firmware *firmware) · 25 unmodified lines | |||
| 480 | } | 480 | } |
| 481 | 481 | ||
| 482 | /* Validate the length and check if there's a CRC */ | 482 | /* Validate the length and check if there's a CRC */ |
| 483 | calc_size += (firmware->count - 1) * sizeof(struct qe_microcode); | 483 | calc_size = struct_size(firmware, microcode, firmware->count); |
| 484 | 484 | ||
| 485 | for (i = 0; i < firmware->count; i++) | 485 | for (i = 0; i < firmware->count; i++) |
| 486 | /* | 486 | /* |
| @@ -519,7 +519,7 @@ int ucc_set_tdm_rxtx_clk(u32 tdm_num, enum qe_clock clock, · 518 unmodified lines | |||
| 519 | int clock_bits; | 519 | int clock_bits; |
| 520 | u32 shift; | 520 | u32 shift; |
| 521 | struct qe_mux __iomem *qe_mux_reg; | 521 | struct qe_mux __iomem *qe_mux_reg; |
| 522 | __be32 __iomem *cmxs1cr; | 522 | __be32 __iomem *cmxs1cr; |
| 523 | 523 | ||
| 524 | qe_mux_reg = &qe_immr->qmx; | 524 | qe_mux_reg = &qe_immr->qmx; |
| 525 | 525 | ||
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | */ | 27 | */ |
| 28 | struct bcom_bd { | 28 | struct bcom_bd { |
| 29 | u32 status; | 29 | u32 status; |
| 30 | u32 data[0]; /* variable payload size */ | 30 | u32 data[]; /* variable payload size */ |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | /* ======================================================================== */ | 33 | /* ======================================================================== */ |
| @@ -307,7 +307,7 @@ struct qe_firmware { · 306 unmodified lines | |||
| 307 | u8 revision; /* The microcode version revision */ | 307 | u8 revision; /* The microcode version revision */ |
| 308 | u8 padding; /* Reserved, for alignment */ | 308 | u8 padding; /* Reserved, for alignment */ |
| 309 | u8 reserved[4]; /* Reserved, for future expansion */ | 309 | u8 reserved[4]; /* Reserved, for future expansion */ |
| 310 | } __attribute__ ((packed)) microcode[1]; | 310 | } __packed microcode[]; |
| 311 | /* All microcode binaries should be located here */ | 311 | /* All microcode binaries should be located here */ |
| 312 | /* CRC32 should be located here, after the microcode binaries */ | 312 | /* CRC32 should be located here, after the microcode binaries */ |
| 313 | } __attribute__ ((packed)); | 313 | } __attribute__ ((packed)); |