Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2734101pxb; Mon, 31 Jan 2022 03:11:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQFK2dTJoOk7KY8UlBd6F5LrWwcdZMRKS3kbL8F9JJqUFLP7qiu+zy6rw14hEP1v+EWAJn X-Received: by 2002:a17:90a:cc15:: with SMTP id b21mr24151719pju.153.1643627463229; Mon, 31 Jan 2022 03:11:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643627463; cv=none; d=google.com; s=arc-20160816; b=VPvuvgj57HAQvgz7vFzHiB75LjJvdoyupNA1CNTcoVvZvJf7wrR9cIywd+c+urMmwL VuM5GZBxa9heMJ2qLYY1deEUW3v03uZnlNvLkuGSf7PO8+3zvS3aEmtm5yBCqi1b9JdA t0QZO++fP5AFow550MpsNaW1QPEK7iE9n1U1QNCn1nsA03lBblhG9Lc5Q6mnEgET2Xjr nLXb/K/XPhHUGZ50VmCVJvc71qZl7x5gUabCEReV7OJo6Hg4tzKC8zeWJSeJ9CZFBqSQ 58uF7oeb+D88nNv2txoqnfjn5p/+Z/XSctpuHzamFfUB/uGYmOobcUzt+hDZJaam2y5X 5R3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KHGm27mRNAvmdz8X1HGEOFhtT+fnoAeLqf/TbX8jecs=; b=GZCj9tpgPouowGRVhR97TPZEG47Mi5+h/F/eJqlX3QGtermWLeQpu4ZB8haDUZZHOi 6dhrC9b8miPSKEX1aiJCtj2ykqBkG26dlIT8okHzJvand0HfjuO4ORgvO9YVh3FPLiLE 41Y7IUMW9EIGFSECl3rSQJkrgFV0l4kukzHSd6In77FxkENchJ8T7mpAEb4VMDK1UtH7 cOHYSoVOANhv04456EbkNyZtjdKaPAtAxbukU9Er1HlUCjc57jBu2YUNPBZxQbfbCnAf j0XjFhKzQpIToVD5j6gUEdphGC5/mNfCH2k1E6c1UDhFWdprUXes3v/DGEhXT77HRSfR oPyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=QX96t5ue; 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 q13si14627516pfl.35.2022.01.31.03.10.52; Mon, 31 Jan 2022 03:11:03 -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=@semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=QX96t5ue; 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 S1346027AbiA1O64 (ORCPT + 99 others); Fri, 28 Jan 2022 09:58:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242261AbiA1O6z (ORCPT ); Fri, 28 Jan 2022 09:58:55 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27240C061714 for ; Fri, 28 Jan 2022 06:58:55 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id h20-20020a17090adb9400b001b518bf99ffso11179483pjv.1 for ; Fri, 28 Jan 2022 06:58:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KHGm27mRNAvmdz8X1HGEOFhtT+fnoAeLqf/TbX8jecs=; b=QX96t5uexOK585+jsEWZcsn9OlOppUJtIL9dCbdq90ZkD6G/9EK7dl6ftkdDLv3SJ4 297H8HUCpS2thXv3WKzXQL3oq7nyvVTZZMw0b3gNjn0YSYt854ImR+jeHYxWHlR1eXUC UPN1WJmL9qha17aftZUm790Ha3WN4wsQsSQSUTD5CU5L5AD+c3Q1WVqdEQoowep4o8i5 gnPVhkh1qy44EHNatFuSaiLTDv4QW6KRwOSd3IX9gTJXcYKaHbrTVpkJKWwcqgSTj9JS 7WbK+BbgOY+JGFEBdbxRzB/qC8aljsrCaL8wXzRLdMU8RqnVEnWw6ahz3L1Ny6c5klRg eN4A== 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=KHGm27mRNAvmdz8X1HGEOFhtT+fnoAeLqf/TbX8jecs=; b=dHK7zVco6KQQi9BMDK8Gi+Av25c5GcshVZRYOPF/sOn0Ut/rAXrixbiSlH39Q0IBIC HDO7GPZZs6RUscAkNc44r3otXvu9pYvlhAdS6yKgquHE+oGVfv7gy9UVzuFjh28fhrwS qaagCFhioHoey9a/+WSELfJ+sRtINcJoTUfkrg44/RUUVEEC7bacpx8AQkNsVlIiTiCs 86kC5fkJvsRunovkW5I7APOJxx9AHnjnuN8RtEgw+l/Sj0SsIKoKFmrzgTf+YHtaCl4B Mr/eO62kkAG0l2jRs24RAeyS78waifQSvwcrjGX2W2RJQ5wPx0oYcCX5XQ234hWD/Bdv /NZQ== X-Gm-Message-State: AOAM533+6igljYcFjjOWxeNKuFZnUh8HOqsFlfurxk8lCFXQBRgT1eNT s2goSOqLP8C51UNsOnxxf34SLirgPckxNesiO27J7WhNAtV+qQ== X-Received: by 2002:a17:902:d48a:: with SMTP id c10mr8691771plg.139.1643381934663; Fri, 28 Jan 2022 06:58:54 -0800 (PST) MIME-Version: 1.0 References: <20220120001621.705352-2-jsd@semihalf.com> <20220128144811.783279-1-jsd@semihalf.com> In-Reply-To: <20220128144811.783279-1-jsd@semihalf.com> From: =?UTF-8?B?SmFuIETEhWJyb8Wb?= Date: Fri, 28 Jan 2022 15:58:43 +0100 Message-ID: Subject: Re: [PATCH v2 0/2] i2c-designware: Add support for AMD PSP semaphore To: Linux Kernel Mailing List , linux-i2c , Jarkko Nikula , Andy Shevchenko Cc: Mika Westerberg , Hans de Goede , Wolfram Sang , Raul E Rangel , Marcin Wojtas , Grzegorz Jaszczyk , upstream@semihalf.com, Tom Lendacky , "Deucher, Alexander" , "Easow, Nimesh" , "Limonciello, Mario" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Adding proper Andy's email address (and removing wrong one) in the whole patchset. Sorry for noise! Best Regards, Jan pt., 28 sty 2022 o 15:48 Jan Dabros napisa=C5=82(a): > > This patchset comprises support for new i2c-designware controller setup o= n some > AMD Cezanne SoCs, where x86 is sharing i2c bus with PSP. PSP uses the sam= e > controller and acts as an i2c arbitrator there (x86 is leasing bus from i= t). > > First commit aims to improve generic i2c-designware code by adding extra = locking > on probe() and disable() paths. I would like to ask someone with access t= o > boards which use Intel BayTrail(CONFIG_I2C_DESIGNWARE_BAYTRAIL) to verify > behavior of my changes on such setup. > > Second commit adds support for new PSP semaphore arbitration mechanism. > Implementation is similar to the one from i2c-designware-baytrail.c howev= er > there are two main differences: > 1) Add new ACPI ID in order to protect against silent binding of the old = driver > to the setup with PSP semaphore. Extra flag ARBITRATION_SEMAPHORE added t= o this > new _HID allows to recognize setup with PSP. > 2) Beside acquire_lock() and release_lock() methods we are also applying = quirks > to the lock_bus() and unlock_bus() global adapter methods. With this in p= lace > all i2c clients drivers may lock i2c bus for a desired number of i2c > transactions (e.g. write-wait-read) without being aware of that such bus = is > shared with another entity. > > This patchset is a follow-up to the RFC sent earlier on LKML [1], with re= view > comments applied. > > Looking forward to some feedback. > > [1] https://lkml.org/lkml/2021/12/22/219 > > v1 -> v2: > * Remove usage of unions > * Get rid of unnecessary __packed attributes > * Switch to use iopoll.h and bitfields.h APIs were applicable > * Follow the convention to check for the error first > * Reorder entries (includes, table entries) alphabetically > * Add necessary includes > * Add Kconfig dependency on X86_64 > (above two fixes for "kernel test robot " issues) > * Modify probe() to use terminating entry for traversing through table > instead of ARRAY_SIZE > * Fix typos in comments > * Rebase patchset > > Jan Dabros (2): > i2c: designware: Add missing locks > i2c: designware: Add AMD PSP I2C bus support > > MAINTAINERS | 1 + > drivers/acpi/acpi_apd.c | 7 +- > drivers/i2c/busses/Kconfig | 11 + > drivers/i2c/busses/Makefile | 1 + > drivers/i2c/busses/i2c-designware-amdpsp.c | 373 +++++++++++++++++++ > drivers/i2c/busses/i2c-designware-baytrail.c | 10 +- > drivers/i2c/busses/i2c-designware-common.c | 12 + > drivers/i2c/busses/i2c-designware-core.h | 18 +- > drivers/i2c/busses/i2c-designware-master.c | 6 + > drivers/i2c/busses/i2c-designware-platdrv.c | 61 +++ > 10 files changed, 489 insertions(+), 11 deletions(-) > create mode 100644 drivers/i2c/busses/i2c-designware-amdpsp.c > > -- > 2.35.0.rc0.227.g00780c9af4-goog >