Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3361236pxb; Mon, 17 Jan 2022 18:35:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJw0k9ZiXsD/Rzynx5n66FWIe1I975QajLjSuTIgNOYVuyH2UNbF4Mpwi8GNSz9vOm60i6La X-Received: by 2002:a17:90b:3841:: with SMTP id nl1mr19371620pjb.60.1642473354155; Mon, 17 Jan 2022 18:35:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642473354; cv=none; d=google.com; s=arc-20160816; b=jYVySYPXIDJE03X+DAqHuqwcWE/4NtWEXmhP9+/j7bA/OuH7kO/Nq5N/tC0b4P8lsb Fn6N4mEy1vXdyNyQUuKLib78cF1+0rFUPn4J+sHQEePBfLh75NmrnwMjRXHdiYhC9r7r QA5U5YFO396n99O03WLIUQFoZWoJNP8Xln8aPMyhUuN7Mf1cnqxUEpXNu4Ltg4d9k4e4 MhNWnvaupQgsCXNdxlEW2fy0+sfNAip3wOC6dI03xRiIc7GxvfwLHkYSZv7yoaOh9LeL Dc+Ql0RIUD3Ur8H2fF5NUQP3A8PkCJnO3UIpI2Vpg0/abqW/RDp3hysndvvPS5c48n+e 7ujQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5y8O1ztdEpf6Q5K1EWJl/cnGkg0Yyb3hjgY54wdHbA0=; b=naVI8D9CnFup0iI8Tg0lDNBqSl1Uv0ke8wjyguXjdscbYKez1mWHM6HFhgzoRzzsp9 VtgUDvpTdymwPANlHaYGdksX9KmvP7eN7G53zGxszR0VGCPGbV7OFINorKUwsJJf1uEh D80a7PumEPioqpIC9xQZWjtpOGDRkhik368FAwd0A8sLd1EOpx0b44cyj71hylzEQIKD ZhbriT0MP8+xwq5FUpAkPVONAyfBolQoI6SDZRJYZWlG/Hupe0Iy5K4y2lxPodG4Pc7h NoyK4VO3r+Tfn5MTdffU/qNTiJWYQrtljtsUoMOLLuMXfL0c/nywJv1dTw3v4jJjtbh5 V3BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I3TXrgYd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j70si14091871pge.354.2022.01.17.18.35.42; Mon, 17 Jan 2022 18:35:54 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I3TXrgYd; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240576AbiAQPlI (ORCPT + 99 others); Mon, 17 Jan 2022 10:41:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237263AbiAQPlH (ORCPT ); Mon, 17 Jan 2022 10:41:07 -0500 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A04C06161C; Mon, 17 Jan 2022 07:41:07 -0800 (PST) Received: by mail-lf1-x136.google.com with SMTP id b14so40653208lff.3; Mon, 17 Jan 2022 07:41:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=5y8O1ztdEpf6Q5K1EWJl/cnGkg0Yyb3hjgY54wdHbA0=; b=I3TXrgYdSkMgV6jQBIuL4t/kAnifbPfadKQXpiUEwrrRAxPONrQcLu2JvDUN6i2klu 59mwDxYiJpHqY+At28M2RqrGoGPoBM7YBl3ybzxPupE+Ixm/tAl9qajHJA2zVyTfeed8 HGbm/NV849yHRyOZND8pn8/bAYoQ/gtbYdeIPylKPcelOG6EYS6f2tT1WoU5LYM30rxk F1CPqdocoTn6gd4wtJTO461HV4mTKa7ty7Xku9sqAtX/0TsLpcU+O/12FfKQHqLnGoLm UGlE7WZOWgMDp+4bs+i4Auc5hbCvZuqScLC95bdV+igiloV/cxMjrYVA1mD2JckpjRDt xR/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=5y8O1ztdEpf6Q5K1EWJl/cnGkg0Yyb3hjgY54wdHbA0=; b=CghkiQEGVdEyfpFppOhHrn7UFVVBdstL1wFG38VoTbfChDGgeUJGV2x4miHMe19kGr /sigAJTQ71XPHqJkip/lLQc5MLPlkWqFC2GM4WnFmHEZwgMcuyJwLPIKwwAh1HVE9Ujr Qd4tNwlnb3iBUXtwKsiaysgEU/iFWDJ8xb4Nq7lRLH9KL3GBpG+zkUDq/+Sv7jnl6wtl GPI3PF550RAVY7DMcLfjoKJ47verlbKlY0cbXth6oFYGv5tZ3zbGbZpgbYu5Gcye/GvJ wB1MS942+ptZzXSjKzKLPHzLi74+iBvJyR6wxpc4c1wfUtlEs6adCB4sCdCpZAT1OTAi lEMQ== X-Gm-Message-State: AOAM533nPqBiKUyxF7ZMhvjamxA/RqB1ayEwhuKjq3lxUJqM2F71lSum 8ZdAOr6HKQWeujZ9LiyJAKQ= X-Received: by 2002:a2e:95cf:: with SMTP id y15mr15070933ljh.132.1642434065726; Mon, 17 Jan 2022 07:41:05 -0800 (PST) Received: from [192.168.2.145] (46-138-227-157.dynamic.spd-mgts.ru. [46.138.227.157]) by smtp.googlemail.com with ESMTPSA id w16sm1427526ljh.122.2022.01.17.07.41.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jan 2022 07:41:05 -0800 (PST) Message-ID: <1db14c3d-6a96-96dd-be76-b81b3a48a2b1@gmail.com> Date: Mon, 17 Jan 2022 18:41:04 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v16 2/4] dmaengine: tegra: Add tegra gpcdma driver Content-Language: en-US To: Akhil R , "dan.j.williams@intel.com" , "devicetree@vger.kernel.org" , "dmaengine@vger.kernel.org" , Jonathan Hunter , Krishna Yarlagadda , Laxman Dewangan , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" , "p.zabel@pengutronix.de" , Rajesh Gumasta , "robh+dt@kernel.org" , "thierry.reding@gmail.com" , "vkoul@kernel.org" Cc: Pavan Kunapuli References: <1641830718-23650-1-git-send-email-akhilrajeev@nvidia.com> <1641830718-23650-3-git-send-email-akhilrajeev@nvidia.com> <16c73e83-b990-7d8e-ddfd-7cbbe7e407ea@gmail.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 17.01.2022 10:02, Akhil R пишет: >> 10.01.2022 19:05, Akhil R пишет: >>> +static int tegra_dma_terminate_all(struct dma_chan *dc) >>> +{ >>> + struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); >>> + unsigned long flags; >>> + LIST_HEAD(head); >>> + int err; >>> + >>> + if (tdc->dma_desc) { >> >> Needs locking protection against racing with the interrupt handler. > tegra_dma_stop_client() waits for the in-flight transfer > to complete and prevents any additional transfer to start. > Wouldn't it manage the race? Do you see any potential issue there? You should consider interrupt handler like a process running in a parallel thread. The interrupt handler sets tdc->dma_desc to NULL, hence you'll get NULL dereference in tegra_dma_stop_client().