Re: [PATCH] firmware: arm_sdei: remove unused interfaces

From: Xiongfeng Wang
Date: Mon May 04 2020 - 22:08:26 EST


Hi James,

On 2020/5/5 1:14, James Morse wrote:
> Hi Christoph,
>
> (CC: +Xiongfeng)
>
> Thanks for the reminder - I was just searching for who was using this.

Thanks for CC me. We do have a driver that are using it.

>
> On 04/05/2020 17:42, Christoph Hellwig wrote:
>> The export symbols to register/unregister and enable/disable events
>> aren't ever used outside of arm_sdei.c, so mark them static.
>
> Xiongfeng, you have drivers using this, could they be posted upstream. Or can we stop
> exporting these?

It's the SDEI Wathchdog which is used for hardlockup detection. But I wasn't
able to push it upstream because we have Pseudo-NMI in mainline.

>
>
> (they were originally added for the GHES RAS thing, but by the time it was all merged
> upstream, it wasn't possible to build it as a module)

The SDEI Watchdog driver also can't be built as a module. We still need to
modify the origin kernel. So I think this patch doesn't affect me. Thanks for CC me.

Thanks,
Xiongfeng

>
> Thanks,
>
> James
>
>
>> diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
>> index 334c8be0c11fb..bdd6461647d74 100644
>> --- a/drivers/firmware/arm_sdei.c
>> +++ b/drivers/firmware/arm_sdei.c
>> @@ -400,7 +400,7 @@ static void _local_event_enable(void *data)
>> sdei_cross_call_return(arg, err);
>> }
>>
>> -int sdei_event_enable(u32 event_num)
>> +static int sdei_event_enable(u32 event_num)
>> {
>> int err = -EINVAL;
>> struct sdei_event *event;
>> @@ -429,7 +429,6 @@ int sdei_event_enable(u32 event_num)
>>
>> return err;
>> }
>> -EXPORT_SYMBOL(sdei_event_enable);
>>
>> static int sdei_api_event_disable(u32 event_num)
>> {
>> @@ -447,7 +446,7 @@ static void _ipi_event_disable(void *data)
>> sdei_cross_call_return(arg, err);
>> }
>>
>> -int sdei_event_disable(u32 event_num)
>> +static int sdei_event_disable(u32 event_num)
>> {
>> int err = -EINVAL;
>> struct sdei_event *event;
>> @@ -471,7 +470,6 @@ int sdei_event_disable(u32 event_num)
>>
>> return err;
>> }
>> -EXPORT_SYMBOL(sdei_event_disable);
>>
>> static int sdei_api_event_unregister(u32 event_num)
>> {
>> @@ -502,7 +500,7 @@ static int _sdei_event_unregister(struct sdei_event *event)
>> return sdei_do_cross_call(_local_event_unregister, event);
>> }
>>
>> -int sdei_event_unregister(u32 event_num)
>> +static int sdei_event_unregister(u32 event_num)
>> {
>> int err;
>> struct sdei_event *event;
>> @@ -533,7 +531,6 @@ int sdei_event_unregister(u32 event_num)
>>
>> return err;
>> }
>> -EXPORT_SYMBOL(sdei_event_unregister);
>>
>> /*
>> * unregister events, but don't destroy them as they are re-registered by
>> @@ -603,7 +600,8 @@ static int _sdei_event_register(struct sdei_event *event)
>> return err;
>> }
>>
>> -int sdei_event_register(u32 event_num, sdei_event_callback *cb, void *arg)
>> +static int sdei_event_register(u32 event_num, sdei_event_callback *cb,
>> + void *arg)
>> {
>> int err;
>> struct sdei_event *event;
>> @@ -643,7 +641,6 @@ int sdei_event_register(u32 event_num, sdei_event_callback *cb, void *arg)
>>
>> return err;
>> }
>> -EXPORT_SYMBOL(sdei_event_register);
>>
>> static int sdei_reregister_event_llocked(struct sdei_event *event)
>> {
>> diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h
>> index 0a241c5c911d8..5f9fb1d95d515 100644
>> --- a/include/linux/arm_sdei.h
>> +++ b/include/linux/arm_sdei.h
>> @@ -22,21 +22,6 @@
>> */
>> typedef int (sdei_event_callback)(u32 event, struct pt_regs *regs, void *arg);
>>
>> -/*
>> - * Register your callback to claim an event. The event must be described
>> - * by firmware.
>> - */
>> -int sdei_event_register(u32 event_num, sdei_event_callback *cb, void *arg);
>> -
>> -/*
>> - * Calls to sdei_event_unregister() may return EINPROGRESS. Keep calling
>> - * it until it succeeds.
>> - */
>> -int sdei_event_unregister(u32 event_num);
>> -
>> -int sdei_event_enable(u32 event_num);
>> -int sdei_event_disable(u32 event_num);
>> -
>> /* GHES register/unregister helpers */
>> int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb,
>> sdei_event_callback *critical_cb);
>>
>
>
> .
>