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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86239C43334 for ; Mon, 13 Jun 2022 20:40:23 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LMNjx5FbBz3chM for ; Tue, 14 Jun 2022 06:40:21 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.166.43; helo=mail-io1-f43.google.com; envelope-from=robherring2@gmail.com; receiver=) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LMNjR1ZB7z3blj for ; Tue, 14 Jun 2022 06:39:54 +1000 (AEST) Received: by mail-io1-f43.google.com with SMTP id p69so7408087iod.0 for ; Mon, 13 Jun 2022 13:39:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Jfed8WHo8TWNvxCiSvI5rcyrYQLVvZOkDmByiHpwcb4=; b=4uCjqj5xl0ofAe33UzLsnaZoVYgW++NA74dhb4TYEboNkpZ7bT9w88ktKS2XFJZ1Ug Fv2CjMAhVUwQnId3Huell5wK7clQXdh0n1wln17dLlcUexxck1pz7qTYFpf3gIUg8y/s y3tsIdgITahMJGRc9bqpDcRfZhzbTaMlYOLVv+ekWj6H7s1WxK/WcqAnA9eJOVCszFyg zroBIiriEiQzMwccf0BREymId2Oif2wQuXYgGH/er99u4aEqD80x44+Ms2TqpCCAKBFj iqYU8ANJ1WI2Pdat03dsEgdnpVxa/+PvTsf0i4RqG8GA8XblTTshMp08ZekJ9oKsU5xO R8UA== X-Gm-Message-State: AOAM531cfs8MQWlTj0xrPA5zunQxftURvQYOpwFqWMi8iMd9AauBmOd0 A+SdgA82d/QD4t2VhpLPSA== X-Google-Smtp-Source: ABdhPJx7nR5T7M0L4hzZ6y5vQUaF5sNik9SF5ruUtWjDfNKqK4EuWnDm5nKY2r7qbgu01ui2ucAQoQ== X-Received: by 2002:a6b:6003:0:b0:668:160b:db94 with SMTP id r3-20020a6b6003000000b00668160bdb94mr769352iog.204.1655152790868; Mon, 13 Jun 2022 13:39:50 -0700 (PDT) Received: from robh.at.kernel.org ([69.39.28.171]) by smtp.gmail.com with ESMTPSA id c9-20020a023f49000000b0033156d6016asm3939471jaf.91.2022.06.13.13.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 13:39:50 -0700 (PDT) Received: (nullmailer pid 42858 invoked by uid 1000); Mon, 13 Jun 2022 20:39:49 -0000 Date: Mon, 13 Jun 2022 14:39:49 -0600 From: Rob Herring To: Serge Semin Subject: Re: [PATCH v4 13/18] PCI: dwc: Add start_link/stop_link inliners Message-ID: <20220613203949.GB28636-robh@kernel.org> References: <20220610082535.12802-1-Sergey.Semin@baikalelectronics.ru> <20220610082535.12802-14-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610082535.12802-14-Sergey.Semin@baikalelectronics.ru> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Lorenzo Pieralisi , Roy Zang , linux-pci@vger.kernel.org, Jingoo Han , Manivannan Sadhasivam , Frank Li , linux-kernel@vger.kernel.org, Serge Semin , Alexey Malahov , Minghuan Lian , Pavel Parkhomenko , Gustavo Pimentel , Bjorn Helgaas , linuxppc-dev@lists.ozlabs.org, Mingkai Hu Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Jun 10, 2022 at 11:25:29AM +0300, Serge Semin wrote: > There are several places in the generic DW PCIe code where the > platform-specific PCIe link start/stop methods are called after making > sure the ops handler and the callbacks are specified. Instead of repeating > the same pattern over and over let's define the static-inline methods in > the DW PCIe header file and use them in the relevant parts of the driver. > > Note returning a negative error from the EP link start procedure if the > start_link pointer isn't specified doesn't really make much sense since it > perfectly normal to have such platform. Moreover even pci_epc_start() > doesn't fail if no epc->ops->start callback is spotted. As a side-effect > of this modification we can set the generic DW PCIe and Layerscape EP > platform drivers free from the empty start_link callbacks and as such > entirely dummy dw_pcie_ops instances. > > Signed-off-by: Serge Semin > > --- > > Changelog v4: > - This is a new patch created on the v4 lap of the series. > --- > drivers/pci/controller/dwc/pci-layerscape-ep.c | 12 ------------ > drivers/pci/controller/dwc/pcie-designware-ep.c | 8 ++------ > drivers/pci/controller/dwc/pcie-designware-host.c | 10 ++++------ > drivers/pci/controller/dwc/pcie-designware-plat.c | 10 ---------- > drivers/pci/controller/dwc/pcie-designware.h | 14 ++++++++++++++ > 5 files changed, 20 insertions(+), 34 deletions(-) Reviewed-by: Rob Herring 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 30B08C433EF for ; Mon, 13 Jun 2022 20:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=C6QkX6aKG7zZm3kyUrO79Evdm6awSrt4MivWLSg9iT8=; b=2ivp5xesANex7r ZjftBGiPoVZi5Fcmid/hz50WoRjkX0bNIbB1QoK4DuMyOO+J3Oh91T84c8798MYWq4WlttvqgPeib c27A+XkR46Mv0l2cELBe08/P6dbdqtmPui3SM/5B4d+7fx5ajOB7a7ye/8zEyQny50sivXJU9kocJ zly5W1D1FN1iGdDnyIlq5m7TiGyVM5meFuBwwiOyxx2RpI0wGAI9TMU/N4O1Jm2j3ZrlfIaINOJfn 9ICcCVxJPzXH8We6xJsullX2ruW4z8Do4Ae5whMaM1vDBcypbOzgh41pQ2kIgj3wg1ut54kv2s/xk DsruQNIbZ7YzbJd6bZhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0qqp-005jGh-IO; Mon, 13 Jun 2022 20:39:55 +0000 Received: from mail-io1-f45.google.com ([209.85.166.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0qqm-005jEo-7N for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2022 20:39:53 +0000 Received: by mail-io1-f45.google.com with SMTP id 19so7338003iou.12 for ; Mon, 13 Jun 2022 13:39:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Jfed8WHo8TWNvxCiSvI5rcyrYQLVvZOkDmByiHpwcb4=; b=LD50RyIjwU6vTDI3i9xn3rmXtSTdLE3fLa/zMMu8HM0igY2SRsuwmcYj7p3b4fanZV 2LnbQI/8JvX9EF+jS2IL8PMn6t4QFiotlZQl2y6BFlE62ZNNBx4jUUtYsKfZY8f606MO VQ+Wic5qZ56LmROT77UvCKuNY39xVGtCa0Qu9UNUgKjAgMxkPZf3CmHX9yk/9tCyjMQ3 rwonJ96nekk3B+pfQU+f1DOX5ELLe8hG6wCYImTIYv+ThQmB86Q/HQlhjW6KEFVgJylX J9DwJEyfoURPjB84PRMCjqRZ1aCYpsLv/1v799Ne3b5J+YMyItXP3IdJJ/sE9RAc/uQC vNbw== X-Gm-Message-State: AOAM531tKPuulkkV/XDLOm8v21/XO8zpBWFOqG6pK+J/3d/fbgp83ATT QJWelnIMZflNw6XmzyIfFw== X-Google-Smtp-Source: ABdhPJx7nR5T7M0L4hzZ6y5vQUaF5sNik9SF5ruUtWjDfNKqK4EuWnDm5nKY2r7qbgu01ui2ucAQoQ== X-Received: by 2002:a6b:6003:0:b0:668:160b:db94 with SMTP id r3-20020a6b6003000000b00668160bdb94mr769352iog.204.1655152790868; Mon, 13 Jun 2022 13:39:50 -0700 (PDT) Received: from robh.at.kernel.org ([69.39.28.171]) by smtp.gmail.com with ESMTPSA id c9-20020a023f49000000b0033156d6016asm3939471jaf.91.2022.06.13.13.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 13:39:50 -0700 (PDT) Received: (nullmailer pid 42858 invoked by uid 1000); Mon, 13 Jun 2022 20:39:49 -0000 Date: Mon, 13 Jun 2022 14:39:49 -0600 From: Rob Herring To: Serge Semin Cc: Bjorn Helgaas , Lorenzo Pieralisi , Minghuan Lian , Mingkai Hu , Roy Zang , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Jingoo Han , Gustavo Pimentel , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Frank Li , Manivannan Sadhasivam , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 13/18] PCI: dwc: Add start_link/stop_link inliners Message-ID: <20220613203949.GB28636-robh@kernel.org> References: <20220610082535.12802-1-Sergey.Semin@baikalelectronics.ru> <20220610082535.12802-14-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610082535.12802-14-Sergey.Semin@baikalelectronics.ru> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220613_133952_313802_ABC672B4 X-CRM114-Status: GOOD ( 18.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 10, 2022 at 11:25:29AM +0300, Serge Semin wrote: > There are several places in the generic DW PCIe code where the > platform-specific PCIe link start/stop methods are called after making > sure the ops handler and the callbacks are specified. Instead of repeating > the same pattern over and over let's define the static-inline methods in > the DW PCIe header file and use them in the relevant parts of the driver. > > Note returning a negative error from the EP link start procedure if the > start_link pointer isn't specified doesn't really make much sense since it > perfectly normal to have such platform. Moreover even pci_epc_start() > doesn't fail if no epc->ops->start callback is spotted. As a side-effect > of this modification we can set the generic DW PCIe and Layerscape EP > platform drivers free from the empty start_link callbacks and as such > entirely dummy dw_pcie_ops instances. > > Signed-off-by: Serge Semin > > --- > > Changelog v4: > - This is a new patch created on the v4 lap of the series. > --- > drivers/pci/controller/dwc/pci-layerscape-ep.c | 12 ------------ > drivers/pci/controller/dwc/pcie-designware-ep.c | 8 ++------ > drivers/pci/controller/dwc/pcie-designware-host.c | 10 ++++------ > drivers/pci/controller/dwc/pcie-designware-plat.c | 10 ---------- > drivers/pci/controller/dwc/pcie-designware.h | 14 ++++++++++++++ > 5 files changed, 20 insertions(+), 34 deletions(-) Reviewed-by: Rob Herring _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4340C433EF for ; Mon, 13 Jun 2022 21:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351626AbiFMVF6 (ORCPT ); Mon, 13 Jun 2022 17:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352630AbiFMVEb (ORCPT ); Mon, 13 Jun 2022 17:04:31 -0400 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE7A33981A; Mon, 13 Jun 2022 13:39:51 -0700 (PDT) Received: by mail-io1-f45.google.com with SMTP id y79so7375187iof.2; Mon, 13 Jun 2022 13:39:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Jfed8WHo8TWNvxCiSvI5rcyrYQLVvZOkDmByiHpwcb4=; b=R/y71E7QOY6woE382+bK9glJduIZ41l7A6wrwXeq6fpfqICgtjIWPLB48KyjA2UGxO RWzVXV4soUsBDINcnPrt2lIVmYmAfbsu54YrLvL5cWvMlHLICdkJIN2QiL11CWxe+zfk fUMcuhBE/JkMYVF2HGpEoWu2SpWND/ZRT9tvrEIobltZMO+1uDdEUsiRw9tAeLnMtT7j OeMllGfoapaK0ro129uzfm04dzJZXxGBKcW0C/cxi/9kpu7odVPrmxE13yQhHwm0FKJu 1bGpMEtcT97KrZuI7gxsowfPCzFi+1fI8FI4hyJXe4uc7zCKBY9HhTdqQC69SY94bJe0 OkWA== X-Gm-Message-State: AOAM5302xIxFIF0mB4V4JSr+FOtdpHM1aVvKf/yXY+A5wQy4KvboWV3o LJ8DS2a/quoPQIHgoo7NPw== X-Google-Smtp-Source: ABdhPJx7nR5T7M0L4hzZ6y5vQUaF5sNik9SF5ruUtWjDfNKqK4EuWnDm5nKY2r7qbgu01ui2ucAQoQ== X-Received: by 2002:a6b:6003:0:b0:668:160b:db94 with SMTP id r3-20020a6b6003000000b00668160bdb94mr769352iog.204.1655152790868; Mon, 13 Jun 2022 13:39:50 -0700 (PDT) Received: from robh.at.kernel.org ([69.39.28.171]) by smtp.gmail.com with ESMTPSA id c9-20020a023f49000000b0033156d6016asm3939471jaf.91.2022.06.13.13.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 13:39:50 -0700 (PDT) Received: (nullmailer pid 42858 invoked by uid 1000); Mon, 13 Jun 2022 20:39:49 -0000 Date: Mon, 13 Jun 2022 14:39:49 -0600 From: Rob Herring To: Serge Semin Cc: Bjorn Helgaas , Lorenzo Pieralisi , Minghuan Lian , Mingkai Hu , Roy Zang , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Jingoo Han , Gustavo Pimentel , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Frank Li , Manivannan Sadhasivam , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 13/18] PCI: dwc: Add start_link/stop_link inliners Message-ID: <20220613203949.GB28636-robh@kernel.org> References: <20220610082535.12802-1-Sergey.Semin@baikalelectronics.ru> <20220610082535.12802-14-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220610082535.12802-14-Sergey.Semin@baikalelectronics.ru> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 10, 2022 at 11:25:29AM +0300, Serge Semin wrote: > There are several places in the generic DW PCIe code where the > platform-specific PCIe link start/stop methods are called after making > sure the ops handler and the callbacks are specified. Instead of repeating > the same pattern over and over let's define the static-inline methods in > the DW PCIe header file and use them in the relevant parts of the driver. > > Note returning a negative error from the EP link start procedure if the > start_link pointer isn't specified doesn't really make much sense since it > perfectly normal to have such platform. Moreover even pci_epc_start() > doesn't fail if no epc->ops->start callback is spotted. As a side-effect > of this modification we can set the generic DW PCIe and Layerscape EP > platform drivers free from the empty start_link callbacks and as such > entirely dummy dw_pcie_ops instances. > > Signed-off-by: Serge Semin > > --- > > Changelog v4: > - This is a new patch created on the v4 lap of the series. > --- > drivers/pci/controller/dwc/pci-layerscape-ep.c | 12 ------------ > drivers/pci/controller/dwc/pcie-designware-ep.c | 8 ++------ > drivers/pci/controller/dwc/pcie-designware-host.c | 10 ++++------ > drivers/pci/controller/dwc/pcie-designware-plat.c | 10 ---------- > drivers/pci/controller/dwc/pcie-designware.h | 14 ++++++++++++++ > 5 files changed, 20 insertions(+), 34 deletions(-) Reviewed-by: Rob Herring