Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6269230rwi; Sun, 23 Oct 2022 21:52:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM50z/inawxdw1X1wruLvV8D1bn3wdqDY894CaCXYcPAl4AQHSt6nBLA+3UuErtU5cH6C9Db X-Received: by 2002:a05:6a00:1c99:b0:562:6292:9e4e with SMTP id y25-20020a056a001c9900b0056262929e4emr32190446pfw.22.1666587141608; Sun, 23 Oct 2022 21:52:21 -0700 (PDT) Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id na18-20020a17090b4c1200b002130053cad7si4417535pjb.7.2022.10.23.21.52.10; Sun, 23 Oct 2022 21:52:21 -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; arc=fail (body hash mismatch); 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=fail (p=NONE sp=NONE dis=NONE) header.from=toshiba.co.jp Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbiJXEdE convert rfc822-to-8bit (ORCPT + 99 others); Mon, 24 Oct 2022 00:33:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbiJXEdA (ORCPT ); Mon, 24 Oct 2022 00:33:00 -0400 Received: from mo-csw.securemx.jp (mo-csw1114.securemx.jp [210.130.202.156]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19527753BA; Sun, 23 Oct 2022 21:32:58 -0700 (PDT) Received: by mo-csw.securemx.jp (mx-mo-csw1114) id 29O4WX1D015399; Mon, 24 Oct 2022 13:32:33 +0900 X-Iguazu-Qid: 2wGrYy8wQgAWV0xULn X-Iguazu-QSIG: v=2; s=0; t=1666585952; q=2wGrYy8wQgAWV0xULn; m=DPW8j72U1WrcwvAABj0KbT39wzyWneK7jEIjY+M50uQ= Received: from imx2-a.toshiba.co.jp (imx2-a.toshiba.co.jp [106.186.93.35]) by relay.securemx.jp (mx-mr1110) id 29O4WVOb032413 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 24 Oct 2022 13:32:32 +0900 X-SA-MID: 48169620 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bt0D4ArB2oWZkMRvHgBVqd+mQxczJXV47nJyC5TCq3Xp3HsXdRicQtejOzqNdAhcCtYrSeH1xQpIsa9/mSe6+GFsuC73YOBFm6Y6ekcYpowL9Ww198V53JTJxHpDnREcTH5amhuceO9No04ivnz/QcmU0i90ft4Sdfa/OhyEnpXEDVPw4oylVW7dyUq9bCAvRe5gl1q2s7UxdEhUfZeaNgfeueK/v9vIZUdH39Ki57b9jHeSy/0O3EtLaYCUdKZRK1+hRxRaSfL7X1f1f7SLzkYbkhdQvZR70ipEz6lpsePOX31F/MoC79gSRypwblu+4XN/G7ZYQlHOGtKbGho3ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bttP4DE0dD3pEtZbVmzWHkdWrRMY6dCs7ozusx2pzxc=; b=YMzUa7SgM+wbcOeHrkwgEqJrbV8iR2sdeEkTZ4QYY2jfQ/EMzIiTF8eVyntwnP9Qh10oqinWcXvAGt6FFs0wI3ryOQPDkyn44H7xRcjb2bldkjA1UZg1clEy9ak5RrPe2DGgWwNcr1e7mRgej4JLbsoTh9TkpYfLrJVbDj4WcGwM1nGC0P3NA8/fL9A0mswDuBY3rWKXHjVHXDWr/woqce4cJn7fjwuapNctnqb9oXDTcpb8kuhxNX5GbcrpiDsuISrO2Q53PbLEmEbLdV+PZCnFIlGBIUe09FAFu5EN0BLek7zVctoZpYS5id6ie0QaPmGUiZJauDzRfmQXEK9Iqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=toshiba.co.jp; dmarc=pass action=none header.from=toshiba.co.jp; dkim=pass header.d=toshiba.co.jp; arc=none From: To: , , , , , Subject: Question for an accepted patch: use of DMA-BUF based videobuf2 capture buffer with no-HW-cache-coherent HW Thread-Topic: Question for an accepted patch: use of DMA-BUF based videobuf2 capture buffer with no-HW-cache-coherent HW Thread-Index: AdjnYKQwg5kJk8s9S/Cvff5NBTRsiQ== Date: Mon, 24 Oct 2022 04:27:26 +0000 X-TSB-HOP2: ON Message-ID: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=toshiba.co.jp; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYAPR01MB6201:EE_|OS3PR01MB5992:EE_ x-ms-office365-filtering-correlation-id: 90ed0f6b-9488-4212-51d5-08dab5780e06 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tr7ztXMHUPLUIBFlCU493PVBKIQW4n2TeEPT9goodtwNbUZ54hy64IaFCHRVq/DUt4YTPr2JCi/zu/4JGFULGpgOYhUSZisunGgcyxFjprRi3kAXUCqDsHDTaGJ4bVAq+qP2sPMcgp2W8peTzXMGy6uKwIsgFPPNOzZyrx5ja5UEja7ZxrcbiC6y7eclxD1ahSiooTAYgJqn/sTKalTMdsFuQughJj1y1wH2HLkomO56gQImLKy872eVcA+ZLn6icGZtlpV5IIaJF7hlV//Xp7fHxzUrJkeAfy8BuExO9nB9FF3J4O0W42zEyBTBX16UFRPSEUY4TMuZcWx9HtGn0DjxXZyGXdDYlH6RyQuiklVwuvs0drzNaEYkaMmdIJQvVdEvamEm1MnNxPGkNjMZ0QdWLLWrmZuyAqB+TwrmyhdnPZi5jF/op2uYwtywsMXGmzrWqwj7r3CK4Tzpi9DQ5obJeu/90e/V7y7wJ1km6VfuNRqdplNPzs2ONWLJl90oEwIJ+IdouQglJH4nn2rStAuTF1rLEfQOCb5a8RBcAEv+YEvd96TEoVf+FSFBNiOqdovSPb6X5fHrMDx9/BtCNKSMxEQIZ9wPGOrjHUOK2Mhgur50IP9bXdk6VpgnhjurF7j6XKllDHPBjBBtGOIQZsL0TKuzP5u7a76fbsJ7hS9a9PEHBs8o7QqsKgn4BJ8hJnbfgR13+dc6E++623IjctpeVvoLwQaw9z+V/bJ0X99CCVzs7rDSBVPCuvusrxW6XYldqiy9V0QgYDvzdUhoYHjrt3buiT0wqrf/DveDvaw= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYAPR01MB6201.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(136003)(376002)(346002)(366004)(451199015)(186003)(83380400001)(38070700005)(5660300002)(86362001)(38100700002)(2906002)(122000001)(52536014)(8936002)(41300700001)(55016003)(478600001)(966005)(9686003)(71200400001)(26005)(76116006)(6506007)(316002)(66446008)(66476007)(66556008)(66946007)(8676002)(110136005)(64756008)(7696005)(33656002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?TXRCSGNpaEducHUxcVpaTVBvTHZZRFdYZWUyRGMzbVVQSDM3OUF0N3lN?= =?iso-2022-jp?B?RXc0eEE0dDBrNWFoZHVhYUs5aS9LcFZPb25EQ1NvYXQ4MVZoQjRycFBj?= =?iso-2022-jp?B?dWs4dFJoMTRGSU1zNHhRTFdYYU4xMGRRNzlmbi9LUE9ucURSTzRpSFJ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Ny92UWNVMDRmTXFwc0JFaU40UUh1OHZX?= =?iso-2022-jp?B?Q2dScHZtdUI4QVdIOWRHRWM4Y1pIeFAwU2VZZjVRS25rZHBXWUtwOUh6?= =?iso-2022-jp?B?MHhlYisvU0QvUU9hK2RxdlR3elEyR040TDd4bGlFeGtaTWxjdkdUeUlv?= =?iso-2022-jp?B?TGp3aElvU2NkS0hBNGVsLzkzMU1KR3JpWnNrY1J6N1BHZEJTckpGcXBQ?= =?iso-2022-jp?B?cXh3NEhrd1VSNEhSNitxNXYzVDBmUVowT3ZpVUZ1S1loRzZLd09ISCtB?= =?iso-2022-jp?B?d1UzeHFaYmxJOGJGRDVTTmFMM0dEZGZYcWVudGg3OE5NcGNKWEd6RlR3?= =?iso-2022-jp?B?MklHZlRHVGdTY1B1Z2xnNDU3eG5wUlNaMVE9PQ==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYAPR01MB6201.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90ed0f6b-9488-4212-51d5-08dab5780e06 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2022 04:27:26.1876 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f109924e-fb71-4ba0-b2cc-65dcdf6fbe4f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: JnfWscJOlF4eUp1tyPRvNk/G9b3TdvwbtHIdtsHonVf6yCondHKWeMSf40HFCVht2cLLA4vafrgPctwzyg2OUZyv7/nr6l4QwTmfNC5xSgM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB5992 X-OriginatorOrg: toshiba.co.jp MSSCP.TransferMailToMossAgent: 103 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 Hi, I'm porting a V4L2 capture driver from 4.19.y to 5.10.y [1]. When I test the ported driver, I sometimes find a corruption on a captured image. Because the corruption is exactly aligned with cacheline, I started investigation from map/unmap of DMA-BUF. The capture driver uses DMA-BUF for videobuf2. The capture hardware does not have HW-mantained cache coherency with CPU, that is, explicit map/unmap is essential on QBUF/DQBUF. After some hours of struggle, I found a patch removing cache synchronizations on QBUF/DQBUF. https://patchwork.kernel.org/project/linux-media/patch/20190124095156.21898-1-paul.kocialkowski@bootlin.com/ When I removed this patch from my 5.10.y working-tree, the driver yielded images without any defects. *************** Sorry for a mention to a patch released 4 years ago. The patch removes map/unmap on QBUF/DQBUF to improve the performance of V4L2 decoder device, by reusing previously decoded frames. However, there seems no cares nor compensations for modifying lifecycle of DMA-BUF, especially on video capture devices. Would you tell me some idea on this patch: * Do well-implemented capture drivers work well even if this patch is applied? * How should a video capture driver call V4L2/videobuf2 APIs, especially when the hardware does not support cache coherency? *************** [1] FYI: the capture driver is not on mainline yet; the candidate is, https://lore.kernel.org/all/20220810132822.32534-1-yuji2.ishikawa@toshiba.co.jp/ *************** Sorry for sending the same email message again. I wrongly posted previous one with HTML format. Regards, Yuji Ishikawa