Message ID | 20240301115546.2266676-1-tudor.ambarus@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-88378-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp1023342dyb; Fri, 1 Mar 2024 03:56:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXgtMCkmBPR1s2TwwDwEy30N3Mode1KGhlYY7ffx7ozQI0++V3AwCOwewe3DMnCAj6SjEVfd8LoSiRwODzLurVy+29/lg== X-Google-Smtp-Source: AGHT+IENjDTqJ3eTZtazWtEwyu0n0IfY00h9nKBBRc0rSi584TyFWVelKEhXUP90YZqxp9NXiM2+ X-Received: by 2002:a17:906:c49:b0:a3e:e678:556 with SMTP id t9-20020a1709060c4900b00a3ee6780556mr1084807ejf.58.1709294170181; Fri, 01 Mar 2024 03:56:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709294170; cv=pass; d=google.com; s=arc-20160816; b=x7y3YgWlsBTY4kHL/1Ps+EFcWnBRC9r6EQMXtM9EfP/p2P/CCAg7iUX0m3dAtBjuCW xJAl8s0oySJA+Y0qqEYa5Qu1LswnKIiP4fu+VsqdkxjO1lG16tt98zJL6LXxyP0MwOas FsHcYr2cp/PLPEZwyH5O9RbWvEYYLHSNi85+KeJzXiXb5IyE1mjMElxwfO+hshn++lBU FtEAwE+im5mDSxN+tjNiIagnY5z6ToyG0s/aFLVmZlYa/QxBsHTDy7HtlKXYEDxiVkw3 DoNgK+ZwO9muNHVaOazAt5j/0+rB8zj2fdwMH1Jjjp1nxYcLMVYguM9RDkIjms+03zeD 8nAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=PH9FTG8r38kw/2KGPIjmzvSzyg9hKHZV3106W9dU8K0=; fh=xF+ep8kFGqajOVL+dsenEWXWypDBZI8Gbaq3SBDXOe8=; b=bReX7X+DDfFMnruTJ+sZNkVEgIYnB1OLBjb1qNKYv/BauUX7HqHEaAYgjAsXzQjNoP 6WDsU/77ihIfdY1UQxAQu5C/ALjyKryz8EQH6z3htjWN8swhj+8fyCXRIikRzrfP4b5Y pBeokasGrbNltpZWY1jEVzGqiEihxKyYJnjFovPbiaAWJ8Zm0j2S49M+XBdRwSrxiKAV fK71vhMnJ0hPYT6shxLgCKtKiw0RqeAV8tOejjOO0xFOw4RdwKEhLP4RhociDrSTofR0 RPYnlUatXlcPKU0zofbcxLJVNrNpqo5CaQLVlVP3JjFSIThR/A8eEQnOgJxLZD2+STCg vXSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eIFn0f9H; 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-88378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88378-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qh18-20020a170906ecb200b00a44218b4830si1349536ejb.467.2024.03.01.03.56.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:56:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88378-ouuuleilei=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=eIFn0f9H; 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-88378-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88378-ouuuleilei=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 C70E81F229C5 for <ouuuleilei@gmail.com>; Fri, 1 Mar 2024 11:56:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9F2F66E2AA; Fri, 1 Mar 2024 11:55:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="eIFn0f9H" Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (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 2BB876D1AF for <linux-kernel@vger.kernel.org>; Fri, 1 Mar 2024 11:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709294153; cv=none; b=BhnJGsK6VMDc0zK/RwX+ZCtjsiiYQz7F/jV/38QHwJyuwbo+y0/HzEdNtLJ8msbCvQ9oGoWQkItLATwcleLsNaGbkCxoGsLlx/id7KQDTRZQErEVlmJR1ACPGmVa+7ZULtBvgALhJuz4NFvYyhYn4KhGCh8HidbXwwg56mFVosg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709294153; c=relaxed/simple; bh=9IBd4IHdnmgZMr9MhB2rgqeToI13RNjtnipSgmttHIg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=utptrseRaYzkr/xrh5bieOorikGCBzQ3eLhdbi1LjsxmNrsFcgUNsCfoRrNWD1n/76h9G0BqQfn2/37dNmgn3zzutRyeW2yykkgDXLeZZ8qhU9k8boLzDON7joIWMKnLVp4CoKmiOsAqhjQ6D7uXkFnW66B+dfa99q1ihYGONm8= 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=eIFn0f9H; arc=none smtp.client-ip=209.85.167.41 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-lf1-f41.google.com with SMTP id 2adb3069b0e04-5131f3fc695so2099536e87.1 for <linux-kernel@vger.kernel.org>; Fri, 01 Mar 2024 03:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709294150; x=1709898950; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PH9FTG8r38kw/2KGPIjmzvSzyg9hKHZV3106W9dU8K0=; b=eIFn0f9HdsKAjpJMPIO8Ee42E6ZkP04W4IggB97tcnZ1GKtBpqH1bSNQsr5wMT9bTO Y5t1ZdOwX56MmioM0UkWz/tUcL1rsbK8SarBRfQrrS/28usVFnviwKOljazO1XTM6kjM TnpMEVxWO3Z/BXWxCE5fWePDE56pzPBNtoyeZWgnO4T8tiehbXKXuZy/ArP5qjch4BVy nXbRFBO2jtL6Q77I3QOl8CrjPD47KgjJzgqNFCn7NYsfNbCl2kVfp/BxsJw4bEWEBXZg /hTouSIb6r6qTGdVVwEIjxhCnfTvp+hMperYaqykRoM2p/ZulvIIjZdOp9Xqsf/wv+ki M3UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709294150; x=1709898950; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PH9FTG8r38kw/2KGPIjmzvSzyg9hKHZV3106W9dU8K0=; b=GyPu3WZxKsxXNXe1Xy10zlUk1HpeBCfuWomMMR3TZiK5k313GD4c14YRf6v+xYWczc Z/pN46k0jsm+9Y5NWS67+NtWtHdTiEGPSQ3pvCblQU+5g0sjRQ2JzPa/Gp4LS0/MFTdA Xu/0COjCWs4UXKq2qVMPYSRgRIyt516LukK2zeaSNLtbG6GgFOrgibcNW3kI4Djy8Gp9 hzScOXFM9SquY5Z3GGqA7/qPvlk7a9ShcZ5YAzmezcj5SpegQqjTZ4MPPqBbhhb4QaOi g4yr13Hes/yHID4pKo3+7dV5O1/KOXPIxhFLzwdjVZQtVnmBUeGlu9QQodIZB/6xyNfD CAMA== X-Forwarded-Encrypted: i=1; AJvYcCUF48ZQbQqDTsG7WsUrVwCY4sAkqilfn48CmvmTQ60SH3Idpmp9nQ74FwiTczMsayBEPP2s+50+f5osK35GMxLt7kECSTYViwufg/bt X-Gm-Message-State: AOJu0Yzw5p8AOgKRllWdGSG8ekLuHisgO5lXIjgJbDsHXzG9aYE2nGGQ 4JcSJuQejKkjX+ZF3+cQM6YUXegVYnBh01m7MRN95ckxr0iHRqBhvDjTuwNfq8Y= X-Received: by 2002:ac2:4c13:0:b0:513:24b8:a7b1 with SMTP id t19-20020ac24c13000000b0051324b8a7b1mr1236878lfq.47.1709294150170; Fri, 01 Mar 2024 03:55:50 -0800 (PST) Received: from ta2.c.googlers.com.com (110.121.148.146.bc.googleusercontent.com. [146.148.121.110]) by smtp.gmail.com with ESMTPSA id i10-20020adff30a000000b0033b6e26f0f9sm4367674wro.42.2024.03.01.03.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 03:55:49 -0800 (PST) From: Tudor Ambarus <tudor.ambarus@linaro.org> To: andi.shyti@kernel.org, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Cc: linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, semen.protsenko@linaro.org, willmcvicker@google.com, kernel-team@android.com, Tudor Ambarus <tudor.ambarus@linaro.org> Subject: [PATCH] spi: dt-bindings: samsung: make dma properties not required Date: Fri, 1 Mar 2024 11:55:46 +0000 Message-ID: <20240301115546.2266676-1-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.44.0.278.ge034bb2e1d-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792324844089097742 X-GMAIL-MSGID: 1792324844089097742 |
Series |
spi: dt-bindings: samsung: make dma properties not required
|
|
Commit Message
Tudor Ambarus
March 1, 2024, 11:55 a.m. UTC
Since the addition of the driver in 2009, the driver selects between DMA
and polling mode depending on the transfer length - DMA mode for
transfers bigger than the FIFO depth, polling mode otherwise. All
versions of the IP support polling mode, make the dma properties not
required.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
Documentation/devicetree/bindings/spi/samsung,spi.yaml | 2 --
1 file changed, 2 deletions(-)
Comments
On Fri, Mar 1, 2024 at 5:55 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > > Since the addition of the driver in 2009, the driver selects between DMA > and polling mode depending on the transfer length - DMA mode for > transfers bigger than the FIFO depth, polling mode otherwise. All > versions of the IP support polling mode, make the dma properties not > required. > AFAIU, the device tree has nothing to do with drivers, it's about hardware description. Does making DMA properties not required here mean that there are some HW out there which doesn't integrate DMA in SPI blocks? Even if this change is ok (I'm not sure), the argumentation doesn't look sound to me. > Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> > --- > Documentation/devicetree/bindings/spi/samsung,spi.yaml | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml > index 2f0a0835ecfb..f681372da81f 100644 > --- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml > +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml > @@ -76,8 +76,6 @@ required: > - compatible > - clocks > - clock-names > - - dmas > - - dma-names > - interrupts > - reg > > -- > 2.44.0.278.ge034bb2e1d-goog >
On Fri, Mar 01, 2024 at 01:28:35PM -0600, Sam Protsenko wrote: > On Fri, Mar 1, 2024 at 5:55 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > > Since the addition of the driver in 2009, the driver selects between DMA > > and polling mode depending on the transfer length - DMA mode for > > transfers bigger than the FIFO depth, polling mode otherwise. All > > versions of the IP support polling mode, make the dma properties not > > required. > AFAIU, the device tree has nothing to do with drivers, it's about > hardware description. Does making DMA properties not required here > mean that there are some HW out there which doesn't integrate DMA in > SPI blocks? Even if this change is ok (I'm not sure), the > argumentation doesn't look sound to me. I do remember there being some SoC which shipped a SPI controller in that configuration for some reason. Possibly one of the OEM ones rather than one in a Samsung SoC?
On 01.03.2024 22:42, Mark Brown wrote: > On Fri, Mar 01, 2024 at 01:28:35PM -0600, Sam Protsenko wrote: >> On Fri, Mar 1, 2024 at 5:55 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > >>> Since the addition of the driver in 2009, the driver selects between DMA >>> and polling mode depending on the transfer length - DMA mode for >>> transfers bigger than the FIFO depth, polling mode otherwise. All >>> versions of the IP support polling mode, make the dma properties not >>> required. > >> AFAIU, the device tree has nothing to do with drivers, it's about >> hardware description. Does making DMA properties not required here correct >> mean that there are some HW out there which doesn't integrate DMA in no, to me it means that the IP can work without DMA, only in PIO mode, regardless if DMA is integrated or not. Not required means that the property is not mandatory, which is what I'm trying to achieve here. >> SPI blocks? Even if this change is ok (I'm not sure), the >> argumentation doesn't look sound to me. switching to PIO mode in the driver for sizes smaller than FIFO depths in the driver guarantees that all existing compatibles support PIO mode. Are you saying that if there is a physical line between an IP and DMA controller, then the DMA properties must always be specified in dt? I thought they can be marked as optional in this case, and that's what I did with this patch. > > I do remember there being some SoC which shipped a SPI controller in > that configuration for some reason. Possibly one of the OEM ones rather > than one in a Samsung SoC? with DMA you mean? Thanks, ta
On Sat, Mar 2, 2024 at 3:36 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > > > > On 01.03.2024 22:42, Mark Brown wrote: > > On Fri, Mar 01, 2024 at 01:28:35PM -0600, Sam Protsenko wrote: > >> On Fri, Mar 1, 2024 at 5:55 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > > > >>> Since the addition of the driver in 2009, the driver selects between DMA > >>> and polling mode depending on the transfer length - DMA mode for > >>> transfers bigger than the FIFO depth, polling mode otherwise. All > >>> versions of the IP support polling mode, make the dma properties not > >>> required. > > > >> AFAIU, the device tree has nothing to do with drivers, it's about > >> hardware description. Does making DMA properties not required here > > correct > > >> mean that there are some HW out there which doesn't integrate DMA in > > no, to me it means that the IP can work without DMA, only in PIO mode, > regardless if DMA is integrated or not. Not required means that the > property is not mandatory, which is what I'm trying to achieve here. > > >> SPI blocks? Even if this change is ok (I'm not sure), the > >> argumentation doesn't look sound to me. > > switching to PIO mode in the driver for sizes smaller than FIFO depths > in the driver guarantees that all existing compatibles support PIO mode. > > Are you saying that if there is a physical line between an IP and DMA > controller, then the DMA properties must always be specified in dt? I > thought they can be marked as optional in this case, and that's what I > did with this patch. > No, I would wait for maintainers to clarify on that bit. Change itself can be ok. But the commit message shouldn't mention the driver, because the driver uses (depends on) device tree, not vice versa. The device tree can be used in other projects as well (like U-Boot and OP-TEE), so it should be designed to be universal and not depend on kernel drivers. The commit message should be based on particular HW layout features and how the patch makes the bindings describe that HW better. It shouldn't rely on driver implementations. Also, it may be beneficial for reviewers/maintainers if you mention briefly (either in the commit message, patch #0, or under the "---" stanza) what exactly problem are you trying to solve in your case with this patch. > > > > I do remember there being some SoC which shipped a SPI controller in > > that configuration for some reason. Possibly one of the OEM ones rather > > than one in a Samsung SoC? > > with DMA you mean? > > Thanks, > ta
On Sat, Mar 02, 2024 at 10:23:16AM -0600, Sam Protsenko wrote: > On Sat, Mar 2, 2024 at 3:36 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > > > > > > > > On 01.03.2024 22:42, Mark Brown wrote: > > > On Fri, Mar 01, 2024 at 01:28:35PM -0600, Sam Protsenko wrote: > > >> On Fri, Mar 1, 2024 at 5:55 AM Tudor Ambarus <tudor.ambarus@linaro.org> wrote: > > > > > >>> Since the addition of the driver in 2009, the driver selects between DMA > > >>> and polling mode depending on the transfer length - DMA mode for > > >>> transfers bigger than the FIFO depth, polling mode otherwise. All > > >>> versions of the IP support polling mode, make the dma properties not > > >>> required. > > > > > >> AFAIU, the device tree has nothing to do with drivers, it's about > > >> hardware description. Does making DMA properties not required here > > > > correct > > > > >> mean that there are some HW out there which doesn't integrate DMA in > > > > no, to me it means that the IP can work without DMA, only in PIO mode, > > regardless if DMA is integrated or not. Not required means that the > > property is not mandatory, which is what I'm trying to achieve here. > > > > >> SPI blocks? Even if this change is ok (I'm not sure), the > > >> argumentation doesn't look sound to me. > > > > switching to PIO mode in the driver for sizes smaller than FIFO depths > > in the driver guarantees that all existing compatibles support PIO mode. > > > > Are you saying that if there is a physical line between an IP and DMA > > controller, then the DMA properties must always be specified in dt? I > > thought they can be marked as optional in this case, and that's what I > > did with this patch. > > > > No, I would wait for maintainers to clarify on that bit. Change itself > can be ok. But the commit message shouldn't mention the driver, > because the driver uses (depends on) device tree, not vice versa. The > device tree can be used in other projects as well (like U-Boot and > OP-TEE), so it should be designed to be universal and not depend on > kernel drivers. The commit message should be based on particular HW > layout features and how the patch makes the bindings describe that HW > better. It shouldn't rely on driver implementations. If the controller is DMA capable then it should have dma properties. The compatible should be enough to tell if it is a case of 'can only work with DMA'. Otherwise, it is going to be up to a specific user. Even within Linux, you may have a serial port that doesn't use DMA for the console, but uses it for the tty or serdev. Of course, if a new device is added without DMA properties and they are added later on, then they are going to be optional even though the DMA support is always there. I can't fully understand everyone's h/w. Rob
diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml index 2f0a0835ecfb..f681372da81f 100644 --- a/Documentation/devicetree/bindings/spi/samsung,spi.yaml +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml @@ -76,8 +76,6 @@ required: - compatible - clocks - clock-names - - dmas - - dma-names - interrupts - reg