Received: by 10.223.185.111 with SMTP id b44csp30204wrg; Fri, 9 Mar 2018 00:10:22 -0800 (PST) X-Google-Smtp-Source: AG47ELsC2NTwLZZMmAzQS5vVdoGeKle0cDGZ+E7Ci2AkxJXDXCOoCdhb6YZq+uPMBzku1+PXHVAO X-Received: by 2002:a17:902:26a:: with SMTP id 97-v6mr26928131plc.3.1520583022055; Fri, 09 Mar 2018 00:10:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520583022; cv=none; d=google.com; s=arc-20160816; b=rJRWD2jqD9OHIg6zmY8ad9Yp2wcgcTxgCGAAaBDa5ucWrag3MldmTxFU8X5Thbzk9o NGgqqBp44T8qJaYJehkhMJSpHBUgU7ybMbfAxdhs5rN1+k0elGu9XGzcPynWpyLgllVW xj6wQ5JeO/KQCtJiA1Jtfcnu1jAlWzt9XopeRyKQxlzyBeeIm4u00T/Dke4kemN22grV Fs1qmfq0HTUGMlSMZN6RgMnVaINj7X+OQiDDlPf+0N2snSJAFYqYwjFkNLS6D9gQgl2j GYqkSU9wAQ+evg9Eb0mm2QSD1PZfbVdwfViPi+3fDOd6dHRG5G/drHaLC3gi087/qTtz aspw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=ZlTiPlPrfWZo7ZTNUcKp9VuzhQRJ4EnTlmTQZaxP4b0=; b=yJnDWvymhMNGzFtuKKJIrDjd39h5gqUEfY9HCUkb5ZogNP6ySABY5h93kJJIywPlcy ig5qzLbIcnHndDirKnBusLgqDMeGiZqOGveAjuVuI/ElVSZeB1YG+QEyMniZLuIcNlwk DDMWD97cKZYJ7knZRfPfagZ12Jo+kensBAzRZn28x5bfanuO4lnr8HVG7PT2r/5JdqAN UU/xECBWxnS1Xl1Hjta4DuTkiT1PCGXqEHpwpOAzJpIWz+NfhKWF6b2JT1sL+YUEWgge K9mxfNL8ptu94rWbyWRlwvR3B0oFMZArvoHEt3T1rxVEimelTNMwB7moDVMiLOGB7TvU pf1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZJ1frFKg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si345529pgt.680.2018.03.09.00.10.07; Fri, 09 Mar 2018 00:10:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZJ1frFKg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751696AbeCIIJP (ORCPT + 99 others); Fri, 9 Mar 2018 03:09:15 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:42948 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750913AbeCIIJL (ORCPT ); Fri, 9 Mar 2018 03:09:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZlTiPlPrfWZo7ZTNUcKp9VuzhQRJ4EnTlmTQZaxP4b0=; b=ZJ1frFKg1wjUw0ry95uAdsGet WiOK58EBphpEyzDvpNo/eJwsTah7nzDdb2saKokCNSCsdbvdaJJVx/+MplyiZfSXgbJuXUhI8y0MY YO391LA3qB2W0uqtNyfevYsMABuxyasFiKPlcY/+IN07VfnVvqH+lHAtfo7GnUu+nBz0gOe0W8+pq B6q/Ry2Q8pYj2bNL5DCKc1O4x/t6uj84bEbnfOGKRphJkwedYWu53GdLlvldIG3djZV3E8fQBDzeq ZEMwQU0bd9OK+1WAkSXKwAWirVKrp2cmcf2cOfm5NNPhE/rSJ1zhQkJbeWbquzorvP4WcQDHXupsY UMkFBAhZg==; Received: from [179.179.39.66] (helo=vento.lan) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1euD5R-0008Nw-MM; Fri, 09 Mar 2018 08:09:10 +0000 Date: Fri, 9 Mar 2018 05:09:05 -0300 From: Mauro Carvalho Chehab To: David Howells Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH] dvb: Save port number and provide sysfs attributes to pass values to udev Message-ID: <20180309050905.3584cae3@vento.lan> In-Reply-To: <537.1520552145@warthog.procyon.org.uk> References: <20180306085530.7b51aa29@vento.lan> <151559583569.13545.12649741692530472663.stgit@warthog.procyon.org.uk> <537.1520552145@warthog.procyon.org.uk> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 08 Mar 2018 23:35:45 +0000 David Howells escreveu: > Mauro Carvalho Chehab wrote: > > > > + dvb_class->dev_groups = dvb_class_groups, > > > dvb_class->dev_uevent = dvb_uevent; > > > dvb_class->devnode = dvb_devnode; > > > return 0; > > > > The patch itself looks good, but I'm not seeing any documentation. > > I should probably add something to Documentation/media/dvb-drivers/udev.rst Makes sense. > > You should likely add something to Documentation/ABI > > Any suggestions as to where to add stuff in there? The README there leaves > a lot to be desired as to how to name elements - for instance, DVB devices can > be seen through /sys/class/ and /sys/devices/. > > I could put it in sys-class-dvb or sys-devices-dvb - or, arguably, both. Good point. I don't have a strong opinion, but, as we're using /sys/class for remote controller's elements[1], I would place DVB stuff there also. [1] Documentation/ABI/testing/sysfs-class-rc > > and to the DVB uAPI (Documentation/media/uapi/dvb). > > Likewise, any suggestion as to where in here? As far as I can tell, the docs > here don't currently mention sysfs at all. I'm guessing I'll need to create a > file specifically to talk about how to use this stuff with udev. Yes. The docs don't mention simply because, right now, there's nothing special on sysfs. > > > + port->frontends.adapter.port_num = port->nr; > > > + > > > > Doing it for each multi-adapter device is something that bothers > > me. The better would be if we could move this to the DVB Kernel, > > in order to not need to check/fix every driver. > > I'm not sure how achievable that is: *port in this case is a private > cx23885-specific structure object. Yes, but other drivers that support multiple frontends store it somewhere. Yet, maybe we could keep this out of the first version. > > If, otherwise, this is not possible, then we need a patch fixing port_num > > for all drivers that support multiple adapters. > > > > Also, the risk of forgetting it seems high. So, perhaps we should > > add a new parameter to some function (like at dvb_register_device > > or at dvb_register_frontend), in order to make the port number > > a mandatory attribute. > > Hmmm... The cx23885 driver doesn't call either of these functions as far as I > can tell - at least, not directly. Maybe by vb2_dvb_register_bus()? Yeah, some hybrid drivers typically use a helper module to handle dvb registration, either at VB or VB2. As this has to be generic enough, if we add, we'll likely need to place the port number at dvb_register_device()/dvb_register_frontend() and then change vb2_dvb_register_bus() accordingly. Hmm... that's said, I guess we can get rid of the VB 1 version, as I'm not seeing any driver calling videobuf_dvb_register_bus() anymore. I'll double check and write a patch to get rid of it, if possible. > > Note that these attribute files appear for the demux, dvr and net directories > as well as for the frontend. > > Hmmm... further, the port number is no longer getting through and all adapters > are showing port 0. Weird. > The MAC address works, though. Maybe I should drop the > port number. Yeah, let's drop it for the first version. It can be added later if needed. Thanks, Mauro