Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3101914pxb; Mon, 24 Jan 2022 02:27:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9pFB4koXUdTD/JRK/2IAImaWIKS8t/zk7CBKUNqZH7al8XMYHxmu7kdqFtQ71QcwKkf5h X-Received: by 2002:a17:902:6a82:b0:148:a2e7:fb5c with SMTP id n2-20020a1709026a8200b00148a2e7fb5cmr13899226plk.157.1643020047591; Mon, 24 Jan 2022 02:27:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643020047; cv=none; d=google.com; s=arc-20160816; b=C08o110s8OYXYB7KhlsLJn9Z4z1LYzttLN4I5YaSpFCpEP+wyFOwMQSE49mRWIUeUz HPYQwKid7qNlLdOYnPkCBWE4qDFCrNtv96C26oB4cSt6D+PKzA1cMAsXJt65+nGPo1HE BRPUjiVZSwTbNWimFARAWu/YvjfyOEr+ydUB6Hukt40RmiU6NZASbSHj8+owRcl+rp4D 9BAeJJag3qIYJoyRl0KnGQvtevohwtETjAL0NUMp5JWYa1V9lnp5ZudPqlOUpi1sa8N6 ObIRxabeHuiP7SvQjvfN9PGAuWF6Wn30IVu/AcdK92sywA8s18Ym73ipgzm9SixXkcin 32Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IRh1AwgOyHG95IgZjxN6/tW4IDOYupWAj9NeN/rZ3Ug=; b=1FpCFCj4Y4NvY9UGQuEXxuFbV82Fu24TuEh8shCIFc/IVI/kW1NNsprUScrEg8zqD6 txMZFW5FdOUp8FQDXHSYE2cAPgs9ldpLM8FsPZVIa9dtmkdvtwCn0BSWKzDN66OgcbBM knxLbuS5OvbqleZUW0J3ZSc8l2Cnv1T6VXSVYQzuneD7wro8YD54BffffA9lFaTi41qJ JB42LnGovGnOU38zp7gvpjixW9KdArYwswc4mBWEGsC6PwtQ1YmjAHW4p6khXASt0ImJ vuo2rD0fE6ilLg9ljWuw6MS3K3Ea2fuKtPzXxG0pnAAvAfhqQFPQzyXT90FEaIu6nxUP xRvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R5IMIFv2; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gf11si11642777pjb.71.2022.01.24.02.27.06; Mon, 24 Jan 2022 02:27:27 -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=@linuxfoundation.org header.s=korg header.b=R5IMIFv2; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238556AbiAWQSA (ORCPT + 99 others); Sun, 23 Jan 2022 11:18:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232645AbiAWQR6 (ORCPT ); Sun, 23 Jan 2022 11:17:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB7AFC06173B for ; Sun, 23 Jan 2022 08:17:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6C28960F64 for ; Sun, 23 Jan 2022 16:17:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 572CCC340E8; Sun, 23 Jan 2022 16:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1642954676; bh=8ocM8NfepuzO2PWIYLNWmobi6Q6duWrlTkUf4R4FV0E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R5IMIFv2wv6h4HftGg4BVqs19rrewU+nA7IM/RpiI5vxOe63/QraPYFDMEexMEZyy dzOK9BkLmdthfs3sAj4NVaDmNz6yrQxIGz+MbJbA2yrDQ5tR5T8RMc99fvuKyFMaHE NywGfo+TZf2ii3JzjjKJuckjYMShmPbs4N7xizcU= Date: Sun, 23 Jan 2022 17:17:32 +0100 From: Greg Kroah-Hartman To: Oded Gabbay Cc: Cai Huoqing , Arnd Bergmann , "Linux-Kernel@Vger. Kernel. Org" Subject: Re: [PATCH] habanalabs: Remove unused enum member DMA_SRAM_TO_SRAM Message-ID: References: <20220111114724.7987-1-cai.huoqing@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 23, 2022 at 06:11:54PM +0200, Oded Gabbay wrote: > On Sun, Jan 23, 2022 at 6:08 PM Greg Kroah-Hartman > wrote: > > > > On Sun, Jan 23, 2022 at 06:01:53PM +0200, Oded Gabbay wrote: > > > On Sun, Jan 23, 2022 at 5:04 PM Greg Kroah-Hartman > > > wrote: > > > > > > > > On Sun, Jan 23, 2022 at 04:43:15PM +0200, Oded Gabbay wrote: > > > > > On Tue, Jan 11, 2022 at 1:47 PM Cai Huoqing wrote: > > > > > > > > > > > > The driver don't support the SRAM-to-SRAM translation of DMA, > > > > > > so remove 'DMA_SRAM_TO_SRAM'. > > > > > > > > > > > > Signed-off-by: Cai Huoqing > > > > > > --- > > > > > > drivers/misc/habanalabs/include/goya/goya_packets.h | 1 - > > > > > > 1 file changed, 1 deletion(-) > > > > > > > > > > > > diff --git a/drivers/misc/habanalabs/include/goya/goya_packets.h b/drivers/misc/habanalabs/include/goya/goya_packets.h > > > > > > index ef54bad20509..25fbebdc6143 100644 > > > > > > --- a/drivers/misc/habanalabs/include/goya/goya_packets.h > > > > > > +++ b/drivers/misc/habanalabs/include/goya/goya_packets.h > > > > > > @@ -36,7 +36,6 @@ enum goya_dma_direction { > > > > > > DMA_SRAM_TO_HOST, > > > > > > DMA_DRAM_TO_HOST, > > > > > > DMA_DRAM_TO_DRAM, > > > > > > - DMA_SRAM_TO_SRAM, > > > > > > DMA_ENUM_MAX > > > > > > }; > > > > > > > > > > > > -- > > > > > > 2.25.1 > > > > > > > > > > > > > > > > This is a general spec file in our s/w stack, and therefore a change > > > > > in it in the driver will cause our driver to be out of sync with our > > > > > user-space stack. i.e. the value of DMA_ENUM_MAX will be different in > > > > > the driver and in the user-space stack. I don't know if there will be > > > > > any consequences but I prefer not to risk it. > > > > > > > > If this is synced to userspace, shouldn't it be in a uapi file with a > > > > specific value associated with it? > > > > > > > > thanks, > > > > > > > > greg k-h > > > > > > Yes, it was a mistake from day 1. A mistake we didn't repeat in future ASICs. > > > I take great care of putting anything that is synced between driver > > > and userspace in our uapi file. > > > > > > Having said that, after almost 3 years of having this mistake, I feel > > > it is not too disastrous to leave it as is. > > > Our Goya s/w stack is pretty much stable and I don't want to make > > > changes without good reason. > > > > You should just move this to a uapi file to show that it is something > > that can't be changed. Can't you do that without breaking anything on > > the kernel side? > On the kernel side there isn't any problem with moving it. > What I'm afraid of, is that the userspace will now have a duplicate > definition of this enum. > Both in the original file, which is included in the user space stack > from day 1, and from our uapi file. > In short, I'm afraid of breaking its compilation. > If you think that's acceptable, I don't have a problem moving it. > > > > > Otherwise maintaining this is going to be hard as no one has a clue that > > this is a value that userspace uses. > > I can document it with a BIG comment in the file. > And as I said, Goya s/w stack is pretty much fixed and I don't believe > is going to change anymore. The trick is long-term maintaince for the next 20+ years of this code in the kernel. A huge comment would help, but even better to move this where it needs to go in a uapi file so that it makes it obvious we can not change this. thanks, greg k-h