Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp488550yba; Fri, 3 May 2019 05:46:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoLHxrG933Dk8ykLJCzBcx2f7ZW2OisYu6BVFcI/x46PNPlDFYM3GaMDP9FOCSXxYhovoY X-Received: by 2002:a63:4c54:: with SMTP id m20mr1564051pgl.316.1556887585575; Fri, 03 May 2019 05:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556887585; cv=none; d=google.com; s=arc-20160816; b=OmR08EM8xWxbQYHrHCoI18fF5IJVHMTomNGkO2hRb5+AuTsY9ZQJAiBJw3ABNObRq7 5o1gMA9OEmyKry0DXZeQdPcbYQk48WDrB6L7i85oIbyUNxbY/V3ApH8J+6M0i2HumNyb uG2qUMciKlDjsdpiHHa6ImXL5fwlr72hVd5p7nMpZnHp/iZflFQJwoQdb4oSHjsF7VFA 28Wn987vk86764COPtlT/04ZRuvY69fsjvagn4arJRbqFXpozplAtFGiPTcnm2yZhMvF zkm8RCSNg7JAXcMbMRaUeFDSrRNprTg58C9f3xEV0E2psLtVkC6XxsrZsRBwnQ3BWwjH v7Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature; bh=YGu1Y9VezXVMpHUohZOs9+Bd2dI9N9DmPcOF3xiObZc=; b=AybjFUJbE+FZNTZwRab1rvdtYMugTxOInwAri6k6DRfg+gFlxZQhYztCsgi/Lzh44e vVJiEdfBtq7buO3ICYo1EEMaS+wXNaiFP60wy3MfZZBcvUD3Ho6eERHmBf7ir/fk/F+r QGWdgJo1gWzt9/kAxcjS6ZsD2prnpdrXTz0mMadSGPgDi9s0TkoUbpZk5XBDnAcl1Rp9 T55ORVlOAhZ4u4ZJgMEWzNyKv9Y2vtvpIU7v7N5MiTanJmld9QUzh30OGdm8nQlGVEvg vzpGQv3WNAVgrMHEIoTsA2Z5uj3BwZEsxFcQL8kLvWxAOyYZijoUeVkc07zaDVSy+xox ceqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dHc+xc8D; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a73si2042917pfj.174.2019.05.03.05.46.10; Fri, 03 May 2019 05:46:25 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dHc+xc8D; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727402AbfECMFw (ORCPT + 99 others); Fri, 3 May 2019 08:05:52 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37999 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbfECMFw (ORCPT ); Fri, 3 May 2019 08:05:52 -0400 Received: by mail-wr1-f66.google.com with SMTP id k16so7578441wrn.5; Fri, 03 May 2019 05:05:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=YGu1Y9VezXVMpHUohZOs9+Bd2dI9N9DmPcOF3xiObZc=; b=dHc+xc8DYo3RihRctct4xWfaqJ5SiX1ja6MN1EHUcGdv8NLKKo084y9NitaTrPJgYv aAhc+nzQ5ZZWKvAkpv28d6EAduw3v39ezTmTYG/PwQ3UidrlrHS8yr52WR103xl+lxfY YyXTAVmH0V2lfgBbhIqhimNFXV2fMOQr3s5NklwAKZ+0NHpclKF//gDz7h2uYE7a8g8D UJEjKTsLt4q2uzP9/i/RSejAxgqvj2CpFIO2ZejuY2/sZfmbDspQ4oqw2cW/LVRkRvAN QA73UZngNoLmxfu7il/Q30G1JR104TYnxZBZ11sCnK2HEkQk5mjFkgF+I+6aFsPh1Mj0 WIJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=YGu1Y9VezXVMpHUohZOs9+Bd2dI9N9DmPcOF3xiObZc=; b=ta9CWQQ1UmcC8tTC/918C0r7gnw1nnZyvaYuYaxOJ1dT9PVKC+qaFRRCOPuIqnj/oA bJ65cFS3w1A8zu/ld6kEbrIbhxPlTRBIRa16HKp/1pKp4HQsH6m8LWKhvOlvOHE7rGjb pNU6DiVGFUbgBE7PB0fM+PI7+eE6PvNAcOzZ8GqhInubzASGfK3FfYgzq0k9DLIWfRQz NigTyH0HP2K5HFmcjAdcJEqJ7fMy3Si/wImrC+qVq3smuseaMu0AK+HvMNeuyEmhxNdq OZeS73UWnikKl5g3ueSJOCIyrXwxG9/Xwm2sMwQNadKpPIvgGWCiVXQtLjCjQ2AHd0vL orMw== X-Gm-Message-State: APjAAAVD/AgbNj8yFdqyWn1eAE+CCRejD2w0ris2YXJdVE9LDVzEW19c jxxte/BsD1SlHbfDqY/Ujx4= X-Received: by 2002:adf:ee8d:: with SMTP id b13mr2832098wro.219.1556885150671; Fri, 03 May 2019 05:05:50 -0700 (PDT) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id s16sm2232061wrg.71.2019.05.03.05.05.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 05:05:49 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH] dma-buf: add struct dma_buf_attach_info v2 To: Russell King - ARM Linux admin Cc: xen-devel@lists.xenproject.org, devel@driverdev.osuosl.org, linux-tegra@vger.kernel.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, sstabellini@kernel.org, jgross@suse.com, boris.ostrovsky@oracle.com, digetx@gmail.com, gregkh@linuxfoundation.org, arnd@arndb.de, mchehab@kernel.org, kyungmin.park@samsung.com, m.szyprowski@samsung.com, pawel@osciak.com, jonathanh@nvidia.com, thierry.reding@gmail.com, tomi.valkeinen@ti.com, rodrigo.vivi@intel.com, joonas.lahtinen@linux.intel.com, jani.nikula@linux.intel.com, sean@poorly.run, maxime.ripard@bootlin.com, maarten.lankhorst@linux.intel.com, sumit.semwal@linaro.org References: <20190430111002.106168-1-christian.koenig@amd.com> <20190430173127.k5ivpaz6ktbfecgo@shell.armlinux.org.uk> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Fri, 3 May 2019 14:05:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190430173127.k5ivpaz6ktbfecgo@shell.armlinux.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 30.04.19 um 19:31 schrieb Russell King - ARM Linux admin: > On Tue, Apr 30, 2019 at 01:10:02PM +0200, Christian König wrote: >> Add a structure for the parameters of dma_buf_attach, this makes it much easier >> to add new parameters later on. > I don't understand this reasoning. What are the "new parameters" that > are being proposed, and why do we need to put them into memory to pass > them across this interface? > > If the intention is to make it easier to change the interface, passing > parameters in this manner mean that it's easy for the interface to > change and drivers not to notice the changes, since the compiler will > not warn (unless some member of the structure that the driver is using > gets removed, in which case it will error.) > > Additions to the structure will go unnoticed by drivers - what if the > caller is expecting some different kind of behaviour, and the driver > ignores that new addition? Well, exactly that's the intention here: That the drivers using this interface should be able to ignore the new additions for now as long as they are not going to use them. The background is that we have multiple interface changes in the pipeline, and each step requires new optional parameters. > This doesn't seem to me like a good idea. Well, the obvious alternatives are: a) Change all drivers to explicitly provide NULL/0 for the new parameters. b) Use a wrapper, so that the function signature of dma_buf_attach stays the same. Key point here is that I have an invalidation callback change, a P2P patch set and some locking changes which all require adding new parameters or flags. And at each step I would then start to change all drivers, adding some more NULL pointers or flags with 0 default value. I'm actually perfectly fine going down any route, but this just seemed to me simplest and with the least risk of breaking anything. Opinions? Thanks, Christian.