From patchwork Tue Mar 31 18:38:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 185119 Delivered-To: patches@linaro.org Received: by 2002:a92:de47:0:0:0:0:0 with SMTP id e7csp4007113ilr; Tue, 31 Mar 2020 11:38:49 -0700 (PDT) X-Received: by 2002:a19:cb8e:: with SMTP id b136mr11959284lfg.67.1585679929204; Tue, 31 Mar 2020 11:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585679929; cv=none; d=google.com; s=arc-20160816; b=RCepnR64ojdNwv0lrSPZfScbWV5ag/yVQuJilTKZfG4RBFhN9q//hG4Jolrz1hyYEO tpv1b7DCcMY+CAwfXIOm5YXW4OcAK1BFKEkBKSMP2fy5v93YAK2wfuCXofsrlAuMFmJQ Z19kROaNm/GgNi+G3Gu0Yz3BmgWt9ku04yE8Scn31m1uOq7xQ6i03sWnbGpMbV6jxnoa r7hsqrgJb/1QrQZUpDJ/31PPhUpY7brrpZ9exYqKBX7UzMF9KAolNmBHL2NZuU+xxjv6 /Hx9W1xzMHb7YJNAbRx+D0pgVAwG7rmWHN0cdd+rklVGoRQF2CSE9Wf5w3HKzftasdqY WiKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=A1iR82JLy2QBCOT69varWy2T5A5xF9bW9JJAjBNZYtw=; b=cUI2IkOJJT1j+z3Y497izOBNuqVFxBz6Dk6+Pob6D+V2sAnlQbL4FjL7abTyLft6DS Yto1OTf+K56VVaBFwaROCrKnim+m4G2KDoX8F3zf+j181s7rwaQG+KAbh2WD25XiLPy0 BPPvCrurQRO2hBt6chE/ZT8i2yCkDqwHmfgR225MB1xL0YtcFdpe46T5perbEQza5HPb v18KKaNFKz1CGCBJnAviTbtmIHkKp3kvoIRYC0BPTtkYxehdct/K0Gfm7uY3Y8r44KCN iT1cNLeXypEHL97cloJ6WbHNWFNVUfiDctr2JMMmbjcLVHY7i9QyZtp38bCin5jnSIVI /+6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AgqKOg0X; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z26sor6569489lfh.37.2020.03.31.11.38.49 for (Google Transport Security); Tue, 31 Mar 2020 11:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AgqKOg0X; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=sMFWHlh8oGS9DqFQqjc0ZCoXG3oaauTsx19nLw9oCSj8zYUy7BCMxinQN+3RqczJhO 4HsbPw31/HN2gYTtc7tmIiO9RyRJMb1+qmZLndfvWKJcXg9RrfJ6gZ9rL8L55Izcx2MD /xNRssBJiZTOXGiXa5GmCzodBnbaLjAd1xL6CpPLljU5V8uV0egyLAxM4jGWrn3ypOQl 3MZNWyimYlTt5XZVEkWd/Uf8pB4RmrbqE58W+7ErmqyGwftIaorix4HhhMEs3YYVRFeT H33EtSxXX7ouNnSXzwoqx1aQDA+7JqXOv6oCpnV+ek9TcrEw8RtXaAWnmR+CoUoiaFfl cZwQ== X-Gm-Message-State: AGi0PuZdVaq24+WEVB0fXKsNVPtQfetg5Ro2r68jx5U5i4g4ExGYXTSI XJRJy6rEhYV5E0pImMJgeUzIBOtZ X-Google-Smtp-Source: APiQypKRx83jRA3vthxlvydh1YZb4WXvAun13NnHXa386ryuuWqw8NWW/Vu8GQtNCFg8UW/MxqPqog== X-Received: by 2002:a19:a409:: with SMTP id q9mr12183993lfc.71.1585679928748; Tue, 31 Mar 2020 11:38:48 -0700 (PDT) Return-Path: 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 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