Received: by 10.223.176.5 with SMTP id f5csp823845wra; Tue, 30 Jan 2018 20:22:03 -0800 (PST) X-Google-Smtp-Source: AH8x224KBqy4dx2OuPxRzSbX75hHQPDtaceGE7nwqDzGbjVvkRPQojXcJbwnZ4ZYb7ejTNcIQslF X-Received: by 2002:a17:902:b7c3:: with SMTP id v3-v6mr17837698plz.307.1517372523082; Tue, 30 Jan 2018 20:22:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517372523; cv=none; d=google.com; s=arc-20160816; b=uIIE1AqvLs2jkZpyNuJsOUkeMPTUcjS7QdfKTd2CwyrxWsy9ngyPz1GUqnlK7SlwyI 6KhdutNizv7Im7AiwsIuCmASgcHWGnALSzZO1P7mgXOZd23B/pxMtgByTs7ukq+NscFb EYAXtSwANzwioFKDTdppFv21zPZSjoznRkdabZPu5l1DNZ2Fje9bbL6ijLarztB793OH VfJoLfYtVp2gPMZqt8rKti6CGP9f25Wzqt2chuCUkxFnU+dYtqISSbv+aUJccMKQ9WW8 GNMKrIW5mHoIxnVsv/789GTUEVkUbaBdiONo0wSwtULMv+vRJRuFL2dFf1w0oDhQ/f30 Ud6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=QIRFjU9qO+Bz7dKKxgehoUXsqYK3b5GZO/8DlbsrcV4=; b=B0n3MSr0GEScpWKleJjRrljYqNYS+IM9zFTtOtPYQIXxTc7rt6XodGl+Jm9rt0I8ns E/PTBwzBYBvyW+kCjDylBnT4TzGn7Q846Q4GSf5TyXNgOI0VTJKr89Ltui4tHaSu3SQa FGuSZJof5gVpgTfPEOj7KZdLvCNBfXCQwS2k1TKPdD+Bub4N1u0MM4v/Shdaxvu9F6pY /Og3YLiXbRC5cX9Sp/Qbg279sIDsDf9r3wy3A6KFpsmH5WnJS+zO8uovcV4CHYFJK3E4 5r2bu3ia9oxe/HOrjmEFEfDGLMNVMAS7I/8SmxNBmsdsxlK2ncpij6fX21fDYXJ/XDwB geTg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z75si974087pfd.119.2018.01.30.20.21.48; Tue, 30 Jan 2018 20:22:03 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752581AbeAaDbB (ORCPT + 99 others); Tue, 30 Jan 2018 22:31:01 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40890 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbeAaDa7 (ORCPT ); Tue, 30 Jan 2018 22:30:59 -0500 Received: by mail-wm0-f66.google.com with SMTP id v123so5078147wmd.5; Tue, 30 Jan 2018 19:30:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=QIRFjU9qO+Bz7dKKxgehoUXsqYK3b5GZO/8DlbsrcV4=; b=ec8dpFnkTiubxVwbuY0wJmiJedx34Zk9de6VNacWnS3ZHFsftBfNovWIG/0/d82OJ8 L78tK6RWdmES67Nq0rwu2M2OP98gD5VqiZjatdt4jV4H0C1XAA6MIeZEiByXqU7a804X 1u6S5Mpf/j9j4677Orqdw27KVBDkf0so4fkk35dfUT+6OsPATa4B2KPap0g+a8LxoS5j WjO/Nkwkw/TeG791sRTbYHfTt0Vq9uF68eRq9PDoi7We+bHFMadz5avYuGH0kvFeJwP4 Sfw3Hj96WRTsqvXibcN/IPMmv5Fw2TpqYs0xOKtCk3Lg0xMMZSw3i1LQYve59Hf+lNXR WlFA== X-Gm-Message-State: AKwxyte8BGxGDR00KsSdvmS0u1At4Wyh777Em3FCtd2fUZvHGNMXvDMR eMZ7y6gyBa46WcQaR9OL6H093YB7DKY= X-Received: by 10.80.226.203 with SMTP id q11mr56383927edl.248.1517369457620; Tue, 30 Jan 2018 19:30:57 -0800 (PST) Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com. [209.85.128.175]) by smtp.gmail.com with ESMTPSA id f55sm8931677ede.77.2018.01.30.19.30.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jan 2018 19:30:57 -0800 (PST) Received: by mail-wr0-f175.google.com with SMTP id v15so13440026wrb.8; Tue, 30 Jan 2018 19:30:57 -0800 (PST) X-Received: by 10.223.168.120 with SMTP id l111mr15493926wrc.118.1517369116743; Tue, 30 Jan 2018 19:25:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.208.197 with HTTP; Tue, 30 Jan 2018 19:24:56 -0800 (PST) In-Reply-To: <20180131030807.GA19945@bart.dudau.co.uk> References: <1516695531-23349-1-git-send-email-yong.deng@magewell.com> <201801260759.RyNhDZz4%fengguang.wu@intel.com> <20180126094658.aa70ed3f890464f6051e21e4@magewell.com> <20180126110041.f89848325b9ecfb07df387ca@magewell.com> <20180131030807.GA19945@bart.dudau.co.uk> From: Chen-Yu Tsai Date: Wed, 31 Jan 2018 11:24:56 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [linux-sunxi] Re: [PATCH v6 2/2] media: V3s: Add support for Allwinner CSI. To: Liviu Dudau Cc: Yong , kbuild test robot , kbuild-all@01.org, Maxime Ripard , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , "David S. Miller" , Greg Kroah-Hartman , Hans Verkuil , Linus Walleij , Randy Dunlap , Stanimir Varbanov , Hugues Fruchet , Yannick Fertre , Philipp Zabel , Arnd Bergmann , Benjamin Gaignard , Ramesh Shanmugasundaram , Sakari Ailus , Rick Chang , Linux Media Mailing List , devicetree , linux-arm-kernel , linux-kernel , linux-sunxi , =?UTF-8?Q?Ond=C5=99ej_Jirman?= , Dave Martin , Thierry Reding Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 31, 2018 at 11:08 AM, Liviu Dudau wrote: > On Fri, Jan 26, 2018 at 11:00:41AM +0800, Yong wrote: >> Hi Maxime, >> >> On Fri, 26 Jan 2018 09:46:58 +0800 >> Yong wrote: >> >> > Hi Maxime, >> > >> > Do you have any experience in solving this problem? >> > It seems the PHYS_OFFSET maybe undeclared when the ARCH is not arm. >> >> Got it. >> Should I add 'depends on ARM' in Kconfig? > > No, I don't think you should do that, you should fix the code. > > The dma_addr_t addr that you've got is ideally coming from dma_alloc_coherent(), > in which case the addr is already "suitable" for use by the device (because the > bus where the device is attached to does all the address translations). If you > apply PHYS_OFFSET forcefully to it you might get unexpected results. As explained in the thread, the dma_addr_t address is based on the kernel and processor's viewpoint, which has DRAM at an offset. This particular peripheral (and some others, such as display and video decoder) on Allwinner platforms do DMA on the separate memory bus directly, which does _not_ have that memory offset. This is specific to our hardware. And also mentioned is that there is no sensible representation in the device tree that would allow the DMA API to do proper address translation. Just throwing it out there, maybe we could do a dummy IOMMU that does the simple translation of (addr - PHYS_OFFSET)? Still I'm not sure if the device tree representation would be sane. ChenYu >> >> > >> > On Fri, 26 Jan 2018 08:04:18 +0800 >> > kbuild test robot wrote: >> > >> > > Hi Yong, >> > > >> > > I love your patch! Yet something to improve: >> > > >> > > [auto build test ERROR on linuxtv-media/master] >> > > [also build test ERROR on v4.15-rc9 next-20180119] >> > > [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] >> > > >> > > url: https://github.com/0day-ci/linux/commits/Yong-Deng/dt-bindings-media-Add-Allwinner-V3s-Camera-Sensor-Interface-CSI/20180126-054511 >> > > base: git://linuxtv.org/media_tree.git master >> > > config: i386-allmodconfig (attached as .config) >> > > compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 >> > > reproduce: >> > > # save the attached .config to linux build tree >> > > make ARCH=i386 >> > > >> > > All errors (new ones prefixed by >>): >> > > >> > > drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c: In function 'sun6i_csi_update_buf_addr': >> > > >> drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c:567:31: error: 'PHYS_OFFSET' undeclared (first use in this function); did you mean 'PAGE_OFFSET'? >> > > dma_addr_t bus_addr = addr - PHYS_OFFSET; >> > > ^~~~~~~~~~~ >> > > PAGE_OFFSET >> > > drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c:567:31: note: each undeclared identifier is reported only once for each function it appears in >> > > >> > > vim +567 drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c >> > > >> > > 562 >> > > 563 void sun6i_csi_update_buf_addr(struct sun6i_csi *csi, dma_addr_t addr) >> > > 564 { >> > > 565 struct sun6i_csi_dev *sdev = sun6i_csi_to_dev(csi); >> > > 566 /* transform physical address to bus address */ >> > > > 567 dma_addr_t bus_addr = addr - PHYS_OFFSET; >> > > 568 >> > > 569 regmap_write(sdev->regmap, CSI_CH_F0_BUFA_REG, >> > > 570 (bus_addr + sdev->planar_offset[0]) >> 2); >> > > 571 if (sdev->planar_offset[1] != -1) >> > > 572 regmap_write(sdev->regmap, CSI_CH_F1_BUFA_REG, >> > > 573 (bus_addr + sdev->planar_offset[1]) >> 2); >> > > 574 if (sdev->planar_offset[2] != -1) >> > > 575 regmap_write(sdev->regmap, CSI_CH_F2_BUFA_REG, >> > > 576 (bus_addr + sdev->planar_offset[2]) >> 2); >> > > 577 } >> > > 578 >> > > >> > > --- >> > > 0-DAY kernel test infrastructure Open Source Technology Center >> > > https://lists.01.org/pipermail/kbuild-all Intel Corporation >> > >> > >> > Thanks, >> > Yong >> >> >> Thanks, >> Yong >> >> -- >> You received this message because you are subscribed to the Google Groups "linux-sunxi" group. >> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout.