From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5F331514DE for ; Sat, 22 Jun 2024 13:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719064752; cv=none; b=XKY3ymjKzQnb6lrof2N2b4/GuFCqhZ/3OOcFxpeCUEzAfSPa0xr1a6erWWhoQBO0+S9ipOWzb34HY3QQYpcZYfEJUieUATEWWa/KPcY2AWbltpSiLDUQOpG9rNzsnCD7iBSoREKPUHFfjbXD3VqTEnrDXwYkZLVIPgD0mao/11s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719064752; c=relaxed/simple; bh=Hlncw3D0np0NO7WdEKuXDozD6V+UiHGgPNvAKMVaGUc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Yap6Gd//zw35DM5mLoifsF3J7hTqVOOwYK0HdEXuKWBJGg8wZCcwnZosYcLMggGk+mGBYg8zifPmBo5AD6f9NJ4zYLzzZaVUkbPX7+vOH7KCynHcQxbZNBup6u6NntEsz5Ts2KIgmcaDPx1w/q1b5Deuk+sfQu0QMQuazD6LsOo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Nu2qdadx; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Nu2qdadx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719064749; 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=gPYbXApe3OM15mkD3VSRDUdygVNd6ij8zbxEegihFXY=; b=Nu2qdadxg2IBeuBXrVhssq3mNAff2B5E3cQcgN9+b8ZIGSzQcsB/mLQBrCK9v4k5FYMMFg z1h56td3sn1Ee/dL2y9tndwTDYivJ6aOzczVpr4GKgM7iu1hAsHC1k7vWABntyXuK2u8bS 7FdenEh72WUNB2/716GbPwAsr9lIoHA= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-150-e2ZHiJZBM2iaVjCNPDrMPQ-1; Sat, 22 Jun 2024 09:59:08 -0400 X-MC-Unique: e2ZHiJZBM2iaVjCNPDrMPQ-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2ec5a297b48so745211fa.2 for ; Sat, 22 Jun 2024 06:59:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719064746; x=1719669546; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gPYbXApe3OM15mkD3VSRDUdygVNd6ij8zbxEegihFXY=; b=GJiUF5vbD8s99hjf3j9Rn2AGi4M3acxKTCennZYWwlhZTx6dMZkgbM/SX3nxrXMIjc 3jiBFyvfWszCx9p/pioPZ1AvKQ7dS97yjXgf7qcx7N+PaOIH5CRlf0JRBuxiOyfTQDgy Po1+B/KAe4kOwll/bvPFsbA9HdL7eogD1MPCjFwsDx/0v+YMC7I517BOBbmhNKaDOnFu MoWNDW67chGZ0qvrdhW6gSjlq8F1YnYNNhl9QXsyd4S6DSayElRHQvsG7vGsr0m7Pw8Q y+q0TI0gy6T2VJBWpGveboKs7bmufAqPCKEebu1aLY2L0aiWwrdmrppDg+AAaS4LoK6R dMsw== X-Forwarded-Encrypted: i=1; AJvYcCUiCsTGwle/zVIFcewrBugMa0fU3+rMnA9uRwHTtEmZOKrAbA/w17ZzwVkWMeF/Q+tmnDb2f1eW2yl0+egKV5eT6cVPIP0mpaQx+l9Ld8xTtZY5ZA== X-Gm-Message-State: AOJu0YzegiwNitTHl8tVKraNg0ueHmUZD7YlMSaf+Q5tJ9UTm+x8DzQW Mia1WMJtLZuAnMG8oY/ihLm55APzs0pviZKaqkxWwgu1BrGUC7zwQjHUssGoyYqWnIuEHQlZtwr FFmid+J7kIFuX7WG+DPHLK86/1qg6VLyRgsgGmepa7tNgw0KRwGCLjXnO0+KyRK4/DN43a80= X-Received: by 2002:a2e:998c:0:b0:2ec:543e:909e with SMTP id 38308e7fff4ca-2ec543e92cfmr11253041fa.15.1719064746651; Sat, 22 Jun 2024 06:59:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGq/Q0IipgcOSifv55wfdDD3wsLG6VhYCQeFdZ+AzWYdUNiSgyfCDKx7GXFE+bjm/sgw+qAKw== X-Received: by 2002:a2e:998c:0:b0:2ec:543e:909e with SMTP id 38308e7fff4ca-2ec543e92cfmr11252871fa.15.1719064746216; Sat, 22 Jun 2024 06:59:06 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3041208esm2373429a12.30.2024.06.22.06.59.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 22 Jun 2024 06:59:05 -0700 (PDT) Message-ID: <178ccb23-36cb-4f83-8cd5-caa35c37de63@redhat.com> Date: Sat, 22 Jun 2024 15:59:05 +0200 Precedence: bulk X-Mailing-List: platform-driver-x86@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/6] platform/x86: dell-smo8800: Move instantiation of lis3lv02d i2c_client from i2c-i801 to dell-smo8800 To: Andy Shevchenko Cc: =?UTF-8?Q?Pali_Roh=C3=A1r?= , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Andy Shevchenko , Paul Menzel , Wolfram Sang , eric.piel@tremplin-utc.net, Marius Hoch , Dell.Client.Kernel@dell.com, Kai Heng Feng , platform-driver-x86@vger.kernel.org, Jean Delvare , Andi Shyti , linux-i2c@vger.kernel.org References: <20240621122503.10034-1-hdegoede@redhat.com> <20240621122503.10034-4-hdegoede@redhat.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Andy, On 6/21/24 5:24 PM, Andy Shevchenko wrote: > On Fri, Jun 21, 2024 at 2:25 PM Hans de Goede wrote: >> >> It is not necessary to handle the Dell specific instantiation of >> i2c_client-s for SMO88xx ACPI devices without an ACPI I2cResource >> inside the generic i801 I2C adapter driver. >> >> The kernel already instantiates platform_device-s for these ACPI devices >> and the drivers/platform/x86/dell/dell-smo8800.c driver binds to these >> platform drivers. >> >> Move the i2c_client instantiation from the generic i2c-i801 driver to >> the SMO88xx specific dell-smo8800 driver. >> >> Moving the i2c_client instantiation here has the following advantages: >> >> 1. This moves the SMO88xx ACPI device quirk handling away from the generic >> i2c-i801 module which is loaded on all Intel x86 machines to the SMO88xx >> specific dell-smo8800 module where it belongs. >> >> 2. This removes the duplication of the SMO88xx ACPI Hardware ID (HID) table >> between the i2c-i801 and dell-smo8800 drivers. >> >> 3. This allows extending the quirk handling by adding new code and related >> module parameters to the dell-smo8800 driver, without needing to modify >> the i2c-i801 code. > > ... > > >> +static int smo8800_find_i801(struct device *dev, void *data) >> +{ >> + struct i2c_adapter *adap, **adap_ret = data; >> + >> + adap = i2c_verify_adapter(dev); >> + if (!adap) >> + return 0; >> + >> + if (!strstarts(adap->name, "SMBus I801 adapter")) > > With the comment on the previous patch I'm wondering if it makes sense > to have this to be as simple as strstr("I801") or strstr("I801 IDF")? We want the non IDF one, strstr("I801") would match both and strstr("I801 IDF") would match the one we don't want. > >> + return 0; >> + >> + *adap_ret = i2c_get_adapter(adap->nr); >> + return 1; >> +} > > ... > >> + info.addr = (long)lis3lv02d_dmi_id->driver_data; > > Hmm... Usually we use uintptr_t, but okay. > > ... > >> + if (strstarts(adap->name, "SMBus I801 adapter")) > > A dup? Is there a possibility it may go desynchronized? That is a good point I'll add a small i2c_adapter_is_main_i801(adap) helper for this for the next version. Regards, Hans