Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3087839rwb; Mon, 15 Aug 2022 17:49:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR53gvY15vltJ6dmzzJsYtmCkhAuo3AFhyITeKkZyh2p8qLV9d2UbFXoL1/VElTrpI9gMVMV X-Received: by 2002:a17:907:1608:b0:730:5ad0:ae1a with SMTP id hb8-20020a170907160800b007305ad0ae1amr12026152ejc.222.1660610997221; Mon, 15 Aug 2022 17:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610997; cv=none; d=google.com; s=arc-20160816; b=uujajLWV3/QBgZuS7moJlT/Qh99Zm4Uz/rvp2Sz+LZe/bkvnH5GD0EJLIOb31MD6PP QFNVM+4B0ePCLCeZE5qRHs6cYx7rrPWZdlbBl4g0FBBoQFURRGgVT24kV1zuMEa8Bai3 bMISbvuKJHKEwB62/taqW3anJEm3ymvPiLHjDjAp1iT5SCjJFZiN0DmTa+GmTLHKAc7f 86nI9KAw0E4xZ/vvi/FO7/xF2JS/1uTMXL5yjELl4o2xuVe6r/w42/xGwqLV9yIp4jAw 1XyoMxhMOcRyweJpLSG5gAlJetFyD8CY/TRUQifZS9l03rupJnEq4oKd1GXCojr1Nw1g YRFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3dUHSnNzSYWRE87CWkwcpvfo3X8Ogkvykn5IE4Hf9E4=; b=OyTGfIQtAtN8vBUiVuI5DwCsHdMkiC6uCeTGtVzcs6gUfD9/evTzV4VHIBvtKCDwaM kp4/x6uUnRsIuT9x415x1Ge0n1AuXXs/XNU7nHNkKX+PK16+Yi3LyWjAI0jXMKCS4mNI 3nNQPWf2ryJYZJzlmdQ2gnVMMz2PrXHjx7l5wlcU7jCDRhxSXk6geQdtrXrrlTig/3Bi /xHQ0bTN2hTJ9jWlKwo1NaLt6UginOTnuCtRAFzPayuDoCJ6at+xUNd2Obf6BoWdMadF mLKktxlDKh8mXf26R7eaAbx3HawNzGuAmp8C9NyRAqkBw/5Xy541Tjas1lSXh7B6Q348 7C1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSs2OMEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l14-20020a50d6ce000000b00440072d0ae3si8971636edj.196.2022.08.15.17.49.32; Mon, 15 Aug 2022 17:49:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZSs2OMEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354734AbiHOXuD (ORCPT + 99 others); Mon, 15 Aug 2022 19:50:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354424AbiHOXp2 (ORCPT ); Mon, 15 Aug 2022 19:45:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B82A689923; Mon, 15 Aug 2022 13:14:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4399160B6E; Mon, 15 Aug 2022 20:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33662C433C1; Mon, 15 Aug 2022 20:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594456; bh=9O9iAJb5khkUCY/Vmag+s/+bSwnnOfdvyRWWB2nxb6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZSs2OMEfOWqp0kkbNdbGTbyp0vqbTz70tWLqdE4QcHbETr3CIo3EAu0fIplbo/PCa UFEVhzgVOquGvqr6sMMTknIxVRea4FT80shrje3dpPV8ghFKTtB8DL8ObUsuZVYAZG 8m51H3ZuzlQb6IjSpv6GMpJ2R1ToHuIvm5qYLC0E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, AngeloGioacchino Del Regno , Houlong Wei , Irui Wang , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.19 0454/1157] media: platform: mtk-mdp: Fix mdp_ipi_comm structure alignment Date: Mon, 15 Aug 2022 19:56:50 +0200 Message-Id: <20220815180457.757333630@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: AngeloGioacchino Del Regno [ Upstream commit ab14c99c035da7156a3b66fa171171295bc4b89a ] The mdp_ipi_comm structure defines a command that is either PROCESS (start processing) or DEINIT (destroy instance); we are using this one to send PROCESS or DEINIT commands from Linux to an MDP instance through a VPU write but, while the first wants us to stay 4-bytes aligned, the VPU instead requires an 8-bytes data alignment. Keeping in mind that these commands are executed immediately after sending them (hence not chained with others before the VPU/MDP "actually" start executing), it is fine to simply add a padding of 4 bytes to this structure: this keeps the same performance as before, as we're still stack-allocating it, while avoiding hackery inside of mtk-vpu to ensure alignment bringing a definitely bigger performance impact. Fixes: c8eb2d7e8202 ("[media] media: Add Mediatek MDP Driver") Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Houlong Wei Reviewed-by: Irui Wang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/mediatek/mdp/mtk_mdp_ipi.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_ipi.h b/drivers/media/platform/mediatek/mdp/mtk_mdp_ipi.h index 2cb8cecb3077..b810c96695c8 100644 --- a/drivers/media/platform/mediatek/mdp/mtk_mdp_ipi.h +++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_ipi.h @@ -40,12 +40,14 @@ struct mdp_ipi_init { * @ipi_id : IPI_MDP * @ap_inst : AP mtk_mdp_vpu address * @vpu_inst_addr : VPU MDP instance address + * @padding : Alignment padding */ struct mdp_ipi_comm { uint32_t msg_id; uint32_t ipi_id; uint64_t ap_inst; uint32_t vpu_inst_addr; + uint32_t padding; }; /** -- 2.35.1