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 8A2D9C433FE for ; Tue, 21 Dec 2021 16:47:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239996AbhLUQre (ORCPT ); Tue, 21 Dec 2021 11:47:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236468AbhLUQrd (ORCPT ); Tue, 21 Dec 2021 11:47:33 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E91AEC061574 for ; Tue, 21 Dec 2021 08:47:32 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id z29so54312052edl.7 for ; Tue, 21 Dec 2021 08:47:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qgzoOjuixCPGD3DrGcfNRG0OiVFUDG2snsOsT7Z+aWs=; b=GfZb8I6uUXmA3ugHIvVwpvC75DFWqQ9FTrkYC+xshHSAlo0PBtBwr7JyaJl6qNUSCK /NZ6dgKqVNXMkHXcvp8keaHOhC9o7qT5Z9WQn7CLE9/9acgQ9bSYnrzfhgtyY4icBoFS S47vPFEUe8cwXS+Xtn4fDGjQIFrraNgMjP/RQf4KV17CZAV6Gs6jpwglRvHOcqHDpJaL 5hGWYcKtbkA6Zh2tnyqRJAbPS1yb272ZLAfgQMP1sImvfwE59amNwt1QMBPS3ZrdCfQA wgF9LuSmes4YJDeRDmkhDeZ+UoZ5SxTFUH9cTHgpFrJY/OB3ks5+8yfIUcc0dhJH3lWj tiEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qgzoOjuixCPGD3DrGcfNRG0OiVFUDG2snsOsT7Z+aWs=; b=pcqabkCcI7AnZJmfC0rWOm4Gv1vlfATHLCCPUqpaG9rd+f1WGdtH2RojfqN3SgTGP6 giQCpSx6dV19/2wnZrCuLt4SmceNl4EGYQcVXhoLdKYuhbphYbBXYY78+Yymu8GrT506 zuoxY9NpBwg+GoMUi6bGXUOWTJorjQgxepdipfTZCwL+2GE3mCQ8x+zJXlxzySZSiGtG vS0Hx739gh2nl+sEDGoywaOFm95aq/H6k2mXgg6xnole4HM0ant32s8FtrI6Zi2UI68S iTiHfWq0nSsQ6eUEZsoz03bGxIrz8RyyP7OcHA9U53iiNpZV9xtAhulagVQH2XDPQZt4 bGow== X-Gm-Message-State: AOAM530PV09GNHfV0EsuDYeFjvL1rFNYXWy5zLwGBJyJw6uqpR1vtrEV Gf9LPLhtqTNG6j9wRqpaOxZcKDhz0nTn2m4dk2beZQ== X-Google-Smtp-Source: ABdhPJwDLPCgB8Wi8VYCO/jFHJtdzGpyco8O0RmQmiFpE9YLdKzudzKph06jI7RIeEBybqsLVIoSLRUWzWUsqlZzMAA= X-Received: by 2002:a05:6402:1c08:: with SMTP id ck8mr4115171edb.32.1640105250601; Tue, 21 Dec 2021 08:47:30 -0800 (PST) MIME-Version: 1.0 References: <20211220210643.47842-1-pmenzel@molgen.mpg.de> In-Reply-To: From: Guenter Roeck Date: Tue, 21 Dec 2021 08:47:19 -0800 Message-ID: Subject: Re: [PATCH] CHROMIUM: i2c: Add device property for probing To: Dmitry Torokhov Cc: Paul Menzel , Wolfram Sang , Rob Herring , Mika Westerberg , Furquan Shaikh , Greg Kroah-Hartman , Tim Wawrzynczak , coreboot@coreboot.org, Matt DeVillier , Felix Singer , Duncan Laurie , Benson Leung , Furquan Shaikh , Justin TerAvest , Guenter Roeck , linux-i2c@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , linux-kernel , linux-acpi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 20, 2021 at 1:49 PM Dmitry Torokhov wrote: > > Hi Paul, > > On Mon, Dec 20, 2021 at 1:07 PM Paul Menzel wrote= : > > > > From: Furquan Shaikh > > > > Dear Linux folks, > > > > > > Google Chromebooks are often built with devices sourced from different > > vendors. These need to be probed. To deal with this, the firmware =E2= =80=93 in > > this case coreboot =E2=80=93 tags such optional devices accordingly =E2= =80=93 I think > > this is commit fbf2c79b (drivers/i2c/generic: Add config for marking > > device as probed) =E2=80=93 and Chromium OS=E2=80=99 Linux kernel has t= he patch at hand > > applied to act accordingly. Right after the merge, Dmitry created a > > revert, which was actively discussed for two days but wasn=E2=80=99t ap= plied. > > That means, millions of devices shipped with such a firmware and Linux > > kernel. To support these devices with upstream Linux kernel, is there a= n > > alternative to applying the patch to the Linux kernel, and to support > > the shipped devices? > > *sigh* I should have pushed harder, but I see it managed to > proliferate even into our newer kernels. Not having this patch should > not cause any problems, it can only hurt, because the i2c core has no > idea how to power up and reset the device properly. The only downside > of not having this patch is that we may have devices in sysfs that are > not connected to actual hardware. They do now cause any problems and > is how we have been shipping ARM-based devices where we also dual- and > triple-source components. However if we were to have a device that > switches between several addresses (let's say device in bootloader > mode uses 0x10 address and in normal mode 0x20) this "probing" may > result in device not being detected at all. > > If we wanted to do this correctly, coreboot would have to implement > full power and reset control and also add drivers for I2C controllers > to be able to communicate with peripherals, and then adjust _STA > methods to report "not present" when the device is indeed absent. And > note that even in this case we would have issues with "morphing > devices", so coreboot would also need to know how to reset device out > of bootloader mode, and maybe flash firmware so device can work in > normal mode. > > However coreboot does (or did?) not want to add code to handle i2c > controllers, and would like to push this knowledge to the kernel. And > the kernel does know how to handle peripherals properly, but that > knowledge lies in individual drivers, not i2c core. > > We should remove "linux,probed" from coreboot and not propagate to > newer Chrome OS kernels, and keep it away from upstream. > Revert from chromeos-5.15 is at https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/= 3350347. Everyone please feel free to comment there. Guenter