Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2164378pxb; Fri, 5 Mar 2021 08:39:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiqIBiz6vNi3AmZ1naib9EPKDGcJZLtIXTmmGjvtIb6JCjiZBwmrFaSMN1bjElfUxFAPJ4 X-Received: by 2002:a17:906:cd12:: with SMTP id oz18mr2998160ejb.498.1614962395460; Fri, 05 Mar 2021 08:39:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614962395; cv=none; d=google.com; s=arc-20160816; b=LjxeXbSOcwGchhc0wYPKC9gVJSppaUYxy7LyBLZ+d9RqhyDXv8WIGISV0AENh8eTzI UGKlLCgDepyNq09AXWsexI1EYJKBBaDcf8lcb+jLRGA/NcSuNR4AE/v4HLKoF95ycRE2 HurhOTlb7CsRgaJRDif4N82DrV26GulTPaW3BYIEowrCwuNmIiFCCfURx/UA5Q2SCt3n fhGd6K2wT8Rawy6b392gU8Y/V9QCJx59TQtNdKHCIt83UkrxMwN5c9qJIdW2VsAzKJQd K4KeddyOjRh0eP0R37Upise6gZHEVOLWTJZ7+f7q4l+2jWQ+Crv23QOr+CIkoO5OUDqs YIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=/WT9UENyKU6PRq/wSyFDmyON1pQr5AFXQ6KBDlTAJ9g=; b=hqDdPVl9FKwZjeDC3QfmkLZuSLv4x/2W9fgmtqY5F1I6lhWeFM35rMWcfxwJ6GSD8F CB8vyvAELH2SWZ9iJXz6EdBd1g+8rwtF/L8dj9wMOuVMgORpV/4C2wVHVqHC0mdikf+E 89xeWgkoyR9NStBR8E2cmttLNuWyTD4qwRpEZ1fQCEZ1N/at6Db3pXJcYaMIyYEwYpd4 loPLo82Cp9E30bQEL1m8qngAkEVpvme7UTLoX3xdBz4Wy9SrDurN2jvmY0sSZa5ZYhqw RXKi6ijCScTnz2ECSe+ED9hulFICAElZTC1VMQTUUh8QjRIOeSohs/R7oKda1M/F21AO TPHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="f6kbmlT/"; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh9si1702912ejb.85.2021.03.05.08.39.33; Fri, 05 Mar 2021 08:39:55 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b="f6kbmlT/"; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231249AbhCEQhC (ORCPT + 99 others); Fri, 5 Mar 2021 11:37:02 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54270 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbhCEQgb (ORCPT ); Fri, 5 Mar 2021 11:36:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614962190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/WT9UENyKU6PRq/wSyFDmyON1pQr5AFXQ6KBDlTAJ9g=; b=f6kbmlT/bmaOD6loFwecsbus/U3oxP6A0OgF4Nu1qMAFcKyYWjC0rutlaL4rANq1dD8uwD OX+GFLJx02DrnZdJF62jLRqlEY28/ytTzgO+3LlBxSjxvn+fGgJJz9hOej9+JpSDucrbYZ kBHp1vhoNWsO6emiBePUNOkKGbWeboc= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-3p5Y8IZxPGeKs2b6EW4WqQ-1; Fri, 05 Mar 2021 11:36:27 -0500 X-MC-Unique: 3p5Y8IZxPGeKs2b6EW4WqQ-1 Received: by mail-ed1-f70.google.com with SMTP id o24so1177349edt.15 for ; Fri, 05 Mar 2021 08:36:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/WT9UENyKU6PRq/wSyFDmyON1pQr5AFXQ6KBDlTAJ9g=; b=hjj33vw44+FtiByYllecBKTdJFgHLfJbFhJy1HOeO5bA4eIEyYohYG9NRoC4iOL/bi i2mHKuSYtGVR0Y4PQB7grVzCT5cR/SD17eo53Bhp223rm3gnqq3uIRsgWrWtD8wLmWZJ NxRbWls1QLRGFF/ccgfPdz+hvWTITiJ/cWziVb85Z4ePd4/JPTiNxHhbQvrSGPAr/ie2 o4IVTVV8qjgrSbjJfaD0YeNTrL8tPZyGaZLfqqCshB5w6QuFjCOQBH4cVlIVQsc5lKC4 1qQQQCakrEnCmSVl1j90UjoIDBcth68L1PTWMbcdnbIYf9WY3/wPZp0Y1Rx3+WyqjnMa Maew== X-Gm-Message-State: AOAM531UYaDPB/IUALrg+a3o02QX3VF2kQrAB+u2LGhQOxXmrA6AxNzz oqjuHgdi4Bw+Z/MUcYGOzpEDFjyw6Ys0LSrC/jwnFCQucYGO6kZF8pnGpzKiXhFgbdmn66fNxnZ /RKlBlyKMV1l2veUKQ3xUqVdZ X-Received: by 2002:a17:906:d214:: with SMTP id w20mr3003141ejz.284.1614962185925; Fri, 05 Mar 2021 08:36:25 -0800 (PST) X-Received: by 2002:a17:906:d214:: with SMTP id w20mr3003113ejz.284.1614962185753; Fri, 05 Mar 2021 08:36:25 -0800 (PST) Received: from x1.localdomain (2001-1c00-0c1e-bf00-1054-9d19-e0f0-8214.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1054:9d19:e0f0:8214]) by smtp.gmail.com with ESMTPSA id u15sm1769835ejy.48.2021.03.05.08.36.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Mar 2021 08:36:25 -0800 (PST) Subject: Re: [PATCH 1/4] platform/x86: simatic-ipc: add main driver for Siemens devices To: Andy Shevchenko Cc: Henning Schild , Linux Kernel Mailing List , Linux LED Subsystem , Platform Driver , linux-watchdog@vger.kernel.org, Srikanth Krishnakar , Jan Kiszka , Gerd Haeussler , Guenter Roeck , Wim Van Sebroeck , Mark Gross , Pavel Machek References: <20210302163309.25528-1-henning.schild@siemens.com> <20210302163309.25528-2-henning.schild@siemens.com> <2fad304a-9e1e-c83d-7a9e-02b35ed22418@redhat.com> From: Hans de Goede Message-ID: Date: Fri, 5 Mar 2021 17:36:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 3/5/21 5:25 PM, Andy Shevchenko wrote: > On Fri, Mar 5, 2021 at 6:14 PM Hans de Goede wrote: >> On 3/5/21 4:42 PM, Andy Shevchenko wrote: >>> On Thu, Mar 4, 2021 at 3:47 PM Hans de Goede wrote: >>>> On 3/4/21 11:11 AM, Andy Shevchenko wrote: >>>>> On Thu, Mar 4, 2021 at 8:36 AM Henning Schild >>>>> wrote: > > ... > >>>>> Oy vey! I know what this is and let's do it differently. I have some >>>>> (relatively old) patch series I can send you privately for testing. >>>> >>>> This bit stood out the most to me too, it would be good if we can this fixed >>>> in some cleaner work. So I'm curious how things will look with Andy's work >>>> integrated. >>>> >>>> Also I don't think this should be exported. Instead this (or its replacement) >>>> should be used to get the address for an IOMEM resource to add the platform >>>> devices when they are instantiated. Then the platform-dev drivers can just >>>> use the regular functions to get their resources instead of relying on this >>>> module. >>> >>> I have published a WIP branch [1]. I have no means to test (I don't >>> know what hardware at hand I can use right now), but I made it compile >>> after 4 years of gathering dust... >> >> So I took a quick look at the following 2 commits: > > (One of the latter commits moves the code to drivers/pci/pci-p2sb.c, > do you think it's better like that? The idea is to deduplicate > __pci_bus_read_base() call) > >> "platform/x86: p2sb: New Primary to Sideband bridge support library" >> "mfd: lpc_ich: Switch to generic p2sb_bar()" >> >> And this looks good to me, although compared to the code from this >> patch-set you are missing the pci_lock_rescan_remove(); and >> pci_unlock_rescan_remove(); calls. > > Oh, indeed. > >>> Feel free to give any kind of comments or share your ideas on how it >>> can be improved (the above idea on IOMEM resource is interesting, but >>> devices are PCI, not sure how this can be done). >> >> The code added by this patch introduces a register_platform_devices() >> function which creates a bunch of platform-devices; and then the >> device-drivers for those call simatic_ipc_get_membase0() to get their >> base-address. > > Sounds like an MFD approach... Yes except that there does not seem to be a clear parent for these devices, so it is MFD-ish. IOW I'm not sure this should be changed to use the MFD framework, but I was thinking along those line myself too. Henning did you look into using the MFD framework + MFD cell descriptions to instantiate the platform-devices for you ? Regards, Hans