hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/soc/fsl/qbman/bman.c
....@@ -562,11 +562,9 @@
562562 dev_err(c->dev, "request_irq() failed\n");
563563 goto fail_irq;
564564 }
565
- if (c->cpu != -1 && irq_can_set_affinity(c->irq) &&
566
- irq_set_affinity(c->irq, cpumask_of(c->cpu))) {
567
- dev_err(c->dev, "irq_set_affinity() failed\n");
565
+
566
+ if (dpaa_set_portal_irq_affinity(c->dev, c->irq, c->cpu))
568567 goto fail_affinity;
569
- }
570568
571569 /* Need RCR to be empty before continuing */
572570 ret = bm_rcr_get_fill(p);
....@@ -637,31 +635,32 @@
637635 return 0;
638636 }
639637
640
-static int bm_shutdown_pool(u32 bpid)
638
+int bm_shutdown_pool(u32 bpid)
641639 {
640
+ int err = 0;
642641 struct bm_mc_command *bm_cmd;
643642 union bm_mc_result *bm_res;
644643
644
+
645
+ struct bman_portal *p = get_affine_portal();
645646 while (1) {
646
- struct bman_portal *p = get_affine_portal();
647647 /* Acquire buffers until empty */
648648 bm_cmd = bm_mc_start(&p->p);
649649 bm_cmd->bpid = bpid;
650650 bm_mc_commit(&p->p, BM_MCC_VERB_CMD_ACQUIRE | 1);
651651 if (!bm_mc_result_timeout(&p->p, &bm_res)) {
652
- put_affine_portal();
653652 pr_crit("BMan Acquire Command timedout\n");
654
- return -ETIMEDOUT;
653
+ err = -ETIMEDOUT;
654
+ goto done;
655655 }
656656 if (!(bm_res->verb & BM_MCR_VERB_ACQUIRE_BUFCOUNT)) {
657
- put_affine_portal();
658657 /* Pool is empty */
659
- return 0;
658
+ goto done;
660659 }
661
- put_affine_portal();
662660 }
663
-
664
- return 0;
661
+done:
662
+ put_affine_portal();
663
+ return err;
665664 }
666665
667666 struct gen_pool *bm_bpalloc;