Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3364417rdb; Tue, 6 Feb 2024 15:56:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IGF1coX1ThHEQiyKcoMG7YyHYp+IIk8n5Jz6IlNodyi6aweywuy3yn1nmMIqgqF/1ciy7bp X-Received: by 2002:a17:906:5651:b0:a30:d5ae:2833 with SMTP id v17-20020a170906565100b00a30d5ae2833mr2886456ejr.56.1707263766305; Tue, 06 Feb 2024 15:56:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707263766; cv=pass; d=google.com; s=arc-20160816; b=UjJJoVef9I7u0MvbbY30cdF8ziAsR0zZdd11P2Ql3cqJgUZ2XRhukeCVBt0Ys4AVPE ba6LXnLp73E5I3pgzFkbjSsZylfdYde6/EVHa6txkyaqTJWfMEdrnHp7EsSkLQVhLjCK NeKZMfN0JZ58kkiCcaBMPuDtWJgAZmHUYaHY4IC/tZvoYOgEaEN9VOrUgyhxzvFhyefv ntTFeKfafl0w6zv8ENqBnwvTvaN9P0Tl6/ZW2JmwlPJtF1AuK8snygdPjc+/kjKGLVUT fT2Nv1p+UxVqxG5TJieXhRLa7dBk4mqMlbu4Cu9nEl9YaTu9f/828I/lb9lkY2G8OsSo JVvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=DtOrymEAdfT98LBNA0k140e2ceLpyomhr7hhmTPTgGQ=; fh=EjcxOuPwx0L9K8xFRVNUei1rw8CXN9UFyVCYb21SCz8=; b=IOTv7O9palP7z9uCTCq6/o4P3Ve6DEd+bjBKuBjFF92WYGfyTShgzyfJvN7JZ1xMsp ThpjmV1kDoZwq3CAs0uNyaNtf34RgaWDNtjsszFqcvkSTysgV/N8uhw3hW9KcqghXdtS lo+gMPAzhAiA6ep7bQY4RajYq1QDIJDuzTEeqzAn39yMC1oIsTT5FyIKzDHv945hccHi 275ZuFFKceREUl9DCxK7xMBCRFxFcVJoyPJjtCWMd1aZMjhKoonHoqaHWCBU5vvIVIxp U58llUvUtVyYoVWany0G6Fmr2/Dbx80XckkOKIoSYWNv/fBwrsuIipe3lJAKuixSXBev bfGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XJj13Rr1; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-55743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCU2rWwWFCOQwUdD4YI5lQl3CFWGS3TUxPw07+o8ZtLRG9Qje9OX4E4MZfgBgpPjtr91QrtDwUccH0n/oi9VyqGpZdJcSZGZm6+YjrHjSQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o24-20020a1709061d5800b00a381ceae672si95635ejh.761.2024.02.06.15.56.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 15:56:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XJj13Rr1; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-55743-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55743-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 106071F24510 for ; Tue, 6 Feb 2024 23:56:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF2E31CD30; Tue, 6 Feb 2024 23:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XJj13Rr1" Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D1F61CD3C for ; Tue, 6 Feb 2024 23:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707263756; cv=none; b=l8YkFEmwqhaeilHsNKx9RN6zxTAn5Y05J5+s7JMaIW5fiWjgDvr0dGUpAz+8rlo1RE9ODNdqdgU5lUwB4CvcxuRCdDN3e7rSQWYw1mkPbUFO+l6EIbDi6P0k/j/ljW59G7j55tAB3q42bFJQF+nxxT7PWvy0oiVdNwJCveDbNwc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707263756; c=relaxed/simple; bh=u0+U+SZx2w6pb8yMnsy3CSd5G/SWbrq5xPVhC79TTZM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nmZnPmNZCpMq68NuNCgY5Fk5zZfN9emBG5hSxHu+V3odGO86Fl1f96jmPd37nX7I0FWJUdwL6RjwayEU+K+P9H+JhRvEwkkPTM7Jv8/GkFLmNU5WGzUprY55Nvv2kZ2AWkXh9lULiIVix+zMm3vFTnkzM7idsC35ypts8XrLrDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=XJj13Rr1; arc=none smtp.client-ip=209.85.128.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-6048313efb4so648147b3.2 for ; Tue, 06 Feb 2024 15:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707263750; x=1707868550; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DtOrymEAdfT98LBNA0k140e2ceLpyomhr7hhmTPTgGQ=; b=XJj13Rr1oL5Rvei6RC06qnapIN1soQyz2XhKLC4l/XtthCUl9nnJD3PF4pDUPj6MyI 2PpjeQ6ghTtJOWfPRA9Ro2I8+Iujp78zbCLLdFL2Ict2gdg8FzVI3paeA1fYkkUIBfwy S4elsTD3Fn2ziWSpr2ypLRK4l8vofCNORR1Z1k31rSKK+g5r8HMV/t+tUdJidW9E5Msx EvNKlELxNFWMhiv+m/8RQojbp6/C+IrxmYbQ9CaS16v1sdyl0a0Td7EiYWT6fA9k5oYu cUYhdGyMNNzIYPLcU8l+XV4wcGE2cvFu0kn8PLSRQoleHVtpZr7YKgpYLFlXWo0JAF39 rt7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707263750; x=1707868550; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DtOrymEAdfT98LBNA0k140e2ceLpyomhr7hhmTPTgGQ=; b=XRtzhl3y1uD4VGrQWa3LVYdjWXgwE5r/+3ioSlC6YVlSDv79pCRe3bpdphMPJ3DER1 SK3US0y36z1gCQ6R4MAw2ofBGmAJAgCQrh2A1xOkfymAtZjg6ziCRgSNxfDZpukN6hZe YcMPAb0STB19AMBxAtFO+n4arpD0d1okvm0hv5xcNyEa96q/jfDN451PW/+j8coHsLgQ laIbh/5Csin/KpqOHBmpTlsu58yViHeE1cbq8xw9mpKtLmlgCAIXRNbnYRff/bkDijXv K3+yDgNO8Y+hx66I0q4EYG3o9MjcrXS2yBBSeLk9PVuTPOg7hXeD01JA80QnIA/Ip4/b lCSw== X-Gm-Message-State: AOJu0YxD38OCpbemXvTlc9UpaVSFxOwbNvUrPt95KI0XCG9nwpO/fZWU Rwfm5i+FG/MEc7I431aayblva2yVF3mgSg6aKreLFj8OAxTTzUU9O/yKx6ENAutl6gZXT9Tk32m daa1XYeyrLj8dz0o29pjrYyrqbDAoI3KRiIPABA== X-Received: by 2002:a81:f10e:0:b0:5ff:828e:20a with SMTP id h14-20020a81f10e000000b005ff828e020amr3418024ywm.48.1707263750656; Tue, 06 Feb 2024 15:55:50 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240207-spmi-multi-master-support-v1-0-ce57f301c7fd@linaro.org> <20240207-spmi-multi-master-support-v1-1-ce57f301c7fd@linaro.org> In-Reply-To: <20240207-spmi-multi-master-support-v1-1-ce57f301c7fd@linaro.org> From: Dmitry Baryshkov Date: Wed, 7 Feb 2024 01:55:39 +0200 Message-ID: Subject: Re: [PATCH RFC 1/2] spmi: Add support for multi-master To: Abel Vesa Cc: Stephen Boyd , Matthias Brugger , Bjorn Andersson , Konrad Dybcio , AngeloGioacchino Del Regno , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org Content-Type: text/plain; charset="UTF-8" On Wed, 7 Feb 2024 at 01:34, Abel Vesa wrote: > > Some newer SPMI controllers support multiple bus masters. > Such a master can control multiple slave devices. The generic > framework needs to be able to pass on the master id to the > controller-specific driver. So do that. The framework will > check if the devicetree child nodes are actually bus masters > and will register the devices for each master. The legacy > approach will still be supported for backwards compatibility. Please remind me, are those two actual bus musters driving a single bus in parallel or two SPMI buses being handled by a single device? In the latter case this implementation is incorrect. There should be multiple spmi_controller instances, one for each bus. Allocate them in a loop and set ctrl->dev.of_node after allocating. > > Signed-off-by: Abel Vesa > --- > drivers/spmi/spmi-mtk-pmif.c | 6 ++-- > drivers/spmi/spmi-pmic-arb.c | 10 +++--- > drivers/spmi/spmi.c | 76 ++++++++++++++++++++++++++++++-------------- > include/linux/spmi.h | 10 +++--- > 4 files changed, 67 insertions(+), 35 deletions(-) -- With best wishes Dmitry