Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5890995imd; Wed, 31 Oct 2018 03:49:51 -0700 (PDT) X-Google-Smtp-Source: AJdET5ch/gsPXpgzZ6whPwJPQImT6K4nZY11wWCYcN9T5D2t9VCpxHs6cftFPC7WYue4eopJeA/i X-Received: by 2002:a63:2e47:: with SMTP id u68-v6mr2654564pgu.294.1540982991450; Wed, 31 Oct 2018 03:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540982991; cv=none; d=google.com; s=arc-20160816; b=h9yYSsUQZVQxgry44MhBmsHfWgQ3Ja6oVzWIPA8oO1jsaaK2kmj0vkbH27UzsvhHoo f6S840gLUvUFp4XnXPRygzBVTZpKkYVeEBbiwnSKYTRmi3Hp2Pd6yKAl2GoCii1GyTkY DVzOKq27KTQqYQgV6/Gxe4QxFTVhQWcMrhBu1WsPXIYiC4CHFh/ec7/cNFJCqQyp/U5d jqKwUEaBc7W5WARbbsB6us88755UlIyzSW9YN42OwCJIb6AYgwoRYOfTtScnrojRKAQR 6g5OUcPZq11ZxNtai951BweTKtRc4VqBDzuEbs8bAqr+jFJy24WXyRolAFrKqgQqGgTb d7gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=GSOaNK6NLt/IHLloPKi0y5YIrMAStylGTNllVQlPBVU=; b=e231jQ3KWGdP5kAY4NIFvLiU7wFd3ovOQ5uTojx3UlUQSC8d0hZVBAxkAFYrwKQLi6 TE+k0VJ2XAj02e/rC7/JArxUN6vPzQhgvXuo7eVuOtYo/iWNT0UCSSmKwwM31piLchhQ DuUurPTl5sQrsK+KzE5q3LzH6oIlVU9AaIJZvPEbgd9VSv813JFSUlrZAGGXvSOSCux8 7zeEp2hIoQDfnWcM9wTU7mgIZXjMCUNOuNKqZesxl+gOV7ylPXxnTgtLYaT/rpWz6K7r wtD3GJkaiQk3NGejiEh1pTS5VAC4sBydegu833B6WHRZMQdHk8o69LLAHFYLuUej7l3y bmAw== ARC-Authentication-Results: i=1; mx.google.com; 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 136-v6si16724166pfz.165.2018.10.31.03.49.35; Wed, 31 Oct 2018 03:49:51 -0700 (PDT) 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; 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 S1728600AbeJaTqu (ORCPT + 99 others); Wed, 31 Oct 2018 15:46:50 -0400 Received: from gofer.mess.org ([88.97.38.141]:37415 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727980AbeJaTqt (ORCPT ); Wed, 31 Oct 2018 15:46:49 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 27609601E4; Wed, 31 Oct 2018 10:49:13 +0000 (GMT) Date: Wed, 31 Oct 2018 10:49:12 +0000 From: Sean Young To: David Howells Cc: Mauro Carvalho Chehab , Michael Krufky , Brad Love , mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] dvb: Allow MAC addresses to be mapped to stable device names with udev Message-ID: <20181031104912.s3tqjl3u43ou3kwo@gofer.mess.org> References: <20181030223249.dhwhxdjipzmjxzsy@gofer.mess.org> <153778383104.14867.1567557014782141706.stgit@warthog.procyon.org.uk> <20181030110319.764f33f0@coco.lan> <8474.1540982182@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8474.1540982182@warthog.procyon.org.uk> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 31, 2018 at 10:36:22AM +0000, David Howells wrote: > Sean Young wrote: > > > > > Devices have a MAC address available, which is printed during boot: > > > > Not all dvb devices have a mac address. > > How do I tell? If it's all zeros it's not there? The mac gets populated through read_mac_address member of dvb_usb_device_properties. If that's not called (or does not succeed), then there is no mac address. I think you can safely assume that if it's all 0's then it was not read. > > Devices without a mac address shouldn't have a mac_dvb sysfs attribute, > > I think. > > I'm not sure that's possible within the core infrastructure. It's a class > attribute set when the class is created; I'm not sure it can be overridden on > a per-device basis. > > Possibly the file could return "" or "none" in this case? That's very ugly. Have a look at, for example, rc-core wakeup filters: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/rc/rc-main.c#n1844 > > The dvb type and dvb adapter no is already present in the device name, > > I'm not sure why this needs duplicating. > > They can be used with ATTR{} in udev rules. I'm not clear that the name can. See my other email. KERNEL=="dvb[0-9]+\.demux\.[0-9]+" > > With this patch, with a usb Hauppauge Nova-T Stick I get: > > ... > > ==> /sys/class/dvb/dvb0.demux0/dvb_mac <== > > 00:00:00:00:00:00 > > I can't say why that happens. I don't have access to this hardware. Should > it have a MAC address there? Is the MAC address getting stored in > dvbdev->adapter->proposed_mac? Maybe it's not getting read - on the card I > use it's read by the cx23885 driver... I think... The nova-t-usb2.c file > doesn't mention proposed_mac. This is a dib0700-type device (much older). Sean