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: 10900653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E98BE922 for ; Mon, 15 Apr 2019 12:15:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0ADA2870D for ; Mon, 15 Apr 2019 12:15:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3B39287FB; Mon, 15 Apr 2019 12:15:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68F252870D for ; Mon, 15 Apr 2019 12:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727501AbfDOMPc (ORCPT ); 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-Google-Smtp-Source: APXvYqxyOesy66KaWP5IzQdijN7MfwXi/pMBporGCAAsQQYxbnf4/O/N5kUUgpF51R3icRYVy6aQ+Q== 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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; }