All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Takashi Iwai <tiwai@suse.de>,
	mario.limonciello@dell.com, andy@infradead.org,
	dvhart@infradead.org, mjg59@srcf.ucam.org,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v3 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics
Date: Sat, 14 Apr 2018 12:49:50 +0200	[thread overview]
Message-ID: <20180414104950.ngomyjy5l5cwhb5i@pali> (raw)
In-Reply-To: <20180414104512.GA27158@wunner.de>

[-- Attachment #1: Type: text/plain, Size: 2126 bytes --]

On Saturday 14 April 2018 12:45:12 Lukas Wunner wrote:
> On Thu, Apr 12, 2018 at 10:15:41PM +0800, Kai-Heng Feng wrote:
> > > >>@@ -1711,6 +1745,11 @@ static int azx_create(struct snd_card *card,
> > > >>struct pci_dev *pci,
> > > >> 	if (err < 0)
> > > >> 		return err;
> > > >>
> > > >>+	if (check_dell_switchable_gfx(pci)) {
> > > >>+		pci_disable_device(pci);
> > > 
> > > Now looking at it again... This code disables all ATI and NVIDIA sound
> > > cards available in any Dell System (laptop or AIO) if system says that
> > > SG is enabled, right?
> > > 
> > > It means that also any external ATI or NVIDIA PCI card with audio device
> > > connected to Thunderbolt (e.g. via PCI <--> TB bridge) is always
> > > unconditionally disabled too?
> > 
> > I never thought of this case, thanks for bringing this up.
> > Do you have any suggestion to check if it connects to the system via
> > Thunderbolt?
> 
> Just use pci_is_thunderbolt_attached(), introduced by 8531e283bee6,
> like this:
> 
> if (check_dell_switchable_gfx(pci) && !pci_is_thunderbolt_attached(pci))

And what about PCI-e device attached to ExpressCard slot?

> > >>>+	/* Only need to check for Dell laptops and AIOs */
> > >>>+	if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) ||
> > >>>+	    !(dmi_match(DMI_CHASSIS_TYPE, "10") ||
> > >>>+	      dmi_match(DMI_CHASSIS_TYPE, "13")) ||
> > >>>+	    !(pdev->vendor == PCI_VENDOR_ID_ATI ||
> > >>>+	      pdev->vendor == PCI_VENDOR_ID_NVIDIA))
> > >>>+		return false;
> 
> It sure would be nice if someone could add macros for the chassis type
> to include/linux/dmi.h so that we don't have to use these magic numbers
> everywhere:
> 
> $ git grep -l DMI_CHASSIS_TYPE
> drivers/firmware/dmi-id.c
> drivers/firmware/dmi_scan.c
> drivers/input/keyboard/atkbd.c
> drivers/input/serio/i8042-x86ia64io.h
> drivers/platform/x86/asus-wmi.c
> drivers/platform/x86/dell-laptop.c
> drivers/platform/x86/samsung-laptop.c
> include/linux/mod_devicetable.h
> scripts/mod/file2alias.c
> 
> Thanks,
> 
> Lukas

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: mjg59@srcf.ucam.org, alsa-devel@alsa-project.org,
	mario.limonciello@dell.com, Takashi Iwai <tiwai@suse.de>,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	dvhart@infradead.org, andy@infradead.org
Subject: Re: [PATCH v3 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics
Date: Sat, 14 Apr 2018 12:49:50 +0200	[thread overview]
Message-ID: <20180414104950.ngomyjy5l5cwhb5i@pali> (raw)
In-Reply-To: <20180414104512.GA27158@wunner.de>


[-- Attachment #1.1: Type: text/plain, Size: 2126 bytes --]

On Saturday 14 April 2018 12:45:12 Lukas Wunner wrote:
> On Thu, Apr 12, 2018 at 10:15:41PM +0800, Kai-Heng Feng wrote:
> > > >>@@ -1711,6 +1745,11 @@ static int azx_create(struct snd_card *card,
> > > >>struct pci_dev *pci,
> > > >> 	if (err < 0)
> > > >> 		return err;
> > > >>
> > > >>+	if (check_dell_switchable_gfx(pci)) {
> > > >>+		pci_disable_device(pci);
> > > 
> > > Now looking at it again... This code disables all ATI and NVIDIA sound
> > > cards available in any Dell System (laptop or AIO) if system says that
> > > SG is enabled, right?
> > > 
> > > It means that also any external ATI or NVIDIA PCI card with audio device
> > > connected to Thunderbolt (e.g. via PCI <--> TB bridge) is always
> > > unconditionally disabled too?
> > 
> > I never thought of this case, thanks for bringing this up.
> > Do you have any suggestion to check if it connects to the system via
> > Thunderbolt?
> 
> Just use pci_is_thunderbolt_attached(), introduced by 8531e283bee6,
> like this:
> 
> if (check_dell_switchable_gfx(pci) && !pci_is_thunderbolt_attached(pci))

And what about PCI-e device attached to ExpressCard slot?

> > >>>+	/* Only need to check for Dell laptops and AIOs */
> > >>>+	if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) ||
> > >>>+	    !(dmi_match(DMI_CHASSIS_TYPE, "10") ||
> > >>>+	      dmi_match(DMI_CHASSIS_TYPE, "13")) ||
> > >>>+	    !(pdev->vendor == PCI_VENDOR_ID_ATI ||
> > >>>+	      pdev->vendor == PCI_VENDOR_ID_NVIDIA))
> > >>>+		return false;
> 
> It sure would be nice if someone could add macros for the chassis type
> to include/linux/dmi.h so that we don't have to use these magic numbers
> everywhere:
> 
> $ git grep -l DMI_CHASSIS_TYPE
> drivers/firmware/dmi-id.c
> drivers/firmware/dmi_scan.c
> drivers/input/keyboard/atkbd.c
> drivers/input/serio/i8042-x86ia64io.h
> drivers/platform/x86/asus-wmi.c
> drivers/platform/x86/dell-laptop.c
> drivers/platform/x86/samsung-laptop.c
> include/linux/mod_devicetable.h
> scripts/mod/file2alias.c
> 
> Thanks,
> 
> Lukas

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2018-04-14 10:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 10:42 [PATCH v3 1/3] dell-led: Change dell-led.h to dell-common.h Kai-Heng Feng
2018-04-12 10:42 ` [PATCH v3 2/3] platform/x86: dell-*: Add interface for switchable graphics status query Kai-Heng Feng
2018-04-12 10:42   ` Kai-Heng Feng
2018-04-12 10:42 ` [PATCH v3 3/3] ALSA: hda: Disabled unused audio controller for Dell platforms with Switchable Graphics Kai-Heng Feng
2018-04-12 10:50   ` Takashi Iwai
2018-04-12 10:50     ` Takashi Iwai
2018-04-12 10:59     ` Pali Rohár
2018-04-12 10:59       ` Pali Rohár
2018-04-12 14:15       ` Kai-Heng Feng
2018-04-12 14:15         ` Kai-Heng Feng
2018-04-13 16:08         ` Darren Hart
2018-04-14 10:45         ` Lukas Wunner
2018-04-14 10:45           ` Lukas Wunner
2018-04-14 10:49           ` Pali Rohár [this message]
2018-04-14 10:49             ` Pali Rohár
2018-04-14 11:17             ` Lukas Wunner
2018-04-14 11:17               ` Lukas Wunner
2018-04-15 17:17               ` Pali Rohár
2018-04-15 19:05                 ` Lukas Wunner
2018-04-15 19:05                   ` Lukas Wunner
2018-04-16 14:25                   ` Pali Rohár
2018-04-16 14:25                     ` Pali Rohár
2018-04-17  2:38                     ` Lukas Wunner
2018-04-17  2:38                       ` Lukas Wunner
2018-04-17  7:52                       ` Pali Rohár
2018-04-12 14:12     ` Kai-Heng Feng
2018-04-14 11:25       ` Lukas Wunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180414104950.ngomyjy5l5cwhb5i@pali \
    --to=pali.rohar@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andy@infradead.org \
    --cc=dvhart@infradead.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mario.limonciello@dell.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.