Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1589333ybl; Wed, 8 Jan 2020 21:07:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyRJMmjDphE7HHzRMBPMTv+q5sEcpvO36R6NsazkEWIBTuYmzbpzhPixOG0KPtUBtXkW9pH X-Received: by 2002:a05:6808:10d:: with SMTP id b13mr1780136oie.69.1578546468660; Wed, 08 Jan 2020 21:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578546468; cv=none; d=google.com; s=arc-20160816; b=vmxqgE0zS1wmbGQKOP1DLHK8phDqWfrT2/Lk47YB/IS7hUPWP89lrF99qzhAH2cnKg Q3nQr2q+oNTj5E4pz67qaF2XOPmKyBhIfDqL9qsiQgzgyIGGM6mGRE4Z9mf0aaISMpzA vmla6I9oixlzUC/fMOICAcciMeaneDF92I221P3AE5tollvsr/hLvaLCRJr9ncI+/Tfd Qb0YxK/hGwfRCQvRbN+PYfRLhwTzEUOIqJ4H32G7II3uCYrKq8RWx0JfT4cYnTZcX5mu FTwJ158xYizZ9s1pLfxlV11jJvgQU/P1yjwnYaatirIWywFRoKEHfLuwmrj9jYsfPFH/ xq+A== 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=MF8c+sdns7iguGosmLN+yWRChH5HbQHEVoRuFYd3R88=; b=UZcacudIbcN3pxMYjvIS2/4v4gIGaEyOqbaVmOfrGb2Jt+PGjIbpkXe0irIgGqjb1M M9TisTqyYZKB92oIyHcgySu0BGr6Bhkb0J7jNXmBCHYJIkSPPJ48Ts2SWV382MitTVPW FMDWTYuS7xL78jZcFYCf58xbl1zFMObY5EkfkIsbBwLBqUTsdN4XGnRpYC1hMmhzGp0p eSzou8MRab0YWnJXH1oOVSrgSvaaRKRLwoJK2qV064qXBmN+PxEY0OVaagDUNpQ37Dxh 64qGLZzuUCRpwfIbz2tYTygV7mRT5CSO9yLmFQX/V92210Hc3/X4AWA5MsT95Xu7e1Tf bY3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@aj.id.au header.s=fm1 header.b=L3c4NMVN; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=fEwkixlk; 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 1si2880299oip.277.2020.01.08.21.07.35; Wed, 08 Jan 2020 21:07:48 -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; dkim=pass header.i=@aj.id.au header.s=fm1 header.b=L3c4NMVN; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=fEwkixlk; 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 S1725958AbgAIFGr (ORCPT + 99 others); Thu, 9 Jan 2020 00:06:47 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:54849 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725308AbgAIFGq (ORCPT ); Thu, 9 Jan 2020 00:06:46 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6018121BF9; Thu, 9 Jan 2020 00:06:45 -0500 (EST) Received: from imap2 ([10.202.2.52]) by compute4.internal (MEProxy); Thu, 09 Jan 2020 00:06:45 -0500 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=fm1; bh=MF8c+sdns7iguGosmLN+yWRChH5HbQH EVoRuFYd3R88=; b=L3c4NMVNgbWCOOtr/APLZBN3ezi4IzeQfH9jOLv3qEDdjgH i2jznUAAc++h/cpuHDptk5D3bM+mnfokTiurIEyFhz0TCzoO0KnoT2D+6RJ9cVK/ k8J5Bg1gz3AclF5liUl/z+6+JfauXv15tExiC0ZYdRYhesyheHzwmOUnMEELAsqO bWFComFbdj0vpzJyZ4abMWM0P19Rb+s00cp0j7wzB06FqJ5ZD1pOWPSIENLi3YgF 6dsChMBe7vWqyetWyJgV5ZxarS+5vgSgsVSW02PpCBN/iotRWSmaiLl8LmtQn7DD 4EHxLK5H08DJHufYDYrCb3mTBfrXTr4YR+RzD7w== 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=fm1; bh=MF8c+s dns7iguGosmLN+yWRChH5HbQHEVoRuFYd3R88=; b=fEwkixlkFKOerFt8LoBhLn aW2pyVTNpNZ6a9E7Y0NVAkFjwG11d9dkCGNDNlG+nVEdXR9Nb3xHLmg1egEI8i0U b1IKI01QCnXta+ZgubHVhYRRkP3WegkrdkNjXDCpI4DEuVxfEGzXTXZVah6VSAPd yrTXvb5up17dDtHYWtrTXbTMGeVkC1VVtLNwoLcz8ZxckT2zw66g/Pm3vX0QKUqt osN4oG363+e2lKlzknwqP09GpCox7cpT4xbvmSeCgJ14GJP5JVzq+MMv/x83pg5h 5xdplFNqyNrOqVruJGKfX+vfFEZQF3k2Nh3S6IcV9Le5G8y4jzkQbNRtBYK+6Jsg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdehledgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdetnhgu rhgvficulfgvfhhfvghrhidfuceorghnughrvgifsegrjhdrihgurdgruheqnecurfgrrh grmhepmhgrihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgv rhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E6FC6E00A5; Thu, 9 Jan 2020 00:06:43 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.7-740-g7d9d84e-fmstable-20200109v1 Mime-Version: 1.0 Message-Id: <3c44c745-d39a-4724-860d-a66537b2adbb@www.fastmail.com> In-Reply-To: <1577993276-2184-7-git-send-email-eajames@linux.ibm.com> References: <1577993276-2184-1-git-send-email-eajames@linux.ibm.com> <1577993276-2184-7-git-send-email-eajames@linux.ibm.com> Date: Thu, 09 Jan 2020 15:38:20 +1030 From: "Andrew Jeffery" To: "Eddie James" , linux-aspeed@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, mark.rutland@arm.com, "Jason Cooper" , "Marc Zyngier" , "Rob Herring" , tglx@linutronix.de, "Joel Stanley" Subject: Re: [PATCH v4 06/12] soc: aspeed: Add XDMA Engine Driver Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Jan 2020, at 05:57, Eddie James wrote: > +static int aspeed_xdma_init_scu(struct aspeed_xdma *ctx, struct device *dev) > +{ > + struct regmap *scu = syscon_regmap_lookup_by_phandle(dev->of_node, > + "aspeed,scu"); > + > + if (!IS_ERR(scu)) { > + u32 selection; > + bool pcie_device_bmc = true; > + const u32 bmc = SCU_PCIE_CONF_BMC_EN | > + SCU_PCIE_CONF_BMC_EN_MSI | SCU_PCIE_CONF_BMC_EN_IRQ | > + SCU_PCIE_CONF_BMC_EN_DMA; > + const u32 vga = SCU_PCIE_CONF_VGA_EN | > + SCU_PCIE_CONF_VGA_EN_MSI | SCU_PCIE_CONF_VGA_EN_IRQ | > + SCU_PCIE_CONF_VGA_EN_DMA; > + const char *pcie = NULL; > + > + if (!of_property_read_string(dev->of_node, "pcie-device", > + &pcie)) { > + if (!strcmp(pcie, "vga")) { > + pcie_device_bmc = false; > + } else if (strcmp(pcie, "bmc")) { > + dev_err(dev, > + "Invalid pcie-device property %s.\n", > + pcie); > + return -EINVAL; > + } > + } > + > + if (pcie_device_bmc) { > + selection = bmc; > + regmap_write(scu, ctx->chip->scu_bmc_class, > + SCU_BMC_CLASS_REV_XDMA); > + } else { > + selection = vga; > + } > + > + regmap_update_bits(scu, ctx->chip->scu_pcie_conf, bmc | vga, > + selection); > + } else { > + dev_warn(dev, "Unable to configure PCIe; continuing.\n"); > + } Not something you need to fix but generally I'd structure this as a early-return: if (IS_ERR(scu)) { dev_warn(dev, "Unable to configure PCIe; continuing.\n"); return 0; } ... Could probably also improve the warning message to say what caused the failure, but again, something that can be changed later.