From mboxrd@z Thu Jan 1 00:00:00 1970 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 6ED64C433FE for ; Fri, 28 Jan 2022 14:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346071AbiA1O64 (ORCPT ); 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-Google-Smtp-Source: ABdhPJyoeuHdawWTX1fkovIXW+x8syaFep3Ntoh7Frv6h+Ux1STXcUY9n7FibfP1dz5lmL8j7eyJT0dQ+q10aFblEzE= 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 >