Received: by 10.223.185.116 with SMTP id b49csp7389247wrg; Thu, 1 Mar 2018 04:54:32 -0800 (PST) X-Google-Smtp-Source: AG47ELtrbFknwGW4fHHuo4mS5O/Ltf7J5xS0Y/4P3jf9NgxCT2vDEHCLUJKtlVZhtCahBrGWKZsM X-Received: by 2002:a17:902:9a8a:: with SMTP id w10-v6mr1834005plp.201.1519908872784; Thu, 01 Mar 2018 04:54:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519908872; cv=none; d=google.com; s=arc-20160816; b=EhUkwgLg9EFa1+/3b3KC9/1Q9M8R9XR71B0QXXILO19jTKoeOt2vzimMM3goM0jw1E kgajAU/1/aG24iG/iLS4l6V65CfGPZ7Ilp0aImdmeSHko0FyXAFZAkUfhJnTEucKjrTR uxZrHTamF7rxeGogRkEcAob20qkPaX94sOqba5upjdIoEv7Ri8CbOr1dXxvqNCt2t4aC HdSiRFsWYwyTkNZJxo71DF0tU1t4mK/cW8ff54lzllLEnCFf0MmgnvZdPvn2GB7AizQ7 b3Upp+uc7DE477AJDQJeg8HZL0dxXs3cUQ6rZ0pa+i/7rlOEDHKfxGE0SS1iavMIMGxy aN9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=utLzQaFDw8DkZho4qoxVWMXDvI5bXZ7JWkx1fIwyWPU=; b=a7LEBgGbyS2GuCZr0wJ3M3x5/E8nIKJ7r52Ij/IC/aZxEVE4MNMSRLBZOnXcM0IyeA Fb0wQSemmYiaF+A0tBU380Xo83B3JzYrL2ViDpyxt3fb8muCWPndhZqhhm+G+D1/7dkD Ukjo2ej3lWp1J9syS6J6RjYhWfWYooB1F46Qj11br4nm99Fte66l4w+QlU+5M5gSN9n8 Pv0K5GMoMZ2qrR5baB/OcUzaW/uecz4poPYN1OVuxaQoc+Es0uaxAN0U7cCwHJ1oG3dc NTG2M2N6tXte9KRmK/HDaR6yR6vZluIUUmfeqwFzxR1KclChU7wh+PhCWm49uzBbQcSs u88g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si2446536pgs.529.2018.03.01.04.54.17; Thu, 01 Mar 2018 04:54:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030581AbeCAMxF (ORCPT + 99 others); Thu, 1 Mar 2018 07:53:05 -0500 Received: from mga02.intel.com ([134.134.136.20]:26017 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030504AbeCAMxD (ORCPT ); Thu, 1 Mar 2018 07:53:03 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2018 04:53:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,408,1515484800"; d="scan'208";a="179075660" Received: from vkoul-udesk7.iind.intel.com (HELO localhost) ([10.223.84.143]) by orsmga004.jf.intel.com with ESMTP; 01 Mar 2018 04:52:58 -0800 Date: Thu, 1 Mar 2018 18:26:49 +0530 From: Vinod Koul To: Sean Wang Cc: dan.j.williams@intel.com, robh+dt@kernel.org, mark.rutland@arm.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Randy Dunlap , Fengguang Wu , Julia Lawall Subject: Re: [PATCH v5 2/3] dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC Message-ID: <20180301125649.GH15443@localhost> References: <20180301082329.GD15443@localhost> <1519900021.8089.136.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519900021.8089.136.camel@mtkswgap22> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 01, 2018 at 06:27:01PM +0800, Sean Wang wrote: > On Thu, 2018-03-01 at 13:53 +0530, Vinod Koul wrote: > > On Sun, Feb 18, 2018 at 03:08:30AM +0800, sean.wang@mediatek.com wrote: > > > > > @@ -0,0 +1,1054 @@ > > > +// SPDX-License-Identifier: GPL-2.0 > > // Copyright ... > > > > The copyright line needs to follow SPDX tag line > > > > okay, I will make it reorder and be something like that > > // SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (c) 2017-2018 MediaTek Inc. > * Author: Sean Wang > * > * Driver for MediaTek High-Speed DMA Controller > * > */ It needs to be: // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2017-2018 MediaTek Inc. /* * whatever else you want */ The first two lines are in C99 style comment and need to have SPDX tag and Copyright info > the point is I learned from other subsystem makes the driver name be > same with the module name with KBUILD_MODNAME. > > If you really don't like it, I can just change it into > > #define MTK_DMA_DEV "mtk-hsdma" It is used only once, why not use KBUILD_MODNAME directly? > > > > + > > > +#define MTK_HSDMA_USEC_POLL 20 > > > +#define MTK_HSDMA_TIMEOUT_POLL 200000 > > > +#define MTK_HSDMA_DMA_BUSWIDTHS BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) > > > > Undefined buswidth?? ?? > > > +/** > > > + * struct mtk_hsdma_pdesc - This is the struct holding info describing physical > > > + * descriptor (PD) and its placement must be kept at > > > + * 4-bytes alignment in little endian order. > > > + * @desc[1-4]: The control pad used to indicate hardware how to > > > > pls align to 80char or lesser > > > > weird, it seems the line is already with 80 char and pass the > checkpatch.pl. or do I misunderstand something ? Okay please check. With text it helps to wrap before that > > > + /* > > > + * Updating into hardware the pointer of TX ring lets HSDMA to take > > > + * action for those pending PDs. > > > + */ > > > + mtk_dma_write(hsdma, MTK_HSDMA_TX_CPU, ring->cur_tptr); > > > + > > > + spin_unlock_irqrestore(&hsdma->lock, flags); > > > + > > > + return !hvd->len ? 0 : -ENOSPC; > > > > you already wrote and started txn, so why this? > > > > it's possible just partial virtual descriptor fits into hardware and > then return -ENOSPC. And it will start it to complete the remaining part > as soon as possible when some rooms is being freed. Either ways you have issued the descriptor, so you succeed right? > > shouldn't we check if next is in range, we can crash if we get bad value > > from hardware.. > > okay, there are checks for next with ddone bit check and null check in > the corresponding descriptor as the following. what if you get bad next value > > > > + rxd = &pc->ring.rxd[next]; resulting in bad ref here -- ~Vinod