From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4829C5518E for ; Wed, 22 Apr 2020 17:04:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 831D820776 for ; Wed, 22 Apr 2020 17:04:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pGim6eWT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 831D820776 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9QRf8rLrd9ZjMrEF5ruUQmfWfukAcbkrF+FAMtAi3tA=; b=pGim6eWTY0Dr7W nOfduxotwznmHuYoqCeRxgbdcOa2mBE3sLqo7Ged/t9VczDuncA+SXpT6EOFyiDzJknfNm8JXF89q nrvhZV5faApU4DHuo/FxBbtW3P+2CTIESqiouNoOyWgJrsNknYvikX2Tjv5FyLpfYYGFY9300S2py bPrJivQli1O0bt3ag0qCqWGizmdWScZs31yJ0F7x0j9JcFlbXaC1ujtOvsqrJst/yQrw3cizA++4f nmZ4FMKZvZiU3untKvkrZOfMCfu4Zi3stlh8/6A0UH1AGI6ymOvj4ZfS0tKGGzo16yW28C2EZyya6 FD9JEoFie/TYk7sEsOcQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRIn5-00074E-Kt; Wed, 22 Apr 2020 17:04:03 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jRIn1-00071c-Og for linux-arm-kernel@lists.infradead.org; Wed, 22 Apr 2020 17:04:02 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id F271B68C4E; Wed, 22 Apr 2020 19:03:49 +0200 (CEST) Date: Wed, 22 Apr 2020 19:03:49 +0200 From: Christoph Hellwig To: Ulf Hansson Subject: Re: [RESEND PATCH v2 1/2] driver core: platform: Initialize dma_parms for platform devices Message-ID: <20200422170349.GA28781@lst.de> References: <20200422100954.31211-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200422100954.31211-1-ulf.hansson@linaro.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200422_100359_950529_255C4D75 X-CRM114-Status: GOOD ( 13.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , "Rafael J . Wysocki" , Greg Kroah-Hartman , Linus Walleij , Russell King , Haibo Chen , linux-kernel@vger.kernel.org, Vinod Koul , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, stable@vger.kernel.org, Robin Murphy , Christoph Hellwig , Ludovic Barre Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 22, 2020 at 12:09:54PM +0200, Ulf Hansson wrote: > It's currently the platform driver's responsibility to initialize the > pointer, dma_parms, for its corresponding struct device. The benefit with > this approach allows us to avoid the initialization and to not waste memory > for the struct device_dma_parameters, as this can be decided on a case by > case basis. > > However, it has turned out that this approach is not very practical. Not > only does it lead to open coding, but also to real errors. In principle > callers of dma_set_max_seg_size() doesn't check the error code, but just > assumes it succeeds. > > For these reasons, let's do the initialization from the common platform bus > at the device registration point. This also follows the way the PCI devices > are being managed, see pci_device_add(). > > Suggested-by: Christoph Hellwig > Cc: > Tested-by: Haibo Chen > Reviewed-by: Arnd Bergmann > Signed-off-by: Ulf Hansson Looks good, Reviewed-by: Christoph Hellwig _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel