Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp123999lqh; Fri, 3 May 2024 15:53:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/DE6Ap61YhWbbYWtgW1NyyvaZz8igQ+qeSSxWQfpTiiSl9eE6g+XHBS/eAfrjRD5pbSw/qGetgI5Lab/tR/m+0AVK5RLDZJ80YfPQ8A== X-Google-Smtp-Source: AGHT+IEmSbaQda1YnrAvlkGZm19K4PCcmkJGc/1pRdlWc1c55FUskSsAhx090sZFCiEaatGIvu8x X-Received: by 2002:a17:902:db04:b0:1e0:b562:b229 with SMTP id m4-20020a170902db0400b001e0b562b229mr4887353plx.47.1714776822094; Fri, 03 May 2024 15:53:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714776822; cv=pass; d=google.com; s=arc-20160816; b=qA8M0RsWd7cvttT4KZkVhAMzfUk8zB8N74zWcJ41Uj4RwgmB0bBQyEkWragIp+dRiE iCFg8odoecgyer9ZkkqEIqSWFRJYu8iAbOFIcjOfc3YuPOaoFtqxveyI00VMsTnp/Iov XYF9UNvvdt01p72dyRLmr51dLgZqTz6x+qOQgmAjKHWXamdjtfqOLUmVBcEMe3V7I/f9 VhYjU7v9WF3FEOpZJS+4z24J+4U9FCGWNJthn2UE6LkYvrf5shqvNWWrVyQqGi1PfSU8 6sXdnFGLu5d15y7WXY904UFX3Lnhwk4a9zQxfwBwlb6+CjZlAzLHT+/sdYH+vrk6C+X3 CGcw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=8Hq9El8gfCReJAAF44Fc5R9XRxX7ULV+bu85rf6J700=; fh=bq1FULiqm/1U3YYXi4Tma8rZe4F6g4t1Hc/dMmjv+Bs=; b=gqUbASaLw3mDzZF2gkQKDOd5pS+NNPlP0dP+fsPpsi3zvgGxklhnBfbsYisSIGNj+M 9h98hGqP62vh6ad75Zw0j55fJJxmz5x6tYZJuNlDDyJCwPXtIVavXJUD7BfXGZGdabzR DJ9rYyeRNdljn3ODRZ1S5DjELgX7JVPcQLD3Cd28c9EPz5hvLlMpTQ9EwBwWl+aiAZ8v fjgofgQzbPgdVJPDXWunFY18R+7W/9swMfGFCDixkhCVarHir93W8h89d1g4TRQz/DDV H0dLaK6Alu4U4gM687/BhnPTOwpcwDBEGwQ3iqLroiCwBuGxOQC90VJQCsXz/eGD2en9 bvcA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=fintech.ru); spf=pass (google.com: domain of linux-kernel+bounces-168387-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168387-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e9-20020a170902ef4900b001e2a3ff7b93si3824215plx.111.2024.05.03.15.53.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 15:53:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168387-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=fintech.ru); spf=pass (google.com: domain of linux-kernel+bounces-168387-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168387-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F116F28647C for ; Fri, 3 May 2024 22:52:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 339C3839F8; Fri, 3 May 2024 22:52:22 +0000 (UTC) Received: from exchange.fintech.ru (exchange.fintech.ru [195.54.195.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9A3258AB9; Fri, 3 May 2024 22:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.54.195.159 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714776741; cv=none; b=VVwPHq3GOujYL/0Cq+lgcFTwHgGNYOc1r9t6N6/EGeIOe8p/kgjiFkTAxvIJMeHm/sLXGiBEAVKVPFh9Sfok+z0y/1JHKXhErMAKZFjD33ny0QuhOtRhQPkcdF0C3832+UdUB5jxZL3PKRmFxrR/wYJnq4Ko3lkWx+GdJUClS5c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714776741; c=relaxed/simple; bh=+k7smC01PbURrogCBgEc+38Tqvw0xyJMXL4rJUbsaSA=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=iP/WLEJSOxgmOLZGTc166ZjVvUoWquatAVDMAvGJC1GeeFcKJprr9IsZrQyuIIZj03DtsfHpjAIvCrGfhDOpc3tf+t7ddP/U2oVnXy8FRS9hiPlarfraLi8xWJCsc28a+aqvaP/DxUalx5SU2IqfHgJUfoo7fe6y465V3iySLcE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fintech.ru; spf=pass smtp.mailfrom=fintech.ru; arc=none smtp.client-ip=195.54.195.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fintech.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fintech.ru Received: from Ex16-01.fintech.ru (10.0.10.18) by exchange.fintech.ru (195.54.195.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Sat, 4 May 2024 01:52:14 +0300 Received: from [192.168.211.130] (10.0.253.138) by Ex16-01.fintech.ru (10.0.10.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Sat, 4 May 2024 01:52:13 +0300 Message-ID: <73c24dd7-3cd8-4875-a33d-b546a346a24d@fintech.ru> Date: Fri, 3 May 2024 15:52:10 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] media: usb: siano: fix endpoint checks in smsusb_init_device() To: Mauro Carvalho Chehab CC: Hans Verkuil , Dongliang Mu , Andrew Morton , Alan Stern , , , , References: <20240409143634.33230-1-n.zhandarovich@fintech.ru> <20240503165833.4781fb4a@sal.lan> <4069e01b-09d1-49e6-b053-3f6b99dd9405@fintech.ru> <20240503222054.45ed636f@sal.lan> Content-Language: en-US From: Nikita Zhandarovich In-Reply-To: <20240503222054.45ed636f@sal.lan> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-01.fintech.ru (10.0.10.18) Hi On 5/3/24 14:20, Mauro Carvalho Chehab wrote: > Em Fri, 3 May 2024 09:14:37 -0700 > Nikita Zhandarovich escreveu: > >>> Did you test it on what devices? I'm not sure if all siano devices >>> are bulk. Why did you decide to use usb_endpoint_is_bulk_(in|out) >>> instead of usb_endpoint_dir_(in|out)? >> >> I did not have the hardware required to test it properly, I'm afraid. >> I made sure to point that out in the patch description. >> >> As for siano devices possibly having different endpoints type apart from >> bulk, I was relying on the rest of the driver code to determine just >> that (which is maybe somewhat flawed in this case). > > Most digital TV devices also have ISOC endpoints. I'm not sure about > Siano. After a quick glance at Siano driver I am not sure about that being true specifically for Siano devices just yet, but I understand your point nonetheless. > >> Since >> smsusb_submit_urb() (and some other functions like usb_rcvbulkpipe()) >> works exclusively with bulk types, I did not feel the need to even >> expect int types, for instance. > > The problem is not with int endpoints. Most media devices have isoc > endpoints. There are even cases that different device models supported > by the same driver have some bulk and some isoc endpoints. See em28xx > driver for instance: most devices are isoc only; some have both isoc > and bulk; a few have just bulk. > > In the specific case of siano, it supports 3 generations of devices > (sms1000, sms11xx, sms22xx), each with several submodels. > Those 3 generations have different specs, and sms1000 even have one > "boot" USB ID, and one "warm" USB ID, each one with different endpoints. > > That's basically why I'm afraid of a patch like this could cause > regressions if not properly tested, as it is changing the logic > from just detecting the direction to also validate if the endpoint > is not isoc. Thank you for being so thorough with your answer. I think I overestimated how much I should trust current driver implementation. I should be (at least, in this case) looking at what hardware expects of the driver. Let me try to do a little more research into smsxxxx specs and maybe see about getting my hands on some actual devices for testing. > > Regards, > Mauro With regards, Nikita