]> Git Repo - linux.git/commitdiff
Merge tag 'soc-fsl-next-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/leo...
authorArnd Bergmann <[email protected]>
Thu, 28 May 2020 10:45:25 +0000 (12:45 +0200)
committerArnd Bergmann <[email protected]>
Thu, 28 May 2020 10:45:26 +0000 (12:45 +0200)
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

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
1  2 
drivers/soc/fsl/dpio/dpio-service.c
drivers/soc/fsl/dpio/qbman-portal.c

index bcdcd3e7d7f12571f68ef453eeb12ca438c0c4f2,f1080c7a3fe190f6c6475d1efe4d66b897a2041e..7351f303055063c7a93cd1e1f1e3fb85297c5818
@@@ -58,7 -58,7 +58,7 @@@ static inline struct dpaa2_io *service_
         * If cpu == -1, choose the current cpu, with no guarantees about
         * potentially being migrated away.
         */
-       if (unlikely(cpu < 0))
+       if (cpu < 0)
                cpu = smp_processor_id();
  
        /* If a specific cpu was requested, pick it up immediately */
@@@ -70,6 -70,10 +70,10 @@@ static inline struct dpaa2_io *service_
        if (d)
                return d;
  
+       d = service_select_by_cpu(d, -1);
+       if (d)
+               return d;
        spin_lock(&dpio_list_lock);
        d = list_entry(dpio_list.next, struct dpaa2_io, node);
        list_del(&d->node);
@@@ -478,18 -482,12 +482,18 @@@ int dpaa2_io_service_enqueue_multiple_d
                                const struct dpaa2_fd *fd,
                                int nb)
  {
 -      int i;
 -      struct qbman_eq_desc ed[32];
 +      struct qbman_eq_desc *ed;
 +      int i, ret;
 +
 +      ed = kcalloc(sizeof(struct qbman_eq_desc), 32, GFP_KERNEL);
 +      if (!ed)
 +              return -ENOMEM;
  
        d = service_select(d);
 -      if (!d)
 -              return -ENODEV;
 +      if (!d) {
 +              ret = -ENODEV;
 +              goto out;
 +      }
  
        for (i = 0; i < nb; i++) {
                qbman_eq_desc_clear(&ed[i]);
                qbman_eq_desc_set_fq(&ed[i], fqid[i]);
        }
  
 -      return qbman_swp_enqueue_multiple_desc(d->swp, &ed[0], fd, nb);
 +      ret = qbman_swp_enqueue_multiple_desc(d->swp, &ed[0], fd, nb);
 +out:
 +      kfree(ed);
 +      return ret;
  }
  EXPORT_SYMBOL(dpaa2_io_service_enqueue_multiple_desc_fq);
  
index 804b8ba9bf5c949e9df56aab130e53e2a99f8e94,053086b99e259e209f9a60b836f1281e8d38db74..e2e9fbb58a727192121e00c0f1cd8d954a9496a3
@@@ -572,18 -572,6 +572,6 @@@ void qbman_eq_desc_set_qd(struct qbman_
  #define EQAR_VB(eqar)      ((eqar) & 0x80)
  #define EQAR_SUCCESS(eqar) ((eqar) & 0x100)
  
- static inline void qbman_write_eqcr_am_rt_register(struct qbman_swp *p,
-                                                  u8 idx)
- {
-       if (idx < 16)
-               qbman_write_register(p, QBMAN_CINH_SWP_EQCR_AM_RT + idx * 4,
-                                    QMAN_RT_MODE);
-       else
-               qbman_write_register(p, QBMAN_CINH_SWP_EQCR_AM_RT2 +
-                                    (idx - 16) * 4,
-                                    QMAN_RT_MODE);
- }
  #define QB_RT_BIT ((u32)0x100)
  /**
   * qbman_swp_enqueue_direct() - Issue an enqueue command
@@@ -753,7 -741,7 +741,7 @@@ int qbman_swp_enqueue_multiple_mem_back
        if (!s->eqcr.available) {
                eqcr_ci = s->eqcr.ci;
                p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI_MEMBACK;
 -              s->eqcr.ci = __raw_readl(p) & full_mask;
 +              s->eqcr.ci = *p & full_mask;
                s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
                                        eqcr_ci, s->eqcr.ci);
                if (!s->eqcr.available) {
@@@ -823,6 -811,7 +811,6 @@@ int qbman_swp_enqueue_multiple_desc_dir
        const uint32_t *cl;
        uint32_t eqcr_ci, eqcr_pi, half_mask, full_mask;
        int i, num_enqueued = 0;
 -      uint64_t addr_cena;
  
        half_mask = (s->eqcr.pi_ci_mask>>1);
        full_mask = s->eqcr.pi_ci_mask;
  
        /* Flush all the cacheline without load/store in between */
        eqcr_pi = s->eqcr.pi;
 -      addr_cena = (uint64_t)s->addr_cena;
        for (i = 0; i < num_enqueued; i++)
                eqcr_pi++;
        s->eqcr.pi = eqcr_pi & full_mask;
@@@ -899,7 -889,7 +887,7 @@@ int qbman_swp_enqueue_multiple_desc_mem
        if (!s->eqcr.available) {
                eqcr_ci = s->eqcr.ci;
                p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI_MEMBACK;
 -              s->eqcr.ci = __raw_readl(p) & full_mask;
 +              s->eqcr.ci = *p & full_mask;
                s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
                                        eqcr_ci, s->eqcr.ci);
                if (!s->eqcr.available)
This page took 0.070307 seconds and 4 git commands to generate.