Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3771354ybb; Tue, 31 Mar 2020 11:39:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvRuC6SKN39XbOFcfs/2vCBsfwJmb4rzB+wnI/BQow7nCSqpXTTwH6w8cWJygcuKcz8pYkK X-Received: by 2002:a9d:6c19:: with SMTP id f25mr14455943otq.371.1585679967056; Tue, 31 Mar 2020 11:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585679967; cv=none; d=google.com; s=arc-20160816; b=j2tqq5Vv8o8T5NGleOcYn52YwlAKTLOoyksNqbOkbRzPtMLh5rG04nSfQxFZpoC0qM kznCpKVGqRZsuus2JbWQojcuo8jiilGDW/O0Nw329Mi3OgRmC7x2uTiuc0p8JdMgCDVV i8tAPJgGJ5YiXrYLwh9rxIO0p6CyjU4sXnqxnxrJ1PCj9xJ64s4PlXk8S2R5aFPFChn7 /4qiPAPSbOTODuyN2WzYyOv13SPNoVdADkEhONWtbP6xlio3v7ZV0mn+sjIbwp6a+KHV 4j/W9OEN/DWQNS/vXDpnreZy7N8Fhj+PC/UUfL8v1secmSflrL1Uz/u7Nh+h14hnP9iz 0jyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=A1iR82JLy2QBCOT69varWy2T5A5xF9bW9JJAjBNZYtw=; b=oDlXwhHHXmsAbxEyAMTLe3vNjm6dEvl0LFKC/58gR5y5mKdGVkM1J66LWYVLb3o4u0 E25tLHccTdQOMUhAofgnkytvBa0uilQKpMX3nYPkWFpRweUvdea1YwkbymlWhCc4vSnZ rE8BE9C1uoaqtiLPE+ASo57PwlHg58/LwteqvtqnFRgJOq7FVc/UM2w8TG9urNYSNb9t 7rbbk2o4xhLtwNVjpFQOUNlaUaMVFxKLmtsokmFznberQCYBEj/Rq08cFbZ07rVQayxL cEIgvjivX97RiAgxCfEZQA0F2Gx1TwaflaggeVTWgOg6f7O+8FWVFbbNvymL0oxjfoL5 yNaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AgqKOg0X; 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 l25si8510701otn.206.2020.03.31.11.39.14; Tue, 31 Mar 2020 11:39:27 -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=AgqKOg0X; 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 S1727795AbgCaSiv (ORCPT + 99 others); Tue, 31 Mar 2020 14:38:51 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:44884 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbgCaSiu (ORCPT ); Tue, 31 Mar 2020 14:38:50 -0400 Received: by mail-lf1-f65.google.com with SMTP id j188so18216051lfj.11 for ; Tue, 31 Mar 2020 11:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A1iR82JLy2QBCOT69varWy2T5A5xF9bW9JJAjBNZYtw=; b=AgqKOg0Xlsg+qGXoQ+t9zCBNScJcIVnuGn7QUcnP5aj8K6e742Rcu/EaX9dFEgNWBB vLt6fu6VOygerOifBdA6nnhB4ysDtUoC0P1DJFSqfuuPpywvC25BwJBpffeJCIkJh8dG tLUkc/jZQ3hFDfS/dw7P10lHqjs5yx7744a4h8kR+4682zw7JntAP1hQJza4+5Ku02jb dNvog8Zyo5wsM5AASjRnI3cy5WnI9Gu7ncfLGtjv7HYWKTm2pQkdxBZaLHwLhXV4Ye05 5DmXFtwrhnbuUCpWEJdx7hpJvwEYTEu/5k+jNUlVf3VrzgCLx9kpqwanVLH5BWTzIS1P mdIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A1iR82JLy2QBCOT69varWy2T5A5xF9bW9JJAjBNZYtw=; b=NBWWmu8XaTI6DDdemscOuShL2kR8p0GkBeokIORildsi0xWO2Fk1jzquW/7l8xqOT/ yMPI+IWiiGCtzcLkVbzWk0M4M9SOK9qgAA6kWUkhP334rSGlseYCxE/rk7LjEQ57yP+p w8487VTE4CzgyGWUkcu6XsnMcTbv7rmPILK3z0up4O8C4Kv7rci+q1o6LFMMrv5NtWoV jGSfIfhpqEJZDXEunfUv9h18iW9GIe8zCW0dBdCyR6oBeTRyG+Xch28mM33Lct9xMr/g 7RvxRcK+7703ecAkRUMKG93oa3zTh2Ng6ybZtNxiBQSCx1QYtvW4RcTXCP4tDAeRieNS Cr1A== X-Gm-Message-State: AGi0PuZOo8okFkNZbZzPTY1graJkjqReNruq/YaVF8MFUBQBKQXywVQ2 +zZt+SIlOjkhn0qZN+1oLB6zMQ== X-Received: by 2002:a19:a409:: with SMTP id q9mr12183993lfc.71.1585679928748; Tue, 31 Mar 2020 11:38:48 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id b28sm10331849ljp.90.2020.03.31.11.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 11:38:47 -0700 (PDT) From: Ulf Hansson To: Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Christoph Hellwig , Russell King , Linus Walleij , Robin Murphy , Vinod Koul , Haibo Chen , Ludovic Barre , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 0/2] amba/platform: Initialize dma_parms at the bus level Date: Tue, 31 Mar 2020 20:38:42 +0200 Message-Id: <20200331183844.30488-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's currently the amba/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, this series initializes the dma_parms from the amba/platform bus at the device registration point. This also follows the way the PCI devices are being managed, see pci_device_add(). If it turns out that this is an acceptable solution, we probably also want the changes for stable, but I am not sure if it applies without conflicts. The series is based on v5.6. Kind regards Ulf Hansson Ulf Hansson (2): driver core: platform: Initialize dma_parms for platform devices amba: Initialize dma_parms for amba devices drivers/amba/bus.c | 1 + drivers/base/platform.c | 2 ++ include/linux/amba/bus.h | 1 + include/linux/platform_device.h | 1 + 4 files changed, 5 insertions(+) -- 2.20.1