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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8652FCF31B9 for ; Wed, 2 Oct 2024 13:10:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=d+vo+CngfnFXF6+FSmqK0SlB5GNZMtMWx22seKJwNuI=; b=SU38bmkEkiXESGIr4g/3MgOMk3 NYGcFYbRGxTnrQtETi2vmcJLBRRX/Y1pUEneYmN+tOm/k0rIN7UHIrQlDVdKyf0OjxHWgwRBTLWwf i40pWpXmySkbG2CrfBJIs0tFysBhHAMSA0ag5fkhuvmo38J8RSMOkyhLf+ywcMTuVE/QsDVaR5yAc etM8GNvC5oeKBnpDxUy+YlifmVlstxok+5hc155vkTC/ONuOAVTvaMmd3ZILVL2h19cA4o7/8N/bo UdDnBNMs3gF28b4elmrF92buqaaSfKACaHZqFyLAfaxXUxwAGy/kN5pORo1Z3+S/V1EOdvRgwQOhK QBsjHYDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svz7W-000000063Y1-2OLz; Wed, 02 Oct 2024 13:10:22 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svz5Q-00000006379-3T6a for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 13:08:14 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-37ccd50faafso4359109f8f.3 for ; Wed, 02 Oct 2024 06:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727874491; x=1728479291; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d+vo+CngfnFXF6+FSmqK0SlB5GNZMtMWx22seKJwNuI=; b=EghcPljCTN/YN5PPxsivp6CNdUr85F4NY+iTkPctboxYEdHZKv1WsWME3kIbqL0KLu usaKamhYFeucnWmX6nPCcTrUTGQacTJtAltTzW3lFcvdCafvS9JXjMtpTql41rrN+zlI aAjhhweP9cTOq/quN9zLT1H/vPvhj9Y9cEfUa+hwc+2yC6Ok/GVjHRcSg7G8LGaErIHn aqZ55Q8Lu+BNMxETEoMtjrnJKitT4DNW7Ifz2EkanRG1BD/bnUT8XX+LfIxHDLufRynf Sh1zaC3vr0QWGJyBPJefqWxulifLWd13pumTjGp/opXq7xxq8hnObR7vMcuqioAET3wr nebA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727874491; x=1728479291; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d+vo+CngfnFXF6+FSmqK0SlB5GNZMtMWx22seKJwNuI=; b=o4jKPLWZ/xdUGGcMtL1EjoIeuj4MK3xqkTplqkSAKErFjOadcY4KnDijhy2ctlMgKI Rh8PF7m6BsRITF/fY81hPYt0f57TRdqVnNUclNiGPLMv0bPfmfaEHyTOdjyeJa5bGCiG OCsuHzw1SQcD9NRa7YqPrP11KuHXEZ1FKM7TZ0CWgipAZNzkPxipZfzJP1v6FoE41Kl7 0TwdD5xUN9dAETZLeJ5+P0U512RjqeMg1QTnZk2Xmek7/ihAmFG7nWNKUskOmrj11T2l Ec3y469W2T0W8i9dXCS0+pw/V6GA5DZpWjFH2liP8gOh/40D0vx6hLO31DP+VmEBwsF4 mFIQ== X-Forwarded-Encrypted: i=1; AJvYcCUVSgiP9JrkExwjriaXI2e9/VkBPuMnAYev09ewIgP2LiUxav7cUg6P2IyJVW3PyhS9AQwVcQyNS5PWKaKnlHTw@lists.infradead.org X-Gm-Message-State: AOJu0YyUVVsWEBxYsRMQZ1xQdUotDhUFC83mEoOJWpZjdtZfM2ZMvvS2 pzLDNNiS9oktoTIEGKWswpLn2wfp53DOAXU78u4spn6p3txKeow9 X-Google-Smtp-Source: AGHT+IF9FentvtlBTj0QFbrVHmGbx05S13YBVweR1DdtG3DoyI9laTrIrlgQf/nES/TeKn6ouzVbXg== X-Received: by 2002:adf:8b5d:0:b0:37c:c832:cf9c with SMTP id ffacd0b85a97d-37cfba1239dmr2358739f8f.50.1727874490800; Wed, 02 Oct 2024 06:08:10 -0700 (PDT) Received: from eichest-laptop (31-10-206-125.static.upc.ch. [31.10.206.125]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cd56e6488sm13956736f8f.46.2024.10.02.06.08.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 06:08:10 -0700 (PDT) Date: Wed, 2 Oct 2024 15:08:08 +0200 From: Stefan Eichenberger To: Arnd Bergmann Cc: o.rempel@pengutronix.de, Pengutronix Kernel Team , Andi Shyti , Shawn Guo , Sascha Hauer , Fabio Estevam , Frank Li , linux-i2c@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Francesco Dolcini , Stefan Eichenberger Subject: Re: [PATCH v4 3/4] i2c: imx: use readb_relaxed and writeb_relaxed Message-ID: References: <20241002112020.23913-1-eichest@gmail.com> <20241002112020.23913-4-eichest@gmail.com> <6b070948-cf02-4f13-a220-0f6cfa21c41a@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b070948-cf02-4f13-a220-0f6cfa21c41a@app.fastmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_060812_885507_9D8B8B23 X-CRM114-Status: GOOD ( 20.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 02, 2024 at 11:51:22AM +0000, Arnd Bergmann wrote: > On Wed, Oct 2, 2024, at 11:19, Stefan Eichenberger wrote: > > From: Stefan Eichenberger > > > > Use the relaxed version of readb and writeb to reduce overhead. It is > > safe to use the relaxed version because we either do not rely on dma > > completion, or we use a dma callback to ensure that the dma transfer is > > complete before we continue. > > I would still consider this a bug in general, you should > never default to the unsafe variants. > > If there is a codepath that needs the barrierless version, > please add imx_i2c_write_reg_relaxed()/imx_i2c_read_reg_relaxed() > helpers that use those only in the places where it makes > a measurable difference, with a comment that explains > the usage. I added the patch because of the following dicussion: https://lore.kernel.org/linux-i2c/ZpVWXlR6j2i0ZtVQ@lizhi-Precision-Tower-5810/ I can't determine if the relaxed version improves performance. The 'normal' version worked well for our use case too. Therefore, dropping the change would be acceptable for us. Another potential solution could be to use the relaxed version only inside the ISR. Would that be an acceptable solution? What is your impression, Frank Li ? Regards, Stefan