Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4446505pxb; Mon, 21 Feb 2022 21:54:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhMualPYeJdjmnYt9VIJ9AexPZC6IBf09C8/t8ZbdEGWuO6iSX1ea1yNfYINCYKQmTTetx X-Received: by 2002:a17:902:9348:b0:14d:8ee9:329f with SMTP id g8-20020a170902934800b0014d8ee9329fmr21397400plp.80.1645509241059; Mon, 21 Feb 2022 21:54:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645509241; cv=none; d=google.com; s=arc-20160816; b=YliL7hehTGrbch/JXAXibhNJRfv0oXI8WM2Qm8JlW7COojiCf1Q/GZEHGqN1ErPcX6 3t0tfbRPQC0SklP+cNFhs+oK2aiRcTIBgM7ZUFKMi2ow036xGZRkcZ1A+9VlEpF/y+4Y 0gfugwxDZrWXVnmP2sYY6ampHJ8lcMPw9m+4hzmicpuJBmb4+UBeQmczbZtRXo5pnNQ4 zL+IGSP6cWGKN1b4QGFIHmJy96OzD4+I64DhCQjUZK9Kaexqf3B01F2nVt904td8m3pg Z1HfE0ebMwxt6EQRWlk3wKUNkljDmCQKT9uj1reljxDM4drfRMX5m0bP1Mk0qSF4qOqk +WHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GiBDC4NrOX8UwcznWIOERNhc3u5ACgSxBptO6DWd+2Q=; b=OPZizq+uojW5WAOh9lDgTDO+CuQzUTKMBvzO2XEgFnunJxIHSgctxh/8D5IBaV5/52 NTbAcSwTFkU5DZTPLoD3SEj6slzVPtf8ubVXGRsAXke3RpAHZLQDnjJHsAl6O+3DicpG wH+RghDeFVn0b8jAJORW+rPFnk8w5qMAmo93IlCADP97Nv5qdsj49bg/CZ1CFwhidwJ1 W1UPVyr9sIq+qKlgELS1dt4ZS3EWLZ70YDVhqgERSMnit9FG2oUStYduie0Lr3T7dg6y Pvya5QU3/splScK4rxaEaGfs8rtGUbCyNYcfGjfQ61XxPdZdbGU7dfIoLkDkqvpody95 CnxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e92JXaCZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 142si11377506pfy.162.2022.02.21.21.54.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:54:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=e92JXaCZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7C1F53EA89; Mon, 21 Feb 2022 21:16:49 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbiBUTJ7 (ORCPT + 99 others); Mon, 21 Feb 2022 14:09:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232658AbiBUTJz (ORCPT ); Mon, 21 Feb 2022 14:09:55 -0500 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 183C819C23; Mon, 21 Feb 2022 11:09:31 -0800 (PST) Received: by mail-ed1-x531.google.com with SMTP id m3so25395315eda.10; Mon, 21 Feb 2022 11:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=GiBDC4NrOX8UwcznWIOERNhc3u5ACgSxBptO6DWd+2Q=; b=e92JXaCZb6LAJISQYrOD/RcnTqGgZnfGKmpzUXnFJEYgL+KJA6xCoFGGJaxCAGSQBi t4YXSIjPWYTyCNZcbsADf6ERExszQIvxgCCR0aijB084zwS9oAt0+8F9hNyPXXD9Xo6D isPe8pw3R3SijuH7hs/ig3QPV9CkA3hlK3WJVGXjBjUklC+7Pdvb8fG4STKfQ+eKUVgx yi6nPg7TtDYCGIBxv5Kpx0ue6457fE3stz2ZZYPyFX4QkWUMRZWUez+ydUnrbqCevcfA 5/W2J5JjNKtBoF2rPq1+bRKo81wPKnVbkiXpGInArBrUyKLTPpcKFegQ3DL0LsrgKX2y BwGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=GiBDC4NrOX8UwcznWIOERNhc3u5ACgSxBptO6DWd+2Q=; b=m42y1U4tbT8BXQu0YForV8WMbE1gFq9AujEb0oeoUKmtLyHnb9/ZpBEJj70U91vlka b77FCQGmJH6J2mFzJb75lYXktbjfZ6Cb+LNPks0cfpTlUZsgnBkmvxfoBhQuAXZOY+L1 ADZtXD8uBWGaemvpgHtszRpXM9tNlozLfGJXutRbS9Q/LF1uC9J6W3e3s5siFHQBTKIu fsIefXVPUEPaJx0YzJVZz/fghUGGxs/DL28MpsopWEuGuI3oNasGcRzEOoHEKIJnlnpm GEO6shNzpyCo2jN1FAOvSgTU7AY8YhFTMf1gn2cgWUi3rxL8bkOIp/sLHcb5LVRJEaXr FnTQ== X-Gm-Message-State: AOAM532tE0r1gi0n5V2H9YusajwN5ho5ZrEDAmTCtNSwydSf5FXJs99Y cpe7paZdWOPbCd7W2wIa6xI= X-Received: by 2002:a05:6402:50cb:b0:412:ab6d:c807 with SMTP id h11-20020a05640250cb00b00412ab6dc807mr21726221edb.382.1645470569495; Mon, 21 Feb 2022 11:09:29 -0800 (PST) Received: from skbuf ([188.25.231.156]) by smtp.gmail.com with ESMTPSA id y23sm5557003ejk.153.2022.02.21.11.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 11:09:29 -0800 (PST) Date: Mon, 21 Feb 2022 21:09:27 +0200 From: Vladimir Oltean To: Alvin =?utf-8?Q?=C5=A0ipraga?= Cc: Linus Walleij , Andrew Lunn , Vivien Didelot , Florian Fainelli , "David S. Miller" , Jakub Kicinski , Michael Rasmussen , Alvin =?utf-8?Q?=C5=A0ipraga?= , Luiz Angelo Daros de Luca , =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 net-next 2/2] net: dsa: realtek: rtl8365mb: serialize indirect PHY register access Message-ID: <20220221190927.5rb2vz5jj3ky324z@skbuf> References: <20220221184631.252308-1-alvin@pqrs.dk> <20220221184631.252308-3-alvin@pqrs.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220221184631.252308-3-alvin@pqrs.dk> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 21, 2022 at 07:46:31PM +0100, Alvin Šipraga wrote: > To fix this problem, one must guard against regmap access while the > PHY indirect register read is executing. Fix this by using the newly > introduced "nolock" regmap in all PHY-related functions, and by aquiring > the regmap mutex at the top level of the PHY register access callbacks. > Although no issue has been observed with PHY register _writes_, this > change also serializes the indirect access method there. This is done > purely as a matter of convenience and for reasons of symmetry. Reviewed-by: Vladimir Oltean