Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2356666pxb; Fri, 5 Feb 2021 16:14:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3RHy2GVWKtAUOa/ZpWS87PvlEk3iqiTODMcobROxMek+45RZvRSLwgS8ZP5zxoQTORFW8 X-Received: by 2002:a17:907:35d1:: with SMTP id ap17mr6673161ejc.79.1612570495575; Fri, 05 Feb 2021 16:14:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612570495; cv=none; d=google.com; s=arc-20160816; b=Fw6URNspfIYL3wak1nVMiH5dT/TxO3oxano77l66aDN5RosM+Z/dwQaxx/LoJ9ytAs U+09tCYKw6bsFmZorGO6ryH8HX+LGFRrge58+6csYzEMpAEz7eS1ToGk5nO1iQPEIk7S aCoqKu7DL37sT82khjmeQZSKw8HNpPuH0y70IJUwJM/Dej3I8szXsXyAw+XYhS6GGhli Dsfp4Hlbvvj4y1rqceJojLHWMiDr/ylai1omYZ+5q2rOHzQ2hZ2RjiC52jDNY3UGU5iz ULCFZcaJWSyfxtmcuoWhGNR4cRkAxLV3R+5dvtuIkF64QWphpVpjujoqM6pG/P/BkHXr NdbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=NmxWw8NPcXU+FGhKNf7kO3v50FeuQc/xeiCZjjTPS3E=; b=i+nX4eczLRkHVNVu1WXmyMedePPqSehynxN+cYh5xLH9aOVpJbkXMcLhSrx3n1TL/z WkXyo/eQ5nsAft2O+Xh1dMJ+5ggoAx1VCDZCSORLj8I0tZScSyKfTkbkNPT9zGtsH0LS 58yIu8wFB5ai0LUEHXqLfThdTL/xWBfhd0YD5gcz/+XwREjIqTRfhxtF0XS9KlIbB0GY A7alw9pjttIFkUJaipZ6DUjVjM8/3ad2gralNliaMUkovPkljWACrI1/vdJv6lFCJGrM /Dzxi5et1cLCmdWTbtrIfd6sztL2V+mPI/INbovW7WWwHu3o8kN6QVwYyV98F06DjI8J Lxag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx15si5995369ejb.27.2021.02.05.16.14.31; Fri, 05 Feb 2021 16:14:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbhBFAN7 (ORCPT + 99 others); Fri, 5 Feb 2021 19:13:59 -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