Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3706577iog; Tue, 28 Jun 2022 00:32:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tswJQADu4ih3+3E1ppwjABlk3+7plbIxrHp5/bKOEIgJUK4HKJl6lTQDhmM2HbweCiPeLC X-Received: by 2002:a05:6402:27c6:b0:435:d24a:d061 with SMTP id c6-20020a05640227c600b00435d24ad061mr21606497ede.427.1656401521072; Tue, 28 Jun 2022 00:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656401521; cv=none; d=google.com; s=arc-20160816; b=isEWI9LyxZQHgM/ytRnJSrY8+sJJvHIGnout2sm/h2z2+wYnf6YKgj2og2Jx9A4rz5 M8UhEouVFc1q4wl7DAGvbGC/ZIAm/im1R6VUR8Ta4+s4ubLr7C2AA1i5PNY9G0HlPg6X KLghoQBUFmLytjnqDDPUD/QMgCl3kThFQvbPrwcaA7MwLakEuxTtIc1+4fqwR1xzzJ4G aJpALcY+yv3fDdSkrMWHHIRdXHxyt5QUQuv+wUB0UhI1+74liJypiu8jp7dj+k46QoaO eHbevgBhsIS2Z6vKW6tE+r+KvI0LQspD1LLI8/DOJfNXfvuFhUCX5MdFuZ5Av5eedgD1 DQxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=3IbietPa9HOFamBlxNc4z3KpiQQx3EaNsyPyExw/TZU=; b=pqLQ9n2ITyPYl6vfK9z2s9kaU48BfniHTjS5YVh9ni7iTpp7mQ4VoQSLffjhRa71f1 2sAsEMVFuQodU+VrY9LzMhzD0Gv+mWeFeXoq3CNKVRhb7YKSHwmRA5HfJfQ02hYa/gEY W6yW3C5RC3qc6sBn2k4z6uZP6++R19Y7gyoNXNdAgDdIx4YxomB+jMF1uw2Ag517BlNr S/IqvQk3KLKi7pZsw+g85CjnICUCDHRi/sgDgMiN4MBs0SWs7+OnVQQrDNGdE6+qRLoL skrnhAEKjKEIjSc4/sLdAi4HCfjYTKYbGufYKiDsyjYplP4+IxLAapKS/i5W9KcywfAy h7mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qC+UQmph; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz13-20020a0564021d4d00b004374b50d656si15319845edb.375.2022.06.28.00.31.35; Tue, 28 Jun 2022 00:32:01 -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=@kernel.org header.s=k20201202 header.b=qC+UQmph; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239605AbiF1HIk (ORCPT + 99 others); Tue, 28 Jun 2022 03:08:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiF1HIf (ORCPT ); Tue, 28 Jun 2022 03:08:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA4A0B4A0; Tue, 28 Jun 2022 00:08:34 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9A4E9B81CD2; Tue, 28 Jun 2022 07:08:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5220EC341D0; Tue, 28 Jun 2022 07:08:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656400112; bh=Dm+i1ahm5JO1Y0z9h4uqTDK4kJt3Abm9W7KKXWn4iRE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qC+UQmphl8Hd+1T1U0QD9tDpqj4RMtyFkgyHY4s5qIB7gRI+xS50dQLQF60N4d53a pt8nrB+n/0dsGBpX9rzm604Cauhg2V1pGMdOs9Z8ftj1edDPVWFevjoguG98IqrTXI ivqLmEwSVJigzb4BvjUY8SyP2jqcLYvPGrfQt0+Lb4o5OGtjK05l74oqdAtZe6v+RV EiZUgKYNvTN+ggir5o2MPXO4/eJKq2WsfCAQvCsHp1NxR2fH/lMZBuGL6JAF9vspsB biRI4WdoUfZ8vhFQRuwocB5PEe84qldt+0c/fmHu+92iK9/LCneqYIva5kjHPnQFrz CH1QITDOJFbvA== Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-318889e6a2cso107031767b3.1; Tue, 28 Jun 2022 00:08:32 -0700 (PDT) X-Gm-Message-State: AJIora8MiVwDMPyfVFDg50UsNzIa8HEXJj852LRFNF2XK4Bl+jtVzBSX IkfkG7HMbEQJR83rL6kkMQu46XNHYTFUCNfeJ4o= X-Received: by 2002:a81:1d43:0:b0:318:638d:2ca with SMTP id d64-20020a811d43000000b00318638d02camr20536106ywd.135.1656400111255; Tue, 28 Jun 2022 00:08:31 -0700 (PDT) MIME-Version: 1.0 References: <20220617125750.728590-1-arnd@kernel.org> <20220617125750.728590-4-arnd@kernel.org> <6ba86afe-bf9f-1aca-7af1-d0d348d75ffc@gmail.com> <9289fd82-285c-035f-5355-4d70ce4f87b0@gmail.com> In-Reply-To: <9289fd82-285c-035f-5355-4d70ce4f87b0@gmail.com> From: Arnd Bergmann Date: Tue, 28 Jun 2022 09:08:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 3/3] arch/*/: remove CONFIG_VIRT_TO_BUS To: Michael Schmitz Cc: Geert Uytterhoeven , scsi , Linux Kernel Mailing List , Arnd Bergmann , Jakub Kicinski , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Linux IOMMU , Khalid Aziz , "Maciej W . Rozycki" , Matt Wang , Miquel van Smoorenburg , Mark Salyzyn , linuxppc-dev , Linux-Arch , alpha , linux-m68k , Parisc List , Denis Efremov , Michael Ellerman Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.5 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 On Tue, Jun 28, 2022 at 5:25 AM Michael Schmitz wrote: > Am 28.06.2022 um 09:12 schrieb Michael Schmitz: > > Leaving the bounce buffer handling in place, and taking a few other > liberties - this is what converting the easiest case (a3000 SCSI) might > look like. Any obvious mistakes? The mvme147 driver would be very > similar to handle (after conversion to a platform device). > > The driver allocates bounce buffers using kmalloc if it hits an > unaligned data buffer - can such buffers still even happen these days? > If I understand dma_map_single() correctly, the resulting dma handle > would be equally misaligned? > > To allocate a bounce buffer, would it be OK to use dma_alloc_coherent() > even though AFAIU memory used for DMA buffers generally isn't consistent > on m68k? I think it makes sense to skip the bounce buffering as you do here: the only standardized way we have for integrating that part is to use the swiotlb infrastructure, but as you mentioned earlier that part is probably too resource-heavy here for Amiga. I see two other problems with your patch though: a) you still duplicate the cache handling: the cache_clear()/cache_push() is supposed to already be done by dma_map_single() when the device is not cache-coherent. b) The bounce buffer is never mapped here, instead you have the virt_to_phys() here, which is not the same. I think you need to map the pointer that actually gets passed down to the device after deciding to use a bouce buffer or not. Arnd