Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp590524lqp; Fri, 5 Apr 2024 03:05:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUNRQZsqOdlxhHpLy5E/Hacv69Ixl3hkDi/agmDm5KBw2olsjoIYN/HK2vzCQ0QGss5Ri9PM+1pHFmXjhyDqIR3zbBy/EanzD99lzGOOA== X-Google-Smtp-Source: AGHT+IH1qO+g5I6TwkyoR7VYlRttNZR0pJpWfizfmob0JKrpJSf+KMQsEXA7IbvI9QuB9qIGAosz X-Received: by 2002:a17:906:717:b0:a51:a488:9213 with SMTP id y23-20020a170906071700b00a51a4889213mr636110ejb.17.1712311544602; Fri, 05 Apr 2024 03:05:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712311544; cv=pass; d=google.com; s=arc-20160816; b=Y2eA+vgRA6IqPsFf4hB1TBqJI+TgFj42jt1OFZ8W+/MmqmgXduS1pgN0ACDgMh7SeE Eu+ALHOlBSapzPvvck+EDPQ8gI7/jYWH9jMD4RmmY7PodqCF/2+BiJIptaqOzfvZhyld 7oV7U0FesSWClQrQquuIUew4BP1rM0gEPIt8dk+a6JAWUuEIQOL8+mmMgU96tD1Yas2Y /jw24ak2ksIdYncu1pSuTjrsoy9aTkH7GsGF2b27Y6K+9o9pfZ3owyX4BRk4k+BN/kYT FeYroV7jPUOX4UywrclD4pdXVHIVbEs0H4/BL/K2aIEzzX5ngTqe0yoFlK8kolzoRZvS AxSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:from:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=WwcV05X3lqi4MM+buZxa5Jcly8fqYYsYkniToo40n50=; fh=H9JccmSFEOjaNqE6my0e+xhoQXVH2FqZcw6bCd3sqlw=; b=jD4FresOra1FKuzr5LC0umdKts+7vE5jOZ5kWZEwkUr5/Ph9+KOQ9A45WxdrRaTsGw X6L2tNpL/9pJgoTkucZz5rmVxycS3B8Qq02q0ntknN5apaFAbuuD7XYu8GKEe/K0KLcc I1pPrvkQ4mvC1ul1m91JdYuJE+ZWRRzY4+foftw1dI6ykujhzJ9ly7cPoXwb6nBuwxiN Ky8G8nGmzHpEoX4vEviltXv29T81/KgjAzZ+AtTpAkdFwx3S4u4B1ZCK/3x5ghGZsrBA 4kIRpKsO4b/IsP+e/Ff0wxjqhaoJxwLjWx30mFpM4fXz6XwlAD9OpJ6/8MbUjhHk7q1E soZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Npm0cDWT; 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-132790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132790-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id la24-20020a170906ad9800b00a4752e0f8b7si553341ejb.989.2024.04.05.03.05.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 03:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Npm0cDWT; 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-132790-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132790-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 2C0841F23181 for ; Fri, 5 Apr 2024 10:05:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4686D161920; Fri, 5 Apr 2024 10:05:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Npm0cDWT" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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 A02A0161907 for ; Fri, 5 Apr 2024 10:05:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712311525; cv=none; b=IQvIMYWw3joyCiaPtdvZJ2fVimVtGW1eJkMwu4x9oL67DgCpwSW08XYZ6aaqKhOTSFRBLcW6i2jcGY8Ri9dLvjbRAprMuxvtso8pw+w/hFvX3sq7EBYAigS/Q1ESDRbn5LhioihOmuEPh5yIrMqNU/U4pVbM8p4rMYoFEwYoxaM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712311525; c=relaxed/simple; bh=5faoT9xunTo9gmrfIgQNKCITOx66fCo3gMcXas4GecM=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:Content-Type; b=ZR6fuwkPCAwGP1BFD4PO/K3ReKmO24Os630JbRJrnR/PCf3m1aVAwvbIfji3QZ/wMtzUDfcqvx2b05G9rPsm1/SabqGGG06q/DQQeXe8tAPqdf7ByuNceswFa86GneDVeqKhayCyT4/8ksFd9R1dhzDBdftCF8vjJLfc/dpE+sw= 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=Npm0cDWT; arc=none smtp.client-ip=209.85.208.181 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-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d4a8bddc21so25312331fa.0 for ; Fri, 05 Apr 2024 03:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712311522; x=1712916322; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:from:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=WwcV05X3lqi4MM+buZxa5Jcly8fqYYsYkniToo40n50=; b=Npm0cDWT7zT0KM1edc2dkRy9SPK6iBF80s0AqPGNYSoi92cDbMHdk25VKESGV3KG8G HLzgvDAjp2cwKDHnyJyzJ/0rxrvPrWTsTm0TA6Yag/O1rH9dHByhDTCqMzmXmGVgYoam XBtM14eJ+mzZbeMg0Fz0S7hw0nrl2yvHkhbup6hw2LifBT+yMhckns4+Ze9Psr4gxKQ1 b10FAoqQWFBEx5pfPeenJZzCHXZvVxqUsuspTRUhOPmYv454/d+vfTyRQJARmZjJwXzk s64n5TdAQxWJVch7f78ycZXPvJFg+Lacux7DfqONl7kNLkLnSjdvdoXdpkm4/z/HfMDm U54w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712311522; x=1712916322; h=content-transfer-encoding:cc:to:subject:from:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WwcV05X3lqi4MM+buZxa5Jcly8fqYYsYkniToo40n50=; b=JksuGg+8XSFEPT4h87cLd7TjMYaLh0wIqZlBoMTL9mgzBtfuZMt8UXNnxtRN8JRqmD +9baElFg6bjJ8KhpD5tO+rDkmTWDewm+n9jtmr4nX85gnTs1DOIct4xKYCaRVrrYYSIM Bmoz93wvQpltnEQlXBBcdC2mernaI57kdjE4tbzArFMzWLcbHQjvsU6Nm4dxUWfGT7bx QX2Ns+Tz4CjFpCfdD3ExReV3Yu2+OaDxU/YTbsPVNQij2q/cA+g8G6yUEoFx4OQsADW6 uNtVXKOxsCYqCTY9MRaNi8A0EVselCRujsJLfybpzkodzVxdkgbgslGkrkJiO7Z9aUm6 2S1Q== X-Forwarded-Encrypted: i=1; AJvYcCU8ShRYUvci+/ODZ+gONmWQZjOUo3u2iGKbEQO4OZGdFfug1WZBF7K6FG6rpyeT1x/AYNzPeqz9bhvmqoTO6ho3Nf4td8oM6Vks3afC X-Gm-Message-State: AOJu0YxWk4DTMsSjFoySv+idflHoBiMnkLBAOZUaQVBIG6LyFi/uLfeK wIoU07ysjdQA6bkgkwrpMQd3j3ML7wAwz42mZr+T9+JGjAmN23plHvSPODy/5EY= X-Received: by 2002:a2e:9b0b:0:b0:2d7:1830:d5f9 with SMTP id u11-20020a2e9b0b000000b002d71830d5f9mr742081lji.31.1712311521856; Fri, 05 Apr 2024 03:05:21 -0700 (PDT) Received: from [192.168.2.107] ([82.76.204.14]) by smtp.gmail.com with ESMTPSA id u11-20020a05600c210b00b00414674a1a40sm2312275wml.45.2024.04.05.03.05.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Apr 2024 03:05:21 -0700 (PDT) Message-ID: Date: Fri, 5 Apr 2024 11:05:18 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US From: Tudor Ambarus Subject: GS101 pl330 AxCACHE To: Arnd Bergmann , =?UTF-8?B?6rmA7J6s7JuQL0pBRVdPTiBLSU0=?= , Vinod Koul , dmaengine@vger.kernel.org, bumyong.lee@samsung.com, surendran.k@samsung.com, l.stelmach@samsung.com, m.szyprowski@samsung.com Cc: linux-arm-kernel , linux-samsung-soc@vger.kernel.org, "linux-kernel@vger.kernel.org" , =?UTF-8?Q?Andr=C3=A9_Draszik?= , Peter Griffin , William McVicker , kernel-team@android.com, Sam Protsenko , Krzysztof Kozlowski , sugar.zhang@rock-chips.com, Alim Akhtar , Sylwester Nawrocki , Chanwoo Choi , jassisinghbrar@gmail.com, "Simek, Michal" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi, I'm trying to enable the pl330 DMA controller in GS101 and I'm facing some problems related to AxCACHE. I'm writing this with the hope that someone (from samsung?) knows a bit more about the pl330 integration and its AxCACHE use. For simplicity, let's consider just the DMA_MEM_TO_MEM case for the moment. With the current upstream pl330 driver I see that the dmatest module complains with errors like: [ 6572.661927][ T6358] dmatest: dma0chan0-copy0: dstbuf[0x18e0] not copied! Expected cf, got 3f Checked the downstream driver and found a fix: - desc->rqcfg.scctl = CCTRL0; - desc->rqcfg.dcctl = CCTRL0; + desc->rqcfg.scctl = CCTRL2; + desc->rqcfg.dcctl = CCTRL2; According to CoreLing DMA-330 TRM [1], the {dst,src}_cache_ctrl fields program the state of AxCACHE. AMBA AXI and ACE Protocol Specification [2] says that these signals specify the memory attributes of a request. - CTRL0 -> AxCACHE[3:0] = 0b0000 (Device non-bufferable) - CTRL2 -> AxCACHE[3:0] = 0b0010 (Normal Non-cacheable Non-bufferable) AxCACHE[1] bit is the Modifiable bit. I guess that GS101 can not meet the requirements of Non-modifiable transactions. But why? Culprit could be TREX, the non-coherent interconnect, which collects requests from different masters and sends the request to cache coherent interconnect and to System-Level Cache. But I can't pin-point the exact restriction that comes with it. Any hints here are appreciated. Thanks for reading up to here. Let's consider now the DMA_MEM_TO_DEV and DMA_DEV_TO_MEM cases. I guess that for simplicity the driver author chose to always set CCTRL0 for both src and dst regardless of the memory type, device or normal. This is possible because normal non-cacheable memory can be accessed by any Manager using a device memory transaction (see "A4.5 Mismatched memory attributes" section of [2]). This can be improved however, if we use CTRL0 (thus Device non-bufferable) for DEV, and CTRL2 (thus Normal Non-cacheable Non-bufferable) for MEM. I tried this suggestion on GS101 for a MEM to DEV transaction and I get timeouts. I tried the downstream driver as well. The downstream GS101 device tree defines all the USI nodes without DMA support, I guess the to/from DEV transactions are not sorted out yet. I enabled the DMA use for USI in downstream and ITMON complains with "Unsupported transaction error". Any feedback is welcomed. Thanks! ta [1] https://documentation-service.arm.com/static/5e8e25befd977155116a5ad9?token= [2] https://documentation-service.arm.com/static/602a9df190ee6824a1e02b98?token=