Re: hid-playstation race conditions during probe failures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Never mind, it was my own fault. Was essentially returning a positive
errno value (bug in new code) and hadn't realized probe had actually
succeeded due to that instead of failed.

Thanks,
Roderick

On Tue, Sep 27, 2022 at 9:53 PM Roderick Colenbrander
<thunderbird2k@xxxxxxxxx> wrote:
>
> Hi Benjamin and Jiri,
>
> I'm doing some work around hid-playstation and as part of that I
> stumbled on some kernel oopses, which I at first couldn't explain. I
> believe I understand the problem now, but I don't know what the best
> fix is and if it is completely my driver.
>
> The basic summary is that hid-playstation relies on associating custom
> data with the device using hid_set_drvdata during probe (in
> dualsense_create to be exact). When a probe call fails (one of the sub
> paths of dualsense_create), there is currently an undefined pointer
> associated with the hid_device.
>
> What seems to happen is that raw_event (ps_raw_event) still gets
> called while in this undefined state. I don't fully understand this
> well, but it is because the driver has to perform some get feature
> requests and had to open the device.
>
> Is my understanding so far correct? If it is, my driver has a race
> condition. The ultimate issue is raw_event, would it need to do
> something special (e.g. looking at some flags). I can also delay
> calling 'hid_set_drvdata' closer to successful setup (a little hacky
> perhaps). Or is the issue and fix something else?
>
> Thanks,
> Roderick



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux