lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 24 Jul 2018 17:03:47 +0800
From:   Kai Heng Feng <kai.heng.feng@...onical.com>
To:     Alan Stern <stern@...land.harvard.edu>
Cc:     arnd@...db.de, gregkh@...uxfoundation.org, ulf.hansson@...aro.org,
        bauer.chen@...ltek.com, ricky_wu@...ltek.com,
        linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [PATCH 1/5] misc: rtsx_usb: Use USB remote wakeup signaling for
 card insertion detection


> On Jul 23, 2018, at 10:19 PM, Alan Stern <stern@...land.harvard.edu> wrote:
>
> On Mon, 23 Jul 2018, Kai-Heng Feng wrote:
>
>> Although rtsx_usb doesn't support card removal detection, card insertion
>> will resume rtsx_usb by USB remote wakeup signaling.
>>
>> When rtsx_usb gets resumed, also resumes its child devices,
>> rtsx_usb_sdmmc and rtsx_usb_ms, to notify them there's a card in its
>> slot.
>>
>> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
>> ---
>>  drivers/misc/cardreader/rtsx_usb.c | 13 +++++++++++++
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/drivers/misc/cardreader/rtsx_usb.c  
>> b/drivers/misc/cardreader/rtsx_usb.c
>> index b97903ff1a72..fed83453e5c5 100644
>> --- a/drivers/misc/cardreader/rtsx_usb.c
>> +++ b/drivers/misc/cardreader/rtsx_usb.c
>> @@ -723,8 +723,20 @@ static int rtsx_usb_suspend(struct usb_interface  
>> *intf, pm_message_t message)
>>  	return 0;
>>  }
>>
>> +static int rtsx_usb_resume_child(struct device *dev, void *data)
>> +{
>> +	/* No need to wake up self again */
>> +	if (dev == data)
>> +		return 0;
>
> Is this test actually needed?  device_for_each_child() won't enumerate
> the device it is called for, only that device's children.

Ok, I'll update this part.

>
>> +
>> +	dev_dbg(dev, "%s called\n", __func__);
>
> Not necessary.  People can use ftrace if they want this information.

Sure I'll remove it.
This is to make the change more aligned with the original code. It uses  
similar function on other places too.

Kai-Heng

>
> Alan Stern
>
>> +	pm_request_resume(dev);
>> +	return 0;
>> +}
>> +
>>  static int rtsx_usb_resume(struct usb_interface *intf)
>>  {
>> +	device_for_each_child(&intf->dev, &intf->dev, rtsx_usb_resume_child);
>>  	return 0;
>>  }
>>
>> @@ -734,6 +746,7 @@ static int rtsx_usb_reset_resume(struct  
>> usb_interface *intf)
>>  		(struct rtsx_ucr *)usb_get_intfdata(intf);
>>
>>  	rtsx_usb_reset_chip(ucr);
>> +	device_for_each_child(&intf->dev, &intf->dev, rtsx_usb_resume_child);
>>  	return 0;
>>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ