From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,FAKE_REPLY_C,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07B3CC4332E for ; Thu, 19 Mar 2020 17:07:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D186D2072D for ; Thu, 19 Mar 2020 17:07:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HKToJlsr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fAsoMHdZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D186D2072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=Hz9FIbWHLl6UmPTUl1mtdAkKOcaEg3etmqaCKzTShRg=; b=HKToJlsrMScnoi oNAtz5ughBRF8OS7UjJfC3DTFbyoJq2mUs9JapD9aYGjhBwipYGb7wBxP23rij/tJOppQTptkDRg7 BHj9IkW92pC6Ndy+6zwyHLmKQiVgjuRhRQwt9aRLFt+adNkepypxNw6gZmtp+O6d0SuDphBnFQ11e foXxtmkZh7ksck4B2kOMegjeoRrEzEiyJ09us+TnhXYgHQxeWW3Gbh4stE5155Cm3/I2lDHsoKJpe Y/IzNtkIAdaCsR7mSIITyx8/4eix+g4ph0VLKJ92cZ+4bDW5eL1ufIRXuai/bJ3PjwYFOaOea9D1P mxs6L6PRu2px/sqPnyfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEydO-00020H-8V; Thu, 19 Mar 2020 17:07:06 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEydK-0001zc-79 for linux-arm-kernel@lists.infradead.org; Thu, 19 Mar 2020 17:07:04 +0000 Received: from localhost (mobile-166-175-186-165.mycingular.net [166.175.186.165]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 71D4C2072D; Thu, 19 Mar 2020 17:07:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584637621; bh=NdR6LVZ2cIsGAen/1ujzdrUs8tOtmmAvYQrgY/mLbXM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=fAsoMHdZ+CYuM4c3hgzSAXhoiZ3xbVbN8s2cz7P9jqZcY1HB2yJCvRtzAv8IouYHO LC3dp3VGJ75UAMS0WzOgKBLBc3qum4Xg8DyXU67qvbSw9FVQNq+jdccLoJUC4cY0Oe POScnOpP9mVL6PMYpSsyL0K3elHJk1q6Tes9R0s8= Date: Thu, 19 Mar 2020 12:06:59 -0500 From: Bjorn Helgaas To: Kunihiko Hayashi Subject: Re: [PATCH v2 2/2] PCI: uniphier: Add UniPhier PCIe endpoint controller support Message-ID: <20200319170659.GA158868@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1584604449-13461-3-git-send-email-hayashi.kunihiko@socionext.com> User-Agent: Mutt/1.12.2 (2019-09-21) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200319_100702_844833_BD25BA27 X-CRM114-Status: GOOD ( 16.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Lorenzo Pieralisi , Masami Hiramatsu , Jassi Brar , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Masahiro Yamada , Rob Herring , Andrew Murray , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 19, 2020 at 04:54:09PM +0900, Kunihiko Hayashi wrote: > This introduces specific glue layer for UniPhier platform to support > PCIe controller that is based on the DesignWare PCIe core, and > this driver supports endpoint mode. This supports for Pro5 SoC only. Possible alternate text: ("specific glue layer" isn't the usual way to describe a driver) PCI: uniphier: Add Socionext UniPhier Pro5 SoC endpoint controller driver Add driver for the Socionext UniPhier Pro5 SoC endpoint controller. This controller is based on the DesignWare PCIe core. > +/* assertion time of intx in usec */ s/intx/INTx/ to match usage in spec (and in comments below :)) > +#define PCL_INTX_WIDTH_USEC 30 > +struct uniphier_pcie_ep_soc_data { > + bool is_legacy; I'd prefer "unsigned int is_legacy:1". See [1]. But AFAICT you actually don't need this at all (yet), since you only have a single of_device_id, and it sets "is_legacy = true". That means the *not* legacy code is effectively dead and hasn't been tested. My preference would be to add "is_legacy" and the associated tests when you actually *need* them, i.e., when you add support for a non-legacy device. > +static int uniphier_pcie_ep_raise_legacy_irq(struct dw_pcie_ep *ep) > +{ > + struct dw_pcie *pci = to_dw_pcie_from_ep(ep); > + struct uniphier_pcie_ep_priv *priv = to_uniphier_pcie(pci); > + u32 val; > + > + /* assert INTx */ > + val = readl(priv->base + PCL_APP_INTX); > + val |= PCL_APP_INTX_SYS_INT; > + writel(val, priv->base + PCL_APP_INTX); > + > + udelay(PCL_INTX_WIDTH_USEC); > + > + /* deassert INTx */ > + val = readl(priv->base + PCL_APP_INTX); Why do you need to read PCL_APP_INTX again here? > + val &= ~PCL_APP_INTX_SYS_INT; > + writel(val, priv->base + PCL_APP_INTX); > + > + return 0; > +} > + ret = dw_pcie_ep_init(ep); > + if (ret) { > + dev_err(dev, "Failed to initialize endpoint (%d)\n", ret); > + return ret; > + } > + > + return 0; This is equivalent to: ret = dw_pcie_ep_init(ep); if (ret) dev_err(dev, "Failed to initialize endpoint (%d)\n", ret); return ret; > +} [1] https://lore.kernel.org/linux-fsdevel/CA+55aFzKQ6Pj18TB8p4Yr0M4t+S+BsiHH=BJNmn=76-NcjTj-g@mail.gmail.com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel