Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1601736ybb; Thu, 26 Mar 2020 04:02:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvY38zrf7WfTrEA3qJrsQnP9me2cks4uz/uhmTi4HtHGyrrUw3jTxUAGRRgTWFlT6FuIW/F X-Received: by 2002:a4a:3357:: with SMTP id q84mr4665445ooq.69.1585220539250; Thu, 26 Mar 2020 04:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585220539; cv=none; d=google.com; s=arc-20160816; b=OmAIZDoBd5hHc98KQpO4gFHl6U+AOSaYhnIexKu0WJf4/vovTAkU/wB2GzXgR9uzHJ cl0iXTpFQHYKhQ0z+JGFEh0Q1Bwt4l32Pi0tkSqxIUo4+XtPyAKExpcUoGk/sTBTGBWA oRdSfKl3L2nk3BRbIKoyaBxnCIw5q+bL66T8ozwCKQkhBOEStY7l14iLBUEeb9cJD5ES BFW7ax6qmjyGkXVCfKxX0ls2a3x4h5OZmq9NNonqk/bv58mLRMup6u0tuxSk+gTU88Xw iz/SMmpBSp4o0jOe4JfIv1e07E1J8Tr9BRtveB/ub1Bo7sLtlkw27uQo1ChOkWOig2wz u6AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AdGN3xaLWLh2g9ItHfw0n6XCBLId+VTX6q4Rvqq4Sjk=; b=QGNtIZd/CIuu7YHE4Jomlcn4hMr9dmB7jYQWbPgVp9HMiRXH+Vx4KPXGGJIjrFKYKL SvPi0forHGIHG3u18zKvWgNfK/Fm8IGhsTTchGGHxbP4ZfKTv03j3VIntpwNj+K6OZKp Cc5K2VG/NtTKsAQuLeBMs96Yj2NB3dggBtqTRxm3budmXR1AFegjXYUWNn7r75484CEr u3A2w2qTts64459ViNvMwHfPK3/yZuF0DO80qL7ge6rwhYF5cIhvW0qer59NbDa/bhHW VakEn1tMW84d5ZzMNqtI/hocCfMQ2zA6YqRgl6lhyDvHLxTX2AwojGVfDWvjmR/K8Q6Q MWdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hno7tLQK; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si925986oie.242.2020.03.26.04.02.05; Thu, 26 Mar 2020 04:02:19 -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=@linaro.org header.s=google header.b=Hno7tLQK; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727983AbgCZLBn (ORCPT + 99 others); Thu, 26 Mar 2020 07:01:43 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:41559 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727928AbgCZLBn (ORCPT ); Thu, 26 Mar 2020 07:01:43 -0400 Received: by mail-lf1-f67.google.com with SMTP id z23so4425496lfh.8 for ; Thu, 26 Mar 2020 04:01:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AdGN3xaLWLh2g9ItHfw0n6XCBLId+VTX6q4Rvqq4Sjk=; b=Hno7tLQKINqDFQBKig6K/4mPno/jREl+dokP2yCVBvAEiJHXxSOaziAirLO3YLxDGx ZwlByCcWt6aUrqPFwjzYbiq7GeVcUS+Us7HOXnvwSqzIenXVhw8Kef1eZEfJu/WG5IUp RO2BgAdyQvvhpoTdTXMmbhQ7DjEuUEifYDigfsRht0Pop91Xk2wmZVU39hD4NQdLs0u0 cyBjrD6Oj0bhkkUUtKvFuLutMJO7iZm9vHQoiMRq+sMGoD3i4Fl4YfGPaCoNrGoFkUGP uHcKj7BniGoR5cg/CwXxR1auAEEiboE3X4/yj6mccmXVYYfd6iXKNKerEzU24JwVUxSc 1zQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AdGN3xaLWLh2g9ItHfw0n6XCBLId+VTX6q4Rvqq4Sjk=; b=inf8qC2ergLPGwRGnb5XzC4xHaaujEA/5ZDhvL4UyCDeMEocvnbEITrPK+jjMi1P9f jGSINLtHrK8QZzlAoJFiVZWaED+Ig2gB8KM7a2J7YbUdvApodbosLqbsgPfs7jXmxLC/ JRhNKyFWwuVDBiy7bMf5jb+q/w/caxV5qPrRCsZpUIWxRx0T7si3/7FbKJaYSu+A2YgS TLtqsfnn2aKcIpt4o0EV1mWl4WtfTcqQ2OPDMVSRTPb9an0DL6fmLAJ0yEj7NzPEuZ+e 9LO85nTfjVi3pu58cvDo+ud3DbERAWKsO5bmb5FhuVUqJoV/nSSPaNz4Ladlpb/OY80a ha0A== X-Gm-Message-State: ANhLgQ2RiOYQIbSUmK/tTY+SFhKMiiOiqeDRV3YOcfQLSbafWe26R5Fv b8KD+Bgx0JrrYRThMxZhYcqOhCMTredGwNsYy/LGog== X-Received: by 2002:ac2:5f7c:: with SMTP id c28mr5067560lfc.4.1585220499722; Thu, 26 Mar 2020 04:01:39 -0700 (PDT) MIME-Version: 1.0 References: <20200325113407.26996-1-ulf.hansson@linaro.org> <20200325113407.26996-2-ulf.hansson@linaro.org> In-Reply-To: <20200325113407.26996-2-ulf.hansson@linaro.org> From: Linus Walleij Date: Thu, 26 Mar 2020 12:01:28 +0100 Message-ID: Subject: Re: [PATCH 1/2] driver core: platform: Initialize dma_parms for platform devices To: Ulf Hansson Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , "linux-kernel@vger.kernel.org" , Arnd Bergmann , Christoph Hellwig , Russell King , Vinod Koul , Haibo Chen , Ludovic Barre , Linux ARM , dmaengine , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 25, 2020 at 12:34 PM 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: > Signed-off-by: Ulf Hansson This seems in line with what Christoph said. Reviewed-by: Linus Walleij I imagine we can eventually set up more of the DMA config such as segment size based on config from the device tree, but I'm not sure about that yet. Yours, Linus Walleij