Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp747837yba; Wed, 3 Apr 2019 19:17:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzh1qI3UAc5GknXsNoTrrY2R++GEAN5n/L3q2rVtMJuOkfsCTRMdx0MnGeRjGK0OBdihpZp X-Received: by 2002:a17:902:b48c:: with SMTP id y12mr3492702plr.280.1554344248515; Wed, 03 Apr 2019 19:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554344248; cv=none; d=google.com; s=arc-20160816; b=nZZgDCpo7dPRL8zEzrfQpSe9SDR0u+ilpLQpDdoGn8a1X+ySZGHUWIKJKvegOKqyMu 50VqCh+4czAG6Nu2ed7gyiJDPeCqcG4gJ0apuJxJ2e66yYUbq184HGk2VWelhK+/IRbK JjOLv0rWh+fcKqHALInYsoOoWBuaoBnS7p1vs6Y7OYT2WQE4eKvj7/ud4tIgzwvRqDmF jeKs/wihbStOiOT9ulh1AMs/tvnFjymZndkAftQhUV+Q3xfShfKthQsU7uB0uLY5IXkk PtMsvmZULbSANzDSD++TGZEVDWRvqh7bPlDwIuFPgM4pmKVWij1hVk8zwwREVVleLUvb pLjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=r0+ySxPxczosFjZW0tVjVY7YxeyyP96YtlNToKjzLcs=; b=bj+BOGx5yFZiQpyuzWPqsLtp2FZ2IHEppBFhQ9F+RSPVBLj3+0q59wtuyPp77TZGPg vO7eir2D+xNt8ZwbKl62ObSwCo/PXt27Gqxi/Z0xw7D52Iw2UeMRLThhdySm2sNaZKnc wWXPw/zHYdK0DaQ2oKH+tJzYcSDOFw9twQEAXadv1bEqurPszeXsVHwSDzWzJwHuY1KQ FfhYpvc6S0P72BusBCY9oNaq1MY7Q9hOjxY9h923ppOBHlSeNoRjCCUuU9GvJaEQd9NS e4+3m/XhjrcBi73KlV51V2LAkLzMp7TT1nRbsJBXwDHLeLqhuuLVscqNuytBtq2bBV/7 p+8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm2 header.b=BrNRdPV4; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=4qeP4U9D; 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 f15si15553645pgm.132.2019.04.03.19.17.13; Wed, 03 Apr 2019 19:17:28 -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=@aj.id.au header.s=fm2 header.b=BrNRdPV4; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=4qeP4U9D; 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 S1726607AbfDDCQi (ORCPT + 99 others); Wed, 3 Apr 2019 22:16:38 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:60255 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfDDCQi (ORCPT ); Wed, 3 Apr 2019 22:16:38 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5B7F521D23; Wed, 3 Apr 2019 22:16:37 -0400 (EDT) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Wed, 03 Apr 2019 22:16:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm2; bh=r0+ySxPxczosFjZW0tVjVY7YxeyyP96 YtlNToKjzLcs=; b=BrNRdPV4PqYv1yfmwSvq43n5VWDUbmWRfVy+ZSwP2h52Ycu EqKrfovi388Ru4TyleBAZNEs5vjhcvpLDfuRUp7aguhaX8YGREtDVxWArVcuacJh R8ajAjrtnoGWRWo8m9rg39dP0noBKfJlmvjRTFV7tHPPgn6UVrBRQEbSzfqdj2Dq ScnSJ4CwXuuQGFtlT9MZMr45N7OA6yTLP33lGSzrNQkgo1ClTpeobSzeXlVd2RDQ /fNwShwfAtpApSqUYTDlFzZIl3BQ6Hs9dwa+7lNl0JGtBLN6sOzA+grVj7YTfsws 0ypkPnVeL+qWmK0h61Elt9U0xODaKeWS87oPghA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=r0+ySx PxczosFjZW0tVjVY7YxeyyP96YtlNToKjzLcs=; b=4qeP4U9DD5PE5Ce1iwM3mm mdN/pTxpq/K1WnabHhpmVl2RcC2b7qUqt+F3oQHn6OMtXFbgp2filffevuD01ODH Q6/ZUafRyZlGiw0eps57lCpVOJw6rA1Szgy1RGkPTVA3P3woGQbzHa2fwN7vxnDU KCe550imW6CT77bcsYUXecy/ura6QdxcoleHY6LJGoyRdoGQsI61DODv9BId8jF1 CVCU9lOhRBYixsT22GFc777fvpPkljmvqzM8F+JKfybEiv4n3BzjAPH0VuJsb8oa ih2oW7A9vZlsbTWCHrYq92VEjmTMhUQRI7q557jN3dd2WdGUvjyvgK6u0Q5lS2og == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrtdeggdehgeculddtuddrgedutddrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertderreej necuhfhrohhmpedftehnughrvgifucflvghffhgvrhihfdcuoegrnhgurhgvfiesrghjrd hiugdrrghuqeenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvgifsegrjhdrihgu rdgruhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 672C77C1B9; Wed, 3 Apr 2019 22:16:35 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-329-gf4aae99-fmstable-20190329v1 Mime-Version: 1.0 X-Me-Personality: 52947553 Message-Id: In-Reply-To: References: <1554229504-5661-1-git-send-email-eajames@linux.ibm.com> <1554229504-5661-3-git-send-email-eajames@linux.ibm.com> <7effb2de-cc91-47af-88a2-a0075262e9c4@www.fastmail.com> Date: Wed, 03 Apr 2019 22:16:34 -0400 From: "Andrew Jeffery" To: "Eddie James" , "Eddie James" , linux-media@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-aspeed@lists.ozlabs.org, "Joel Stanley" , "Mauro Carvalho Chehab" , linux-clk@vger.kernel.org, "Stephen Boyd" , "Michael Turquette" , devicetree@vger.kernel.org, mark.rutland@arm.com, "Rob Herring" Subject: =?UTF-8?Q?Re:_[PATCH_2/5]_media:_platform:_Aspeed:_Make_reserved_memory_?= =?UTF-8?Q?optional?= Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Apr 2019, at 01:05, Eddie James wrote: > > On 4/3/19 1:01 AM, Andrew Jeffery wrote: > > > > On Wed, 3 Apr 2019, at 04:55, Eddie James wrote: > >> Reserved memory doesn't need to be required; system memory would work > >> fine. > > I had to do a bit of legwork to understand what you were doing here. My > > understanding is that we allocate out of the default CMA region if the > > memory-region property isn't specified. Is that what you're expecting? > > Could be helpful to be a little less terse in the commit message. > > > Correct. > > > > > >> Signed-off-by: Eddie James > >> --- > >> drivers/media/platform/aspeed-video.c | 6 +----- > >> 1 file changed, 1 insertion(+), 5 deletions(-) > >> > >> diff --git a/drivers/media/platform/aspeed-video.c > >> b/drivers/media/platform/aspeed-video.c > >> index 55c55a6..8144fe3 100644 > >> --- a/drivers/media/platform/aspeed-video.c > >> +++ b/drivers/media/platform/aspeed-video.c > >> @@ -1608,11 +1608,7 @@ static int aspeed_video_init(struct aspeed_video > >> *video) > >> return PTR_ERR(video->vclk); > >> } > >> > >> - rc = of_reserved_mem_device_init(dev); > >> - if (rc) { > >> - dev_err(dev, "Unable to reserve memory\n"); > >> - return rc; > >> - } > >> + of_reserved_mem_device_init(dev); > > You're ignoring *all* errors here with the expectation that the cause is the > > missing memory-region property. However, other errors can propagate > > out of of_reserved_mem_device_init() - e.g. ENOMEM. Rather than remove > > error checking, I think you should explicitly test for ENODEV, which is what is > > returned if the memory-region property is absent. > > > But it doesn't matter if it fails for any reason, any DMA allocation > should fall back to default CMA memory. In the case of ENOMEM or other > errors, then the later calls to allocate DMA may fail and we can deal > with it then. Fair enough then. I think it deserves a comment, but up to you. Andrew