Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp529543ybz; Fri, 24 Apr 2020 04:53:30 -0700 (PDT) X-Google-Smtp-Source: APiQypJsCOM3QUoQRbSRyKsI/XafsC1mkWLhKVkPyvHqiB+B2lfuhACWwWHZGFTGKQRkkuFIgprA X-Received: by 2002:a05:6402:1fc:: with SMTP id i28mr6702946edy.18.1587729210203; Fri, 24 Apr 2020 04:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587729210; cv=none; d=google.com; s=arc-20160816; b=ySgG09Zs0nb4uFJLGQE2XXxtyrpQCYHiWGegKs7TUckh4PAGaGaRQH1hYF0OXntyaD LliuhKh7zD6cgzlqCTtdPLO6URamoRXB0DLk7NFOZoAoJJpkwsjm5+d/6Uin9pZfOmgt 3seiV/20n3qJvzz54YhqP+U58EvKqTwQs4biYk/sycGDPaCCXBZWo8XwzoTL/tdECWRu iPbR1jYz18EQYNDZNm4sG8muQbhOdGxD3w1a+FNyv8q7iu86D1WR9G37Zygn5sYItem2 Jti1AIpXcdTSjjQR+i29g0hRzHATDH+dAQfR1m9sxeKNGqFDbM71igRDlRA+seumORlC RHCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:message-id:date:subject:cc:to :from; bh=xmLspL677jtwNEf2vCuv7BuBeW4aZAaJPeral9pl01k=; b=TJBlSaFBQL2x2bvViAobRSVDqvEQEGt+mgjBk1k4QP44C4LwgugRODh7HHXzuLcX5A 4eD+o81Ao0VoNR2p6WfBRlxI8E2W+nymRqMMgVDz2dWn1w9dW+Qllu1ifeaci3JDbce+ AJDeYfxWDh4KMNnoY73r/p6/9wcvBm9HBwlnxzyIF3D1bgLY3KlGENJkxA9tKJ40Wyb1 mclkJEB+J2645qwcoCRWeTpR+JxCC3HKOhReW2dOgQhudaoJWgi7uUP0I7wxLzgJeHiK vUJR4u24lXgMLz7WydkY/xjZUGbiSRF0/y4qBNoO+Pb4/AqryJ0dIwOhkiF+AZlHut8b ssCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si2931416ejr.449.2020.04.24.04.53.05; Fri, 24 Apr 2020 04:53:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726895AbgDXLvZ (ORCPT + 99 others); Fri, 24 Apr 2020 07:51:25 -0400 Received: from inva020.nxp.com ([92.121.34.13]:34656 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726247AbgDXLvZ (ORCPT ); Fri, 24 Apr 2020 07:51:25 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A27361A03A9; Fri, 24 Apr 2020 13:51:23 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 93DF11A039B; Fri, 24 Apr 2020 13:51:23 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 3540B205C6; Fri, 24 Apr 2020 13:51:23 +0200 (CEST) From: Ioana Ciornei To: leoyang.li@nxp.com Cc: linux-kernel@vger.kernel.org, Roy Pledge , Ioana Ciornei Subject: [PATCH] soc: fsl: dpio: Prefer the CPU affine DPIO Date: Fri, 24 Apr 2020 14:51:12 +0300 Message-Id: <20200424115112.22437-1-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 Reply-to: ioana.ciornei@nxp.com X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roy Pledge Use the cpu affine DPIO unless there isn't one which can happen if less DPIOs than cores are assign to the kernel. Signed-off-by: Roy Pledge Signed-off-by: Ioana Ciornei --- drivers/soc/fsl/dpio/dpio-service.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c index cd4f6410e8c2..f1080c7a3fe1 100644 --- a/drivers/soc/fsl/dpio/dpio-service.c +++ b/drivers/soc/fsl/dpio/dpio-service.c @@ -58,7 +58,7 @@ static inline struct dpaa2_io *service_select_by_cpu(struct dpaa2_io *d, * 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 @@ static inline struct dpaa2_io *service_select(struct dpaa2_io *d) 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); -- 2.17.1