Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp519444ybb; Wed, 25 Mar 2020 04:35:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vutU3vbCNdIokNrdwDRWM3dtgHtCBGCvgfwoHjduzjYBKOjjq3kHICV0IpbgXVNQ8m8pmZU X-Received: by 2002:a9d:128:: with SMTP id 37mr2053157otu.270.1585136108909; Wed, 25 Mar 2020 04:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585136108; cv=none; d=google.com; s=arc-20160816; b=jnpByKuHBvmLeRtdugttmIFHSAniJZxQTLQDTr1GqUxUK1sVwC3AArmKvkzUWTlmgf 4jkuENazXCUJIU6ZVfK32ZscPQ2oADERdY4VDq8/1dUeuWzeiz+LPAbQG8Fa+Kn7Glku 5k1C+/qTxuH1Fnu+RL1rlaBY28/6+A/3z8p/k3ysXhLKn1+VsuKWyQR5oTuXn+Hb/2oF bTZ6g13LM8so0cBi5jgVeJFsgN7dtbTfC8xOUKdrJaKH6/rSlzbOp4hjGULwIHFJTCxS dP3TT7sWtXIZYi8OFAeAEIXB98ojE1Ur6gtuRjW4um+mZeOf5nqvRMjk1lRJvBIZnuO9 GIYA== 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=GygzIdLieGBXLHn6ARjh7cxx6yFmsNHIRCvqZUoEcYs=; b=a2W2+xoNqhR80zUc5jolInAkzW9jffrS1iDdlsspL8A3+5pc9BCuajCJLHZ9B531hT MaRFdbI+zBS+Zd5gXWQvRW8sP1A3O5tRzVxaUW3g+V+knHKtE5LU7U5gSCWg/aQJuziQ 9N0cNK1KrcTbigQl1wAOo4A4qa12M02m5aKMDif44QcYQIlCLys2ybdz1aMj9QYWIFBA Eues8KyP0Oo/hbXa0wHXmKI0YlMnoewdMO6Bf/NhI74BcFqv1mA7W1qiBeGHa8ZRBryc zRzS9gdXKbf8HhxJyS5C84GZyIze6jOqoDVOIQk+qs5HmZpSmKgu9Raad+gVXuNCF+de iZjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DRqp7xKN; 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 r71si10188551oie.265.2020.03.25.04.34.52; Wed, 25 Mar 2020 04:35:08 -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=DRqp7xKN; 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 S1727320AbgCYLea (ORCPT + 99 others); Wed, 25 Mar 2020 07:34:30 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:40697 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726313AbgCYLe3 (ORCPT ); Wed, 25 Mar 2020 07:34:29 -0400 Received: by mail-lf1-f68.google.com with SMTP id j17so1457550lfe.7 for ; Wed, 25 Mar 2020 04:34:27 -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=GygzIdLieGBXLHn6ARjh7cxx6yFmsNHIRCvqZUoEcYs=; b=DRqp7xKN9hAEg0yzoACoL1sqSGt2zkuiC8T/kc3khyd5AU7yPm9TzjP9g64Lfnx0eV IhR3tdxeoYYwlcecjzbXSLbsGvsQ80B5x/pe2vK+cKy97E4y4MlXheTXRvDwOcTVpb54 uPvIKuS2eopieWOxV6LYZthn3rlPGYobpYqAxc4g09nnk02DRFaiSasWr+QeggEGBirs uskLdv0pYvdYCYNvKmCAzzxGP5NKeNL/P+SD9dr8Ze/keCsGXnzPB2yDQDKTFcOcBkFA cGUbVY78QaEcXGchRKeR/OFkguB+lq1BvGOpXwl+7dwCxVD6mcOpV1IN5lopIzPW//94 giOA== 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=GygzIdLieGBXLHn6ARjh7cxx6yFmsNHIRCvqZUoEcYs=; b=P1axsVsBd7dUrb3BbhAEcb3flWfF/VVeJ4v1EFHl33K/DAhkEvz6NTgqjquiqcjy+n 3QiKrQDv6l36MS/j3iZbFxgyFBwsq1/SUS4xPlm9zgocxiwuerD+Y+6EqlGGE7SW3dyY iXJIvuiZ81yEY4AEY6C4VOFxMgQBcZ4m9XZni0XdSj/RzEADaPT6RX9UwnLILvKO6W+w s0msLu5TbO2w7l5Q3BHQ45OSw7S4I8z4WNE5XVJMXed9qfN6wy67bZRZHUvjpYwwFN/G IGj6/+C9hLvr5WbzXrR+5r3yf150R/rnLkXsrcanjJB6FqSO6YGivWjUMl9l0UBxYjr4 xxIQ== X-Gm-Message-State: ANhLgQ0Ke6ub4zoDA135jL3DgAbBnesnvMX3B/mFZ08bqHr9tCc5pWRw cYULso0xnDpy9cV/0nfYj7my7g== X-Received: by 2002:a19:ca12:: with SMTP id a18mr604115lfg.213.1585136067038; Wed, 25 Mar 2020 04:34:27 -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 v22sm3920009ljc.79.2020.03.25.04.34.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 04:34:26 -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 , Vinod Koul , Haibo Chen , Ludovic Barre , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, Ulf Hansson Subject: [PATCH 0/2] amba/platform: Initialize dma_parms at the bus level Date: Wed, 25 Mar 2020 12:34:05 +0100 Message-Id: <20200325113407.26996-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-rc7. 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 | 2 ++ drivers/base/platform.c | 1 + include/linux/amba/bus.h | 1 + include/linux/platform_device.h | 1 + 4 files changed, 5 insertions(+) -- 2.20.1