From patchwork Wed Mar 25 11:34:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 184803 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp505754ile; Wed, 25 Mar 2020 04:34:27 -0700 (PDT) X-Received: by 2002:a2e:8652:: with SMTP id i18mr1733126ljj.265.1585136067497; Wed, 25 Mar 2020 04:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585136067; cv=none; d=google.com; s=arc-20160816; b=YQLnBiXLntium2Q+8wIcZ3EqF51KYMlNsIXk1xXvoBFOoMBz8LqR57B43IzD5UTjkF gdM7zbu+ydAI6LmZqYVzCS68L1GTw9QlYx7sbHym+2rAHmlBmU86tm0J65McknusC09e RQScOu6lM1yDMVCT9sb8uSInzIavPU8I7KPssh4WeMkLiMfNBzTdpnQNUiP6BQvHkoHM tuzf48pjTsW5NyrgZkxI9K2ZCGeetmVVkc6WfkkximvsBtObHj8/MiVGu3V4lbGJztDV wMG3hDj3WyxEcMOcPazfuYGI/N2Uo4DLxoOju5lSuO0KXCNch9HVDszJaLTtdr3OABLT T7oA== 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=GygzIdLieGBXLHn6ARjh7cxx6yFmsNHIRCvqZUoEcYs=; b=kwYRVZ1I2RKlFA8xiSd1VwO6PUbk57KWEnIsvXLJUmxJlwe5lFxblXmKiQJtZP3x93 ZA4NgBL9AMYV4flZv71icvyTzcPy6wyUxZkLanj9gSkw5Jl9Bv18hST8zH56UeduvC94 3oSJa20JevzQI0f8qcp4TnTqloJX6eEd6B0ehL6mpgisacJNqblWKDkI622ELoPmaY8b PgedV5uy0sN5O0bzXVt0Ida5qdGwe7r3FunaxQ4PbXZUhVHxhW+8HJVXtfHkncyqelFF /tvTpikpFjn3v9FmC7ZjiWeccp7zhiupTBjep66P9gQFuGHjclR7Q3QuV0Kc6jdLYFUp IVag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DRqp7xKN; 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 v24sor2388269lfi.60.2020.03.25.04.34.27 for (Google Transport Security); Wed, 25 Mar 2020 04:34:27 -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=DRqp7xKN; 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=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=jMxqdzGz1n/H3OpQ9rcKTAChC9ll5DeBgQ0E8NRsvgOflOOVo25wlVBwVT5SOkZXgp rwqJsVpOAHkV0NHjIndcYTTXEKxoEYehFCxRLbjSxhGTNGUq9eEslscU+Be37vvMIxT3 eez+5L2nPREHRROOPh/nE6UH9szVWC3VpASLJqhkdVGSK9aRpmzLQanfLKjRhEISl7Ei Ui9R60lo9C7Z8X/LQbEE5gU9Q6242wHgEnUn8YBr0TmFaa93939ZLZheRrPAOvB3AmTc I+Lqosei1ruEE5noEbLgTywQ+1P8EBl38W2BJyRj1gmssaWBoXb+CABg4vz2UGXbw1Rb WSTw== X-Gm-Message-State: ANhLgQ0SkoDa4aQ+3mVcQyV5Vi7iy6eNfOK3zuRJ3UpHRpdCYTB0rUNv 7KUSoQ2TNlLbAQ3FJkEfibtUppef X-Google-Smtp-Source: ADFU+vtnjU4L34iNseu0oH29xgbKLOULZjfBlZISdEH9KJSXiDUGagFRm4SrzXiL2Hzwl8XydqOIRg== X-Received: by 2002:a19:ca12:: with SMTP id a18mr604115lfg.213.1585136067038; Wed, 25 Mar 2020 04:34:27 -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 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 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