From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE997216A11 for ; Fri, 11 Oct 2024 12:27:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728649677; cv=none; b=V+j4sDYaB1bB3vZss3Pq824VAScpZ6kgRYlaq0e/9nfoqfD9tEdoqSJChAiTJGS3ipsKLC737wqJyK5sXCvFCpxx+0eAHVBPO0OX0zB1CxSk9d8QPnRq6ca1HE9+JSAKyFrb7SQQsmLRCajhAuyYmpWadP5WN9zVzghGTasWANE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728649677; c=relaxed/simple; bh=ULnSG4geb8Txl5Cj3WsAJjHU3fohxOMG1UD3Gjc1u5Y=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=fM0LkuhYRNBO/RZAQggbKHk7WZMXVBd/y49QxETsbHlJgGXkgvhvZ9RqbpLlNsPOz6q0mFSeIwAQOAo3iyt8gTh+rB9/0yybmbmyhz9K36OF76speTaMF6sHKa+RE6+NADTsrfLTyJ/HYM7NN2GQ2rCbLAWftVUI7vNJG663gmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=fp6KMWPa; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fp6KMWPa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728649674; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OvgPP8URR3aRLLAeRhIGd9GfEadFvbPu0wTLuyU+TtY=; b=fp6KMWPanTJLYlJUNx65p4DGmVtecsomSgEDF+ivbF5NeUvydKp19dLwtIwo5u/Nm3zxwa dMp9UrbMIwsOSTdEmDlpuTZGYmSYW1USKh7euU4hgrSbbtYFodJ/uINX8yvZAvbJM+jmPY qHkBYqHfCs0YDCWQbLODd5x4w5aam/0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-379-7WgkkUHXOjmH1g_Fledj4w-1; Fri, 11 Oct 2024 08:27:53 -0400 X-MC-Unique: 7WgkkUHXOjmH1g_Fledj4w-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-43111c47d0bso9790915e9.2 for ; Fri, 11 Oct 2024 05:27:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728649672; x=1729254472; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=OvgPP8URR3aRLLAeRhIGd9GfEadFvbPu0wTLuyU+TtY=; b=Xqrkro8pHJuGhZ+AoDnJMl0so4PMNP1+aLIaJpxBCtU7paQZyuVU38/WCvXUxYNLvQ 8VcLpqenZLSfDhPvxtwgAO8K/jnROtqThB4MXqi5At+tEhTYxTFvXJCovpXvZdOWSzKN 8DpSpGKzoqoyixSonzMsUlYN3aNGdiZ/0o/eHfnQMh5LfcWCb9PADI36xnAynOOHg5IG wUUd82qlUxPeV6pWygnKXcoLuyVE5NhCC4i8oqP5DAFNjxEAwn+68dOYYOvkM0HrinRT GmZPwwHmtYOr5Q/W1eyqie0My7w2JcRRaMYBUy7wlD8uZP+PjieXuw8GvXkbUN0YNK7S 0Gzg== X-Forwarded-Encrypted: i=1; AJvYcCV9oD4TVi85bbY4u8YWSILigl2IFxrU4uYEU5wzVhkcogfT/JuvqUx/am9k36dvhUC58fkbDWodgy1kQw==@vger.kernel.org X-Gm-Message-State: AOJu0YxqG3HN/Rjl4cbu1jbE1Fn6XsRjLxJBAhp8AmVSdWp99DF5Jw8F +BYKV0xXNMmJydNqDn+nN9vRGwfXAEnvndualt/Q+DRPMSVQZecUudDnV3URyH6Lf4V0a8GiJoP D/+fRWtk6MipwG4yiJyZiBmZrMTTpLzv4Z24thcpfc3LmrnupjgsIWAHUSoZ/ X-Received: by 2002:a05:600c:1f8c:b0:430:c3a5:652a with SMTP id 5b1f17b1804b1-4311ded53cbmr16268215e9.12.1728649672185; Fri, 11 Oct 2024 05:27:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgVv3RNAOR2FC6mKD8YlkQf/6eOtik4XN5FWpHDbbO6uoNEPOtTgURod1/yDncIWXirvGTnQ== X-Received: by 2002:a05:600c:1f8c:b0:430:c3a5:652a with SMTP id 5b1f17b1804b1-4311ded53cbmr16267425e9.12.1728649671758; Fri, 11 Oct 2024 05:27:51 -0700 (PDT) Received: from eisenberg.fritz.box ([2001:16b8:3d05:4700:3e59:7d70:cabd:144b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4311835d95bsm40843965e9.47.2024.10.11.05.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2024 05:27:51 -0700 (PDT) Message-ID: Subject: Re: [RFC PATCH 02/13] ALSA: hda: hda_intel: Use always-managed version of pcim_intx() From: Philipp Stanner To: Andy Shevchenko Cc: Damien Le Moal , Niklas Cassel , Sergey Shtylyov , Basavaraj Natikar , Jiri Kosina , Benjamin Tissoires , Arnd Bergmann , Greg Kroah-Hartman , Alex Dubov , Sudarsana Kalluru , Manish Chopra , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasesh Mody , GR-Linux-NIC-Dev@marvell.com, Igor Mitsyanko , Sergey Matyukevich , Kalle Valo , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Bjorn Helgaas , Alex Williamson , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Jaroslav Kysela , Takashi Iwai , Mario Limonciello , Chen Ni , Ricky Wu , Al Viro , Breno Leitao , Kevin Tian , Thomas Gleixner , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= , Mostafa Saleh , Hannes Reinecke , John Garry , Soumya Negi , Jason Gunthorpe , Yi Liu , "Dr. David Alan Gilbert" , Christian Brauner , Ankit Agrawal , Reinette Chatre , Eric Auger , Ye Bin , Marek =?ISO-8859-1?Q?Marczykowski-G=F3recki?= , Pierre-Louis Bossart , Maarten Lankhorst , Kai Vehmanen , Peter Ujfalusi , Rui Salvaterra , Marc Zyngier , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ntb@lists.linux.dev, linux-pci@vger.kernel.org, linux-staging@lists.linux.dev, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, linux-sound@vger.kernel.org Date: Fri, 11 Oct 2024 14:27:48 +0200 In-Reply-To: References: <20241009083519.10088-1-pstanner@redhat.com> <20241009083519.10088-3-pstanner@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-1.fc40) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Thu, 2024-10-10 at 17:46 +0300, Andy Shevchenko wrote: > On Wed, Oct 09, 2024 at 10:35:08AM +0200, Philipp Stanner wrote: > > pci_intx() is a hybrid function which can sometimes be managed > > through > > devres. To remove this hybrid nature from pci_intx(), it is > > necessary to > > port users to either an always-managed or a never-managed version. > >=20 > > hda_intel enables its PCI-Device with pcim_enable_device(). Thus, > > it needs > > the always-managed version. > >=20 > > Replace pci_intx() with pcim_intx(). >=20 > ... >=20 > > =C2=A0 bus->irq =3D chip->pci->irq; > > =C2=A0 chip->card->sync_irq =3D bus->irq; > > - pci_intx(chip->pci, !chip->msi); > > + pcim_intx(chip->pci, !chip->msi); > > =C2=A0 return 0; >=20 > I believe each driver needs an individual approach. Looking at the > above > I would first to understand why this one is being used and why we > can't > switch to pci{m}_alloc_irq_vectors(). (Yeah, managed > pci_alloc_irq_vectors() > is probably still missing, I don't remember if you introduced it or > not. >=20 Alright alright =E2=80=93 we touched it in the other mail briefly, but let = me point out another specific problem: pci_alloc_irq_vectors() *uses* pci_intx(). And pci_intx() can be managed sometimes. See the problem? :( So it's not just that I couldn't port the driver Alex is concerned about, it's also that MSI itself is a user of pci_intx(). So a pcim_alloc_irq_vectors() might end up doing double-devres or God knows what else. Only once pci_intx() is clean one can start thinking about the code in pci/msi/ It's the biggest reason why I want to clean it up as suggested here, and also why the only patch I'm really nervous about is number 8. P.