Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp726398pxf; Thu, 1 Apr 2021 11:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwt8a87aJ3HBoSFuXibTFpLZBJ2cOqmJZ9GABTaSTTZgwhr+ee9i5eOAn2NaB040H4i8n32 X-Received: by 2002:a50:ec96:: with SMTP id e22mr11557454edr.385.1617303334370; Thu, 01 Apr 2021 11:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617303334; cv=none; d=google.com; s=arc-20160816; b=txPTPcMwCcVt98wX2LgrRZv/ZJFjMG+o425ybqe4ObwGQqdVzpp+7A9gTVLPSc4POr kX0cLICo+GGaMkc6sBz5LMuQ92XGvrp+6sj0peyNgzQ3TdQhj37fNfq0pkltc/YWXu2o 2a8ryeb9/9FKrRPpDKB1Ahe05/2EoLi/OtLpeuYfpbsTLsFiXKNKyXg/cDQHbDloV/SN /uXT3bTX/b4qEyUq7Lb6UPIu1GW/zPA1BYMqabrjOMZ7qi91TYtoPh7labbp+XKwznQ0 hu4sTUilJ3ynh2W8u52TELDxpN1joEEx6NI44DMR7gN4OS4gNhJxmd7tfn3DJd9lKbrC 937Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=/dc2EGWmsA3RUmAwd7arhch2Jpxk/v01KY5RHpEalS4=; b=HOYTJuN+N+dsM1Icq+rqboPVZxMczQ9lqduwDdpEtfI19FIddPV5oZrSXh0DpykKq1 7Cwj215HTPerjS6z2pNT8E2Mb9+jMwCp1Qgtu69L5BSGHjvrrQxeIz4xNKO/p+GYI7uX 8L9VyBUFHTP1nhWUInYRKZouhf9qHadXJqoGkof24zlAIGE2/bhFixAVhN6w5BqtcYPQ tujsMUnJtZvvAtl4YaHd32EbYivVIq2bhNpa9q5xMUsNO8nCWNb+VFvxFyT0NiZPHtB7 nE45oT5GwWOMNKjzOnyJXVg8U5JNsRQJ3FKS5BuTGpMThaBqWnJSW6sFC5Ubz8HyxyaJ o9ww== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dm15si5144737ejc.270.2021.04.01.11.55.11; Thu, 01 Apr 2021 11:55:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241285AbhDASwD (ORCPT + 99 others); Thu, 1 Apr 2021 14:52:03 -0400 Received: from mga05.intel.com ([192.55.52.43]:63637 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237593AbhDASho (ORCPT ); Thu, 1 Apr 2021 14:37:44 -0400 IronPort-SDR: DBRHA8ad8cfXh7D8L2eIVs4X6MpbWGm8fln6prJF3nNbWB2ljPZQ8VzC3i7kkCvrkRe/xIzLh3 u/r9L/6m8kaQ== X-IronPort-AV: E=McAfee;i="6000,8403,9941"; a="277457339" X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="277457339" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 08:43:18 -0700 IronPort-SDR: 2pgC/2XvpsQ6arvCckvZv4G5JVCsE5cF0RoD2BuJXuxZuisHgV7En4ZsKMzypSTd1o8j+9m2q3 +K0odndjwu2w== X-IronPort-AV: E=Sophos;i="5.81,296,1610438400"; d="scan'208";a="446315995" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Apr 2021 08:43:14 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lRzTT-000ID7-8B; Thu, 01 Apr 2021 18:43:11 +0300 Date: Thu, 1 Apr 2021 18:43:11 +0300 From: Andy Shevchenko To: Henning Schild Cc: Wolfram Sang , Jean Delvare , Lee Jones , Tan Jui Nee , Jim Quinlan , Jonathan Yong , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-pci@vger.kernel.org, Jean Delvare , Peter Tyser , hdegoede@redhat.com, Mika Westerberg Subject: Re: [PATCH v1 3/7] PCI: New Primary to Sideband (P2SB) bridge support library Message-ID: References: <20210308122020.57071-1-andriy.shevchenko@linux.intel.com> <20210308122020.57071-4-andriy.shevchenko@linux.intel.com> <20210313104557.321de08e@md1za8fc.ad001.siemens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210313104557.321de08e@md1za8fc.ad001.siemens.net> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 13, 2021 at 10:45:57AM +0100, Henning Schild wrote: > Am Mon, 8 Mar 2021 14:20:16 +0200 > schrieb Andy Shevchenko : ... > > + * pci_p2sb_bar - Get Primary to Sideband bridge (P2SB) device BAR > > + * @pdev: PCI device to get a PCI bus to communicate with > > + * @devfn: PCI slot and function to communicate with > > + * @mem: memory resource to be filled in > > Do we really need that many arguments to it? > > Before i had, in a platform driver that never had its own pci_dev or bus > > res->start = simatic_ipc_get_membase0(PCI_DEVFN(13, 0)); > if (res-start == 0) > return -ENODEV; > > So helper only asked for the devfn, returned base and no dedicated > error code. > > With this i need > > struct pci_bus *bus = pci_find_bus(0, 0); > struct pci_dev *pci_dev = bus->self; > unsigned int magic_i_do_not_want = PCI_DEVFN(13, 0); What confuses me is the use for SPI NOR controller on Broxton. And I think we actually can indeed hide all this under the hood by exposing P2SB to the OS. Mika, what do you think? > I guess that second devfn is for devices behind that bridge. So > unhiding it might reveal several devices? Good question. I need a device where actually this happens (hidden P2SB stuff with let's say SPI NOR there) to see how it looks like in such case. I only understood the GPIO part. But I'm not so sure anymore. > But when caring about that > p2sb do i really need to know its devfn. If so i would like to get -- With Best Regards, Andy Shevchenko