Re: [PATCH 1/2] HID: intel-ish-hid: fix wrong type conversion

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

 



On Wed, 2019-05-29 at 07:21 +0000, Yang, Hyungwoo wrote:
> > On Tue, 2019-05-28 at 14:36 -0700, Hyungwoo Yang wrote:
> > > "struct device" is embedded in "struct ishtp_cl_device".
> > > so the conversion should be done by container_of() method.
> > 
> > Which tree this patch is going to? You can't even apply on the
> > mainline tree (5.2-rc2). Also you will not be able to compile even
> > if you address the conflict (The patch ordering is wrong). 
> 
> Oh.. I wasn't careful to split the patch after testing. I've
> corrected.
> 
> > 
> > What was symptom or problem you try to address? Is there any crash
> > or bug occurred? Does it happen with the mainline kernel?
> 
> I've added the detail in commit message in v2. Basically due to wrong
> usage of driver_data of ishtp client device, we see kernel crash.
> Currently driver_data is set by bus driver which is wrong since
> driver_data should be owned by corresponding device driver. Right
> now, we see kernel crash during suspend() of cros_ec_ishtp. Yes, it
> happens with the mainline kernel since cros_ec_ishtp is already
> upstreamed.
Technically this driver is not mainline. It will go in 5.3.

The problem is  cros_ec ish driver is overriding driver_data
"
	client_data->ec_dev = ec_dev;
	dev->driver_data = ec_dev;
"
The client drivers own the driver data in its "struct ishtp_cl_device
*" not the struct device *.

As far as I can see the purpose of this is to get device pointer for
debug purpose only.

I think you can remove the dev->driver_data assignment and simply
replace

dev_*(dev,

to
dev_*(ec_dev->dev,

Thanks,
Srinivas

> 
> > 
> > 
> > > 
> > > Change-Id: Idcbafe724e216ee6275f9d1e35a3b79cee5ce88c
> > 
> > This tells me that you are trying to fix some Chrome issue. Don't
> > include these tags for mainline kernel.
> 
> done in v2. Thank you.
> 
> > 
> > Thanks,
> > Srinivas
> 
> Thanks,
> Hyungwoo




[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