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 2CB3DC36002 for ; Fri, 21 Mar 2025 16:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gokYmuCz+d878rm6OfSggP+CqtKOR5gWa6e/pu4wID8=; b=id9Vox0wz3g9Lq yZatTXImjkhAxCBGEHqxLJIEQZnWhzxLCqWFqu8mIMSL3Bw7xqrZCMAEk7JX85NW82nLX8fimaYnu 64WJDtvYOvvMngxUreONVSrKz2yCJwzAlvBlFqdJdJ2C8V+KPyGqMedkjVcCP8YAw7o+eX7xeSGPX AhGfoaSvSAdAid4sUENBv+ak06tEZu/KvNiD9WjqFTNVqIj5rVSuE07K6vjHcZYYspHeXDmd6fQJF n3OQs/5qAr35BPVr8AYzSTk+R7YNHJRxLuEYUR7wwAvdUjXdb5fPJadfHfW5r1ahLuCWYTUFIHMgC uV1qj5AH+VxXJc34RZ2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvexZ-0000000FRDx-0PAm; Fri, 21 Mar 2025 16:11:01 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvevt-0000000FQq3-1IwS for linux-rockchip@lists.infradead.org; Fri, 21 Mar 2025 16:09:18 +0000 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 52LATB1S022185 for ; Fri, 21 Mar 2025 16:09:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= fdOuElFLpccoJsuXgqKPQO+xF/9Y5vee1gm2/OiO0Gw=; b=MBt27kD4ga1ISE1Y oYW+r5SB7YuIJ+WP2qd2UrnA9bVoMbvLpp5Ag6nBiypSs0xrww2+q4JskgZvPgEh FfXtDFZQSKbkuuGSua1GvghQRGqBh+9M0S6PEv7JSilvs2kl6QO1uM2FN2H7Zjnr LDT7PioLyMjyMH0rl3DqPfPkkWX9cjW4KzssK3WpktwvD0pvXnotcSGd2uKYVkCB JM/Tqlr0ZQUgjKJTcL48w3PJVc/nAGf82cwFwiuHmOegvi9e+AD/uQwQWf5RFnOc sVLDE2CO6twu/klPDlOell0cX7YaIgiWxafKlBrI1ye4lLVmpLJdRKzyD+3HWF3K IrpZ2A== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 45h4wph7uf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 21 Mar 2025 16:09:15 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-224347aef79so50435195ad.2 for ; Fri, 21 Mar 2025 09:09:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742573355; x=1743178155; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fdOuElFLpccoJsuXgqKPQO+xF/9Y5vee1gm2/OiO0Gw=; b=Y34sSZ1PUlTa7/OMWtZmzc1Izr0/mJUGML4d95pQ06raZYA4sDux7Ot1IFEKQR3nFI FnYonVz1A0add+HMQog5T9X93Bup+v1x6Xhsv5IsSbqsJQMKhvr8Zar+wvNMlnlBHN4u HWMP7DKEO+NykmuWdig7CCSuFjFw7bql2lvv+1jwFqNXCU/EL+v26GjwPbF1D73xfJk7 WCUp4rIVpRwALRGQ52wsmBntKwm3k5ZDA1/lbMaaeMKMb1mA8caRLb9qhPIu0TXu56z/ F4ieF/Azu9gX8BgCO0tJqsVEZjctlhG2J0ZfaASj0Rr8uvUBXa+mhwSIbQrbeCTTOo1S trlw== X-Forwarded-Encrypted: i=1; AJvYcCWzW5Zo2LmjQWv2aw0/zU94U9DTodKOL977+cf+ay0R39hEEUpNwPLr7/u6heUJnhQFUcTChXipJHlUcM+57A==@lists.infradead.org X-Gm-Message-State: AOJu0Yy3c9hfUUf9lUz4oBjEemCsc27s0KKdf03VY7XfEVCK9mAokxX5 rcJEVTy32xsaXn3p0ftyT6HG+QPkBsIyIX9YpPg/8xG3Wvd+c8XZl4/pHFPatF1pR5671Un/bIi 8LMzqmvnQY7ecBgMkhCaqrQ4uHzL+EkG9TwKjAeb1NRwe4uoDuj/OSpKXnzwKt49gYZb1tTA= X-Gm-Gg: ASbGncsunUSVUVsUiDaD5Z65KjhmA2p4WskGxJHZu1a9nOGPOQw0NTxLLzxxPGcTzC/ +PLxviCP0CrXGo5vz44sXADCJB3ZhAxpKP1L2wG51Z+OZbP9/XFV3h0gm5/QRohJi5cMEn7b6BO BYNWgzKAOfIW56fRtuxJ+ET0JHrIlfMMSErSxCl0kQWu5Jx7qco98PQMGSLAm6YoaqrR37eYnGk OWy0KZzoJLzKVuD16yf23Y1FGg4kGS2nbu42kUGHr4Tbb/AxpcyVZJWKys3ATMtiS8NwxlLOmRG yJWfzWTgEtof7FMwAq6JuTnqW1Q5DEWSiZq/ejvm+KQxO4NJAGcOcvaXzLbXceNVzA== X-Received: by 2002:a05:6a00:4f81:b0:736:5822:74b4 with SMTP id d2e1a72fcca58-73905a530a9mr6797779b3a.21.1742573354382; Fri, 21 Mar 2025 09:09:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGL5fYByHbvsD/gRtsSQfXYP8pBS52gj7BStPaMfEBPmc/gB4ybx9sZflEDEhvH+V7H0dixLA== X-Received: by 2002:a05:6a00:4f81:b0:736:5822:74b4 with SMTP id d2e1a72fcca58-73905a530a9mr6797719b3a.21.1742573353797; Fri, 21 Mar 2025 09:09:13 -0700 (PDT) Received: from [10.226.59.182] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-af8a27de717sm1957838a12.12.2025.03.21.09.09.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Mar 2025 09:09:13 -0700 (PDT) Message-ID: <4d617199-191c-47d9-a0f1-5bf9c149d09d@oss.qualcomm.com> Date: Fri, 21 Mar 2025 10:09:05 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 6/7] accel/rocket: Add job submission IOCTL To: Tomeu Vizoso , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , Oded Gabbay , Jonathan Corbet , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Sebastian Reichel Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org References: <20250225-6-10-rocket-v2-0-d4dbcfafc141@tomeuvizoso.net> <20250225-6-10-rocket-v2-6-d4dbcfafc141@tomeuvizoso.net> Content-Language: en-US From: Jeff Hugo In-Reply-To: <20250225-6-10-rocket-v2-6-d4dbcfafc141@tomeuvizoso.net> X-Proofpoint-ORIG-GUID: 0Jv7NAR6-5Rql1kS75LhnsHax4sFtHtQ X-Proofpoint-GUID: 0Jv7NAR6-5Rql1kS75LhnsHax4sFtHtQ X-Authority-Analysis: v=2.4 cv=ZN3XmW7b c=1 sm=1 tr=0 ts=67dd8f2b cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=Vs1iUdzkB0EA:10 a=otp63fjl-Mw8CRR8ssMA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1093,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-03-21_05,2025-03-21_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 spamscore=0 mlxscore=0 priorityscore=1501 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2502280000 definitions=main-2503210118 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_090917_466262_8A59A072 X-CRM114-Status: GOOD ( 17.55 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 2/25/2025 12:55 AM, Tomeu Vizoso wrote: > +/** > + * struct drm_rocket_task - A task to be run on the NPU > + * > + * A task is the smallest unit of work that can be run on the NPU. > + */ > +struct drm_rocket_task { > + /** DMA address to NPU mapping of register command buffer */ > + __u64 regcmd; > + > + /** Number of commands in the register command buffer */ > + __u32 regcmd_count; > +}; > + > +/** > + * struct drm_rocket_job - A job to be run on the NPU > + * > + * The kernel will schedule the execution of this job taking into account its > + * dependencies with other jobs. All tasks in the same job will be executed > + * sequentially on the same core, to benefit from memory residency in SRAM. > + */ > +struct drm_rocket_job { > + /** Pointer to an array of struct drm_rocket_task. */ > + __u64 tasks; > + > + /** Pointer to a u32 array of the BOs that are read by the job. */ > + __u64 in_bo_handles; > + > + /** Pointer to a u32 array of the BOs that are written to by the job. */ > + __u64 out_bo_handles; > + > + /** Number of tasks passed in. */ > + __u32 task_count; > + > + /** Number of input BO handles passed in (size is that times 4). */ > + __u32 in_bo_handle_count; > + > + /** Number of output BO handles passed in (size is that times 4). */ > + __u32 out_bo_handle_count; > +}; > + > +/** > + * struct drm_rocket_submit - ioctl argument for submitting commands to the NPU. > + * > + * The kernel will schedule the execution of these jobs in dependency order. > + */ > +struct drm_rocket_submit { > + /** Pointer to an array of struct drm_rocket_job. */ > + __u64 jobs; > + > + /** Number of jobs passed in. */ > + __u32 job_count; > +}; These 3 structs will be different sizes in 32-bit env vs 64-bit env. Yes the driver depends on ARM64, but compat (32-bit userspace with 64-bit kernel) is still possible. They should all be padded out to 64-bit alignment. When you do that, you should specify that the padding must be zero, and check for that in the driver so that you have the option to use the padding in the future. _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip