X86 platform drivers
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Arnd Bergmann" <arnd@kernel.org>,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH v3 19/19] platform/x86: x86-android-tablets: Stop using EPROBE_DEFER
Date: Sat, 20 Sep 2025 13:35:05 +0200	[thread overview]
Message-ID: <8b00f4a1-82b0-4680-b3ea-a3a938e53e46@kernel.org> (raw)
In-Reply-To: <CAHp75VeuZGUOhQAey6r7Q_mPOmBG4j_UdWerVp1LZpeyUKmZag@mail.gmail.com>

Hi Andy,

On 20-Sep-25 1:21 PM, Andy Shevchenko wrote:
> On Fri, Sep 19, 2025 at 11:48 PM Hans de Goede <hansg@kernel.org> wrote:
>>
>> Since the x86-android-tablets code uses platform_create_bundle() it cannot
>> use EPROBE_DEFER and the driver-core will translate EPROBE_DEFER to ENXIO.
>>
>> Stop using EPROBE_DEFER instead log an error and return ENODEV, or for non
>> fatal cases log a warning and return 0.
> 
> 
> ...
> 
> 
>>         struct pci_dev *pdev;
>>
>>         pdev = pci_get_domain_bus_and_slot(0, 0, info->ctrl.pci.devfn);
>> -       if (!pdev)
>> -               return ERR_PTR(-EPROBE_DEFER);
>> +       if (!pdev) {
>> +               pr_err("error could not get PCI serdev at devfn 0x%02x\n", info->ctrl.pci.devfn);
> 
> TBH, I think this is unlikely to happen. If we have a PCI device, I
> hardly can imagine that we can't get it, yet it may be not enumerated,
> but the pdev seems to me won't ever be NULL. Am I mistaken?

I agree that this should never happen, but IMHO we should still check for it,
we cannot just assume that the device will be there.

This is like many other error checks in the kernel where without fault injection
the error will more or less never happen. Still we always add error checks to
be robust.

Regards,

Hans



> 
>> +               return ERR_PTR(-ENODEV);
>> +       }
>>
>>         /* This puts our reference on pdev and returns a ref on the ctrl */
>>         return get_serdev_controller_from_parent(&pdev->dev, 0, info->ctrl_devname);
> 
> ...
> 
>>         /* Reprobe the SDIO controller to enumerate the now enabled Wifi module */
>>         pdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0x11, 0));
>> -       if (!pdev)
>> -               return -EPROBE_DEFER;
>> +       if (!pdev) {
>> +               pr_warn("Could not get PCI SDIO at devfn 0x%02x\n", PCI_DEVFN(0x11, 0));
>> +               return 0;
>> +       }
> 
> Ditto here.
> 


  reply	other threads:[~2025-09-20 11:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 20:47 [PATCH v3 00/19] x86-android-tablets: convert to use GPIO references + Acer A1-840 support Hans de Goede
2025-09-19 20:47 ` [PATCH v3 01/19] platform/x86: x86-android-tablets: convert Goodix devices to GPIO references Hans de Goede
2025-09-19 20:47 ` [PATCH v3 02/19] platform/x86: x86-android-tablets: convert Wacom " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 03/19] platform/x86: x86-android-tablets: convert HiDeep " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 04/19] platform/x86: x86-android-tablets: convert Novatek " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 05/19] platform/x86: x86-android-tablets: convert EDT " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 06/19] platform/x86: x86-android-tablets: convert int3496 " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 07/19] platform/x86: x86-android-tablets: convert wm1502 " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 08/19] platform/x86: x86-android-tablets: convert HID-I2C " Hans de Goede
2025-09-19 20:47 ` [PATCH v3 09/19] platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger " Hans de Goede
2025-09-20 11:05   ` Andy Shevchenko
2025-09-20 12:57     ` Hans de Goede
2025-09-19 20:47 ` [PATCH v3 10/19] platform/x86: x86-android-tablets: remove support for GPIO lookup tables Hans de Goede
2025-09-19 20:47 ` [PATCH v3 11/19] platform/x86: x86-android-tablets: convert gpio_keys devices to GPIO references Hans de Goede
2025-09-19 20:47 ` [PATCH v3 12/19] platform/x86: x86-android-tablets: replace bat_swnode with swnode_group Hans de Goede
2025-09-19 21:08   ` Dmitry Torokhov
2025-09-20 11:09   ` Andy Shevchenko
2025-09-20 12:45     ` Hans de Goede
2025-09-19 20:47 ` [PATCH v3 13/19] platform/x86: x86-android-tablets: use swnode_group instead of manual registering Hans de Goede
2025-09-19 21:09   ` Dmitry Torokhov
2025-09-19 20:47 ` [PATCH v3 14/19] platform/x86: x86-android-tablets: Update my email address Hans de Goede
2025-09-19 20:47 ` [PATCH v3 15/19] platform/x86: x86-android-tablets: Move Acer info to its own file Hans de Goede
2025-09-19 21:10   ` Dmitry Torokhov
2025-09-19 20:47 ` [PATCH v3 16/19] platform/x86: x86-android-tablets: Add support for Acer A1-840 tablet Hans de Goede
2025-09-19 20:47 ` [PATCH v3 17/19] platform/x86: x86-android-tablets: Simplify lenovo_yoga_tab2_830_1050_exit() Hans de Goede
2025-09-19 21:12   ` Dmitry Torokhov
2025-09-19 20:47 ` [PATCH v3 18/19] platform/x86: x86-android-tablets: Fix modules lists for Lenovo devices Hans de Goede
2025-09-19 20:47 ` [PATCH v3 19/19] platform/x86: x86-android-tablets: Stop using EPROBE_DEFER Hans de Goede
2025-09-19 21:20   ` Dmitry Torokhov
2025-09-20 11:21   ` Andy Shevchenko
2025-09-20 11:35     ` Hans de Goede [this message]
2025-09-20 11:22 ` [PATCH v3 00/19] x86-android-tablets: convert to use GPIO references + Acer A1-840 support Andy Shevchenko
2025-09-20 12:45   ` Hans de Goede

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=8b00f4a1-82b0-4680-b3ea-a3a938e53e46@kernel.org \
    --to=hansg@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=arnd@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox