Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3748097ybb; Tue, 31 Mar 2020 11:12:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvxHktHnHAiciO6t+rWXs3203LAL2d72ylH56DVvXBNkO9oUON6XltsG+LvSAvDLKTTBYnm X-Received: by 2002:a9d:1a4:: with SMTP id e33mr13526804ote.343.1585678330045; Tue, 31 Mar 2020 11:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585678330; cv=none; d=google.com; s=arc-20160816; b=PK3OcgxXeyTjr7x7NUcnDkobz7+s2rq6VjYrFO+BlCrY6wgMI9L5ZxDPWBya+kHHRP x3awlFOTUXieP33jNEEq2Zuv4+TdC+Qe+t6APWYUTXEY8IB6OGuEKn/QXQg0eqIBBCDr tpvcmhySMl7aU645r22fFEiZlacK7peUQwwf9Et/ivqYOIDx0DJlcDOlLSeGH5k7CcCX ZO/gfpf1grIPHRFqtG3l4fNyaWCi3/A6hyNdkLWJkmcLkXUu+AF/SEkMsz3GPH2Uho4C 6zR37maYsj5WIuQ5oqOyy0zJLNPDWyIWJeAzwpvM0G6KBbRCtgEQHPKQnHiZS23P2vkq MeXQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UPJq6ZlTzB31AHhJ/+QZLwm1iSTlBLnX9zVCEY1D9+4=; b=y2V2H994zyrt6D/Hou8fK54fA5CNATqeH/t+lbzW5/BZdd6Vh/plaiiUNak9PJykro 3wTDmzPHSozTHnqUNYTjIGfyboC4j+sEF4PTgYghUWaEUMvIRS4CMdzqhdezga47DGrj iu8dQ5RyM9uRe3+HaMYhk4SiJ2X5aMhsf1dDo6YL4RmyJ8n2W4GOQKEueU7sauVq745n 0rb439wDDfxPyHDly4PBKkuNiQdasyuBbkvuNA/K1K0SAy3FpH+O0u4pmx3lJF6jeAun O1oNuYHunr7yg1i5JClYuafF0fuLcN3+LqHUCqhatyX+67/Jx6dyeHcRKgS7TNiIXk3q +IyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oDuAK8ri; 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 p126si7428599oib.73.2020.03.31.11.11.57; Tue, 31 Mar 2020 11:12:10 -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=oDuAK8ri; 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 S1727787AbgCaSJR (ORCPT + 99 others); Tue, 31 Mar 2020 14:09:17 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:47091 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbgCaSJR (ORCPT ); Tue, 31 Mar 2020 14:09:17 -0400 Received: by mail-vs1-f65.google.com with SMTP id z125so14061680vsb.13 for ; Tue, 31 Mar 2020 11:09:16 -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:content-transfer-encoding; bh=UPJq6ZlTzB31AHhJ/+QZLwm1iSTlBLnX9zVCEY1D9+4=; b=oDuAK8ri3s9l8SoVYBHbDcZwEw9KgiiYf/MpM8+3UdjLAqFIF662mmjXuIXNyb/ez8 IzuHflTQWAUV2pof4NIUTD9JmBz2toCJIihOcdaBy8zPUmiQ+oeh/2rFJagHTursEWcs 4V6VYEYBBIaTCKTChOoTfPtT/NRaR/3u3mYkaI2hWqB3jPcxJF0cbe059XBt0KU6tm+z MkNSk2yUyXCVvluLjfLYhYMIQgTHlVY8AL4imdlsUmenfrAaWURjFzltEvV3DcDd8qTZ Nj7HLfHutH0+ZGOLDQ33x4GiMmNVJ1ka/xcvL+e0pdHMAA2DCXooIm7NmWSnhY3gVmk5 iaJA== 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:content-transfer-encoding; bh=UPJq6ZlTzB31AHhJ/+QZLwm1iSTlBLnX9zVCEY1D9+4=; b=t3HLMyydSQVQWTIHEaL5VcwDaQA4eO6FJkIFN3MYibsnjYJ+dDp621rL4vx4HNwmHE Ucg5qtIZv5v4QuYCdAplNrdxuxNSmYOcTNCIbFzl+cSXQ2vqMlPU9Q6HGcoAYBfln9PN ku4xWlORqMtmeCukQ+/FCbeIZpiVQ1NgzAuWA6TRIBI6ig8IyOHsRxcq0uF/ulMRVDg1 8GdURjx2JcKqt49jZ4UiGL8kbjXwNTaKDlX4FQL6ClpKuZjSUwwhw1denikdf/Xjn1Bg 9vza31CBQnukgHpaqzBMJBLqXxxVj+S6USYfdne4BtiUl0XXkuTpfx491SWt1JaWANr9 BrAg== X-Gm-Message-State: AGi0PubQln3oDZPBs7CX1+puiWvysrXhb5Vu2L+Eki5/Z+T1moNdDtf4 HwcntRAcxlV8BIKtXMg+6eKhrIIjk9HAzL4eh4opyA== X-Received: by 2002:a05:6102:72d:: with SMTP id u13mr2964354vsg.35.1585678155840; Tue, 31 Mar 2020 11:09:15 -0700 (PDT) MIME-Version: 1.0 References: <20200325113407.26996-1-ulf.hansson@linaro.org> <2b2f1b1e-d186-e60f-baa9-3223ad4101f0@arm.com> In-Reply-To: <2b2f1b1e-d186-e60f-baa9-3223ad4101f0@arm.com> From: Ulf Hansson Date: Tue, 31 Mar 2020 20:08:39 +0200 Message-ID: Subject: Re: [PATCH 0/2] amba/platform: Initialize dma_parms at the bus level To: Robin Murphy Cc: BOUGH CHEN , Arnd Bergmann , "Rafael J . Wysocki" , Greg Kroah-Hartman , Linus Walleij , Russell King , "linux-kernel@vger.kernel.org" , Vinod Koul , "linux-arm-kernel@lists.infradead.org" , "dmaengine@vger.kernel.org" , Christoph Hellwig , Ludovic Barre Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Mar 2020 at 20:15, Robin Murphy wrote: > > On 2020-03-27 3:34 pm, Ulf Hansson wrote: > > On Fri, 27 Mar 2020 at 04:02, BOUGH CHEN wrote: > >> > >> > >>> -----Original Message----- > >>> From: BOUGH CHEN > >>> Sent: 2020=E5=B9=B43=E6=9C=8826=E6=97=A5 12:41 > >>> To: Ulf Hansson ; Greg Kroah-Hartman > >>> ; Rafael J . Wysocki ; > >>> linux-kernel@vger.kernel.org > >>> Cc: Arnd Bergmann ; Christoph Hellwig ; > >>> Russell King ; Linus Walleij ; > >>> Vinod Koul ; Ludovic Barre ; > >>> linux-arm-kernel@lists.infradead.org; dmaengine@vger.kernel.org > >>> Subject: RE: [PATCH 0/2] amba/platform: Initialize dma_parms at the b= us level > >>> > >>>> -----Original Message----- > >>>> From: Ulf Hansson > >>>> Sent: 2020=E5=B9=B43=E6=9C=8825=E6=97=A5 19:34 > >>>> To: Greg Kroah-Hartman ; Rafael J . > >>>> Wysocki ; linux-kernel@vger.kernel.org > >>>> Cc: Arnd Bergmann ; Christoph Hellwig ; > >>>> Russell King ; Linus Walleij > >>>> ; Vinod Koul ; BOUGH CHE= N > >>>> ; 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 > >>>> > >>>> It's currently the amba/platform driver's responsibility to initiali= ze > >>>> 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 ca= n > >>>> 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 assume= s > >>>> it succeeds. > >>>> > >>>> For these reasons, this series initializes the dma_parms from the > >>>> amba/platform bus at the device registration point. This also follow= s > >>>> the way the PCI devices are being managed, see pci_device_add(). > >>>> > >>>> If it turns out that this is an acceptable solution, we probably als= o > >>>> want the changes for stable, but I am not sure if it applies without= conflicts. > >>>> > >>>> The series is based on v5.6-rc7. > >>>> > >>> > >>> Hi Ulf, > >>> > >>> Since i.MXQM SMMU related code still not upstream yet, so I apply you= r > >>> patches on our internal Linux branch based on v5.4.24, and find it do= not work > >>> on my side. Maybe for platform core drivers, there is a gap between v= 5.4.24 > >>> and v5.6-rc7 which has the impact. > >>> I will try to put our SMMU related code into v5.6-rc7, then do the te= st again. > >>> > >>> > >> > >> Hi Ulf, > >> > >> On the latest Linux-next branch, the top commit 89295c59c1f063b533d071= ca49d0fa0c0783ca6f (tag: next-20200326), after add your two patches, I just= add the simple debug code as following in the /driver/mmc/core/queue.c, bu= t seems still not work as our expect, logically, it should work, so can you= or anyone test on other platform? This seems weird. > > > > You are right, this doesn't work for platform devices being added > > through the OF path. > > > > In other words, of_platform_device_create_pdata() manually allocates > > the platform device and assigns it the &platform_bus_type, but without > > calling platform_device_add(). > > > > For amba, it works fine, as in that OF path, amba_device_add() is calle= d. Hmm. > > > > I re-spin this, to address the problem. Perhaps we simply need to use > > the ->probe() path. > > FWIW we already have setup_pdev_dma_masks(), so it might be logical to > include dma_parms in there too. Yep, thanks for the suggestion. This work fine. [...] Kind regards Uffe