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 X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C21BC433E0 for ; Sat, 6 Feb 2021 00:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA7E765013 for ; Sat, 6 Feb 2021 00:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbhBFAOF (ORCPT ); Fri, 5 Feb 2021 19:14:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:40868 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232257AbhBENDx (ORCPT ); Fri, 5 Feb 2021 08:03:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6C6E7ACBA; Fri, 5 Feb 2021 13:03:03 +0000 (UTC) Date: Fri, 05 Feb 2021 14:03:03 +0100 Message-ID: From: Takashi Iwai To: Andrew Lunn Cc: Hans Verkuil , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, "Matwey V. Kornilov" , Robert Foss Subject: Re: [PATCH] media: pwc: Fix the URB buffer allocation In-Reply-To: References: <20210121202855.17400-1-tiwai@suse.de> <7afd0612-de36-60b1-6650-6f8de24a7145@xs4all.nl> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 05 Feb 2021 13:53:21 +0100, Andrew Lunn wrote: > > On Fri, Feb 05, 2021 at 01:36:43PM +0100, Hans Verkuil wrote: > > Hi Takashi, > > > > Thank you for this patch, but it clashes with another patch trying to do the same thing > > that has already been merged in our tree: > > > > https://patchwork.linuxtv.org/project/linux-media/patch/20210104170007.20625-1-matwey@sai.msu.ru/ > > > > I do prefer your patch over the one already merged since it is a bit simpler, but > > shouldn't the calls to dma_sync_single_for_cpu() and dma_sync_single_for_device() > > in pwc-if.c also use urb->dev->bus->controller? > > > > Also, Matwey's patch uses urb->dev->bus->sysdev instead of urb->dev->bus->controller. > > How does 'sysdev' relate to 'controller'? I think 'controller' is the right device to > > use, but either seems to work when I test it with my pwc webcam. > > Hi Hans > > A quick grep in driver/usb show that all but one dma mapping operation > use sysdev. The one other case uses controller. So the numbers suggest > controller is wrong, sysdev is correct. Indeed, looks so. In most cases, this doesn't matter since both point to the same device object. In some cases like xhci-plat HCD, they differ. And sysdev might be a better choice from the consistency POV. But this brought an interesting question, too. eg. USB chipidea HCD uses platform devices for both controller and sysdev, and I couldn't find any DMA mask setup. So, no matter what to use, the uwc driver would be broken on this... Maybe it's just not covered. > But maybe ask GregKH? To be certain, better to involve with USB people, yeah. thanks, Takashi