Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp693565pxa; Wed, 12 Aug 2020 11:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwixnriHHkzxj+TlxP/WxumVaEIz4hA9qUt5Ij+jEAzdIXRZQC68Q09RVhLkGodwqBnKxkc X-Received: by 2002:a17:906:3b83:: with SMTP id u3mr995890ejf.55.1597255707118; Wed, 12 Aug 2020 11:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597255707; cv=none; d=google.com; s=arc-20160816; b=SeUSysbs8wor5cD9IGAN7n3rUtF1zvkK5UYw65xo30rxNLiQU8uun2xKUY1Ae8q3rG nuFMkbLm2anFEl/AwJLwuVmJ5E6Ff2m0wCiNLb0qqEP04W0/de0kqGRQ5rVuE0OIorq9 UN2MD04hLenwCtv1brovusYcqfZzcZToUDfFUTtvEheX1VBGqVoO0EDRobZoMU3gHiF5 kmJEeCzkv/9GMZAZRJvgC0sOImpTr3WL+T7rGDZSp4fGWPHl8fwhpNcCrWzPfy/dNtFd SdFyURek9vZfTXmrycbUHzIfrmkD8CoqRwr6/054DAQZsPFNeokV8TBuSZmSGXCiteNC KHlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=FPM/BpxL7oHk5NwDUOl9GJEl4QuvKvovtaLxj5QbinM=; b=bvpO6DMDcPtGwUlNUZlzFZMyJmWEI7qsFZ+lFwUcVHguq36Pkvdl8KGuLTFCr8RuQu 4CeaahqhCveKTHboLHmEdJfRifhh1J5cPunlnkeEou6JAEUQe3AhdKnBELUbYadmJyu/ Y4gawL0vudOCtHsXlRaLFy4lptY37lRm87q2RwFSgscFjfVyJTxrqVcr81xu38NUPCUD TTbjadwOzQwYtUKpXktpEwzd3hxn1uYkVF3WuKjsrqnae2mxE5SjoQBW2iHC+4W6fT+f yCYHzBQUvEw+BsAHMYE069uS5u3FsOzmvUJQo9krGGqCnno92FTicWX1KL8ZkSJfxJ79 ovVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=dPPr77PP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si1685346edx.426.2020.08.12.11.07.49; Wed, 12 Aug 2020 11:08:27 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=dPPr77PP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726640AbgHLSHS (ORCPT + 99 others); Wed, 12 Aug 2020 14:07:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726554AbgHLSHQ (ORCPT ); Wed, 12 Aug 2020 14:07:16 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52DE7C061384 for ; Wed, 12 Aug 2020 11:07:16 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id b2so1442072qvp.9 for ; Wed, 12 Aug 2020 11:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=FPM/BpxL7oHk5NwDUOl9GJEl4QuvKvovtaLxj5QbinM=; b=dPPr77PPopJMkB3J1yt/ankUvINgjFbRtn7AMXcoTxgOv4Qnz8BmX18CGvnpDoNboC RdBfGamTp+ItJYrXQOhA+ATgJhrWxC7oZXQM5Q3E+IC333XHrA35Xgpiz1g1+eCk0g5J LHWdw0LwJi+FdGosEZll1xe5ub1affO7TItKtEmD4+bYgbMaujsZ0HkQBmx7hCRhE7gs ASP2oWwiikGuPIVN/TUiCMTWTtuyO/dChqvWVOrNOEVrbSokdAWF52h4N0xNIypYkucn Kw88wjXP6RrYAG/5c+SbZ7RH91UXZN+awliP03byg6ZCTl62qFsjos/SZlDNZZuljdig wIhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=FPM/BpxL7oHk5NwDUOl9GJEl4QuvKvovtaLxj5QbinM=; b=erVzlRoBUQ4SNCIYkyFvxcnT0WrAbKDvrAlSY8kj0sv9x+I9kxbPC9m/Vt80d2xuUo A6cgYRmVRKVIr0I+9+t+idbNKPnwEMtIo2Pb3W7IJ8ZEkw/U6Xi8qWIXB72cc7zN2P2u Sa382hu0eT98xjspCekwiUZeK2BRqpAKMgIjQd2Mp9enygv/qEcLDfYSfRoD4msqkNYk 97qPAYFQltHj0XbM7WAbhZW/LW+Xf7EexwfnoDUsDBMwMK1ZfFYEk/B0G0krV5nxJN5F yz7T6t/54G7s3vVoGIetwNJSmItku8uXQy6v7iO0TAB7gOuoa8lRm0sUvHZvyTdh+jVa kejA== X-Gm-Message-State: AOAM532zkH07KUWv0x9on8gdua2a9bmbOMqqwc924hCEG6k78M2Khlpu pBs3Cd+7E8vVL9KpOf2EMTkPYoUna1RRMZZSf6WKdw== X-Received: by 2002:ad4:5502:: with SMTP id az2mr839333qvb.148.1597255635563; Wed, 12 Aug 2020 11:07:15 -0700 (PDT) MIME-Version: 1.0 References: <20200121134157.20396-1-sakari.ailus@linux.intel.com> <20200121134157.20396-6-sakari.ailus@linux.intel.com> <20200311085555.GH5379@paasikivi.fi.intel.com> <20200323213101.GB21174@kekkonen.localdomain> <20200810082549.GD840@valkosipuli.retiisi.org.uk> <20200811080009.GE840@valkosipuli.retiisi.org.uk> In-Reply-To: <20200811080009.GE840@valkosipuli.retiisi.org.uk> From: Bartosz Golaszewski Date: Wed, 12 Aug 2020 20:07:04 +0200 Message-ID: Subject: Re: [PATCH v4 5/6] at24: Support probing while off To: Sakari Ailus Cc: Sakari Ailus , "Rafael J. Wysocki" , linux-i2c , Wolfram Sang , linux-acpi@vger.kernel.org, Bingbu Cao , linux-media , Chiranjeevi Rapolu , Hyungwoo Yang , Arnd Bergmann , LKML , Greg Kroah-Hartman , Rajmohan Mani , Tomasz Figa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 10:00 AM Sakari Ailus wrote: > > Hi Bartosz, > > On Mon, Aug 10, 2020 at 08:12:00PM +0200, Bartosz Golaszewski wrote: > > On Mon, Aug 10, 2020 at 10:26 AM Sakari Ailus wro= te: > > > > > > > [snip] > > > > > > > > > > Rafael: I think that there are two issues with patch 1/5: > > > > 1. It adds a very specific boolean flag to a structure that's meant= to > > > > be very general. As I pointed out in the i2c patch: at the very lea= st > > > > this could be made into an int storing flag values, instead of a > > > > boolean field. But rather than that - it looks to me more like a > > > > device (or bus) feature than a driver feature. Is there any ACPI fl= ag > > > > we could use to pass this information to the driver model without > > > > changing the driver structure? > > > > > > To my knowledge there isn't. The fact that I=E6=B6=8E devices are pow= ered on for > > > probe in ACPI based systems is specific to Linux kernel and not ACPI = as > > > such. > > > > > > The reason this needs to be in a generic struct is that the device's = power > > > state will be changed before any interaction with the driver takes pl= ace as > > > it's the I=E6=B6=8E framework that powers on the device. > > > > > > > I'm not sure I'm following. Looking at patch 1/6 struct device already > > exists so why can't this information be conveyed "per device" as > > opposed to "per driver"? > > It's both driver and device. > > Suppose there's no indication of driver support. If you add the property > telling the device shouldn't be powered on for probe, it won't be. And if > the driver doesn't support that, probe will fail. That could happen e.g. > when running an older kernel on a system that happens to specify this > property for a given device. > > You could view this as a driver bug of course. I still think it's better = to > make driver support for this explicit, and avoid making this a practical > problem anywhere. > I see. I'm not sure this is the correct solution but let's see what Wolfram says. From my side: I'd prefer to see the disable_i2c_core_irq_mapping converted to flags first and then the flags extended with whatever you need. disable_i2c_core_irq_mapping could also be removed AFAICT - nobody uses it. Bart