Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1800493pxb; Thu, 4 Nov 2021 08:39:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWFHNKVACQIzoXxCxf0QCxHvBf3VzoRvzVB2i5SgC22qhsw1moD4G/nK54It6aYTWsE+Te X-Received: by 2002:a05:6e02:933:: with SMTP id o19mr3088494ilt.92.1636040387997; Thu, 04 Nov 2021 08:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636040387; cv=none; d=google.com; s=arc-20160816; b=nzOQRIT/tyOV3tbzRwjQbV+3i6l7gE0/6aGOcbxUEmZBb4MMjTen0j3eBTWcHqxVCn vulV4a5NG5usJoUvfv9fKHcxBqHrfujASlq/QOg3/OVigMDOVxL/JqiETHzr0/zREuAs N05ZmeFv973AZE3GfdCxpFoddLfx4N0yWt25WcA0hjkpjecb5ccceDfQmJDNMXufo7Nr Qs0cq/cejjzucnVVh5FdYDbYQITqk3tkUMSn6jcumt6pZuMwGMUnCwisHJdnImbXaXza uNiIqJoAvW0KpeuRPpzw5MopQOeA/qoout6JuLNcM51JPCs9wEl2HVA1FAu5VUgkvvIS S0pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=h39XA7CmIjA1tSdi5S0QwC5Z6NnwmJ985ncqU3+v2RE=; b=bdN74QJC6Qy/yELdn2lz9YQ1a9Apx39tth6ouACza5VgWDk+H6MMGVDd1OVhHLTKe+ Iu7UyAqqdhpKYmzfJsMPcLMgwNnMAbnnCwn2XICxzMTO5a5vyXeKbiae0oeJaPSXi47y wzG+zhDmU4qyzioBBbToze7VhEe57qRmE6rWPZ/0YD5WNUH1jazsGrRt7UX8C7v+TtMK TPBH6pt/OLJArVhhwI780z4/LxmDMPFNfbVVb+f0u7f7HhD2IPHd38/MQocYJm3WZek4 VKV+J0kTF9JV52bXvceN8M3VIKr3xIySgjLdpMW/A6OmXB2xXyOdl8DSjzWSW3JGIrpQ xWQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JZwFZOKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g7si3887822ilf.124.2021.11.04.08.39.32; Thu, 04 Nov 2021 08:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JZwFZOKm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231538AbhKDPkE (ORCPT + 99 others); Thu, 4 Nov 2021 11:40:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:42468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbhKDPkD (ORCPT ); Thu, 4 Nov 2021 11:40:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF9AA610FD; Thu, 4 Nov 2021 15:37:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636040245; bh=gOnpVuCJ6ZQWNS7FGa/CA1COrnFPwRd/hzU3ApMGZyw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=JZwFZOKmpNfhURWYZ4TQdgYUb+VQKyjRAKQmYJYhjgOe1biuhJ4YLmQ9jE6lQUsOW Fv9iEEfPInWsDuj6jYkOp1A2stbcC5GuuuMae3DieEIpC6tYkqFCt1+GUhhsomtGG4 fkLCdUCJHYaDztHlv68bYm/JOiRe6wbe89TUX6KcpbwfvkIetYvYdj4qN3t4kXtrpj n58v41z4fhUThtl9Nl5F5H43rn9ZI2PovwnRhAjt3A27mENqynIBpCLx1oWLxdmaxJ UMGakn1aEWrcQrGqSA3vp0LsHXYL++M6NuXX0lNOdc/IEnYKBsvDnWCPK9/3tu2TQO 6BrP5zWoLPHUA== Received: by mail-ed1-f43.google.com with SMTP id o8so22795655edc.3; Thu, 04 Nov 2021 08:37:25 -0700 (PDT) X-Gm-Message-State: AOAM531grwlA1v7EHkS6YluWLYzSICS/8w6ahbEN4EkaEFQWVSy4MIDD GCNcJVA1kztdlmVupRD0f/oaSdlYxMh3XBxe/A== X-Received: by 2002:a50:da06:: with SMTP id z6mr70205630edj.355.1636040224963; Thu, 04 Nov 2021 08:37:04 -0700 (PDT) MIME-Version: 1.0 References: <20211102160612.GA612467@bhelgaas> <20211102174415.58cd3d4f@sal.lan> In-Reply-To: <20211102174415.58cd3d4f@sal.lan> From: Rob Herring Date: Thu, 4 Nov 2021 10:36:52 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v15 04/13] PCI: kirin: Add support for bridge slot DT schema To: Mauro Carvalho Chehab Cc: Bjorn Helgaas , Lorenzo Pieralisi , Linuxarm , mauro.chehab@huawei.com, =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Binghui Wang , Bjorn Helgaas , Xiaowei Song , "linux-kernel@vger.kernel.org" , PCI , Kishon Vijay Abraham I Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 2, 2021 at 12:44 PM Mauro Carvalho Chehab wrote: > > Hi Bjorn, > > Em Tue, 2 Nov 2021 11:06:12 -0500 > Bjorn Helgaas escreveu: > > > > + > > > + /* Per-slot clkreq */ > > > + int n_gpio_clkreq; > > > + int gpio_id_clkreq[MAX_PCI_SLOTS]; > > > + const char *clkreq_names[MAX_PCI_SLOTS]; > > > > I think there's been previous discussion about this, but I didn't > > follow it, so I'm just double-checking that this is what we want here. > > > > IIUC, this (MAX_PCI_SLOTS, "hisilicon,clken-gpios") applies to an > > external PEX 8606 bridge, which seems a little strange to be > > hard-coded into the kirin driver this way. > > > > I see that "hisilicon,clken-gpios" is optional, but what if some > > platform connects all 6 lanes? What if there's a different bridge > > altogether? Keep in mind this is HiKey. There's never been a 2nd board upstream for the SoCs, the boards have a short lifespan in terms of both support and availability. And yet Hikey manages to do multiple complicated things on the board design. I have a hard time caring... > > > > I'll assume this is actually the way we want thing unless I hear > > otherwise. > > Yes, there was past discussions about that with Rob, with regards > to how the DT would represent it, which got reflected at the code. At first I thought these were CLKREQ connections which absolutely should be per port/bridge like PERST, but they are not. They are simply enables for the refclk's and pretty specific to HiKey. > At the end, it was decided to just add a single property inside PCIe: > > > pcie@f4000000 { > compatible = "hisilicon,kirin970-pcie"; > ... > hisilicon,clken-gpios = <&gpio27 3 0>, <&gpio17 0 0>, > <&gpio20 6 0>; > > I don't think this is a problem, as, if some day another bridge would > need a larger number of slots, it is just a matter of changing the > number at the MAX_PCI_SLOTS, as this controls only the size of the array > (and the check for array overflow when parsing the properties). It is a problem that your host bridge driver has hardcoded board specifics. That's not the first time you've heard that from me. But given the board-to-soc ratio of Hikey is 1:1, I don't care that much. Rob