Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp833473rwb; Thu, 22 Sep 2022 07:02:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uuVF0RXjfqSRxfqOUwmyEAd2Dtx4c9VucRAGB+GAbRHt1Hi5354mDGM85IFfVawqwfR/K X-Received: by 2002:a17:902:e74c:b0:177:f3be:2812 with SMTP id p12-20020a170902e74c00b00177f3be2812mr3424666plf.123.1663855349157; Thu, 22 Sep 2022 07:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663855349; cv=none; d=google.com; s=arc-20160816; b=h96nFIeUFUsOeP/fwnbmQGwD2S85FUuIjxwZyfc/RBEQudSYtXmZE/ZgnRIEZmwqPe qPQ99p7J8NuIyO5T9tRbncbyDprkaEBulFQ6PKlNVcf/rxTQikwTG96oI4hX041ppUG4 ffdM9UE9lTC/9doy7d3TkuRX2p66QcCCdySkaECFw69UFlWocQVhbGDXE6Bf6VRGQXLj Okn6ARhgj96Kb6zdtlkbjBJfW0BOHZ31Xzn5kDo62FnBpP7tQshlbQwhnqAQ1Ty87jEh HvyrMlI6inxsEH/+HMmk9MLTjd1jadCBVExyuOOjcELDgPxYJQ+vwRG5638F3fJB7TaB pmyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Y2Ud/qqg2elpmXsNxxNKNrA5ku1+e8yE9DeSYAF5uII=; b=suGW5H4FSJbOR4Uoeu1J7QI04uMrOwzwLd2AEL01hFPY9IZVam3+OfI6AZFVkNEMEB 8vBCp7y4yNpjsUvn5li/dChUlwBcugv9kxQKOFjNTZ7wfnnxkMGsqXzoMg3yKjX2QF2H 90wXSyqpKagWZq5xBXjK2aZ5mdzNBvKcUZ8GU4K1EQyCKEX4mSmQD0y1CtXN1ii4sErf qWxQ16c/0+YRYnXI2BUnHvJYQcHiGPoDcOib3QGN4F4RXdnp+346EejIH/atKjCSCBL9 9d0UPiNAsy6dTke/GYZTk+JjDjZUipaA+SrLQIknJme28VqqCKwQ8dthLRIFNQfxv34R afUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="BlG4Rv/B"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a17090341cc00b001788451884esi7133216ple.290.2022.09.22.07.02.01; Thu, 22 Sep 2022 07:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="BlG4Rv/B"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230188AbiIVNss (ORCPT + 99 others); Thu, 22 Sep 2022 09:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231794AbiIVNs3 (ORCPT ); Thu, 22 Sep 2022 09:48:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 133E2EFA5D for ; Thu, 22 Sep 2022 06:48:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663854491; 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=Y2Ud/qqg2elpmXsNxxNKNrA5ku1+e8yE9DeSYAF5uII=; b=BlG4Rv/BWAFotjzOvxbwNnW4eYn0P077FqoEZXK2oCDlN1or+lekDMjpNgjJwJHkGZmp/U KsGZmZJ43R+6C5g04iHrh7jR3IAJV7j9Av70jIzezUr73OeFgCmXkiFZ9NP16eVkIhHSQk 0n8xjnDZUVcmbMTYz6HkD2UBI4WktH8= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-604-l9O_N698NWOJ1xNKZoaWFg-1; Thu, 22 Sep 2022 09:48:10 -0400 X-MC-Unique: l9O_N698NWOJ1xNKZoaWFg-1 Received: by mail-ed1-f71.google.com with SMTP id e15-20020a056402190f00b0044f41e776a0so6695090edz.0 for ; Thu, 22 Sep 2022 06:48:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Y2Ud/qqg2elpmXsNxxNKNrA5ku1+e8yE9DeSYAF5uII=; b=KeNMU4DGv2BwNV3CB5aGDlIAW5BKSlJwpN75sOSnsR0mM6z1hVRvJ27ufqDo3NTYCh twz2mQvIJ1wNBPxmxUgjfLUzkSzLeWF0K3inOflwqYH5Ozq72Yr+d4WDpogyvx7GeK6B ZZ1rwF1kzP2AoMwwxzPTfiACM9FHzDojIwlVzJNy4rQ7Y2lzuV9yCTIqGg+AIHOgKQ3v Eo4u9T/ZgekNK8SxH6Ms0RFWd+hltxUvrpfZej8ZKi1uWm0H5ygE+MgvYcIWrnJMdKK5 OfPAq8qC++k7OGu6Tx4rpFmxefEaHndgFnKRiW8VlmXf2ZhOHoRbm/NbeVZJSTLBBtxb TD4A== X-Gm-Message-State: ACrzQf2DWouiQ/sg9NJL6GMZWsgzXVIy1Yrwtld1ScpAzX/lhd4upBBt u5jXHep9eBgpW0rZ0LC46v3gi2n7WnaWTboPrImD7T3ABwXBOs755KQz9Zglr2DrTUy68EU/ztZ DtSXOGhBUpEYWkAY996xedsmy X-Received: by 2002:a17:907:7d8d:b0:781:fd6b:4545 with SMTP id oz13-20020a1709077d8d00b00781fd6b4545mr2994188ejc.117.1663854489001; Thu, 22 Sep 2022 06:48:09 -0700 (PDT) X-Received: by 2002:a17:907:7d8d:b0:781:fd6b:4545 with SMTP id oz13-20020a1709077d8d00b00781fd6b4545mr2994171ejc.117.1663854488823; Thu, 22 Sep 2022 06:48:08 -0700 (PDT) Received: from ?IPV6:2001:1c00:c1e:bf00:d69d:5353:dba5:ee81? (2001-1c00-0c1e-bf00-d69d-5353-dba5-ee81.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:d69d:5353:dba5:ee81]) by smtp.gmail.com with ESMTPSA id kv6-20020a17090778c600b0076f0ab594e9sm2644319ejc.73.2022.09.22.06.48.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 22 Sep 2022 06:48:08 -0700 (PDT) Message-ID: Date: Thu, 22 Sep 2022 15:48:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH -next 1/2] i2c: designware: Switch from using MMIO access to SMN access Content-Language: en-US To: Andy Shevchenko , Borislav Petkov Cc: "Limonciello, Mario" , =?UTF-8?B?SmFuIETEhWJyb8Wb?= , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, jarkko.nikula@linux.intel.com, wsa@kernel.org, rrangel@chromium.org, upstream@semihalf.com, Muralidhara M K , Naveen Krishna Chatradhi References: <20220916131854.687371-1-jsd@semihalf.com> <20220916131854.687371-2-jsd@semihalf.com> <60a52348-7d50-1056-a596-e154f87c99d2@amd.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 9/22/22 11:51, Andy Shevchenko wrote: > +Cc: Hans (mentioned your name and was under impression that you are in Cc list already) > > On Thu, Sep 22, 2022 at 12:49:15PM +0300, Andy Shevchenko wrote: >> On Wed, Sep 21, 2022 at 10:50:53PM +0200, Borislav Petkov wrote: >>> On Wed, Sep 21, 2022 at 03:19:26PM -0500, Limonciello, Mario wrote: >>>> Jan mentioned this in the commit message: >>>> >>>>> The function which registers i2c-designware-platdrv is a >>>>> subsys_initcall that is executed before fs_initcall (when enumeration > of >>>> NB descriptors occurs). >>>> >>>> So if it's not exported again, then it means that we somehow >>>> need to get i2c-designware-platdrv to register earlier too. >>> >>> So I have this there: >>> >>> /* This has to go after the PCI subsystem */ >>> fs_initcall(init_amd_nbs); >>> >>> as I need PCI. It itself does >>> >>> arch_initcall(pci_arch_init); >>> >>> so I guess init_amd_nbs() could be a subsys_initcall... >>> >>> Or why is >>> >>> subsys_initcall(dw_i2c_init_driver); >>> >>> a subsys initcall in the first place? >>> >>> Looking at >>> >>> 104522806a7d ("i2c: designware: dw_i2c_init_driver as subsys initcall") >>> >>> I don't see a particular reason why it should be a subsys_initcall... >>> >>> In any case, this should be fixed without an export which was crap in >>> the first place. >>> >>> Hm. >> >> I'm speculating here, but IIRC the I2C controllers may serve PMICs on some >> platform that are required to be present earlier due to some ACPI code >> accessing them. This Hans de Goede can confirm or correct me. Right, thank you for Cc-ing me. At least on X86 there are several platforms (and 100-s of device models) which use a PMIC connected to the i2c-designware controller and this PMIC gets poked directly from ACPI _S0 and _S3 (power on/off) methods. So the I2C bus driver needs to *bind* to the controller as soon as we find its description in ACPI, otherwise we get a whole bunch of failed ACPI OpRegion access errors as well as various actual really issues. So please keep this as a subsys initcall. Regards, Hans