From patchwork Mon Apr 15 12:14:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 162191 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2850216jan; Mon, 15 Apr 2019 05:15:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/yGihbR5zX8ZQN3HKhOfOtCGQR8c1tI6boO5iOZmLSis3uKp8m9yGX2mVGG6DT/ANPjx4 X-Received: by 2002:a63:fc5a:: with SMTP id r26mr66601711pgk.97.1555330533586; Mon, 15 Apr 2019 05:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555330533; cv=none; d=google.com; s=arc-20160816; b=H6A+xJOZU9fHu1S23nfDmIeT1uTPeFhqS2s/eBKLJp4AAsi06orSfk4O1PgYRPDGaC 9I4DlrHF2oIp68a15/1NJpDBnETh02m8MMtU4o+326PysXHc4F971MsB0chw5slZzaYt EYXpBv1AhaLi/kFDLOenp4iZ1b7nc5YtZmfDRT1qLGmwYJ5wlHsC9XeDCJP/KCzJTNut 8yM7ACkqyJRz4lhMEQqew4CoP46VpBDpouq8Q6NQcdKrisWf3+LrKaW8t6W0O/gvntEV eBHuEScaYL3cJSqfsiNdY1HHEK3DeTCN7A3mgDgUK0OQAkKnianSRDpBb5sSmTcEwTWH JxrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=lTV/HwBV1wkVNbsMEdMR98H0jnrUsLsqBHs1N83HCIU=; b=GNMIXsmF9HZVvaOvG8hhlR89YUg1WjDTSGRTrez2lVkUexFhrMkHf411p+zrI2phcz lQ5e0gO4V813u8apiNJ12aPb3tUJQo0N3OJRtERRXOIY5scqwIs9/T6Qs9zRko/BnQqR pMtB0Bp0z1qUT6DkCYP5hkBd2A21Zr6yAXNZ9KBDk4zmwJDm0G4dzALyPSRty3BIU8OP MEvbJTzQIS2JRxM+LG9hvoPy93MuubW0ZcADEaxAnYPeQHtaMFWV3VlZVdJXOBCgiHaq HFas+47xhy6GVnDV8i9kpKlP0XRwX0YE34x3cCRPaV+yI9TTAVP0aVgKX4Y320kxG9tU XMNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=exbKQxTI; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si44875146pgb.435.2019.04.15.05.15.33; Mon, 15 Apr 2019 05:15:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=exbKQxTI; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727501AbfDOMPc (ORCPT + 3 others); Mon, 15 Apr 2019 08:15:32 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:41355 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727483AbfDOMPa (ORCPT ); Mon, 15 Apr 2019 08:15:30 -0400 Received: by mail-pl1-f195.google.com with SMTP id d1so8475091plj.8 for ; Mon, 15 Apr 2019 05:15:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=lTV/HwBV1wkVNbsMEdMR98H0jnrUsLsqBHs1N83HCIU=; b=exbKQxTI4xxMk74weN1pp2wuWgBFrTV9NGMiVFBHcSOizFz6Pm1jJnsGxfzgw6aiZl WTZuVOV27S2Q/kVYJy44QMwfvkZWepHXib3hYamU+tiN/c6VURhf7etsMsdTK1o9qLie yNGlyJ6v2Yz3v1vgXciDRK2F/rULdNOQq6GrSAivnwrVe6HeUA/T6mjfNByP14j6smbK 2Smp0i7gWEX//tj2tce9NLHqnI4U4FGzml63MT5exyr1d8fubsuqsrcHqbQOG7ICSlTP fxw1JPFdDt2h8Rr4kaYNFEzpqeXIRZnuD604uXsMxWfqqzHlCNmLHN8py/gbxBb2OFJQ VTsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=lTV/HwBV1wkVNbsMEdMR98H0jnrUsLsqBHs1N83HCIU=; b=WlfbnzT478xDA3drCWiJaBNc/7uOg5enBHT72fQ6VoYEDL/1mOW6HkNKVud6sFjgUD F3M+tf+VDEE5ldGyZSxrmBjy/cQbLuo41QbPfRD/NVDhNLBPWN3Hgf/ixRka1bS7nfNK 0XLM1HJOMFeqR34rqgdWFunINvlpfxL1520JP+E1z6Q/mmTQ6VVaDnveeR6m/0v/4IxX dKQR29JKMwKYizVu/yZZyhGH45CcC9JnWsPwAFqKWIcwbNxBRmCGZ5renpZB2Sn3tB7O ZQbfbtolKIthwPy9Gf3lWWAQ+SRxFT0qmhjdhnWoYhA2DahG9g6xUDEGNSdOplA7jA7H b3TQ== X-Gm-Message-State: APjAAAWU2dN8PuETGgi/KiCBp+RF4MuXBZUSWB9UWEpnpoiR9teNRsUa dAoumPBdmegWtXCKiPIm3I26Sw== X-Received: by 2002:a17:902:6bc7:: with SMTP id m7mr27139625plt.146.1555330530070; Mon, 15 Apr 2019 05:15:30 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id 6sm64157155pfj.95.2019.04.15.05.15.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Apr 2019 05:15:29 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vkoul@kernel.org Cc: eric.long@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, broonie@kernel.org, baolin.wang@linaro.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] dmaengine: sprd: Add device validation to support multiple controllers Date: Mon, 15 Apr 2019 20:14:58 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org From: Eric Long Since we can support multiple DMA engine controllers, we should add device validation in filter function to check if the correct controller to be requested. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- drivers/dma/sprd-dma.c | 5 +++++ 1 file changed, 5 insertions(+) -- 1.7.9.5 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 0f92e60..9f99d4b 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -1020,8 +1020,13 @@ static void sprd_dma_free_desc(struct virt_dma_desc *vd) static bool sprd_dma_filter_fn(struct dma_chan *chan, void *param) { struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); + struct of_phandle_args *dma_spec = + container_of(param, struct of_phandle_args, args[0]); u32 slave_id = *(u32 *)param; + if (chan->device->dev->of_node != dma_spec->np) + return false; + schan->dev_id = slave_id; return true; }